@nivaro/react 0.2.53 → 0.2.55
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +94 -0
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +116 -110
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import * as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
import
|
|
6
|
-
import { fieldDrilldownConfig as
|
|
7
|
-
import { get as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as _t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as de, useQueryClient as wt } from "@tanstack/react-query";
|
|
3
|
+
import * as vt from "lucide-react";
|
|
4
|
+
import { ChevronDown as St, Loader2 as kt, User as Dt, Mail as $t } from "lucide-react";
|
|
5
|
+
import nt, { useState as Q, useRef as Se, useEffect as ne } from "react";
|
|
6
|
+
import { fieldDrilldownConfig as Ft, useDrilldown as jt, useOptionalNivaroClient as ue, useNavigation as Lt } from "../../context.js";
|
|
7
|
+
import { get as rt, post as Ot } from "../../lib/commands.js";
|
|
8
|
+
import { planFieldGrid as qt, isEmptyValue as Bt, isFolded as Ut, readGroupStructure as Tt } from "../../lib/form-structure.js";
|
|
9
|
+
import { reportSectionUse as it } from "../../lib/form-usage-beacon.js";
|
|
10
|
+
import { useRecordReader as st } from "../../lib/record-loader.js";
|
|
11
|
+
import { choiceLabel as It, titleCase as lt, cn as W } from "../../lib/utils.js";
|
|
12
|
+
import { DesignDropZone as Mt, designWrap as Gt } from "../layout-editor/DesignNode.js";
|
|
13
|
+
import { useLayoutDesign as Vt, revealGroupKey as Pt } from "../layout-editor/design-context.js";
|
|
14
|
+
import { GridGuides as we } from "../layout-editor/grid-guides.js";
|
|
15
|
+
import { UserAvatar as Ct } from "../UserAvatar.js";
|
|
16
|
+
import { DropdownMenu as Jt, DropdownMenuTrigger as Rt, DropdownMenuContent as zt, DropdownMenuItem as We } from "../ui/dropdown-menu.js";
|
|
17
|
+
import { WidgetSlot as Ae } from "../WidgetSlot.js";
|
|
18
|
+
import { FieldRow as ve } from "./FieldRow.js";
|
|
19
|
+
import { FoldArea as Kt, RowGroupCell as Ht, rowMemberField as Wt } from "./form-structure-ui.js";
|
|
20
|
+
import { useFormHelpVideos as At, FormHelpVideoButton as Et } from "./FormHelpVideoButton.js";
|
|
21
|
+
import { applyDisplayTemplate as Yt, useContainerWidth as Qt, resolveColSpan as Ee } from "./helpers.js";
|
|
22
|
+
import { SectionIntro as Zt } from "./LayoutContentBlock.js";
|
|
23
|
+
import { UserChip as at, OwnersInline as Ye, OwnersInlineCompact as Xt } from "./UserChip.js";
|
|
24
|
+
import { UserRosterCluster as Bn } from "./UserChip.js";
|
|
25
|
+
function Qe(t) {
|
|
20
26
|
if (typeof t != "string") return t ?? [];
|
|
21
27
|
try {
|
|
22
28
|
return JSON.parse(t);
|
|
@@ -24,94 +30,94 @@ function Te(t) {
|
|
|
24
30
|
return [];
|
|
25
31
|
}
|
|
26
32
|
}
|
|
27
|
-
function
|
|
33
|
+
function en({
|
|
28
34
|
relCollection: t,
|
|
29
35
|
relId: r,
|
|
30
36
|
entries: i,
|
|
31
37
|
separator: u
|
|
32
38
|
}) {
|
|
33
|
-
const
|
|
34
|
-
queryKey: ["inline-display", t, n,
|
|
35
|
-
queryFn: () =>
|
|
36
|
-
enabled: !!
|
|
39
|
+
const s = ue(), l = st(), n = String(r), m = i.some((g) => g.field.includes(".")) ? ["id", ...i.map((g) => g.field)].join(",") : null, { data: h } = de({
|
|
40
|
+
queryKey: ["inline-display", t, n, m],
|
|
41
|
+
queryFn: () => l(t, n, m),
|
|
42
|
+
enabled: !!s && !!n,
|
|
37
43
|
staleTime: 6e4
|
|
38
44
|
});
|
|
39
|
-
if (!
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
for (const
|
|
43
|
-
if (
|
|
44
|
-
|
|
45
|
+
if (!h) return null;
|
|
46
|
+
const k = (g) => {
|
|
47
|
+
let f = h;
|
|
48
|
+
for (const y of g.split(".")) {
|
|
49
|
+
if (f == null || typeof f != "object") return;
|
|
50
|
+
f = f[y];
|
|
45
51
|
}
|
|
46
|
-
return
|
|
52
|
+
return f;
|
|
47
53
|
};
|
|
48
54
|
if (u != null) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
55
|
+
const g = (L) => {
|
|
56
|
+
const S = k(L.field);
|
|
57
|
+
if (S == null || S === "") return null;
|
|
58
|
+
const D = L.format ?? "text";
|
|
59
|
+
if (D === "date" || D === "datetime")
|
|
54
60
|
try {
|
|
55
|
-
return new Date(String(
|
|
61
|
+
return new Date(String(S)).toLocaleDateString();
|
|
56
62
|
} catch {
|
|
57
|
-
return String(
|
|
63
|
+
return String(S);
|
|
58
64
|
}
|
|
59
|
-
return
|
|
60
|
-
},
|
|
61
|
-
let
|
|
62
|
-
for (const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
(
|
|
67
|
-
const
|
|
68
|
-
return
|
|
65
|
+
return D === "boolean" ? S ? "Yes" : "No" : String(S);
|
|
66
|
+
}, f = [];
|
|
67
|
+
let y = [];
|
|
68
|
+
for (const L of i)
|
|
69
|
+
L.line_break && y.length > 0 ? (f.push(y), y = [L]) : y.push(L);
|
|
70
|
+
y.length > 0 && f.push(y);
|
|
71
|
+
const q = f.map(
|
|
72
|
+
(L) => L.map((S) => {
|
|
73
|
+
const D = g(S);
|
|
74
|
+
return D ? { label: S.label ?? null, display: D } : null;
|
|
69
75
|
}).filter(Boolean)
|
|
70
|
-
).filter((
|
|
71
|
-
return
|
|
76
|
+
).filter((L) => L.length > 0);
|
|
77
|
+
return q.length === 0 ? null : /* @__PURE__ */ e("div", { className: "mt-1", children: q.map((L, S) => (
|
|
72
78
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable line order
|
|
73
|
-
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children:
|
|
79
|
+
/* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: L.map((D, J) => (
|
|
74
80
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable token order
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
81
|
+
/* @__PURE__ */ x(nt.Fragment, { children: [
|
|
82
|
+
J > 0 && u,
|
|
83
|
+
D.label && /* @__PURE__ */ x("span", { className: "font-semibold text-slate-600 dark:text-slate-300", children: [
|
|
84
|
+
D.label,
|
|
79
85
|
":"
|
|
80
86
|
] }),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
] },
|
|
84
|
-
)) },
|
|
87
|
+
D.label ? " " : "",
|
|
88
|
+
D.display
|
|
89
|
+
] }, J)
|
|
90
|
+
)) }, S)
|
|
85
91
|
)) });
|
|
86
92
|
}
|
|
87
|
-
const
|
|
88
|
-
const
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
let
|
|
92
|
-
if (
|
|
93
|
+
const o = i.map((g) => {
|
|
94
|
+
const f = k(g.field);
|
|
95
|
+
if (f == null || f === "") return null;
|
|
96
|
+
const y = g.format ?? "text";
|
|
97
|
+
let q;
|
|
98
|
+
if (y === "date" || y === "datetime")
|
|
93
99
|
try {
|
|
94
|
-
|
|
100
|
+
q = new Date(String(f)).toLocaleDateString();
|
|
95
101
|
} catch {
|
|
96
|
-
|
|
102
|
+
q = String(f);
|
|
97
103
|
}
|
|
98
|
-
else
|
|
99
|
-
return { label:
|
|
104
|
+
else y === "boolean" ? q = f ? "Yes" : "No" : q = String(f);
|
|
105
|
+
return { label: g.label, display: q };
|
|
100
106
|
}).filter(Boolean);
|
|
101
|
-
return
|
|
107
|
+
return o.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: o.map((g, f) => (
|
|
102
108
|
// biome-ignore lint/suspicious/noArrayIndexKey: stable order from config
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
105
|
-
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children:
|
|
106
|
-
] },
|
|
109
|
+
/* @__PURE__ */ x("div", { className: "flex items-baseline gap-2", children: [
|
|
110
|
+
g.label && /* @__PURE__ */ e("span", { className: "shrink-0 min-w-[56px] text-[10px] font-medium text-slate-400", children: g.label }),
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-300 truncate", children: g.display })
|
|
112
|
+
] }, f)
|
|
107
113
|
)) });
|
|
108
114
|
}
|
|
109
|
-
function
|
|
115
|
+
function tn(t) {
|
|
110
116
|
if (!t) return null;
|
|
111
|
-
const r = t.replace(/(^|-)([a-z])/g, (u,
|
|
117
|
+
const r = t.replace(/(^|-)([a-z])/g, (u, s, l) => l.toUpperCase()), i = vt[r];
|
|
112
118
|
return i || null;
|
|
113
119
|
}
|
|
114
|
-
function
|
|
120
|
+
function Ze(t) {
|
|
115
121
|
if (!t.options) return {};
|
|
116
122
|
if (typeof t.options == "object") return t.options;
|
|
117
123
|
try {
|
|
@@ -120,7 +126,7 @@ function qe(t) {
|
|
|
120
126
|
return {};
|
|
121
127
|
}
|
|
122
128
|
}
|
|
123
|
-
function
|
|
129
|
+
function ke(t, r) {
|
|
124
130
|
if (t == null || t === "") return "—";
|
|
125
131
|
if (typeof t == "boolean") return t ? "Yes" : "No";
|
|
126
132
|
const i = (r == null ? void 0 : r.interface) ?? "", u = (() => {
|
|
@@ -138,12 +144,12 @@ function de(t, r) {
|
|
|
138
144
|
if (u === "percent" && Number.isFinite(n)) return `${(n * 100).toFixed(1)}%`;
|
|
139
145
|
if (/^0\.0+$/.test(u) && Number.isFinite(n)) return n.toFixed(u.length - 2);
|
|
140
146
|
if (u === "date" && typeof t == "string") {
|
|
141
|
-
const
|
|
142
|
-
if (!Number.isNaN(
|
|
147
|
+
const a = t.length === 10 ? /* @__PURE__ */ new Date(`${t}T00:00:00`) : new Date(t);
|
|
148
|
+
if (!Number.isNaN(a.getTime())) return a.toLocaleDateString();
|
|
143
149
|
}
|
|
144
150
|
if (u === "datetime" && typeof t == "string") {
|
|
145
|
-
const
|
|
146
|
-
if (!Number.isNaN(
|
|
151
|
+
const a = new Date(t);
|
|
152
|
+
if (!Number.isNaN(a.getTime())) return a.toLocaleString();
|
|
147
153
|
}
|
|
148
154
|
}
|
|
149
155
|
if (i === "duration" && Number.isFinite(Number(t))) {
|
|
@@ -155,7 +161,7 @@ function de(t, r) {
|
|
|
155
161
|
if (i === "checklist" && typeof t == "string")
|
|
156
162
|
try {
|
|
157
163
|
const n = JSON.parse(t);
|
|
158
|
-
if (Array.isArray(n)) return `${n.filter((
|
|
164
|
+
if (Array.isArray(n)) return `${n.filter((a) => a == null ? void 0 : a.done).length}/${n.length} done`;
|
|
159
165
|
} catch {
|
|
160
166
|
}
|
|
161
167
|
if (i === "address" && typeof t == "string" && t.trim().startsWith("{"))
|
|
@@ -174,104 +180,104 @@ function de(t, r) {
|
|
|
174
180
|
return String(t);
|
|
175
181
|
}
|
|
176
182
|
}
|
|
177
|
-
const
|
|
178
|
-
if (i === "datetime" || i === "date" || /^\d{4}-\d{2}-\d{2}T/.test(
|
|
183
|
+
const s = String(t);
|
|
184
|
+
if (i === "datetime" || i === "date" || /^\d{4}-\d{2}-\d{2}T/.test(s) || /^\d{4}-\d{2}-\d{2}$/.test(s))
|
|
179
185
|
try {
|
|
180
|
-
let n = /^\d{4}-\d{2}-\d{2}$/.test(
|
|
186
|
+
let n = /^\d{4}-\d{2}-\d{2}$/.test(s) || i === "date";
|
|
181
187
|
if (!n && (r != null && r.options))
|
|
182
188
|
try {
|
|
183
|
-
const
|
|
184
|
-
|
|
189
|
+
const m = typeof r.options == "string" ? JSON.parse(r.options) : r.options;
|
|
190
|
+
m && m.date_mode === "date" && (n = !0);
|
|
185
191
|
} catch {
|
|
186
192
|
}
|
|
187
|
-
const
|
|
188
|
-
return
|
|
193
|
+
const a = s.match(/^(\d{4})-(\d{2})-(\d{2})(?:T00:00:00(?:\.000)?Z)?$/);
|
|
194
|
+
return a ? new Date(Number(a[1]), Number(a[2]) - 1, Number(a[3])).toLocaleDateString() : n ? new Date(s).toLocaleDateString() : new Date(s).toLocaleString();
|
|
189
195
|
} catch {
|
|
190
196
|
}
|
|
191
197
|
if ((i === "select-dropdown" || i === "radio-buttons") && r) {
|
|
192
|
-
const
|
|
193
|
-
if (Array.isArray(
|
|
194
|
-
const
|
|
195
|
-
if (
|
|
198
|
+
const a = Ze(r).choices;
|
|
199
|
+
if (Array.isArray(a)) {
|
|
200
|
+
const m = a.find((h) => String(h.value) === s);
|
|
201
|
+
if (m) return It(m.text);
|
|
196
202
|
}
|
|
197
203
|
}
|
|
198
|
-
const
|
|
199
|
-
if (!Number.isNaN(
|
|
200
|
-
const n =
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
if (
|
|
204
|
+
const l = Number(s);
|
|
205
|
+
if (!Number.isNaN(l) && s !== "" && r) {
|
|
206
|
+
const n = Ze(r), a = n.format, m = typeof n.unit == "string" ? n.unit.trim() : "";
|
|
207
|
+
if (m && !a) {
|
|
208
|
+
const h = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(l);
|
|
209
|
+
if (m === "$")
|
|
204
210
|
try {
|
|
205
211
|
return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(
|
|
206
|
-
|
|
212
|
+
l
|
|
207
213
|
);
|
|
208
214
|
} catch {
|
|
209
|
-
return `$${
|
|
215
|
+
return `$${h}`;
|
|
210
216
|
}
|
|
211
|
-
return
|
|
217
|
+
return m === "%" ? `${h}%` : `${h} ${m}`;
|
|
212
218
|
}
|
|
213
|
-
if (
|
|
219
|
+
if (a === "currency")
|
|
214
220
|
try {
|
|
215
221
|
return new Intl.NumberFormat(void 0, {
|
|
216
222
|
style: "currency",
|
|
217
223
|
currency: n.currency || "USD"
|
|
218
|
-
}).format(
|
|
224
|
+
}).format(l);
|
|
219
225
|
} catch {
|
|
220
226
|
}
|
|
221
|
-
if (
|
|
222
|
-
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(
|
|
223
|
-
if (
|
|
224
|
-
const
|
|
227
|
+
if (a === "int")
|
|
228
|
+
return new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(l);
|
|
229
|
+
if (a === "decimal") {
|
|
230
|
+
const h = typeof n.precision == "number" ? n.precision : 2;
|
|
225
231
|
return new Intl.NumberFormat(void 0, {
|
|
226
|
-
minimumFractionDigits:
|
|
227
|
-
maximumFractionDigits:
|
|
228
|
-
}).format(
|
|
232
|
+
minimumFractionDigits: h,
|
|
233
|
+
maximumFractionDigits: h
|
|
234
|
+
}).format(l);
|
|
229
235
|
}
|
|
230
236
|
}
|
|
231
|
-
return !
|
|
237
|
+
return !s.includes(" ") && !s.includes("@") && !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(s) && !/^\d+$/.test(s) && (s.includes("_") || s.includes("-") || /^[a-z]/.test(s)) ? lt(s) : s;
|
|
232
238
|
}
|
|
233
|
-
function
|
|
234
|
-
const r =
|
|
239
|
+
function Xe({ userId: t }) {
|
|
240
|
+
const r = ue(), { navigate: i, userUrl: u } = Lt(), s = u ? u(t) : `/users/${t}`, { data: l } = de({
|
|
235
241
|
queryKey: ["user-chip", t],
|
|
236
242
|
queryFn: () => r.request(
|
|
237
|
-
|
|
238
|
-
).then((
|
|
243
|
+
rt(`/users/${t}`)
|
|
244
|
+
).then((m) => m.data ?? null),
|
|
239
245
|
enabled: !!r && !!t,
|
|
240
246
|
staleTime: 12e4
|
|
241
|
-
}), n =
|
|
242
|
-
return /* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */ e(
|
|
247
|
+
}), n = l ? [l.first_name, l.last_name].filter(Boolean).join(" ") || l.email : t, a = n.split(" ").map((m) => m[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
248
|
+
return /* @__PURE__ */ x(Jt, { children: [
|
|
249
|
+
/* @__PURE__ */ e(Rt, { 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: [
|
|
244
250
|
/* @__PURE__ */ e(
|
|
245
|
-
|
|
251
|
+
Ct,
|
|
246
252
|
{
|
|
247
253
|
userId: t,
|
|
248
254
|
className: "h-4 w-4",
|
|
249
|
-
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:
|
|
255
|
+
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: a })
|
|
250
256
|
}
|
|
251
257
|
),
|
|
252
258
|
/* @__PURE__ */ e("span", { className: "text-[11px] text-slate-600", children: n })
|
|
253
259
|
] }) }),
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
|
|
256
|
-
|
|
260
|
+
/* @__PURE__ */ x(zt, { align: "start", className: "text-[12px]", children: [
|
|
261
|
+
s && /* @__PURE__ */ x(
|
|
262
|
+
We,
|
|
257
263
|
{
|
|
258
264
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
259
|
-
onSelect: () => i(
|
|
265
|
+
onSelect: () => i(s),
|
|
260
266
|
children: [
|
|
261
|
-
/* @__PURE__ */ e(
|
|
267
|
+
/* @__PURE__ */ e(Dt, { className: "h-3.5 w-3.5" }),
|
|
262
268
|
" View profile"
|
|
263
269
|
]
|
|
264
270
|
}
|
|
265
271
|
),
|
|
266
|
-
(
|
|
267
|
-
|
|
272
|
+
(l == null ? void 0 : l.email) && /* @__PURE__ */ x(
|
|
273
|
+
We,
|
|
268
274
|
{
|
|
269
275
|
className: "gap-2 text-[12px] cursor-pointer",
|
|
270
276
|
onSelect: () => {
|
|
271
|
-
window.location.href = `mailto:${
|
|
277
|
+
window.location.href = `mailto:${l.email}`;
|
|
272
278
|
},
|
|
273
279
|
children: [
|
|
274
|
-
/* @__PURE__ */ e(
|
|
280
|
+
/* @__PURE__ */ e($t, { className: "h-3.5 w-3.5" }),
|
|
275
281
|
" Send email"
|
|
276
282
|
]
|
|
277
283
|
}
|
|
@@ -279,42 +285,42 @@ function Me({ userId: t }) {
|
|
|
279
285
|
] })
|
|
280
286
|
] });
|
|
281
287
|
}
|
|
282
|
-
function
|
|
288
|
+
function nn({
|
|
283
289
|
collection: t,
|
|
284
290
|
itemId: r,
|
|
285
291
|
layoutId: i,
|
|
286
292
|
attachField: u,
|
|
287
|
-
filenameTemplate:
|
|
288
|
-
label:
|
|
293
|
+
filenameTemplate: s,
|
|
294
|
+
label: l
|
|
289
295
|
}) {
|
|
290
|
-
const n =
|
|
291
|
-
if (!(!n ||
|
|
292
|
-
|
|
296
|
+
const n = ue(), a = wt(), [m, h] = Q(!1), k = async () => {
|
|
297
|
+
if (!(!n || m || !u)) {
|
|
298
|
+
h(!0);
|
|
293
299
|
try {
|
|
294
300
|
await n.request(
|
|
295
|
-
|
|
301
|
+
Ot(`/collection-layouts/${i}/generate-and-attach`, {
|
|
296
302
|
collection: t,
|
|
297
303
|
item_id: r,
|
|
298
304
|
attach_field: u,
|
|
299
|
-
filename_template:
|
|
305
|
+
filename_template: s ?? void 0
|
|
300
306
|
})
|
|
301
|
-
),
|
|
307
|
+
), a.invalidateQueries({ queryKey: ["m2m-items"] }), a.invalidateQueries({ queryKey: ["items", t, r] });
|
|
302
308
|
} catch {
|
|
303
309
|
} finally {
|
|
304
|
-
|
|
310
|
+
h(!1);
|
|
305
311
|
}
|
|
306
312
|
}
|
|
307
|
-
},
|
|
308
|
-
return /* @__PURE__ */
|
|
313
|
+
}, o = !u;
|
|
314
|
+
return /* @__PURE__ */ x(
|
|
309
315
|
"button",
|
|
310
316
|
{
|
|
311
317
|
type: "button",
|
|
312
|
-
onClick:
|
|
313
|
-
disabled:
|
|
314
|
-
title:
|
|
318
|
+
onClick: k,
|
|
319
|
+
disabled: m || o,
|
|
320
|
+
title: o ? "Configure PDF field in Data Model → Layouts" : void 0,
|
|
315
321
|
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",
|
|
316
322
|
children: [
|
|
317
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ x(
|
|
318
324
|
"svg",
|
|
319
325
|
{
|
|
320
326
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -331,48 +337,48 @@ function vt({
|
|
|
331
337
|
]
|
|
332
338
|
}
|
|
333
339
|
),
|
|
334
|
-
|
|
340
|
+
m ? "Generating…" : l
|
|
335
341
|
]
|
|
336
342
|
}
|
|
337
343
|
);
|
|
338
344
|
}
|
|
339
|
-
function
|
|
345
|
+
function re({
|
|
340
346
|
relCollection: t,
|
|
341
347
|
id: r,
|
|
342
348
|
className: i
|
|
343
349
|
}) {
|
|
344
|
-
var
|
|
345
|
-
const u =
|
|
350
|
+
var f;
|
|
351
|
+
const u = ue(), s = st(), l = r != null && r !== "" ? String(r) : null, { data: n } = de({
|
|
346
352
|
queryKey: ["col-meta-dt", t],
|
|
347
353
|
queryFn: () => u.request(
|
|
348
|
-
|
|
349
|
-
).then((
|
|
350
|
-
enabled: !!u && !!
|
|
354
|
+
rt(`/collections/${t}`)
|
|
355
|
+
).then((y) => y.data).catch(() => ({})),
|
|
356
|
+
enabled: !!u && !!l,
|
|
351
357
|
staleTime: 3e5
|
|
352
|
-
}),
|
|
353
|
-
queryKey: ["rel-display", t,
|
|
354
|
-
queryFn: () =>
|
|
355
|
-
enabled: !!u && !!
|
|
358
|
+
}), a = (((f = n == null ? void 0 : n.display_template) == null ? void 0 : f.match(/\{\{\s*[^}]+?\s*\}\}/g)) ?? []).map((y) => y.replace(/[{}\s]/g, "")).filter((y) => y.includes(".")), m = a.length ? ["id", ...a].join(",") : null, { data: h, isLoading: k } = de({
|
|
359
|
+
queryKey: ["rel-display", t, l, m],
|
|
360
|
+
queryFn: () => s(t, l, m),
|
|
361
|
+
enabled: !!u && !!l && n !== void 0,
|
|
356
362
|
staleTime: 6e4
|
|
357
363
|
});
|
|
358
|
-
if (!
|
|
359
|
-
if (
|
|
364
|
+
if (!l) return /* @__PURE__ */ e("span", { children: "—" });
|
|
365
|
+
if (k || u && n === void 0)
|
|
360
366
|
return /* @__PURE__ */ e("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" });
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
const
|
|
364
|
-
return /* @__PURE__ */ e("span", { className:
|
|
367
|
+
const o = i ?? "text-[13px] text-slate-700";
|
|
368
|
+
if (!h) return /* @__PURE__ */ e("span", { className: o, children: l });
|
|
369
|
+
const g = n != null && n.display_template ? Yt(n.display_template, h) : String(h.name ?? h.title ?? h.label ?? h.display_name ?? l);
|
|
370
|
+
return /* @__PURE__ */ e("span", { className: o, children: g });
|
|
365
371
|
}
|
|
366
|
-
function
|
|
367
|
-
return /* @__PURE__ */ e(
|
|
372
|
+
function et({ userId: t }) {
|
|
373
|
+
return /* @__PURE__ */ e(at, { userId: t, size: "compact" });
|
|
368
374
|
}
|
|
369
|
-
function
|
|
375
|
+
function tt({
|
|
370
376
|
relCollection: t,
|
|
371
377
|
id: r,
|
|
372
378
|
drillConfig: i
|
|
373
379
|
}) {
|
|
374
|
-
const u =
|
|
375
|
-
return !u || r == null || r === "" ?
|
|
380
|
+
const u = jt(), s = /* @__PURE__ */ e(re, { relCollection: t, id: r });
|
|
381
|
+
return !u || r == null || r === "" ? s : /* @__PURE__ */ e(
|
|
376
382
|
"button",
|
|
377
383
|
{
|
|
378
384
|
type: "button",
|
|
@@ -388,7 +394,7 @@ function Pe({
|
|
|
388
394
|
},
|
|
389
395
|
className: "group/drill cursor-pointer text-left transition-colors",
|
|
390
396
|
children: /* @__PURE__ */ e(
|
|
391
|
-
|
|
397
|
+
re,
|
|
392
398
|
{
|
|
393
399
|
relCollection: t,
|
|
394
400
|
id: r,
|
|
@@ -398,616 +404,757 @@ function Pe({
|
|
|
398
404
|
}
|
|
399
405
|
);
|
|
400
406
|
}
|
|
401
|
-
function
|
|
402
|
-
const [r, i] =
|
|
403
|
-
return
|
|
404
|
-
const
|
|
407
|
+
function rn(t) {
|
|
408
|
+
const [r, i] = Q(!1), u = Se(!0), s = Se(JSON.stringify(t ?? null));
|
|
409
|
+
return ne(() => {
|
|
410
|
+
const l = JSON.stringify(t ?? null);
|
|
405
411
|
if (u.current) {
|
|
406
|
-
u.current = !1,
|
|
412
|
+
u.current = !1, s.current = l;
|
|
407
413
|
return;
|
|
408
414
|
}
|
|
409
|
-
if (
|
|
410
|
-
|
|
411
|
-
const n = window.setTimeout(() => i(!0), 0),
|
|
415
|
+
if (l === s.current) return;
|
|
416
|
+
s.current = l, i(!1);
|
|
417
|
+
const n = window.setTimeout(() => i(!0), 0), a = window.setTimeout(() => i(!1), 1200);
|
|
412
418
|
return () => {
|
|
413
|
-
window.clearTimeout(n), window.clearTimeout(
|
|
419
|
+
window.clearTimeout(n), window.clearTimeout(a);
|
|
414
420
|
};
|
|
415
421
|
}, [t]), r ? "nvr-value-pulse" : "";
|
|
416
422
|
}
|
|
417
|
-
function
|
|
423
|
+
function jn({
|
|
418
424
|
field: t,
|
|
419
425
|
val: r,
|
|
420
426
|
relations: i,
|
|
421
427
|
collection: u,
|
|
422
|
-
displayFormat:
|
|
423
|
-
textClassName:
|
|
428
|
+
displayFormat: s,
|
|
429
|
+
textClassName: l
|
|
424
430
|
}) {
|
|
425
|
-
const n =
|
|
426
|
-
(
|
|
431
|
+
const n = rn(r), a = W(l ?? "text-[13px] text-slate-900 dark:text-slate-100", n), m = Ft(t) ?? { enabled: !0, layout_id: null, width: null }, h = i.find(
|
|
432
|
+
(o) => o.one_collection === u && o.one_field === t.field && o.junction_field
|
|
427
433
|
);
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
(
|
|
431
|
-
),
|
|
432
|
-
return !
|
|
433
|
-
|
|
434
|
+
if (h) {
|
|
435
|
+
const o = i.find(
|
|
436
|
+
(y) => y.many_collection === h.many_collection && y.many_field === h.junction_field
|
|
437
|
+
), g = o == null ? void 0 : o.one_collection, f = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
|
|
438
|
+
return !g || f.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : g === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: f.map((y) => /* @__PURE__ */ e(et, { userId: String(y) }, String(y))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: f.map((y) => /* @__PURE__ */ e(
|
|
439
|
+
tt,
|
|
434
440
|
{
|
|
435
|
-
relCollection:
|
|
436
|
-
id:
|
|
437
|
-
drillConfig:
|
|
441
|
+
relCollection: g,
|
|
442
|
+
id: y,
|
|
443
|
+
drillConfig: m
|
|
438
444
|
},
|
|
439
|
-
String(
|
|
445
|
+
String(y)
|
|
440
446
|
)) });
|
|
441
447
|
}
|
|
442
|
-
const
|
|
443
|
-
(
|
|
448
|
+
const k = i.find(
|
|
449
|
+
(o) => o.many_collection === u && o.many_field === t.field && !o.junction_field
|
|
444
450
|
);
|
|
445
|
-
if (
|
|
446
|
-
const
|
|
447
|
-
return
|
|
448
|
-
|
|
451
|
+
if (k != null && k.one_collection) {
|
|
452
|
+
const o = Array.isArray(r) ? r : r != null && r !== "" ? [r] : [];
|
|
453
|
+
return o.length === 0 ? /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" }) : k.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1 gap-y-0.5", children: o.map((g) => /* @__PURE__ */ e(et, { userId: String(g) }, String(g))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: o.map((g) => /* @__PURE__ */ e(
|
|
454
|
+
tt,
|
|
449
455
|
{
|
|
450
|
-
relCollection:
|
|
451
|
-
id:
|
|
452
|
-
drillConfig:
|
|
456
|
+
relCollection: k.one_collection,
|
|
457
|
+
id: g,
|
|
458
|
+
drillConfig: m
|
|
453
459
|
},
|
|
454
|
-
String(
|
|
460
|
+
String(g)
|
|
455
461
|
)) });
|
|
456
462
|
}
|
|
457
463
|
if (r == null || r === "")
|
|
458
464
|
return /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-slate-600", children: "—" });
|
|
459
|
-
if (
|
|
460
|
-
const
|
|
461
|
-
if (
|
|
462
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
465
|
+
if (s && s !== "text") {
|
|
466
|
+
const o = Number(r);
|
|
467
|
+
if (s === "currency" && !isNaN(o))
|
|
468
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, {
|
|
463
469
|
style: "currency",
|
|
464
470
|
currency: "USD",
|
|
465
471
|
minimumFractionDigits: 2
|
|
466
|
-
}).format(
|
|
467
|
-
if (
|
|
468
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
469
|
-
if (
|
|
470
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
471
|
-
if (
|
|
472
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
473
|
-
|
|
472
|
+
}).format(o) });
|
|
473
|
+
if (s === "integer" && !isNaN(o))
|
|
474
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format(Math.round(o)) });
|
|
475
|
+
if (s === "decimal" && !isNaN(o))
|
|
476
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }).format(o) });
|
|
477
|
+
if (s === "percent" && !isNaN(o))
|
|
478
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Intl.NumberFormat(void 0, { style: "percent", maximumFractionDigits: 1 }).format(
|
|
479
|
+
o / 100
|
|
474
480
|
) });
|
|
475
|
-
if (
|
|
481
|
+
if (s === "date")
|
|
476
482
|
try {
|
|
477
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
483
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Date(String(r)).toLocaleDateString() });
|
|
478
484
|
} catch {
|
|
479
485
|
}
|
|
480
|
-
if (
|
|
486
|
+
if (s === "datetime")
|
|
481
487
|
try {
|
|
482
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
488
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: new Date(String(r)).toLocaleString() });
|
|
483
489
|
} catch {
|
|
484
490
|
}
|
|
485
491
|
}
|
|
486
|
-
return /* @__PURE__ */ e("span", { className: `font-semibold ${
|
|
492
|
+
return /* @__PURE__ */ e("span", { className: `font-semibold ${a}`, children: ke(r, t) });
|
|
487
493
|
}
|
|
488
|
-
function
|
|
494
|
+
function sn({
|
|
489
495
|
summaryFields: t,
|
|
490
496
|
fields: r,
|
|
491
497
|
draft: i,
|
|
492
498
|
relations: u,
|
|
493
|
-
collection:
|
|
494
|
-
itemId:
|
|
499
|
+
collection: s,
|
|
500
|
+
itemId: l,
|
|
495
501
|
ownersCollection: n,
|
|
496
|
-
ownersItemId:
|
|
497
|
-
ownersAssignment:
|
|
498
|
-
m2mCounts:
|
|
499
|
-
o2mCounts:
|
|
500
|
-
o2mAggValues:
|
|
501
|
-
summaryAggConfigs:
|
|
502
|
-
o2mLoading:
|
|
503
|
-
hideEmpty:
|
|
502
|
+
ownersItemId: a,
|
|
503
|
+
ownersAssignment: m,
|
|
504
|
+
m2mCounts: h,
|
|
505
|
+
o2mCounts: k,
|
|
506
|
+
o2mAggValues: o,
|
|
507
|
+
summaryAggConfigs: g,
|
|
508
|
+
o2mLoading: f,
|
|
509
|
+
hideEmpty: y
|
|
504
510
|
}) {
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
if (
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
510
|
-
return
|
|
511
|
-
}) :
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const d = (
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */ e("span", { className:
|
|
511
|
+
const q = t.map((N) => typeof N == "string" ? N : N.field), L = y ? q.filter((N) => {
|
|
512
|
+
if (N === "__owners__" || f != null && f.has(N) || o && N in o) return !0;
|
|
513
|
+
if (h && N in h) return (h[N] ?? 0) > 0;
|
|
514
|
+
if (k && N in k) return (k[N] ?? 0) > 0;
|
|
515
|
+
const U = i[N];
|
|
516
|
+
return U != null && U !== "" && !(Array.isArray(U) && U.length === 0);
|
|
517
|
+
}) : q;
|
|
518
|
+
if (L.length === 0) return null;
|
|
519
|
+
const S = "text-[9px] font-semibold uppercase tracking-wider text-slate-400 dark:text-slate-500 shrink-0", D = "text-[12px] font-semibold text-slate-700 dark:text-slate-300", J = "text-[12px] text-slate-300 dark:text-slate-600", R = "flex items-baseline gap-1.5", me = (N) => {
|
|
520
|
+
if (N === "__owners__") {
|
|
521
|
+
const d = (m == null ? void 0 : m.label_override) || "Owners";
|
|
522
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
523
|
+
/* @__PURE__ */ e("span", { className: S, children: d }),
|
|
518
524
|
/* @__PURE__ */ e(
|
|
519
|
-
|
|
525
|
+
Xt,
|
|
520
526
|
{
|
|
521
|
-
collection: n ??
|
|
522
|
-
itemId:
|
|
527
|
+
collection: n ?? s,
|
|
528
|
+
itemId: a ?? l
|
|
523
529
|
}
|
|
524
530
|
)
|
|
525
531
|
] });
|
|
526
532
|
}
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
529
|
-
return /* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */ e("span", { className:
|
|
531
|
-
/* @__PURE__ */ e(
|
|
533
|
+
const U = t.find((d) => (typeof d == "string" ? d : d.field) === N), ie = U && typeof U != "string" ? U.label : void 0, A = r.find((d) => d.field === N), I = ie || (A == null ? void 0 : A.label) || N.replace(/_/g, " ").replace(/\b\w/g, (d) => d.toUpperCase());
|
|
534
|
+
if (f != null && f.has(N))
|
|
535
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
536
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
537
|
+
/* @__PURE__ */ e(kt, { className: "h-3 w-3 animate-spin text-slate-300" })
|
|
532
538
|
] });
|
|
533
|
-
if (
|
|
534
|
-
const d =
|
|
535
|
-
let
|
|
539
|
+
if (o && N in o) {
|
|
540
|
+
const d = g == null ? void 0 : g[N], B = (d == null ? void 0 : d.label) || I, $ = o[N];
|
|
541
|
+
let G;
|
|
536
542
|
if ((d == null ? void 0 : d.agg) === "count")
|
|
537
|
-
|
|
543
|
+
G = String($);
|
|
538
544
|
else {
|
|
539
|
-
const
|
|
545
|
+
const K = d != null && d.field_options ? (() => {
|
|
540
546
|
try {
|
|
541
547
|
return JSON.parse(d.field_options);
|
|
542
548
|
} catch {
|
|
543
549
|
return {};
|
|
544
550
|
}
|
|
545
|
-
})() : {},
|
|
546
|
-
if (
|
|
551
|
+
})() : {}, E = K.format;
|
|
552
|
+
if (E === "currency")
|
|
547
553
|
try {
|
|
548
|
-
|
|
554
|
+
G = new Intl.NumberFormat(void 0, {
|
|
549
555
|
style: "currency",
|
|
550
|
-
currency:
|
|
551
|
-
}).format(
|
|
556
|
+
currency: K.currency || "USD"
|
|
557
|
+
}).format($);
|
|
552
558
|
} catch {
|
|
553
|
-
|
|
559
|
+
G = $.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
554
560
|
}
|
|
555
|
-
else if (
|
|
556
|
-
|
|
557
|
-
else if (
|
|
558
|
-
const
|
|
559
|
-
|
|
560
|
-
minimumFractionDigits:
|
|
561
|
-
maximumFractionDigits:
|
|
562
|
-
}).format(
|
|
561
|
+
else if (E === "int")
|
|
562
|
+
G = new Intl.NumberFormat(void 0, { maximumFractionDigits: 0 }).format($);
|
|
563
|
+
else if (E === "decimal") {
|
|
564
|
+
const Y = typeof K.precision == "number" ? K.precision : 2;
|
|
565
|
+
G = new Intl.NumberFormat(void 0, {
|
|
566
|
+
minimumFractionDigits: Y,
|
|
567
|
+
maximumFractionDigits: Y
|
|
568
|
+
}).format($);
|
|
563
569
|
} else
|
|
564
|
-
|
|
570
|
+
G = $.toLocaleString(void 0, { maximumFractionDigits: 2 });
|
|
565
571
|
}
|
|
566
|
-
return /* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */ e("span", { className:
|
|
568
|
-
/* @__PURE__ */ e("span", { className:
|
|
572
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
573
|
+
/* @__PURE__ */ e("span", { className: S, children: B }),
|
|
574
|
+
/* @__PURE__ */ e("span", { className: D, children: G })
|
|
569
575
|
] });
|
|
570
576
|
}
|
|
571
|
-
if (
|
|
572
|
-
const d =
|
|
573
|
-
return /* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */ e("span", { className:
|
|
575
|
-
/* @__PURE__ */
|
|
577
|
+
if (h && N in h) {
|
|
578
|
+
const d = h[N];
|
|
579
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
580
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
581
|
+
/* @__PURE__ */ x("span", { className: D, children: [
|
|
576
582
|
d,
|
|
577
583
|
" item",
|
|
578
584
|
d !== 1 ? "s" : ""
|
|
579
585
|
] })
|
|
580
586
|
] });
|
|
581
587
|
}
|
|
582
|
-
if (
|
|
583
|
-
const d =
|
|
584
|
-
return /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */ e("span", { className:
|
|
586
|
-
/* @__PURE__ */
|
|
588
|
+
if (k && N in k) {
|
|
589
|
+
const d = k[N];
|
|
590
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
591
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
592
|
+
/* @__PURE__ */ x("span", { className: D, children: [
|
|
587
593
|
d,
|
|
588
594
|
" row",
|
|
589
595
|
d !== 1 ? "s" : ""
|
|
590
596
|
] })
|
|
591
597
|
] });
|
|
592
598
|
}
|
|
593
|
-
const
|
|
594
|
-
(d) => d.many_collection ===
|
|
599
|
+
const j = i[N], M = u.find(
|
|
600
|
+
(d) => d.many_collection === s && d.many_field === N && !d.junction_field
|
|
595
601
|
);
|
|
596
|
-
if (
|
|
597
|
-
const d = Array.isArray(
|
|
598
|
-
return /* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */ e("span", { className:
|
|
600
|
-
d.length === 0 ? /* @__PURE__ */ e("span", { className:
|
|
602
|
+
if (M != null && M.one_collection) {
|
|
603
|
+
const d = Array.isArray(j) ? j : j != null && j !== "" ? [j] : [];
|
|
604
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
605
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
606
|
+
d.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : M.one_collection === "nivaro_users" ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: d.map((B) => /* @__PURE__ */ e(Xe, { userId: String(B) }, String(B))) }) : /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5", children: d.map((B) => /* @__PURE__ */ e(re, { relCollection: M.one_collection, id: B }, String(B))) })
|
|
601
607
|
] });
|
|
602
608
|
}
|
|
603
|
-
if (Array.isArray(
|
|
604
|
-
const d = u.find((
|
|
605
|
-
return /* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */ e("span", { className:
|
|
607
|
-
|
|
608
|
-
(
|
|
609
|
-
) }) : /* @__PURE__ */
|
|
610
|
-
|
|
609
|
+
if (Array.isArray(j)) {
|
|
610
|
+
const d = u.find(($) => $.many_field === N && $.junction_field), B = d == null ? void 0 : d.one_collection;
|
|
611
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
612
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
613
|
+
j.length === 0 ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : B ? /* @__PURE__ */ e("span", { className: "inline-flex flex-wrap gap-x-1.5 gap-y-0.5", children: j.map(
|
|
614
|
+
($) => B === "nivaro_users" ? /* @__PURE__ */ e(Xe, { userId: String($) }, String($)) : /* @__PURE__ */ e(re, { relCollection: B, id: $ }, String($))
|
|
615
|
+
) }) : /* @__PURE__ */ x("span", { className: D, children: [
|
|
616
|
+
j.length,
|
|
611
617
|
" item",
|
|
612
|
-
|
|
618
|
+
j.length !== 1 ? "s" : ""
|
|
613
619
|
] })
|
|
614
620
|
] });
|
|
615
621
|
}
|
|
616
|
-
return /* @__PURE__ */
|
|
617
|
-
/* @__PURE__ */ e("span", { className:
|
|
618
|
-
|
|
622
|
+
return /* @__PURE__ */ x("div", { className: R, children: [
|
|
623
|
+
/* @__PURE__ */ e("span", { className: S, children: I }),
|
|
624
|
+
j == null || j === "" ? /* @__PURE__ */ e("span", { className: J, children: "—" }) : /* @__PURE__ */ e("span", { className: D, children: ke(j, A) })
|
|
619
625
|
] });
|
|
620
626
|
};
|
|
621
|
-
return /* @__PURE__ */ e("div", { 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", children:
|
|
627
|
+
return /* @__PURE__ */ e("div", { 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", children: L.map((N) => /* @__PURE__ */ e(nt.Fragment, { children: me(N) }, N)) });
|
|
622
628
|
}
|
|
623
|
-
function
|
|
629
|
+
function Ln({
|
|
624
630
|
group: t,
|
|
625
631
|
fields: r,
|
|
626
632
|
draft: i,
|
|
627
633
|
onChange: u,
|
|
628
|
-
relations:
|
|
629
|
-
collection:
|
|
634
|
+
relations: s,
|
|
635
|
+
collection: l,
|
|
630
636
|
itemId: n,
|
|
631
|
-
errors:
|
|
632
|
-
visibleFields:
|
|
633
|
-
lockedFields:
|
|
634
|
-
layoutAiEnabled:
|
|
635
|
-
displayOnly:
|
|
636
|
-
renderField:
|
|
637
|
-
onCountChange:
|
|
638
|
-
isNew:
|
|
639
|
-
fieldValues:
|
|
640
|
-
isOpen:
|
|
641
|
-
onToggle:
|
|
642
|
-
summaryFields:
|
|
643
|
-
m2mCounts:
|
|
644
|
-
o2mCounts:
|
|
645
|
-
o2mAggValues:
|
|
646
|
-
summaryAggConfigs:
|
|
647
|
-
o2mLoading:
|
|
648
|
-
footerSlot:
|
|
649
|
-
ownersCollection:
|
|
650
|
-
ownersItemId:
|
|
651
|
-
ownersAssignment:
|
|
652
|
-
pdfAssignment:
|
|
637
|
+
errors: a,
|
|
638
|
+
visibleFields: m,
|
|
639
|
+
lockedFields: h,
|
|
640
|
+
layoutAiEnabled: k,
|
|
641
|
+
displayOnly: o,
|
|
642
|
+
renderField: g,
|
|
643
|
+
onCountChange: f,
|
|
644
|
+
isNew: y,
|
|
645
|
+
fieldValues: q,
|
|
646
|
+
isOpen: L,
|
|
647
|
+
onToggle: S,
|
|
648
|
+
summaryFields: D,
|
|
649
|
+
m2mCounts: J,
|
|
650
|
+
o2mCounts: R,
|
|
651
|
+
o2mAggValues: me,
|
|
652
|
+
summaryAggConfigs: N,
|
|
653
|
+
o2mLoading: U,
|
|
654
|
+
footerSlot: ie,
|
|
655
|
+
ownersCollection: A,
|
|
656
|
+
ownersItemId: I,
|
|
657
|
+
ownersAssignment: j,
|
|
658
|
+
pdfAssignment: M,
|
|
653
659
|
pdfAttachField: d,
|
|
654
|
-
pdfFilenameTemplate:
|
|
655
|
-
layoutId:
|
|
656
|
-
hideEmptySummary:
|
|
657
|
-
widgetAssignments:
|
|
658
|
-
widgetApiBase:
|
|
659
|
-
fieldInlineDisplay:
|
|
660
|
-
swapConfig:
|
|
661
|
-
swapped:
|
|
662
|
-
onSwapToggle:
|
|
663
|
-
alternateFields:
|
|
664
|
-
alternateWidths:
|
|
660
|
+
pdfFilenameTemplate: B,
|
|
661
|
+
layoutId: $,
|
|
662
|
+
hideEmptySummary: G,
|
|
663
|
+
widgetAssignments: K,
|
|
664
|
+
widgetApiBase: E,
|
|
665
|
+
fieldInlineDisplay: Y,
|
|
666
|
+
swapConfig: V,
|
|
667
|
+
swapped: De,
|
|
668
|
+
onSwapToggle: $e,
|
|
669
|
+
alternateFields: Z,
|
|
670
|
+
alternateWidths: pe,
|
|
671
|
+
deferred: se,
|
|
672
|
+
onFirstOpen: le
|
|
665
673
|
}) {
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
(
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
|
|
674
|
+
var Me;
|
|
675
|
+
const [ot, ct] = Q(t.is_collapsed ?? !1), [dt, ut] = Q(!1), F = Vt(), H = (p, _) => Gt(F, p, _, { asChild: !0 }), ae = (p) => ({ kind: "slot", field: p, group_key: t.key }), Fe = !!(F != null && F.showHidden), [je, Le] = Q({}), { data: fe } = At(l), X = (F == null ? void 0 : F.fold) ?? null, ee = (F == null ? void 0 : F.reveal) ?? null, [Oe, he] = Q(null);
|
|
676
|
+
ne(() => {
|
|
677
|
+
X && he(!X.open);
|
|
678
|
+
}, [X == null ? void 0 : X.seq]), ne(() => {
|
|
679
|
+
ee && Pt(ee.target) === t.key && he(!1);
|
|
680
|
+
}, [ee == null ? void 0 : ee.seq]);
|
|
681
|
+
const qe = S !== void 0, z = Oe ?? (qe ? !L : ot);
|
|
682
|
+
ne(() => {
|
|
683
|
+
se && !z && (le == null || le(t.key));
|
|
684
|
+
}, [se, z, le, t.key]);
|
|
685
|
+
const be = Oe !== null ? () => he((p) => !p) : qe ? S : () => ct((p) => !p), Be = !F && $ != null, ge = () => {
|
|
686
|
+
Be && it({ layoutId: Number($), collection: l, kind: "opened", key: t.key });
|
|
687
|
+
}, mt = () => {
|
|
688
|
+
z && ge(), be == null || be();
|
|
689
|
+
}, pt = !o && r.some((p) => a[p.field]), Ue = F ? "always" : t.visibility_mode ?? "always";
|
|
690
|
+
if (Ue === "new_only" && !y || Ue === "existing_only" && y) return null;
|
|
691
|
+
const te = K ?? [], ft = !y && te.some((p) => p.widget_id != null && je[p.field] === void 0);
|
|
692
|
+
let oe = !1;
|
|
693
|
+
if (t.hide_when_empty && q && !F && (oe = q.every(
|
|
694
|
+
(_) => _ == null || _ === "" || Array.isArray(_) && _.length === 0
|
|
695
|
+
) && !ft && te.every((_) => !je[_.field])), oe && te.length === 0) return null;
|
|
696
|
+
const xe = Se(null), ye = Qt(xe), Te = tn(t.icon), ht = Fe ? r : r.filter((p) => !p.hidden), Ie = (Me = fe == null ? void 0 : fe.sections) == null ? void 0 : Me[t.key], bt = Array.isArray(Ie) && Ie.length > 0, gt = (p) => bt ? /* @__PURE__ */ x("div", { className: "relative", children: [
|
|
697
|
+
p,
|
|
698
|
+
/* @__PURE__ */ e("span", { className: "absolute right-[52px] top-1/2 flex -translate-y-1/2", children: /* @__PURE__ */ e(
|
|
699
|
+
Et,
|
|
700
|
+
{
|
|
701
|
+
collection: l,
|
|
702
|
+
kind: "section",
|
|
703
|
+
name: t.key,
|
|
704
|
+
label: t.label || t.key
|
|
705
|
+
}
|
|
706
|
+
) })
|
|
707
|
+
] }) : p, Ne = (p) => Fe && (p.hidden || !(m.has(p.field) || !m.size));
|
|
708
|
+
return /* @__PURE__ */ x(
|
|
675
709
|
"div",
|
|
676
710
|
{
|
|
677
|
-
|
|
711
|
+
"data-loads-on-open": se ? "" : void 0,
|
|
712
|
+
className: W(
|
|
678
713
|
"nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
|
|
679
|
-
|
|
680
|
-
|
|
714
|
+
o && "bg-slate-50/60 dark:bg-slate-900/20",
|
|
715
|
+
oe && "hidden"
|
|
681
716
|
),
|
|
717
|
+
onPointerDownCapture: (p) => {
|
|
718
|
+
var _, c;
|
|
719
|
+
(c = (_ = p.target) == null ? void 0 : _.closest) != null && c.call(_, "[data-usage-header]") || ge();
|
|
720
|
+
},
|
|
721
|
+
onFocusCapture: (p) => {
|
|
722
|
+
var _, c;
|
|
723
|
+
(c = (_ = p.target) == null ? void 0 : _.closest) != null && c.call(_, "[data-usage-header]") || ge();
|
|
724
|
+
},
|
|
682
725
|
children: [
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
{
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
726
|
+
Be && !oe && /* @__PURE__ */ e(ln, { layoutId: Number($), collection: l, sectionKey: t.key }),
|
|
727
|
+
gt(
|
|
728
|
+
/* @__PURE__ */ x(
|
|
729
|
+
"button",
|
|
730
|
+
{
|
|
731
|
+
type: "button",
|
|
732
|
+
"data-usage-header": "",
|
|
733
|
+
onClick: mt,
|
|
734
|
+
"data-design-group-header": F ? "" : void 0,
|
|
735
|
+
className: W(
|
|
736
|
+
"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",
|
|
737
|
+
// Round the bottom only when nothing renders below the header — an
|
|
738
|
+
// expanded body (or collapsed summary strip) square-joins it, and a
|
|
739
|
+
// rounded hover overlay would leave see-through notches at the seam.
|
|
740
|
+
z && !(D && D.length > 0) && "rounded-b-xl"
|
|
741
|
+
),
|
|
742
|
+
children: [
|
|
743
|
+
Te && /* @__PURE__ */ e(Te, { className: "h-3.5 w-3.5 shrink-0 text-slate-400 dark:text-slate-500" }),
|
|
744
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-[13px] shrink-0 text-slate-800 dark:text-slate-200", children: t.label }),
|
|
745
|
+
/* @__PURE__ */ e("span", { className: "flex-1" }),
|
|
746
|
+
pt && /* @__PURE__ */ e("span", { className: "nvr-pop h-2 w-2 rounded-full bg-destructive shrink-0" }),
|
|
747
|
+
/* @__PURE__ */ e(
|
|
748
|
+
St,
|
|
749
|
+
{
|
|
750
|
+
"data-design-pass": F ? "" : void 0,
|
|
751
|
+
className: W(
|
|
752
|
+
"h-4 w-4 text-slate-400 dark:text-slate-500 transition-transform duration-200",
|
|
753
|
+
z && "-rotate-90"
|
|
754
|
+
)
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
]
|
|
758
|
+
}
|
|
759
|
+
)
|
|
713
760
|
),
|
|
714
|
-
|
|
715
|
-
|
|
761
|
+
z && D && D.length > 0 && /* @__PURE__ */ e(
|
|
762
|
+
sn,
|
|
716
763
|
{
|
|
717
|
-
summaryFields:
|
|
764
|
+
summaryFields: D,
|
|
718
765
|
fields: r,
|
|
719
766
|
draft: i,
|
|
720
|
-
relations:
|
|
721
|
-
collection:
|
|
767
|
+
relations: s,
|
|
768
|
+
collection: l,
|
|
722
769
|
itemId: n,
|
|
723
|
-
ownersCollection:
|
|
724
|
-
ownersItemId:
|
|
725
|
-
ownersAssignment:
|
|
726
|
-
m2mCounts:
|
|
727
|
-
o2mCounts:
|
|
728
|
-
o2mAggValues:
|
|
729
|
-
summaryAggConfigs:
|
|
730
|
-
o2mLoading:
|
|
731
|
-
hideEmpty: !!t.summary_hide_empty || !!
|
|
770
|
+
ownersCollection: A,
|
|
771
|
+
ownersItemId: I,
|
|
772
|
+
ownersAssignment: j,
|
|
773
|
+
m2mCounts: J,
|
|
774
|
+
o2mCounts: R,
|
|
775
|
+
o2mAggValues: me,
|
|
776
|
+
summaryAggConfigs: N,
|
|
777
|
+
o2mLoading: U,
|
|
778
|
+
hideEmpty: !!t.summary_hide_empty || !!G
|
|
732
779
|
}
|
|
733
780
|
),
|
|
734
|
-
|
|
735
|
-
|
|
781
|
+
z && !se && t.hide_when_empty && te.length > 0 && /* @__PURE__ */ e("div", { className: "hidden", children: te.filter((p) => p.widget_id != null).map((p) => /* @__PURE__ */ e(
|
|
782
|
+
Ae,
|
|
736
783
|
{
|
|
737
|
-
widgetId:
|
|
738
|
-
inputBindings:
|
|
784
|
+
widgetId: p.widget_id,
|
|
785
|
+
inputBindings: Qe(p.input_bindings),
|
|
739
786
|
itemDraft: i,
|
|
740
787
|
frameless: !0,
|
|
741
|
-
apiBase:
|
|
742
|
-
onContentChange: (
|
|
743
|
-
(
|
|
788
|
+
apiBase: E,
|
|
789
|
+
onContentChange: (_) => Le(
|
|
790
|
+
(c) => c[p.field] === _ ? c : { ...c, [p.field]: _ }
|
|
744
791
|
)
|
|
745
792
|
},
|
|
746
|
-
|
|
793
|
+
p.field
|
|
747
794
|
)) }),
|
|
748
|
-
!
|
|
795
|
+
!z && /* @__PURE__ */ x("div", { className: "nvr-expand-in border-t border-slate-100 px-5 py-4", children: [
|
|
796
|
+
!o && /* @__PURE__ */ e(Zt, { group: t, className: "mb-3" }),
|
|
749
797
|
(() => {
|
|
750
|
-
const
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
})
|
|
756
|
-
|
|
798
|
+
const p = qt(ht, {
|
|
799
|
+
rows: o ? [] : Tt(t.swap_config).rows,
|
|
800
|
+
folded: (c) => !o && Ut(c._overrides),
|
|
801
|
+
keep: (c) => !!c.required,
|
|
802
|
+
filled: (c) => !Bt(i[c.field]) || !!a[c.field]
|
|
803
|
+
}), _ = p.units.map(
|
|
804
|
+
(c) => c.kind === "row" ? {
|
|
805
|
+
_k: `row:${c.row.key}`,
|
|
806
|
+
sort: c.members[0].sort ?? 0,
|
|
807
|
+
_t: "row",
|
|
808
|
+
row: c.row,
|
|
809
|
+
members: c.members
|
|
810
|
+
} : { _k: c.field.field, sort: c.field.sort ?? 0, _t: "field", f: c.field }
|
|
811
|
+
);
|
|
812
|
+
j && _.push({
|
|
757
813
|
_k: "__owners__",
|
|
758
|
-
sort:
|
|
814
|
+
sort: j.sort,
|
|
759
815
|
_t: "owners",
|
|
760
|
-
slot:
|
|
761
|
-
}),
|
|
816
|
+
slot: j
|
|
817
|
+
}), M && _.push({
|
|
762
818
|
_k: "__pdf__",
|
|
763
|
-
sort:
|
|
819
|
+
sort: M.sort,
|
|
764
820
|
_t: "pdf",
|
|
765
|
-
slot:
|
|
821
|
+
slot: M
|
|
766
822
|
});
|
|
767
|
-
for (const
|
|
768
|
-
|
|
769
|
-
return
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
823
|
+
for (const c of K ?? [])
|
|
824
|
+
_.push({ _k: c.field, sort: c.sort, _t: "widget", slot: c });
|
|
825
|
+
return _.sort((c, O) => c.sort - O.sort), F && _.length === 0 && p.folded.length === 0 ? /* @__PURE__ */ e(Mt, {}) : o ? /* @__PURE__ */ x(
|
|
826
|
+
"div",
|
|
827
|
+
{
|
|
828
|
+
ref: xe,
|
|
829
|
+
className: W(F && "relative", "grid grid-cols-12 gap-x-6 gap-y-3"),
|
|
830
|
+
children: [
|
|
831
|
+
/* @__PURE__ */ e(we, { gapClass: "gap-x-6" }),
|
|
832
|
+
_.map((c) => {
|
|
833
|
+
if (c._t === "owners") {
|
|
834
|
+
const v = c.slot.col_span ?? 12;
|
|
835
|
+
return H(
|
|
836
|
+
ae("__owners__"),
|
|
837
|
+
/* @__PURE__ */ e(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
className: "min-w-0",
|
|
841
|
+
style: { gridColumn: `span ${v}` },
|
|
842
|
+
children: /* @__PURE__ */ e(
|
|
843
|
+
Ye,
|
|
844
|
+
{
|
|
845
|
+
collection: l,
|
|
846
|
+
itemId: n,
|
|
847
|
+
label: c.slot.label_override || "Owners"
|
|
848
|
+
}
|
|
849
|
+
)
|
|
850
|
+
},
|
|
851
|
+
"__owners__"
|
|
852
|
+
)
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
if (c._t === "pdf" || c._t === "widget" || c._t === "row") return null;
|
|
856
|
+
const O = c.f, b = s.find(
|
|
857
|
+
(v) => v.many_collection === l && v.many_field === O.field && !v.junction_field
|
|
858
|
+
);
|
|
859
|
+
return H(
|
|
860
|
+
{ kind: "field", field: O.field, group_key: t.key },
|
|
861
|
+
/* @__PURE__ */ x(
|
|
862
|
+
"div",
|
|
781
863
|
{
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
864
|
+
className: "min-w-0",
|
|
865
|
+
style: { gridColumn: `span ${Ee(O.options, ye)}` },
|
|
866
|
+
children: [
|
|
867
|
+
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: O.label || lt(O.field) }),
|
|
868
|
+
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (b == null ? void 0 : b.one_collection) === "nivaro_users" ? (() => {
|
|
869
|
+
const v = i[O.field], P = Array.isArray(v) ? v : v != null && v !== "" ? [v] : [];
|
|
870
|
+
return P.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: P.map((T) => /* @__PURE__ */ e(at, { userId: String(T) }, String(T))) });
|
|
871
|
+
})() : b != null && b.one_collection ? /* @__PURE__ */ e(re, { relCollection: b.one_collection, id: i[O.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: ke(i[O.field], O) }) })
|
|
872
|
+
]
|
|
873
|
+
},
|
|
874
|
+
O.field
|
|
786
875
|
)
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
);
|
|
876
|
+
);
|
|
877
|
+
})
|
|
878
|
+
]
|
|
791
879
|
}
|
|
792
|
-
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
/* @__PURE__ */ N(
|
|
799
|
-
"div",
|
|
800
|
-
{
|
|
801
|
-
className: "min-w-0",
|
|
802
|
-
style: { gridColumn: `span ${Ue(y.options, xe)}` },
|
|
803
|
-
children: [
|
|
804
|
-
/* @__PURE__ */ e("dt", { className: "text-[11px] font-medium text-slate-400 truncate", children: y.label || Ke(y.field) }),
|
|
805
|
-
/* @__PURE__ */ e("dd", { className: "mt-0.5 break-words", children: (O == null ? void 0 : O.one_collection) === "nivaro_users" ? (() => {
|
|
806
|
-
const D = i[y.field], X = Array.isArray(D) ? D : D != null && D !== "" ? [D] : [];
|
|
807
|
-
return X.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: X.map((z) => /* @__PURE__ */ e(Ge, { userId: String(z) }, String(z))) });
|
|
808
|
-
})() : O != null && O.one_collection ? /* @__PURE__ */ e(Q, { relCollection: O.one_collection, id: i[y.field] }) : /* @__PURE__ */ e("span", { className: "text-[13px] text-slate-700", children: de(i[y.field], y) }) })
|
|
809
|
-
]
|
|
810
|
-
},
|
|
811
|
-
y.field
|
|
812
|
-
)
|
|
813
|
-
);
|
|
814
|
-
}) }) : /* @__PURE__ */ e("div", { ref: ae, className: "grid grid-cols-12 gap-4 items-start", children: x.map((s) => {
|
|
815
|
-
var $e, Fe;
|
|
816
|
-
if (s._t === "owners") {
|
|
817
|
-
const S = s.slot.col_span ?? 12;
|
|
818
|
-
return W(
|
|
819
|
-
Z("__owners__"),
|
|
820
|
-
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
821
|
-
Ie,
|
|
880
|
+
) : (() => {
|
|
881
|
+
const c = (b) => {
|
|
882
|
+
var ze, Ke;
|
|
883
|
+
if (b._t === "row")
|
|
884
|
+
return /* @__PURE__ */ e(
|
|
885
|
+
Ht,
|
|
822
886
|
{
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
887
|
+
row: b.row,
|
|
888
|
+
members: b.members,
|
|
889
|
+
containerWidth: ye,
|
|
890
|
+
errors: a,
|
|
891
|
+
renderMember: (w) => H(
|
|
892
|
+
{ kind: "field", field: w.field, group_key: t.key },
|
|
893
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
894
|
+
ve,
|
|
895
|
+
{
|
|
896
|
+
field: Wt(w),
|
|
897
|
+
draft: i,
|
|
898
|
+
onChange: u,
|
|
899
|
+
relations: s,
|
|
900
|
+
collection: l,
|
|
901
|
+
itemId: n,
|
|
902
|
+
error: a[w.field],
|
|
903
|
+
visible: m.has(w.field) || !m.size,
|
|
904
|
+
forceVisible: Ne(w) || void 0,
|
|
905
|
+
locked: h.has(w.field),
|
|
906
|
+
layoutAiEnabled: k,
|
|
907
|
+
renderField: g,
|
|
908
|
+
onCountChange: f
|
|
909
|
+
}
|
|
910
|
+
) }, w.field)
|
|
911
|
+
)
|
|
912
|
+
},
|
|
913
|
+
b._k
|
|
914
|
+
);
|
|
915
|
+
if (b._t === "owners") {
|
|
916
|
+
const w = b.slot.col_span ?? 12;
|
|
917
|
+
return H(
|
|
918
|
+
ae("__owners__"),
|
|
919
|
+
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
920
|
+
Ye,
|
|
921
|
+
{
|
|
922
|
+
collection: l,
|
|
923
|
+
itemId: n,
|
|
924
|
+
label: b.slot.label_override || "Owners"
|
|
925
|
+
}
|
|
926
|
+
) }, "__owners__")
|
|
927
|
+
);
|
|
928
|
+
}
|
|
929
|
+
if (b._t === "pdf") {
|
|
930
|
+
if (!$) return null;
|
|
931
|
+
const w = b.slot.col_span ?? 12, C = ((ze = b.slot.label_override) == null ? void 0 : ze.trim()) || "Generate PDF";
|
|
932
|
+
return H(
|
|
933
|
+
ae("__pdf__"),
|
|
934
|
+
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
935
|
+
nn,
|
|
936
|
+
{
|
|
937
|
+
collection: l,
|
|
938
|
+
itemId: n,
|
|
939
|
+
layoutId: $,
|
|
940
|
+
attachField: d ?? null,
|
|
941
|
+
filenameTemplate: B,
|
|
942
|
+
label: C
|
|
943
|
+
}
|
|
944
|
+
) }, "__pdf__")
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
if (b._t === "widget") {
|
|
948
|
+
if (!b.slot.widget_id) return null;
|
|
949
|
+
const w = b.slot.col_span ?? 12, C = Qe(b.slot.input_bindings);
|
|
950
|
+
return H(
|
|
951
|
+
ae(b.slot.field),
|
|
952
|
+
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${w}` }, children: /* @__PURE__ */ e(
|
|
953
|
+
Ae,
|
|
954
|
+
{
|
|
955
|
+
widgetId: b.slot.widget_id,
|
|
956
|
+
inputBindings: C,
|
|
957
|
+
itemDraft: i,
|
|
958
|
+
label: b.slot.label_override ?? void 0,
|
|
959
|
+
defaultExpanded: b.slot.default_expanded ?? !0,
|
|
960
|
+
frameless: !0,
|
|
961
|
+
apiBase: E,
|
|
962
|
+
onContentChange: (He) => Le(
|
|
963
|
+
(_e) => _e[b.slot.field] === He ? _e : { ..._e, [b.slot.field]: He }
|
|
964
|
+
)
|
|
965
|
+
}
|
|
966
|
+
) }, b.slot.field)
|
|
967
|
+
);
|
|
968
|
+
}
|
|
969
|
+
const v = b.f, P = Y == null ? void 0 : Y[v.field], T = P == null ? void 0 : P.entries, xt = (P == null ? void 0 : P.separator) ?? null, ce = i[v.field], Ge = ce != null && ce !== "", Ve = T != null && T.length && Ge ? ((Ke = s.find(
|
|
970
|
+
(w) => w.many_collection === l && w.many_field === v.field && !w.junction_field
|
|
971
|
+
)) == null ? void 0 : Ke.one_collection) ?? null : null, Pe = (V == null ? void 0 : V.enabled) && v.field === V.primary_field, Ce = (() => {
|
|
972
|
+
const w = i[(V == null ? void 0 : V.primary_field) ?? ""];
|
|
973
|
+
return w != null && w !== "";
|
|
974
|
+
})(), Je = (Z ?? []).some((w) => {
|
|
975
|
+
const C = i[w.field];
|
|
976
|
+
return C != null && C !== "";
|
|
977
|
+
}), yt = Pe && $e ? /* @__PURE__ */ x("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
978
|
+
/* @__PURE__ */ e(
|
|
979
|
+
"button",
|
|
980
|
+
{
|
|
981
|
+
type: "button",
|
|
982
|
+
onClick: $e,
|
|
983
|
+
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",
|
|
984
|
+
children: De ? V.back_label ?? "Back" : V.toggle_label ?? "Enter manually"
|
|
826
985
|
}
|
|
827
|
-
)
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
if (s._t === "pdf") {
|
|
831
|
-
if (!F) return null;
|
|
832
|
-
const S = s.slot.col_span ?? 12, J = (($e = s.slot.label_override) == null ? void 0 : $e.trim()) || "Generate PDF";
|
|
833
|
-
return W(
|
|
834
|
-
Z("__pdf__"),
|
|
835
|
-
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
836
|
-
vt,
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ x(
|
|
988
|
+
"span",
|
|
837
989
|
{
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
990
|
+
className: [
|
|
991
|
+
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
992
|
+
Ce ? "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"
|
|
993
|
+
].join(" "),
|
|
994
|
+
title: "Original field",
|
|
995
|
+
children: [
|
|
996
|
+
/* @__PURE__ */ e(
|
|
997
|
+
"span",
|
|
998
|
+
{
|
|
999
|
+
className: [
|
|
1000
|
+
"h-1.5 w-1.5 rounded-full",
|
|
1001
|
+
Ce ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1002
|
+
].join(" ")
|
|
1003
|
+
}
|
|
1004
|
+
),
|
|
1005
|
+
"Original"
|
|
1006
|
+
]
|
|
844
1007
|
}
|
|
845
|
-
)
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
if (s._t === "widget") {
|
|
849
|
-
if (!s.slot.widget_id) return null;
|
|
850
|
-
const S = s.slot.col_span ?? 12, J = Te(s.slot.input_bindings);
|
|
851
|
-
return W(
|
|
852
|
-
Z(s.slot.field),
|
|
853
|
-
/* @__PURE__ */ e("div", { style: { gridColumn: `span ${S}` }, children: /* @__PURE__ */ e(
|
|
854
|
-
Le,
|
|
1008
|
+
),
|
|
1009
|
+
/* @__PURE__ */ x(
|
|
1010
|
+
"span",
|
|
855
1011
|
{
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1012
|
+
className: [
|
|
1013
|
+
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
1014
|
+
Je ? "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"
|
|
1015
|
+
].join(" "),
|
|
1016
|
+
title: "Manual fields",
|
|
1017
|
+
children: [
|
|
1018
|
+
/* @__PURE__ */ e(
|
|
1019
|
+
"span",
|
|
1020
|
+
{
|
|
1021
|
+
className: [
|
|
1022
|
+
"h-1.5 w-1.5 rounded-full",
|
|
1023
|
+
Je ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
1024
|
+
].join(" ")
|
|
1025
|
+
}
|
|
1026
|
+
),
|
|
1027
|
+
"Manual"
|
|
1028
|
+
]
|
|
866
1029
|
}
|
|
867
|
-
)
|
|
868
|
-
)
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
|
|
890
|
-
{
|
|
891
|
-
className: [
|
|
892
|
-
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
893
|
-
Se ? "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"
|
|
894
|
-
].join(" "),
|
|
895
|
-
title: "Original field",
|
|
896
|
-
children: [
|
|
897
|
-
/* @__PURE__ */ e(
|
|
898
|
-
"span",
|
|
899
|
-
{
|
|
900
|
-
className: [
|
|
901
|
-
"h-1.5 w-1.5 rounded-full",
|
|
902
|
-
Se ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
903
|
-
].join(" ")
|
|
904
|
-
}
|
|
905
|
-
),
|
|
906
|
-
"Original"
|
|
907
|
-
]
|
|
908
|
-
}
|
|
909
|
-
),
|
|
910
|
-
/* @__PURE__ */ N(
|
|
911
|
-
"span",
|
|
912
|
-
{
|
|
913
|
-
className: [
|
|
914
|
-
"inline-flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-medium",
|
|
915
|
-
ke ? "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"
|
|
916
|
-
].join(" "),
|
|
917
|
-
title: "Manual fields",
|
|
918
|
-
children: [
|
|
919
|
-
/* @__PURE__ */ e(
|
|
920
|
-
"span",
|
|
921
|
-
{
|
|
922
|
-
className: [
|
|
923
|
-
"h-1.5 w-1.5 rounded-full",
|
|
924
|
-
ke ? "bg-emerald-500" : "bg-slate-300 dark:bg-slate-600"
|
|
925
|
-
].join(" ")
|
|
926
|
-
}
|
|
927
|
-
),
|
|
928
|
-
"Manual"
|
|
929
|
-
]
|
|
930
|
-
}
|
|
931
|
-
)
|
|
932
|
-
] }) : void 0, Ze = ve && ue && (E != null && E.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: E.map((S) => {
|
|
933
|
-
const J = (le == null ? void 0 : le[S.field]) ?? 2;
|
|
934
|
-
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${J}` }, children: /* @__PURE__ */ e(
|
|
935
|
-
Be,
|
|
1030
|
+
)
|
|
1031
|
+
] }) : void 0, Nt = Pe && De && (Z != null && Z.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: Z.map((w) => {
|
|
1032
|
+
const C = (pe == null ? void 0 : pe[w.field]) ?? 2;
|
|
1033
|
+
return /* @__PURE__ */ e("div", { style: { gridColumn: `span ${C}` }, children: /* @__PURE__ */ e(
|
|
1034
|
+
ve,
|
|
1035
|
+
{
|
|
1036
|
+
field: w,
|
|
1037
|
+
draft: i,
|
|
1038
|
+
onChange: u,
|
|
1039
|
+
relations: s,
|
|
1040
|
+
collection: l,
|
|
1041
|
+
itemId: n,
|
|
1042
|
+
error: a[w.field],
|
|
1043
|
+
visible: !0,
|
|
1044
|
+
forceVisible: !0,
|
|
1045
|
+
locked: h.has(w.field),
|
|
1046
|
+
layoutAiEnabled: k,
|
|
1047
|
+
renderField: g,
|
|
1048
|
+
onCountChange: f
|
|
1049
|
+
}
|
|
1050
|
+
) }, w.field);
|
|
1051
|
+
}) }) }) : void 0, Re = /* @__PURE__ */ e(
|
|
1052
|
+
ve,
|
|
936
1053
|
{
|
|
937
|
-
field:
|
|
1054
|
+
field: v,
|
|
938
1055
|
draft: i,
|
|
939
1056
|
onChange: u,
|
|
940
|
-
relations:
|
|
941
|
-
collection:
|
|
1057
|
+
relations: s,
|
|
1058
|
+
collection: l,
|
|
942
1059
|
itemId: n,
|
|
943
|
-
error:
|
|
944
|
-
visible: !
|
|
945
|
-
forceVisible:
|
|
946
|
-
locked:
|
|
947
|
-
layoutAiEnabled:
|
|
948
|
-
renderField:
|
|
949
|
-
onCountChange:
|
|
1060
|
+
error: a[v.field],
|
|
1061
|
+
visible: m.has(v.field) || !m.size,
|
|
1062
|
+
forceVisible: Ne(v) || void 0,
|
|
1063
|
+
locked: h.has(v.field),
|
|
1064
|
+
layoutAiEnabled: k,
|
|
1065
|
+
renderField: g,
|
|
1066
|
+
onCountChange: f,
|
|
1067
|
+
swapButton: yt,
|
|
1068
|
+
swapContent: Nt
|
|
950
1069
|
}
|
|
951
|
-
)
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1070
|
+
);
|
|
1071
|
+
return H(
|
|
1072
|
+
{ kind: "field", field: v.field, group_key: t.key },
|
|
1073
|
+
/* @__PURE__ */ x(
|
|
1074
|
+
"div",
|
|
1075
|
+
{
|
|
1076
|
+
style: { gridColumn: `span ${Ee(v.options, ye)}` },
|
|
1077
|
+
children: [
|
|
1078
|
+
Ne(v) ? /* @__PURE__ */ e("div", { "data-design-hidden": "", className: "opacity-40", children: Re }) : Re,
|
|
1079
|
+
(T == null ? void 0 : T.length) && Ge && Ve && /* @__PURE__ */ e(
|
|
1080
|
+
en,
|
|
1081
|
+
{
|
|
1082
|
+
relCollection: Ve,
|
|
1083
|
+
relId: ce,
|
|
1084
|
+
entries: T,
|
|
1085
|
+
separator: xt
|
|
1086
|
+
}
|
|
1087
|
+
)
|
|
1088
|
+
]
|
|
1089
|
+
},
|
|
1090
|
+
v.field
|
|
1091
|
+
)
|
|
1092
|
+
);
|
|
1093
|
+
}, O = p.folded.map((b) => ({
|
|
1094
|
+
_k: b.field,
|
|
1095
|
+
sort: b.sort ?? 0,
|
|
1096
|
+
_t: "field",
|
|
1097
|
+
f: b
|
|
1098
|
+
}));
|
|
1099
|
+
return /* @__PURE__ */ x(_t, { children: [
|
|
1100
|
+
/* @__PURE__ */ x(
|
|
975
1101
|
"div",
|
|
976
1102
|
{
|
|
977
|
-
|
|
1103
|
+
ref: xe,
|
|
1104
|
+
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
978
1105
|
children: [
|
|
979
|
-
|
|
980
|
-
(
|
|
981
|
-
_t,
|
|
982
|
-
{
|
|
983
|
-
relCollection: we,
|
|
984
|
-
relId: z,
|
|
985
|
-
entries: D,
|
|
986
|
-
separator: X
|
|
987
|
-
}
|
|
988
|
-
)
|
|
1106
|
+
/* @__PURE__ */ e(we, {}),
|
|
1107
|
+
_.map(c)
|
|
989
1108
|
]
|
|
990
|
-
}
|
|
991
|
-
|
|
1109
|
+
}
|
|
1110
|
+
),
|
|
1111
|
+
/* @__PURE__ */ e(
|
|
1112
|
+
Kt,
|
|
1113
|
+
{
|
|
1114
|
+
count: O.length,
|
|
1115
|
+
open: dt,
|
|
1116
|
+
forcedOpen: p.forcedOpen,
|
|
1117
|
+
design: !!F,
|
|
1118
|
+
onToggle: () => ut((b) => !b),
|
|
1119
|
+
children: /* @__PURE__ */ x(
|
|
1120
|
+
"div",
|
|
1121
|
+
{
|
|
1122
|
+
className: W(F && "relative", "grid grid-cols-12 gap-4 items-start"),
|
|
1123
|
+
children: [
|
|
1124
|
+
/* @__PURE__ */ e(we, {}),
|
|
1125
|
+
O.map(c)
|
|
1126
|
+
]
|
|
1127
|
+
}
|
|
1128
|
+
)
|
|
1129
|
+
}
|
|
992
1130
|
)
|
|
993
|
-
);
|
|
994
|
-
})
|
|
1131
|
+
] });
|
|
1132
|
+
})();
|
|
995
1133
|
})(),
|
|
996
|
-
|
|
1134
|
+
ie && /* @__PURE__ */ e("div", { className: "mt-4", children: ie })
|
|
997
1135
|
] })
|
|
998
1136
|
]
|
|
999
1137
|
}
|
|
1000
1138
|
);
|
|
1001
1139
|
}
|
|
1140
|
+
function ln({
|
|
1141
|
+
layoutId: t,
|
|
1142
|
+
collection: r,
|
|
1143
|
+
sectionKey: i
|
|
1144
|
+
}) {
|
|
1145
|
+
return ne(() => {
|
|
1146
|
+
it({ layoutId: t, collection: r, kind: "shown", key: i });
|
|
1147
|
+
}, [t, r, i]), null;
|
|
1148
|
+
}
|
|
1002
1149
|
export {
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1150
|
+
Ln as GroupSection,
|
|
1151
|
+
en as InlineDisplay,
|
|
1152
|
+
Ye as OwnersInline,
|
|
1153
|
+
Xt as OwnersInlineCompact,
|
|
1154
|
+
re as RelationCell,
|
|
1155
|
+
jn as StripFieldValue,
|
|
1156
|
+
at as UserChip,
|
|
1157
|
+
Bn as UserRosterCluster,
|
|
1158
|
+
ke as formatDisplayValue,
|
|
1159
|
+
rn as useChangePulse
|
|
1013
1160
|
};
|