@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,39 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Info as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useParentDraft as
|
|
7
|
-
import { showsAiButton as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
|
|
1
|
+
import { jsxs as m, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as at, useQueries as Bt, useQuery as se, useMutation as Mt } from "@tanstack/react-query";
|
|
3
|
+
import { Info as Dt, Crosshair as Ht, Loader2 as Ot, Sparkles as Kt, Lock as Ut, SlidersHorizontal as Wt, History as Vt, BellRing as zt, Bell as Qt, Sigma as Gt } from "lucide-react";
|
|
4
|
+
import { memo as Yt, useState as Le, useRef as L, useId as Jt, useEffect as ce, useCallback as et } from "react";
|
|
5
|
+
import { toast as de } from "sonner";
|
|
6
|
+
import { useParentDraft as Xt, useNivaroClient as ue } from "../../context.js";
|
|
7
|
+
import { showsAiButton as Zt, AUTOFILL_CHECK_KEY as It, readAiFill as en } from "../../lib/ai-fill.js";
|
|
8
|
+
import { useCoViewers as tn } from "../../lib/co-edit.js";
|
|
9
|
+
import { get as z, del as nn, post as Ce } from "../../lib/commands.js";
|
|
10
|
+
import { toastError as rn } from "../../lib/error-toast.js";
|
|
11
|
+
import { useOptionalRealtime as on } from "../../lib/realtime.js";
|
|
12
|
+
import { titleCase as j, cn as B, formatDateTime as Re, toLocalDateString as ln } from "../../lib/utils.js";
|
|
13
|
+
import { requiredByRules as tt } from "../../lib/validation-rules.js";
|
|
14
|
+
import { GlossaryLabel as nt } from "../ai/GlossaryText.js";
|
|
15
|
+
import { useFieldSource as an, FieldSourceInfo as sn } from "../ConfigReadBack.js";
|
|
16
|
+
import { Label as cn } from "../ui/label.js";
|
|
17
|
+
import { TooltipProvider as oe, Tooltip as ie, TooltipTrigger as le, TooltipContent as ae } from "../ui/tooltip.js";
|
|
18
|
+
import { useAddendumFields as dn } from "./AddendumFieldContext.js";
|
|
19
|
+
import { AutoIdPreviewField as un } from "./AutoIdPreviewField.js";
|
|
20
|
+
import { useCascadeClearNotifier as mn } from "./cascade-clear-notice.js";
|
|
21
|
+
import { useCoeditTarget as pn, isCoeditInterface as hn } from "./coedit/context.js";
|
|
22
|
+
import { DerivedCauseNote as fn } from "./DerivedCauseNote.js";
|
|
23
|
+
import { DuplicateNotice as xn } from "./DuplicateNotice.js";
|
|
24
|
+
import { FOCUSABLE as rt } from "./entry/entry-keys.js";
|
|
25
|
+
import { useFieldAffordances as yn, useFieldContextMenu as bn, usePresenceSoftLock as gn, LockReasonBadge as vn, PresenceSoftLockStrip as wn } from "./FieldAffordances.js";
|
|
26
|
+
import { FieldCommentButton as kn } from "./FieldComments.js";
|
|
27
|
+
import { FieldRenderer as Nn } from "./FieldRenderer.js";
|
|
28
|
+
import { FieldSourceBadge as _n } from "./FieldSourceBadge.js";
|
|
29
|
+
import { FormHelpVideoButton as Fn } from "./FormHelpVideoButton.js";
|
|
30
|
+
import { primaryControl as Cn, applyFieldA11y as Rn } from "./field-a11y.js";
|
|
31
|
+
import { getCascadeFilters as Ln, SYSTEM_FIELDS as Sn, parseJson as $n, buildCascadeFilter as Tn, CascadeEffectController as qn } from "./helpers.js";
|
|
32
|
+
import { isDerivedForRecord as An } from "./live-rollups.js";
|
|
33
|
+
import { useM2MStaging as Pn } from "./M2MStagingContext.js";
|
|
34
|
+
import { personalDefaultSlotFor as En, PersonalDefaultSlot as jn } from "./PersonalDefaultControl.js";
|
|
35
|
+
import { PersonalDefaultHint as Bn } from "./PersonalDefaultPill.js";
|
|
36
|
+
import { usePartnerNeeds as Mn, isEmptyValue as ot, PartnerNeedBadge as Dn, PartnerNeedHint as Hn } from "./partner-needs.js";
|
|
37
|
+
import { isDisplayFormulaRow as it, usePlacementTextContext as On, placementFieldText as Kn, fieldCounterConfig as Un, fieldIsRecommended as Wn, RecommendedMarker as Vn, RepeatLastButton as zn, DisplayFormulaValue as Qn, FieldCounter as Gn } from "./placement-behaviour.js";
|
|
38
|
+
import { RemoteChangeMark as Yn, RemoteConflictNotice as Jn } from "./RemoteChangeUi.js";
|
|
39
|
+
import { keepIfEqual as Xn, jsonEqual as Zn } from "./render-stability.js";
|
|
40
|
+
import { softRuleWarning as In } from "./soft-rules.js";
|
|
41
|
+
import { usePersonalDefaultsApi as er } from "./usePersonalDefaults.js";
|
|
42
|
+
import { resolveOptionFilterTokens as tr } from "../../lib/option-filter-tokens.js";
|
|
43
|
+
const lt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger", "number"]), nr = /* @__PURE__ */ new Set(["string", "text", "richtext", "textarea", "markdown", "json", "csv"]), rr = /* @__PURE__ */ new Set([
|
|
37
44
|
"input",
|
|
38
45
|
"textarea",
|
|
39
46
|
"wysiwyg",
|
|
@@ -41,7 +48,7 @@ const tt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
41
48
|
"input-rich-text-html",
|
|
42
49
|
"rich_text",
|
|
43
50
|
"extension-editorjs"
|
|
44
|
-
]),
|
|
51
|
+
]), or = /* @__PURE__ */ new Set([
|
|
45
52
|
"relation-m2o",
|
|
46
53
|
"relation-m2m",
|
|
47
54
|
"select-multiple-m2m",
|
|
@@ -52,95 +59,95 @@ const tt = /* @__PURE__ */ new Set(["integer", "float", "decimal", "bigInteger",
|
|
|
52
59
|
"file",
|
|
53
60
|
"files",
|
|
54
61
|
"image"
|
|
55
|
-
]),
|
|
56
|
-
function
|
|
57
|
-
const e =
|
|
58
|
-
return
|
|
62
|
+
]), ir = /* @__PURE__ */ new Set(["file", "file-image", "files-m2m", "files", "image"]);
|
|
63
|
+
function lr(p) {
|
|
64
|
+
const e = p.interface ?? "";
|
|
65
|
+
return or.has(e) || e.startsWith("relation-") || e.endsWith("-m2o") || e.endsWith("-m2m") || lt.has(p.type ?? "") ? !1 : !!(nr.has(p.type ?? "") || rr.has(e) || !e && p.type && !lt.has(p.type));
|
|
59
66
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
67
|
+
function ar(p, e, s) {
|
|
68
|
+
return p.filter((h) => (s == null ? void 0 : s(h)) !== e);
|
|
62
69
|
}
|
|
63
|
-
function
|
|
64
|
-
const x =
|
|
65
|
-
return
|
|
66
|
-
queryKey: ["field-lineage",
|
|
70
|
+
function sr(p, e, s, h) {
|
|
71
|
+
const x = ue();
|
|
72
|
+
return se({
|
|
73
|
+
queryKey: ["field-lineage", p, e, s],
|
|
67
74
|
queryFn: () => x.request(
|
|
68
|
-
|
|
69
|
-
).then((
|
|
75
|
+
z(`/lineage/${p}/${encodeURIComponent(e)}/${s}`)
|
|
76
|
+
).then((c) => c.data),
|
|
70
77
|
enabled: h,
|
|
71
78
|
staleTime: 3e4
|
|
72
79
|
});
|
|
73
80
|
}
|
|
74
|
-
function
|
|
75
|
-
var
|
|
76
|
-
if (
|
|
77
|
-
const
|
|
78
|
-
return `= ${
|
|
81
|
+
function eo(p, e = "rows") {
|
|
82
|
+
var r, w, g;
|
|
83
|
+
if (p && (p.kind === "write" || p.kind === "read") && p.formula) {
|
|
84
|
+
const d = (b) => typeof b == "number" ? b.toLocaleString(void 0, { maximumFractionDigits: 2 }) : b == null || b === "" ? "0" : String(b);
|
|
85
|
+
return `= ${p.formula.replace(/item\.([A-Za-z_][A-Za-z0-9_]*)/g, (b, i) => {
|
|
79
86
|
var f;
|
|
80
|
-
return
|
|
87
|
+
return d((f = p.inputs) == null ? void 0 : f[i]);
|
|
81
88
|
}).replace(/\s*-\s*/g, " − ").replace(/\s*\*\s*/g, " × ").replace(/\s*\/\s*/g, " ÷ ")}`;
|
|
82
89
|
}
|
|
83
|
-
if (!
|
|
84
|
-
const
|
|
90
|
+
if (!p || p.kind !== "rollup") return null;
|
|
91
|
+
const s = (p.sources ?? []).reduce((d, a) => d + a.rows.length, 0), h = (p.sources ?? []).reduce((d, a) => {
|
|
85
92
|
var b;
|
|
86
|
-
return
|
|
87
|
-
}, 0), x = (g = (w = (
|
|
93
|
+
return d + (((b = a.excluded) == null ? void 0 : b.length) ?? 0);
|
|
94
|
+
}, 0), x = (g = (w = (r = (p.sources ?? []).find((d) => {
|
|
88
95
|
var a;
|
|
89
|
-
return (a =
|
|
90
|
-
})) == null ? void 0 :
|
|
91
|
-
return h &&
|
|
96
|
+
return (a = d.excluded) == null ? void 0 : a.length;
|
|
97
|
+
})) == null ? void 0 : r.excluded) == null ? void 0 : w[0]) == null ? void 0 : g.reason, c = [`= ${s} ${s === 1 ? e.replace(/s$/, "") : e}`];
|
|
98
|
+
return h && c.push(
|
|
92
99
|
`${h} excluded${x ? ` (${x.replace(/^does not match: /, "")})` : ""}`
|
|
93
|
-
),
|
|
100
|
+
), c.join(" · ");
|
|
94
101
|
}
|
|
95
|
-
function
|
|
96
|
-
collection:
|
|
102
|
+
function cr({
|
|
103
|
+
collection: p,
|
|
97
104
|
itemId: e,
|
|
98
|
-
field:
|
|
105
|
+
field: s
|
|
99
106
|
}) {
|
|
100
|
-
const [h, x] =
|
|
101
|
-
|
|
107
|
+
const [h, x] = Le(!1), c = L(null), { data: r, isLoading: w } = sr(p, e, s, h);
|
|
108
|
+
ce(() => {
|
|
102
109
|
if (!h) return;
|
|
103
110
|
const a = (b) => {
|
|
104
|
-
var
|
|
105
|
-
(
|
|
111
|
+
var i;
|
|
112
|
+
(i = c.current) != null && i.contains(b.target) || x(!1);
|
|
106
113
|
};
|
|
107
114
|
return window.addEventListener("mousedown", a), () => window.removeEventListener("mousedown", a);
|
|
108
115
|
}, [h]);
|
|
109
|
-
const g = (a) => a == null ? "—" : Number(a).toLocaleString(void 0, { maximumFractionDigits: 2 }),
|
|
110
|
-
return /* @__PURE__ */
|
|
116
|
+
const g = (a) => a == null ? "—" : Number(a).toLocaleString(void 0, { maximumFractionDigits: 2 }), d = (r == null ? void 0 : r.stored_value) != null ? Number(r.stored_value) : null;
|
|
117
|
+
return /* @__PURE__ */ m("div", { ref: c, className: "relative inline-flex", children: [
|
|
111
118
|
/* @__PURE__ */ n(
|
|
112
119
|
"button",
|
|
113
120
|
{
|
|
114
121
|
type: "button",
|
|
115
122
|
onClick: () => x((a) => !a),
|
|
116
123
|
title: "Where does this number come from?",
|
|
117
|
-
className:
|
|
124
|
+
className: B(
|
|
118
125
|
"inline-flex items-center rounded p-0.5 transition-opacity",
|
|
119
126
|
h ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
120
127
|
),
|
|
121
128
|
"data-field-lineage": !0,
|
|
122
|
-
children: /* @__PURE__ */ n(
|
|
129
|
+
children: /* @__PURE__ */ n(Gt, { className: "h-3 w-3" })
|
|
123
130
|
}
|
|
124
131
|
),
|
|
125
|
-
h && /* @__PURE__ */
|
|
132
|
+
h && /* @__PURE__ */ m("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-[340px] w-[360px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
126
133
|
/* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Where this number comes from" }),
|
|
127
134
|
w && /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }),
|
|
128
|
-
(
|
|
129
|
-
/* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children:
|
|
130
|
-
Object.entries(
|
|
135
|
+
(r == null ? void 0 : r.kind) === "write" && /* @__PURE__ */ m("div", { className: "space-y-1 px-1 py-1", children: [
|
|
136
|
+
/* @__PURE__ */ n("p", { className: "font-mono text-[11px] text-slate-600 dark:text-slate-300", children: r.formula }),
|
|
137
|
+
Object.entries(r.inputs ?? {}).map(([a, b]) => /* @__PURE__ */ m("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
131
138
|
/* @__PURE__ */ n("span", { className: "font-mono", children: a }),
|
|
132
139
|
" = ",
|
|
133
140
|
g(b)
|
|
134
141
|
] }, a)),
|
|
135
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ m("p", { className: "pt-1 text-[11.5px] font-medium text-slate-700 dark:text-slate-200", children: [
|
|
136
143
|
"= ",
|
|
137
|
-
g(
|
|
144
|
+
g(r.stored_value)
|
|
138
145
|
] })
|
|
139
146
|
] }),
|
|
140
|
-
(
|
|
141
|
-
var
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
147
|
+
(r == null ? void 0 : r.kind) === "rollup" && (r.sources ?? []).map((a, b) => {
|
|
148
|
+
var i;
|
|
149
|
+
return /* @__PURE__ */ m("div", { className: "mb-1.5", children: [
|
|
150
|
+
/* @__PURE__ */ m("p", { className: "px-1 text-[10.5px] text-slate-400", children: [
|
|
144
151
|
(a.aggregate ?? "sum").toUpperCase(),
|
|
145
152
|
a.value_field ? ` of ${a.value_field}` : "",
|
|
146
153
|
" across ",
|
|
@@ -149,7 +156,7 @@ function On({
|
|
|
149
156
|
] }),
|
|
150
157
|
a.error && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-amber-600 dark:text-amber-400", children: a.error }),
|
|
151
158
|
a.note && /* @__PURE__ */ n("p", { className: "px-1 py-1 text-[11.5px] text-slate-400", children: a.note }),
|
|
152
|
-
a.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: a.rows.map((f) => /* @__PURE__ */
|
|
159
|
+
a.rows.length > 0 && /* @__PURE__ */ n("div", { className: "mt-0.5 space-y-px", children: a.rows.map((f) => /* @__PURE__ */ m(
|
|
153
160
|
"div",
|
|
154
161
|
{
|
|
155
162
|
className: "flex items-baseline gap-2 rounded px-1 py-0.5 text-[11.5px] hover:bg-slate-50 dark:hover:bg-muted",
|
|
@@ -160,7 +167,7 @@ function On({
|
|
|
160
167
|
"span",
|
|
161
168
|
{
|
|
162
169
|
className: "w-[88px] shrink-0 truncate text-right text-[10px] text-slate-400",
|
|
163
|
-
"data-tip": f.updated_at ? `${f.updated_by ?? "unknown"} · ${
|
|
170
|
+
"data-tip": f.updated_at ? `${f.updated_by ?? "unknown"} · ${Re(f.updated_at)}` : void 0,
|
|
164
171
|
children: f.updated_by ?? ""
|
|
165
172
|
}
|
|
166
173
|
)
|
|
@@ -169,18 +176,18 @@ function On({
|
|
|
169
176
|
f.id
|
|
170
177
|
)) }),
|
|
171
178
|
a.truncated && /* @__PURE__ */ n("p", { className: "px-1 pt-0.5 text-[10.5px] text-amber-600 dark:text-amber-400", children: "Showing the first 200 rows — the subtotal covers only these." }),
|
|
172
|
-
a.subtotal != null && /* @__PURE__ */
|
|
179
|
+
a.subtotal != null && /* @__PURE__ */ m("p", { className: "border-t border-slate-100 px-1 pt-1 text-right text-[11.5px] font-medium text-slate-700 dark:border-border dark:text-slate-200", children: [
|
|
173
180
|
"subtotal ",
|
|
174
181
|
g(a.subtotal)
|
|
175
182
|
] }),
|
|
176
|
-
(((
|
|
177
|
-
/* @__PURE__ */
|
|
183
|
+
(((i = a.excluded) == null ? void 0 : i.length) ?? 0) > 0 && /* @__PURE__ */ m("div", { className: "mt-1 rounded bg-slate-50 px-1 py-1 dark:bg-muted/40", children: [
|
|
184
|
+
/* @__PURE__ */ m("p", { className: "text-[10.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
178
185
|
a.excluded.length,
|
|
179
186
|
" excluded —",
|
|
180
187
|
" ",
|
|
181
188
|
a.excluded[0].reason.replace(/^does not match: /, "")
|
|
182
189
|
] }),
|
|
183
|
-
a.excluded.slice(0, 8).map((f) => /* @__PURE__ */
|
|
190
|
+
a.excluded.slice(0, 8).map((f) => /* @__PURE__ */ m(
|
|
184
191
|
"div",
|
|
185
192
|
{
|
|
186
193
|
className: "flex items-baseline gap-2 px-0.5 text-[11px] text-slate-400",
|
|
@@ -191,7 +198,7 @@ function On({
|
|
|
191
198
|
},
|
|
192
199
|
f.id
|
|
193
200
|
)),
|
|
194
|
-
a.excluded.length > 8 && /* @__PURE__ */
|
|
201
|
+
a.excluded.length > 8 && /* @__PURE__ */ m("p", { className: "px-0.5 text-[10.5px] text-slate-400", children: [
|
|
195
202
|
"+",
|
|
196
203
|
a.excluded.length - 8,
|
|
197
204
|
" more"
|
|
@@ -199,90 +206,90 @@ function On({
|
|
|
199
206
|
] })
|
|
200
207
|
] }, b);
|
|
201
208
|
}),
|
|
202
|
-
(
|
|
209
|
+
(r == null ? void 0 : r.kind) === "rollup" && d != null && /* @__PURE__ */ m("p", { className: "px-1 pt-0.5 text-right text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
|
|
203
210
|
"stored ",
|
|
204
|
-
g(
|
|
211
|
+
g(d),
|
|
205
212
|
(() => {
|
|
206
|
-
const a = (
|
|
207
|
-
return (
|
|
213
|
+
const a = (r.sources ?? []).reduce((i, f) => i + (f.subtotal ?? 0), 0);
|
|
214
|
+
return (r.sources ?? []).some((i) => i.truncated) ? null : Math.abs(a - d) < 0.01 ? /* @__PURE__ */ n("span", { className: "ml-1 text-emerald-600 dark:text-emerald-400", children: "✓ matches" }) : /* @__PURE__ */ n("span", { className: "ml-1 text-amber-600 dark:text-amber-400", children: "✕ differs from contributions" });
|
|
208
215
|
})()
|
|
209
216
|
] })
|
|
210
217
|
] })
|
|
211
218
|
] });
|
|
212
219
|
}
|
|
213
|
-
function
|
|
214
|
-
collection:
|
|
220
|
+
function dr({
|
|
221
|
+
collection: p,
|
|
215
222
|
itemId: e,
|
|
216
|
-
field:
|
|
223
|
+
field: s,
|
|
217
224
|
formatValue: h,
|
|
218
225
|
onRestore: x
|
|
219
226
|
}) {
|
|
220
|
-
const
|
|
221
|
-
queryKey: ["field-value-history",
|
|
222
|
-
queryFn: () =>
|
|
223
|
-
enabled:
|
|
227
|
+
const c = ue(), [r, w] = Le(!1), g = L(null), { data: d, isLoading: a } = se({
|
|
228
|
+
queryKey: ["field-value-history", p, e, s],
|
|
229
|
+
queryFn: () => c.request(z(`/field-history/${p}/${encodeURIComponent(e)}/${s}`)).then((i) => i.data ?? []),
|
|
230
|
+
enabled: r,
|
|
224
231
|
staleTime: 6e4
|
|
225
232
|
});
|
|
226
|
-
|
|
227
|
-
if (!
|
|
228
|
-
const
|
|
229
|
-
var
|
|
230
|
-
(
|
|
233
|
+
ce(() => {
|
|
234
|
+
if (!r) return;
|
|
235
|
+
const i = (f) => {
|
|
236
|
+
var Q;
|
|
237
|
+
(Q = g.current) != null && Q.contains(f.target) || w(!1);
|
|
231
238
|
};
|
|
232
|
-
return window.addEventListener("mousedown",
|
|
233
|
-
}, [
|
|
234
|
-
const b = (
|
|
235
|
-
return /* @__PURE__ */
|
|
239
|
+
return window.addEventListener("mousedown", i), () => window.removeEventListener("mousedown", i);
|
|
240
|
+
}, [r]);
|
|
241
|
+
const b = (i, f) => f || (i == null || i === "" ? "—" : h ? h(i) : typeof i == "boolean" || i === "true" || i === "false" ? i === !0 || i === "true" ? "Yes" : "No" : typeof i == "string" && /^\d{4}-\d{2}-\d{2}$/.test(i) ? ln(i) : typeof i == "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(i) ? Re(i) : typeof i == "object" ? JSON.stringify(i).slice(0, 60) : String(i).slice(0, 80));
|
|
242
|
+
return /* @__PURE__ */ m("div", { ref: g, className: "relative inline-flex", children: [
|
|
236
243
|
/* @__PURE__ */ n(
|
|
237
244
|
"button",
|
|
238
245
|
{
|
|
239
246
|
type: "button",
|
|
240
|
-
onClick: () => w((
|
|
247
|
+
onClick: () => w((i) => !i),
|
|
241
248
|
title: "Value history",
|
|
242
|
-
className:
|
|
249
|
+
className: B(
|
|
243
250
|
"inline-flex items-center rounded p-0.5 transition-opacity",
|
|
244
|
-
|
|
251
|
+
r ? "text-nvr-cyan opacity-100" : "text-slate-400 hover:text-nvr-cyan dark:text-slate-300 dark:hover:text-nvr-cyan"
|
|
245
252
|
),
|
|
246
253
|
"data-field-history": !0,
|
|
247
|
-
children: /* @__PURE__ */ n(
|
|
254
|
+
children: /* @__PURE__ */ n(Vt, { className: "h-3 w-3" })
|
|
248
255
|
}
|
|
249
256
|
),
|
|
250
|
-
|
|
257
|
+
r && /* @__PURE__ */ m("div", { className: "absolute left-0 top-full z-40 mt-1 max-h-64 w-[300px] overflow-y-auto rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
251
258
|
/* @__PURE__ */ n("p", { className: "mb-1 px-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "Value history" }),
|
|
252
|
-
a ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (
|
|
259
|
+
a ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "Loading…" }) : (d ?? []).length === 0 ? /* @__PURE__ */ n("p", { className: "px-1 py-2 text-[11.5px] text-slate-400", children: "No recorded changes for this field." }) : /* @__PURE__ */ n("div", { className: "space-y-1", children: (d ?? []).map((i, f) => /* @__PURE__ */ m(
|
|
253
260
|
"div",
|
|
254
261
|
{
|
|
255
262
|
className: "rounded px-1 py-1 text-[11.5px] leading-snug hover:bg-slate-50 dark:hover:bg-muted",
|
|
256
263
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: b(
|
|
264
|
+
/* @__PURE__ */ m("span", { className: "flex items-baseline justify-between gap-2", children: [
|
|
265
|
+
/* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: b(i.value, i.display) }),
|
|
259
266
|
x && f > 0 && /* @__PURE__ */ n(
|
|
260
267
|
"button",
|
|
261
268
|
{
|
|
262
269
|
type: "button",
|
|
263
270
|
onClick: () => {
|
|
264
|
-
x(
|
|
271
|
+
x(i.value ?? null), w(!1);
|
|
265
272
|
},
|
|
266
273
|
className: "shrink-0 rounded border border-slate-200 px-1.5 py-px text-[10px] text-slate-500 hover:border-nvr-cyan/60 hover:text-nvr-navy dark:border-border dark:hover:text-nvr-cyan",
|
|
267
274
|
children: "Restore"
|
|
268
275
|
}
|
|
269
276
|
)
|
|
270
277
|
] }),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
278
|
+
/* @__PURE__ */ m("span", { className: "block text-[10.5px] text-slate-400", children: [
|
|
279
|
+
i.action === "create" ? "initial value" : "changed",
|
|
280
|
+
i.timestamp ? ` · ${Re(i.timestamp)}` : "",
|
|
281
|
+
i.user_name ? ` · ${i.user_name}` : "",
|
|
282
|
+
i.origin && i.origin.kind !== "user" && /* @__PURE__ */ n(
|
|
276
283
|
"span",
|
|
277
284
|
{
|
|
278
|
-
className:
|
|
279
|
-
children:
|
|
285
|
+
className: i.origin.kind === "integration" ? "ml-1 rounded bg-purple-500/10 px-1 py-px text-[9.5px] font-medium text-purple-700 dark:text-purple-400" : i.origin.kind === "import" ? "ml-1 rounded bg-sky-500/10 px-1 py-px text-[9.5px] font-medium text-sky-700 dark:text-sky-400" : "ml-1 rounded bg-amber-500/10 px-1 py-px text-[9.5px] font-medium text-amber-700 dark:text-amber-400",
|
|
286
|
+
children: i.origin.label ?? i.origin.kind
|
|
280
287
|
}
|
|
281
288
|
)
|
|
282
289
|
] }),
|
|
283
|
-
|
|
290
|
+
i.note && /* @__PURE__ */ m("span", { className: "block text-[10.5px] italic text-slate-500 dark:text-slate-400", children: [
|
|
284
291
|
"“",
|
|
285
|
-
|
|
292
|
+
i.note,
|
|
286
293
|
"”"
|
|
287
294
|
] })
|
|
288
295
|
]
|
|
@@ -292,379 +299,403 @@ function Hn({
|
|
|
292
299
|
] })
|
|
293
300
|
] });
|
|
294
301
|
}
|
|
295
|
-
function
|
|
296
|
-
collection:
|
|
302
|
+
function ur({
|
|
303
|
+
collection: p,
|
|
297
304
|
itemId: e,
|
|
298
|
-
field:
|
|
305
|
+
field: s
|
|
299
306
|
}) {
|
|
300
|
-
const h =
|
|
307
|
+
const h = ue(), x = at(), { data: c } = se({
|
|
301
308
|
queryKey: ["field-watch-config"],
|
|
302
|
-
queryFn: () => h.request(
|
|
309
|
+
queryFn: () => h.request(z("/field-watches/config")).then((a) => a.data).catch(() => ({ enabled: !1 })),
|
|
303
310
|
staleTime: 5 * 6e4
|
|
304
|
-
}),
|
|
305
|
-
queryKey:
|
|
306
|
-
queryFn: () => h.request(
|
|
307
|
-
enabled: !!(
|
|
311
|
+
}), r = ["field-watch-self", p, e], { data: w = [] } = se({
|
|
312
|
+
queryKey: r,
|
|
313
|
+
queryFn: () => h.request(z("/field-watches/self", { collection: p, item_id: e })).then((a) => a.data ?? []).catch(() => []),
|
|
314
|
+
enabled: !!(c != null && c.enabled),
|
|
308
315
|
staleTime: 6e4
|
|
309
|
-
}), g = w.includes(
|
|
316
|
+
}), g = w.includes(s), d = Mt({
|
|
310
317
|
mutationFn: () => g ? h.request(
|
|
311
|
-
|
|
312
|
-
`/field-watches/self?collection=${encodeURIComponent(
|
|
318
|
+
nn(
|
|
319
|
+
`/field-watches/self?collection=${encodeURIComponent(p)}&field=${encodeURIComponent(s)}&item_id=${encodeURIComponent(e)}`
|
|
313
320
|
)
|
|
314
|
-
) : h.request(
|
|
321
|
+
) : h.request(Ce("/field-watches/self", { collection: p, field: s, item_id: e })),
|
|
315
322
|
onSuccess: () => {
|
|
316
|
-
x.invalidateQueries({ queryKey:
|
|
323
|
+
x.invalidateQueries({ queryKey: r }), de.success(
|
|
317
324
|
g ? "No longer watching this field" : "Watching — you will be notified when it changes"
|
|
318
325
|
);
|
|
319
326
|
},
|
|
320
|
-
onError: () =>
|
|
327
|
+
onError: () => de.error("Could not update the watch")
|
|
321
328
|
});
|
|
322
|
-
return
|
|
329
|
+
return c != null && c.enabled ? /* @__PURE__ */ n(
|
|
323
330
|
"button",
|
|
324
331
|
{
|
|
325
332
|
type: "button",
|
|
326
|
-
onClick: () =>
|
|
333
|
+
onClick: () => d.mutate(),
|
|
327
334
|
title: g ? "Stop watching this field on this record" : "Watch this field on this record",
|
|
328
|
-
"data-field-watch":
|
|
335
|
+
"data-field-watch": s,
|
|
329
336
|
className: `rounded p-0.5 transition-colors ${g ? "text-nvr-navy dark:text-nvr-cyan" : "text-slate-300 hover:text-slate-500"}`,
|
|
330
|
-
children: g ? /* @__PURE__ */ n(
|
|
337
|
+
children: g ? /* @__PURE__ */ n(zt, { className: "h-3 w-3" }) : /* @__PURE__ */ n(Qt, { className: "h-3 w-3" })
|
|
331
338
|
}
|
|
332
339
|
) : null;
|
|
333
340
|
}
|
|
334
|
-
const
|
|
341
|
+
const to = Yt(function({
|
|
335
342
|
field: e,
|
|
336
|
-
draft:
|
|
343
|
+
draft: s,
|
|
337
344
|
onChange: h,
|
|
338
345
|
relations: x,
|
|
339
|
-
collection:
|
|
340
|
-
itemId:
|
|
346
|
+
collection: c,
|
|
347
|
+
itemId: r,
|
|
341
348
|
error: w,
|
|
342
349
|
visible: g,
|
|
343
|
-
locked:
|
|
350
|
+
locked: d,
|
|
344
351
|
layoutAiEnabled: a,
|
|
345
352
|
renderField: b,
|
|
346
|
-
onCountChange:
|
|
353
|
+
onCountChange: i,
|
|
347
354
|
swapButton: f,
|
|
348
|
-
swapContent:
|
|
349
|
-
forceVisible:
|
|
350
|
-
autoFillTick:
|
|
355
|
+
swapContent: Q,
|
|
356
|
+
forceVisible: st,
|
|
357
|
+
autoFillTick: me
|
|
351
358
|
}) {
|
|
352
|
-
var
|
|
353
|
-
const
|
|
359
|
+
var Qe, Ge, Ye, Je, Xe, Ze;
|
|
360
|
+
const G = ir.has(e.interface ?? ""), _ = Xt(), y = Pn(), Se = at(), pe = ue(), [$e, Y] = Le(!1), l = yn(), he = mn(), Te = an(e.field), J = L(null), M = Jt(), fe = L(null), qe = L(!1), Ae = L({
|
|
354
361
|
required: !1,
|
|
355
362
|
hasError: !1
|
|
356
363
|
});
|
|
357
|
-
|
|
358
|
-
const t =
|
|
359
|
-
if (!t || (
|
|
360
|
-
t.id || (t.id = `${
|
|
361
|
-
const
|
|
362
|
-
t.getAttribute("aria-labelledby") !==
|
|
364
|
+
ce(() => {
|
|
365
|
+
const t = qe.current ? Cn(fe.current) : null;
|
|
366
|
+
if (!t || (Rn(t, { ...Ae.current, errorId: `${M}-error` }), t.hasAttribute("aria-label"))) return;
|
|
367
|
+
t.id || (t.id = `${M}-control`);
|
|
368
|
+
const o = t.tagName === "BUTTON" ? `${M} ${t.id}` : M;
|
|
369
|
+
t.getAttribute("aria-labelledby") !== o && t.setAttribute("aria-labelledby", o);
|
|
363
370
|
});
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const t =
|
|
371
|
+
const Pe = d && !G, Ee = L(null);
|
|
372
|
+
ce(() => {
|
|
373
|
+
const t = Ee.current;
|
|
367
374
|
if (!t) return;
|
|
368
|
-
if (!
|
|
375
|
+
if (!Pe) {
|
|
369
376
|
t.removeAttribute("inert");
|
|
370
377
|
return;
|
|
371
378
|
}
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
}, [
|
|
375
|
-
const
|
|
379
|
+
const o = typeof document < "u" ? document.activeElement : null;
|
|
380
|
+
o instanceof HTMLElement && t.contains(o) && o.blur(), t.setAttribute("inert", "");
|
|
381
|
+
}, [Pe, me]);
|
|
382
|
+
const X = e.field, je = et(
|
|
376
383
|
(t) => {
|
|
377
|
-
|
|
384
|
+
d || h(X, t);
|
|
378
385
|
},
|
|
379
|
-
[
|
|
380
|
-
),
|
|
381
|
-
(t) =>
|
|
382
|
-
[
|
|
383
|
-
),
|
|
384
|
-
onContextMenu:
|
|
385
|
-
onKeyDown:
|
|
386
|
-
menu:
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
386
|
+
[d, h, X]
|
|
387
|
+
), ct = et(
|
|
388
|
+
(t) => i == null ? void 0 : i(X, t),
|
|
389
|
+
[i, X]
|
|
390
|
+
), dt = L(void 0), Be = L(void 0), Me = L(void 0), De = !d && !e.readonly && !e.computed_formula && !(e.hidden && !e.layout_assigned) && !it(e), {
|
|
391
|
+
onContextMenu: ut,
|
|
392
|
+
onKeyDown: mt,
|
|
393
|
+
menu: pt,
|
|
394
|
+
openFrom: ht,
|
|
395
|
+
isOpen: ft,
|
|
396
|
+
confirmSaveFrom: xt,
|
|
397
|
+
openedBy: xe
|
|
398
|
+
} = bn({
|
|
399
|
+
wrapperRef: J,
|
|
391
400
|
field: e,
|
|
392
|
-
value:
|
|
401
|
+
value: s[e.field],
|
|
393
402
|
relations: x,
|
|
394
|
-
collection:
|
|
395
|
-
itemId:
|
|
396
|
-
openRelated:
|
|
397
|
-
editable:
|
|
398
|
-
}),
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
+
collection: c,
|
|
404
|
+
itemId: r,
|
|
405
|
+
openRelated: l == null ? void 0 : l.openRelated,
|
|
406
|
+
editable: De
|
|
407
|
+
}), yt = on(), bt = pn(c, r, e.field), D = gn(J, {
|
|
408
|
+
off: !!yt && !!bt && hn(e)
|
|
409
|
+
}), ye = tn(c, r && r !== "new" ? r : null), gt = On(), S = l == null ? void 0 : l.remoteChanges[e.field], K = l == null ? void 0 : l.lockReasons[e.field], P = l == null ? void 0 : l.applyToLines[e.field], He = (Qe = l == null ? void 0 : l.duplicates) == null ? void 0 : Qe[e.field], H = Mn(), Z = H == null ? void 0 : H.fields[e.field], vt = H == null ? void 0 : H.hints[e.field], R = er(), wt = (R == null ? void 0 : R.applied(e.field)) ?? !1, Oe = (R == null ? void 0 : R.hintFor(e.field)) ?? null, be = En(R, e.field, De), ge = () => {
|
|
410
|
+
var t, o;
|
|
411
|
+
return ((t = fe.current) == null ? void 0 : t.querySelector(rt)) ?? ((o = J.current) == null ? void 0 : o.querySelector(rt));
|
|
412
|
+
}, I = Zt(e._overrides, a, lr(e)), ve = !!(l != null && l.fromAutofill) && !!e._overrides && e._overrides[It] === !0;
|
|
413
|
+
async function kt() {
|
|
403
414
|
var t;
|
|
404
|
-
if (
|
|
405
|
-
|
|
415
|
+
if (I.perField) return Nt();
|
|
416
|
+
Y(!0);
|
|
406
417
|
try {
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
collection:
|
|
410
|
-
item_id:
|
|
418
|
+
const o = await pe.request(
|
|
419
|
+
Ce("/ai/generate", {
|
|
420
|
+
collection: c,
|
|
421
|
+
item_id: r !== "new" ? r : void 0,
|
|
411
422
|
field: e.field
|
|
412
423
|
})
|
|
413
424
|
);
|
|
414
|
-
((t =
|
|
425
|
+
((t = o.data) == null ? void 0 : t.value) != null && h(e.field, o.data.value);
|
|
415
426
|
} catch {
|
|
416
427
|
} finally {
|
|
417
|
-
|
|
428
|
+
Y(!1);
|
|
418
429
|
}
|
|
419
430
|
}
|
|
420
|
-
async function
|
|
421
|
-
var
|
|
431
|
+
async function Nt() {
|
|
432
|
+
var o, u, k, T;
|
|
422
433
|
const t = {};
|
|
423
|
-
for (const
|
|
424
|
-
|
|
434
|
+
for (const N of ((o = en(e._overrides)) == null ? void 0 : o.tokens) ?? []) N in s && (t[N] = s[N]);
|
|
435
|
+
Y(!0);
|
|
425
436
|
try {
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
collection:
|
|
429
|
-
layout_id: (
|
|
437
|
+
const N = await pe.request(
|
|
438
|
+
Ce("/ai/field-fill", {
|
|
439
|
+
collection: c,
|
|
440
|
+
layout_id: (l == null ? void 0 : l.layoutId) ?? null,
|
|
430
441
|
field: e.field,
|
|
431
|
-
item_id:
|
|
442
|
+
item_id: r && r !== "new" ? r : null,
|
|
432
443
|
values: t
|
|
433
444
|
})
|
|
434
|
-
),
|
|
435
|
-
typeof
|
|
436
|
-
} catch (
|
|
437
|
-
|
|
445
|
+
), C = (u = N.data) == null ? void 0 : u.value;
|
|
446
|
+
typeof C == "string" && C !== "" ? h(e.field, C) : de.info("The AI had nothing to write here"), (T = (k = N.data) == null ? void 0 : k.missing) != null && T.length && de.info(`Filled without ${N.data.missing.join(", ")} (empty or not visible to you)`);
|
|
447
|
+
} catch (N) {
|
|
448
|
+
rn(N, "AI fill failed", { action: "Fill with AI" });
|
|
438
449
|
} finally {
|
|
439
|
-
|
|
450
|
+
Y(!1);
|
|
440
451
|
}
|
|
441
452
|
}
|
|
442
|
-
const E =
|
|
443
|
-
const
|
|
444
|
-
(k) => k.one_collection ===
|
|
453
|
+
const E = Ln(e.dependency_config), Ke = E.flatMap((t) => {
|
|
454
|
+
const o = x.find(
|
|
455
|
+
(k) => k.one_collection === c && k.one_field === t.parent_field
|
|
445
456
|
);
|
|
446
|
-
if (!
|
|
447
|
-
if (
|
|
448
|
-
const
|
|
449
|
-
(k) => k.many_collection ===
|
|
457
|
+
if (!o) return [];
|
|
458
|
+
if (o.junction_field) return [{ rule: t, rel: o }];
|
|
459
|
+
const u = x.find(
|
|
460
|
+
(k) => k.many_collection === o.many_collection && k.id !== o.id
|
|
450
461
|
);
|
|
451
|
-
return
|
|
452
|
-
}),
|
|
453
|
-
queries:
|
|
454
|
-
queryKey: ["m2m-items", t.many_collection, t.many_field,
|
|
455
|
-
queryFn: () =>
|
|
456
|
-
|
|
457
|
-
filter: JSON.stringify({ [t.many_field]: { _eq:
|
|
462
|
+
return u != null && u.many_field ? [{ rule: t, rel: { ...o, junction_field: u.many_field } }] : [];
|
|
463
|
+
}), _t = Bt({
|
|
464
|
+
queries: Ke.map(({ rel: t }) => ({
|
|
465
|
+
queryKey: ["m2m-items", t.many_collection, t.many_field, r],
|
|
466
|
+
queryFn: () => pe.request(
|
|
467
|
+
z(`/items/${t.many_collection}`, {
|
|
468
|
+
filter: JSON.stringify({ [t.many_field]: { _eq: r } }),
|
|
458
469
|
limit: 200,
|
|
459
470
|
fields: `id,${t.junction_field}`
|
|
460
471
|
})
|
|
461
|
-
).then((
|
|
462
|
-
enabled: !!
|
|
472
|
+
).then((o) => o.data ?? []),
|
|
473
|
+
enabled: !!r && r !== "new",
|
|
463
474
|
staleTime: 3e4
|
|
464
475
|
}))
|
|
465
|
-
}),
|
|
466
|
-
|
|
467
|
-
var
|
|
468
|
-
const k =
|
|
476
|
+
}), Ft = Object.fromEntries(
|
|
477
|
+
Ke.map(({ rule: t, rel: o }, u) => {
|
|
478
|
+
var N;
|
|
479
|
+
const k = o.one_field ?? `${o.many_collection}.${o.junction_field}`, T = (y == null ? void 0 : y.getStagedUnlinks(k)) ?? /* @__PURE__ */ new Set();
|
|
469
480
|
return [
|
|
470
481
|
t.parent_field,
|
|
471
|
-
(((
|
|
482
|
+
(((N = _t[u]) == null ? void 0 : N.data) ?? []).filter((C) => !T.has(C.id)).map((C) => C[o.junction_field])
|
|
472
483
|
];
|
|
473
484
|
})
|
|
474
|
-
),
|
|
475
|
-
if (!
|
|
485
|
+
), ee = dn()[e.field] ?? [];
|
|
486
|
+
if (!st && (!g || !e.layout_assigned && (e.hidden || Sn.has(e.field))))
|
|
476
487
|
return null;
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
required: !!(e.required ||
|
|
488
|
+
const U = s[e.field] ?? null, te = Kn(e, gt), F = te.label ?? j(e.field);
|
|
489
|
+
qe.current = F !== "", Ae.current = {
|
|
490
|
+
required: !!(e.required || tt(e.validation_rules, s)),
|
|
480
491
|
hasError: !!w
|
|
481
492
|
};
|
|
482
|
-
const
|
|
493
|
+
const $ = it(e), Ue = $ ? null : Un(e), We = $ || !(r === "new" || !r || (Ge = _ == null ? void 0 : _.dirtyFields) != null && Ge.has(e.field)) ? null : In(e, s), Ct = !$ && !d && !e.readonly && ((Ye = e._overrides) == null ? void 0 : Ye.repeat_last) === !0, Rt = An(e, s), Lt = (Xe = (Je = $n(e.options)) == null ? void 0 : Je.auto_id) == null ? void 0 : Xe.pattern, v = (() => {
|
|
483
494
|
const t = x.find(
|
|
484
|
-
(
|
|
495
|
+
(u) => u.one_collection === c && u.one_field === e.field
|
|
485
496
|
);
|
|
486
497
|
if (!t) return null;
|
|
487
498
|
if (t.junction_field) return t;
|
|
488
|
-
const
|
|
489
|
-
(
|
|
499
|
+
const o = x.find(
|
|
500
|
+
(u) => u.many_collection === t.many_collection && u.id !== t.id
|
|
490
501
|
);
|
|
491
|
-
return
|
|
492
|
-
})(),
|
|
502
|
+
return o ? { ...t, junction_field: o.many_field } : null;
|
|
503
|
+
})(), we = v ? null : x.find((t) => t.many_collection === c && t.many_field === e.field) ?? null, ke = v ? x.find(
|
|
493
504
|
(t) => t.many_collection === v.many_collection && t.many_field === v.junction_field && t.id !== v.id
|
|
494
|
-
) ?? null : null,
|
|
505
|
+
) ?? null : null, O = v ? v.one_field ?? `${v.many_collection}.${v.junction_field}` : null, Ne = O ? (y == null ? void 0 : y.getStagedLinks(O)) ?? [] : [], St = v ? (Se.getQueryData([
|
|
495
506
|
"m2m-items",
|
|
496
507
|
v.many_collection,
|
|
497
508
|
v.many_field,
|
|
498
|
-
|
|
499
|
-
]) ?? []).map((t) => t[v.junction_field]) : [],
|
|
500
|
-
var
|
|
501
|
-
return ((
|
|
502
|
-
}, A =
|
|
509
|
+
r
|
|
510
|
+
]) ?? []).map((t) => t[v.junction_field]) : [], Ve = v ? Ne[0] ?? St[0] ?? null : U, _e = (ke == null ? void 0 : ke.one_collection) ?? (we == null ? void 0 : we.one_collection) ?? void 0, $t = !!Z && !d && !e.readonly && (v ? !(Z.filled || Ne.length > 0) : ot(U)), Tt = !!vt && !d && ot(U), ne = (t) => {
|
|
511
|
+
var o;
|
|
512
|
+
return ((_ == null ? void 0 : _.collection) === c ? (o = _ == null ? void 0 : _.fieldLabels) == null ? void 0 : o[t] : void 0) ?? j(String(t));
|
|
513
|
+
}, A = Tn({
|
|
503
514
|
rules: E,
|
|
504
515
|
// A parent whose value THIS field's own pick derived must not narrow this
|
|
505
516
|
// field's options — otherwise picking a region locks the region picker
|
|
506
517
|
// into the zone the pick itself filled, and cross-zone changes read as
|
|
507
518
|
// "No results".
|
|
508
519
|
skipParent: (t) => {
|
|
509
|
-
var
|
|
510
|
-
return ((
|
|
520
|
+
var o;
|
|
521
|
+
return ((o = y == null ? void 0 : y.getDerivedOrigin) == null ? void 0 : o.call(y, t)) === e.field;
|
|
511
522
|
},
|
|
512
523
|
parentValue: (t) => {
|
|
513
|
-
if (
|
|
514
|
-
const
|
|
515
|
-
if (!
|
|
516
|
-
let
|
|
517
|
-
if (!
|
|
518
|
-
const
|
|
519
|
-
(
|
|
524
|
+
if (s[t] != null) return s[t];
|
|
525
|
+
const o = x.find((q) => q.one_collection === c && q.one_field === t);
|
|
526
|
+
if (!o) return null;
|
|
527
|
+
let u = o;
|
|
528
|
+
if (!u.junction_field) {
|
|
529
|
+
const q = x.find(
|
|
530
|
+
(Ie) => Ie.many_collection === o.many_collection && Ie.id !== o.id
|
|
520
531
|
);
|
|
521
|
-
if (
|
|
532
|
+
if (q != null && q.many_field) u = { ...o, junction_field: q.many_field };
|
|
522
533
|
else return null;
|
|
523
534
|
}
|
|
524
|
-
const k =
|
|
525
|
-
return
|
|
535
|
+
const k = u.one_field ?? `${u.many_collection}.${u.junction_field}`, T = (y == null ? void 0 : y.getStagedLinks(k)) ?? [], N = Ft[t] ?? [], C = [...new Set([...T, ...N].map((q) => String(q)))];
|
|
536
|
+
return C.length === 0 ? null : C.length === 1 ? C[0] : C;
|
|
526
537
|
},
|
|
527
538
|
parentOptionFilter: (t) => {
|
|
528
|
-
var
|
|
529
|
-
const
|
|
530
|
-
return
|
|
539
|
+
var u;
|
|
540
|
+
const o = (_ == null ? void 0 : _.collection) === c ? (u = _.fieldOptionFilters) == null ? void 0 : u[t] : void 0;
|
|
541
|
+
return o ? tr(o, s, r) : void 0;
|
|
531
542
|
}
|
|
532
|
-
}),
|
|
533
|
-
function
|
|
534
|
-
const t =
|
|
543
|
+
}), W = A.filter ? Xn(dt, A.filter, Zn) : A.filter, V = A.satisfiedParents.map(ne), re = A.satisfiedParents, qt = A.unsatisfiedParents.length ? ne(A.unsatisfiedParents[0]) : null, Fe = A.missingRequiredParents, ze = Fe.length ? ne(Fe[0]) : null;
|
|
544
|
+
function At() {
|
|
545
|
+
const t = Me.current;
|
|
535
546
|
if (t && t.src === e) return t.value;
|
|
536
|
-
const
|
|
537
|
-
return
|
|
547
|
+
const o = { ...e, readonly: !0 };
|
|
548
|
+
return Me.current = { src: e, value: o }, o;
|
|
538
549
|
}
|
|
539
|
-
function
|
|
540
|
-
const t =
|
|
541
|
-
|
|
550
|
+
function Pt() {
|
|
551
|
+
const t = ar(
|
|
552
|
+
re,
|
|
542
553
|
e.field,
|
|
543
554
|
y == null ? void 0 : y.getDerivedOrigin
|
|
544
|
-
),
|
|
545
|
-
if (
|
|
555
|
+
), o = JSON.stringify([V, re, t]), u = Be.current;
|
|
556
|
+
if (u && u.sig === o && u.onChange === h) return u.value;
|
|
546
557
|
const k = {
|
|
547
|
-
labels:
|
|
548
|
-
keys:
|
|
558
|
+
labels: V,
|
|
559
|
+
keys: re,
|
|
549
560
|
clearable: t,
|
|
550
|
-
onClear: t.length > 0 ? (
|
|
551
|
-
t.includes(
|
|
561
|
+
onClear: t.length > 0 ? (T) => {
|
|
562
|
+
t.includes(T) && h(T, null);
|
|
552
563
|
} : void 0
|
|
553
564
|
};
|
|
554
|
-
return
|
|
565
|
+
return Be.current = { sig: o, onChange: h, value: k }, k;
|
|
555
566
|
}
|
|
556
|
-
function
|
|
557
|
-
for (const t of
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
567
|
+
function Et() {
|
|
568
|
+
for (const t of re) {
|
|
569
|
+
const o = document.querySelector(`[data-field="${t}"]`);
|
|
570
|
+
o && (o.scrollIntoView({ behavior: "smooth", block: "center" }), o.style.transition = "box-shadow 0.15s ease", o.style.boxShadow = "0 0 0 2px rgb(var(--nvr-cyan-rgb, 0 206 255)), 0 0 0 5px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.25)", o.style.borderRadius = "12px", setTimeout(() => {
|
|
571
|
+
o.style.boxShadow = "none", setTimeout(() => {
|
|
572
|
+
o.style.transition = "", o.style.borderRadius = "";
|
|
562
573
|
}, 300);
|
|
563
574
|
}, 900));
|
|
564
575
|
}
|
|
565
576
|
}
|
|
566
|
-
const
|
|
567
|
-
const t = v &&
|
|
568
|
-
if (t != null && t !== "" && !(Array.isArray(t) && !t.length) && (
|
|
577
|
+
const jt = () => {
|
|
578
|
+
const t = v && O ? Ve : s[e.field];
|
|
579
|
+
if (t != null && t !== "" && !(Array.isArray(t) && !t.length) && (he == null || he({
|
|
569
580
|
field: e.field,
|
|
570
|
-
label:
|
|
571
|
-
parents: E.map((
|
|
572
|
-
})), v &&
|
|
573
|
-
for (const
|
|
574
|
-
const
|
|
581
|
+
label: F || j(e.field),
|
|
582
|
+
parents: E.map((o) => o.parent_field).filter(Boolean)
|
|
583
|
+
})), v && O) {
|
|
584
|
+
for (const u of Ne) y == null || y.unstageLink(O, u);
|
|
585
|
+
const o = Se.getQueryData([
|
|
575
586
|
"m2m-items",
|
|
576
587
|
v.many_collection,
|
|
577
588
|
v.many_field,
|
|
578
|
-
|
|
589
|
+
r
|
|
579
590
|
]) ?? [];
|
|
580
|
-
for (const
|
|
591
|
+
for (const u of o) y == null || y.stageUnlink(O, u.id);
|
|
581
592
|
} else
|
|
582
593
|
h(e.field, null);
|
|
583
594
|
};
|
|
584
595
|
return (
|
|
585
596
|
// biome-ignore lint/a11y/noStaticElementInteractions: the wrapper only hosts the field context menu (right-click / Shift+F10); the inputs inside stay the controls
|
|
586
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ m(
|
|
587
598
|
"div",
|
|
588
599
|
{
|
|
589
|
-
ref:
|
|
600
|
+
ref: J,
|
|
590
601
|
"data-field": e.field,
|
|
591
|
-
"data-field-collection":
|
|
602
|
+
"data-field-collection": c,
|
|
592
603
|
"data-field-interface": e.interface ?? void 0,
|
|
593
|
-
"data-autofill-check":
|
|
594
|
-
className:
|
|
604
|
+
"data-autofill-check": ve ? "" : void 0,
|
|
605
|
+
className: B(
|
|
595
606
|
"group/fieldrow space-y-1.5",
|
|
596
|
-
|
|
607
|
+
ve && "rounded-md bg-amber-50/60 p-1.5 ring-1 ring-amber-300 dark:bg-amber-500/10 dark:ring-amber-500/40"
|
|
597
608
|
),
|
|
598
|
-
onContextMenu:
|
|
599
|
-
onKeyDown:
|
|
600
|
-
onFocusCapture:
|
|
609
|
+
onContextMenu: ut,
|
|
610
|
+
onKeyDown: mt,
|
|
611
|
+
onFocusCapture: D.onFocusCapture,
|
|
601
612
|
children: [
|
|
602
|
-
|
|
613
|
+
pt,
|
|
603
614
|
E.length > 0 && /* @__PURE__ */ n(
|
|
604
|
-
|
|
615
|
+
qn,
|
|
605
616
|
{
|
|
606
617
|
cascadeRules: E,
|
|
607
|
-
cascadeFilter:
|
|
608
|
-
currentValue:
|
|
609
|
-
relatedCollection:
|
|
610
|
-
missingRequiredParents:
|
|
611
|
-
onClear:
|
|
618
|
+
cascadeFilter: W,
|
|
619
|
+
currentValue: Ve,
|
|
620
|
+
relatedCollection: _e,
|
|
621
|
+
missingRequiredParents: Fe,
|
|
622
|
+
onClear: jt
|
|
612
623
|
}
|
|
613
624
|
),
|
|
614
|
-
(
|
|
625
|
+
(F !== "" || ee.length > 0) && /* @__PURE__ */ m(
|
|
615
626
|
"div",
|
|
616
627
|
{
|
|
617
628
|
className: "flex flex-wrap items-center gap-1.5 min-h-[1.5rem]",
|
|
618
|
-
"data-pd-row":
|
|
629
|
+
"data-pd-row": be ? "" : void 0,
|
|
619
630
|
children: [
|
|
620
|
-
|
|
621
|
-
/* @__PURE__ */ n(
|
|
622
|
-
(e.required ||
|
|
623
|
-
|
|
631
|
+
F !== "" && /* @__PURE__ */ m(cn, { id: M, "data-field-label": !0, className: "text-sm font-medium", children: [
|
|
632
|
+
/* @__PURE__ */ n(nt, { text: F, collection: c }),
|
|
633
|
+
(e.required || tt(e.validation_rules, s)) && /* @__PURE__ */ n("span", { className: "ml-0.5 text-destructive", children: "*" }),
|
|
634
|
+
Wn(e) && /* @__PURE__ */ n(Vn, {})
|
|
624
635
|
] }),
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
/* @__PURE__ */ n(
|
|
636
|
+
$t && Z && /* @__PURE__ */ n(Dn, { field: e.field, mark: Z }),
|
|
637
|
+
te.note && /* @__PURE__ */ n(oe, { delayDuration: 100, children: /* @__PURE__ */ m(ie, { children: [
|
|
638
|
+
/* @__PURE__ */ n(le, { asChild: !0, children: /* @__PURE__ */ n(Dt, { className: "h-3.5 w-3.5 shrink-0 cursor-help text-slate-400 hover:text-slate-600" }) }),
|
|
639
|
+
/* @__PURE__ */ n(ae, { side: "top", className: "max-w-[240px] text-[12px]", children: (l == null ? void 0 : l.glossaryHelp) === !1 ? te.note : /* @__PURE__ */ n(nt, { text: te.note, collection: c }) })
|
|
628
640
|
] }) }),
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
641
|
+
Te && /* @__PURE__ */ n(sn, { source: Te, label: F }),
|
|
642
|
+
!$ && r && r !== "new" && /* @__PURE__ */ n(
|
|
643
|
+
dr,
|
|
632
644
|
{
|
|
633
|
-
collection:
|
|
634
|
-
itemId:
|
|
645
|
+
collection: c,
|
|
646
|
+
itemId: r,
|
|
635
647
|
field: e.field,
|
|
636
648
|
onRestore: e.readonly ? void 0 : (t) => h(e.field, t)
|
|
637
649
|
}
|
|
638
650
|
),
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
651
|
+
!$ && r && r !== "new" && /* @__PURE__ */ n(ur, { collection: c, itemId: r, field: e.field }),
|
|
652
|
+
!$ && r && r !== "new" && /* @__PURE__ */ n(kn, { field: e.field, label: F || j(e.field) }),
|
|
653
|
+
r && r !== "new" && ye.length > 0 && // Realtime round 7 #4 — "Point Beth to this field": opens the field menu, whose
|
|
654
|
+
// Point items name each person on the record now. Revealed on hover/focus; the
|
|
655
|
+
// slot is kept (opacity) so the row never shifts.
|
|
656
|
+
/* @__PURE__ */ n(
|
|
657
|
+
"button",
|
|
644
658
|
{
|
|
645
|
-
|
|
646
|
-
|
|
659
|
+
type: "button",
|
|
660
|
+
"data-field-menu-trigger": "",
|
|
661
|
+
"data-field-point-trigger": "",
|
|
662
|
+
"aria-label": `Point someone to ${F || j(e.field)}`,
|
|
663
|
+
"data-tip": ye.length === 1 ? `Point ${ye[0].name} to this field` : "Point someone on this record to this field",
|
|
664
|
+
onClick: (t) => ht(t.currentTarget),
|
|
665
|
+
className: B(
|
|
666
|
+
"inline-flex items-center rounded p-0.5 text-slate-400 transition-opacity hover:text-nvr-cyan focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-slate-400 dark:hover:text-nvr-cyan",
|
|
667
|
+
ft ? "opacity-100 text-nvr-cyan" : "opacity-0 group-hover/fieldrow:opacity-100"
|
|
668
|
+
),
|
|
669
|
+
children: /* @__PURE__ */ n(Ht, { className: "h-3 w-3" })
|
|
670
|
+
}
|
|
671
|
+
),
|
|
672
|
+
r && r !== "new" && Rt && /* @__PURE__ */ n(cr, { collection: c, itemId: r, field: e.field }),
|
|
673
|
+
Ct && /* @__PURE__ */ n(
|
|
674
|
+
zn,
|
|
675
|
+
{
|
|
676
|
+
collection: c,
|
|
677
|
+
itemId: r,
|
|
647
678
|
field: e.field,
|
|
648
|
-
label:
|
|
679
|
+
label: F || j(e.field),
|
|
649
680
|
onFill: (t) => h(e.field, t)
|
|
650
681
|
}
|
|
651
682
|
),
|
|
652
|
-
|
|
683
|
+
!$ && I.show && !(I.perField && (d || e.readonly)) && /* @__PURE__ */ m(
|
|
653
684
|
"button",
|
|
654
685
|
{
|
|
655
686
|
type: "button",
|
|
656
|
-
onClick:
|
|
657
|
-
disabled:
|
|
658
|
-
"data-ai-fill":
|
|
687
|
+
onClick: kt,
|
|
688
|
+
disabled: $e,
|
|
689
|
+
"data-ai-fill": I.perField ? e.field : void 0,
|
|
659
690
|
className: "inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 disabled:opacity-50 transition-colors",
|
|
660
691
|
title: "Generate with AI",
|
|
661
692
|
children: [
|
|
662
|
-
|
|
693
|
+
$e ? /* @__PURE__ */ n(Ot, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ n(Kt, { className: "h-3 w-3" }),
|
|
663
694
|
"AI"
|
|
664
695
|
]
|
|
665
696
|
}
|
|
666
697
|
),
|
|
667
|
-
|
|
698
|
+
ve && /* @__PURE__ */ n(
|
|
668
699
|
"span",
|
|
669
700
|
{
|
|
670
701
|
"data-tip": "People often change what the AI read from the document here — check it",
|
|
@@ -673,36 +704,36 @@ const Fr = jt(function({
|
|
|
673
704
|
}
|
|
674
705
|
),
|
|
675
706
|
f,
|
|
676
|
-
|
|
707
|
+
P && !d && !e.readonly && /* @__PURE__ */ m(
|
|
677
708
|
"button",
|
|
678
709
|
{
|
|
679
710
|
type: "button",
|
|
680
|
-
onClick: () =>
|
|
681
|
-
disabled:
|
|
711
|
+
onClick: () => P.onApply(s[e.field] ?? null),
|
|
712
|
+
disabled: s[e.field] == null || s[e.field] === "" || P.count === 0,
|
|
682
713
|
"data-apply-to-lines": e.field,
|
|
683
|
-
"data-tip":
|
|
714
|
+
"data-tip": P.count === 0 ? "No lines yet — add lines first" : s[e.field] == null || s[e.field] === "" ? "Pick a value first" : P.count != null ? `Copy this value onto all ${P.count} lines (staged until you save)` : "Copy this value onto every line (staged until you save)",
|
|
684
715
|
className: "inline-flex items-center gap-1 rounded border border-nvr-cyan/40 px-1.5 py-0.5 text-[10.5px] font-medium text-[#0e7490] transition-colors hover:bg-nvr-cyan/10 disabled:cursor-not-allowed disabled:opacity-40 dark:text-nvr-cyan",
|
|
685
716
|
children: [
|
|
686
|
-
|
|
717
|
+
P.label ?? "Apply to lines",
|
|
687
718
|
" ↓"
|
|
688
719
|
]
|
|
689
720
|
}
|
|
690
721
|
),
|
|
691
|
-
|
|
692
|
-
/* @__PURE__ */ n(
|
|
722
|
+
ee.length > 0 && /* @__PURE__ */ n(oe, { delayDuration: 100, children: /* @__PURE__ */ m(ie, { children: [
|
|
723
|
+
/* @__PURE__ */ n(le, { asChild: !0, children: /* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 border border-amber-200 dark:bg-amber-500/10 dark:text-amber-400 dark:border-amber-500/20 cursor-default", children: [
|
|
693
724
|
/* @__PURE__ */ n("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400 shrink-0" }),
|
|
694
725
|
"addendum"
|
|
695
726
|
] }) }),
|
|
696
|
-
/* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ m(ae, { side: "top", className: "max-w-[220px] text-[12px]", children: [
|
|
728
|
+
/* @__PURE__ */ m("p", { className: "font-medium mb-1", children: [
|
|
698
729
|
"In active addendum",
|
|
699
|
-
|
|
730
|
+
ee.length > 1 ? "s" : "",
|
|
700
731
|
":"
|
|
701
732
|
] }),
|
|
702
|
-
|
|
733
|
+
ee.map((t) => /* @__PURE__ */ m("p", { className: "text-slate-400", children: [
|
|
703
734
|
t.title,
|
|
704
735
|
" ",
|
|
705
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ m("span", { className: "capitalize", children: [
|
|
706
737
|
"(",
|
|
707
738
|
t.status,
|
|
708
739
|
")"
|
|
@@ -711,65 +742,86 @@ const Fr = jt(function({
|
|
|
711
742
|
] })
|
|
712
743
|
] }) }),
|
|
713
744
|
/* @__PURE__ */ n(
|
|
714
|
-
|
|
745
|
+
Fn,
|
|
715
746
|
{
|
|
716
|
-
collection:
|
|
747
|
+
collection: c,
|
|
717
748
|
kind: "field",
|
|
718
749
|
name: e.field,
|
|
719
|
-
label:
|
|
750
|
+
label: F
|
|
751
|
+
}
|
|
752
|
+
),
|
|
753
|
+
S && !S.conflict && /* @__PURE__ */ n(
|
|
754
|
+
Yn,
|
|
755
|
+
{
|
|
756
|
+
change: S,
|
|
757
|
+
now: s[e.field],
|
|
758
|
+
field: e,
|
|
759
|
+
relatedCollection: _e ?? null,
|
|
760
|
+
onDismiss: () => l == null ? void 0 : l.dismissRemoteChange(e.field)
|
|
720
761
|
}
|
|
721
762
|
),
|
|
722
|
-
(
|
|
723
|
-
/* @__PURE__ */ n(
|
|
724
|
-
/* @__PURE__ */ n(
|
|
763
|
+
(d || e.readonly) && K ? /* @__PURE__ */ n(vn, { reason: K, onHover: l == null ? void 0 : l.onLockHover }) : d ? /* @__PURE__ */ n(oe, { delayDuration: 200, children: /* @__PURE__ */ m(ie, { children: [
|
|
764
|
+
/* @__PURE__ */ n(le, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "inline-flex items-center text-amber-400 dark:text-amber-500", children: /* @__PURE__ */ n(Ut, { className: "h-3 w-3" }) }) }),
|
|
765
|
+
/* @__PURE__ */ n(ae, { side: "top", className: "text-[12px]", children: "This field is locked" })
|
|
725
766
|
] }) }) : null,
|
|
726
767
|
E.length > 0 && (() => {
|
|
727
|
-
const t = !!
|
|
728
|
-
(
|
|
768
|
+
const t = !!W && Object.keys(W).length > 0 && V.length > 0, o = E.map(
|
|
769
|
+
(u) => ne(String(u.parent_field))
|
|
729
770
|
);
|
|
730
|
-
return /* @__PURE__ */ n(
|
|
731
|
-
/* @__PURE__ */ n(
|
|
771
|
+
return /* @__PURE__ */ n(oe, { delayDuration: 100, children: /* @__PURE__ */ m(ie, { children: [
|
|
772
|
+
/* @__PURE__ */ n(le, { asChild: !0, children: /* @__PURE__ */ n(
|
|
732
773
|
"button",
|
|
733
774
|
{
|
|
734
775
|
type: "button",
|
|
735
|
-
"aria-label": `Show the fields that narrow ${
|
|
736
|
-
onClick:
|
|
737
|
-
className:
|
|
776
|
+
"aria-label": `Show the fields that narrow ${F || "this list"}`,
|
|
777
|
+
onClick: Et,
|
|
778
|
+
className: B(
|
|
738
779
|
"inline-flex items-center transition-colors",
|
|
739
780
|
t ? "text-nvr-cyan hover:text-nvr-cyan" : "text-slate-300 hover:text-nvr-cyan dark:text-slate-600 dark:hover:text-nvr-cyan"
|
|
740
781
|
),
|
|
741
|
-
children: /* @__PURE__ */ n(
|
|
782
|
+
children: /* @__PURE__ */ n(Wt, { className: "h-3 w-3" })
|
|
742
783
|
}
|
|
743
784
|
) }),
|
|
744
|
-
/* @__PURE__ */ n(
|
|
785
|
+
/* @__PURE__ */ n(ae, { side: "top", className: "text-[12px]", children: t ? `Filtered by ${V.join(", ")} — click to highlight` : `Options filter by ${o.join(", ")} once set` })
|
|
745
786
|
] }) });
|
|
746
787
|
})(),
|
|
747
|
-
|
|
788
|
+
!$ && r && r !== "new" && e.type !== "alias" && !e.field.startsWith("__") && // Realtime round 7 #7 — where the value came from ("Set by ERP Sync · 2 m ago"):
|
|
789
|
+
// while it has just changed live, and when the pointer rests on the field.
|
|
790
|
+
/* @__PURE__ */ n(
|
|
791
|
+
_n,
|
|
792
|
+
{
|
|
793
|
+
collection: c,
|
|
794
|
+
itemId: r,
|
|
795
|
+
field: e.field,
|
|
796
|
+
live: !!S && !S.conflict
|
|
797
|
+
}
|
|
798
|
+
),
|
|
799
|
+
be && // Right-anchored: the personal-default control flush with the field's right edge
|
|
748
800
|
// (it carries Make / Update / Clear itself — no ⋯ button; right-click and
|
|
749
801
|
// Shift+F10 still open the field menu). The slot keeps one box whatever it shows,
|
|
750
802
|
// so nothing to its left moves.
|
|
751
803
|
/* @__PURE__ */ n("span", { className: "ml-auto inline-flex shrink-0 items-center gap-1", children: /* @__PURE__ */ n(
|
|
752
|
-
|
|
804
|
+
jn,
|
|
753
805
|
{
|
|
754
806
|
field: e.field,
|
|
755
|
-
label:
|
|
756
|
-
state:
|
|
757
|
-
confirmOpen:
|
|
758
|
-
onConfirm: (t,
|
|
807
|
+
label: F,
|
|
808
|
+
state: be,
|
|
809
|
+
confirmOpen: xe === "make" || xe === "update" ? xe : null,
|
|
810
|
+
onConfirm: (t, o) => (
|
|
759
811
|
// After a save the button becomes "Your default": focus goes to the field.
|
|
760
|
-
|
|
812
|
+
xt(t, ge, o)
|
|
761
813
|
),
|
|
762
814
|
onUndo: () => {
|
|
763
815
|
R == null || R.undo(e.field), requestAnimationFrame(() => {
|
|
764
816
|
var t;
|
|
765
|
-
return (t =
|
|
817
|
+
return (t = ge()) == null ? void 0 : t.focus();
|
|
766
818
|
});
|
|
767
819
|
},
|
|
768
820
|
onCleared: () => (
|
|
769
821
|
// The Clear button is gone (and not a tab stop): focus goes to the field.
|
|
770
822
|
requestAnimationFrame(() => {
|
|
771
823
|
var t;
|
|
772
|
-
return (t =
|
|
824
|
+
return (t = ge()) == null ? void 0 : t.focus();
|
|
773
825
|
})
|
|
774
826
|
)
|
|
775
827
|
}
|
|
@@ -777,78 +829,88 @@ const Fr = jt(function({
|
|
|
777
829
|
]
|
|
778
830
|
}
|
|
779
831
|
),
|
|
780
|
-
|
|
781
|
-
|
|
832
|
+
D.editor && !d && /* @__PURE__ */ n(
|
|
833
|
+
wn,
|
|
782
834
|
{
|
|
783
|
-
editor:
|
|
784
|
-
confirming:
|
|
785
|
-
onConfirm:
|
|
786
|
-
onCancel:
|
|
835
|
+
editor: D.editor,
|
|
836
|
+
confirming: D.confirming,
|
|
837
|
+
onConfirm: D.confirm,
|
|
838
|
+
onCancel: D.cancel
|
|
787
839
|
}
|
|
788
840
|
),
|
|
789
|
-
|
|
841
|
+
Q ?? /* @__PURE__ */ n(
|
|
790
842
|
"div",
|
|
791
843
|
{
|
|
792
|
-
ref:
|
|
793
|
-
className:
|
|
794
|
-
"data-tip": (
|
|
795
|
-
onPointerEnter: (
|
|
844
|
+
ref: fe,
|
|
845
|
+
className: B(d && !G && "cursor-not-allowed"),
|
|
846
|
+
"data-tip": (d || e.readonly) && K ? K : void 0,
|
|
847
|
+
onPointerEnter: (d || e.readonly) && K ? l == null ? void 0 : l.onLockHover : void 0,
|
|
796
848
|
children: /* @__PURE__ */ n(
|
|
797
849
|
"div",
|
|
798
850
|
{
|
|
799
|
-
ref:
|
|
800
|
-
className:
|
|
851
|
+
ref: Ee,
|
|
852
|
+
className: B(
|
|
801
853
|
// A locked FILE field stays interactive: its chips keep the
|
|
802
854
|
// download link and preview click (the component itself hides
|
|
803
855
|
// upload/replace/remove when readonly) — blocking pointer events
|
|
804
856
|
// made attachments unopenable on every locked form (addendum
|
|
805
857
|
// view, terminal states).
|
|
806
|
-
|
|
858
|
+
d && !G && "pointer-events-none opacity-60",
|
|
807
859
|
// The ring lands with a 2px shake so the eye finds the field;
|
|
808
860
|
// the animation runs once when the class is added.
|
|
809
861
|
w && "nvr-shake ring-1 ring-red-400 rounded-md",
|
|
810
|
-
|
|
862
|
+
me && "nvr-autofill-glow"
|
|
811
863
|
),
|
|
812
|
-
children:
|
|
813
|
-
|
|
864
|
+
children: $ ? /* @__PURE__ */ n(Qn, { field: e, values: s }) : Lt ? /* @__PURE__ */ n(
|
|
865
|
+
un,
|
|
814
866
|
{
|
|
815
|
-
collection:
|
|
867
|
+
collection: c,
|
|
816
868
|
field: e,
|
|
817
|
-
draft:
|
|
818
|
-
itemId:
|
|
869
|
+
draft: s,
|
|
870
|
+
itemId: r
|
|
819
871
|
}
|
|
820
872
|
) : b ? b({
|
|
821
873
|
field: e,
|
|
822
|
-
value:
|
|
823
|
-
onChange:
|
|
824
|
-
disabled:
|
|
825
|
-
collection:
|
|
826
|
-
itemId:
|
|
874
|
+
value: U,
|
|
875
|
+
onChange: je,
|
|
876
|
+
disabled: d,
|
|
877
|
+
collection: c,
|
|
878
|
+
itemId: r,
|
|
827
879
|
relations: x,
|
|
828
|
-
cascadeFilter:
|
|
829
|
-
unsatisfiedParentLabel:
|
|
830
|
-
requiredParentLabel:
|
|
880
|
+
cascadeFilter: W,
|
|
881
|
+
unsatisfiedParentLabel: qt,
|
|
882
|
+
requiredParentLabel: ze
|
|
831
883
|
}) : /* @__PURE__ */ n(
|
|
832
|
-
|
|
884
|
+
Nn,
|
|
833
885
|
{
|
|
834
|
-
field:
|
|
835
|
-
value:
|
|
836
|
-
onChange:
|
|
886
|
+
field: d && G ? At() : e,
|
|
887
|
+
value: U,
|
|
888
|
+
onChange: je,
|
|
837
889
|
relations: x,
|
|
838
|
-
collection:
|
|
839
|
-
itemId:
|
|
840
|
-
cascadeFilter:
|
|
841
|
-
requiredParentLabel:
|
|
842
|
-
narrowedBy:
|
|
843
|
-
onCountChange:
|
|
890
|
+
collection: c,
|
|
891
|
+
itemId: r,
|
|
892
|
+
cascadeFilter: W,
|
|
893
|
+
requiredParentLabel: ze,
|
|
894
|
+
narrowedBy: V.length > 0 ? Pt() : void 0,
|
|
895
|
+
onCountChange: i ? ct : void 0
|
|
844
896
|
}
|
|
845
897
|
)
|
|
846
898
|
},
|
|
847
|
-
|
|
899
|
+
me ?? 0
|
|
848
900
|
)
|
|
849
901
|
}
|
|
850
902
|
),
|
|
851
|
-
|
|
903
|
+
Ue && /* @__PURE__ */ n(Gn, { value: s[e.field], config: Ue }),
|
|
904
|
+
r && r !== "new" && // rt9 #10: "Moved 2 days later because PO due date changed" when the app re-derived it.
|
|
905
|
+
/* @__PURE__ */ n(
|
|
906
|
+
fn,
|
|
907
|
+
{
|
|
908
|
+
collection: c,
|
|
909
|
+
itemId: r,
|
|
910
|
+
field: e.field,
|
|
911
|
+
type: e.type
|
|
912
|
+
}
|
|
913
|
+
),
|
|
852
914
|
w && // The message under the field: a red border alone never said WHY (Service End before
|
|
853
915
|
// Start, b01-N5). The form's summary at the top lists it too — and is
|
|
854
916
|
// the ONE live announcement (army11 f3: ten role=alert regions fired at
|
|
@@ -856,32 +918,50 @@ const Fr = jt(function({
|
|
|
856
918
|
/* @__PURE__ */ n(
|
|
857
919
|
"p",
|
|
858
920
|
{
|
|
859
|
-
id: `${
|
|
921
|
+
id: `${M}-error`,
|
|
860
922
|
"data-field-error": e.field,
|
|
861
923
|
className: "text-[11.5px] leading-snug text-red-600 dark:text-red-400",
|
|
862
924
|
children: w
|
|
863
925
|
}
|
|
864
926
|
),
|
|
865
|
-
!w &&
|
|
927
|
+
!w && We && // A soft (warning-only) rule the value breaks: said here, never blocks the save.
|
|
866
928
|
/* @__PURE__ */ n(
|
|
867
929
|
"p",
|
|
868
930
|
{
|
|
869
931
|
"data-field-warning": e.field,
|
|
870
932
|
className: "text-[11.5px] leading-snug text-amber-700 dark:text-amber-400",
|
|
871
|
-
children:
|
|
933
|
+
children: We
|
|
934
|
+
}
|
|
935
|
+
),
|
|
936
|
+
((Ze = l == null ? void 0 : l.linkedChanges) == null ? void 0 : Ze[e.field]) && // rt4 #6 — the record this field links to changed while the form was open and is
|
|
937
|
+
// no longer offered here: what happened, under the field. The value stays.
|
|
938
|
+
/* @__PURE__ */ n(
|
|
939
|
+
"p",
|
|
940
|
+
{
|
|
941
|
+
"data-field-linked-change": e.field,
|
|
942
|
+
className: "text-[11.5px] leading-snug text-amber-700 dark:text-amber-400",
|
|
943
|
+
children: l.linkedChanges[e.field]
|
|
872
944
|
}
|
|
873
945
|
),
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
946
|
+
Tt && /* @__PURE__ */ n(Hn, { field: e.field, label: F || j(e.field) }),
|
|
947
|
+
Oe && !wt && /* @__PURE__ */ n(Bn, { field: e.field, text: Oe }),
|
|
948
|
+
He && /* @__PURE__ */ n(xn, { field: e.field, hint: He }),
|
|
949
|
+
(S == null ? void 0 : S.conflict) && /* @__PURE__ */ n(
|
|
950
|
+
Jn,
|
|
878
951
|
{
|
|
879
|
-
change:
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
952
|
+
change: S,
|
|
953
|
+
mine: s[e.field],
|
|
954
|
+
field: e,
|
|
955
|
+
relatedCollection: _e ?? null,
|
|
956
|
+
locked: d || !!e.readonly,
|
|
957
|
+
onKeepMine: () => l == null ? void 0 : l.dismissRemoteChange(e.field),
|
|
958
|
+
onTakeTheirs: l != null && l.takeRemoteChange ? () => {
|
|
883
959
|
var t;
|
|
884
|
-
return (t =
|
|
960
|
+
return (t = l.takeRemoteChange) == null ? void 0 : t.call(l, e.field);
|
|
961
|
+
} : void 0,
|
|
962
|
+
onMerge: l != null && l.mergeRemoteChange ? (t) => {
|
|
963
|
+
var o;
|
|
964
|
+
return (o = l.mergeRemoteChange) == null ? void 0 : o.call(l, e.field, t);
|
|
885
965
|
} : void 0
|
|
886
966
|
}
|
|
887
967
|
)
|
|
@@ -891,9 +971,9 @@ const Fr = jt(function({
|
|
|
891
971
|
);
|
|
892
972
|
});
|
|
893
973
|
export {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
974
|
+
to as FieldRow,
|
|
975
|
+
ar as clearableParents,
|
|
976
|
+
lr as isAiEligible,
|
|
977
|
+
eo as lineageSummary,
|
|
978
|
+
sr as useFieldLineage
|
|
899
979
|
};
|