@nivaro/react 0.3.114 → 0.3.116
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 +1728 -22
- 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 +4909 -4182
- 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 +612 -551
- 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/OverflowRail.js +326 -0
- 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/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/SignalCard.js +84 -77
- 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/list/PhonePager.js +50 -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 +389 -323
- 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 +2050 -1942
- 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/OwnerAvatars.js +9 -9
- 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 +2407 -1950
- package/dist/shared/components/queue/worklist-helpers.js +10 -6
- 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/ui/popover.js +53 -29
- 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/keep-row-focus.js +43 -0
- 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-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/obligation-banner.js +17 -17
- 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/rail-menu-context.js +9 -0
- 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/row-surface.js +7 -0
- 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/table-pins.js +20 -18
- 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 +62 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-below-md.js +29 -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,78 +1,81 @@
|
|
|
1
1
|
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { ChevronDown as
|
|
2
|
+
import { useQuery as O } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronDown as fe, Loader2 as we, AlertTriangle as Ue, X as _e, Check as Ne, Mail as st } from "lucide-react";
|
|
4
4
|
import { useState as Q, useRef as Ce, useEffect as qe } from "react";
|
|
5
|
-
import { useNivaroClient as Oe, useItemEditAuth as
|
|
5
|
+
import { useNivaroClient as Oe, useItemEditAuth as Pe, useDrilldown as it } from "../../context.js";
|
|
6
6
|
import { parseAllowedCollections as at } from "../../lib/allowed-collections.js";
|
|
7
7
|
import { get as $ } from "../../lib/commands.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { pickerOptionsMeta as ot } from "../../lib/live-pickers.js";
|
|
9
|
+
import { useOptionBadges as ct } from "../../lib/picker-badges.js";
|
|
10
|
+
import { compareByMatch as Ie } from "../../lib/picker-rank.js";
|
|
11
|
+
import { useRecordReader as dt } from "../../lib/record-loader.js";
|
|
10
12
|
import { useOnlineUsers as De } from "../../lib/use-online-users.js";
|
|
11
|
-
import { cn as Z, userOptionFilter as
|
|
12
|
-
import { UserAvatar as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
13
|
+
import { cn as Z, userOptionFilter as Me, matchesAllTokens as ut } from "../../lib/utils.js";
|
|
14
|
+
import { UserAvatar as Ee } from "../UserAvatar.js";
|
|
15
|
+
import { RecordPickerBadges as mt, PickerBadgeList as ft } from "./PickerBadges.js";
|
|
16
|
+
import { Command as Je, CommandInput as ze, CommandList as Be, CommandEmpty as Ge, CommandGroup as Le, CommandItem as Fe } from "../ui/command.js";
|
|
17
|
+
import { Popover as Ve, PopoverTrigger as Re, PopoverContent as We } from "../ui/popover.js";
|
|
18
|
+
import { applyDisplayTemplate as pe } from "./helpers.js";
|
|
19
|
+
import { useM2MStaging as Ze } from "./M2MStagingContext.js";
|
|
20
|
+
import { onlyCloseMatches as pt } from "./picker-search.js";
|
|
21
|
+
import { useStaleTip as ht, RelatedItemLabel as ue } from "./RelationCombobox.js";
|
|
22
|
+
function Qe(t) {
|
|
20
23
|
return t.replace(/\(.*$/, "").trim().split(/\s+/).map((l) => l[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
|
|
21
24
|
}
|
|
22
|
-
function
|
|
25
|
+
function ie(t) {
|
|
23
26
|
return at(t == null ? void 0 : t.one_allowed_collections);
|
|
24
27
|
}
|
|
25
|
-
const
|
|
28
|
+
const yt = /^m2a:([A-Za-z_][A-Za-z0-9_]*):(.+)$/;
|
|
26
29
|
function Te(t, l) {
|
|
27
30
|
return `m2a:${t}:${String(l)}`;
|
|
28
31
|
}
|
|
29
|
-
function
|
|
32
|
+
function me(t) {
|
|
30
33
|
if (typeof t != "string") return null;
|
|
31
|
-
const l = t.match(
|
|
34
|
+
const l = t.match(yt);
|
|
32
35
|
return l ? { collection: l[1], id: l[2] } : null;
|
|
33
36
|
}
|
|
34
|
-
function
|
|
37
|
+
function bt(t) {
|
|
35
38
|
if (!t || t.one_collection) return [];
|
|
36
|
-
const l =
|
|
39
|
+
const l = ie(t);
|
|
37
40
|
return l.length < 2 ? [] : l.filter((d) => d !== "directus_users" && d !== "nivaro_users");
|
|
38
41
|
}
|
|
39
|
-
function Xe(t, l, d,
|
|
40
|
-
const
|
|
41
|
-
queryKey: ["m2a-extra-options",
|
|
42
|
+
function Xe(t, l, d, o) {
|
|
43
|
+
const c = bt(l), { data: v } = O({
|
|
44
|
+
queryKey: ["m2a-extra-options", c.join(",")],
|
|
42
45
|
queryFn: async () => {
|
|
43
46
|
const f = [];
|
|
44
|
-
for (const m of
|
|
45
|
-
const [
|
|
46
|
-
t.request($(`/collections/${m}`)).then((
|
|
47
|
-
t.request($(`/items/${m}`, { limit: 500 })).then((
|
|
47
|
+
for (const m of c) {
|
|
48
|
+
const [L, r] = await Promise.all([
|
|
49
|
+
t.request($(`/collections/${m}`)).then((h) => h.data).catch(() => null),
|
|
50
|
+
t.request($(`/items/${m}`, { limit: 500 })).then((h) => h.data ?? []).catch(() => [])
|
|
48
51
|
]);
|
|
49
|
-
for (const
|
|
52
|
+
for (const h of r)
|
|
50
53
|
f.push({
|
|
51
|
-
token: Te(m,
|
|
54
|
+
token: Te(m, h.id),
|
|
52
55
|
collection: m,
|
|
53
|
-
label:
|
|
56
|
+
label: pe((L == null ? void 0 : L.display_template) ?? null, h)
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
59
|
return f;
|
|
57
60
|
},
|
|
58
|
-
enabled:
|
|
61
|
+
enabled: o && c.length > 0,
|
|
59
62
|
staleTime: 6e4
|
|
60
63
|
}), x = d.trim().toLowerCase();
|
|
61
|
-
return (
|
|
64
|
+
return (v ?? []).filter((f) => !x || f.label.toLowerCase().includes(x)).sort((f, m) => f.label.localeCompare(m.label)).slice(0, 25);
|
|
62
65
|
}
|
|
63
66
|
function He({
|
|
64
67
|
options: t,
|
|
65
68
|
isSelected: l,
|
|
66
69
|
onPick: d,
|
|
67
|
-
round:
|
|
70
|
+
round: o
|
|
68
71
|
}) {
|
|
69
|
-
return t.length === 0 ? null : /* @__PURE__ */ n(Le, { heading: "External emails", "data-m2a-extra-options": "", children: t.map((
|
|
70
|
-
const
|
|
72
|
+
return t.length === 0 ? null : /* @__PURE__ */ n(Le, { heading: "External emails", "data-m2a-extra-options": "", children: t.map((c) => {
|
|
73
|
+
const v = l(c.token);
|
|
71
74
|
return /* @__PURE__ */ p(
|
|
72
75
|
Fe,
|
|
73
76
|
{
|
|
74
|
-
value:
|
|
75
|
-
onSelect: () => d(
|
|
77
|
+
value: c.token,
|
|
78
|
+
onSelect: () => d(c.token),
|
|
76
79
|
className: "flex items-center gap-2 text-[12px]",
|
|
77
80
|
children: [
|
|
78
81
|
/* @__PURE__ */ n(
|
|
@@ -80,51 +83,51 @@ function He({
|
|
|
80
83
|
{
|
|
81
84
|
className: Z(
|
|
82
85
|
"flex h-4 w-4 shrink-0 items-center justify-center border transition-colors",
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
o ? "rounded-full" : "rounded",
|
|
87
|
+
v ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
|
|
85
88
|
),
|
|
86
|
-
children:
|
|
89
|
+
children: v && /* @__PURE__ */ n(Ne, { className: "h-2.5 w-2.5 text-white" })
|
|
87
90
|
}
|
|
88
91
|
),
|
|
89
92
|
/* @__PURE__ */ n(st, { className: "h-3.5 w-3.5 shrink-0 text-slate-400", "aria-hidden": !0 }),
|
|
90
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
93
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: c.label })
|
|
91
94
|
]
|
|
92
95
|
},
|
|
93
|
-
|
|
96
|
+
c.token
|
|
94
97
|
);
|
|
95
98
|
}) });
|
|
96
99
|
}
|
|
97
100
|
function Ye(t) {
|
|
98
|
-
return !t || t.one_collection ||
|
|
101
|
+
return !t || t.one_collection || ie(t).length < 2 ? null : t.one_collection_field || "collection";
|
|
99
102
|
}
|
|
100
103
|
function Se(t, l, d) {
|
|
101
104
|
if (!l || !t) return d;
|
|
102
|
-
const
|
|
103
|
-
if (typeof
|
|
104
|
-
const
|
|
105
|
-
return
|
|
105
|
+
const o = t[l];
|
|
106
|
+
if (typeof o != "string" || !o.trim()) return d;
|
|
107
|
+
const c = o.trim();
|
|
108
|
+
return c === "directus_users" || c === "nivaro_users" ? "nivaro_users" : c;
|
|
106
109
|
}
|
|
107
110
|
function je({ collection: t, id: l }) {
|
|
108
|
-
const d = Oe(), { data:
|
|
111
|
+
const d = Oe(), { data: o } = O({
|
|
109
112
|
queryKey: ["col-meta", t],
|
|
110
|
-
queryFn: () => d.request($(`/collections/${t}`)).then((
|
|
113
|
+
queryFn: () => d.request($(`/collections/${t}`)).then((c) => c.data),
|
|
111
114
|
staleTime: 3e5,
|
|
112
115
|
retry: !1
|
|
113
116
|
});
|
|
114
|
-
return /* @__PURE__ */ n("span", { "data-m2a-collection": t, children: /* @__PURE__ */ n(
|
|
117
|
+
return /* @__PURE__ */ n("span", { "data-m2a-collection": t, children: /* @__PURE__ */ n(ue, { collection: t, id: l, displayTemplate: o == null ? void 0 : o.display_template }) });
|
|
115
118
|
}
|
|
116
|
-
function
|
|
117
|
-
return !t || t.one_collection ? 0 :
|
|
119
|
+
function Mt(t) {
|
|
120
|
+
return !t || t.one_collection ? 0 : ie(t).length;
|
|
118
121
|
}
|
|
119
122
|
function et(t) {
|
|
120
123
|
if (!t) return null;
|
|
121
124
|
if (t.one_collection) return t.one_collection;
|
|
122
|
-
const l =
|
|
125
|
+
const l = ie(t);
|
|
123
126
|
return l.length === 0 ? null : l.some((d) => d === "directus_users" || d === "nivaro_users") ? "nivaro_users" : l[0];
|
|
124
127
|
}
|
|
125
|
-
function
|
|
128
|
+
function Et(t) {
|
|
126
129
|
if (!t || t.one_collection) return null;
|
|
127
|
-
const l =
|
|
130
|
+
const l = ie(t);
|
|
128
131
|
if (l.length === 0) return null;
|
|
129
132
|
const d = l.includes("directus_users") ? "directus_users" : l.includes("nivaro_users") ? "nivaro_users" : l[0];
|
|
130
133
|
return { field: t.one_collection_field ?? "collection", value: d };
|
|
@@ -132,109 +135,113 @@ function Kt(t) {
|
|
|
132
135
|
function W(t) {
|
|
133
136
|
return String(t).toLowerCase();
|
|
134
137
|
}
|
|
135
|
-
function
|
|
138
|
+
function Jt({
|
|
136
139
|
relation: t,
|
|
137
140
|
parentId: l,
|
|
138
141
|
allRelations: d,
|
|
139
|
-
extraFilter:
|
|
140
|
-
optionSort:
|
|
141
|
-
requiredParent:
|
|
142
|
+
extraFilter: o,
|
|
143
|
+
optionSort: c,
|
|
144
|
+
requiredParent: v,
|
|
142
145
|
onCountChange: x,
|
|
143
146
|
drilldown: f
|
|
144
147
|
}) {
|
|
145
|
-
const m = Oe(),
|
|
148
|
+
const m = Oe(), L = it(), r = Ze(), [h, A] = Q(!1), [b, F] = Q(""), j = d.find(
|
|
146
149
|
(e) => e.many_collection === t.many_collection && e.many_field === t.junction_field && e.id !== t.id
|
|
147
|
-
), i = et(
|
|
150
|
+
), i = et(j), _ = t.junction_field ?? "", X = t.many_field ?? "", g = t.one_field ?? `${t.many_collection}.${_}`, T = Ye(j), { data: y } = O({
|
|
148
151
|
queryKey: ["col-meta", i],
|
|
149
152
|
queryFn: () => m.request($(`/collections/${i}`)).then((e) => e.data),
|
|
150
153
|
enabled: !!i,
|
|
151
154
|
staleTime: 3e5,
|
|
152
155
|
retry: !1
|
|
153
|
-
}), { data:
|
|
156
|
+
}), { data: ae = [] } = O({
|
|
154
157
|
// An M2A read carries the discriminator: its own key (same prefix, so every
|
|
155
158
|
// ['m2m-items', junction, …] invalidation still refreshes it).
|
|
156
159
|
queryKey: [
|
|
157
160
|
"m2m-items",
|
|
158
161
|
t.many_collection,
|
|
159
|
-
|
|
162
|
+
X,
|
|
160
163
|
l,
|
|
161
|
-
...
|
|
164
|
+
...T ? ["m2a"] : []
|
|
162
165
|
],
|
|
163
166
|
queryFn: () => m.request(
|
|
164
167
|
$(`/items/${t.many_collection}`, {
|
|
165
|
-
filter: JSON.stringify({ [
|
|
168
|
+
filter: JSON.stringify({ [X]: { _eq: l } }),
|
|
166
169
|
limit: 200,
|
|
167
|
-
fields: `id,${
|
|
170
|
+
fields: `id,${_}${T ? `,${T}` : ""}`
|
|
168
171
|
})
|
|
169
172
|
).then((e) => e.data ?? []),
|
|
170
173
|
staleTime: 3e4,
|
|
171
174
|
enabled: !!l && l !== "new"
|
|
172
|
-
}),
|
|
175
|
+
}), H = (e) => Se(e, T, i), ye = Pe().isAdmin, I = i === "nivaro_users" ? Me(ye) : null, be = De(i === "nivaro_users"), Y = o ? I ? { _and: [o, I] } : o : I, ee = Y ? JSON.stringify(Y) : void 0, te = c && !/^-?label$/.test(c) ? c : void 0, xe = (() => {
|
|
173
176
|
const e = y == null ? void 0 : y.display_template;
|
|
174
177
|
if (!e || !e.includes(".")) return null;
|
|
175
|
-
const
|
|
176
|
-
return
|
|
178
|
+
const a = [...e.matchAll(/\{\{([^}]+)\}\}/g)].map((u) => u[1].trim());
|
|
179
|
+
return a.length === 0 ? null : ["id", ...a].join(",");
|
|
177
180
|
})(), {
|
|
178
|
-
options:
|
|
179
|
-
isLoading:
|
|
180
|
-
localSearch:
|
|
181
|
+
options: B,
|
|
182
|
+
isLoading: D,
|
|
183
|
+
localSearch: oe,
|
|
181
184
|
closeMatches: ne
|
|
182
185
|
} = tt({
|
|
183
186
|
client: m,
|
|
184
187
|
relatedCollection: i,
|
|
185
|
-
search:
|
|
186
|
-
filterParam:
|
|
187
|
-
serverSort:
|
|
188
|
-
templateNestedFields:
|
|
189
|
-
enabled:
|
|
190
|
-
labelOf:
|
|
191
|
-
}),
|
|
192
|
-
new Set(
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
return
|
|
196
|
-
},
|
|
188
|
+
search: b,
|
|
189
|
+
filterParam: ee,
|
|
190
|
+
serverSort: te,
|
|
191
|
+
templateNestedFields: xe,
|
|
192
|
+
enabled: h && !!i,
|
|
193
|
+
labelOf: N
|
|
194
|
+
}), ge = rt(!!ne, b), ke = Xe(m, j, b, h), U = (r == null ? void 0 : r.getStagedLinks(g)) ?? [], G = (r == null ? void 0 : r.getStagedUnlinks(g)) ?? /* @__PURE__ */ new Set(), k = ae.filter((e) => !G.has(e.id));
|
|
195
|
+
new Set(k.map((e) => String(e[_])));
|
|
196
|
+
const V = (e) => {
|
|
197
|
+
const a = H(e);
|
|
198
|
+
return a && a !== i ? Te(a, e[_]) : e[_];
|
|
199
|
+
}, q = [
|
|
197
200
|
...new Set(
|
|
198
|
-
|
|
201
|
+
k.filter((e) => H(e) === i).map((e) => String(e[_]))
|
|
199
202
|
)
|
|
200
|
-
],
|
|
201
|
-
queryKey: ["m2m-avail", i,
|
|
203
|
+
], S = JSON.stringify(o ? { _and: [{ id: { _in: q } }, o] } : { id: { _in: q } }), { data: re } = O({
|
|
204
|
+
queryKey: ["m2m-avail", i, q.join(","), ee],
|
|
202
205
|
queryFn: () => m.request(
|
|
203
206
|
$(`/items/${i}`, {
|
|
204
|
-
filter:
|
|
207
|
+
filter: S,
|
|
205
208
|
picker: "1",
|
|
206
209
|
limit: 200,
|
|
207
210
|
fields: "id"
|
|
208
211
|
})
|
|
209
212
|
).then((e) => e.data ?? []),
|
|
210
|
-
enabled: !!i &&
|
|
213
|
+
enabled: !!i && q.length > 0,
|
|
211
214
|
staleTime: 3e4
|
|
212
|
-
}),
|
|
213
|
-
...
|
|
214
|
-
...
|
|
215
|
-
]),
|
|
216
|
-
|
|
215
|
+
}), R = new Set((re ?? []).map((e) => String(e.id))), M = re !== void 0 ? new Set(q.filter((e) => !R.has(e))) : /* @__PURE__ */ new Set(), K = new Set(U.map(W)), P = /* @__PURE__ */ new Set([
|
|
216
|
+
...k.map((e) => W(V(e))),
|
|
217
|
+
...K
|
|
218
|
+
]), le = ct(
|
|
219
|
+
i,
|
|
220
|
+
(B ?? []).map((e) => e.id),
|
|
221
|
+
h && i !== "nivaro_users"
|
|
222
|
+
), E = Ce(x);
|
|
223
|
+
E.current = x, qe(() => {
|
|
217
224
|
var e;
|
|
218
|
-
(e =
|
|
219
|
-
}, [
|
|
220
|
-
function
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
225
|
+
(e = E.current) == null || e.call(E, P.size);
|
|
226
|
+
}, [P.size]);
|
|
227
|
+
function se(e) {
|
|
228
|
+
const a = W(e);
|
|
229
|
+
if (K.has(a)) {
|
|
223
230
|
r == null || r.unstageLink(g, e);
|
|
224
231
|
return;
|
|
225
232
|
}
|
|
226
|
-
const u =
|
|
233
|
+
const u = ae.find((C) => W(V(C)) === a);
|
|
227
234
|
if (u) {
|
|
228
|
-
|
|
235
|
+
G.has(u.id) ? r == null || r.unstageUnlink(g, u.id) : r == null || r.stageUnlink(g, u.id);
|
|
229
236
|
return;
|
|
230
237
|
}
|
|
231
238
|
r == null || r.stageLink(g, e);
|
|
232
239
|
}
|
|
233
|
-
function
|
|
234
|
-
const
|
|
235
|
-
return
|
|
240
|
+
function N(e) {
|
|
241
|
+
const a = (y == null ? void 0 : y.display_template) ?? null;
|
|
242
|
+
return a ? pe(a, e) : String(e._display ?? e.id ?? "");
|
|
236
243
|
}
|
|
237
|
-
return
|
|
244
|
+
return v ? /* @__PURE__ */ p(
|
|
238
245
|
"button",
|
|
239
246
|
{
|
|
240
247
|
type: "button",
|
|
@@ -243,35 +250,35 @@ function jt({
|
|
|
243
250
|
children: [
|
|
244
251
|
/* @__PURE__ */ p("span", { className: "truncate", children: [
|
|
245
252
|
"Select ",
|
|
246
|
-
|
|
253
|
+
v,
|
|
247
254
|
" first"
|
|
248
255
|
] }),
|
|
249
|
-
/* @__PURE__ */ n(
|
|
256
|
+
/* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
250
257
|
]
|
|
251
258
|
}
|
|
252
259
|
) : /* @__PURE__ */ n("div", { children: /* @__PURE__ */ p(
|
|
253
|
-
|
|
260
|
+
Ve,
|
|
254
261
|
{
|
|
255
|
-
open:
|
|
262
|
+
open: h,
|
|
256
263
|
onOpenChange: (e) => {
|
|
257
|
-
|
|
264
|
+
A(e), e || F("");
|
|
258
265
|
},
|
|
259
266
|
children: [
|
|
260
|
-
/* @__PURE__ */ n(
|
|
267
|
+
/* @__PURE__ */ n(Re, { asChild: !0, children: /* @__PURE__ */ p(
|
|
261
268
|
"div",
|
|
262
269
|
{
|
|
263
270
|
role: "button",
|
|
264
271
|
tabIndex: 0,
|
|
265
272
|
onKeyDown: (e) => {
|
|
266
|
-
if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (
|
|
273
|
+
if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (h || b !== "" || e.key !== " ")) {
|
|
267
274
|
e.preventDefault();
|
|
268
275
|
const u = e.key;
|
|
269
|
-
|
|
270
|
-
} else (e.key === "Enter" || e.key === " " || !
|
|
276
|
+
F((C) => u === " " && (C === "" || C.endsWith(" ")) ? C : C + u), h || A(!0);
|
|
277
|
+
} else (e.key === "Enter" || e.key === " " || !h && e.key === "ArrowDown") && (e.preventDefault(), A((u) => !u));
|
|
271
278
|
},
|
|
272
279
|
className: "flex min-h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-1 text-sm text-left font-normal hover:bg-muted",
|
|
273
280
|
children: [
|
|
274
|
-
|
|
281
|
+
P.size > 0 ? /* @__PURE__ */ p(
|
|
275
282
|
"span",
|
|
276
283
|
{
|
|
277
284
|
className: "flex min-w-0 flex-1 flex-wrap items-center gap-1",
|
|
@@ -279,51 +286,52 @@ function jt({
|
|
|
279
286
|
e.target.closest("button") && e.stopPropagation();
|
|
280
287
|
},
|
|
281
288
|
children: [
|
|
282
|
-
|
|
283
|
-
const
|
|
289
|
+
k.map((e) => {
|
|
290
|
+
const a = e[_], u = H(e), C = u !== i, J = !C && M.has(String(a));
|
|
284
291
|
return /* @__PURE__ */ p(
|
|
285
292
|
"span",
|
|
286
293
|
{
|
|
287
|
-
title:
|
|
294
|
+
title: J ? "This record is no longer an available option" : void 0,
|
|
288
295
|
className: Z(
|
|
289
296
|
"inline-flex items-center gap-1 rounded-full border pl-2.5 pr-1.5 py-0.5 text-[12px]",
|
|
290
|
-
|
|
297
|
+
J ? "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-600 dark:bg-amber-950/30 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-slate-200"
|
|
291
298
|
),
|
|
292
299
|
children: [
|
|
293
|
-
|
|
294
|
-
u && (
|
|
300
|
+
J && /* @__PURE__ */ n(Ue, { className: "h-3 w-3 shrink-0 text-amber-500" }),
|
|
301
|
+
u && (C ? (
|
|
295
302
|
// An external email (or another allowed kind): its own
|
|
296
303
|
// table, its own label — never read as a person.
|
|
297
|
-
/* @__PURE__ */ n(je, { collection: u, id:
|
|
298
|
-
) : f &&
|
|
304
|
+
/* @__PURE__ */ n(je, { collection: u, id: a })
|
|
305
|
+
) : f && L ? /* @__PURE__ */ n(
|
|
299
306
|
"button",
|
|
300
307
|
{
|
|
301
308
|
type: "button",
|
|
302
309
|
title: "Open detail panel",
|
|
303
|
-
onClick: () =>
|
|
310
|
+
onClick: () => L.open({
|
|
304
311
|
collection: u,
|
|
305
|
-
itemId: String(
|
|
312
|
+
itemId: String(a),
|
|
306
313
|
layoutId: f.layout_id,
|
|
307
314
|
width: f.width
|
|
308
315
|
}),
|
|
309
316
|
className: "underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-[#172940] hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
|
|
310
317
|
children: /* @__PURE__ */ n(
|
|
311
|
-
|
|
318
|
+
ue,
|
|
312
319
|
{
|
|
313
320
|
collection: u,
|
|
314
|
-
id:
|
|
321
|
+
id: a,
|
|
315
322
|
displayTemplate: y == null ? void 0 : y.display_template
|
|
316
323
|
}
|
|
317
324
|
)
|
|
318
325
|
}
|
|
319
326
|
) : /* @__PURE__ */ n(
|
|
320
|
-
|
|
327
|
+
ue,
|
|
321
328
|
{
|
|
322
329
|
collection: u,
|
|
323
|
-
id:
|
|
330
|
+
id: a,
|
|
324
331
|
displayTemplate: y == null ? void 0 : y.display_template
|
|
325
332
|
}
|
|
326
333
|
)),
|
|
334
|
+
u && !C && u !== "nivaro_users" && /* @__PURE__ */ n(mt, { collection: u, id: a }),
|
|
327
335
|
/* @__PURE__ */ n(
|
|
328
336
|
"button",
|
|
329
337
|
{
|
|
@@ -344,14 +352,14 @@ function jt({
|
|
|
344
352
|
{
|
|
345
353
|
className: "inline-flex items-center gap-1 rounded-full border border-dashed border-nvr-cyan/50 bg-nvr-cyan/5 pl-2.5 pr-1.5 py-0.5 text-[12px] text-slate-600 dark:text-slate-300",
|
|
346
354
|
children: [
|
|
347
|
-
|
|
355
|
+
me(e) ? /* @__PURE__ */ n(
|
|
348
356
|
je,
|
|
349
357
|
{
|
|
350
|
-
collection:
|
|
351
|
-
id:
|
|
358
|
+
collection: me(e).collection,
|
|
359
|
+
id: me(e).id
|
|
352
360
|
}
|
|
353
361
|
) : i ? /* @__PURE__ */ n(
|
|
354
|
-
|
|
362
|
+
ue,
|
|
355
363
|
{
|
|
356
364
|
collection: i,
|
|
357
365
|
id: e,
|
|
@@ -375,48 +383,48 @@ function jt({
|
|
|
375
383
|
]
|
|
376
384
|
}
|
|
377
385
|
) : /* @__PURE__ */ n("span", { className: "truncate text-muted-foreground", children: "Select items…" }),
|
|
378
|
-
/* @__PURE__ */ n(
|
|
386
|
+
/* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
379
387
|
]
|
|
380
388
|
}
|
|
381
389
|
) }),
|
|
382
|
-
/* @__PURE__ */ n(
|
|
390
|
+
/* @__PURE__ */ n(We, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ p(
|
|
383
391
|
Je,
|
|
384
392
|
{
|
|
385
393
|
shouldFilter: !1,
|
|
386
|
-
...
|
|
394
|
+
...ge,
|
|
387
395
|
children: [
|
|
388
396
|
/* @__PURE__ */ n(
|
|
389
397
|
ze,
|
|
390
398
|
{
|
|
391
399
|
placeholder: "Search…",
|
|
392
|
-
value:
|
|
393
|
-
onValueChange:
|
|
400
|
+
value: b,
|
|
401
|
+
onValueChange: F,
|
|
394
402
|
className: "h-9 text-[13px]"
|
|
395
403
|
}
|
|
396
404
|
),
|
|
397
|
-
/* @__PURE__ */ p(
|
|
398
|
-
|
|
399
|
-
!
|
|
405
|
+
/* @__PURE__ */ p(Be, { children: [
|
|
406
|
+
D ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(we, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(Ge, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
|
|
407
|
+
!D && ne && /* @__PURE__ */ p(
|
|
400
408
|
"p",
|
|
401
409
|
{
|
|
402
410
|
"data-picker-close-matches": !0,
|
|
403
411
|
className: "px-3 pb-1 pt-2 text-[11.5px] text-muted-foreground",
|
|
404
412
|
children: [
|
|
405
413
|
"No exact match for “",
|
|
406
|
-
|
|
414
|
+
b.trim(),
|
|
407
415
|
"” — did you mean:"
|
|
408
416
|
]
|
|
409
417
|
}
|
|
410
418
|
),
|
|
411
|
-
/* @__PURE__ */ n(Le, { children: !
|
|
412
|
-
(e,
|
|
419
|
+
/* @__PURE__ */ n(Le, { children: !D && (te ? [...he(B, b, oe, N)] : [...he(B, b, oe, N)].sort(
|
|
420
|
+
(e, a) => Ie(N(e), N(a), b, c === "-label")
|
|
413
421
|
)).map((e) => {
|
|
414
|
-
const
|
|
422
|
+
const a = String(e.id), u = P.has(W(a));
|
|
415
423
|
return /* @__PURE__ */ p(
|
|
416
424
|
Fe,
|
|
417
425
|
{
|
|
418
|
-
value:
|
|
419
|
-
onSelect: () =>
|
|
426
|
+
value: a,
|
|
427
|
+
onSelect: () => se(e.id),
|
|
420
428
|
className: "flex items-center gap-2 text-[13px]",
|
|
421
429
|
children: [
|
|
422
430
|
/* @__PURE__ */ n(
|
|
@@ -430,32 +438,33 @@ function jt({
|
|
|
430
438
|
}
|
|
431
439
|
),
|
|
432
440
|
i === "nivaro_users" && /* @__PURE__ */ n(
|
|
433
|
-
|
|
441
|
+
Ee,
|
|
434
442
|
{
|
|
435
|
-
userId:
|
|
443
|
+
userId: a,
|
|
436
444
|
className: "h-4 w-4",
|
|
437
|
-
fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children:
|
|
445
|
+
fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Qe(N(e)) })
|
|
438
446
|
}
|
|
439
447
|
),
|
|
440
|
-
i === "nivaro_users" &&
|
|
448
|
+
i === "nivaro_users" && be.has(a.toUpperCase()) && /* @__PURE__ */ n(
|
|
441
449
|
"span",
|
|
442
450
|
{
|
|
443
451
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
|
|
444
452
|
"data-tip": "Online now"
|
|
445
453
|
}
|
|
446
454
|
),
|
|
447
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
455
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: N(e) }),
|
|
456
|
+
/* @__PURE__ */ n(ft, { badges: le[a] })
|
|
448
457
|
]
|
|
449
458
|
},
|
|
450
|
-
|
|
459
|
+
a
|
|
451
460
|
);
|
|
452
461
|
}) }),
|
|
453
462
|
/* @__PURE__ */ n(
|
|
454
463
|
He,
|
|
455
464
|
{
|
|
456
|
-
options:
|
|
457
|
-
isSelected: (e) =>
|
|
458
|
-
onPick: (e) =>
|
|
465
|
+
options: ke,
|
|
466
|
+
isSelected: (e) => P.has(W(e)),
|
|
467
|
+
onPick: (e) => se(e),
|
|
459
468
|
round: !1
|
|
460
469
|
}
|
|
461
470
|
)
|
|
@@ -468,150 +477,152 @@ function jt({
|
|
|
468
477
|
) });
|
|
469
478
|
}
|
|
470
479
|
function tt(t) {
|
|
471
|
-
const { client: l, relatedCollection: d, search:
|
|
480
|
+
const { client: l, relatedCollection: d, search: o, filterParam: c, serverSort: v, templateNestedFields: x } = t, f = (i) => l.request(
|
|
472
481
|
$(`/items/${d}`, {
|
|
473
482
|
limit: nt,
|
|
474
|
-
search:
|
|
483
|
+
search: i || void 0,
|
|
475
484
|
// Typo pass (fix11-search): close matches only when the exact search finds nothing.
|
|
476
|
-
...
|
|
477
|
-
filter:
|
|
485
|
+
...i ? { typo: "1" } : {},
|
|
486
|
+
filter: c,
|
|
478
487
|
picker: "1",
|
|
479
488
|
// A dotted display template ({{core_category.name}}) needs the
|
|
480
489
|
// nested expansion — a bare row only carries the FK id.
|
|
481
490
|
...x ? { fields: x } : {},
|
|
482
|
-
...
|
|
491
|
+
...v ? { sort: v } : {}
|
|
483
492
|
})
|
|
484
|
-
).then((
|
|
493
|
+
).then((_) => _.data ?? []), m = (i) => [
|
|
485
494
|
"m2m-options",
|
|
486
495
|
d,
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
496
|
+
i,
|
|
497
|
+
c,
|
|
498
|
+
v ?? "",
|
|
490
499
|
x ?? ""
|
|
491
|
-
],
|
|
500
|
+
], L = c ? 0 : 3e4, r = ot(d), { data: h, isFetching: A } = O({
|
|
492
501
|
queryKey: m(""),
|
|
493
502
|
queryFn: () => f(""),
|
|
494
503
|
enabled: t.enabled,
|
|
495
|
-
staleTime:
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
504
|
+
staleTime: L,
|
|
505
|
+
meta: r
|
|
506
|
+
}), b = xt(h, o, t.labelOf), { data: F, isFetching: j } = O({
|
|
507
|
+
queryKey: m(o),
|
|
508
|
+
queryFn: () => f(o),
|
|
509
|
+
enabled: t.enabled && b,
|
|
510
|
+
staleTime: L,
|
|
511
|
+
meta: r
|
|
501
512
|
});
|
|
502
|
-
return
|
|
503
|
-
options:
|
|
504
|
-
isLoading: !
|
|
513
|
+
return b ? {
|
|
514
|
+
options: F ?? [],
|
|
515
|
+
isLoading: !F && j,
|
|
505
516
|
localSearch: !1,
|
|
506
|
-
closeMatches:
|
|
507
|
-
} : { options:
|
|
517
|
+
closeMatches: pt(F)
|
|
518
|
+
} : { options: h ?? [], isLoading: !h && A, localSearch: !!o };
|
|
508
519
|
}
|
|
509
520
|
const nt = 200;
|
|
510
|
-
function
|
|
511
|
-
return l.trim() ? !t || t.length >= nt ? !0 :
|
|
521
|
+
function xt(t, l, d) {
|
|
522
|
+
return l.trim() ? !t || t.length >= nt ? !0 : he(t, l, !0, d).length === 0 : !1;
|
|
512
523
|
}
|
|
513
|
-
function
|
|
514
|
-
return !d || !l.trim() ? t : t.filter((
|
|
524
|
+
function he(t, l, d, o) {
|
|
525
|
+
return !d || !l.trim() ? t : t.filter((c) => ut(o(c), l));
|
|
515
526
|
}
|
|
516
|
-
function
|
|
527
|
+
function zt({
|
|
517
528
|
relation: t,
|
|
518
529
|
parentId: l,
|
|
519
530
|
allRelations: d,
|
|
520
|
-
extraFilter:
|
|
521
|
-
optionSort:
|
|
522
|
-
requiredParent:
|
|
531
|
+
extraFilter: o,
|
|
532
|
+
optionSort: c,
|
|
533
|
+
requiredParent: v,
|
|
523
534
|
onCountChange: x,
|
|
524
535
|
readOnly: f
|
|
525
536
|
}) {
|
|
526
|
-
const m = Oe(),
|
|
537
|
+
const m = Oe(), L = dt(), r = Ze(), [h, A] = Q(!1), [b, F] = Q(""), j = d.find(
|
|
527
538
|
(s) => s.many_collection === t.many_collection && s.many_field === t.junction_field && s.id !== t.id
|
|
528
|
-
), i = et(
|
|
539
|
+
), i = et(j), _ = t.junction_field ?? "", X = t.many_field ?? "", g = t.one_field ?? `${t.many_collection}.${_}`, { data: T } = O({
|
|
529
540
|
queryKey: ["col-meta", i],
|
|
530
541
|
queryFn: () => m.request($(`/collections/${i}`)).then((s) => s.data),
|
|
531
542
|
enabled: !!i,
|
|
532
543
|
staleTime: 3e5,
|
|
533
544
|
retry: !1
|
|
534
|
-
}), y = Ye(
|
|
545
|
+
}), y = Ye(j), { data: ae = [], isFetching: H } = O({
|
|
535
546
|
queryKey: [
|
|
536
547
|
"m2m-items",
|
|
537
548
|
t.many_collection,
|
|
538
|
-
|
|
549
|
+
X,
|
|
539
550
|
l,
|
|
540
551
|
...y ? ["m2a"] : []
|
|
541
552
|
],
|
|
542
553
|
queryFn: () => m.request(
|
|
543
554
|
$(`/items/${t.many_collection}`, {
|
|
544
|
-
filter: JSON.stringify({ [
|
|
555
|
+
filter: JSON.stringify({ [X]: { _eq: l } }),
|
|
545
556
|
limit: 1,
|
|
546
|
-
fields: `id,${
|
|
557
|
+
fields: `id,${_}${y ? `,${y}` : ""}`
|
|
547
558
|
})
|
|
548
559
|
).then((s) => s.data ?? []),
|
|
549
560
|
staleTime: 3e4,
|
|
550
561
|
enabled: !!l && l !== "new"
|
|
551
|
-
}),
|
|
552
|
-
const s =
|
|
562
|
+
}), ye = Pe().isAdmin, I = i === "nivaro_users" ? Me(ye) : null, be = De(i === "nivaro_users"), Y = o ? I ? { _and: [o, I] } : o : I, ee = Y ? JSON.stringify(Y) : void 0, te = c && !/^-?label$/.test(c) ? c : void 0, xe = (() => {
|
|
563
|
+
const s = T == null ? void 0 : T.display_template;
|
|
553
564
|
if (!s || !s.includes(".")) return null;
|
|
554
|
-
const w = [...s.matchAll(/\{\{([^}]+)\}\}/g)].map((
|
|
565
|
+
const w = [...s.matchAll(/\{\{([^}]+)\}\}/g)].map((de) => de[1].trim());
|
|
555
566
|
return w.length === 0 ? null : ["id", ...w].join(",");
|
|
556
567
|
})(), {
|
|
557
|
-
options:
|
|
558
|
-
isLoading:
|
|
559
|
-
localSearch:
|
|
568
|
+
options: B,
|
|
569
|
+
isLoading: D,
|
|
570
|
+
localSearch: oe,
|
|
560
571
|
closeMatches: ne
|
|
561
572
|
} = tt({
|
|
562
573
|
client: m,
|
|
563
574
|
relatedCollection: i,
|
|
564
|
-
search:
|
|
565
|
-
filterParam:
|
|
566
|
-
serverSort:
|
|
567
|
-
templateNestedFields:
|
|
568
|
-
enabled:
|
|
569
|
-
labelOf:
|
|
570
|
-
}),
|
|
571
|
-
|
|
575
|
+
search: b,
|
|
576
|
+
filterParam: ee,
|
|
577
|
+
serverSort: te,
|
|
578
|
+
templateNestedFields: xe,
|
|
579
|
+
enabled: h && !!i,
|
|
580
|
+
labelOf: z
|
|
581
|
+
}), ge = rt(!!ne, b), ke = Xe(m, j, b, h), U = (r == null ? void 0 : r.getStagedLinks(g)) ?? [], G = (r == null ? void 0 : r.getStagedUnlinks(g)) ?? /* @__PURE__ */ new Set(), k = ae.find((s) => !G.has(s.id)) ?? null, V = k ? k[_] : null, q = U.length > 0 ? U[U.length - 1] : null, S = q ?? V, re = U.length > 0 || G.size > 0, R = Ce(x);
|
|
582
|
+
R.current = x, qe(() => {
|
|
572
583
|
var s;
|
|
573
|
-
(s =
|
|
574
|
-
}, [
|
|
575
|
-
const M =
|
|
576
|
-
queryKey: ["col-meta",
|
|
577
|
-
queryFn: () => m.request($(`/collections/${
|
|
578
|
-
enabled:
|
|
584
|
+
(s = R.current) == null || s.call(R, S != null ? 1 : 0);
|
|
585
|
+
}, [S]);
|
|
586
|
+
const M = me(q), K = q != null ? (M == null ? void 0 : M.collection) ?? i : Se(k, y, i), P = M ? M.id : S, le = Se(k, y, i), E = k == null ? null : le && le !== i ? Te(le, V) : String(V), se = q != null ? String(q) : E, N = K !== i, { data: e } = O({
|
|
587
|
+
queryKey: ["col-meta", K],
|
|
588
|
+
queryFn: () => m.request($(`/collections/${K}`)).then((s) => s.data),
|
|
589
|
+
enabled: N && !!K,
|
|
579
590
|
staleTime: 3e5,
|
|
580
591
|
retry: !1
|
|
581
|
-
}), { data:
|
|
582
|
-
queryKey: ["relation-single",
|
|
583
|
-
queryFn: () =>
|
|
584
|
-
enabled: !!
|
|
592
|
+
}), { data: a } = O({
|
|
593
|
+
queryKey: ["relation-single", K, String(P)],
|
|
594
|
+
queryFn: () => L(K, P),
|
|
595
|
+
enabled: !!K && P != null,
|
|
585
596
|
staleTime: 6e4
|
|
586
|
-
}),
|
|
587
|
-
queryKey: ["relation-avail", i, String(
|
|
597
|
+
}), u = JSON.stringify(o ? { _and: [{ id: { _eq: S } }, o] } : { id: { _eq: S } }), { data: C } = O({
|
|
598
|
+
queryKey: ["relation-avail", i, String(S), ee],
|
|
588
599
|
queryFn: () => m.request(
|
|
589
600
|
$(`/items/${i}`, {
|
|
590
|
-
filter:
|
|
601
|
+
filter: u,
|
|
591
602
|
picker: "1",
|
|
592
603
|
limit: 1,
|
|
593
604
|
fields: "id"
|
|
594
605
|
})
|
|
595
606
|
).then((s) => s.data ?? []),
|
|
596
|
-
enabled: !!i && !
|
|
607
|
+
enabled: !!i && !N && S != null && !!a,
|
|
597
608
|
staleTime: 3e4
|
|
598
|
-
}),
|
|
599
|
-
function
|
|
600
|
-
const w = (
|
|
601
|
-
return w ?
|
|
609
|
+
}), J = !N && C !== void 0 && C.length === 0, $e = ht(J);
|
|
610
|
+
function z(s) {
|
|
611
|
+
const w = (T == null ? void 0 : T.display_template) ?? null;
|
|
612
|
+
return w ? pe(w, s) : String(s.name ?? s.title ?? s.label ?? s.id ?? "");
|
|
602
613
|
}
|
|
603
|
-
const
|
|
614
|
+
const ce = N ? a : B.find((s) => String(s.id) === String(S)) ?? a, Ae = S != null && !a && !ce, ve = ce ? N ? pe((e == null ? void 0 : e.display_template) ?? null, ce) : z(ce) : null;
|
|
604
615
|
if (f)
|
|
605
|
-
return /* @__PURE__ */ n("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: Ae ? "…" :
|
|
616
|
+
return /* @__PURE__ */ n("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: Ae ? "…" : ve ?? "—" });
|
|
606
617
|
function Ke(s) {
|
|
607
618
|
for (const w of U) r == null || r.unstageLink(g, w);
|
|
608
|
-
|
|
619
|
+
k && !G.has(k.id) && (r == null || r.stageUnlink(g, k.id)), String(s) === E && k ? r == null || r.unstageUnlink(g, k.id) : String(s) !== se && (r == null || r.stageLink(g, s)), A(!1), F("");
|
|
609
620
|
}
|
|
610
621
|
function lt() {
|
|
611
622
|
for (const s of U) r == null || r.unstageLink(g, s);
|
|
612
|
-
|
|
623
|
+
k && (r == null || r.stageUnlink(g, k.id)), A(!1);
|
|
613
624
|
}
|
|
614
|
-
return
|
|
625
|
+
return v ? /* @__PURE__ */ p(
|
|
615
626
|
"button",
|
|
616
627
|
{
|
|
617
628
|
type: "button",
|
|
@@ -620,68 +631,68 @@ function Ut({
|
|
|
620
631
|
children: [
|
|
621
632
|
/* @__PURE__ */ p("span", { className: "truncate text-muted-foreground", children: [
|
|
622
633
|
"Select ",
|
|
623
|
-
|
|
634
|
+
v,
|
|
624
635
|
" first"
|
|
625
636
|
] }),
|
|
626
|
-
/* @__PURE__ */ n(
|
|
637
|
+
/* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
627
638
|
]
|
|
628
639
|
}
|
|
629
640
|
) : /* @__PURE__ */ p("div", { ...$e.bind, children: [
|
|
630
641
|
/* @__PURE__ */ p(
|
|
631
|
-
|
|
642
|
+
Ve,
|
|
632
643
|
{
|
|
633
|
-
open:
|
|
644
|
+
open: h,
|
|
634
645
|
onOpenChange: (s) => {
|
|
635
|
-
|
|
646
|
+
A(s), s || F("");
|
|
636
647
|
},
|
|
637
648
|
children: [
|
|
638
|
-
/* @__PURE__ */ n(
|
|
649
|
+
/* @__PURE__ */ n(Re, { asChild: !0, children: /* @__PURE__ */ p(
|
|
639
650
|
"button",
|
|
640
651
|
{
|
|
641
652
|
type: "button",
|
|
642
653
|
className: Z(
|
|
643
654
|
"w-full h-9 px-3 text-[12px] border rounded-md bg-background text-left flex items-center justify-between hover:bg-muted cursor-pointer transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
644
|
-
|
|
655
|
+
J ? "border-amber-300 dark:border-amber-600" : re ? "border-nvr-cyan/50" : "border-input"
|
|
645
656
|
),
|
|
646
657
|
children: [
|
|
647
|
-
Ae ||
|
|
658
|
+
Ae || H && q == null && l !== "new" ? /* @__PURE__ */ n(we, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ p(
|
|
648
659
|
"span",
|
|
649
660
|
{
|
|
650
661
|
className: Z(
|
|
651
662
|
"flex items-center gap-1.5 truncate min-w-0",
|
|
652
|
-
|
|
663
|
+
ve ? re ? "text-nvr-cyan" : "text-slate-800 dark:text-slate-100" : "text-muted-foreground"
|
|
653
664
|
),
|
|
654
665
|
children: [
|
|
655
|
-
|
|
656
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
666
|
+
J && /* @__PURE__ */ n(Ue, { className: "h-3.5 w-3.5 shrink-0 text-amber-500" }),
|
|
667
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: ve ?? "Select…" })
|
|
657
668
|
]
|
|
658
669
|
}
|
|
659
670
|
),
|
|
660
|
-
/* @__PURE__ */ n(
|
|
671
|
+
/* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
|
|
661
672
|
]
|
|
662
673
|
}
|
|
663
674
|
) }),
|
|
664
|
-
/* @__PURE__ */ n(
|
|
675
|
+
/* @__PURE__ */ n(We, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ p(
|
|
665
676
|
Je,
|
|
666
677
|
{
|
|
667
678
|
shouldFilter: !1,
|
|
668
|
-
...
|
|
679
|
+
...ge,
|
|
669
680
|
children: [
|
|
670
681
|
/* @__PURE__ */ n(
|
|
671
682
|
ze,
|
|
672
683
|
{
|
|
673
684
|
placeholder: "Search…",
|
|
674
|
-
value:
|
|
675
|
-
onValueChange:
|
|
685
|
+
value: b,
|
|
686
|
+
onValueChange: F,
|
|
676
687
|
className: "h-9 text-[12px]"
|
|
677
688
|
}
|
|
678
689
|
),
|
|
679
|
-
|
|
690
|
+
S != null && /* @__PURE__ */ p(
|
|
680
691
|
"button",
|
|
681
692
|
{
|
|
682
693
|
type: "button",
|
|
683
694
|
onClick: () => {
|
|
684
|
-
lt(),
|
|
695
|
+
lt(), A(!1);
|
|
685
696
|
},
|
|
686
697
|
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",
|
|
687
698
|
children: [
|
|
@@ -690,24 +701,24 @@ function Ut({
|
|
|
690
701
|
]
|
|
691
702
|
}
|
|
692
703
|
),
|
|
693
|
-
/* @__PURE__ */ p(
|
|
694
|
-
|
|
695
|
-
!
|
|
704
|
+
/* @__PURE__ */ p(Be, { children: [
|
|
705
|
+
D ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(we, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(Ge, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
|
|
706
|
+
!D && ne && /* @__PURE__ */ p(
|
|
696
707
|
"p",
|
|
697
708
|
{
|
|
698
709
|
"data-picker-close-matches": !0,
|
|
699
710
|
className: "px-3 pb-1 pt-2 text-[11.5px] text-muted-foreground",
|
|
700
711
|
children: [
|
|
701
712
|
"No exact match for “",
|
|
702
|
-
|
|
713
|
+
b.trim(),
|
|
703
714
|
"” — did you mean:"
|
|
704
715
|
]
|
|
705
716
|
}
|
|
706
717
|
),
|
|
707
|
-
!
|
|
708
|
-
(s, w) =>
|
|
718
|
+
!D && /* @__PURE__ */ n(Le, { children: [...he(B, b, oe, z)].sort(
|
|
719
|
+
(s, w) => te ? 0 : Ie(z(s), z(w), b, c === "-label")
|
|
709
720
|
).map((s) => {
|
|
710
|
-
const w = String(s.id),
|
|
721
|
+
const w = String(s.id), de = String(S) === w;
|
|
711
722
|
return /* @__PURE__ */ p(
|
|
712
723
|
Fe,
|
|
713
724
|
{
|
|
@@ -720,27 +731,27 @@ function Ut({
|
|
|
720
731
|
{
|
|
721
732
|
className: Z(
|
|
722
733
|
"flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
|
|
723
|
-
|
|
734
|
+
de ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
|
|
724
735
|
),
|
|
725
|
-
children:
|
|
736
|
+
children: de && /* @__PURE__ */ n(Ne, { className: "h-2.5 w-2.5 text-white" })
|
|
726
737
|
}
|
|
727
738
|
),
|
|
728
739
|
i === "nivaro_users" && /* @__PURE__ */ n(
|
|
729
|
-
|
|
740
|
+
Ee,
|
|
730
741
|
{
|
|
731
742
|
userId: w,
|
|
732
743
|
className: "h-4 w-4",
|
|
733
|
-
fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children:
|
|
744
|
+
fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Qe(z(s)) })
|
|
734
745
|
}
|
|
735
746
|
),
|
|
736
|
-
i === "nivaro_users" &&
|
|
747
|
+
i === "nivaro_users" && be.has(w.toUpperCase()) && /* @__PURE__ */ n(
|
|
737
748
|
"span",
|
|
738
749
|
{
|
|
739
750
|
className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
|
|
740
751
|
"data-tip": "Online now"
|
|
741
752
|
}
|
|
742
753
|
),
|
|
743
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
754
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: z(s) })
|
|
744
755
|
]
|
|
745
756
|
},
|
|
746
757
|
w
|
|
@@ -749,8 +760,8 @@ function Ut({
|
|
|
749
760
|
/* @__PURE__ */ n(
|
|
750
761
|
He,
|
|
751
762
|
{
|
|
752
|
-
options:
|
|
753
|
-
isSelected: (s) =>
|
|
763
|
+
options: ke,
|
|
764
|
+
isSelected: (s) => se === s,
|
|
754
765
|
onPick: (s) => Ke(s),
|
|
755
766
|
round: !0
|
|
756
767
|
}
|
|
@@ -766,13 +777,13 @@ function Ut({
|
|
|
766
777
|
] });
|
|
767
778
|
}
|
|
768
779
|
function rt(t, l) {
|
|
769
|
-
const [d,
|
|
780
|
+
const [d, o] = Q(null), [c, v] = Q(!1), x = Ce(!1);
|
|
770
781
|
return qe(() => {
|
|
771
|
-
|
|
782
|
+
o(null), x.current = !1;
|
|
772
783
|
}, [l]), t ? {
|
|
773
|
-
value: d ?? (
|
|
784
|
+
value: d ?? (c ? " " : ""),
|
|
774
785
|
onValueChange: (f) => {
|
|
775
|
-
x.current ?
|
|
786
|
+
x.current ? o(f) : v((m) => !m);
|
|
776
787
|
},
|
|
777
788
|
onKeyDownCapture: (f) => {
|
|
778
789
|
f.key === "ArrowDown" || f.key === "ArrowUp" ? x.current = !0 : f.key === "Enter" && !x.current && (f.preventDefault(), f.stopPropagation());
|
|
@@ -783,18 +794,18 @@ function rt(t, l) {
|
|
|
783
794
|
} : {};
|
|
784
795
|
}
|
|
785
796
|
export {
|
|
786
|
-
|
|
787
|
-
|
|
797
|
+
Jt as M2MCombobox,
|
|
798
|
+
zt as M2MSingleSelectCombobox,
|
|
788
799
|
je as OwnCollectionLabel,
|
|
789
|
-
|
|
800
|
+
Mt as m2aAllowedCount,
|
|
790
801
|
Ye as m2aDiscriminator,
|
|
791
|
-
|
|
802
|
+
bt as m2aExtraCollections,
|
|
792
803
|
Se as m2aRowCollection,
|
|
793
804
|
Te as m2aToken,
|
|
794
|
-
|
|
795
|
-
|
|
805
|
+
Et as m2aWriteMeta,
|
|
806
|
+
xt as m2mAsksServer,
|
|
796
807
|
W as m2mIdKey,
|
|
797
|
-
|
|
798
|
-
|
|
808
|
+
he as narrowM2MOptions,
|
|
809
|
+
me as parseM2aToken,
|
|
799
810
|
et as resolveM2MRelatedCollection
|
|
800
811
|
};
|