@nivaro/react 0.3.113 → 0.3.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ScreenShareHost.js +24 -0
- package/dist/full.css +50 -2
- package/dist/hooks/useSessionRecorder.js +61 -60
- package/dist/index.d.ts +1727 -19
- package/dist/index.js +1091 -950
- package/dist/shared/components/ActivityEntry.js +209 -97
- package/dist/shared/components/AgentPresenceChip.js +51 -0
- package/dist/shared/components/AnnouncementBanner.js +56 -41
- package/dist/shared/components/AutolinkedText.js +98 -85
- package/dist/shared/components/BroadcastView.js +149 -141
- package/dist/shared/components/CacheStamp.js +78 -30
- package/dist/shared/components/CollectionBrowserView.js +4088 -3592
- package/dist/shared/components/ConfigChangeStrip.js +63 -0
- package/dist/shared/components/ConfigReachNote.js +107 -0
- package/dist/shared/components/ConformanceView.js +389 -319
- package/dist/shared/components/DataTable.js +544 -504
- package/dist/shared/components/DelegateCoverLine.js +164 -0
- package/dist/shared/components/EnvironmentNotice.js +56 -65
- package/dist/shared/components/FilePreviewLightbox.js +89 -43
- package/dist/shared/components/FindingFixedMark.js +23 -0
- package/dist/shared/components/GridPresenceLine.js +100 -0
- package/dist/shared/components/IdleReloadWatcher.js +82 -43
- package/dist/shared/components/InStep.js +46 -0
- package/dist/shared/components/ItemEditForm.js +5504 -4889
- package/dist/shared/components/LiveAnnouncer.js +62 -0
- package/dist/shared/components/LiveCount.js +54 -0
- package/dist/shared/components/LiveFigure.js +28 -0
- package/dist/shared/components/LiveListControls.js +114 -0
- package/dist/shared/components/LiveNewMatchesPill.js +25 -0
- package/dist/shared/components/LiveOffNote.js +44 -0
- package/dist/shared/components/LivePreferenceHost.js +42 -0
- package/dist/shared/components/LiveRowMark.js +25 -20
- package/dist/shared/components/LiveTraceView.js +257 -0
- package/dist/shared/components/MapView.js +30 -29
- package/dist/shared/components/MatrixEditor.js +497 -462
- package/dist/shared/components/MyWorkView.js +346 -272
- package/dist/shared/components/NotificationBell.js +215 -201
- package/dist/shared/components/PageRenderer.js +636 -599
- package/dist/shared/components/PresenceDot.js +21 -0
- package/dist/shared/components/ProfileView.js +656 -536
- package/dist/shared/components/RealtimeStatusBanner.js +25 -25
- package/dist/shared/components/RecentRecordsRail.js +51 -48
- package/dist/shared/components/RecordCompare.js +241 -150
- package/dist/shared/components/RecordDrilldownSheet.js +66 -64
- package/dist/shared/components/RecordGridEditor.js +350 -311
- package/dist/shared/components/RecordHoverCard.js +147 -0
- package/dist/shared/components/RecordPeekHost.js +111 -0
- package/dist/shared/components/RecordReadView.js +414 -412
- package/dist/shared/components/RelativeTime.js +16 -0
- package/dist/shared/components/ReportView.js +1396 -1304
- package/dist/shared/components/ScreenRefreshButton.js +77 -0
- package/dist/shared/components/TabCountHost.js +10 -0
- package/dist/shared/components/TickerNumber.js +19 -18
- package/dist/shared/components/TipLayer.js +70 -58
- package/dist/shared/components/WidgetImageMenu.js +59 -0
- package/dist/shared/components/WidgetSlot.js +571 -524
- package/dist/shared/components/activity/RecordActivityStream.js +317 -0
- package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
- package/dist/shared/components/cbv/approval-changed.js +20 -0
- package/dist/shared/components/cbv/changed-by-others.js +251 -0
- package/dist/shared/components/cbv/column-totals.js +75 -67
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
- package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
- package/dist/shared/components/change-proposals/types.js +4 -0
- package/dist/shared/components/chat/ChatPanel.js +1571 -1528
- package/dist/shared/components/chat/Composer.js +276 -298
- package/dist/shared/components/chat/room-due.js +13 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
- package/dist/shared/components/collections-directory/directory-data.js +75 -63
- package/dist/shared/components/imports/ImportConsole.js +159 -155
- package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
- package/dist/shared/components/integrations/SendStatus.js +202 -0
- package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
- package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
- package/dist/shared/components/integrations/console/api.js +161 -117
- package/dist/shared/components/integrations/console/tone.js +15 -12
- package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
- package/dist/shared/components/item-edit/CloneDialog.js +208 -206
- package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
- package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
- package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
- package/dist/shared/components/item-edit/FieldComments.js +159 -116
- package/dist/shared/components/item-edit/FieldPointer.js +132 -0
- package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
- package/dist/shared/components/item-edit/FieldRow.js +519 -439
- package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
- package/dist/shared/components/item-edit/FilePickerField.js +454 -369
- package/dist/shared/components/item-edit/GroupSection.js +618 -567
- package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
- package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
- package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
- package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
- package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
- package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
- package/dist/shared/components/item-edit/PickerBadges.js +52 -0
- package/dist/shared/components/item-edit/PlanGrid.js +434 -439
- package/dist/shared/components/item-edit/RecalcValue.js +55 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
- package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
- package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
- package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
- package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
- package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
- package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
- package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
- package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
- package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
- package/dist/shared/components/item-edit/SectionPresence.js +78 -0
- package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
- package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
- package/dist/shared/components/item-edit/coedit/collab.js +84 -0
- package/dist/shared/components/item-edit/coedit/context.js +24 -0
- package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
- package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
- package/dist/shared/components/item-edit/coedit/session.js +382 -0
- package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
- package/dist/shared/components/item-edit/file-live.js +77 -0
- package/dist/shared/components/item-edit/file-processing.js +87 -0
- package/dist/shared/components/item-edit/layout-switch.js +148 -0
- package/dist/shared/components/item-edit/live-related.js +23 -0
- package/dist/shared/components/item-edit/live-title.js +66 -0
- package/dist/shared/components/item-edit/partner-needs.js +142 -0
- package/dist/shared/components/item-edit/removed-line.js +58 -0
- package/dist/shared/components/item-edit/render-stability.js +70 -59
- package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
- package/dist/shared/components/layout-editor/CollabParts.js +72 -70
- package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
- package/dist/shared/components/list/InlineEdit.js +504 -208
- package/dist/shared/components/list/ListViewers.js +81 -0
- package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
- package/dist/shared/components/merge/MergeWithFlow.js +290 -0
- package/dist/shared/components/merge/merge-values.js +110 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
- package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
- package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
- package/dist/shared/components/notifications/bundles.js +21 -19
- package/dist/shared/components/notifications/resolved-line.js +25 -0
- package/dist/shared/components/ops/OpsTasksView.js +45 -44
- package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
- package/dist/shared/components/panels/AlertBanners.js +132 -0
- package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
- package/dist/shared/components/panels/BranchLanes.js +82 -54
- package/dist/shared/components/panels/CommentAwareness.js +332 -0
- package/dist/shared/components/panels/CommentImages.js +219 -0
- package/dist/shared/components/panels/CommentPanel.js +649 -530
- package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
- package/dist/shared/components/panels/NewSinceChip.js +16 -0
- package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
- package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
- package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
- package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
- package/dist/shared/components/panels/SlaClock.js +130 -99
- package/dist/shared/components/panels/TaskPanel.js +308 -287
- package/dist/shared/components/panels/unseen-move-check.js +101 -0
- package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
- package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
- package/dist/shared/components/profile/AgentNameField.js +141 -0
- package/dist/shared/components/profile/AgentsPanel.js +55 -46
- package/dist/shared/components/profile/PersonAccess.js +398 -330
- package/dist/shared/components/profile/PersonAdminTools.js +127 -113
- package/dist/shared/components/profile/PersonProfile.js +81 -73
- package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
- package/dist/shared/components/queue/QueueBulkBar.js +101 -84
- package/dist/shared/components/queue/QueueItemSheet.js +66 -66
- package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
- package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
- package/dist/shared/components/queue/queue-totals.js +92 -0
- package/dist/shared/components/queue/worklist-helpers.js +18 -14
- package/dist/shared/components/send-view/SendViewButton.js +136 -0
- package/dist/shared/components/send-view/SentViewCards.js +147 -0
- package/dist/shared/components/support/ReportProblem.js +1 -0
- package/dist/shared/components/support/ScreenShare.js +554 -0
- package/dist/shared/components/support/SupportView.js +160 -129
- package/dist/shared/components/support/TicketDetailSheet.js +101 -89
- package/dist/shared/components/watch-list/WatchDock.js +1044 -0
- package/dist/shared/components/watch-list/WatchExtras.js +723 -0
- package/dist/shared/components/watch-list/WatchListButton.js +46 -0
- package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
- package/dist/shared/components/watch-list/WatchRows.js +348 -0
- package/dist/shared/lib/activity-sentence.js +87 -75
- package/dist/shared/lib/agent-presence.js +46 -0
- package/dist/shared/lib/approval-progress.js +49 -0
- package/dist/shared/lib/attention-prefs.js +27 -0
- package/dist/shared/lib/cell-locks.js +56 -0
- package/dist/shared/lib/co-edit.js +166 -0
- package/dist/shared/lib/coedit-registry.js +44 -0
- package/dist/shared/lib/comment-awareness.js +124 -0
- package/dist/shared/lib/comment-images.js +45 -0
- package/dist/shared/lib/config-watch.js +94 -0
- package/dist/shared/lib/copy-rules.js +65 -0
- package/dist/shared/lib/count-step.js +30 -0
- package/dist/shared/lib/deadline-ticker.js +68 -0
- package/dist/shared/lib/derived-causes.js +115 -0
- package/dist/shared/lib/draft-store.js +114 -85
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/field-merge.js +126 -0
- package/dist/shared/lib/filter-sentence.js +10 -10
- package/dist/shared/lib/focus-mode.js +16 -12
- package/dist/shared/lib/grid-cursors.js +77 -0
- package/dist/shared/lib/grid-presence.js +182 -0
- package/dist/shared/lib/idle-reload.js +100 -73
- package/dist/shared/lib/in-step.js +45 -0
- package/dist/shared/lib/integration-chip.js +19 -18
- package/dist/shared/lib/line-locks.js +141 -0
- package/dist/shared/lib/line-split.js +41 -0
- package/dist/shared/lib/linked-changes.js +150 -0
- package/dist/shared/lib/list-link.js +56 -50
- package/dist/shared/lib/list-return.js +231 -0
- package/dist/shared/lib/list-viewers.js +52 -0
- package/dist/shared/lib/live-announcer.js +86 -0
- package/dist/shared/lib/live-counts.js +85 -0
- package/dist/shared/lib/live-data-changed.js +108 -0
- package/dist/shared/lib/live-deltas.js +81 -0
- package/dist/shared/lib/live-findings.js +113 -0
- package/dist/shared/lib/live-groups.js +122 -0
- package/dist/shared/lib/live-link-labels.js +162 -0
- package/dist/shared/lib/live-list-flow.js +334 -0
- package/dist/shared/lib/live-list.js +143 -129
- package/dist/shared/lib/live-moves.js +51 -0
- package/dist/shared/lib/live-ops.js +26 -26
- package/dist/shared/lib/live-pickers.js +7 -0
- package/dist/shared/lib/live-preference.js +184 -0
- package/dist/shared/lib/live-queries.js +226 -181
- package/dist/shared/lib/live-screen.js +333 -0
- package/dist/shared/lib/live-search.js +108 -0
- package/dist/shared/lib/live-seen.js +35 -0
- package/dist/shared/lib/live-views.js +100 -0
- package/dist/shared/lib/live.js +159 -133
- package/dist/shared/lib/missed-updates.js +198 -0
- package/dist/shared/lib/newer-file.js +56 -0
- package/dist/shared/lib/notification-sound.js +42 -20
- package/dist/shared/lib/own-writes.js +59 -41
- package/dist/shared/lib/picker-badges.js +94 -0
- package/dist/shared/lib/presence-signals.js +131 -84
- package/dist/shared/lib/realtime.js +49 -24
- package/dist/shared/lib/record-gaps.js +85 -0
- package/dist/shared/lib/record-outbox.js +369 -222
- package/dist/shared/lib/record-peek.js +75 -0
- package/dist/shared/lib/record-tabs.js +92 -72
- package/dist/shared/lib/relative-ticker.js +42 -0
- package/dist/shared/lib/request-gate.js +119 -119
- package/dist/shared/lib/rollup-recalc.js +107 -0
- package/dist/shared/lib/room-gaps.js +40 -36
- package/dist/shared/lib/rum.js +137 -87
- package/dist/shared/lib/save-progress.js +20 -0
- package/dist/shared/lib/scheduled-countdown.js +67 -0
- package/dist/shared/lib/screen-refresh.js +160 -0
- package/dist/shared/lib/screen-share.js +234 -0
- package/dist/shared/lib/seen-since.js +74 -0
- package/dist/shared/lib/selection-watch.js +205 -0
- package/dist/shared/lib/send-status.js +132 -0
- package/dist/shared/lib/send-view.js +23 -0
- package/dist/shared/lib/socket-liveness.js +155 -0
- package/dist/shared/lib/socket-realtime.js +168 -140
- package/dist/shared/lib/state-census.js +53 -0
- package/dist/shared/lib/summary-mode.js +61 -39
- package/dist/shared/lib/tab-attention.js +143 -32
- package/dist/shared/lib/table-density.js +64 -0
- package/dist/shared/lib/track-travel.js +40 -0
- package/dist/shared/lib/unseen-changes.js +68 -0
- package/dist/shared/lib/upload-file.js +33 -0
- package/dist/shared/lib/upload-presence.js +127 -0
- package/dist/shared/lib/urgent-chime.js +65 -0
- package/dist/shared/lib/use-online-users.js +32 -11
- package/dist/shared/lib/user-sync.js +155 -39
- package/dist/shared/lib/waiting-count.js +44 -0
- package/dist/shared/lib/watch-desktop.js +83 -0
- package/dist/shared/lib/watch-list.js +447 -0
- package/dist/shared/lib/widget-image-render.js +64 -0
- package/dist/shared/lib/widget-image.js +111 -0
- package/dist/shared/lib/worker-socket.js +130 -104
- package/dist/shared/lib/write-to-screen.js +133 -0
- package/package.json +1 -1
- package/styles.css +49 -1
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Pencil as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { DrilldownContext as Ut, useNivaroClient as
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as U, useQueryClient as vt } from "@tanstack/react-query";
|
|
3
|
+
import { Pencil as jt, ChevronDown as Wt } from "lucide-react";
|
|
4
|
+
import { useMemo as _e, useRef as It, useState as Q, useEffect as ke, useCallback as bt, Fragment as Ht } from "react";
|
|
5
|
+
import { DrilldownContext as Ut, useNivaroClient as Ne, useApiFetchConfig as Vt, useDrilldown as _t } from "../context.js";
|
|
6
6
|
import { useDebounced as Bt } from "../hooks/useDebounced.js";
|
|
7
|
-
import { parseAllowedCollections as
|
|
8
|
-
import { get as Y, patch as
|
|
9
|
-
import { toastError as
|
|
10
|
-
import { readGroupStructure as
|
|
11
|
-
import { quietHiddenSectionsOf as
|
|
12
|
-
import { useLiveRecord as
|
|
13
|
-
import { isDisplayFormulaField as
|
|
14
|
-
import { invalidateRecordRow as
|
|
15
|
-
import { sanitizeHtml as
|
|
16
|
-
import { titleCase as Ze, formatRelative as
|
|
17
|
-
import { matchesVisibleWhen as
|
|
18
|
-
import { InboundRequestPopover as
|
|
19
|
-
import { FileM2MField as
|
|
20
|
-
import { useFieldTouches as
|
|
21
|
-
import { richTextToPlain as
|
|
22
|
-
import { isNamelessLabel as ul, NAMELESS_LABEL as
|
|
23
|
-
import { PersonalDefaultMark as
|
|
24
|
-
import { usePlacementTextContext as
|
|
25
|
-
import { RuleHiddenNotes as
|
|
26
|
-
import { RELATED_LOADING_CLASS as
|
|
27
|
-
import { ruleHiddenGroups as
|
|
28
|
-
import { UserChip as
|
|
29
|
-
import { DesignNode as
|
|
30
|
-
import { DesignCanvas as
|
|
31
|
-
import { revealGroupKey as
|
|
32
|
-
import { choiceLabelsFrom as
|
|
33
|
-
import { useRecordIntegrity as
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
7
|
+
import { parseAllowedCollections as Gt } from "../lib/allowed-collections.js";
|
|
8
|
+
import { get as Y, patch as Jt } from "../lib/commands.js";
|
|
9
|
+
import { toastError as Qt } from "../lib/error-toast.js";
|
|
10
|
+
import { readGroupStructure as Yt, isFolded as zt, isEmptyValue as ye, planFieldGrid as Xt } from "../lib/form-structure.js";
|
|
11
|
+
import { quietHiddenSectionsOf as Zt } from "../lib/layout-resolve.js";
|
|
12
|
+
import { useLiveRecord as el } from "../lib/live.js";
|
|
13
|
+
import { isDisplayFormulaField as Ce, resolvePlacementText as tl, displayFormulaOf as ll, formatDisplayValue as rl } from "../lib/placement-behaviour.js";
|
|
14
|
+
import { invalidateRecordRow as al, useRecordReader as nl } from "../lib/record-loader.js";
|
|
15
|
+
import { sanitizeHtml as il } from "../lib/sanitize-html.js";
|
|
16
|
+
import { titleCase as Ze, formatRelative as We } from "../lib/utils.js";
|
|
17
|
+
import { matchesVisibleWhen as sl } from "../lib/visible-when.js";
|
|
18
|
+
import { InboundRequestPopover as dl } from "./integrations/InboundRequest.js";
|
|
19
|
+
import { FileM2MField as ol } from "./item-edit/FilePickerField.js";
|
|
20
|
+
import { useFieldTouches as cl } from "./item-edit/HeaderFreshness.js";
|
|
21
|
+
import { richTextToPlain as ml } from "./item-edit/helpers.js";
|
|
22
|
+
import { isNamelessLabel as ul, NAMELESS_LABEL as fl } from "./item-edit/option-disambiguate.js";
|
|
23
|
+
import { PersonalDefaultMark as gt } from "./item-edit/PersonalDefaultControl.js";
|
|
24
|
+
import { usePlacementTextContext as pl, evaluateDisplayFormula as hl } from "./item-edit/placement-behaviour.js";
|
|
25
|
+
import { RuleHiddenNotes as bl } from "./item-edit/RuleHiddenNotes.js";
|
|
26
|
+
import { RELATED_LOADING_CLASS as gl, RelatedMissingLabel as yl } from "./item-edit/related-missing.js";
|
|
27
|
+
import { ruleHiddenGroups as xl, groupHasReadableField as vl } from "./item-edit/rule-hidden.js";
|
|
28
|
+
import { UserChip as kt } from "./item-edit/UserChip.js";
|
|
29
|
+
import { DesignNode as _l } from "./layout-editor/DesignNode.js";
|
|
30
|
+
import { DesignCanvas as kl } from "./layout-editor/design-canvas.js";
|
|
31
|
+
import { revealGroupKey as Nl } from "./layout-editor/design-context.js";
|
|
32
|
+
import { choiceLabelsFrom as wl } from "./layout-editor/overview/describe-conditions.js";
|
|
33
|
+
import { useRecordIntegrity as Sl, integrityByField as $l } from "./panels/RecordIntegrityBanner.js";
|
|
34
|
+
import { RecordHoverCard as et } from "./RecordHoverCard.js";
|
|
35
|
+
import { RelativeTime as Fl } from "./RelativeTime.js";
|
|
36
|
+
import { SimpleSelectXs as yt } from "./ui/SimpleSelect.js";
|
|
37
|
+
import { WidgetSlot as ql } from "./WidgetSlot.js";
|
|
38
|
+
const xe = (n) => {
|
|
39
|
+
if (!n) return {};
|
|
40
|
+
if (typeof n == "object") return n;
|
|
39
41
|
try {
|
|
40
|
-
return JSON.parse(
|
|
42
|
+
return JSON.parse(n);
|
|
41
43
|
} catch {
|
|
42
44
|
return {};
|
|
43
45
|
}
|
|
44
|
-
},
|
|
45
|
-
function
|
|
46
|
-
let
|
|
47
|
-
if (typeof
|
|
46
|
+
}, Al = 3;
|
|
47
|
+
function Rl(n) {
|
|
48
|
+
let m = n;
|
|
49
|
+
if (typeof m == "string")
|
|
48
50
|
try {
|
|
49
|
-
|
|
51
|
+
m = JSON.parse(m);
|
|
50
52
|
} catch {
|
|
51
|
-
|
|
53
|
+
m = m ? m.split(",").map((s) => s.trim()) : [];
|
|
52
54
|
}
|
|
53
|
-
if (!Array.isArray(
|
|
55
|
+
if (!Array.isArray(m)) return [];
|
|
54
56
|
const b = [];
|
|
55
|
-
for (const s of
|
|
57
|
+
for (const s of m)
|
|
56
58
|
if (typeof s == "string" && s) b.push({ field: s, label: null });
|
|
57
59
|
else if (s && typeof s == "object" && typeof s.field == "string") {
|
|
58
60
|
const F = s.label;
|
|
@@ -63,18 +65,18 @@ function ql(a) {
|
|
|
63
65
|
}
|
|
64
66
|
return b.filter((s) => !s.field.startsWith("__"));
|
|
65
67
|
}
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const b = new Date(String(
|
|
70
|
-
return Number.isNaN(b.getTime()) ? String(
|
|
71
|
-
},
|
|
72
|
-
const
|
|
73
|
-
return Number.isNaN(
|
|
74
|
-
},
|
|
75
|
-
const
|
|
76
|
-
return Number.isNaN(
|
|
77
|
-
}, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }),
|
|
68
|
+
const Nt = (n) => {
|
|
69
|
+
const m = String(n).match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ]00:00:00(?:\.0+)?(?:Z|[+-]00:?00)?)?$/);
|
|
70
|
+
if (m) return `${m[2]}/${m[3]}/${m[1]}`;
|
|
71
|
+
const b = new Date(String(n));
|
|
72
|
+
return Number.isNaN(b.getTime()) ? String(n) : `${String(b.getMonth() + 1).padStart(2, "0")}/${String(b.getDate()).padStart(2, "0")}/${b.getFullYear()}`;
|
|
73
|
+
}, tt = (n) => {
|
|
74
|
+
const m = Number(n);
|
|
75
|
+
return Number.isNaN(m) ? String(n) : `$${m.toLocaleString("en-US", { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
|
|
76
|
+
}, He = (n) => {
|
|
77
|
+
const m = Number(n);
|
|
78
|
+
return Number.isNaN(m) ? String(n) : m.toLocaleString("en-US");
|
|
79
|
+
}, Ie = "text-[11.5px] font-medium text-slate-500 dark:text-slate-400", le = () => /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }), Tl = `
|
|
78
80
|
[data-read-board]{grid-template-columns:minmax(0,1fr)}
|
|
79
81
|
[data-read-dl]{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
80
82
|
@media (min-width:640px){[data-read-dl="full"]{grid-template-columns:repeat(3,minmax(0,1fr))}}
|
|
@@ -89,45 +91,45 @@ const kt = (a) => {
|
|
|
89
91
|
}
|
|
90
92
|
@media (min-width:1536px){[data-read-dl="full"]{grid-template-columns:repeat(6,minmax(0,1fr))}}
|
|
91
93
|
`;
|
|
92
|
-
function
|
|
93
|
-
value:
|
|
94
|
-
trueTone:
|
|
94
|
+
function Ue({
|
|
95
|
+
value: n,
|
|
96
|
+
trueTone: m = "positive"
|
|
95
97
|
}) {
|
|
96
|
-
const b =
|
|
98
|
+
const b = n === !0 || n === 1 || n === "1" || n === "true";
|
|
97
99
|
return /* @__PURE__ */ t(
|
|
98
100
|
"span",
|
|
99
101
|
{
|
|
100
|
-
className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${b ?
|
|
102
|
+
className: `inline-flex h-[18px] items-center rounded-full px-1.5 text-[10.5px] font-semibold ${b ? m === "danger" ? "bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400" : "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400" : "bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400"}`,
|
|
101
103
|
children: b ? "Yes" : "No"
|
|
102
104
|
}
|
|
103
105
|
);
|
|
104
106
|
}
|
|
105
|
-
function Ll({ collection:
|
|
106
|
-
const b =
|
|
107
|
-
queryKey: ["cbv-collection-meta",
|
|
107
|
+
function Ll({ collection: n, id: m }) {
|
|
108
|
+
const b = Ne(), s = nl(), F = _t(), { data: N } = U({
|
|
109
|
+
queryKey: ["cbv-collection-meta", n],
|
|
108
110
|
queryFn: () => b.request(
|
|
109
|
-
Y(`/collections/${
|
|
111
|
+
Y(`/collections/${n}`)
|
|
110
112
|
).then((A) => A.data).catch(() => ({ display_template: null, fields: [] })),
|
|
111
113
|
staleTime: 10 * 6e4,
|
|
112
114
|
retry: !1
|
|
113
115
|
}), {
|
|
114
116
|
data: _,
|
|
115
|
-
isPending:
|
|
117
|
+
isPending: O,
|
|
116
118
|
error: q
|
|
117
|
-
} =
|
|
118
|
-
queryKey: ["rrv-related",
|
|
119
|
-
queryFn: () => s(
|
|
120
|
-
enabled:
|
|
119
|
+
} = U({
|
|
120
|
+
queryKey: ["rrv-related", n, String(m)],
|
|
121
|
+
queryFn: () => s(n, m),
|
|
122
|
+
enabled: m != null && !!N,
|
|
121
123
|
staleTime: 6e4,
|
|
122
124
|
retry: !1
|
|
123
125
|
});
|
|
124
|
-
if (
|
|
125
|
-
if (!_ && !q && (
|
|
126
|
-
return /* @__PURE__ */ t("span", { className:
|
|
127
|
-
if (!_) return /* @__PURE__ */ t(
|
|
126
|
+
if (m == null) return /* @__PURE__ */ t(le, {});
|
|
127
|
+
if (!_ && !q && (O || !N))
|
|
128
|
+
return /* @__PURE__ */ t("span", { className: gl });
|
|
129
|
+
if (!_) return /* @__PURE__ */ t(yl, { error: q, collection: n, id: m });
|
|
128
130
|
let f = "";
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
131
|
+
const T = N == null ? void 0 : N.display_template;
|
|
132
|
+
if (T && (f = T.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (A, j) => {
|
|
131
133
|
const w = j.split(".").reduce((x, g) => x == null ? void 0 : x[g], _);
|
|
132
134
|
return w == null ? "" : String(w);
|
|
133
135
|
}).trim()), !f) {
|
|
@@ -146,34 +148,34 @@ function Ll({ collection: a, id: u }) {
|
|
|
146
148
|
break;
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
|
-
return ul(f) && (f =
|
|
151
|
+
return ul(f) && (f = fl), F ? /* @__PURE__ */ t(et, { collection: n, id: m, children: /* @__PURE__ */ t(
|
|
150
152
|
"button",
|
|
151
153
|
{
|
|
152
154
|
type: "button",
|
|
153
|
-
onClick: () => F.open({ collection:
|
|
155
|
+
onClick: () => F.open({ collection: n, itemId: String(m) }),
|
|
154
156
|
className: "text-left underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
|
|
155
157
|
children: f
|
|
156
158
|
}
|
|
157
|
-
) : /* @__PURE__ */ t(
|
|
159
|
+
) }) : /* @__PURE__ */ t(et, { collection: n, id: m, children: f });
|
|
158
160
|
}
|
|
159
|
-
function Ol({ id:
|
|
160
|
-
const
|
|
161
|
-
queryKey: ["rrv-file-meta", String(
|
|
162
|
-
queryFn: () =>
|
|
163
|
-
Y(`/files/${
|
|
161
|
+
function Ol({ id: n }) {
|
|
162
|
+
const m = Ne(), { apiBase: b } = Vt(), { data: s, isPending: F } = U({
|
|
163
|
+
queryKey: ["rrv-file-meta", String(n)],
|
|
164
|
+
queryFn: () => m.request(
|
|
165
|
+
Y(`/files/${n}/meta`)
|
|
164
166
|
).then((_) => _.data).catch(() => null),
|
|
165
|
-
enabled:
|
|
167
|
+
enabled: n != null,
|
|
166
168
|
staleTime: 5 * 6e4,
|
|
167
169
|
retry: !1
|
|
168
170
|
});
|
|
169
|
-
if (
|
|
171
|
+
if (n == null) return /* @__PURE__ */ t(le, {});
|
|
170
172
|
if (!s && F)
|
|
171
173
|
return /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-24 animate-pulse rounded bg-slate-100 align-middle dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
172
|
-
const N = (s == null ? void 0 : s.title) || (s == null ? void 0 : s.filename_download) || `#${String(
|
|
174
|
+
const N = (s == null ? void 0 : s.title) || (s == null ? void 0 : s.filename_download) || `#${String(n)}`;
|
|
173
175
|
return /* @__PURE__ */ t(
|
|
174
176
|
"a",
|
|
175
177
|
{
|
|
176
|
-
href: `${b}/files/${
|
|
178
|
+
href: `${b}/files/${n}`,
|
|
177
179
|
target: "_blank",
|
|
178
180
|
rel: "noreferrer",
|
|
179
181
|
className: "underline decoration-slate-300 underline-offset-2 transition-colors hover:text-[#007a99] hover:decoration-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan dark:hover:decoration-nvr-cyan",
|
|
@@ -181,10 +183,10 @@ function Ol({ id: a }) {
|
|
|
181
183
|
}
|
|
182
184
|
);
|
|
183
185
|
}
|
|
184
|
-
const
|
|
185
|
-
function
|
|
186
|
-
junction:
|
|
187
|
-
parentFk:
|
|
186
|
+
const lt = ({ collection: n, id: m }) => n === "nivaro_files" ? /* @__PURE__ */ t(Ol, { id: m }) : /* @__PURE__ */ t(Ll, { collection: n, id: m });
|
|
187
|
+
function Cl({
|
|
188
|
+
junction: n,
|
|
189
|
+
parentFk: m,
|
|
188
190
|
junctionField: b,
|
|
189
191
|
parentId: s,
|
|
190
192
|
onCount: F,
|
|
@@ -192,30 +194,30 @@ function Rl({
|
|
|
192
194
|
relation: _
|
|
193
195
|
}) {
|
|
194
196
|
var W;
|
|
195
|
-
const
|
|
196
|
-
queryKey: ["cbv-collection-meta",
|
|
197
|
-
queryFn: () =>
|
|
197
|
+
const O = Ne(), { data: q } = U({
|
|
198
|
+
queryKey: ["cbv-collection-meta", n],
|
|
199
|
+
queryFn: () => O.request(Y(`/collections/${n}`)).then((v) => v.data),
|
|
198
200
|
staleTime: 10 * 6e4,
|
|
199
201
|
retry: !1
|
|
200
202
|
}), f = ((q == null ? void 0 : q.relations) ?? []).find(
|
|
201
|
-
(v) => v.many_collection ===
|
|
202
|
-
),
|
|
203
|
+
(v) => v.many_collection === n && v.many_field === b
|
|
204
|
+
), T = Gt(f == null ? void 0 : f.one_allowed_collections), A = !!f && !f.one_collection && (T.length > 0 || !!f.one_collection_field), j = (f == null ? void 0 : f.one_collection_field) ?? "collection", w = (v) => v ? v === "directus_users" ? "nivaro_users" : v : null, x = (f == null ? void 0 : f.one_collection) ?? (A ? T.some((v) => v === "directus_users" || v === "nivaro_users") ? "nivaro_users" : w(T[0]) : null), { data: g } = U({
|
|
203
205
|
// Under the edit form's ['m2m-items', junction, parentFk, parentId] prefix (a longer key,
|
|
204
206
|
// so never the same cache entry): every link write that refreshes the form's list —
|
|
205
207
|
// a file upload, a picker change, the save itself — refreshes Summary's too. Its own
|
|
206
208
|
// 'rrv-m2m' key heard none of them, so a file added this session never showed here.
|
|
207
209
|
queryKey: [
|
|
208
210
|
"m2m-items",
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
n,
|
|
212
|
+
m,
|
|
211
213
|
s,
|
|
212
214
|
"rrv",
|
|
213
215
|
b,
|
|
214
216
|
A ? j : ""
|
|
215
217
|
],
|
|
216
|
-
queryFn: () =>
|
|
217
|
-
Y(`/items/${
|
|
218
|
-
filter: JSON.stringify({ [
|
|
218
|
+
queryFn: () => O.request(
|
|
219
|
+
Y(`/items/${n}`, {
|
|
220
|
+
filter: JSON.stringify({ [m]: { _eq: s } }),
|
|
219
221
|
fields: A ? `id,${b},${j}` : `id,${b}`,
|
|
220
222
|
limit: 200
|
|
221
223
|
})
|
|
@@ -233,12 +235,12 @@ function Rl({
|
|
|
233
235
|
staleTime: 3e4,
|
|
234
236
|
retry: !1
|
|
235
237
|
}), C = g == null ? void 0 : g.map((v) => v.id), S = x ?? (A ? ((W = g == null ? void 0 : g.find((v) => v.collection)) == null ? void 0 : W.collection) ?? null : null), D = C == null ? void 0 : C.length;
|
|
236
|
-
return
|
|
238
|
+
return ke(() => {
|
|
237
239
|
D !== void 0 && (F == null || F(D));
|
|
238
|
-
}, [D, F]),
|
|
240
|
+
}, [D, F]), ke(() => {
|
|
239
241
|
S && (N == null || N(S));
|
|
240
242
|
}, [S, N]), q && !S && (!A || g) ? /* @__PURE__ */ t(le, {}) : !C || !S ? /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) : C.length === 0 ? /* @__PURE__ */ t(le, {}) : S === "nivaro_files" && _ ? /* @__PURE__ */ t("div", { className: "mt-1", children: /* @__PURE__ */ t(
|
|
241
|
-
|
|
243
|
+
ol,
|
|
242
244
|
{
|
|
243
245
|
relation: _,
|
|
244
246
|
parentId: s,
|
|
@@ -250,46 +252,46 @@ function Rl({
|
|
|
250
252
|
{
|
|
251
253
|
className: "inline-flex items-center whitespace-nowrap",
|
|
252
254
|
children: [
|
|
253
|
-
/* @__PURE__ */ t(
|
|
255
|
+
/* @__PURE__ */ t(lt, { collection: k ?? S, id: v }),
|
|
254
256
|
$ < C.length - 1 && /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "," })
|
|
255
257
|
]
|
|
256
258
|
},
|
|
257
259
|
`${k ?? S}:${v}`
|
|
258
260
|
)) });
|
|
259
261
|
}
|
|
260
|
-
function
|
|
261
|
-
collection:
|
|
262
|
-
fkField:
|
|
262
|
+
function Dl({
|
|
263
|
+
collection: n,
|
|
264
|
+
fkField: m,
|
|
263
265
|
parentId: b,
|
|
264
266
|
layoutId: s,
|
|
265
267
|
presets: F,
|
|
266
268
|
defaultPreset: N,
|
|
267
269
|
onCount: _
|
|
268
270
|
}) {
|
|
269
|
-
const
|
|
271
|
+
const O = Ne(), q = _t(), f = (F ?? []).filter((l) => l && Array.isArray(l.columns)), [T, A] = Q(
|
|
270
272
|
() => {
|
|
271
273
|
var l;
|
|
272
274
|
return f.length >= 2 ? ((l = f.find((d) => d.name === N)) == null ? void 0 : l.name) ?? f[0].name : "__all__";
|
|
273
275
|
}
|
|
274
|
-
), { data: j } =
|
|
275
|
-
queryKey: ["cbv-collection-meta",
|
|
276
|
-
queryFn: () =>
|
|
276
|
+
), { data: j } = U({
|
|
277
|
+
queryKey: ["cbv-collection-meta", n],
|
|
278
|
+
queryFn: () => O.request(Y(`/collections/${n}`)).then((l) => l.data),
|
|
277
279
|
staleTime: 10 * 6e4,
|
|
278
280
|
retry: !1
|
|
279
281
|
}), w = (l) => {
|
|
280
282
|
var d;
|
|
281
283
|
return ((d = ((j == null ? void 0 : j.relations) ?? []).find(
|
|
282
|
-
(o) => o.many_collection ===
|
|
284
|
+
(o) => o.many_collection === n && o.many_field === l && o.one_collection
|
|
283
285
|
)) == null ? void 0 : d.one_collection) ?? null;
|
|
284
|
-
}, { data: x } =
|
|
285
|
-
queryKey: ["rrv-cols",
|
|
286
|
-
queryFn: () =>
|
|
287
|
-
Y(`/field-config/${
|
|
286
|
+
}, { data: x } = U({
|
|
287
|
+
queryKey: ["rrv-cols", n, s ?? null],
|
|
288
|
+
queryFn: () => O.request(
|
|
289
|
+
Y(`/field-config/${n}`, s ? { layout_id: s } : {})
|
|
288
290
|
).then((l) => ({
|
|
289
291
|
// Lines carry their own number — sort by it and show it first.
|
|
290
292
|
lineNo: (l.data ?? []).some((d) => d.field === "line_number"),
|
|
291
293
|
cols: (l.data ?? []).filter(
|
|
292
|
-
(d) => !d.hidden && !d.field.startsWith("__") && (!d.field.includes(".") || d.interface === "relation-path") && d.field !==
|
|
294
|
+
(d) => !d.hidden && !d.field.startsWith("__") && (!d.field.includes(".") || d.interface === "relation-path") && d.field !== m && ((s ? d.layout_assigned : !0) ?? !0) && (d.interface === "relation-path" || [
|
|
293
295
|
"string",
|
|
294
296
|
"text",
|
|
295
297
|
"integer",
|
|
@@ -301,33 +303,33 @@ function Tl({
|
|
|
301
303
|
"timestamp",
|
|
302
304
|
"uuid"
|
|
303
305
|
].includes(d.type ?? ""))
|
|
304
|
-
).filter((d, o, h) => h.findIndex((
|
|
306
|
+
).filter((d, o, h) => h.findIndex((L) => L.field === d.field) === o)
|
|
305
307
|
})),
|
|
306
308
|
staleTime: 5 * 6e4,
|
|
307
309
|
retry: !1
|
|
308
|
-
}), g = (x == null ? void 0 : x.cols) ?? [], C = !!(x != null && x.lineNo), S =
|
|
310
|
+
}), g = (x == null ? void 0 : x.cols) ?? [], C = !!(x != null && x.lineNo), S = T !== "__all__" ? f.find((l) => l.name === T) : null, D = _e(() => {
|
|
309
311
|
if (!S) return g;
|
|
310
312
|
const l = new Set(S.columns), d = g.filter((o) => l.has(o.field));
|
|
311
313
|
return d.length > 0 ? d : g;
|
|
312
|
-
}, [g, S]), [W, v] = Q(""), [k, $] = Q(1), [ie,
|
|
314
|
+
}, [g, S]), [W, v] = Q(""), [k, $] = Q(1), [ie, V] = Q({}), Z = Bt(ie, 350), De = _e(() => {
|
|
313
315
|
const l = [
|
|
314
|
-
{ path: [
|
|
316
|
+
{ path: [m], op: "_eq", value: b }
|
|
315
317
|
];
|
|
316
318
|
for (const [d, o] of Object.entries(Z)) {
|
|
317
319
|
if (!(o != null && o.value.trim())) continue;
|
|
318
|
-
const h = o.value.trim(),
|
|
320
|
+
const h = o.value.trim(), L = Number(h), M = o.op === "_contains" ? h : h === "true" || h === "false" ? h === "true" : Number.isNaN(L) ? h : L;
|
|
319
321
|
l.push({ path: [d], op: o.op, value: M });
|
|
320
322
|
}
|
|
321
323
|
return JSON.stringify(l);
|
|
322
|
-
}, [Z,
|
|
323
|
-
data:
|
|
324
|
-
isLoading:
|
|
324
|
+
}, [Z, m, b]), u = 25, {
|
|
325
|
+
data: B,
|
|
326
|
+
isLoading: ue,
|
|
325
327
|
isFetching: Ee
|
|
326
|
-
} =
|
|
327
|
-
queryKey: ["rrv-rows",
|
|
328
|
-
queryFn: () =>
|
|
329
|
-
Y(`/items/${
|
|
330
|
-
limit:
|
|
328
|
+
} = U({
|
|
329
|
+
queryKey: ["rrv-rows", n, m, b, W, C, k, De],
|
|
330
|
+
queryFn: () => O.request(
|
|
331
|
+
Y(`/items/${n}`, {
|
|
332
|
+
limit: u,
|
|
331
333
|
page: k,
|
|
332
334
|
...W ? { sort: W } : C ? { sort: "line_number" } : {},
|
|
333
335
|
conditions: De
|
|
@@ -336,34 +338,34 @@ function Tl({
|
|
|
336
338
|
placeholderData: (l) => l,
|
|
337
339
|
staleTime: 3e4,
|
|
338
340
|
retry: !1
|
|
339
|
-
}), E = (
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}, [
|
|
343
|
-
const
|
|
341
|
+
}), E = (B == null ? void 0 : B.data) ?? [], ee = (B == null ? void 0 : B.total) ?? E.length, H = Object.values(Z).some((l) => !!(l != null && l.value.trim()));
|
|
342
|
+
ke(() => {
|
|
343
|
+
B && !H && (_ == null || _(ee));
|
|
344
|
+
}, [B, H, ee, _]);
|
|
345
|
+
const fe = D.filter((l) => l.field.includes(".")), pe = E.map((l) => String(l.id)), { data: z } = U({
|
|
344
346
|
queryKey: [
|
|
345
347
|
"rrv-resolve-paths",
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
348
|
+
n,
|
|
349
|
+
fe.map((l) => l.field).join(","),
|
|
350
|
+
pe.join(",")
|
|
349
351
|
],
|
|
350
|
-
queryFn: () =>
|
|
351
|
-
Y(`/items/${
|
|
352
|
-
ids:
|
|
353
|
-
paths:
|
|
352
|
+
queryFn: () => O.request(
|
|
353
|
+
Y(`/items/${n}/resolve-paths`, {
|
|
354
|
+
ids: pe.join(","),
|
|
355
|
+
paths: fe.map((l) => l.field).join(",")
|
|
354
356
|
})
|
|
355
357
|
).then((l) => l.data ?? { rows: {}, targets: {} }).catch(() => ({ rows: {}, targets: {} })),
|
|
356
|
-
enabled:
|
|
358
|
+
enabled: fe.length > 0 && pe.length > 0,
|
|
357
359
|
staleTime: 3e4
|
|
358
|
-
}), P = C && E.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee /
|
|
359
|
-
$(1),
|
|
360
|
-
const
|
|
361
|
-
return o ?
|
|
360
|
+
}), P = C && E.some((l) => l.line_number != null), se = Math.max(1, Math.ceil(ee / u)), de = (l, d, o) => {
|
|
361
|
+
$(1), V((h) => {
|
|
362
|
+
const L = { ...h };
|
|
363
|
+
return o ? L[l] = { op: d, value: o } : delete L[l], L;
|
|
362
364
|
});
|
|
363
|
-
},
|
|
365
|
+
}, Ve = (l) => {
|
|
364
366
|
$(1), v((d) => d === l ? `-${l}` : d === `-${l}` ? "" : l);
|
|
365
367
|
};
|
|
366
|
-
if (
|
|
368
|
+
if (ue)
|
|
367
369
|
return /* @__PURE__ */ t("div", { className: "space-y-1.5 py-2", children: [0, 1, 2].map((l) => /* @__PURE__ */ t(
|
|
368
370
|
"div",
|
|
369
371
|
{
|
|
@@ -373,39 +375,39 @@ function Tl({
|
|
|
373
375
|
)) });
|
|
374
376
|
if (E.length === 0 && Object.keys(Z).length === 0)
|
|
375
377
|
return /* @__PURE__ */ t("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
376
|
-
const
|
|
378
|
+
const Be = (l, d) => {
|
|
377
379
|
var M, re;
|
|
378
380
|
if (d.field.includes(".")) {
|
|
379
|
-
const
|
|
381
|
+
const ae = (M = z == null ? void 0 : z.rows[String(l.id)]) == null ? void 0 : M[d.field];
|
|
380
382
|
if (!z)
|
|
381
383
|
return /* @__PURE__ */ t("span", { className: "inline-block h-3 w-14 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" });
|
|
382
|
-
if (!
|
|
383
|
-
const
|
|
384
|
-
return q &&
|
|
384
|
+
if (!ae || ae.value === "") return /* @__PURE__ */ t(le, {});
|
|
385
|
+
const qe = z.targets[d.field], he = (re = ae.ids) == null ? void 0 : re[0];
|
|
386
|
+
return q && qe && he ? /* @__PURE__ */ t(et, { collection: qe, id: he, children: /* @__PURE__ */ t(
|
|
385
387
|
"button",
|
|
386
388
|
{
|
|
387
389
|
type: "button",
|
|
388
390
|
onClick: (Ge) => {
|
|
389
|
-
Ge.stopPropagation(), q.open({ collection:
|
|
391
|
+
Ge.stopPropagation(), q.open({ collection: qe, itemId: String(he) });
|
|
390
392
|
},
|
|
391
393
|
className: "text-left underline decoration-slate-300 underline-offset-2 hover:text-[#007a99] dark:decoration-slate-600 dark:hover:text-nvr-cyan",
|
|
392
|
-
children:
|
|
394
|
+
children: ae.value
|
|
393
395
|
}
|
|
394
|
-
) :
|
|
396
|
+
) }) : ae.value;
|
|
395
397
|
}
|
|
396
398
|
const o = l[d.field];
|
|
397
|
-
if (d.type === "boolean" && o == null) return /* @__PURE__ */ t(
|
|
399
|
+
if (d.type === "boolean" && o == null) return /* @__PURE__ */ t(Ue, { value: !1 });
|
|
398
400
|
if (o == null || o === "") return /* @__PURE__ */ t(le, {});
|
|
399
401
|
const h = w(d.field);
|
|
400
402
|
if (h === "nivaro_users")
|
|
401
|
-
return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(
|
|
402
|
-
if (h) return /* @__PURE__ */ t(
|
|
403
|
-
if (d.type === "boolean") return /* @__PURE__ */ t(
|
|
404
|
-
if (d.type === "decimal" || d.type === "float") return
|
|
405
|
-
if (d.type === "integer") return
|
|
406
|
-
if (d.type === "date" || d.type === "datetime" || d.type === "timestamp") return
|
|
407
|
-
const
|
|
408
|
-
return
|
|
403
|
+
return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(kt, { userId: String(o), size: "compact" }) });
|
|
404
|
+
if (h) return /* @__PURE__ */ t(lt, { collection: h, id: o });
|
|
405
|
+
if (d.type === "boolean") return /* @__PURE__ */ t(Ue, { value: o });
|
|
406
|
+
if (d.type === "decimal" || d.type === "float") return tt(o);
|
|
407
|
+
if (d.type === "integer") return He(o);
|
|
408
|
+
if (d.type === "date" || d.type === "datetime" || d.type === "timestamp") return Nt(o);
|
|
409
|
+
const L = String(o);
|
|
410
|
+
return L.length > 48 ? `${L.slice(0, 48)}…` : L;
|
|
409
411
|
}, oe = (l) => ["decimal", "float", "integer"].includes(l.type ?? "") && !w(l.field) && !l.field.includes("."), Pe = (l) => {
|
|
410
412
|
const d = l.options;
|
|
411
413
|
if (!d) return {};
|
|
@@ -416,18 +418,18 @@ function Tl({
|
|
|
416
418
|
return {};
|
|
417
419
|
}
|
|
418
420
|
return d;
|
|
419
|
-
},
|
|
421
|
+
}, we = (l) => {
|
|
420
422
|
const d = Pe(l).aggregate;
|
|
421
423
|
return typeof d == "string" && ["sum", "avg", "min", "max", "count"].includes(d) ? d : null;
|
|
422
|
-
}, Me = D.some((l) =>
|
|
423
|
-
const d =
|
|
424
|
+
}, Me = D.some((l) => we(l)), Se = (l) => {
|
|
425
|
+
const d = we(l);
|
|
424
426
|
if (!d) return null;
|
|
425
427
|
const o = E.map((M) => Number(M[l.field])).filter((M) => !Number.isNaN(M));
|
|
426
428
|
let h = null;
|
|
427
429
|
if (d === "count" ? h = E.length : o.length > 0 && (d === "sum" ? h = o.reduce((M, re) => M + re, 0) : d === "avg" ? h = o.reduce((M, re) => M + re, 0) / o.length : d === "min" ? h = Math.min(...o) : d === "max" && (h = Math.max(...o))), h === null) return "—";
|
|
428
|
-
const
|
|
429
|
-
return d === "count" ||
|
|
430
|
-
},
|
|
430
|
+
const L = Pe(l).format;
|
|
431
|
+
return d === "count" || L === "int" ? He(Math.round(h)) : L === "currency" || l.type === "decimal" || l.type === "float" ? tt(h) : d === "avg" ? h.toFixed(2) : He(h);
|
|
432
|
+
}, $e = (l) => !w(l.field) && !l.field.includes("."), Ke = (l) => w(l.field) || l.field.includes(".") ? null : l.type === "boolean" ? "bool" : ["integer", "decimal", "float"].includes(l.type ?? "") ? "num" : ["string", "text"].includes(l.type ?? "") ? "text" : null, Fe = D.some((l) => Ke(l) != null);
|
|
431
433
|
return /* @__PURE__ */ p("div", { children: [
|
|
432
434
|
f.length >= 2 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap items-center gap-1", "data-read-presets": !0, children: [
|
|
433
435
|
{ name: "__all__", label: "All" },
|
|
@@ -437,8 +439,8 @@ function Tl({
|
|
|
437
439
|
{
|
|
438
440
|
type: "button",
|
|
439
441
|
onClick: () => A(l.name),
|
|
440
|
-
"aria-pressed":
|
|
441
|
-
className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${
|
|
442
|
+
"aria-pressed": T === l.name,
|
|
443
|
+
className: `rounded-full border px-2 py-0.5 text-[10.5px] font-medium transition-colors ${T === l.name ? "border-nvr-cyan bg-nvr-cyan/10 text-[#007a99] dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:bg-slate-50 dark:border-slate-700 dark:text-slate-400 dark:hover:bg-slate-800"}`,
|
|
442
444
|
children: l.label
|
|
443
445
|
},
|
|
444
446
|
l.name
|
|
@@ -446,7 +448,7 @@ function Tl({
|
|
|
446
448
|
/* @__PURE__ */ t(
|
|
447
449
|
"div",
|
|
448
450
|
{
|
|
449
|
-
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ee && !
|
|
451
|
+
className: `overflow-x-auto rounded-md border border-slate-200 dark:border-slate-700 ${Ee && !ue ? "opacity-70" : ""}`,
|
|
450
452
|
children: /* @__PURE__ */ p("table", { className: "w-full", style: { fontVariantNumeric: "tabular-nums" }, children: [
|
|
451
453
|
/* @__PURE__ */ p("thead", { children: [
|
|
452
454
|
/* @__PURE__ */ p("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
@@ -456,18 +458,18 @@ function Tl({
|
|
|
456
458
|
return /* @__PURE__ */ p(
|
|
457
459
|
"th",
|
|
458
460
|
{
|
|
459
|
-
onClick: () =>
|
|
460
|
-
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${oe(l) ? "text-right" : "text-left"} ${
|
|
461
|
+
onClick: () => $e(l) && Ve(l.field),
|
|
462
|
+
className: `h-7 select-none whitespace-nowrap px-2.5 text-[9.5px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 ${oe(l) ? "text-right" : "text-left"} ${$e(l) ? "cursor-pointer hover:text-slate-700 dark:hover:text-slate-200" : ""}`,
|
|
461
463
|
children: [
|
|
462
464
|
l.label || Ze(l.field),
|
|
463
|
-
|
|
465
|
+
$e(l) && /* @__PURE__ */ t("span", { className: d ? "ml-0.5 text-[#00a5cc]" : "ml-0.5 text-slate-300", children: d ? W.startsWith("-") ? "▼" : "▲" : "⇅" })
|
|
464
466
|
]
|
|
465
467
|
},
|
|
466
468
|
l.field
|
|
467
469
|
);
|
|
468
470
|
})
|
|
469
471
|
] }),
|
|
470
|
-
|
|
472
|
+
Fe && /* @__PURE__ */ p("tr", { className: "border-b border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800", children: [
|
|
471
473
|
P && /* @__PURE__ */ t("th", { className: "px-1.5 py-1" }),
|
|
472
474
|
D.map((l) => {
|
|
473
475
|
const d = Ke(l), o = ie[l.field];
|
|
@@ -484,7 +486,7 @@ function Tl({
|
|
|
484
486
|
),
|
|
485
487
|
d === "num" && /* @__PURE__ */ p("span", { className: "flex items-center gap-0.5", children: [
|
|
486
488
|
/* @__PURE__ */ t(
|
|
487
|
-
|
|
489
|
+
yt,
|
|
488
490
|
{
|
|
489
491
|
value: (o == null ? void 0 : o.op) ?? "_eq",
|
|
490
492
|
onChange: (h) => de(l.field, h, (o == null ? void 0 : o.value) ?? ""),
|
|
@@ -508,7 +510,7 @@ function Tl({
|
|
|
508
510
|
)
|
|
509
511
|
] }),
|
|
510
512
|
d === "bool" && /* @__PURE__ */ t(
|
|
511
|
-
|
|
513
|
+
yt,
|
|
512
514
|
{
|
|
513
515
|
value: (o == null ? void 0 : o.value) ?? "",
|
|
514
516
|
onChange: (h) => de(l.field, "_eq", h),
|
|
@@ -537,7 +539,7 @@ function Tl({
|
|
|
537
539
|
E.map((l) => /* @__PURE__ */ p(
|
|
538
540
|
"tr",
|
|
539
541
|
{
|
|
540
|
-
onClick: q ? () => q.open({ collection:
|
|
542
|
+
onClick: q ? () => q.open({ collection: n, itemId: String(l.id) }) : void 0,
|
|
541
543
|
className: `border-b border-slate-100 last:border-0 dark:border-slate-800 ${q ? "cursor-pointer hover:bg-nvr-cyan/5 dark:hover:bg-nvr-cyan/10" : ""}`,
|
|
542
544
|
children: [
|
|
543
545
|
P && /* @__PURE__ */ t("td", { className: "px-2 py-1.5 text-right text-[11px] tabular-nums text-slate-400", children: l.line_number == null ? "" : String(l.line_number) }),
|
|
@@ -545,7 +547,7 @@ function Tl({
|
|
|
545
547
|
"td",
|
|
546
548
|
{
|
|
547
549
|
className: `whitespace-nowrap px-2.5 py-1.5 text-[12px] text-slate-700 dark:text-slate-200 ${oe(d) ? "text-right" : ""}`,
|
|
548
|
-
children:
|
|
550
|
+
children: Be(l, d)
|
|
549
551
|
},
|
|
550
552
|
d.field
|
|
551
553
|
))
|
|
@@ -562,14 +564,14 @@ function Tl({
|
|
|
562
564
|
children: [
|
|
563
565
|
P && /* @__PURE__ */ t("td", {}),
|
|
564
566
|
D.map((l) => {
|
|
565
|
-
const d =
|
|
567
|
+
const d = we(l);
|
|
566
568
|
return /* @__PURE__ */ t(
|
|
567
569
|
"td",
|
|
568
570
|
{
|
|
569
571
|
className: `whitespace-nowrap px-2.5 py-1.5 ${oe(l) ? "text-right" : ""}`,
|
|
570
|
-
children: d && /* @__PURE__ */ p(
|
|
572
|
+
children: d && /* @__PURE__ */ p(ve, { children: [
|
|
571
573
|
/* @__PURE__ */ t("span", { className: "mr-1 font-mono text-[10px] text-slate-400", children: d.toUpperCase() }),
|
|
572
|
-
/* @__PURE__ */ t("span", { className: "tabular-nums", children:
|
|
574
|
+
/* @__PURE__ */ t("span", { className: "tabular-nums", children: Se(l) })
|
|
573
575
|
] })
|
|
574
576
|
},
|
|
575
577
|
l.field
|
|
@@ -581,11 +583,11 @@ function Tl({
|
|
|
581
583
|
] })
|
|
582
584
|
}
|
|
583
585
|
),
|
|
584
|
-
ee >
|
|
586
|
+
ee > u && /* @__PURE__ */ p("div", { className: "mt-1.5 flex items-center justify-between", children: [
|
|
585
587
|
/* @__PURE__ */ p("p", { className: "text-[11px] tabular-nums text-slate-400", children: [
|
|
586
|
-
((k - 1) *
|
|
588
|
+
((k - 1) * u + 1).toLocaleString("en-US"),
|
|
587
589
|
"–",
|
|
588
|
-
Math.min(k *
|
|
590
|
+
Math.min(k * u, ee).toLocaleString("en-US"),
|
|
589
591
|
" of",
|
|
590
592
|
" ",
|
|
591
593
|
ee.toLocaleString("en-US")
|
|
@@ -644,46 +646,46 @@ function Tl({
|
|
|
644
646
|
] })
|
|
645
647
|
] });
|
|
646
648
|
}
|
|
647
|
-
function
|
|
648
|
-
collection:
|
|
649
|
-
itemId:
|
|
649
|
+
function xt({
|
|
650
|
+
collection: n,
|
|
651
|
+
itemId: m,
|
|
650
652
|
layoutData: b,
|
|
651
653
|
design: s,
|
|
652
654
|
flush: F,
|
|
653
655
|
renderSlot: N,
|
|
654
656
|
integrityMarks: _,
|
|
655
|
-
renderGrid:
|
|
657
|
+
renderGrid: O,
|
|
656
658
|
onEditSection: q,
|
|
657
659
|
gridCounts: f
|
|
658
660
|
}) {
|
|
659
|
-
var
|
|
660
|
-
const
|
|
661
|
+
var ot;
|
|
662
|
+
const T = Ne(), A = pl(), j = s ? s.record ?? {} : null, w = !!(s != null && s.context.showHidden), x = s ? String(((ot = s.record) == null ? void 0 : ot.id) ?? "") : m ?? "", g = _e(
|
|
661
663
|
() => s ? {
|
|
662
664
|
...s.layout,
|
|
663
665
|
layout: s.layout.layout ?? { id: 0, name: "" }
|
|
664
666
|
} : b,
|
|
665
667
|
[s, b]
|
|
666
668
|
), C = (e) => ({
|
|
667
|
-
kind:
|
|
669
|
+
kind: Ce(e.field) ? "slot" : "field",
|
|
668
670
|
field: e.field,
|
|
669
671
|
group_key: e.group_key ?? null
|
|
670
|
-
}), S = (e, r, i = !1) => s ? /* @__PURE__ */ t(
|
|
672
|
+
}), S = (e, r, i = !1) => s ? /* @__PURE__ */ t(_l, { target: e, children: i ? /* @__PURE__ */ t("div", { "data-design-hidden": !0, className: "opacity-40", children: r }) : r }) : r, D = _e(
|
|
671
673
|
() => [
|
|
672
674
|
...new Set(
|
|
673
675
|
(s ? [] : (g == null ? void 0 : g.assignments) ?? []).map((e) => e.field).filter((e) => e && !e.startsWith("__") && !e.includes("."))
|
|
674
676
|
)
|
|
675
677
|
].sort(),
|
|
676
678
|
[g, s]
|
|
677
|
-
), { data: W } =
|
|
679
|
+
), { data: W } = cl(n, x, D), v = (e) => {
|
|
678
680
|
const r = W == null ? void 0 : W[e];
|
|
679
681
|
if (!r) return null;
|
|
680
682
|
const i = r.via !== "user";
|
|
681
683
|
return r.caller && r.activity_id ? /* @__PURE__ */ t(
|
|
682
|
-
|
|
684
|
+
dl,
|
|
683
685
|
{
|
|
684
686
|
activityId: r.activity_id,
|
|
685
687
|
callerName: r.caller.name,
|
|
686
|
-
collection:
|
|
688
|
+
collection: n,
|
|
687
689
|
itemId: x,
|
|
688
690
|
children: /* @__PURE__ */ p(
|
|
689
691
|
"button",
|
|
@@ -691,14 +693,14 @@ function yt({
|
|
|
691
693
|
type: "button",
|
|
692
694
|
"data-field-touch": e,
|
|
693
695
|
"data-field-touch-caller": r.caller.key,
|
|
694
|
-
"data-tip": `Changed ${
|
|
695
|
-
"aria-label": `Changed ${
|
|
696
|
+
"data-tip": `Changed ${We(r.at)} by ${r.caller.name} (through the API) — click for the request`,
|
|
697
|
+
"aria-label": `Changed ${We(r.at)} by ${r.caller.name} through the API`,
|
|
696
698
|
className: "ml-1 inline-flex items-center gap-1 rounded-full bg-amber-50 px-1.5 align-middle text-[9.5px] font-medium leading-4 text-amber-800 hover:bg-amber-100 dark:bg-amber-400/10 dark:text-amber-300 dark:hover:bg-amber-400/20",
|
|
697
699
|
children: [
|
|
698
700
|
/* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 rounded-full bg-amber-400", "aria-hidden": !0 }),
|
|
699
701
|
r.caller.name,
|
|
700
702
|
" · ",
|
|
701
|
-
|
|
703
|
+
/* @__PURE__ */ t(Fl, { value: r.at })
|
|
702
704
|
]
|
|
703
705
|
}
|
|
704
706
|
)
|
|
@@ -707,14 +709,14 @@ function yt({
|
|
|
707
709
|
"span",
|
|
708
710
|
{
|
|
709
711
|
"data-field-touch": e,
|
|
710
|
-
"data-tip": `Changed ${
|
|
712
|
+
"data-tip": `Changed ${We(r.at)} by ${r.who}${i ? ` · ${r.via}` : ""}`,
|
|
711
713
|
role: "img",
|
|
712
|
-
"aria-label": `Changed ${
|
|
714
|
+
"aria-label": `Changed ${We(r.at)} by ${r.who}`,
|
|
713
715
|
className: `ml-1 inline-block h-1.5 w-1.5 rounded-full align-middle ${i ? "bg-amber-400" : "bg-slate-300 dark:bg-slate-600"}`
|
|
714
716
|
}
|
|
715
717
|
);
|
|
716
|
-
}, { data: k } =
|
|
717
|
-
() => _ && (k != null && k.enabled) ?
|
|
718
|
+
}, { data: k } = Sl(n, x, !!_ && !s), $ = _e(
|
|
719
|
+
() => _ && (k != null && k.enabled) ? $l(k.findings) : null,
|
|
718
720
|
[_, k]
|
|
719
721
|
), ie = ({ field: e }) => {
|
|
720
722
|
const r = $ == null ? void 0 : $.get(e);
|
|
@@ -732,79 +734,79 @@ function yt({
|
|
|
732
734
|
children: r.length > 1 ? r.length : "!"
|
|
733
735
|
}
|
|
734
736
|
);
|
|
735
|
-
}, { data:
|
|
736
|
-
queryKey: ["cbv-collection-meta",
|
|
737
|
-
queryFn: () =>
|
|
738
|
-
Y(`/collections/${
|
|
737
|
+
}, { data: V } = U({
|
|
738
|
+
queryKey: ["cbv-collection-meta", n],
|
|
739
|
+
queryFn: () => T.request(
|
|
740
|
+
Y(`/collections/${n}`)
|
|
739
741
|
).then((e) => e.data),
|
|
740
742
|
staleTime: 10 * 6e4,
|
|
741
743
|
retry: !1
|
|
742
|
-
}), Z =
|
|
743
|
-
queryKey: ["rrv-record",
|
|
744
|
+
}), Z = vt(), { data: De } = U({
|
|
745
|
+
queryKey: ["rrv-record", n, x],
|
|
744
746
|
enabled: !s,
|
|
745
|
-
queryFn: () =>
|
|
746
|
-
initialData: () => Z.getQueryData(["item",
|
|
747
|
+
queryFn: () => T.request(Y(`/items/${n}/${x}`)).then((e) => e.data),
|
|
748
|
+
initialData: () => Z.getQueryData(["item", n, x]) ?? void 0,
|
|
747
749
|
initialDataUpdatedAt: () => {
|
|
748
750
|
var e;
|
|
749
|
-
return (e = Z.getQueryState(["item",
|
|
751
|
+
return (e = Z.getQueryState(["item", n, x])) == null ? void 0 : e.dataUpdatedAt;
|
|
750
752
|
},
|
|
751
753
|
staleTime: 3e4,
|
|
752
754
|
retry: !1
|
|
753
|
-
}),
|
|
754
|
-
|
|
755
|
-
e.aspectsOnly || e.deleted || (Z.invalidateQueries({ queryKey: ["rrv-record",
|
|
755
|
+
}), u = j ?? De;
|
|
756
|
+
el(n, s ? null : x, (e) => {
|
|
757
|
+
e.aspectsOnly || e.deleted || (Z.invalidateQueries({ queryKey: ["rrv-record", n, x] }), Z.invalidateQueries({ queryKey: ["field-touch", n, x] }));
|
|
756
758
|
});
|
|
757
|
-
const
|
|
758
|
-
|
|
759
|
-
const e =
|
|
760
|
-
if (
|
|
761
|
-
const r = Object.keys(
|
|
762
|
-
(c) => !c.startsWith("__") && JSON.stringify(e[c]) !== JSON.stringify(
|
|
759
|
+
const B = It(null), [ue, Ee] = Q(() => /* @__PURE__ */ new Set());
|
|
760
|
+
ke(() => {
|
|
761
|
+
const e = B.current;
|
|
762
|
+
if (B.current = u ?? null, s || !e || !u || e === u) return;
|
|
763
|
+
const r = Object.keys(u).filter(
|
|
764
|
+
(c) => !c.startsWith("__") && JSON.stringify(e[c]) !== JSON.stringify(u[c])
|
|
763
765
|
);
|
|
764
766
|
if (r.length === 0) return;
|
|
765
767
|
Ee(new Set(r));
|
|
766
768
|
const i = setTimeout(() => Ee(/* @__PURE__ */ new Set()), 2400);
|
|
767
769
|
return () => clearTimeout(i);
|
|
768
|
-
}, [
|
|
769
|
-
const E = (e) =>
|
|
770
|
-
queryKey: ["rrv-field-config",
|
|
770
|
+
}, [u, s]);
|
|
771
|
+
const E = (e) => ue.has(e) ? " nvr-value-pulse-bg rounded-sm" : "", { data: ee } = U({
|
|
772
|
+
queryKey: ["rrv-field-config", n, g.layout.id],
|
|
771
773
|
enabled: !s,
|
|
772
|
-
queryFn: () =>
|
|
773
|
-
Y(`/field-config/${
|
|
774
|
+
queryFn: () => T.request(
|
|
775
|
+
Y(`/field-config/${n}`, { layout_id: g.layout.id })
|
|
774
776
|
).then((e) => e.data ?? []).catch(() => null),
|
|
775
777
|
staleTime: 5 * 6e4,
|
|
776
778
|
retry: !1
|
|
777
|
-
}),
|
|
778
|
-
() => new Map((ee ?? (
|
|
779
|
-
[ee,
|
|
780
|
-
),
|
|
779
|
+
}), H = _e(
|
|
780
|
+
() => new Map((ee ?? (V == null ? void 0 : V.fields) ?? []).map((e) => [e.field, e])),
|
|
781
|
+
[ee, V]
|
|
782
|
+
), fe = (V == null ? void 0 : V.relations) ?? [], pe = (e) => {
|
|
781
783
|
var r;
|
|
782
|
-
return ((r =
|
|
783
|
-
(i) => i.many_collection ===
|
|
784
|
+
return ((r = fe.find(
|
|
785
|
+
(i) => i.many_collection === n && i.many_field === e && i.one_collection
|
|
784
786
|
)) == null ? void 0 : r.one_collection) ?? null;
|
|
785
|
-
}, z = (e) =>
|
|
786
|
-
(r) => r.one_collection ===
|
|
787
|
+
}, z = (e) => fe.find(
|
|
788
|
+
(r) => r.one_collection === n && (r.one_field === e || r.many_collection === e)
|
|
787
789
|
) ?? null, P = (e) => {
|
|
788
790
|
var r;
|
|
789
|
-
return !((e.is_visible === void 0 || e.is_visible) && xe(e.overrides).hidden !== !0 && !((r =
|
|
791
|
+
return !((e.is_visible === void 0 || e.is_visible) && xe(e.overrides).hidden !== !0 && !((r = H.get(e.field)) != null && r.hidden));
|
|
790
792
|
}, se = g.assignments.filter(
|
|
791
|
-
(e) => (!e.field.startsWith("__") ||
|
|
793
|
+
(e) => (!e.field.startsWith("__") || Ce(e.field)) && (w || !P(e))
|
|
792
794
|
), de = g.assignments.filter(
|
|
793
795
|
(e) => e.field.startsWith("__widget_") && e.widget_id != null && (w || e.is_visible === void 0 || !!e.is_visible)
|
|
794
|
-
),
|
|
796
|
+
), Ve = (e) => {
|
|
795
797
|
if (!e.input_bindings) return [];
|
|
796
798
|
try {
|
|
797
799
|
return JSON.parse(String(e.input_bindings));
|
|
798
800
|
} catch {
|
|
799
801
|
return [];
|
|
800
802
|
}
|
|
801
|
-
},
|
|
802
|
-
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !
|
|
803
|
-
).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe),
|
|
803
|
+
}, Be = N || s ? g.assignments.filter(
|
|
804
|
+
(e) => e.field.startsWith("__") && !e.field.startsWith("__widget_") && !Ce(e.field) && (w || e.is_visible === void 0 || !!e.is_visible)
|
|
805
|
+
).sort((e, r) => e.sort - r.sort) : [], oe = ["__pipeline__", "__addendums__"], Pe = new Set(oe), we = (e) => (N == null ? void 0 : N(e.field, e)) ?? (s ? /* @__PURE__ */ t("div", { className: "rounded-xl border border-dashed border-slate-300 bg-white px-5 py-3 text-[12px] font-medium text-slate-500 dark:border-slate-600 dark:bg-slate-900/40 dark:text-slate-400", children: e.label_override || Ze(e.field.replace(/^_+|_+$/g, "")) }) : null), Me = (e, r = "trailing") => N || s ? Be.filter(
|
|
804
806
|
(i) => e === null ? i.group_key == null && r === "leading" === Pe.has(i.field) : i.group_key === e
|
|
805
807
|
).sort(
|
|
806
808
|
(i, c) => r === "leading" && e === null ? oe.indexOf(i.field) - oe.indexOf(c.field) : 0
|
|
807
|
-
).map((i) => ({ key: i.field, a: i, node:
|
|
809
|
+
).map((i) => ({ key: i.field, a: i, node: we(i) })).filter((i) => i.node != null) : [], Se = (e, r = "trailing") => {
|
|
808
810
|
const i = Me(e, r);
|
|
809
811
|
return i.length === 0 ? null : /* @__PURE__ */ t(
|
|
810
812
|
"div",
|
|
@@ -818,26 +820,26 @@ function yt({
|
|
|
818
820
|
) }, c.key))
|
|
819
821
|
}
|
|
820
822
|
);
|
|
821
|
-
}, [
|
|
823
|
+
}, [$e, Ke] = Q({}), Fe = (e) => w || $e[e] === !0, [l, d] = Q({}), o = bt(
|
|
822
824
|
(e) => (r) => d((i) => i[e] === r ? i : { ...i, [e]: r }),
|
|
823
825
|
[]
|
|
824
|
-
), [h,
|
|
825
|
-
(e) => (r) =>
|
|
826
|
+
), [h, L] = Q({}), M = bt(
|
|
827
|
+
(e) => (r) => L((i) => i[e] === r ? i : { ...i, [e]: r }),
|
|
826
828
|
[]
|
|
827
829
|
), re = (e) => {
|
|
828
830
|
const r = de.filter((c) => c.group_key === e).sort((c, y) => c.sort - y.sort);
|
|
829
831
|
if (r.length === 0) return null;
|
|
830
|
-
const i = r.some((c) =>
|
|
831
|
-
return /* @__PURE__ */ t("div", { className: i ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: r.map((c) => /* @__PURE__ */ t("div", { hidden:
|
|
832
|
+
const i = r.some((c) => Fe(c.field));
|
|
833
|
+
return /* @__PURE__ */ t("div", { className: i ? "mt-3 space-y-4" : "hidden", "data-read-widgets": !0, children: r.map((c) => /* @__PURE__ */ t("div", { hidden: !Fe(c.field), children: S(
|
|
832
834
|
{ kind: "slot", field: c.field, group_key: c.group_key ?? null },
|
|
833
835
|
/* @__PURE__ */ t(
|
|
834
|
-
|
|
836
|
+
ql,
|
|
835
837
|
{
|
|
836
838
|
widgetId: c.widget_id,
|
|
837
|
-
inputBindings:
|
|
838
|
-
itemDraft:
|
|
839
|
-
itemCollection:
|
|
840
|
-
ready: !!
|
|
839
|
+
inputBindings: Ve(c),
|
|
840
|
+
itemDraft: u ?? {},
|
|
841
|
+
itemCollection: n,
|
|
842
|
+
ready: !!u,
|
|
841
843
|
label: c.label_override ?? void 0,
|
|
842
844
|
defaultExpanded: c.default_expanded == null ? !0 : !!c.default_expanded,
|
|
843
845
|
onContentChange: (y) => Ke(
|
|
@@ -847,38 +849,38 @@ function yt({
|
|
|
847
849
|
),
|
|
848
850
|
P(c)
|
|
849
851
|
) }, c.field)) });
|
|
850
|
-
}, [
|
|
852
|
+
}, [ae, qe] = Q(() => /* @__PURE__ */ new Set()), he = w || !u ? [] : xl({
|
|
851
853
|
groups: g.groups.filter(
|
|
852
854
|
(e) => e.type !== "container" && e.visibility_mode !== "new_only"
|
|
853
855
|
),
|
|
854
|
-
values:
|
|
855
|
-
fields: [...
|
|
856
|
-
choices:
|
|
857
|
-
quiet:
|
|
858
|
-
readable: (e) =>
|
|
856
|
+
values: u,
|
|
857
|
+
fields: [...H.values()],
|
|
858
|
+
choices: wl([...H.values()]),
|
|
859
|
+
quiet: Zt(g.layout.conditions),
|
|
860
|
+
readable: (e) => vl(
|
|
859
861
|
g.assignments.filter((r) => r.group_key === e).map((r) => r.field),
|
|
860
|
-
|
|
862
|
+
u,
|
|
861
863
|
!!s
|
|
862
864
|
)
|
|
863
|
-
}), Ge = (e) =>
|
|
865
|
+
}), Ge = (e) => qe((r) => {
|
|
864
866
|
const i = new Set(r);
|
|
865
867
|
return i.has(e) ? i.delete(e) : i.add(e), i;
|
|
866
|
-
}),
|
|
867
|
-
(e) => w || !
|
|
868
|
-
), [
|
|
868
|
+
}), rt = [...g.groups].sort((e, r) => e.sort - r.sort).filter((e) => w || e.visibility_mode !== "new_only").filter(
|
|
869
|
+
(e) => w || !u || ae.has(e.key) || sl(e.visible_when, u)
|
|
870
|
+
), [wt, Je] = Q(() => /* @__PURE__ */ new Set()), be = (e) => !e.is_collapsed || wt.has(e.key), St = (e) => Je((r) => {
|
|
869
871
|
const i = new Set(r);
|
|
870
872
|
return i.has(e) ? i.delete(e) : i.add(e), i;
|
|
871
|
-
}),
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
}, [
|
|
875
|
-
const e =
|
|
873
|
+
}), Ae = (s == null ? void 0 : s.context.fold) ?? null, Re = (s == null ? void 0 : s.context.reveal) ?? null;
|
|
874
|
+
ke(() => {
|
|
875
|
+
Ae && Je(Ae.open ? new Set(g.groups.map((e) => e.key)) : /* @__PURE__ */ new Set());
|
|
876
|
+
}, [Ae == null ? void 0 : Ae.seq]), ke(() => {
|
|
877
|
+
const e = Re ? Nl(Re.target) : null;
|
|
876
878
|
e && Je((r) => r.has(e) ? r : new Set(r).add(e));
|
|
877
|
-
}, [
|
|
879
|
+
}, [Re == null ? void 0 : Re.seq]);
|
|
878
880
|
const Qe = [];
|
|
879
|
-
for (const e of
|
|
881
|
+
for (const e of rt) {
|
|
880
882
|
if (e.type === "container") {
|
|
881
|
-
for (const r of
|
|
883
|
+
for (const r of rt.filter((i) => i.container_id != null && i.container_id === e.id))
|
|
882
884
|
Qe.push(r);
|
|
883
885
|
continue;
|
|
884
886
|
}
|
|
@@ -887,34 +889,34 @@ function yt({
|
|
|
887
889
|
const G = (e) => {
|
|
888
890
|
var r;
|
|
889
891
|
return !!((r = z(e.field)) != null && r.junction_field);
|
|
890
|
-
},
|
|
892
|
+
}, at = (e) => {
|
|
891
893
|
var i;
|
|
892
894
|
const r = String(
|
|
893
|
-
xe(e.overrides).interface ?? ((i =
|
|
895
|
+
xe(e.overrides).interface ?? ((i = H.get(e.field)) == null ? void 0 : i.interface) ?? ""
|
|
894
896
|
);
|
|
895
897
|
return /rich|wysiwyg|editorjs/i.test(r);
|
|
896
|
-
},
|
|
897
|
-
const r =
|
|
898
|
-
if (i.summary_toggle === !0 && !s && x &&
|
|
898
|
+
}, Te = (e) => {
|
|
899
|
+
const r = H.get(e.field), i = xe(e.overrides);
|
|
900
|
+
if (i.summary_toggle === !0 && !s && x && u)
|
|
899
901
|
return /* @__PURE__ */ t(
|
|
900
|
-
|
|
902
|
+
El,
|
|
901
903
|
{
|
|
902
|
-
collection:
|
|
904
|
+
collection: n,
|
|
903
905
|
itemId: String(x),
|
|
904
906
|
field: e.field,
|
|
905
|
-
value:
|
|
907
|
+
value: u[e.field],
|
|
906
908
|
label: ce(e)
|
|
907
909
|
}
|
|
908
910
|
);
|
|
909
|
-
if (
|
|
910
|
-
const K =
|
|
911
|
-
return /* @__PURE__ */ t("span", { "data-display-formula": e.field, className: "tabular-nums", children:
|
|
911
|
+
if (Ce(e.field)) {
|
|
912
|
+
const K = ll(i), me = hl((K == null ? void 0 : K.expr) ?? "", u ?? {});
|
|
913
|
+
return /* @__PURE__ */ t("span", { "data-display-formula": e.field, className: "tabular-nums", children: me.error ? "—" : rl(me.value, K ?? { format: "", currency: null }) });
|
|
912
914
|
}
|
|
913
915
|
const c = z(e.field);
|
|
914
916
|
if (s && !x && (c != null && c.junction_field)) return /* @__PURE__ */ t(le, {});
|
|
915
917
|
if (c != null && c.junction_field && c.many_collection && c.many_field)
|
|
916
918
|
return /* @__PURE__ */ t(
|
|
917
|
-
|
|
919
|
+
Cl,
|
|
918
920
|
{
|
|
919
921
|
junction: c.many_collection,
|
|
920
922
|
parentFk: c.many_field,
|
|
@@ -925,35 +927,35 @@ function yt({
|
|
|
925
927
|
relation: c
|
|
926
928
|
}
|
|
927
929
|
);
|
|
928
|
-
const y =
|
|
930
|
+
const y = u == null ? void 0 : u[e.field], I = pe(e.field);
|
|
929
931
|
if (I === "nivaro_users" && y != null)
|
|
930
|
-
return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(
|
|
931
|
-
if (I) return /* @__PURE__ */ t(
|
|
932
|
-
if ((r == null ? void 0 : r.type) === "boolean" && (y == null || y === "")) return /* @__PURE__ */ t(
|
|
932
|
+
return /* @__PURE__ */ t("span", { className: "inline-block", children: /* @__PURE__ */ t(kt, { userId: String(y), size: "compact" }) });
|
|
933
|
+
if (I) return /* @__PURE__ */ t(lt, { collection: I, id: y });
|
|
934
|
+
if ((r == null ? void 0 : r.type) === "boolean" && (y == null || y === "")) return /* @__PURE__ */ t(Ue, { value: !1 });
|
|
933
935
|
if (y == null || y === "") return /* @__PURE__ */ t(le, {});
|
|
934
936
|
if ((r == null ? void 0 : r.type) === "boolean")
|
|
935
937
|
return /* @__PURE__ */ t(
|
|
936
|
-
|
|
938
|
+
Ue,
|
|
937
939
|
{
|
|
938
940
|
value: y,
|
|
939
941
|
trueTone: (i.options ?? {}).trueTone ?? "positive"
|
|
940
942
|
}
|
|
941
943
|
);
|
|
942
944
|
const te = i.options ?? {};
|
|
943
|
-
return
|
|
945
|
+
return at(e) && typeof y == "string" ? /^\s*\{/.test(y) ? /* @__PURE__ */ t("div", { className: "min-w-0 whitespace-pre-wrap font-normal [overflow-wrap:anywhere]", children: ml(y) }) : /* @__PURE__ */ t(
|
|
944
946
|
"div",
|
|
945
947
|
{
|
|
946
948
|
className: "rrv-prose min-w-0 font-normal leading-relaxed [overflow-wrap:anywhere] [&_a]:underline [&_h1]:text-[15px] [&_h1]:font-semibold [&_h2]:text-[14px] [&_h2]:font-semibold [&_h3]:font-semibold [&_li]:ml-4 [&_ol]:list-decimal [&_p]:my-1 [&_ul]:list-disc",
|
|
947
|
-
dangerouslySetInnerHTML: { __html:
|
|
949
|
+
dangerouslySetInnerHTML: { __html: il(y) }
|
|
948
950
|
}
|
|
949
|
-
) : te.format === "currency" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children:
|
|
950
|
-
},
|
|
951
|
+
) : te.format === "currency" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children: tt(y) }) : (r == null ? void 0 : r.type) === "decimal" || (r == null ? void 0 : r.type) === "float" ? /* @__PURE__ */ t("span", { className: "tabular-nums", children: He(y) }) : (r == null ? void 0 : r.type) === "date" || (r == null ? void 0 : r.type) === "datetime" || (r == null ? void 0 : r.type) === "timestamp" ? Nt(y) : String(y);
|
|
952
|
+
}, $t = (e) => {
|
|
951
953
|
const r = xe(e.overrides), i = z(e.field);
|
|
952
954
|
if (!(i != null && i.many_collection) || !i.many_field) return null;
|
|
953
955
|
if (s && !x) return /* @__PURE__ */ t("p", { className: "py-3 text-[12px] text-slate-400", children: "No records" });
|
|
954
956
|
const c = r.options ?? {}, y = (() => {
|
|
955
957
|
var K;
|
|
956
|
-
const te = (K =
|
|
958
|
+
const te = (K = H.get(e.field)) == null ? void 0 : K.options;
|
|
957
959
|
if (!te) return {};
|
|
958
960
|
if (typeof te == "string")
|
|
959
961
|
try {
|
|
@@ -964,7 +966,7 @@ function yt({
|
|
|
964
966
|
return te;
|
|
965
967
|
})(), I = c.layout_id ?? null;
|
|
966
968
|
return /* @__PURE__ */ t(
|
|
967
|
-
|
|
969
|
+
Dl,
|
|
968
970
|
{
|
|
969
971
|
collection: i.many_collection,
|
|
970
972
|
fkField: i.many_field,
|
|
@@ -976,75 +978,75 @@ function yt({
|
|
|
976
978
|
},
|
|
977
979
|
e.field
|
|
978
980
|
);
|
|
979
|
-
}, X = (e) => !!z(e.field) && !G(e),
|
|
980
|
-
if (!
|
|
981
|
-
const r =
|
|
981
|
+
}, X = (e) => !!z(e.field) && !G(e), Ft = !!g.layout.hide_empty, nt = Array.isArray(g.layout.header_fields) ? g.layout.header_fields.filter((e) => typeof e == "string") : [], qt = new Set(nt), At = (e) => {
|
|
982
|
+
if (!u || G(e)) return !1;
|
|
983
|
+
const r = u[e.field];
|
|
982
984
|
return r == null || r === "" || Array.isArray(r) && r.length === 0;
|
|
983
|
-
},
|
|
985
|
+
}, Rt = (e) => se.find((r) => r.field === e), ce = (e) => {
|
|
984
986
|
var c;
|
|
985
|
-
const r = xe(e.overrides).label, i = A ?
|
|
986
|
-
return i !== void 0 ? i :
|
|
987
|
-
},
|
|
988
|
-
const r =
|
|
987
|
+
const r = xe(e.overrides).label, i = A ? tl(e.overrides, A).label : void 0;
|
|
988
|
+
return i !== void 0 ? i : Ce(e.field) ? typeof r == "string" && r.trim() ? r : "Formula" : typeof r == "string" && r.trim() ? r : e.label_override || ((c = H.get(e.field)) == null ? void 0 : c.label) || Ze(e.field);
|
|
989
|
+
}, Tt = (e) => {
|
|
990
|
+
const r = Yt(e.swap_config), i = se.filter((a) => a.group_key === e.key && !qt.has(a.field)).filter((a) => w || !u || !zt(a.overrides) || !ye(u[a.field])).sort((a, R) => a.sort - R.sort), c = de.filter((a) => a.group_key === e.key), y = Me(e.key), I = i.length === 0 && c.length === 0 && y.length === 0;
|
|
989
991
|
if (I && !s) return null;
|
|
990
|
-
const te = (
|
|
991
|
-
const
|
|
992
|
-
return
|
|
993
|
-
}).filter((
|
|
994
|
-
({ a
|
|
995
|
-
).slice(0,
|
|
996
|
-
var
|
|
997
|
-
const
|
|
992
|
+
const te = (a) => Ft && !w && (X(a) || G(a)) && ((f == null ? void 0 : f[a.field]) ?? l[a.field]) === 0, K = i.filter((a) => !X(a)), me = i.filter(X), je = c.filter((a) => Fe(a.field)), Ot = !e.hide_when_empty && y.length === 0 && je.length === 0 && i.length > 0 && i.some((a) => X(a) || G(a)) && i.every(te), Ye = (a) => !Ot && te(a), Ct = i.filter((a) => !Ye(a)), ge = (a) => (f == null ? void 0 : f[a.field]) ?? l[a.field], Dt = !!e.hide_when_empty && !s && !w && !!u && y.length === 0 && je.length === 0 && i.every((a) => X(a) || G(a) ? ge(a) === 0 : ye(u[a.field])) || !I && Ct.length === 0 && y.length === 0 && je.length === 0, Et = (a) => (f == null ? void 0 : f[a.field]) ?? l[a.field], ze = !!r.emptyText && !!u && !s && y.length === 0 && je.length === 0 && i.every((a) => X(a) || G(a) ? Et(a) === 0 : ye(u[a.field])), Pt = Xt(K, { rows: r.rows }).units, Xe = e.is_collapsed ? Rl(e.summary_fields).map((a) => {
|
|
993
|
+
const R = i.find((Le) => Le.field === a.field);
|
|
994
|
+
return R ? { a: R, label: a.label || ce(R) } : null;
|
|
995
|
+
}).filter((a) => !!a).filter(
|
|
996
|
+
({ a }) => !e.summary_hide_empty || !u || (X(a) || G(a) ? ge(a) !== 0 : !ye(u[a.field]))
|
|
997
|
+
).slice(0, Al) : [], ct = e.read_width === "full" || e.read_width === "half" || e.read_width === "third" ? e.read_width : me.length > 0 || c.length > 0 || y.length > 0 || K.length > 4 ? "full" : "half", Mt = (a) => {
|
|
998
|
+
var ft, pt, ht;
|
|
999
|
+
const R = Ye(a), J = !!(xe(a.overrides).options ?? {}).emphasis, Oe = at(a) || !!((pt = (ft = H.get(a.field)) == null ? void 0 : ft.interface) != null && pt.includes("rich-text")), mt = u == null ? void 0 : u[a.field], ut = !Oe && !G(a) && !pe(a.field) && (String(((ht = H.get(a.field)) == null ? void 0 : ht.interface) ?? "").includes("textarea") || typeof mt == "string" && mt.length > 36);
|
|
998
1000
|
return /* @__PURE__ */ t(
|
|
999
1001
|
"div",
|
|
1000
1002
|
{
|
|
1001
|
-
hidden:
|
|
1002
|
-
className: `min-w-0 ${
|
|
1003
|
+
hidden: R,
|
|
1004
|
+
className: `min-w-0 ${Oe || G(a) && (h[a.field] === "nivaro_files" || (l[a.field] ?? 0) > 3) ? "col-span-full" : J || ut ? "col-span-2" : ""}`,
|
|
1003
1005
|
children: S(
|
|
1004
|
-
C(
|
|
1005
|
-
/* @__PURE__ */ p(
|
|
1006
|
+
C(a),
|
|
1007
|
+
/* @__PURE__ */ p(ve, { children: [
|
|
1006
1008
|
/* @__PURE__ */ p("dt", { className: Ie, children: [
|
|
1007
|
-
ce(
|
|
1008
|
-
/* @__PURE__ */ t(ie, { field:
|
|
1009
|
-
/* @__PURE__ */ t(
|
|
1010
|
-
v(
|
|
1009
|
+
ce(a),
|
|
1010
|
+
/* @__PURE__ */ t(ie, { field: a.field }),
|
|
1011
|
+
/* @__PURE__ */ t(gt, { field: a.field }),
|
|
1012
|
+
v(a.field)
|
|
1011
1013
|
] }),
|
|
1012
1014
|
/* @__PURE__ */ t(
|
|
1013
1015
|
"dd",
|
|
1014
1016
|
{
|
|
1015
|
-
"data-replay-field":
|
|
1016
|
-
"data-field-collection":
|
|
1017
|
-
"data-remote-changed":
|
|
1018
|
-
className: `mt-1 min-w-0${E(
|
|
1019
|
-
children:
|
|
1017
|
+
"data-replay-field": a.field,
|
|
1018
|
+
"data-field-collection": n,
|
|
1019
|
+
"data-remote-changed": ue.has(a.field) || void 0,
|
|
1020
|
+
className: `mt-1 min-w-0${E(a.field)} ${J ? "text-[17px] font-semibold tracking-[-0.01em] text-slate-900 dark:text-white" : `${G(a) || Oe ? "" : ut ? "line-clamp-3 break-words " : "truncate "}text-[13px] font-medium text-slate-800 dark:text-slate-100`}`,
|
|
1021
|
+
children: u ? Te(a) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-20 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
1020
1022
|
}
|
|
1021
1023
|
)
|
|
1022
1024
|
] }),
|
|
1023
|
-
P(
|
|
1025
|
+
P(a)
|
|
1024
1026
|
)
|
|
1025
1027
|
},
|
|
1026
|
-
|
|
1028
|
+
a.field
|
|
1027
1029
|
);
|
|
1028
|
-
},
|
|
1029
|
-
const
|
|
1030
|
+
}, Kt = (a, R) => {
|
|
1031
|
+
const Le = u && !s ? R.filter((J) => !ye(u[J.field])) : R;
|
|
1030
1032
|
return /* @__PURE__ */ p(
|
|
1031
1033
|
"div",
|
|
1032
1034
|
{
|
|
1033
|
-
"data-read-row":
|
|
1034
|
-
className: `min-w-0 ${
|
|
1035
|
+
"data-read-row": a.key,
|
|
1036
|
+
className: `min-w-0 ${R.length > 2 ? "col-span-full" : "col-span-2"}`,
|
|
1035
1037
|
children: [
|
|
1036
|
-
/* @__PURE__ */ t("dt", { className: Ie, children:
|
|
1037
|
-
/* @__PURE__ */ t("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children:
|
|
1038
|
-
|
|
1038
|
+
/* @__PURE__ */ t("dt", { className: Ie, children: a.label.trim() || R.map(ce).join(" / ") }),
|
|
1039
|
+
/* @__PURE__ */ t("dd", { className: "mt-1 flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u ? Le.length === 0 ? /* @__PURE__ */ t(le, {}) : Le.map((J, Oe) => /* @__PURE__ */ p(Ht, { children: [
|
|
1040
|
+
Oe > 0 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-slate-600", children: "·" }),
|
|
1039
1041
|
S(
|
|
1040
1042
|
C(J),
|
|
1041
1043
|
/* @__PURE__ */ t(
|
|
1042
1044
|
"span",
|
|
1043
1045
|
{
|
|
1044
1046
|
"data-replay-field": J.field,
|
|
1045
|
-
"data-field-collection":
|
|
1047
|
+
"data-field-collection": n,
|
|
1046
1048
|
className: `min-w-0 break-words${E(J.field)}`,
|
|
1047
|
-
children:
|
|
1049
|
+
children: Te(J)
|
|
1048
1050
|
}
|
|
1049
1051
|
),
|
|
1050
1052
|
P(J)
|
|
@@ -1052,31 +1054,31 @@ function yt({
|
|
|
1052
1054
|
] }, J.field)) : /* @__PURE__ */ t("span", { className: "inline-block h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }) })
|
|
1053
1055
|
]
|
|
1054
1056
|
},
|
|
1055
|
-
`row:${
|
|
1057
|
+
`row:${a.key}`
|
|
1056
1058
|
);
|
|
1057
1059
|
};
|
|
1058
1060
|
return /* @__PURE__ */ t(
|
|
1059
1061
|
"section",
|
|
1060
1062
|
{
|
|
1061
|
-
hidden:
|
|
1063
|
+
hidden: Dt,
|
|
1062
1064
|
"data-read-section": e.key,
|
|
1063
|
-
"data-read-width":
|
|
1065
|
+
"data-read-width": ct,
|
|
1064
1066
|
className: "min-w-0 rounded-xl border border-slate-200 bg-white dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
1065
1067
|
children: S(
|
|
1066
1068
|
{ kind: "group", key: e.key },
|
|
1067
|
-
/* @__PURE__ */ p(
|
|
1069
|
+
/* @__PURE__ */ p(ve, { children: [
|
|
1068
1070
|
/* @__PURE__ */ p(
|
|
1069
1071
|
"h3",
|
|
1070
1072
|
{
|
|
1071
1073
|
"data-read-head": "",
|
|
1072
1074
|
className: `group/rs relative flex items-center justify-between gap-2 px-5 py-2.5 text-[12.5px] font-semibold text-slate-700 dark:text-slate-200 ${be(e) ? "border-b border-slate-100 dark:border-slate-800" : ""}`,
|
|
1073
1075
|
children: [
|
|
1074
|
-
e.is_collapsed ? /* @__PURE__ */ p(
|
|
1076
|
+
e.is_collapsed ? /* @__PURE__ */ p(ve, { children: [
|
|
1075
1077
|
/* @__PURE__ */ t(
|
|
1076
1078
|
"button",
|
|
1077
1079
|
{
|
|
1078
1080
|
type: "button",
|
|
1079
|
-
onClick: () =>
|
|
1081
|
+
onClick: () => St(e.key),
|
|
1080
1082
|
"aria-expanded": be(e),
|
|
1081
1083
|
className: `min-w-0 text-left after:absolute after:inset-0 group-hover/rs:text-slate-900 dark:group-hover/rs:text-white ${Xe.length > 0 && !be(e) ? "shrink-0" : "flex-1"}`,
|
|
1082
1084
|
children: e.label
|
|
@@ -1089,30 +1091,30 @@ function yt({
|
|
|
1089
1091
|
{
|
|
1090
1092
|
"data-read-collapsed-summary": e.key,
|
|
1091
1093
|
className: "pointer-events-none flex min-w-0 flex-1 items-baseline gap-x-3 overflow-hidden whitespace-nowrap text-[12px] font-normal",
|
|
1092
|
-
children: Xe.map(({ a
|
|
1093
|
-
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children:
|
|
1094
|
-
/* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children:
|
|
1095
|
-
] },
|
|
1094
|
+
children: Xe.map(({ a, label: R }) => /* @__PURE__ */ p("span", { className: "flex min-w-0 shrink items-baseline gap-1", children: [
|
|
1095
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[10px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: R }),
|
|
1096
|
+
/* @__PURE__ */ t("span", { className: "min-w-0 truncate font-medium text-slate-700 dark:text-slate-300", children: u ? X(a) || G(a) ? ge(a) == null ? "…" : `${ge(a)} ${X(a) ? ge(a) === 1 ? "row" : "rows" : ge(a) === 1 ? "item" : "items"}` : ye(u[a.field]) ? /* @__PURE__ */ t("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : Te(a) : "…" })
|
|
1097
|
+
] }, a.field))
|
|
1096
1098
|
}
|
|
1097
1099
|
)
|
|
1098
1100
|
] }) : /* @__PURE__ */ t("span", { className: "min-w-0 flex-1", children: e.label }),
|
|
1099
|
-
q && (K.length > 0 ||
|
|
1101
|
+
q && (K.length > 0 || me.length > 0) && /* @__PURE__ */ t(
|
|
1100
1102
|
"button",
|
|
1101
1103
|
{
|
|
1102
1104
|
type: "button",
|
|
1103
1105
|
"data-read-edit-section": e.key,
|
|
1104
1106
|
onClick: () => {
|
|
1105
|
-
var
|
|
1106
|
-
return q(e.key, ((
|
|
1107
|
+
var a, R;
|
|
1108
|
+
return q(e.key, ((a = K[0]) == null ? void 0 : a.field) ?? ((R = me[0]) == null ? void 0 : R.field) ?? null);
|
|
1107
1109
|
},
|
|
1108
1110
|
title: `Edit ${e.label}`,
|
|
1109
1111
|
"aria-label": `Edit ${e.label}`,
|
|
1110
1112
|
className: "relative -my-1 rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-slate-700 focus-visible:opacity-100 group-hover/rs:opacity-100 dark:hover:bg-white/5 dark:hover:text-slate-200 motion-reduce:transition-none",
|
|
1111
|
-
children: /* @__PURE__ */ t(
|
|
1113
|
+
children: /* @__PURE__ */ t(jt, { className: "h-3 w-3" })
|
|
1112
1114
|
}
|
|
1113
1115
|
),
|
|
1114
1116
|
e.is_collapsed && /* @__PURE__ */ t(
|
|
1115
|
-
|
|
1117
|
+
Wt,
|
|
1116
1118
|
{
|
|
1117
1119
|
"aria-hidden": "true",
|
|
1118
1120
|
className: `pointer-events-none h-3.5 w-3.5 shrink-0 transition-transform group-hover/rs:text-slate-700 dark:group-hover/rs:text-slate-200 ${be(e) ? "" : "-rotate-90"}`
|
|
@@ -1138,44 +1140,44 @@ function yt({
|
|
|
1138
1140
|
"dl",
|
|
1139
1141
|
{
|
|
1140
1142
|
className: "grid gap-x-6 gap-y-5",
|
|
1141
|
-
"data-read-dl":
|
|
1143
|
+
"data-read-dl": ct,
|
|
1142
1144
|
style: ze ? { display: "none" } : void 0,
|
|
1143
|
-
children:
|
|
1144
|
-
(
|
|
1145
|
+
children: Pt.map(
|
|
1146
|
+
(a) => a.kind === "row" ? Kt(a.row, a.members) : Mt(a.field)
|
|
1145
1147
|
)
|
|
1146
1148
|
}
|
|
1147
1149
|
),
|
|
1148
|
-
|
|
1149
|
-
var
|
|
1150
|
+
me.map((a) => {
|
|
1151
|
+
var R;
|
|
1150
1152
|
return /* @__PURE__ */ t(
|
|
1151
1153
|
"div",
|
|
1152
1154
|
{
|
|
1153
1155
|
className: K.length > 0 ? "mt-3" : "",
|
|
1154
|
-
hidden: Ye(
|
|
1156
|
+
hidden: Ye(a) || ze,
|
|
1155
1157
|
children: S(
|
|
1156
|
-
C(
|
|
1157
|
-
/* @__PURE__ */ p(
|
|
1158
|
-
(
|
|
1159
|
-
/* @__PURE__ */ t("span", { children: ce(
|
|
1160
|
-
/* @__PURE__ */ t(ie, { field:
|
|
1158
|
+
C(a),
|
|
1159
|
+
/* @__PURE__ */ p(ve, { children: [
|
|
1160
|
+
(R = $ == null ? void 0 : $.get(a.field)) != null && R.length ? /* @__PURE__ */ p("div", { className: "mb-1.5 flex items-center gap-1.5 text-[11px] font-medium text-amber-700 dark:text-amber-300", children: [
|
|
1161
|
+
/* @__PURE__ */ t("span", { children: ce(a) }),
|
|
1162
|
+
/* @__PURE__ */ t(ie, { field: a.field }),
|
|
1161
1163
|
/* @__PURE__ */ p("span", { className: "font-normal text-amber-700/80 dark:text-amber-300/80", children: [
|
|
1162
1164
|
"— ",
|
|
1163
|
-
$.get(
|
|
1165
|
+
$.get(a.field).length,
|
|
1164
1166
|
" line issue",
|
|
1165
|
-
$.get(
|
|
1167
|
+
$.get(a.field).length === 1 ? "" : "s",
|
|
1166
1168
|
"; switch to Edit to fix"
|
|
1167
1169
|
] })
|
|
1168
1170
|
] }) : null,
|
|
1169
|
-
(
|
|
1171
|
+
(O ? O(a) : null) ?? $t(a)
|
|
1170
1172
|
] }),
|
|
1171
|
-
P(
|
|
1173
|
+
P(a)
|
|
1172
1174
|
)
|
|
1173
1175
|
},
|
|
1174
|
-
|
|
1176
|
+
a.field
|
|
1175
1177
|
);
|
|
1176
1178
|
}),
|
|
1177
1179
|
re(e.key),
|
|
1178
|
-
|
|
1180
|
+
Se(e.key),
|
|
1179
1181
|
I && s && /* @__PURE__ */ t(
|
|
1180
1182
|
"div",
|
|
1181
1183
|
{
|
|
@@ -1191,55 +1193,55 @@ function yt({
|
|
|
1191
1193
|
},
|
|
1192
1194
|
e.key
|
|
1193
1195
|
);
|
|
1194
|
-
},
|
|
1196
|
+
}, it = Se(null), Lt = Se(null, "leading"), st = nt.map((e) => Rt(e)).filter((e) => !!e && !X(e)).filter((e) => w || !At(e)), [ne, ...dt] = st;
|
|
1195
1197
|
return /* @__PURE__ */ p(
|
|
1196
1198
|
"div",
|
|
1197
1199
|
{
|
|
1198
1200
|
className: F ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto bg-slate-50/60 px-5 py-4 dark:bg-transparent",
|
|
1199
1201
|
children: [
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
+
Lt,
|
|
1203
|
+
st.length > 0 && /* @__PURE__ */ p(
|
|
1202
1204
|
"div",
|
|
1203
1205
|
{
|
|
1204
1206
|
"data-read-header": !0,
|
|
1205
1207
|
className: "mb-4 rounded-xl border border-slate-200 bg-white px-5 py-4 dark:border-slate-700/60 dark:bg-slate-900/40",
|
|
1206
1208
|
children: [
|
|
1207
|
-
|
|
1208
|
-
{ kind: "header", field:
|
|
1209
|
+
ne && S(
|
|
1210
|
+
{ kind: "header", field: ne.field },
|
|
1209
1211
|
/* @__PURE__ */ p("div", { className: "min-w-0", children: [
|
|
1210
1212
|
/* @__PURE__ */ p("p", { className: Ie, children: [
|
|
1211
|
-
ce(
|
|
1212
|
-
/* @__PURE__ */ t(ie, { field:
|
|
1213
|
+
ce(ne),
|
|
1214
|
+
/* @__PURE__ */ t(ie, { field: ne.field })
|
|
1213
1215
|
] }),
|
|
1214
1216
|
/* @__PURE__ */ t(
|
|
1215
1217
|
"p",
|
|
1216
1218
|
{
|
|
1217
|
-
"data-replay-field":
|
|
1218
|
-
"data-field-collection":
|
|
1219
|
-
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${E(
|
|
1220
|
-
children:
|
|
1219
|
+
"data-replay-field": ne.field,
|
|
1220
|
+
"data-field-collection": n,
|
|
1221
|
+
className: `truncate text-[22px] font-semibold leading-tight tracking-[-0.015em] text-slate-900 dark:text-white${E(ne.field)}`,
|
|
1222
|
+
children: u ? Te(ne) : "…"
|
|
1221
1223
|
}
|
|
1222
1224
|
)
|
|
1223
1225
|
] }),
|
|
1224
|
-
P(
|
|
1226
|
+
P(ne)
|
|
1225
1227
|
),
|
|
1226
|
-
|
|
1228
|
+
dt.length > 0 && /* @__PURE__ */ t("dl", { className: "mt-3 flex flex-wrap gap-x-8 gap-y-2", children: dt.map((e) => /* @__PURE__ */ t("div", { className: "min-w-0", children: S(
|
|
1227
1229
|
{ kind: "header", field: e.field },
|
|
1228
|
-
/* @__PURE__ */ p(
|
|
1230
|
+
/* @__PURE__ */ p(ve, { children: [
|
|
1229
1231
|
/* @__PURE__ */ p("dt", { className: Ie, children: [
|
|
1230
1232
|
ce(e),
|
|
1231
1233
|
/* @__PURE__ */ t(ie, { field: e.field }),
|
|
1232
|
-
/* @__PURE__ */ t(
|
|
1234
|
+
/* @__PURE__ */ t(gt, { field: e.field }),
|
|
1233
1235
|
v(e.field)
|
|
1234
1236
|
] }),
|
|
1235
1237
|
/* @__PURE__ */ t(
|
|
1236
1238
|
"dd",
|
|
1237
1239
|
{
|
|
1238
1240
|
"data-replay-field": e.field,
|
|
1239
|
-
"data-field-collection":
|
|
1240
|
-
"data-remote-changed":
|
|
1241
|
+
"data-field-collection": n,
|
|
1242
|
+
"data-remote-changed": ue.has(e.field) || void 0,
|
|
1241
1243
|
className: `mt-0.5 truncate text-[13px] font-medium text-slate-800 dark:text-slate-100${E(e.field)}`,
|
|
1242
|
-
children:
|
|
1244
|
+
children: u ? Te(e) : "…"
|
|
1243
1245
|
}
|
|
1244
1246
|
)
|
|
1245
1247
|
] }),
|
|
@@ -1248,39 +1250,39 @@ function yt({
|
|
|
1248
1250
|
]
|
|
1249
1251
|
}
|
|
1250
1252
|
),
|
|
1251
|
-
/* @__PURE__ */ t("style", { children:
|
|
1252
|
-
|
|
1253
|
-
|
|
1253
|
+
/* @__PURE__ */ t("style", { children: Tl }),
|
|
1254
|
+
V && he.length > 0 && /* @__PURE__ */ t("div", { className: "mb-3", children: /* @__PURE__ */ t(bl, { items: he, revealed: ae, onToggle: Ge }) }),
|
|
1255
|
+
V ? /* @__PURE__ */ t("div", { className: "grid items-stretch gap-4", "data-read-board": !0, children: Qe.map(Tt) }) : /* @__PURE__ */ p("div", { className: "flex flex-col gap-4", "data-read-board-pending": !0, children: [
|
|
1254
1256
|
/* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1255
1257
|
/* @__PURE__ */ t("div", { className: "h-32 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
1256
1258
|
/* @__PURE__ */ t("div", { className: "h-56 animate-pulse rounded-xl bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
1257
1259
|
] }),
|
|
1258
|
-
|
|
1260
|
+
it && /* @__PURE__ */ t("div", { className: "mt-4", children: it })
|
|
1259
1261
|
]
|
|
1260
1262
|
}
|
|
1261
1263
|
);
|
|
1262
1264
|
}
|
|
1263
|
-
function
|
|
1264
|
-
return
|
|
1265
|
+
function Nr(n) {
|
|
1266
|
+
return n.design ? /* @__PURE__ */ t(kl, { design: n.design.context, onRefusedWrite: n.design.onRefusedWrite, children: /* @__PURE__ */ t(Ut.Provider, { value: null, children: /* @__PURE__ */ t(xt, { ...n }) }) }) : /* @__PURE__ */ t(xt, { ...n });
|
|
1265
1267
|
}
|
|
1266
|
-
function
|
|
1267
|
-
collection:
|
|
1268
|
-
itemId:
|
|
1268
|
+
function El({
|
|
1269
|
+
collection: n,
|
|
1270
|
+
itemId: m,
|
|
1269
1271
|
field: b,
|
|
1270
1272
|
value: s,
|
|
1271
1273
|
label: F
|
|
1272
1274
|
}) {
|
|
1273
|
-
const N =
|
|
1274
|
-
if (
|
|
1275
|
+
const N = Ne(), _ = vt(), [O, q] = Q(null), f = O ?? (s === !0 || s === 1 || s === "1" || s === "true"), T = async () => {
|
|
1276
|
+
if (O !== null) return;
|
|
1275
1277
|
const A = !f;
|
|
1276
1278
|
q(A);
|
|
1277
1279
|
try {
|
|
1278
|
-
await N.request(
|
|
1279
|
-
_.invalidateQueries({ queryKey: ["rrv-record",
|
|
1280
|
-
_.invalidateQueries({ queryKey: ["item",
|
|
1281
|
-
]),
|
|
1280
|
+
await N.request(Jt(`/items/${n}/${m}`, { [b]: A })), await Promise.all([
|
|
1281
|
+
_.invalidateQueries({ queryKey: ["rrv-record", n, m] }),
|
|
1282
|
+
_.invalidateQueries({ queryKey: ["item", n, m] })
|
|
1283
|
+
]), al(_, n, m);
|
|
1282
1284
|
} catch (j) {
|
|
1283
|
-
|
|
1285
|
+
Qt(j, "Could not save that change");
|
|
1284
1286
|
} finally {
|
|
1285
1287
|
q(null);
|
|
1286
1288
|
}
|
|
@@ -1292,8 +1294,8 @@ function Cl({
|
|
|
1292
1294
|
role: "switch",
|
|
1293
1295
|
"aria-checked": f,
|
|
1294
1296
|
"aria-label": typeof F == "string" ? F : b,
|
|
1295
|
-
disabled:
|
|
1296
|
-
onClick: () => void
|
|
1297
|
+
disabled: O !== null,
|
|
1298
|
+
onClick: () => void T(),
|
|
1297
1299
|
"data-summary-toggle": b,
|
|
1298
1300
|
className: "group inline-flex items-center gap-2 rounded-md py-0.5 text-[13px] font-medium text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-60 dark:text-slate-100",
|
|
1299
1301
|
children: [
|
|
@@ -1316,7 +1318,7 @@ function Cl({
|
|
|
1316
1318
|
);
|
|
1317
1319
|
}
|
|
1318
1320
|
export {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1321
|
+
Al as COLLAPSED_SUMMARY_MAX,
|
|
1322
|
+
Nr as RecordReadView,
|
|
1323
|
+
Rl as collapsedSummaryEntries
|
|
1322
1324
|
};
|