@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,31 +1,35 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
import
|
|
6
|
-
import { RelationPathDataContext as
|
|
7
|
-
import {
|
|
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
|
-
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as Bt } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as pe, useQueryClient as Ut } from "@tanstack/react-query";
|
|
3
|
+
import * as Pt from "lucide-react";
|
|
4
|
+
import { ChevronDown as Mt, Loader2 as Gt, User as It, Mail as Tt } from "lucide-react";
|
|
5
|
+
import ut, { useContext as Vt, useState as re, useRef as me, useEffect as Q, memo as Et } from "react";
|
|
6
|
+
import { RelationPathDataContext as Ct, useDrilldown as pt, fieldDrilldownConfig as Rt, useOptionalNivaroClient as fe, useNavigation as Jt } from "../../context.js";
|
|
7
|
+
import { OPEN_SECTION_EVENT as tt } from "../../lib/co-edit.js";
|
|
8
|
+
import { get as mt, post as zt } from "../../lib/commands.js";
|
|
9
|
+
import { useCountStep as Ht, countLabel as je } from "../../lib/count-step.js";
|
|
10
|
+
import { planFieldGrid as Kt, isEmptyValue as Wt, isFolded as At, readGroupStructure as Yt } from "../../lib/form-structure.js";
|
|
11
|
+
import { reportSectionUse as ft } from "../../lib/form-usage-beacon.js";
|
|
12
|
+
import { useRecordReader as ht } from "../../lib/record-loader.js";
|
|
13
|
+
import { useStartsOpen as Qt } from "../../lib/use-starts-open.js";
|
|
14
|
+
import { formatDate as ue, formatDateTime as bt, choiceLabel as Zt, titleCase as xt, cn as W, toLocalDateString as Le } from "../../lib/utils.js";
|
|
15
|
+
import { LiveCount as yt } from "../LiveCount.js";
|
|
16
|
+
import { DesignDropZone as Xt, designWrap as en } from "../layout-editor/DesignNode.js";
|
|
17
|
+
import { useLayoutDesign as tn, revealGroupKey as nn } from "../layout-editor/design-context.js";
|
|
18
|
+
import { GridGuides as Fe } from "../layout-editor/grid-guides.js";
|
|
19
|
+
import { UserAvatar as rn } from "../UserAvatar.js";
|
|
20
|
+
import { DropdownMenu as sn, DropdownMenuTrigger as ln, DropdownMenuContent as an, DropdownMenuItem as nt } from "../ui/dropdown-menu.js";
|
|
21
|
+
import { WidgetSlot as rt } from "../WidgetSlot.js";
|
|
22
|
+
import { FieldRow as Oe } from "./FieldRow.js";
|
|
23
|
+
import { useFormHelpVideos as on, FormHelpVideoButton as cn } from "./FormHelpVideoButton.js";
|
|
24
|
+
import { FoldArea as dn, RowGroupCell as un, rowMemberField as pn } from "./form-structure-ui.js";
|
|
25
|
+
import { applyDisplayTemplate as mn, useContainerWidth as fn, resolveColSpan as it } from "./helpers.js";
|
|
26
|
+
import { SectionIntro as hn } from "./LayoutContentBlock.js";
|
|
27
|
+
import { invalidateM2MFor as bn } from "./m2m-invalidate.js";
|
|
28
|
+
import { groupSectionPropsEqual as xn } from "./render-stability.js";
|
|
29
|
+
import { SectionPresence as yn } from "./SectionPresence.js";
|
|
30
|
+
import { UserChip as gt, OwnersInline as st, OwnersInlineCompact as gn } from "./UserChip.js";
|
|
31
|
+
import { UserRosterCluster as lr } from "./UserChip.js";
|
|
32
|
+
function lt(n) {
|
|
29
33
|
if (typeof n != "string") return n ?? [];
|
|
30
34
|
try {
|
|
31
35
|
return JSON.parse(n);
|
|
@@ -33,94 +37,94 @@ function et(n) {
|
|
|
33
37
|
return [];
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
|
-
function
|
|
40
|
+
function Nn({
|
|
37
41
|
relCollection: n,
|
|
38
42
|
relId: t,
|
|
39
43
|
entries: i,
|
|
40
|
-
separator:
|
|
44
|
+
separator: o
|
|
41
45
|
}) {
|
|
42
|
-
const
|
|
43
|
-
queryKey: ["inline-display", n, r,
|
|
44
|
-
queryFn: () =>
|
|
45
|
-
enabled: !!
|
|
46
|
+
const l = fe(), c = ht(), r = String(t), f = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: u } = pe({
|
|
47
|
+
queryKey: ["inline-display", n, r, f],
|
|
48
|
+
queryFn: () => c(n, r, f),
|
|
49
|
+
enabled: !!l && !!r,
|
|
46
50
|
staleTime: 6e4
|
|
47
51
|
});
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
50
|
-
let h =
|
|
52
|
+
if (!u) return null;
|
|
53
|
+
const O = (g) => {
|
|
54
|
+
let h = u;
|
|
51
55
|
for (const v of g.split(".")) {
|
|
52
56
|
if (h == null || typeof h != "object") return;
|
|
53
57
|
h = h[v];
|
|
54
58
|
}
|
|
55
59
|
return h;
|
|
56
60
|
};
|
|
57
|
-
if (
|
|
58
|
-
const g = (
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
61
|
+
if (o != null) {
|
|
62
|
+
const g = (d) => {
|
|
63
|
+
const y = O(d.field);
|
|
64
|
+
if (y == null || y === "") return null;
|
|
65
|
+
const k = d.format ?? "text";
|
|
66
|
+
if (k === "date" || k === "datetime")
|
|
63
67
|
try {
|
|
64
|
-
return
|
|
68
|
+
return Le(y);
|
|
65
69
|
} catch {
|
|
66
|
-
return String(
|
|
70
|
+
return String(y);
|
|
67
71
|
}
|
|
68
|
-
return
|
|
72
|
+
return k === "boolean" ? y ? "Yes" : "No" : String(y);
|
|
69
73
|
}, h = [];
|
|
70
74
|
let v = [];
|
|
71
|
-
for (const
|
|
72
|
-
|
|
75
|
+
for (const d of i)
|
|
76
|
+
d.line_break && v.length > 0 ? (h.push(v), v = [d]) : v.push(d);
|
|
73
77
|
v.length > 0 && h.push(v);
|
|
74
|
-
const
|
|
75
|
-
(
|
|
76
|
-
const
|
|
77
|
-
return
|
|
78
|
+
const j = h.map(
|
|
79
|
+
(d) => d.map((y) => {
|
|
80
|
+
const k = g(y);
|
|
81
|
+
return k ? { label: y.label ?? null, display: k } : null;
|
|
78
82
|
}).filter(Boolean)
|
|
79
|
-
).filter((
|
|
80
|
-
return
|
|
83
|
+
).filter((d) => d.length > 0);
|
|
84
|
+
return j.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: j.map((d, y) => (
|
|
81
85
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
82
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children:
|
|
86
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: d.map((k, D) => (
|
|
83
87
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
D > 0 &&
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
/* @__PURE__ */ x(ut.Fragment, { children: [
|
|
89
|
+
D > 0 && o,
|
|
90
|
+
k.label && /* @__PURE__ */ x("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
91
|
+
k.label,
|
|
88
92
|
":"
|
|
89
93
|
] }),
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
k.label ? " " : "",
|
|
95
|
+
k.display
|
|
92
96
|
] }, D)
|
|
93
|
-
)) },
|
|
97
|
+
)) }, y)
|
|
94
98
|
)) });
|
|
95
99
|
}
|
|
96
100
|
const $ = i.map((g) => {
|
|
97
|
-
const h =
|
|
101
|
+
const h = O(g.field);
|
|
98
102
|
if (h == null || h === "") return null;
|
|
99
103
|
const v = g.format ?? "text";
|
|
100
|
-
let
|
|
104
|
+
let j;
|
|
101
105
|
if (v === "date" || v === "datetime")
|
|
102
106
|
try {
|
|
103
|
-
|
|
107
|
+
j = Le(h);
|
|
104
108
|
} catch {
|
|
105
|
-
|
|
109
|
+
j = String(h);
|
|
106
110
|
}
|
|
107
|
-
else v === "boolean" ?
|
|
108
|
-
return { label: g.label, display:
|
|
111
|
+
else v === "boolean" ? j = h ? "Yes" : "No" : j = String(h);
|
|
112
|
+
return { label: g.label, display: j };
|
|
109
113
|
}).filter(Boolean);
|
|
110
114
|
return $.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1 rounded border border-slate-200 bg-slate-50 dark:border-slate-700 dark:bg-slate-800/50 px-3 py-1.5 space-y-0.5", children: $.map((g, h) => (
|
|
111
115
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
112
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ x("div", { className: "flex items-baseline gap-2", children: [
|
|
113
117
|
g.label && /* @__PURE__ */ e("span", { className: "shrink-0 min-w-[56px] text-[10px] font-medium text-slate-400", children: g.label }),
|
|
114
118
|
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children: g.display })
|
|
115
119
|
] }, h)
|
|
116
120
|
)) });
|
|
117
121
|
}
|
|
118
|
-
function
|
|
122
|
+
function _n(n) {
|
|
119
123
|
if (!n) return null;
|
|
120
|
-
const t = n.replace(/(^|-)([a-z])/g, (
|
|
124
|
+
const t = n.replace(/(^|-)([a-z])/g, (o, l, c) => c.toUpperCase()), i = Pt[t];
|
|
121
125
|
return i || null;
|
|
122
126
|
}
|
|
123
|
-
function
|
|
127
|
+
function at(n) {
|
|
124
128
|
if (!n.options) return {};
|
|
125
129
|
if (typeof n.options == "object") return n.options;
|
|
126
130
|
try {
|
|
@@ -129,10 +133,10 @@ function tt(n) {
|
|
|
129
133
|
return {};
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
|
-
function
|
|
136
|
+
function qe(n, t) {
|
|
133
137
|
if (n == null || n === "") return "—";
|
|
134
138
|
if (typeof n == "boolean") return n ? "Yes" : "No";
|
|
135
|
-
const i = (t == null ? void 0 : t.interface) ?? "",
|
|
139
|
+
const i = (t == null ? void 0 : t.interface) ?? "", o = (() => {
|
|
136
140
|
try {
|
|
137
141
|
const r = t != null && t.options ? JSON.parse(String(t.options)) : null;
|
|
138
142
|
return (r == null ? void 0 : r.display_format) ?? null;
|
|
@@ -140,19 +144,19 @@ function Fe(n, t) {
|
|
|
140
144
|
return null;
|
|
141
145
|
}
|
|
142
146
|
})();
|
|
143
|
-
if (
|
|
147
|
+
if (o) {
|
|
144
148
|
const r = Number(n);
|
|
145
|
-
if (
|
|
149
|
+
if (o === "currency" && Number.isFinite(r))
|
|
146
150
|
return r.toLocaleString(void 0, { style: "currency", currency: "USD" });
|
|
147
|
-
if (
|
|
148
|
-
if (/^0\.0+$/.test(
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
if (!Number.isNaN(
|
|
151
|
+
if (o === "percent" && Number.isFinite(r)) return `${(r * 100).toFixed(1)}%`;
|
|
152
|
+
if (/^0\.0+$/.test(o) && Number.isFinite(r)) return r.toFixed(o.length - 2);
|
|
153
|
+
if (o === "date" && typeof n == "string") {
|
|
154
|
+
const s = n.length === 10 ? /* @__PURE__ */ new Date(`${n}T00:00:00`) : new Date(n);
|
|
155
|
+
if (!Number.isNaN(s.getTime())) return ue(n);
|
|
152
156
|
}
|
|
153
|
-
if (
|
|
154
|
-
const
|
|
155
|
-
if (!Number.isNaN(
|
|
157
|
+
if (o === "datetime" && typeof n == "string") {
|
|
158
|
+
const s = new Date(n);
|
|
159
|
+
if (!Number.isNaN(s.getTime())) return s.toLocaleString();
|
|
156
160
|
}
|
|
157
161
|
}
|
|
158
162
|
if (i === "duration" && Number.isFinite(Number(n))) {
|
|
@@ -164,7 +168,7 @@ function Fe(n, t) {
|
|
|
164
168
|
if (i === "checklist" && typeof n == "string")
|
|
165
169
|
try {
|
|
166
170
|
const r = JSON.parse(n);
|
|
167
|
-
if (Array.isArray(r)) return `${r.filter((
|
|
171
|
+
if (Array.isArray(r)) return `${r.filter((s) => s == null ? void 0 : s.done).length}/${r.length} done`;
|
|
168
172
|
} catch {
|
|
169
173
|
}
|
|
170
174
|
if (i === "address" && typeof n == "string" && n.trim().startsWith("{"))
|
|
@@ -183,104 +187,104 @@ function Fe(n, t) {
|
|
|
183
187
|
return String(n);
|
|
184
188
|
}
|
|
185
189
|
}
|
|
186
|
-
const
|
|
187
|
-
if (i === "datetime" || i === "date" || /^\d{4}-\d{2}-\d{2}T/.test(
|
|
190
|
+
const l = String(n);
|
|
191
|
+
if (i === "datetime" || i === "date" || /^\d{4}-\d{2}-\d{2}T/.test(l) || /^\d{4}-\d{2}-\d{2}$/.test(l))
|
|
188
192
|
try {
|
|
189
|
-
let r = /^\d{4}-\d{2}-\d{2}$/.test(
|
|
193
|
+
let r = /^\d{4}-\d{2}-\d{2}$/.test(l) || i === "date";
|
|
190
194
|
if (!r && (t != null && t.options))
|
|
191
195
|
try {
|
|
192
|
-
const
|
|
193
|
-
|
|
196
|
+
const f = typeof t.options == "string" ? JSON.parse(t.options) : t.options;
|
|
197
|
+
f && f.date_mode === "date" && (r = !0);
|
|
194
198
|
} catch {
|
|
195
199
|
}
|
|
196
|
-
const
|
|
197
|
-
return
|
|
200
|
+
const s = l.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
|
|
201
|
+
return s ? ue(`${s[1]}-${s[2]}-${s[3]}`) : r ? ue(l) : bt(l);
|
|
198
202
|
} catch {
|
|
199
203
|
}
|
|
200
204
|
if ((i === "select-dropdown" || i === "radio-buttons") && t) {
|
|
201
|
-
const
|
|
202
|
-
if (Array.isArray(
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
+
const s = at(t).choices;
|
|
206
|
+
if (Array.isArray(s)) {
|
|
207
|
+
const f = s.find((u) => String(u.value) === l);
|
|
208
|
+
if (f) return Zt(f.text);
|
|
205
209
|
}
|
|
206
210
|
}
|
|
207
|
-
const
|
|
208
|
-
if (!Number.isNaN(
|
|
209
|
-
const r =
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
211
|
+
const c = Number(l);
|
|
212
|
+
if (!Number.isNaN(c) && l !== "" && t) {
|
|
213
|
+
const r = at(t), s = r.format, f = typeof r.unit == "string" ? r.unit.trim() : "";
|
|
214
|
+
if (f && !s) {
|
|
215
|
+
const u = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(c);
|
|
216
|
+
if (f === "$")
|
|
213
217
|
try {
|
|
214
218
|
return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(
|
|
215
|
-
|
|
219
|
+
c
|
|
216
220
|
);
|
|
217
221
|
} catch {
|
|
218
|
-
return `$${
|
|
222
|
+
return `$${u}`;
|
|
219
223
|
}
|
|
220
|
-
return
|
|
224
|
+
return f === "%" ? `${u}%` : `${u} ${f}`;
|
|
221
225
|
}
|
|
222
|
-
if (
|
|
226
|
+
if (s === "currency")
|
|
223
227
|
try {
|
|
224
228
|
return new Intl.NumberFormat(void 0, {
|
|
225
229
|
style: "currency",
|
|
226
230
|
currency: r.currency || "USD"
|
|
227
|
-
}).format(
|
|
231
|
+
}).format(c);
|
|
228
232
|
} catch {
|
|
229
233
|
}
|
|
230
|
-
if (
|
|
231
|
-
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(
|
|
232
|
-
if (
|
|
233
|
-
const
|
|
234
|
+
if (s === "int")
|
|
235
|
+
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(c);
|
|
236
|
+
if (s === "decimal") {
|
|
237
|
+
const u = typeof r.precision == "number" ? r.precision : 2;
|
|
234
238
|
return new Intl.NumberFormat(void 0, {
|
|
235
|
-
minimumFractionDigits:
|
|
236
|
-
maximumFractionDigits:
|
|
237
|
-
}).format(
|
|
239
|
+
minimumFractionDigits: u,
|
|
240
|
+
maximumFractionDigits: u
|
|
241
|
+
}).format(c);
|
|
238
242
|
}
|
|
239
243
|
}
|
|
240
|
-
return !
|
|
244
|
+
return !l.includes(" ") && !l.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(l) && !/^\d+$/.test(l) && (l.includes("_") || l.includes("-") || /^[a-z]/.test(l)) ? xt(l) : l;
|
|
241
245
|
}
|
|
242
|
-
function
|
|
243
|
-
const t =
|
|
246
|
+
function ot({ userId: n }) {
|
|
247
|
+
const t = fe(), { navigate: i, userUrl: o } = Jt(), l = o ? o(n) : `/users/${n}`, { data: c } = pe({
|
|
244
248
|
queryKey: ["user-chip", n],
|
|
245
249
|
queryFn: () => t.request(
|
|
246
|
-
|
|
247
|
-
).then((
|
|
250
|
+
mt(`/users/${n}`)
|
|
251
|
+
).then((f) => f.data ?? null),
|
|
248
252
|
enabled: !!t && !!n,
|
|
249
253
|
staleTime: 12e4
|
|
250
|
-
}), r =
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */ e(
|
|
254
|
+
}), r = c ? [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email : n, s = r.split(" ").map((f) => f[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
255
|
+
return /* @__PURE__ */ x(sn, { children: [
|
|
256
|
+
/* @__PURE__ */ e(ln, { asChild: !0, children: /* @__PURE__ */ x("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 py-px pl-0.5 pr-2 hover:bg-slate-200 transition-colors", children: [
|
|
253
257
|
/* @__PURE__ */ e(
|
|
254
|
-
|
|
258
|
+
rn,
|
|
255
259
|
{
|
|
256
260
|
userId: n,
|
|
257
261
|
className: "h-4 w-4",
|
|
258
|
-
fallback: /* @__PURE__ */ e("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[9px] font-bold text-nvr-navy dark:text-nvr-cyan", children:
|
|
262
|
+
fallback: /* @__PURE__ */ e("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[9px] font-bold text-nvr-navy dark:text-nvr-cyan", children: s })
|
|
259
263
|
}
|
|
260
264
|
),
|
|
261
265
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: r })
|
|
262
266
|
] }) }),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
|
|
267
|
+
/* @__PURE__ */ x(an, { align: "start", className: "text-[12px]", children: [
|
|
268
|
+
l && /* @__PURE__ */ x(
|
|
269
|
+
nt,
|
|
266
270
|
{
|
|
267
271
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
268
|
-
onSelect: () => i(
|
|
272
|
+
onSelect: () => i(l),
|
|
269
273
|
children: [
|
|
270
|
-
/* @__PURE__ */ e(
|
|
274
|
+
/* @__PURE__ */ e(It, { className: "h-3.5 w-3.5" }),
|
|
271
275
|
" View profile"
|
|
272
276
|
]
|
|
273
277
|
}
|
|
274
278
|
),
|
|
275
|
-
(
|
|
276
|
-
|
|
279
|
+
(c == null ? void 0 : c.email) && /* @__PURE__ */ x(
|
|
280
|
+
nt,
|
|
277
281
|
{
|
|
278
282
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
279
283
|
onSelect: () => {
|
|
280
|
-
window.location.href = `mailto:${
|
|
284
|
+
window.location.href = `mailto:${c.email}`;
|
|
281
285
|
},
|
|
282
286
|
children: [
|
|
283
|
-
/* @__PURE__ */ e(
|
|
287
|
+
/* @__PURE__ */ e(Tt, { className: "h-3.5 w-3.5" }),
|
|
284
288
|
" Send email"
|
|
285
289
|
]
|
|
286
290
|
}
|
|
@@ -288,42 +292,42 @@ function nt({ userId: n }) {
|
|
|
288
292
|
] })
|
|
289
293
|
] });
|
|
290
294
|
}
|
|
291
|
-
function
|
|
295
|
+
function wn({
|
|
292
296
|
collection: n,
|
|
293
297
|
itemId: t,
|
|
294
298
|
layoutId: i,
|
|
295
|
-
attachField:
|
|
296
|
-
filenameTemplate:
|
|
297
|
-
label:
|
|
299
|
+
attachField: o,
|
|
300
|
+
filenameTemplate: l,
|
|
301
|
+
label: c
|
|
298
302
|
}) {
|
|
299
|
-
const r =
|
|
300
|
-
if (!(!r ||
|
|
301
|
-
|
|
303
|
+
const r = fe(), s = Ut(), [f, u] = re(!1), O = async () => {
|
|
304
|
+
if (!(!r || f || !o)) {
|
|
305
|
+
u(!0);
|
|
302
306
|
try {
|
|
303
307
|
await r.request(
|
|
304
|
-
|
|
308
|
+
zt(`/collection-layouts/${i}/generate-and-attach`, {
|
|
305
309
|
collection: n,
|
|
306
310
|
item_id: t,
|
|
307
|
-
attach_field:
|
|
308
|
-
filename_template:
|
|
311
|
+
attach_field: o,
|
|
312
|
+
filename_template: l ?? void 0
|
|
309
313
|
})
|
|
310
|
-
),
|
|
314
|
+
), bn(s, [t]), s.invalidateQueries({ queryKey: ["items", n, t] });
|
|
311
315
|
} catch {
|
|
312
316
|
} finally {
|
|
313
|
-
|
|
317
|
+
u(!1);
|
|
314
318
|
}
|
|
315
319
|
}
|
|
316
|
-
}, $ = !
|
|
317
|
-
return /* @__PURE__ */
|
|
320
|
+
}, $ = !o;
|
|
321
|
+
return /* @__PURE__ */ x(
|
|
318
322
|
"button",
|
|
319
323
|
{
|
|
320
324
|
type: "button",
|
|
321
|
-
onClick:
|
|
322
|
-
disabled:
|
|
325
|
+
onClick: O,
|
|
326
|
+
disabled: f || $,
|
|
323
327
|
title: $ ? "Configure PDF field in Data Model → Layouts" : void 0,
|
|
324
328
|
className: "inline-flex items-center gap-1.5 rounded-md border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-nvr-navy hover:bg-nvr-cyan/20 disabled:cursor-not-allowed disabled:opacity-40 dark:text-nvr-cyan",
|
|
325
329
|
children: [
|
|
326
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ x(
|
|
327
331
|
"svg",
|
|
328
332
|
{
|
|
329
333
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -340,53 +344,53 @@ function fn({
|
|
|
340
344
|
]
|
|
341
345
|
}
|
|
342
346
|
),
|
|
343
|
-
|
|
347
|
+
f ? "Generating…" : c
|
|
344
348
|
]
|
|
345
349
|
}
|
|
346
350
|
);
|
|
347
351
|
}
|
|
348
|
-
function
|
|
352
|
+
function ie({
|
|
349
353
|
relCollection: n,
|
|
350
354
|
id: t,
|
|
351
355
|
className: i
|
|
352
356
|
}) {
|
|
353
357
|
var h;
|
|
354
|
-
const
|
|
358
|
+
const o = fe(), l = ht(), c = t != null && t !== "" ? String(t) : null, { data: r } = pe({
|
|
355
359
|
queryKey: ["col-meta-dt", n],
|
|
356
|
-
queryFn: () =>
|
|
357
|
-
|
|
360
|
+
queryFn: () => o.request(
|
|
361
|
+
mt(`/collections/${n}`)
|
|
358
362
|
).then((v) => v.data).catch(() => ({})),
|
|
359
|
-
enabled: !!
|
|
363
|
+
enabled: !!o && !!c,
|
|
360
364
|
staleTime: 3e5
|
|
361
|
-
}),
|
|
362
|
-
queryKey: ["rel-display", n,
|
|
363
|
-
queryFn: () =>
|
|
364
|
-
enabled: !!
|
|
365
|
+
}), s = (((h = r == null ? void 0 : r.display_template) == null ? void 0 : h.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((v) => v.replace(/[{}\s]/g, "")).filter((v) => v.includes(".")), f = s.length ? ["id", ...s].join(",") : null, { data: u, isLoading: O } = pe({
|
|
366
|
+
queryKey: ["rel-display", n, c, f],
|
|
367
|
+
queryFn: () => l(n, c, f),
|
|
368
|
+
enabled: !!o && !!c && r !== void 0,
|
|
365
369
|
staleTime: 6e4
|
|
366
370
|
});
|
|
367
|
-
if (!
|
|
368
|
-
if (
|
|
371
|
+
if (!c) return /* @__PURE__ */ e("span", { children: "—" });
|
|
372
|
+
if (O || o && r === void 0)
|
|
369
373
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
370
374
|
const $ = i ?? "text-[13px] text-slate-700";
|
|
371
|
-
if (!
|
|
372
|
-
const g = r != null && r.display_template ?
|
|
375
|
+
if (!u) return /* @__PURE__ */ e("span", { className: $, children: c });
|
|
376
|
+
const g = r != null && r.display_template ? mn(r.display_template, u) : String(u.name ?? u.title ?? u.label ?? u.display_name ?? c);
|
|
373
377
|
return /* @__PURE__ */ e("span", { className: $, children: g });
|
|
374
378
|
}
|
|
375
|
-
function
|
|
376
|
-
return /* @__PURE__ */ e(
|
|
379
|
+
function ct({ userId: n }) {
|
|
380
|
+
return /* @__PURE__ */ e(gt, { userId: n, size: "compact" });
|
|
377
381
|
}
|
|
378
|
-
function
|
|
382
|
+
function dt({
|
|
379
383
|
relCollection: n,
|
|
380
384
|
id: t,
|
|
381
385
|
drillConfig: i
|
|
382
386
|
}) {
|
|
383
|
-
const
|
|
384
|
-
return !
|
|
387
|
+
const o = pt(), l = /* @__PURE__ */ e(ie, { relCollection: n, id: t });
|
|
388
|
+
return !o || t == null || t === "" ? l : /* @__PURE__ */ e(
|
|
385
389
|
"button",
|
|
386
390
|
{
|
|
387
391
|
type: "button",
|
|
388
392
|
onClick: (r) => {
|
|
389
|
-
r.stopPropagation(),
|
|
393
|
+
r.stopPropagation(), o.open({
|
|
390
394
|
collection: n,
|
|
391
395
|
itemId: String(t),
|
|
392
396
|
layoutId: (i == null ? void 0 : i.layout_id) ?? null,
|
|
@@ -397,7 +401,7 @@ function it({
|
|
|
397
401
|
},
|
|
398
402
|
className: "group/drill cursor-pointer text-left transition-colors",
|
|
399
403
|
children: /* @__PURE__ */ e(
|
|
400
|
-
|
|
404
|
+
ie,
|
|
401
405
|
{
|
|
402
406
|
relCollection: n,
|
|
403
407
|
id: t,
|
|
@@ -407,102 +411,102 @@ function it({
|
|
|
407
411
|
}
|
|
408
412
|
);
|
|
409
413
|
}
|
|
410
|
-
function
|
|
411
|
-
const [t, i] =
|
|
412
|
-
return
|
|
413
|
-
const
|
|
414
|
-
if (
|
|
415
|
-
|
|
414
|
+
function vn(n) {
|
|
415
|
+
const [t, i] = re(!1), o = me(!0), l = me(JSON.stringify(n ?? null));
|
|
416
|
+
return Q(() => {
|
|
417
|
+
const c = JSON.stringify(n ?? null);
|
|
418
|
+
if (o.current) {
|
|
419
|
+
o.current = !1, l.current = c;
|
|
416
420
|
return;
|
|
417
421
|
}
|
|
418
|
-
if (
|
|
419
|
-
|
|
420
|
-
const r = window.setTimeout(() => i(!0), 0),
|
|
422
|
+
if (c === l.current) return;
|
|
423
|
+
l.current = c, i(!1);
|
|
424
|
+
const r = window.setTimeout(() => i(!0), 0), s = window.setTimeout(() => i(!1), 1200);
|
|
421
425
|
return () => {
|
|
422
|
-
window.clearTimeout(r), window.clearTimeout(
|
|
426
|
+
window.clearTimeout(r), window.clearTimeout(s);
|
|
423
427
|
};
|
|
424
428
|
}, [n]), t ? "nvr-value-pulse" : "";
|
|
425
429
|
}
|
|
426
|
-
function
|
|
430
|
+
function nr({
|
|
427
431
|
field: n,
|
|
428
432
|
val: t,
|
|
429
433
|
relations: i,
|
|
430
|
-
collection:
|
|
431
|
-
displayFormat:
|
|
432
|
-
textClassName:
|
|
434
|
+
collection: o,
|
|
435
|
+
displayFormat: l,
|
|
436
|
+
textClassName: c
|
|
433
437
|
}) {
|
|
434
|
-
var
|
|
435
|
-
const r =
|
|
436
|
-
(
|
|
438
|
+
var j;
|
|
439
|
+
const r = vn(t), s = (j = Vt(Ct)) == null ? void 0 : j[n.field], f = pt(), u = W(c ?? "text-[13px] text-slate-900 dark:text-slate-100", r), O = Rt(n) ?? { enabled: !0, layout_id: null, width: null }, $ = i.find(
|
|
440
|
+
(d) => d.one_collection === o && d.one_field === n.field && d.junction_field
|
|
437
441
|
);
|
|
438
442
|
if ($) {
|
|
439
|
-
const
|
|
443
|
+
const d = i.find(
|
|
440
444
|
(D) => D.many_collection === $.many_collection && D.many_field === $.junction_field
|
|
441
|
-
),
|
|
442
|
-
return !
|
|
443
|
-
|
|
445
|
+
), y = d == null ? void 0 : d.one_collection, k = Array.isArray(t) ? t : t != null && t !== "" ? [t] : [];
|
|
446
|
+
return !y || k.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : y === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: k.map((D) => /* @__PURE__ */ e(ct, { userId: String(D) }, String(D))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: k.map((D) => /* @__PURE__ */ e(
|
|
447
|
+
dt,
|
|
444
448
|
{
|
|
445
|
-
relCollection:
|
|
449
|
+
relCollection: y,
|
|
446
450
|
id: D,
|
|
447
|
-
drillConfig:
|
|
451
|
+
drillConfig: O
|
|
448
452
|
},
|
|
449
453
|
String(D)
|
|
450
454
|
)) });
|
|
451
455
|
}
|
|
452
456
|
const g = i.find(
|
|
453
|
-
(
|
|
457
|
+
(d) => d.many_collection === o && d.many_field === n.field && !d.junction_field
|
|
454
458
|
);
|
|
455
459
|
if (g != null && g.one_collection) {
|
|
456
|
-
const
|
|
457
|
-
return
|
|
458
|
-
|
|
460
|
+
const d = Array.isArray(t) ? t : t != null && t !== "" ? [t] : [];
|
|
461
|
+
return d.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: d.map((y) => /* @__PURE__ */ e(ct, { userId: String(y) }, String(y))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((y) => /* @__PURE__ */ e(
|
|
462
|
+
dt,
|
|
459
463
|
{
|
|
460
464
|
relCollection: g.one_collection,
|
|
461
|
-
id:
|
|
462
|
-
drillConfig:
|
|
465
|
+
id: y,
|
|
466
|
+
drillConfig: O
|
|
463
467
|
},
|
|
464
|
-
String(
|
|
468
|
+
String(y)
|
|
465
469
|
)) });
|
|
466
470
|
}
|
|
467
471
|
if (t == null || t === "")
|
|
468
472
|
return /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" });
|
|
469
|
-
if (
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
473
|
+
if (l && l !== "text") {
|
|
474
|
+
const d = Number(t);
|
|
475
|
+
if (l === "currency" && !isNaN(d))
|
|
476
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: new Intl.NumberFormat(void 0, {
|
|
473
477
|
style: "currency",
|
|
474
478
|
currency: "USD",
|
|
475
479
|
minimumFractionDigits: 2
|
|
476
|
-
}).format(
|
|
477
|
-
if (
|
|
478
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
479
|
-
if (
|
|
480
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
481
|
-
if (
|
|
482
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
483
|
-
|
|
480
|
+
}).format(d) });
|
|
481
|
+
if (l === "integer" && !isNaN(d))
|
|
482
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(Math.round(d)) });
|
|
483
|
+
if (l === "decimal" && !isNaN(d))
|
|
484
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(d) });
|
|
485
|
+
if (l === "percent" && !isNaN(d))
|
|
486
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: new Intl.NumberFormat(void 0, { style: "percent", maximumFractionDigits: 1 }).format(
|
|
487
|
+
d / 100
|
|
484
488
|
) });
|
|
485
|
-
if (
|
|
489
|
+
if (l === "date")
|
|
486
490
|
try {
|
|
487
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
491
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: ue(t) || Le(t) });
|
|
488
492
|
} catch {
|
|
489
493
|
}
|
|
490
|
-
if (
|
|
494
|
+
if (l === "datetime")
|
|
491
495
|
try {
|
|
492
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
496
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: bt(String(t)) });
|
|
493
497
|
} catch {
|
|
494
498
|
}
|
|
495
499
|
}
|
|
496
|
-
const h = /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
497
|
-
if (
|
|
498
|
-
const
|
|
500
|
+
const h = /* @__PURE__ */ e("span", { className: `font-semibold ${u}`, children: qe(t, n) }), v = s == null ? void 0 : s.target_collection;
|
|
501
|
+
if (f && v && (s == null ? void 0 : s.ids.length) === 1) {
|
|
502
|
+
const d = s.ids[0];
|
|
499
503
|
return /* @__PURE__ */ e(
|
|
500
504
|
"button",
|
|
501
505
|
{
|
|
502
506
|
type: "button",
|
|
503
507
|
"data-header-path-link": "",
|
|
504
|
-
onClick: (
|
|
505
|
-
|
|
508
|
+
onClick: (y) => {
|
|
509
|
+
y.stopPropagation(), f.open({ collection: v, itemId: String(d), layoutId: null, width: "85%" });
|
|
506
510
|
},
|
|
507
511
|
className: "cursor-pointer text-left underline decoration-slate-300 underline-offset-[3px] hover:text-[#0284c7] hover:decoration-[#0284c7] dark:decoration-slate-600 dark:hover:text-sky-400",
|
|
508
512
|
children: h
|
|
@@ -511,137 +515,163 @@ function Rn({
|
|
|
511
515
|
}
|
|
512
516
|
return h;
|
|
513
517
|
}
|
|
514
|
-
function
|
|
518
|
+
function kn({ value: n }) {
|
|
519
|
+
const t = Ht(n);
|
|
520
|
+
return /* @__PURE__ */ x(
|
|
521
|
+
"span",
|
|
522
|
+
{
|
|
523
|
+
className: "shrink-0 text-[12px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
524
|
+
"data-folded-line-count": n,
|
|
525
|
+
"aria-label": `${n} row${n === 1 ? "" : "s"}`,
|
|
526
|
+
children: [
|
|
527
|
+
t && /* @__PURE__ */ x(
|
|
528
|
+
"span",
|
|
529
|
+
{
|
|
530
|
+
"aria-hidden": !0,
|
|
531
|
+
"data-folded-line-step": !0,
|
|
532
|
+
className: "nvr-fade-in text-slate-400 dark:text-slate-500",
|
|
533
|
+
children: [
|
|
534
|
+
je(t.from),
|
|
535
|
+
/* @__PURE__ */ e("span", { className: "px-1", children: "→" })
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
/* @__PURE__ */ e(yt, { value: n, format: (i) => je(Number(i)) })
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
function Sn({
|
|
515
545
|
summaryFields: n,
|
|
516
546
|
fields: t,
|
|
517
547
|
draft: i,
|
|
518
|
-
relations:
|
|
519
|
-
collection:
|
|
520
|
-
itemId:
|
|
548
|
+
relations: o,
|
|
549
|
+
collection: l,
|
|
550
|
+
itemId: c,
|
|
521
551
|
ownersCollection: r,
|
|
522
|
-
ownersItemId:
|
|
523
|
-
ownersAssignment:
|
|
524
|
-
m2mCounts:
|
|
525
|
-
o2mCounts:
|
|
552
|
+
ownersItemId: s,
|
|
553
|
+
ownersAssignment: f,
|
|
554
|
+
m2mCounts: u,
|
|
555
|
+
o2mCounts: O,
|
|
526
556
|
o2mAggValues: $,
|
|
527
557
|
summaryAggConfigs: g,
|
|
528
558
|
o2mLoading: h,
|
|
529
559
|
hideEmpty: v
|
|
530
560
|
}) {
|
|
531
|
-
const
|
|
532
|
-
if (
|
|
533
|
-
if (
|
|
534
|
-
if (
|
|
535
|
-
const
|
|
536
|
-
return
|
|
537
|
-
}) :
|
|
538
|
-
if (
|
|
539
|
-
const
|
|
540
|
-
if (
|
|
541
|
-
const
|
|
542
|
-
return /* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */ e("span", { className:
|
|
561
|
+
const j = n.map((N) => typeof N == "string" ? N : N.field), d = v ? j.filter((N) => {
|
|
562
|
+
if (N === "__owners__" || h != null && h.has(N) || $ && N in $) return !0;
|
|
563
|
+
if (u && N in u) return (u[N] ?? 0) > 0;
|
|
564
|
+
if (O && N in O) return (O[N] ?? 0) > 0;
|
|
565
|
+
const G = i[N];
|
|
566
|
+
return G != null && G !== "" && !(Array.isArray(G) && G.length === 0);
|
|
567
|
+
}) : j;
|
|
568
|
+
if (d.length === 0) return null;
|
|
569
|
+
const y = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", k = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", D = "text-[12px] text-slate-300 dark:text-slate-600", J = "flex items-baseline gap-1.5", z = (N) => {
|
|
570
|
+
if (N === "__owners__") {
|
|
571
|
+
const m = (f == null ? void 0 : f.label_override) || "Owners";
|
|
572
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
573
|
+
/* @__PURE__ */ e("span", { className: y, children: m }),
|
|
544
574
|
/* @__PURE__ */ e(
|
|
545
|
-
|
|
575
|
+
gn,
|
|
546
576
|
{
|
|
547
|
-
collection: r ??
|
|
548
|
-
itemId:
|
|
577
|
+
collection: r ?? l,
|
|
578
|
+
itemId: s ?? c
|
|
549
579
|
}
|
|
550
580
|
)
|
|
551
581
|
] });
|
|
552
582
|
}
|
|
553
|
-
const
|
|
554
|
-
if (h != null && h.has(
|
|
555
|
-
return /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */ e("span", { className:
|
|
557
|
-
/* @__PURE__ */ e(
|
|
583
|
+
const G = n.find((m) => (typeof m == "string" ? m : m.field) === N), he = G && typeof G != "string" ? G.label : void 0, H = t.find((m) => m.field === N), V = he || (H == null ? void 0 : H.label) || N.replace(/_/g, " ").replace(/\b\w/g, (m) => m.toUpperCase());
|
|
584
|
+
if (h != null && h.has(N))
|
|
585
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
586
|
+
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
587
|
+
/* @__PURE__ */ e(Gt, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
558
588
|
] });
|
|
559
|
-
if ($ &&
|
|
560
|
-
const
|
|
561
|
-
let
|
|
562
|
-
if ((
|
|
563
|
-
|
|
589
|
+
if ($ && N in $) {
|
|
590
|
+
const m = g == null ? void 0 : g[N], U = (m == null ? void 0 : m.label) || V, B = $[N];
|
|
591
|
+
let P;
|
|
592
|
+
if ((m == null ? void 0 : m.agg) === "count")
|
|
593
|
+
P = String(B);
|
|
564
594
|
else {
|
|
565
|
-
const
|
|
595
|
+
const A = m != null && m.field_options ? (() => {
|
|
566
596
|
try {
|
|
567
|
-
return JSON.parse(
|
|
597
|
+
return JSON.parse(m.field_options);
|
|
568
598
|
} catch {
|
|
569
599
|
return {};
|
|
570
600
|
}
|
|
571
|
-
})() : {},
|
|
572
|
-
if (
|
|
601
|
+
})() : {}, Y = A.format;
|
|
602
|
+
if (Y === "currency")
|
|
573
603
|
try {
|
|
574
|
-
|
|
604
|
+
P = new Intl.NumberFormat(void 0, {
|
|
575
605
|
style: "currency",
|
|
576
|
-
currency:
|
|
606
|
+
currency: A.currency || "USD"
|
|
577
607
|
}).format(B);
|
|
578
608
|
} catch {
|
|
579
|
-
|
|
609
|
+
P = B.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
580
610
|
}
|
|
581
|
-
else if (
|
|
582
|
-
|
|
583
|
-
else if (
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
minimumFractionDigits:
|
|
587
|
-
maximumFractionDigits:
|
|
611
|
+
else if (Y === "int")
|
|
612
|
+
P = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(B);
|
|
613
|
+
else if (Y === "decimal") {
|
|
614
|
+
const Z = typeof A.precision == "number" ? A.precision : 2;
|
|
615
|
+
P = new Intl.NumberFormat(void 0, {
|
|
616
|
+
minimumFractionDigits: Z,
|
|
617
|
+
maximumFractionDigits: Z
|
|
588
618
|
}).format(B);
|
|
589
619
|
} else
|
|
590
|
-
|
|
620
|
+
P = B.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
591
621
|
}
|
|
592
|
-
return /* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */ e("span", { className:
|
|
594
|
-
/* @__PURE__ */ e("span", { className:
|
|
622
|
+
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
623
|
+
/* @__PURE__ */ e("span", { className: y, children: U }),
|
|
624
|
+
/* @__PURE__ */ e("span", { className: k, children: P })
|
|
595
625
|
] });
|
|
596
626
|
}
|
|
597
|
-
if (
|
|
598
|
-
const
|
|
599
|
-
return /* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */ e("span", { className:
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
|
|
627
|
+
if (u && N in u) {
|
|
628
|
+
const m = u[N];
|
|
629
|
+
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
630
|
+
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
631
|
+
/* @__PURE__ */ x("span", { className: k, children: [
|
|
632
|
+
m,
|
|
603
633
|
" item",
|
|
604
|
-
|
|
634
|
+
m !== 1 ? "s" : ""
|
|
605
635
|
] })
|
|
606
636
|
] });
|
|
607
637
|
}
|
|
608
|
-
if (
|
|
609
|
-
const
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */ e("span", { className:
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
|
|
638
|
+
if (O && N in O) {
|
|
639
|
+
const m = O[N];
|
|
640
|
+
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
641
|
+
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
642
|
+
/* @__PURE__ */ x("span", { className: k, children: [
|
|
643
|
+
/* @__PURE__ */ e(yt, { value: m, format: (U) => je(Number(U)) }),
|
|
614
644
|
" row",
|
|
615
|
-
|
|
645
|
+
m !== 1 ? "s" : ""
|
|
616
646
|
] })
|
|
617
647
|
] });
|
|
618
648
|
}
|
|
619
|
-
const q = i[
|
|
620
|
-
(
|
|
649
|
+
const q = i[N], I = o.find(
|
|
650
|
+
(m) => m.many_collection === l && m.many_field === N && !m.junction_field
|
|
621
651
|
);
|
|
622
|
-
if (
|
|
623
|
-
const
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */ e("span", { className:
|
|
626
|
-
|
|
652
|
+
if (I != null && I.one_collection) {
|
|
653
|
+
const m = Array.isArray(q) ? q : q != null && q !== "" ? [q] : [];
|
|
654
|
+
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
655
|
+
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
656
|
+
m.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : I.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: m.map((U) => /* @__PURE__ */ e(ot, { userId: String(U) }, String(U))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: m.map((U) => /* @__PURE__ */ e(ie, { relCollection: I.one_collection, id: U }, String(U))) })
|
|
627
657
|
] });
|
|
628
658
|
}
|
|
629
659
|
if (Array.isArray(q)) {
|
|
630
|
-
const
|
|
631
|
-
return /* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */ e("span", { className:
|
|
633
|
-
q.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) :
|
|
634
|
-
(B) =>
|
|
635
|
-
) }) : /* @__PURE__ */
|
|
660
|
+
const m = o.find((B) => B.many_field === N && B.junction_field), U = m == null ? void 0 : m.one_collection;
|
|
661
|
+
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
662
|
+
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
663
|
+
q.length === 0 ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : U ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: q.map(
|
|
664
|
+
(B) => U === "nivaro_users" ? /* @__PURE__ */ e(ot, { userId: String(B) }, String(B)) : /* @__PURE__ */ e(ie, { relCollection: U, id: B }, String(B))
|
|
665
|
+
) }) : /* @__PURE__ */ x("span", { className: k, children: [
|
|
636
666
|
q.length,
|
|
637
667
|
" item",
|
|
638
668
|
q.length !== 1 ? "s" : ""
|
|
639
669
|
] })
|
|
640
670
|
] });
|
|
641
671
|
}
|
|
642
|
-
return /* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */ e("span", { className:
|
|
644
|
-
q == null || q === "" ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : /* @__PURE__ */ e("span", { className:
|
|
672
|
+
return /* @__PURE__ */ x("div", { className: J, children: [
|
|
673
|
+
/* @__PURE__ */ e("span", { className: y, children: V }),
|
|
674
|
+
q == null || q === "" ? /* @__PURE__ */ e("span", { className: D, children: "—" }) : /* @__PURE__ */ e("span", { className: k, children: qe(q, H) })
|
|
645
675
|
] });
|
|
646
676
|
};
|
|
647
677
|
return /* @__PURE__ */ e(
|
|
@@ -649,84 +679,94 @@ function bn({
|
|
|
649
679
|
{
|
|
650
680
|
"data-summary-strip": "",
|
|
651
681
|
className: "flex flex-wrap items-baseline gap-x-5 gap-y-1.5 border-t border-slate-100 dark:border-border/60 bg-slate-50/50 dark:bg-white/[0.015] px-5 py-2.5",
|
|
652
|
-
children:
|
|
682
|
+
children: d.map((N) => /* @__PURE__ */ e(ut.Fragment, { children: z(N) }, N))
|
|
653
683
|
}
|
|
654
684
|
);
|
|
655
685
|
}
|
|
656
|
-
const
|
|
686
|
+
const rr = Et(function({
|
|
657
687
|
group: t,
|
|
658
688
|
fields: i,
|
|
659
|
-
draft:
|
|
660
|
-
onChange:
|
|
661
|
-
relations:
|
|
689
|
+
draft: o,
|
|
690
|
+
onChange: l,
|
|
691
|
+
relations: c,
|
|
662
692
|
collection: r,
|
|
663
|
-
itemId:
|
|
664
|
-
errors:
|
|
665
|
-
visibleFields:
|
|
666
|
-
lockedFields:
|
|
693
|
+
itemId: s,
|
|
694
|
+
errors: f,
|
|
695
|
+
visibleFields: u,
|
|
696
|
+
lockedFields: O,
|
|
667
697
|
layoutAiEnabled: $,
|
|
668
698
|
displayOnly: g,
|
|
669
699
|
renderField: h,
|
|
670
700
|
onCountChange: v,
|
|
671
|
-
isNew:
|
|
672
|
-
fieldValues:
|
|
673
|
-
isOpen:
|
|
674
|
-
onToggle:
|
|
701
|
+
isNew: j,
|
|
702
|
+
fieldValues: d,
|
|
703
|
+
isOpen: y,
|
|
704
|
+
onToggle: k,
|
|
675
705
|
summaryFields: D,
|
|
676
|
-
m2mCounts:
|
|
677
|
-
o2mCounts:
|
|
678
|
-
o2mAggValues:
|
|
679
|
-
summaryAggConfigs:
|
|
680
|
-
o2mLoading:
|
|
706
|
+
m2mCounts: J,
|
|
707
|
+
o2mCounts: z,
|
|
708
|
+
o2mAggValues: N,
|
|
709
|
+
summaryAggConfigs: G,
|
|
710
|
+
o2mLoading: he,
|
|
681
711
|
footerSlot: H,
|
|
682
|
-
ownersCollection:
|
|
712
|
+
ownersCollection: V,
|
|
683
713
|
ownersItemId: q,
|
|
684
|
-
ownersAssignment:
|
|
685
|
-
pdfAssignment:
|
|
686
|
-
pdfAttachField:
|
|
714
|
+
ownersAssignment: I,
|
|
715
|
+
pdfAssignment: m,
|
|
716
|
+
pdfAttachField: U,
|
|
687
717
|
pdfFilenameTemplate: B,
|
|
688
|
-
layoutId:
|
|
689
|
-
hideEmptySummary:
|
|
690
|
-
widgetAssignments:
|
|
691
|
-
widgetApiBase:
|
|
692
|
-
fieldInlineDisplay:
|
|
693
|
-
swapConfig:
|
|
694
|
-
swapped:
|
|
695
|
-
onSwapToggle:
|
|
696
|
-
alternateFields:
|
|
697
|
-
alternateWidths:
|
|
698
|
-
deferred:
|
|
699
|
-
onFirstOpen:
|
|
718
|
+
layoutId: P,
|
|
719
|
+
hideEmptySummary: A,
|
|
720
|
+
widgetAssignments: Y,
|
|
721
|
+
widgetApiBase: Z,
|
|
722
|
+
fieldInlineDisplay: be,
|
|
723
|
+
swapConfig: E,
|
|
724
|
+
swapped: Be,
|
|
725
|
+
onSwapToggle: Ue,
|
|
726
|
+
alternateFields: X,
|
|
727
|
+
alternateWidths: xe,
|
|
728
|
+
deferred: se,
|
|
729
|
+
onFirstOpen: le
|
|
700
730
|
}) {
|
|
701
|
-
var
|
|
702
|
-
const [
|
|
731
|
+
var ze;
|
|
732
|
+
const [Nt, Pe] = Qt(
|
|
703
733
|
t.is_collapsed == null ? void 0 : !t.is_collapsed,
|
|
704
734
|
!0
|
|
705
|
-
),
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
}, [
|
|
709
|
-
|
|
710
|
-
}, [
|
|
711
|
-
const
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
)
|
|
726
|
-
|
|
727
|
-
|
|
735
|
+
), _t = !Nt, [wt, vt] = re(!1), F = tn(), K = (p, _) => en(F, p, _, { asChild: !0 }), ae = (p) => ({ kind: "slot", field: p, group_key: t.key }), Me = !!(F != null && F.showHidden), [Ge, Ie] = re({}), { data: ye } = on(r), ee = (F == null ? void 0 : F.fold) ?? null, te = (F == null ? void 0 : F.reveal) ?? null, [ge, oe] = re(null);
|
|
736
|
+
Q(() => {
|
|
737
|
+
ee && oe(!ee.open);
|
|
738
|
+
}, [ee == null ? void 0 : ee.seq]), Q(() => {
|
|
739
|
+
te && nn(te.target) === t.key && oe(!1);
|
|
740
|
+
}, [te == null ? void 0 : te.seq]);
|
|
741
|
+
const Ne = k !== void 0, M = ge ?? (Ne ? !y : _t), Te = me(() => {
|
|
742
|
+
});
|
|
743
|
+
Te.current = () => {
|
|
744
|
+
M && (ge !== null ? oe(!1) : Ne ? k == null || k() : Pe(!0));
|
|
745
|
+
}, Q(() => {
|
|
746
|
+
if (typeof window > "u") return;
|
|
747
|
+
const p = (_) => {
|
|
748
|
+
const a = _.detail;
|
|
749
|
+
((a == null ? void 0 : a.key) === t.key || a != null && a.field && i.some((L) => L.field === a.field)) && Te.current();
|
|
750
|
+
};
|
|
751
|
+
return window.addEventListener(tt, p), () => window.removeEventListener(tt, p);
|
|
752
|
+
}, [t.key, i]), Q(() => {
|
|
753
|
+
se && !M && (le == null || le(t.key));
|
|
754
|
+
}, [se, M, le, t.key]);
|
|
755
|
+
const _e = ge !== null ? () => oe((p) => !p) : Ne ? k : () => Pe((p) => !p), Ve = !F && P != null, we = () => {
|
|
756
|
+
Ve && ft({ layoutId: Number(P), collection: r, kind: "opened", key: t.key });
|
|
757
|
+
}, kt = () => {
|
|
758
|
+
M && we(), _e == null || _e();
|
|
759
|
+
}, St = !g && i.some((p) => f[p.field]), Ee = F ? "always" : t.visibility_mode ?? "always";
|
|
760
|
+
if (Ee === "new_only" && !j || Ee === "existing_only" && j) return null;
|
|
761
|
+
const ne = Y ?? [], $t = !j && ne.some((p) => p.widget_id != null && Ge[p.field] === void 0);
|
|
762
|
+
let ce = !1;
|
|
763
|
+
if (t.hide_when_empty && d && !F && (ce = d.every(
|
|
764
|
+
(_) => _ == null || _ === "" || Array.isArray(_) && _.length === 0
|
|
765
|
+
) && !$t && ne.every((_) => !Ge[_.field])), ce && ne.length === 0) return null;
|
|
766
|
+
const ve = me(null), ke = fn(ve), Ce = _n(t.icon), Dt = Me ? i : i.filter((p) => !p.hidden), Re = (ze = ye == null ? void 0 : ye.sections) == null ? void 0 : ze[t.key], Ft = Array.isArray(Re) && Re.length > 0, Ot = (p) => Ft ? /* @__PURE__ */ x("div", { className: "relative", children: [
|
|
767
|
+
p,
|
|
728
768
|
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
729
|
-
|
|
769
|
+
cn,
|
|
730
770
|
{
|
|
731
771
|
collection: r,
|
|
732
772
|
kind: "section",
|
|
@@ -734,55 +774,66 @@ const zn = It(function({
|
|
|
734
774
|
label: t.label || t.key
|
|
735
775
|
}
|
|
736
776
|
) })
|
|
737
|
-
] }) :
|
|
738
|
-
return /* @__PURE__ */
|
|
777
|
+
] }) : p, Je = z ? i.filter((p) => p.field in z) : [], Se = Je.length === 1 ? Je[0].field : null, $e = (p) => Me && (p.hidden || !(u.has(p.field) || !u.size));
|
|
778
|
+
return /* @__PURE__ */ x(
|
|
739
779
|
"div",
|
|
740
780
|
{
|
|
741
|
-
"data-loads-on-open":
|
|
781
|
+
"data-loads-on-open": se ? "" : void 0,
|
|
742
782
|
"data-section-key": t.key,
|
|
743
|
-
"data-collapsed":
|
|
744
|
-
className:
|
|
783
|
+
"data-collapsed": M ? "" : void 0,
|
|
784
|
+
className: W(
|
|
745
785
|
"nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
|
|
746
786
|
g && "bg-slate-50/60 dark:bg-slate-900/20",
|
|
747
|
-
|
|
787
|
+
ce && "hidden"
|
|
748
788
|
),
|
|
749
|
-
onPointerDownCapture: (
|
|
750
|
-
var
|
|
751
|
-
(
|
|
789
|
+
onPointerDownCapture: (p) => {
|
|
790
|
+
var _, a;
|
|
791
|
+
(a = (_ = p.target) == null ? void 0 : _.closest) != null && a.call(_, "[data-usage-header]") || we();
|
|
752
792
|
},
|
|
753
|
-
onFocusCapture: (
|
|
754
|
-
var
|
|
755
|
-
(
|
|
793
|
+
onFocusCapture: (p) => {
|
|
794
|
+
var _, a;
|
|
795
|
+
(a = (_ = p.target) == null ? void 0 : _.closest) != null && a.call(_, "[data-usage-header]") || we();
|
|
756
796
|
},
|
|
757
797
|
children: [
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
/* @__PURE__ */
|
|
798
|
+
Ve && !ce && /* @__PURE__ */ e($n, { layoutId: Number(P), collection: r, sectionKey: t.key }),
|
|
799
|
+
Ot(
|
|
800
|
+
/* @__PURE__ */ x(
|
|
761
801
|
"button",
|
|
762
802
|
{
|
|
763
803
|
type: "button",
|
|
764
804
|
"data-usage-header": "",
|
|
765
|
-
onClick:
|
|
766
|
-
"data-design-group-header":
|
|
767
|
-
className:
|
|
805
|
+
onClick: kt,
|
|
806
|
+
"data-design-group-header": F ? "" : void 0,
|
|
807
|
+
className: W(
|
|
768
808
|
"flex w-full items-center gap-2 px-5 py-3 text-left hover:bg-slate-50/50 dark:hover:bg-white/[0.02] rounded-t-xl",
|
|
769
809
|
// Round the bottom only when nothing renders below the header — an
|
|
770
810
|
// expanded body (or collapsed summary strip) square-joins it, and a
|
|
771
811
|
// rounded hover overlay would leave see-through notches at the seam.
|
|
772
|
-
|
|
812
|
+
M && !(D && D.length > 0) && "rounded-b-xl"
|
|
773
813
|
),
|
|
774
814
|
children: [
|
|
775
|
-
|
|
815
|
+
Ce && /* @__PURE__ */ e(Ce, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
776
816
|
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
817
|
+
M && Se && z && Se in z && /* @__PURE__ */ e(kn, { value: z[Se] }),
|
|
777
818
|
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
778
|
-
|
|
819
|
+
M && !F && s && s !== "new" && /* @__PURE__ */ e(
|
|
820
|
+
yn,
|
|
821
|
+
{
|
|
822
|
+
collection: r,
|
|
823
|
+
itemId: s,
|
|
824
|
+
fields: i,
|
|
825
|
+
relations: c,
|
|
826
|
+
label: t.label || t.key
|
|
827
|
+
}
|
|
828
|
+
),
|
|
829
|
+
St && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
|
|
779
830
|
/* @__PURE__ */ e(
|
|
780
|
-
|
|
831
|
+
Mt,
|
|
781
832
|
{
|
|
782
|
-
"data-design-pass":
|
|
783
|
-
className:
|
|
833
|
+
"data-design-pass": F ? "" : void 0,
|
|
834
|
+
className: W(
|
|
784
835
|
"h-4 w-4 text-slate-400 dark:text-slate-500 transition-transform duration-200",
|
|
785
|
-
|
|
836
|
+
M && "-rotate-90"
|
|
786
837
|
)
|
|
787
838
|
}
|
|
788
839
|
)
|
|
@@ -790,99 +841,99 @@ const zn = It(function({
|
|
|
790
841
|
}
|
|
791
842
|
)
|
|
792
843
|
),
|
|
793
|
-
|
|
794
|
-
|
|
844
|
+
M && D && D.length > 0 && /* @__PURE__ */ e(
|
|
845
|
+
Sn,
|
|
795
846
|
{
|
|
796
847
|
summaryFields: D,
|
|
797
848
|
fields: i,
|
|
798
|
-
draft:
|
|
799
|
-
relations:
|
|
849
|
+
draft: o,
|
|
850
|
+
relations: c,
|
|
800
851
|
collection: r,
|
|
801
|
-
itemId:
|
|
802
|
-
ownersCollection:
|
|
852
|
+
itemId: s,
|
|
853
|
+
ownersCollection: V,
|
|
803
854
|
ownersItemId: q,
|
|
804
|
-
ownersAssignment:
|
|
805
|
-
m2mCounts:
|
|
806
|
-
o2mCounts:
|
|
807
|
-
o2mAggValues:
|
|
808
|
-
summaryAggConfigs:
|
|
809
|
-
o2mLoading:
|
|
810
|
-
hideEmpty: !!t.summary_hide_empty || !!
|
|
855
|
+
ownersAssignment: I,
|
|
856
|
+
m2mCounts: J,
|
|
857
|
+
o2mCounts: z,
|
|
858
|
+
o2mAggValues: N,
|
|
859
|
+
summaryAggConfigs: G,
|
|
860
|
+
o2mLoading: he,
|
|
861
|
+
hideEmpty: !!t.summary_hide_empty || !!A
|
|
811
862
|
}
|
|
812
863
|
),
|
|
813
|
-
|
|
814
|
-
|
|
864
|
+
M && !se && t.hide_when_empty && ne.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: ne.filter((p) => p.widget_id != null).map((p) => /* @__PURE__ */ e(
|
|
865
|
+
rt,
|
|
815
866
|
{
|
|
816
|
-
widgetId:
|
|
817
|
-
inputBindings:
|
|
818
|
-
itemDraft:
|
|
867
|
+
widgetId: p.widget_id,
|
|
868
|
+
inputBindings: lt(p.input_bindings),
|
|
869
|
+
itemDraft: o,
|
|
819
870
|
frameless: !0,
|
|
820
|
-
apiBase:
|
|
821
|
-
onContentChange: (
|
|
822
|
-
(
|
|
871
|
+
apiBase: Z,
|
|
872
|
+
onContentChange: (_) => Ie(
|
|
873
|
+
(a) => a[p.field] === _ ? a : { ...a, [p.field]: _ }
|
|
823
874
|
)
|
|
824
875
|
},
|
|
825
|
-
|
|
876
|
+
p.field
|
|
826
877
|
)) }),
|
|
827
|
-
!
|
|
878
|
+
!M && /* @__PURE__ */ x(
|
|
828
879
|
"div",
|
|
829
880
|
{
|
|
830
881
|
"data-section-body": "",
|
|
831
882
|
className: "nvr-expand-in border-t border-slate-100 px-5 py-4 dark:border-border/60",
|
|
832
883
|
children: [
|
|
833
|
-
!g && /* @__PURE__ */ e(
|
|
884
|
+
!g && /* @__PURE__ */ e(hn, { group: t, className: "mb-3" }),
|
|
834
885
|
(() => {
|
|
835
|
-
const
|
|
836
|
-
rows: g ? [] :
|
|
837
|
-
folded: (
|
|
838
|
-
keep: (
|
|
839
|
-
filled: (
|
|
840
|
-
}),
|
|
841
|
-
(
|
|
842
|
-
_k: `row:${
|
|
843
|
-
sort:
|
|
886
|
+
const p = Kt(Dt, {
|
|
887
|
+
rows: g ? [] : Yt(t.swap_config).rows,
|
|
888
|
+
folded: (a) => !g && At(a._overrides),
|
|
889
|
+
keep: (a) => !!a.required,
|
|
890
|
+
filled: (a) => !Wt(o[a.field]) || !!f[a.field]
|
|
891
|
+
}), _ = p.units.map(
|
|
892
|
+
(a) => a.kind === "row" ? {
|
|
893
|
+
_k: `row:${a.row.key}`,
|
|
894
|
+
sort: a.members[0].sort ?? 0,
|
|
844
895
|
_t: "row",
|
|
845
|
-
row:
|
|
846
|
-
members:
|
|
847
|
-
} : { _k:
|
|
896
|
+
row: a.row,
|
|
897
|
+
members: a.members
|
|
898
|
+
} : { _k: a.field.field, sort: a.field.sort ?? 0, _t: "field", f: a.field }
|
|
848
899
|
);
|
|
849
|
-
|
|
900
|
+
I && _.push({
|
|
850
901
|
_k: "__owners__",
|
|
851
|
-
sort:
|
|
902
|
+
sort: I.sort,
|
|
852
903
|
_t: "owners",
|
|
853
|
-
slot:
|
|
854
|
-
}),
|
|
904
|
+
slot: I
|
|
905
|
+
}), m && _.push({
|
|
855
906
|
_k: "__pdf__",
|
|
856
|
-
sort:
|
|
907
|
+
sort: m.sort,
|
|
857
908
|
_t: "pdf",
|
|
858
|
-
slot:
|
|
909
|
+
slot: m
|
|
859
910
|
});
|
|
860
|
-
for (const
|
|
861
|
-
|
|
862
|
-
return
|
|
911
|
+
for (const a of Y ?? [])
|
|
912
|
+
_.push({ _k: a.field, sort: a.sort, _t: "widget", slot: a });
|
|
913
|
+
return _.sort((a, L) => a.sort - L.sort), F && _.length === 0 && p.folded.length === 0 ? /* @__PURE__ */ e(Xt, {}) : g ? /* @__PURE__ */ x(
|
|
863
914
|
"div",
|
|
864
915
|
{
|
|
865
|
-
ref:
|
|
916
|
+
ref: ve,
|
|
866
917
|
"data-section-grid": "",
|
|
867
|
-
className:
|
|
918
|
+
className: W(F && "relative", "grid grid-cols-12 gap-x-6 gap-y-3"),
|
|
868
919
|
children: [
|
|
869
|
-
/* @__PURE__ */ e(
|
|
870
|
-
|
|
871
|
-
if (
|
|
872
|
-
const
|
|
920
|
+
/* @__PURE__ */ e(Fe, { gapClass: "gap-x-6" }),
|
|
921
|
+
_.map((a) => {
|
|
922
|
+
if (a._t === "owners") {
|
|
923
|
+
const S = a.slot.col_span ?? 12;
|
|
873
924
|
return K(
|
|
874
|
-
|
|
925
|
+
ae("__owners__"),
|
|
875
926
|
/* @__PURE__ */ e(
|
|
876
927
|
"div",
|
|
877
928
|
{
|
|
878
929
|
className: "min-w-0",
|
|
879
|
-
style: { gridColumn: `span ${
|
|
930
|
+
style: { gridColumn: `span ${S}` },
|
|
880
931
|
children: /* @__PURE__ */ e(
|
|
881
|
-
|
|
932
|
+
st,
|
|
882
933
|
{
|
|
883
934
|
collection: r,
|
|
884
|
-
itemId:
|
|
885
|
-
label:
|
|
935
|
+
itemId: s,
|
|
936
|
+
label: a.slot.label_override || "Owners"
|
|
886
937
|
}
|
|
887
938
|
)
|
|
888
939
|
},
|
|
@@ -890,57 +941,57 @@ const zn = It(function({
|
|
|
890
941
|
)
|
|
891
942
|
);
|
|
892
943
|
}
|
|
893
|
-
if (
|
|
894
|
-
const
|
|
895
|
-
(
|
|
944
|
+
if (a._t === "pdf" || a._t === "widget" || a._t === "row") return null;
|
|
945
|
+
const L = a.f, b = c.find(
|
|
946
|
+
(S) => S.many_collection === r && S.many_field === L.field && !S.junction_field
|
|
896
947
|
);
|
|
897
948
|
return K(
|
|
898
|
-
{ kind: "field", field:
|
|
899
|
-
/* @__PURE__ */
|
|
949
|
+
{ kind: "field", field: L.field, group_key: t.key },
|
|
950
|
+
/* @__PURE__ */ x(
|
|
900
951
|
"div",
|
|
901
952
|
{
|
|
902
953
|
className: "min-w-0",
|
|
903
|
-
style: { gridColumn: `span ${
|
|
954
|
+
style: { gridColumn: `span ${it(L.options, ke)}` },
|
|
904
955
|
children: [
|
|
905
|
-
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children:
|
|
956
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: L.label || xt(L.field) }),
|
|
906
957
|
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
|
|
907
|
-
const
|
|
908
|
-
return
|
|
909
|
-
})() : b != null && b.one_collection ? /* @__PURE__ */ e(
|
|
958
|
+
const S = o[L.field], C = Array.isArray(S) ? S : S != null && S !== "" ? [S] : [];
|
|
959
|
+
return C.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: C.map((T) => /* @__PURE__ */ e(gt, { userId: String(T) }, String(T))) });
|
|
960
|
+
})() : b != null && b.one_collection ? /* @__PURE__ */ e(ie, { relCollection: b.one_collection, id: o[L.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: qe(o[L.field], L) }) })
|
|
910
961
|
]
|
|
911
962
|
},
|
|
912
|
-
|
|
963
|
+
L.field
|
|
913
964
|
)
|
|
914
965
|
);
|
|
915
966
|
})
|
|
916
967
|
]
|
|
917
968
|
}
|
|
918
969
|
) : (() => {
|
|
919
|
-
const
|
|
920
|
-
var
|
|
970
|
+
const a = (b) => {
|
|
971
|
+
var Ze, Xe;
|
|
921
972
|
if (b._t === "row")
|
|
922
973
|
return /* @__PURE__ */ e(
|
|
923
|
-
|
|
974
|
+
un,
|
|
924
975
|
{
|
|
925
976
|
row: b.row,
|
|
926
977
|
members: b.members,
|
|
927
|
-
containerWidth:
|
|
928
|
-
errors:
|
|
978
|
+
containerWidth: ke,
|
|
979
|
+
errors: f,
|
|
929
980
|
renderMember: (w) => K(
|
|
930
981
|
{ kind: "field", field: w.field, group_key: t.key },
|
|
931
982
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
932
|
-
|
|
983
|
+
Oe,
|
|
933
984
|
{
|
|
934
|
-
field:
|
|
935
|
-
draft:
|
|
936
|
-
onChange:
|
|
937
|
-
relations:
|
|
985
|
+
field: pn(w),
|
|
986
|
+
draft: o,
|
|
987
|
+
onChange: l,
|
|
988
|
+
relations: c,
|
|
938
989
|
collection: r,
|
|
939
|
-
itemId:
|
|
940
|
-
error:
|
|
941
|
-
visible:
|
|
942
|
-
forceVisible:
|
|
943
|
-
locked:
|
|
990
|
+
itemId: s,
|
|
991
|
+
error: f[w.field],
|
|
992
|
+
visible: u.has(w.field) || !u.size,
|
|
993
|
+
forceVisible: $e(w) || void 0,
|
|
994
|
+
locked: O.has(w.field),
|
|
944
995
|
layoutAiEnabled: $,
|
|
945
996
|
renderField: h,
|
|
946
997
|
onCountChange: v
|
|
@@ -953,29 +1004,29 @@ const zn = It(function({
|
|
|
953
1004
|
if (b._t === "owners") {
|
|
954
1005
|
const w = b.slot.col_span ?? 12;
|
|
955
1006
|
return K(
|
|
956
|
-
|
|
1007
|
+
ae("__owners__"),
|
|
957
1008
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
958
|
-
|
|
1009
|
+
st,
|
|
959
1010
|
{
|
|
960
1011
|
collection: r,
|
|
961
|
-
itemId:
|
|
1012
|
+
itemId: s,
|
|
962
1013
|
label: b.slot.label_override || "Owners"
|
|
963
1014
|
}
|
|
964
1015
|
) }, "__owners__")
|
|
965
1016
|
);
|
|
966
1017
|
}
|
|
967
1018
|
if (b._t === "pdf") {
|
|
968
|
-
if (!
|
|
969
|
-
const w = b.slot.col_span ?? 12, R = ((
|
|
1019
|
+
if (!P) return null;
|
|
1020
|
+
const w = b.slot.col_span ?? 12, R = ((Ze = b.slot.label_override) == null ? void 0 : Ze.trim()) || "Generate PDF";
|
|
970
1021
|
return K(
|
|
971
|
-
|
|
1022
|
+
ae("__pdf__"),
|
|
972
1023
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
973
|
-
|
|
1024
|
+
wn,
|
|
974
1025
|
{
|
|
975
1026
|
collection: r,
|
|
976
|
-
itemId:
|
|
977
|
-
layoutId:
|
|
978
|
-
attachField:
|
|
1027
|
+
itemId: s,
|
|
1028
|
+
layoutId: P,
|
|
1029
|
+
attachField: U ?? null,
|
|
979
1030
|
filenameTemplate: B,
|
|
980
1031
|
label: R
|
|
981
1032
|
}
|
|
@@ -984,50 +1035,50 @@ const zn = It(function({
|
|
|
984
1035
|
}
|
|
985
1036
|
if (b._t === "widget") {
|
|
986
1037
|
if (!b.slot.widget_id) return null;
|
|
987
|
-
const w = b.slot.col_span ?? 12, R =
|
|
1038
|
+
const w = b.slot.col_span ?? 12, R = lt(b.slot.input_bindings);
|
|
988
1039
|
return K(
|
|
989
|
-
|
|
1040
|
+
ae(b.slot.field),
|
|
990
1041
|
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
991
|
-
|
|
1042
|
+
rt,
|
|
992
1043
|
{
|
|
993
1044
|
widgetId: b.slot.widget_id,
|
|
994
1045
|
inputBindings: R,
|
|
995
|
-
itemDraft:
|
|
1046
|
+
itemDraft: o,
|
|
996
1047
|
label: b.slot.label_override ?? void 0,
|
|
997
1048
|
defaultExpanded: b.slot.default_expanded ?? !0,
|
|
998
1049
|
frameless: !0,
|
|
999
|
-
apiBase:
|
|
1000
|
-
onContentChange: (
|
|
1001
|
-
(
|
|
1050
|
+
apiBase: Z,
|
|
1051
|
+
onContentChange: (et) => Ie(
|
|
1052
|
+
(De) => De[b.slot.field] === et ? De : { ...De, [b.slot.field]: et }
|
|
1002
1053
|
)
|
|
1003
1054
|
}
|
|
1004
1055
|
) }, b.slot.field)
|
|
1005
1056
|
);
|
|
1006
1057
|
}
|
|
1007
|
-
const
|
|
1008
|
-
(w) => w.many_collection === r && w.many_field ===
|
|
1009
|
-
)) == null ? void 0 :
|
|
1010
|
-
const w =
|
|
1058
|
+
const S = b.f, C = be == null ? void 0 : be[S.field], T = C == null ? void 0 : C.entries, jt = (C == null ? void 0 : C.separator) ?? null, de = o[S.field], He = de != null && de !== "", Ke = T != null && T.length && He ? ((Xe = c.find(
|
|
1059
|
+
(w) => w.many_collection === r && w.many_field === S.field && !w.junction_field
|
|
1060
|
+
)) == null ? void 0 : Xe.one_collection) ?? null : null, We = (E == null ? void 0 : E.enabled) && S.field === E.primary_field, Ae = (() => {
|
|
1061
|
+
const w = o[(E == null ? void 0 : E.primary_field) ?? ""];
|
|
1011
1062
|
return w != null && w !== "";
|
|
1012
|
-
})(),
|
|
1013
|
-
const R =
|
|
1063
|
+
})(), Ye = (X ?? []).some((w) => {
|
|
1064
|
+
const R = o[w.field];
|
|
1014
1065
|
return R != null && R !== "";
|
|
1015
|
-
}),
|
|
1066
|
+
}), Lt = We && Ue ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1016
1067
|
/* @__PURE__ */ e(
|
|
1017
1068
|
"button",
|
|
1018
1069
|
{
|
|
1019
1070
|
type: "button",
|
|
1020
|
-
onClick:
|
|
1071
|
+
onClick: Ue,
|
|
1021
1072
|
className: "inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 transition-colors",
|
|
1022
|
-
children:
|
|
1073
|
+
children: Be ? E.back_label ?? "Back" : E.toggle_label ?? "Enter manually"
|
|
1023
1074
|
}
|
|
1024
1075
|
),
|
|
1025
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ x(
|
|
1026
1077
|
"span",
|
|
1027
1078
|
{
|
|
1028
1079
|
className: [
|
|
1029
1080
|
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
1030
|
-
|
|
1081
|
+
Ae ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
|
|
1031
1082
|
].join(" "),
|
|
1032
1083
|
title: "Original field",
|
|
1033
1084
|
children: [
|
|
@@ -1036,7 +1087,7 @@ const zn = It(function({
|
|
|
1036
1087
|
{
|
|
1037
1088
|
className: [
|
|
1038
1089
|
"h-1.5 w-1.5 rounded-full",
|
|
1039
|
-
|
|
1090
|
+
Ae ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1040
1091
|
].join(" ")
|
|
1041
1092
|
}
|
|
1042
1093
|
),
|
|
@@ -1044,12 +1095,12 @@ const zn = It(function({
|
|
|
1044
1095
|
]
|
|
1045
1096
|
}
|
|
1046
1097
|
),
|
|
1047
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ x(
|
|
1048
1099
|
"span",
|
|
1049
1100
|
{
|
|
1050
1101
|
className: [
|
|
1051
1102
|
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
1052
|
-
|
|
1103
|
+
Ye ? "bg-emerald-50 text-emerald-600 dark:bg-emerald-900/30 dark:text-emerald-400" : "bg-slate-100 text-slate-400 dark:bg-slate-800 dark:text-slate-500"
|
|
1053
1104
|
].join(" "),
|
|
1054
1105
|
title: "Manual fields",
|
|
1055
1106
|
children: [
|
|
@@ -1058,7 +1109,7 @@ const zn = It(function({
|
|
|
1058
1109
|
{
|
|
1059
1110
|
className: [
|
|
1060
1111
|
"h-1.5 w-1.5 rounded-full",
|
|
1061
|
-
|
|
1112
|
+
Ye ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1062
1113
|
].join(" ")
|
|
1063
1114
|
}
|
|
1064
1115
|
),
|
|
@@ -1066,103 +1117,103 @@ const zn = It(function({
|
|
|
1066
1117
|
]
|
|
1067
1118
|
}
|
|
1068
1119
|
)
|
|
1069
|
-
] }) : void 0,
|
|
1070
|
-
const R = (
|
|
1120
|
+
] }) : void 0, qt = We && Be && (X != null && X.length) ? /* @__PURE__ */ e("div", { className: "mt-2 rounded-lg border border-slate-200 bg-slate-50 dark:border-border dark:bg-slate-900/40 p-3", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-3", children: X.map((w) => {
|
|
1121
|
+
const R = (xe == null ? void 0 : xe[w.field]) ?? 2;
|
|
1071
1122
|
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${R}` }, children: /* @__PURE__ */ e(
|
|
1072
|
-
|
|
1123
|
+
Oe,
|
|
1073
1124
|
{
|
|
1074
1125
|
field: w,
|
|
1075
|
-
draft:
|
|
1076
|
-
onChange:
|
|
1077
|
-
relations:
|
|
1126
|
+
draft: o,
|
|
1127
|
+
onChange: l,
|
|
1128
|
+
relations: c,
|
|
1078
1129
|
collection: r,
|
|
1079
|
-
itemId:
|
|
1080
|
-
error:
|
|
1130
|
+
itemId: s,
|
|
1131
|
+
error: f[w.field],
|
|
1081
1132
|
visible: !0,
|
|
1082
1133
|
forceVisible: !0,
|
|
1083
|
-
locked:
|
|
1134
|
+
locked: O.has(w.field),
|
|
1084
1135
|
layoutAiEnabled: $,
|
|
1085
1136
|
renderField: h,
|
|
1086
1137
|
onCountChange: v
|
|
1087
1138
|
}
|
|
1088
1139
|
) }, w.field);
|
|
1089
|
-
}) }) }) : void 0,
|
|
1090
|
-
|
|
1140
|
+
}) }) }) : void 0, Qe = /* @__PURE__ */ e(
|
|
1141
|
+
Oe,
|
|
1091
1142
|
{
|
|
1092
|
-
field:
|
|
1093
|
-
draft:
|
|
1094
|
-
onChange:
|
|
1095
|
-
relations:
|
|
1143
|
+
field: S,
|
|
1144
|
+
draft: o,
|
|
1145
|
+
onChange: l,
|
|
1146
|
+
relations: c,
|
|
1096
1147
|
collection: r,
|
|
1097
|
-
itemId:
|
|
1098
|
-
error:
|
|
1099
|
-
visible:
|
|
1100
|
-
forceVisible:
|
|
1101
|
-
locked:
|
|
1148
|
+
itemId: s,
|
|
1149
|
+
error: f[S.field],
|
|
1150
|
+
visible: u.has(S.field) || !u.size,
|
|
1151
|
+
forceVisible: $e(S) || void 0,
|
|
1152
|
+
locked: O.has(S.field),
|
|
1102
1153
|
layoutAiEnabled: $,
|
|
1103
1154
|
renderField: h,
|
|
1104
1155
|
onCountChange: v,
|
|
1105
|
-
swapButton:
|
|
1106
|
-
swapContent:
|
|
1156
|
+
swapButton: Lt,
|
|
1157
|
+
swapContent: qt
|
|
1107
1158
|
}
|
|
1108
1159
|
);
|
|
1109
1160
|
return K(
|
|
1110
|
-
{ kind: "field", field:
|
|
1111
|
-
/* @__PURE__ */
|
|
1161
|
+
{ kind: "field", field: S.field, group_key: t.key },
|
|
1162
|
+
/* @__PURE__ */ x(
|
|
1112
1163
|
"div",
|
|
1113
1164
|
{
|
|
1114
|
-
style: { gridColumn: `span ${
|
|
1165
|
+
style: { gridColumn: `span ${it(S.options, ke)}` },
|
|
1115
1166
|
children: [
|
|
1116
|
-
|
|
1117
|
-
(
|
|
1118
|
-
|
|
1167
|
+
$e(S) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Qe }) : Qe,
|
|
1168
|
+
(T == null ? void 0 : T.length) && He && Ke && /* @__PURE__ */ e(
|
|
1169
|
+
Nn,
|
|
1119
1170
|
{
|
|
1120
|
-
relCollection:
|
|
1121
|
-
relId:
|
|
1122
|
-
entries:
|
|
1123
|
-
separator:
|
|
1171
|
+
relCollection: Ke,
|
|
1172
|
+
relId: de,
|
|
1173
|
+
entries: T,
|
|
1174
|
+
separator: jt
|
|
1124
1175
|
}
|
|
1125
1176
|
)
|
|
1126
1177
|
]
|
|
1127
1178
|
},
|
|
1128
|
-
|
|
1179
|
+
S.field
|
|
1129
1180
|
)
|
|
1130
1181
|
);
|
|
1131
|
-
},
|
|
1182
|
+
}, L = p.folded.map((b) => ({
|
|
1132
1183
|
_k: b.field,
|
|
1133
1184
|
sort: b.sort ?? 0,
|
|
1134
1185
|
_t: "field",
|
|
1135
1186
|
f: b
|
|
1136
1187
|
}));
|
|
1137
|
-
return /* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1188
|
+
return /* @__PURE__ */ x(Bt, { children: [
|
|
1189
|
+
/* @__PURE__ */ x(
|
|
1139
1190
|
"div",
|
|
1140
1191
|
{
|
|
1141
|
-
ref:
|
|
1192
|
+
ref: ve,
|
|
1142
1193
|
"data-section-grid": "",
|
|
1143
|
-
className:
|
|
1194
|
+
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1144
1195
|
children: [
|
|
1145
|
-
/* @__PURE__ */ e(
|
|
1146
|
-
|
|
1196
|
+
/* @__PURE__ */ e(Fe, {}),
|
|
1197
|
+
_.map(a)
|
|
1147
1198
|
]
|
|
1148
1199
|
}
|
|
1149
1200
|
),
|
|
1150
1201
|
/* @__PURE__ */ e(
|
|
1151
|
-
|
|
1202
|
+
dn,
|
|
1152
1203
|
{
|
|
1153
|
-
count:
|
|
1154
|
-
open:
|
|
1155
|
-
forcedOpen:
|
|
1156
|
-
design: !!
|
|
1157
|
-
onToggle: () =>
|
|
1158
|
-
children: /* @__PURE__ */
|
|
1204
|
+
count: L.length,
|
|
1205
|
+
open: wt,
|
|
1206
|
+
forcedOpen: p.forcedOpen,
|
|
1207
|
+
design: !!F,
|
|
1208
|
+
onToggle: () => vt((b) => !b),
|
|
1209
|
+
children: /* @__PURE__ */ x(
|
|
1159
1210
|
"div",
|
|
1160
1211
|
{
|
|
1161
1212
|
"data-section-grid": "",
|
|
1162
|
-
className:
|
|
1213
|
+
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1163
1214
|
children: [
|
|
1164
|
-
/* @__PURE__ */ e(
|
|
1165
|
-
|
|
1215
|
+
/* @__PURE__ */ e(Fe, {}),
|
|
1216
|
+
L.map(a)
|
|
1166
1217
|
]
|
|
1167
1218
|
}
|
|
1168
1219
|
)
|
|
@@ -1178,25 +1229,25 @@ const zn = It(function({
|
|
|
1178
1229
|
]
|
|
1179
1230
|
}
|
|
1180
1231
|
);
|
|
1181
|
-
},
|
|
1182
|
-
function
|
|
1232
|
+
}, xn);
|
|
1233
|
+
function $n({
|
|
1183
1234
|
layoutId: n,
|
|
1184
1235
|
collection: t,
|
|
1185
1236
|
sectionKey: i
|
|
1186
1237
|
}) {
|
|
1187
|
-
return
|
|
1188
|
-
|
|
1238
|
+
return Q(() => {
|
|
1239
|
+
ft({ layoutId: n, collection: t, kind: "shown", key: i });
|
|
1189
1240
|
}, [n, t, i]), null;
|
|
1190
1241
|
}
|
|
1191
1242
|
export {
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1243
|
+
rr as GroupSection,
|
|
1244
|
+
Nn as InlineDisplay,
|
|
1245
|
+
st as OwnersInline,
|
|
1246
|
+
gn as OwnersInlineCompact,
|
|
1247
|
+
ie as RelationCell,
|
|
1248
|
+
nr as StripFieldValue,
|
|
1249
|
+
gt as UserChip,
|
|
1250
|
+
lr as UserRosterCluster,
|
|
1251
|
+
qe as formatDisplayValue,
|
|
1252
|
+
vn as useChangePulse
|
|
1202
1253
|
};
|