@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,86 +1,87 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { RefreshCw as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useApiFetchConfig as
|
|
6
|
-
import { useDebounced as
|
|
7
|
-
import { get as
|
|
8
|
-
import { HEADER_CELL_DENSE as
|
|
9
|
-
import { affixesFor as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { jsx as t, jsxs as y, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as Be, useQuery as He } from "@tanstack/react-query";
|
|
3
|
+
import { RefreshCw as Ae, MoreVertical as Fe, MoreHorizontal as Ve, Clipboard as Je, Copy as ze, Clock as Ke, Calendar as Qe, Paperclip as Ge, Folder as Xe, File as Ye, FileText as Ze, Bell as et, Phone as tt, MessageSquare as rt, Mail as nt, UserCheck as lt, UserPlus as at, Users as it, User as st, Activity as ot, Zap as ct, Power as dt, Search as ut, Filter as pt, Sliders as ft, Settings as mt, RotateCcw as ht, Pause as gt, Play as yt, HelpCircle as xt, Info as wt, AlertTriangle as bt, AlertCircle as vt, Flag as _t, Bookmark as Nt, Heart as kt, Star as St, Unlock as Rt, Lock as Lt, EyeOff as $t, Eye as Ct, Send as Et, Upload as jt, Download as Tt, Save as It, Trash2 as Ot, Edit2 as qt, Edit as Dt, Minus as Ut, Plus as At, XCircle as Pt, X as Wt, CheckCircle as Mt, Check as Bt, Share2 as Ht, Link as Ft, ExternalLink as Vt, ArrowUpRight as Jt, ArrowDown as zt, ArrowUp as Kt, ArrowLeft as Qt, ArrowRight as Gt } from "lucide-react";
|
|
4
|
+
import { useState as P, useRef as le, useCallback as Xt, useEffect as re, useMemo as je } from "react";
|
|
5
|
+
import { useApiFetchConfig as xe, useDrilldown as Yt, useOptionalNivaroClient as Zt } from "../context.js";
|
|
6
|
+
import { useDebounced as er } from "../hooks/useDebounced.js";
|
|
7
|
+
import { get as tr, post as rr } from "../lib/commands.js";
|
|
8
|
+
import { HEADER_CELL_DENSE as nr, HEADER_CELL_LIST as lr, HEADER_LABEL as ar, HEADER_VALUE_LINE as ir, HEADER_VALUE_HERO as sr, HEADER_VALUE as or } from "../lib/header-strip.js";
|
|
9
|
+
import { affixesFor as ae, formatWidgetValue as ie } from "../lib/widget-value-format.js";
|
|
10
|
+
import { BackgroundRunOffer as cr } from "./BackgroundRunOffer.js";
|
|
11
|
+
import { cacheStampTip as dr, CacheStamp as ur } from "./CacheStamp.js";
|
|
12
|
+
import { useStagedRelations as pr } from "./item-edit/O2MStagingContext.js";
|
|
13
|
+
import { QueryTable as fr } from "./QueryTable.js";
|
|
14
|
+
import { Button as ne } from "./ui/button.js";
|
|
15
|
+
import { DropdownMenu as Te, DropdownMenuTrigger as Ie, DropdownMenuContent as Oe, DropdownMenuItem as qe } from "./ui/dropdown-menu.js";
|
|
16
|
+
import { reportSlotScalar as mr, ReportSlotWidget as hr } from "./widgets/ReportSlotWidget.js";
|
|
17
|
+
import { ReviewListWidget as gr } from "./widgets/ReviewListWidget.js";
|
|
18
|
+
import { RollupWidget as yr } from "./widgets/RollupWidget.js";
|
|
18
19
|
const Q = {
|
|
19
|
-
ArrowRight:
|
|
20
|
-
ArrowLeft:
|
|
21
|
-
ArrowUp:
|
|
22
|
-
ArrowDown:
|
|
23
|
-
ArrowUpRight:
|
|
24
|
-
ExternalLink:
|
|
25
|
-
Link:
|
|
26
|
-
Share2:
|
|
27
|
-
Check:
|
|
28
|
-
CheckCircle:
|
|
29
|
-
X:
|
|
30
|
-
XCircle:
|
|
31
|
-
Plus:
|
|
32
|
-
Minus:
|
|
33
|
-
Edit:
|
|
34
|
-
Edit2:
|
|
35
|
-
Trash2:
|
|
36
|
-
Save:
|
|
37
|
-
Download:
|
|
38
|
-
Upload:
|
|
39
|
-
Send:
|
|
40
|
-
Eye:
|
|
41
|
-
EyeOff:
|
|
42
|
-
Lock:
|
|
43
|
-
Unlock:
|
|
44
|
-
Star:
|
|
45
|
-
Heart:
|
|
46
|
-
Bookmark:
|
|
47
|
-
Flag:
|
|
48
|
-
AlertCircle:
|
|
49
|
-
AlertTriangle:
|
|
50
|
-
Info:
|
|
51
|
-
HelpCircle:
|
|
52
|
-
Play:
|
|
53
|
-
Pause:
|
|
54
|
-
RefreshCw:
|
|
55
|
-
RotateCcw:
|
|
56
|
-
Settings:
|
|
57
|
-
Sliders:
|
|
58
|
-
Filter:
|
|
59
|
-
Search:
|
|
60
|
-
Power:
|
|
61
|
-
Zap:
|
|
62
|
-
Activity:
|
|
63
|
-
User:
|
|
64
|
-
Users:
|
|
65
|
-
UserPlus:
|
|
66
|
-
UserCheck:
|
|
67
|
-
Mail:
|
|
68
|
-
MessageSquare:
|
|
69
|
-
Phone:
|
|
70
|
-
Bell:
|
|
71
|
-
FileText:
|
|
72
|
-
File:
|
|
73
|
-
Folder:
|
|
74
|
-
Paperclip:
|
|
75
|
-
Calendar:
|
|
76
|
-
Clock:
|
|
77
|
-
Copy:
|
|
78
|
-
Clipboard:
|
|
79
|
-
MoreHorizontal:
|
|
80
|
-
MoreVertical:
|
|
20
|
+
ArrowRight: Gt,
|
|
21
|
+
ArrowLeft: Qt,
|
|
22
|
+
ArrowUp: Kt,
|
|
23
|
+
ArrowDown: zt,
|
|
24
|
+
ArrowUpRight: Jt,
|
|
25
|
+
ExternalLink: Vt,
|
|
26
|
+
Link: Ft,
|
|
27
|
+
Share2: Ht,
|
|
28
|
+
Check: Bt,
|
|
29
|
+
CheckCircle: Mt,
|
|
30
|
+
X: Wt,
|
|
31
|
+
XCircle: Pt,
|
|
32
|
+
Plus: At,
|
|
33
|
+
Minus: Ut,
|
|
34
|
+
Edit: Dt,
|
|
35
|
+
Edit2: qt,
|
|
36
|
+
Trash2: Ot,
|
|
37
|
+
Save: It,
|
|
38
|
+
Download: Tt,
|
|
39
|
+
Upload: jt,
|
|
40
|
+
Send: Et,
|
|
41
|
+
Eye: Ct,
|
|
42
|
+
EyeOff: $t,
|
|
43
|
+
Lock: Lt,
|
|
44
|
+
Unlock: Rt,
|
|
45
|
+
Star: St,
|
|
46
|
+
Heart: kt,
|
|
47
|
+
Bookmark: Nt,
|
|
48
|
+
Flag: _t,
|
|
49
|
+
AlertCircle: vt,
|
|
50
|
+
AlertTriangle: bt,
|
|
51
|
+
Info: wt,
|
|
52
|
+
HelpCircle: xt,
|
|
53
|
+
Play: yt,
|
|
54
|
+
Pause: gt,
|
|
55
|
+
RefreshCw: Ae,
|
|
56
|
+
RotateCcw: ht,
|
|
57
|
+
Settings: mt,
|
|
58
|
+
Sliders: ft,
|
|
59
|
+
Filter: pt,
|
|
60
|
+
Search: ut,
|
|
61
|
+
Power: dt,
|
|
62
|
+
Zap: ct,
|
|
63
|
+
Activity: ot,
|
|
64
|
+
User: st,
|
|
65
|
+
Users: it,
|
|
66
|
+
UserPlus: at,
|
|
67
|
+
UserCheck: lt,
|
|
68
|
+
Mail: nt,
|
|
69
|
+
MessageSquare: rt,
|
|
70
|
+
Phone: tt,
|
|
71
|
+
Bell: et,
|
|
72
|
+
FileText: Ze,
|
|
73
|
+
File: Ye,
|
|
74
|
+
Folder: Xe,
|
|
75
|
+
Paperclip: Ge,
|
|
76
|
+
Calendar: Qe,
|
|
77
|
+
Clock: Ke,
|
|
78
|
+
Copy: ze,
|
|
79
|
+
Clipboard: Je,
|
|
80
|
+
MoreHorizontal: Ve,
|
|
81
|
+
MoreVertical: Fe
|
|
81
82
|
};
|
|
82
|
-
function
|
|
83
|
-
return /* @__PURE__ */
|
|
83
|
+
function we({ awaiting: n, dark: s }) {
|
|
84
|
+
return /* @__PURE__ */ y(
|
|
84
85
|
"span",
|
|
85
86
|
{
|
|
86
87
|
className: `text-[12px] font-normal italic ${s ? "text-slate-400" : "text-slate-400 dark:text-slate-500"}`,
|
|
@@ -93,34 +94,34 @@ function ye({ awaiting: n, dark: s }) {
|
|
|
93
94
|
}
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
|
-
function
|
|
97
|
+
function fe({
|
|
97
98
|
label: n,
|
|
98
99
|
value: s,
|
|
99
100
|
display: o,
|
|
100
|
-
loading:
|
|
101
|
+
loading: a,
|
|
101
102
|
awaiting: c
|
|
102
103
|
}) {
|
|
103
|
-
const { prefix:
|
|
104
|
+
const { prefix: m, suffix: v } = ae(s, o), w = a ? null : ie(s, o.format ?? "");
|
|
104
105
|
return (
|
|
105
106
|
// Same label / value vocabulary as a field tile in the record sub-header
|
|
106
107
|
// (lib/header-strip.ts) — the two kinds of cell read as one row.
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ y(
|
|
108
109
|
"div",
|
|
109
110
|
{
|
|
110
|
-
className: `flex h-full min-w-0 flex-col justify-start gap-1 px-4 pt-[9px] pb-2 ${
|
|
111
|
+
className: `flex h-full min-w-0 flex-col justify-start gap-1 px-4 pt-[9px] pb-2 ${nr} ${lr}`,
|
|
111
112
|
children: [
|
|
112
|
-
/* @__PURE__ */ t("span", { className:
|
|
113
|
+
/* @__PURE__ */ t("span", { className: ar, "data-header-label": !0, children: n }),
|
|
113
114
|
/* @__PURE__ */ t(
|
|
114
115
|
"span",
|
|
115
116
|
{
|
|
116
117
|
"data-header-value": !0,
|
|
117
|
-
className: `${
|
|
118
|
-
children:
|
|
118
|
+
className: `${ir} max-w-[232px] items-baseline truncate leading-tight`,
|
|
119
|
+
children: a ? /* @__PURE__ */ t("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : c && s == null ? /* @__PURE__ */ t(we, { awaiting: c }) : /* @__PURE__ */ y(
|
|
119
120
|
"span",
|
|
120
121
|
{
|
|
121
|
-
className: String(o.format ?? "").startsWith("currency") || /^[$€£¥]/.test(
|
|
122
|
+
className: String(o.format ?? "").startsWith("currency") || /^[$€£¥]/.test(m) ? sr : or,
|
|
122
123
|
children: [
|
|
123
|
-
|
|
124
|
+
m,
|
|
124
125
|
w,
|
|
125
126
|
v
|
|
126
127
|
]
|
|
@@ -133,18 +134,18 @@ function ue({
|
|
|
133
134
|
)
|
|
134
135
|
);
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function xr({
|
|
137
138
|
data: n,
|
|
138
139
|
label: s,
|
|
139
140
|
loading: o,
|
|
140
|
-
widgetConfig:
|
|
141
|
+
widgetConfig: a,
|
|
141
142
|
awaiting: c
|
|
142
143
|
}) {
|
|
143
|
-
const
|
|
144
|
+
const m = "h-full flex items-stretch divide-x divide-slate-200 dark:divide-border [[data-header-list]_&]:w-full [[data-header-list]_&]:flex-col [[data-header-list]_&]:divide-x-0";
|
|
144
145
|
if (n && "values" in n) {
|
|
145
146
|
const w = n.values ?? [];
|
|
146
|
-
return w.length === 0 ? null : /* @__PURE__ */ t("div", { className:
|
|
147
|
-
|
|
147
|
+
return w.length === 0 ? null : /* @__PURE__ */ t("div", { className: m, children: w.map((_, R) => /* @__PURE__ */ t(
|
|
148
|
+
fe,
|
|
148
149
|
{
|
|
149
150
|
label: _.label,
|
|
150
151
|
value: _.value,
|
|
@@ -152,16 +153,16 @@ function mr({
|
|
|
152
153
|
loading: !1,
|
|
153
154
|
awaiting: c
|
|
154
155
|
},
|
|
155
|
-
|
|
156
|
+
R
|
|
156
157
|
)) });
|
|
157
158
|
}
|
|
158
159
|
if (o) {
|
|
159
|
-
const w = (
|
|
160
|
-
return /* @__PURE__ */ t("div", { className:
|
|
161
|
-
|
|
160
|
+
const w = (a == null ? void 0 : a.value_fields) ?? [], _ = w.length > 0 ? w : [{ label: s }];
|
|
161
|
+
return /* @__PURE__ */ t("div", { className: m, children: _.map((R, $) => /* @__PURE__ */ t(
|
|
162
|
+
fe,
|
|
162
163
|
{
|
|
163
|
-
label:
|
|
164
|
-
display: { prefix:
|
|
164
|
+
label: R.label ?? s,
|
|
165
|
+
display: { prefix: R.prefix ?? "", suffix: R.suffix ?? "", format: R.format ?? "" },
|
|
165
166
|
loading: !0
|
|
166
167
|
},
|
|
167
168
|
$
|
|
@@ -169,8 +170,8 @@ function mr({
|
|
|
169
170
|
}
|
|
170
171
|
if (!n) return null;
|
|
171
172
|
const v = n.display ?? {};
|
|
172
|
-
return /* @__PURE__ */ t("div", { className:
|
|
173
|
-
|
|
173
|
+
return /* @__PURE__ */ t("div", { className: m, children: /* @__PURE__ */ t(
|
|
174
|
+
fe,
|
|
174
175
|
{
|
|
175
176
|
label: s,
|
|
176
177
|
value: n.value,
|
|
@@ -180,167 +181,167 @@ function mr({
|
|
|
180
181
|
}
|
|
181
182
|
) });
|
|
182
183
|
}
|
|
183
|
-
function
|
|
184
|
+
function wr(n, s) {
|
|
184
185
|
if (Object.hasOwn(n, s)) return n[s] ?? null;
|
|
185
186
|
const o = s.split(".");
|
|
186
|
-
let
|
|
187
|
+
let a = n;
|
|
187
188
|
for (const c of o) {
|
|
188
|
-
if (
|
|
189
|
-
|
|
189
|
+
if (a == null || typeof a != "object") return a ?? null;
|
|
190
|
+
a = a[c];
|
|
190
191
|
}
|
|
191
|
-
return
|
|
192
|
+
return a ?? null;
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function br(n, s) {
|
|
194
195
|
const o = {};
|
|
195
|
-
for (const
|
|
196
|
-
if (
|
|
197
|
-
o[
|
|
198
|
-
else if (
|
|
199
|
-
o[
|
|
200
|
-
else if (
|
|
196
|
+
for (const a of n)
|
|
197
|
+
if (a.binding_type === "item_field")
|
|
198
|
+
o[a.key] = wr(s, a.binding_value);
|
|
199
|
+
else if (a.binding_type === "static")
|
|
200
|
+
o[a.key] = a.binding_value;
|
|
201
|
+
else if (a.binding_type === "url_param" && typeof window < "u") {
|
|
201
202
|
const c = new URLSearchParams(window.location.search);
|
|
202
|
-
o[
|
|
203
|
+
o[a.key] = c.get(a.binding_value) ?? null;
|
|
203
204
|
}
|
|
204
205
|
return o;
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function me({
|
|
207
208
|
data: n,
|
|
208
209
|
awaiting: s
|
|
209
210
|
}) {
|
|
210
|
-
if (s && n.value == null) return /* @__PURE__ */ t(
|
|
211
|
-
const o = n.display ?? {}, { prefix:
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
|
|
214
|
-
/* @__PURE__ */ t("span", { className: "text-2xl font-semibold text-slate-900 dark:text-slate-100", children:
|
|
211
|
+
if (s && n.value == null) return /* @__PURE__ */ t(we, { awaiting: s });
|
|
212
|
+
const o = n.display ?? {}, { prefix: a, suffix: c } = ae(n.value, o), m = ie(n.value, o.format ?? "");
|
|
213
|
+
return /* @__PURE__ */ y("div", { className: "flex items-baseline gap-1", children: [
|
|
214
|
+
a && /* @__PURE__ */ t("span", { className: "text-[13px] text-slate-500", children: a }),
|
|
215
|
+
/* @__PURE__ */ t("span", { className: "text-2xl font-semibold text-slate-900 dark:text-slate-100", children: m }),
|
|
215
216
|
c && /* @__PURE__ */ t("span", { className: "text-[13px] text-slate-500", children: c })
|
|
216
217
|
] });
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
+
function he({
|
|
219
220
|
label: n,
|
|
220
221
|
value: s,
|
|
221
222
|
display: o,
|
|
222
|
-
dark:
|
|
223
|
+
dark: a,
|
|
223
224
|
loading: c,
|
|
224
|
-
awaiting:
|
|
225
|
+
awaiting: m
|
|
225
226
|
}) {
|
|
226
|
-
const { prefix: v, suffix: w } =
|
|
227
|
-
return /* @__PURE__ */
|
|
227
|
+
const { prefix: v, suffix: w } = ae(s, o), _ = c ? null : ie(s, o.format ?? "");
|
|
228
|
+
return /* @__PURE__ */ y("div", { className: "flex flex-col justify-center px-2.5 py-1 min-w-0 gap-0.5", children: [
|
|
228
229
|
/* @__PURE__ */ t(
|
|
229
230
|
"span",
|
|
230
231
|
{
|
|
231
|
-
className: `text-[9px] font-medium uppercase tracking-wider leading-none truncate ${
|
|
232
|
+
className: `text-[9px] font-medium uppercase tracking-wider leading-none truncate ${a ? "text-slate-500" : "text-slate-400"}`,
|
|
232
233
|
children: n
|
|
233
234
|
}
|
|
234
235
|
),
|
|
235
236
|
/* @__PURE__ */ t(
|
|
236
237
|
"span",
|
|
237
238
|
{
|
|
238
|
-
className: `flex items-baseline gap-0.5 text-[13px] font-semibold tabular-nums leading-none ${
|
|
239
|
+
className: `flex items-baseline gap-0.5 text-[13px] font-semibold tabular-nums leading-none ${a ? "text-slate-100" : "text-slate-900"}`,
|
|
239
240
|
children: c ? /* @__PURE__ */ t(
|
|
240
241
|
"span",
|
|
241
242
|
{
|
|
242
|
-
className: `animate-pulse inline-block h-3 w-14 rounded ${
|
|
243
|
+
className: `animate-pulse inline-block h-3 w-14 rounded ${a ? "bg-slate-600" : "bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]"}`
|
|
243
244
|
}
|
|
244
|
-
) :
|
|
245
|
-
v && /* @__PURE__ */ t("span", { className: `text-[10px] ${
|
|
245
|
+
) : m && s == null ? /* @__PURE__ */ t(we, { awaiting: m, dark: a }) : /* @__PURE__ */ y(ye, { children: [
|
|
246
|
+
v && /* @__PURE__ */ t("span", { className: `text-[10px] ${a ? "text-slate-400" : "text-slate-500"}`, children: v }),
|
|
246
247
|
_,
|
|
247
|
-
w && /* @__PURE__ */ t("span", { className: `text-[10px] ${
|
|
248
|
+
w && /* @__PURE__ */ t("span", { className: `text-[10px] ${a ? "text-slate-400" : "text-slate-500"}`, children: w })
|
|
248
249
|
] })
|
|
249
250
|
}
|
|
250
251
|
)
|
|
251
252
|
] });
|
|
252
253
|
}
|
|
253
|
-
function
|
|
254
|
+
function vr({
|
|
254
255
|
data: n,
|
|
255
256
|
label: s,
|
|
256
257
|
style: o,
|
|
257
|
-
loading:
|
|
258
|
+
loading: a,
|
|
258
259
|
widgetConfig: c,
|
|
259
|
-
awaiting:
|
|
260
|
+
awaiting: m
|
|
260
261
|
}) {
|
|
261
262
|
const v = o === "pill-dark", w = v ? "flex items-stretch divide-x divide-slate-700 rounded-md bg-slate-800/90 border border-slate-700 overflow-hidden" : "flex items-stretch divide-x divide-slate-200 rounded-md bg-white border border-slate-200 overflow-hidden dark:bg-card dark:border-border dark:divide-border";
|
|
262
263
|
if (n && "values" in n) {
|
|
263
|
-
const
|
|
264
|
-
return
|
|
265
|
-
|
|
264
|
+
const R = n.values ?? [];
|
|
265
|
+
return R.length === 0 ? null : /* @__PURE__ */ t("div", { className: w, children: R.map(($, N) => /* @__PURE__ */ t(
|
|
266
|
+
he,
|
|
266
267
|
{
|
|
267
268
|
label: $.label,
|
|
268
269
|
value: $.value,
|
|
269
270
|
display: $.display ?? {},
|
|
270
271
|
dark: v,
|
|
271
272
|
loading: !1,
|
|
272
|
-
awaiting:
|
|
273
|
+
awaiting: m
|
|
273
274
|
},
|
|
274
275
|
N
|
|
275
276
|
)) });
|
|
276
277
|
}
|
|
277
|
-
if (
|
|
278
|
-
const
|
|
279
|
-
return /* @__PURE__ */ t("div", { className: w, children: $.map((N,
|
|
280
|
-
|
|
278
|
+
if (a) {
|
|
279
|
+
const R = (c == null ? void 0 : c.value_fields) ?? [], $ = R.length > 0 ? R : [{ label: s }];
|
|
280
|
+
return /* @__PURE__ */ t("div", { className: w, children: $.map((N, D) => /* @__PURE__ */ t(
|
|
281
|
+
he,
|
|
281
282
|
{
|
|
282
283
|
label: N.label ?? s,
|
|
283
284
|
display: { prefix: N.prefix ?? "", suffix: N.suffix ?? "", format: N.format ?? "" },
|
|
284
285
|
dark: v,
|
|
285
286
|
loading: !0
|
|
286
287
|
},
|
|
287
|
-
|
|
288
|
+
D
|
|
288
289
|
)) });
|
|
289
290
|
}
|
|
290
291
|
if (!n) return null;
|
|
291
292
|
const _ = n.display ?? {};
|
|
292
293
|
return /* @__PURE__ */ t("div", { className: w, children: /* @__PURE__ */ t(
|
|
293
|
-
|
|
294
|
+
he,
|
|
294
295
|
{
|
|
295
296
|
label: s,
|
|
296
297
|
value: n.value,
|
|
297
298
|
display: _,
|
|
298
299
|
dark: v,
|
|
299
300
|
loading: !1,
|
|
300
|
-
awaiting:
|
|
301
|
+
awaiting: m
|
|
301
302
|
}
|
|
302
303
|
) });
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function De({ data: n }) {
|
|
305
306
|
const s = n.values ?? [];
|
|
306
307
|
return s.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No values" }) : /* @__PURE__ */ t(
|
|
307
308
|
"div",
|
|
308
309
|
{
|
|
309
310
|
className: "grid gap-3",
|
|
310
311
|
style: { gridTemplateColumns: `repeat(${Math.min(s.length, 3)}, minmax(0, 1fr))` },
|
|
311
|
-
children: s.map((o,
|
|
312
|
+
children: s.map((o, a) => {
|
|
312
313
|
var w;
|
|
313
|
-
const { prefix: c, suffix:
|
|
314
|
-
return /* @__PURE__ */
|
|
314
|
+
const { prefix: c, suffix: m } = ae(o.value, o.display), v = ((w = o.display) == null ? void 0 : w.format) ?? "";
|
|
315
|
+
return /* @__PURE__ */ y("div", { className: "flex flex-col gap-0.5", children: [
|
|
315
316
|
o.label && /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-400 dark:text-slate-500", children: o.label }),
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ y("div", { className: "flex items-baseline gap-0.5", children: [
|
|
317
318
|
c && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: c }),
|
|
318
|
-
/* @__PURE__ */ t("span", { className: "text-xl font-semibold text-slate-900 dark:text-slate-100", children:
|
|
319
|
-
|
|
319
|
+
/* @__PURE__ */ t("span", { className: "text-xl font-semibold text-slate-900 dark:text-slate-100", children: ie(o.value, v) }),
|
|
320
|
+
m && /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500", children: m })
|
|
320
321
|
] })
|
|
321
|
-
] },
|
|
322
|
+
] }, a);
|
|
322
323
|
})
|
|
323
324
|
}
|
|
324
325
|
);
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function _r({ data: n }) {
|
|
327
328
|
const s = n.rows ?? [], o = n.fields ?? [];
|
|
328
|
-
return s.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No items" }) : /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100", children: o.map((
|
|
330
|
-
/* @__PURE__ */ t("tbody", { children: s.map((
|
|
329
|
+
return s.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-400", children: "No items" }) : /* @__PURE__ */ t("div", { className: "overflow-x-auto", children: /* @__PURE__ */ y("table", { className: "w-full text-[12px]", children: [
|
|
330
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { className: "border-b border-slate-100", children: o.map((a) => /* @__PURE__ */ t("th", { className: "py-1 pr-3 text-left font-medium text-slate-500", children: a }, a)) }) }),
|
|
331
|
+
/* @__PURE__ */ t("tbody", { children: s.map((a, c) => /* @__PURE__ */ t("tr", { className: "border-b border-slate-50", children: o.map((m) => /* @__PURE__ */ t("td", { className: "py-1 pr-3 text-slate-700", children: String(a[m] ?? "") }, m)) }, c)) })
|
|
331
332
|
] }) });
|
|
332
333
|
}
|
|
333
|
-
function
|
|
334
|
+
function Ue({
|
|
334
335
|
data: n,
|
|
335
336
|
widgetId: s,
|
|
336
337
|
inputs: o,
|
|
337
|
-
apiBase:
|
|
338
|
+
apiBase: a,
|
|
338
339
|
onAction: c
|
|
339
340
|
}) {
|
|
340
|
-
const
|
|
341
|
+
const m = n.buttons ?? [], [v, w] = P(null), _ = xe(), R = async ($) => {
|
|
341
342
|
w($);
|
|
342
343
|
try {
|
|
343
|
-
const N = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", C = (await (await fetch(`${
|
|
344
|
+
const N = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", C = (await (await fetch(`${a}/widgets-internal/${s}/action`, {
|
|
344
345
|
method: "POST",
|
|
345
346
|
headers: {
|
|
346
347
|
"Content-Type": "application/json",
|
|
@@ -361,168 +362,168 @@ function Oe({
|
|
|
361
362
|
w(null);
|
|
362
363
|
}
|
|
363
364
|
};
|
|
364
|
-
return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children:
|
|
365
|
-
const
|
|
365
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: m.map(($, N) => {
|
|
366
|
+
const D = $.style ?? "secondary", q = "inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-[12px] font-medium transition-colors disabled:opacity-50", C = D === "primary" ? `${q} bg-nvr-cyan text-white hover:bg-nvr-cyan/90` : D === "danger" ? `${q} bg-red-500 text-white hover:bg-red-600` : `${q} border border-slate-200 bg-white text-slate-700 hover:bg-slate-50`;
|
|
366
367
|
return /* @__PURE__ */ t(
|
|
367
368
|
"button",
|
|
368
369
|
{
|
|
369
370
|
type: "button",
|
|
370
371
|
className: C,
|
|
371
372
|
disabled: v !== null,
|
|
372
|
-
onClick: () =>
|
|
373
|
+
onClick: () => R(N),
|
|
373
374
|
children: v === N ? "…" : String($.label ?? `Action ${N + 1}`)
|
|
374
375
|
},
|
|
375
376
|
N
|
|
376
377
|
);
|
|
377
378
|
}) });
|
|
378
379
|
}
|
|
379
|
-
const
|
|
380
|
-
function
|
|
380
|
+
const Nr = /* @__PURE__ */ new Set(["navigate", "field-update", "flow", "toggle"]);
|
|
381
|
+
function ge({
|
|
381
382
|
buttons: n,
|
|
382
383
|
layout: s,
|
|
383
384
|
widgetId: o,
|
|
384
|
-
inputs:
|
|
385
|
+
inputs: a,
|
|
385
386
|
apiBase: c,
|
|
386
|
-
onClientAction:
|
|
387
|
+
onClientAction: m
|
|
387
388
|
}) {
|
|
388
|
-
const [v, w] =
|
|
389
|
+
const [v, w] = P(null), [_, R] = P(null), [$, N] = P({}), D = le(null), q = xe();
|
|
389
390
|
function C(e) {
|
|
390
391
|
return e === !0 || e === 1 ? "1" : e === !1 || e === 0 ? "0" : String(e ?? "");
|
|
391
392
|
}
|
|
392
|
-
function E(e,
|
|
393
|
-
const d = e.id ?? String(
|
|
394
|
-
return $[d] !== void 0 ? $[d] : e.is_on !== void 0 ? e.is_on : C(
|
|
393
|
+
function E(e, p) {
|
|
394
|
+
const d = e.id ?? String(p);
|
|
395
|
+
return $[d] !== void 0 ? $[d] : e.is_on !== void 0 ? e.is_on : C(a[e.toggle_input ?? ""]) === C(e.toggle_on_value ?? "1");
|
|
395
396
|
}
|
|
396
|
-
function G(e,
|
|
397
|
-
if (e.action !== "toggle") return e.label ?? `Action ${
|
|
398
|
-
const d = e.action_config,
|
|
399
|
-
return E(
|
|
397
|
+
function G(e, p) {
|
|
398
|
+
if (e.action !== "toggle") return e.label ?? `Action ${p + 1}`;
|
|
399
|
+
const d = e.action_config, f = e.toggle_input || (d == null ? void 0 : d.toggle_input) || (d == null ? void 0 : d.field) || "", j = f && f !== e.toggle_input ? { ...e, toggle_input: f } : e;
|
|
400
|
+
return E(j, p) ? e.label_on || e.label || `Action ${p + 1}` : e.label_off || e.label || `Action ${p + 1}`;
|
|
400
401
|
}
|
|
401
|
-
function
|
|
402
|
+
function se(e) {
|
|
402
403
|
try {
|
|
403
404
|
if (e.startsWith("/") && !e.startsWith("//")) return e;
|
|
404
|
-
const
|
|
405
|
-
return ["http:", "https:"].includes(
|
|
405
|
+
const p = new URL(e, window.location.origin);
|
|
406
|
+
return ["http:", "https:"].includes(p.protocol) ? p.toString() : null;
|
|
406
407
|
} catch {
|
|
407
408
|
return null;
|
|
408
409
|
}
|
|
409
410
|
}
|
|
410
|
-
async function r(e,
|
|
411
|
-
const d = e.id ?? String(
|
|
412
|
-
|
|
411
|
+
async function r(e, p) {
|
|
412
|
+
const d = e.id ?? String(p);
|
|
413
|
+
R(d);
|
|
413
414
|
try {
|
|
414
|
-
const
|
|
415
|
+
const f = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "", x = (await (await fetch(`${c}/widgets-internal/${o}/action`, {
|
|
415
416
|
method: "POST",
|
|
416
417
|
headers: {
|
|
417
418
|
"Content-Type": "application/json",
|
|
418
|
-
...
|
|
419
|
-
...
|
|
419
|
+
...q.authHeaders,
|
|
420
|
+
...f ? { "x-workspace": f } : {}
|
|
420
421
|
},
|
|
421
|
-
credentials:
|
|
422
|
-
body: JSON.stringify({ button_index:
|
|
422
|
+
credentials: q.credentials,
|
|
423
|
+
body: JSON.stringify({ button_index: p, inputs: a })
|
|
423
424
|
})).json()).data;
|
|
424
|
-
if (
|
|
425
|
+
if (x != null && x.redirect_url)
|
|
425
426
|
try {
|
|
426
|
-
const
|
|
427
|
-
|
|
427
|
+
const k = new URL(x.redirect_url, window.location.origin);
|
|
428
|
+
k.origin === window.location.origin && (window.location.href = k.toString());
|
|
428
429
|
} catch {
|
|
429
430
|
}
|
|
430
431
|
} finally {
|
|
431
|
-
|
|
432
|
+
R(null);
|
|
432
433
|
}
|
|
433
434
|
}
|
|
434
|
-
function
|
|
435
|
+
function J(e, p) {
|
|
435
436
|
const d = e.action ?? "open-url";
|
|
436
|
-
if (
|
|
437
|
+
if (Nr.has(d)) {
|
|
437
438
|
if (d === "toggle") {
|
|
438
|
-
const
|
|
439
|
-
N((
|
|
439
|
+
const f = e.id ?? String(p);
|
|
440
|
+
N((j) => ({ ...j, [f]: !E(e, p) }));
|
|
440
441
|
}
|
|
441
|
-
r(e,
|
|
442
|
+
r(e, p);
|
|
442
443
|
return;
|
|
443
444
|
}
|
|
444
445
|
if (d === "open-url" && e.url) {
|
|
445
|
-
const
|
|
446
|
-
if (!
|
|
447
|
-
e.new_tab ? window.open(
|
|
446
|
+
const f = se(e.url);
|
|
447
|
+
if (!f) return;
|
|
448
|
+
e.new_tab ? window.open(f, "_blank", "noopener,noreferrer") : window.location.href = f;
|
|
448
449
|
} else if (d === "email") {
|
|
449
|
-
const
|
|
450
|
-
e.email_subject &&
|
|
450
|
+
const f = [];
|
|
451
|
+
e.email_subject && f.push(`subject=${encodeURIComponent(e.email_subject)}`), e.email_body && f.push(`body=${encodeURIComponent(e.email_body)}`), window.location.href = `mailto:${e.email_to ?? ""}${f.length ? `?${f.join("&")}` : ""}`;
|
|
451
452
|
} else if (d === "copy") {
|
|
452
|
-
const
|
|
453
|
-
navigator.clipboard.writeText(
|
|
454
|
-
w(e.id ?? String(
|
|
453
|
+
const f = e.copy_value ?? "";
|
|
454
|
+
navigator.clipboard.writeText(f).then(() => {
|
|
455
|
+
w(e.id ?? String(p)), D.current && clearTimeout(D.current), D.current = setTimeout(() => w(null), 1800);
|
|
455
456
|
});
|
|
456
|
-
} else d === "open-sidebar" && e.sidebar_collection && e.sidebar_id && (
|
|
457
|
+
} else d === "open-sidebar" && e.sidebar_collection && e.sidebar_id && (m == null || m({
|
|
457
458
|
type: "open-sidebar",
|
|
458
459
|
collection: e.sidebar_collection,
|
|
459
460
|
itemId: e.sidebar_id
|
|
460
461
|
}));
|
|
461
462
|
}
|
|
462
463
|
function i(e) {
|
|
463
|
-
const
|
|
464
|
-
if (
|
|
465
|
-
const d = parseInt(
|
|
466
|
-
return (d * 299 +
|
|
464
|
+
const p = e.replace("#", "");
|
|
465
|
+
if (p.length < 6) return !0;
|
|
466
|
+
const d = parseInt(p.slice(0, 2), 16), f = parseInt(p.slice(2, 4), 16), j = parseInt(p.slice(4, 6), 16);
|
|
467
|
+
return (d * 299 + f * 587 + j * 114) / 1e3 > 128;
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
-
const
|
|
470
|
-
let
|
|
471
|
-
const
|
|
469
|
+
function Y(e, p, d) {
|
|
470
|
+
const f = e.id ?? String(p), j = v === f, U = _ === f;
|
|
471
|
+
let x = e.label ?? "Button", k = e.variant ?? "secondary";
|
|
472
|
+
const W = e.action_config, A = e.toggle_input || (W == null ? void 0 : W.toggle_input) || (W == null ? void 0 : W.field) || "";
|
|
472
473
|
if (e.action === "toggle") {
|
|
473
|
-
const I =
|
|
474
|
-
|
|
474
|
+
const I = A && A !== e.toggle_input ? { ...e, toggle_input: A } : e, H = E(I, p);
|
|
475
|
+
x = H ? e.label_on || x : e.label_off || x, k = H ? e.variant_on ?? k : e.variant_off ?? k;
|
|
475
476
|
}
|
|
476
|
-
const
|
|
477
|
+
const B = e.icon ? Q[e.icon] : null, L = e.color ? {
|
|
477
478
|
backgroundColor: e.color,
|
|
478
479
|
borderColor: e.color,
|
|
479
480
|
color: i(e.color) ? "#1e293b" : "#ffffff"
|
|
480
481
|
} : void 0;
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
|
|
482
|
+
return /* @__PURE__ */ y(
|
|
483
|
+
ne,
|
|
483
484
|
{
|
|
484
485
|
type: "button",
|
|
485
|
-
variant:
|
|
486
|
+
variant: k,
|
|
486
487
|
size: "sm",
|
|
487
488
|
className: "h-7 gap-1.5 text-[12px]",
|
|
488
|
-
style:
|
|
489
|
+
style: L,
|
|
489
490
|
disabled: _ !== null,
|
|
490
|
-
onClick: () =>
|
|
491
|
+
onClick: () => J(e, p),
|
|
491
492
|
children: [
|
|
492
|
-
|
|
493
|
-
|
|
493
|
+
B && /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
494
|
+
U ? "…" : j ? "✓ Copied" : x
|
|
494
495
|
]
|
|
495
496
|
},
|
|
496
|
-
|
|
497
|
+
f
|
|
497
498
|
);
|
|
498
499
|
}
|
|
499
500
|
if (n.length === 0) return null;
|
|
500
501
|
if (s === "split" && n.length > 1) {
|
|
501
|
-
const [e, ...
|
|
502
|
-
let
|
|
503
|
-
const
|
|
504
|
-
if (e.action === "toggle" &&
|
|
505
|
-
const
|
|
506
|
-
|
|
502
|
+
const [e, ...p] = n, d = e.id ?? "0", f = _ === d, j = e.action === "none" || !e.action;
|
|
503
|
+
let U = e.label ?? "Button", x = e.variant ?? "default";
|
|
504
|
+
const k = e.action_config, W = e.toggle_input || (k == null ? void 0 : k.toggle_input) || (k == null ? void 0 : k.field) || "";
|
|
505
|
+
if (e.action === "toggle" && W) {
|
|
506
|
+
const L = W !== e.toggle_input ? { ...e, toggle_input: W } : e, I = E(L, 0);
|
|
507
|
+
U = I ? e.label_on || U : e.label_off || U, x = I ? e.variant_on ?? x : e.variant_off ?? x;
|
|
507
508
|
}
|
|
508
|
-
const
|
|
509
|
+
const A = e.icon ? Q[e.icon] : null, B = e.color ? {
|
|
509
510
|
backgroundColor: e.color,
|
|
510
511
|
borderColor: e.color,
|
|
511
512
|
color: i(e.color) ? "#1e293b" : "#ffffff"
|
|
512
513
|
} : void 0;
|
|
513
|
-
return
|
|
514
|
-
/* @__PURE__ */ t(
|
|
515
|
-
|
|
514
|
+
return j ? /* @__PURE__ */ t("div", { className: "flex items-center", children: /* @__PURE__ */ y(Te, { children: [
|
|
515
|
+
/* @__PURE__ */ t(Ie, { asChild: !0, children: /* @__PURE__ */ y(
|
|
516
|
+
ne,
|
|
516
517
|
{
|
|
517
518
|
type: "button",
|
|
518
|
-
variant:
|
|
519
|
+
variant: x,
|
|
519
520
|
size: "sm",
|
|
520
521
|
className: "h-7 gap-1.5 text-[12px]",
|
|
521
|
-
style:
|
|
522
|
+
style: B,
|
|
522
523
|
disabled: _ !== null,
|
|
523
524
|
children: [
|
|
524
|
-
|
|
525
|
-
|
|
525
|
+
A && /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
526
|
+
U,
|
|
526
527
|
/* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t(
|
|
527
528
|
"path",
|
|
528
529
|
{
|
|
@@ -536,47 +537,47 @@ function me({
|
|
|
536
537
|
]
|
|
537
538
|
}
|
|
538
539
|
) }),
|
|
539
|
-
/* @__PURE__ */ t(
|
|
540
|
-
|
|
540
|
+
/* @__PURE__ */ t(Oe, { align: "end", className: "min-w-[140px]", children: p.map((L, I) => /* @__PURE__ */ y(
|
|
541
|
+
qe,
|
|
541
542
|
{
|
|
542
543
|
className: "cursor-pointer text-[12px]",
|
|
543
|
-
onSelect: () =>
|
|
544
|
+
onSelect: () => J(L, I + 1),
|
|
544
545
|
children: [
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
return /* @__PURE__ */ t(
|
|
546
|
+
L.icon && Q[L.icon] && (() => {
|
|
547
|
+
const H = Q[L.icon];
|
|
548
|
+
return /* @__PURE__ */ t(H, { className: "mr-1.5 h-3.5 w-3.5 shrink-0" });
|
|
548
549
|
})(),
|
|
549
|
-
G(
|
|
550
|
+
G(L, I + 1)
|
|
550
551
|
]
|
|
551
552
|
},
|
|
552
|
-
|
|
553
|
+
L.id ?? I
|
|
553
554
|
)) })
|
|
554
|
-
] }) }) : /* @__PURE__ */
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
|
|
555
|
+
] }) }) : /* @__PURE__ */ y("div", { className: "flex items-center", children: [
|
|
556
|
+
/* @__PURE__ */ y(
|
|
557
|
+
ne,
|
|
557
558
|
{
|
|
558
559
|
type: "button",
|
|
559
|
-
variant:
|
|
560
|
+
variant: x,
|
|
560
561
|
size: "sm",
|
|
561
562
|
className: "h-7 rounded-r-none text-[12px] gap-1.5 border-r-0",
|
|
562
|
-
style:
|
|
563
|
+
style: B,
|
|
563
564
|
disabled: _ !== null,
|
|
564
|
-
onClick: () =>
|
|
565
|
+
onClick: () => J(e, 0),
|
|
565
566
|
children: [
|
|
566
|
-
|
|
567
|
-
|
|
567
|
+
A && /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
568
|
+
f ? "…" : v === d ? "✓ Copied" : U
|
|
568
569
|
]
|
|
569
570
|
}
|
|
570
571
|
),
|
|
571
|
-
/* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */ t(
|
|
573
|
-
|
|
572
|
+
/* @__PURE__ */ y(Te, { children: [
|
|
573
|
+
/* @__PURE__ */ t(Ie, { asChild: !0, children: /* @__PURE__ */ t(
|
|
574
|
+
ne,
|
|
574
575
|
{
|
|
575
576
|
type: "button",
|
|
576
|
-
variant:
|
|
577
|
+
variant: x,
|
|
577
578
|
size: "sm",
|
|
578
579
|
className: "h-7 rounded-l-none px-1.5 text-[12px]",
|
|
579
|
-
style:
|
|
580
|
+
style: B,
|
|
580
581
|
disabled: _ !== null,
|
|
581
582
|
"aria-label": "More actions",
|
|
582
583
|
children: /* @__PURE__ */ t("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ t(
|
|
@@ -591,259 +592,259 @@ function me({
|
|
|
591
592
|
) })
|
|
592
593
|
}
|
|
593
594
|
) }),
|
|
594
|
-
/* @__PURE__ */ t(
|
|
595
|
-
|
|
595
|
+
/* @__PURE__ */ t(Oe, { align: "end", className: "min-w-[140px]", children: p.map((L, I) => /* @__PURE__ */ y(
|
|
596
|
+
qe,
|
|
596
597
|
{
|
|
597
598
|
className: "text-[12px]",
|
|
598
|
-
onSelect: () =>
|
|
599
|
+
onSelect: () => J(L, I + 1),
|
|
599
600
|
children: [
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
return /* @__PURE__ */ t(
|
|
601
|
+
L.icon && Q[L.icon] && (() => {
|
|
602
|
+
const H = Q[L.icon];
|
|
603
|
+
return /* @__PURE__ */ t(H, { className: "mr-1.5 h-3.5 w-3.5 shrink-0" });
|
|
603
604
|
})(),
|
|
604
|
-
G(
|
|
605
|
+
G(L, I + 1)
|
|
605
606
|
]
|
|
606
607
|
},
|
|
607
|
-
|
|
608
|
+
L.id ?? I
|
|
608
609
|
)) })
|
|
609
610
|
] })
|
|
610
611
|
] });
|
|
611
612
|
}
|
|
612
|
-
return /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: n.map((e,
|
|
613
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-1.5", children: n.map((e, p) => Y(e, p)) });
|
|
613
614
|
}
|
|
614
|
-
function
|
|
615
|
+
function Br({
|
|
615
616
|
widgetId: n,
|
|
616
617
|
inputBindings: s = [],
|
|
617
618
|
itemDraft: o = {},
|
|
618
|
-
itemCollection:
|
|
619
|
+
itemCollection: a,
|
|
619
620
|
ready: c = !0,
|
|
620
|
-
label:
|
|
621
|
+
label: m,
|
|
621
622
|
defaultExpanded: v = !0,
|
|
622
623
|
frameless: w = !1,
|
|
623
624
|
apiBase: _,
|
|
624
|
-
compact:
|
|
625
|
+
compact: R = !1,
|
|
625
626
|
strip: $ = !1,
|
|
626
627
|
onClientAction: N,
|
|
627
|
-
onWidgetType:
|
|
628
|
-
onContentChange:
|
|
628
|
+
onWidgetType: D,
|
|
629
|
+
onContentChange: q
|
|
629
630
|
}) {
|
|
630
|
-
var
|
|
631
|
-
const C =
|
|
632
|
-
|
|
633
|
-
}, []),
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
if (
|
|
637
|
-
let
|
|
638
|
-
const
|
|
631
|
+
var Ce, Ee;
|
|
632
|
+
const C = xe(), E = _ ?? C.apiBase, [G, se] = P(v), [r, J] = P(null), [i, Y] = P(null), [e, p] = P(!0), [d, f] = P(!0), [j, U] = P(!0), [x, k] = P(null), [W, A] = P(0), [B, L] = P(null), I = le(!1), H = Xt(() => {
|
|
633
|
+
I.current = !0, A((l) => l + 1);
|
|
634
|
+
}, []), oe = le(null), ce = le(!1), be = Be();
|
|
635
|
+
re(() => {
|
|
636
|
+
const l = r == null ? void 0 : r.widget_type;
|
|
637
|
+
if (l !== "rollup" && l !== "review_list" && l !== "custom-query") return;
|
|
638
|
+
let u = null;
|
|
639
|
+
const g = be.getQueryCache().subscribe((S) => {
|
|
639
640
|
var K;
|
|
640
641
|
if (S.type !== "updated" || ((K = S.action) == null ? void 0 : K.type) !== "success") return;
|
|
641
|
-
const b = S.query.queryKey,
|
|
642
|
-
typeof
|
|
642
|
+
const b = S.query.queryKey, T = b == null ? void 0 : b[0];
|
|
643
|
+
typeof T == "string" && (!T.startsWith("o2m-rows") && !T.startsWith("nested") && T !== "match-agg" && T !== "m2m-items" || S.query.state.dataUpdateCount <= 1 || T.startsWith("o2m-rows") && oe.current != null && String(b[3]) !== String(oe.current) || (u && clearTimeout(u), u = setTimeout(() => A((te) => te + 1), 400)));
|
|
643
644
|
});
|
|
644
645
|
return () => {
|
|
645
|
-
|
|
646
|
+
u && clearTimeout(u), g();
|
|
646
647
|
};
|
|
647
|
-
}, [
|
|
648
|
-
const
|
|
649
|
-
for (const [
|
|
650
|
-
|
|
651
|
-
const
|
|
652
|
-
if ((r == null ? void 0 : r.widget_type) !== "rollup" || !
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
655
|
-
const
|
|
648
|
+
}, [be, r == null ? void 0 : r.widget_type]);
|
|
649
|
+
const ve = {};
|
|
650
|
+
for (const [l, u] of Object.entries(o))
|
|
651
|
+
l.includes(".") || (u == null || typeof u != "object") && (ve[l] = u);
|
|
652
|
+
const O = { ...ve, ...br(s, o) }, de = pr(), F = je(() => {
|
|
653
|
+
if ((r == null ? void 0 : r.widget_type) !== "rollup" || !de) return null;
|
|
654
|
+
const l = r.config, u = l == null ? void 0 : l.collection;
|
|
655
|
+
if (!u) return null;
|
|
656
|
+
const g = {
|
|
656
657
|
created: [],
|
|
657
658
|
updated: [],
|
|
658
659
|
deleted: []
|
|
659
660
|
};
|
|
660
|
-
for (const S of
|
|
661
|
-
const b = S[
|
|
662
|
-
b && (
|
|
661
|
+
for (const S of de.byGrid.values()) {
|
|
662
|
+
const b = S[u];
|
|
663
|
+
b && (g.created.push(...b.created), g.updated.push(...b.updated), g.deleted.push(...b.deleted));
|
|
663
664
|
}
|
|
664
|
-
return !
|
|
665
|
-
}, [r,
|
|
665
|
+
return !g.created.length && !g.updated.length && !g.deleted.length ? null : g;
|
|
666
|
+
}, [r, de]), Pe = je(
|
|
666
667
|
() => F ? JSON.stringify(F) : "",
|
|
667
668
|
[F]
|
|
668
|
-
), h = (
|
|
669
|
+
), h = (Ce = r == null ? void 0 : r.config) == null ? void 0 : Ce.drilldown, Z = Yt(), ue = h != null && h.id_input ? O[h.id_input] : null, pe = !!Z && !!(h != null && h.collection) && ue != null && ue !== "", _e = async () => {
|
|
669
670
|
var S, b;
|
|
670
|
-
if (!
|
|
671
|
-
const
|
|
672
|
-
let
|
|
673
|
-
const
|
|
671
|
+
if (!pe || !(h != null && h.collection)) return;
|
|
672
|
+
const l = String(ue);
|
|
673
|
+
let u = null;
|
|
674
|
+
const g = (T) => fetch(`${E}${T}`, {
|
|
674
675
|
credentials: C.credentials,
|
|
675
676
|
headers: C.authHeaders
|
|
676
677
|
});
|
|
677
678
|
try {
|
|
678
679
|
if (h.match_field) {
|
|
679
|
-
const
|
|
680
|
+
const T = await g(
|
|
680
681
|
`/items/${h.collection}?filter=${encodeURIComponent(
|
|
681
|
-
JSON.stringify({ [h.match_field]: { _eq:
|
|
682
|
+
JSON.stringify({ [h.match_field]: { _eq: l } })
|
|
682
683
|
)}&fields=id&limit=1`
|
|
683
684
|
);
|
|
684
|
-
if (
|
|
685
|
-
const K = await
|
|
686
|
-
|
|
685
|
+
if (T.ok) {
|
|
686
|
+
const K = await T.json(), te = (b = (S = K == null ? void 0 : K.data) == null ? void 0 : S[0]) == null ? void 0 : b.id;
|
|
687
|
+
te != null && (u = String(te));
|
|
687
688
|
}
|
|
688
689
|
}
|
|
689
|
-
|
|
690
|
+
u == null && (await g(`/items/${h.collection}/${encodeURIComponent(l)}?fields=id`)).ok && (u = l);
|
|
690
691
|
} catch {
|
|
691
692
|
return;
|
|
692
693
|
}
|
|
693
|
-
|
|
694
|
+
u != null && (Z == null || Z.open({
|
|
694
695
|
collection: h.collection,
|
|
695
|
-
itemId:
|
|
696
|
+
itemId: u,
|
|
696
697
|
layoutId: h.layout_id ?? null,
|
|
697
698
|
width: h.width ?? "75%",
|
|
698
699
|
title: h.title
|
|
699
700
|
}));
|
|
700
701
|
};
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
|
|
702
|
+
if (O.record_id == null || O.record_id === "") {
|
|
703
|
+
const l = o.id;
|
|
704
|
+
l != null && l !== "" && (O.record_id = l);
|
|
704
705
|
}
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
function
|
|
708
|
-
const
|
|
706
|
+
oe.current = o.id ?? null;
|
|
707
|
+
const We = JSON.stringify(O) + (a ?? "") + Pe, Me = er(We, 400);
|
|
708
|
+
function Ne() {
|
|
709
|
+
const l = typeof window < "u" ? localStorage.getItem("nivaro_workspace") ?? "" : "";
|
|
709
710
|
return {
|
|
710
711
|
"Content-Type": "application/json",
|
|
711
712
|
...C.authHeaders,
|
|
712
|
-
...
|
|
713
|
+
...l ? { "x-workspace": l } : {}
|
|
713
714
|
};
|
|
714
715
|
}
|
|
715
|
-
const
|
|
716
|
+
const X = Zt(), z = He({
|
|
716
717
|
queryKey: ["nvr-widget-def", n],
|
|
717
718
|
enabled: c,
|
|
718
719
|
staleTime: 6e4,
|
|
719
720
|
retry: !1,
|
|
720
721
|
queryFn: async () => {
|
|
721
|
-
if (
|
|
722
|
-
return (await
|
|
723
|
-
const
|
|
722
|
+
if (X)
|
|
723
|
+
return (await X.request(tr(`/widgets-internal/${n}`))).data;
|
|
724
|
+
const l = await fetch(`${E}/widgets-internal/${n}`, {
|
|
724
725
|
credentials: C.credentials,
|
|
725
|
-
headers:
|
|
726
|
+
headers: Ne()
|
|
726
727
|
});
|
|
727
|
-
if (!
|
|
728
|
-
return (await
|
|
728
|
+
if (!l.ok) throw new Error("Widget not found");
|
|
729
|
+
return (await l.json()).data;
|
|
729
730
|
}
|
|
730
731
|
});
|
|
731
|
-
|
|
732
|
-
c && (
|
|
733
|
-
}, [c,
|
|
732
|
+
re(() => {
|
|
733
|
+
c && (z.data ? (J(z.data), p(!1), k(null), D == null || D(z.data.widget_type)) : z.error && k("Widget not found"));
|
|
734
|
+
}, [c, z.data, z.error]), re(() => {
|
|
734
735
|
if (!c || !r) return;
|
|
735
|
-
const
|
|
736
|
-
if (r.widget_type === "review_list" &&
|
|
737
|
-
let
|
|
738
|
-
return
|
|
736
|
+
const l = O.record_id == null || O.record_id === "";
|
|
737
|
+
if (r.widget_type === "review_list" && l || r.widget_type === "rollup" && l && !F) return;
|
|
738
|
+
let u = !1;
|
|
739
|
+
return ce.current || (f(!0), U(!0)), (async () => {
|
|
739
740
|
try {
|
|
740
|
-
const
|
|
741
|
-
inputs: F ? { ...
|
|
741
|
+
const g = {
|
|
742
|
+
inputs: F ? { ...O, staged: F } : O,
|
|
742
743
|
draft: o,
|
|
743
744
|
bindings: s,
|
|
744
|
-
item_collection:
|
|
745
|
+
item_collection: a
|
|
745
746
|
};
|
|
746
|
-
|
|
747
|
+
I.current && (g.refresh = !0, I.current = !1), L(g);
|
|
747
748
|
let S;
|
|
748
|
-
if (
|
|
749
|
-
S = await
|
|
750
|
-
|
|
749
|
+
if (X)
|
|
750
|
+
S = await X.request(
|
|
751
|
+
rr(`/widgets-internal/${n}/render`, g)
|
|
751
752
|
);
|
|
752
753
|
else {
|
|
753
754
|
const b = await fetch(`${E}/widgets-internal/${n}/render`, {
|
|
754
755
|
method: "POST",
|
|
755
756
|
credentials: C.credentials,
|
|
756
|
-
headers:
|
|
757
|
-
body: JSON.stringify(
|
|
757
|
+
headers: Ne(),
|
|
758
|
+
body: JSON.stringify(g)
|
|
758
759
|
});
|
|
759
760
|
if (!b.ok) throw new Error("Render failed");
|
|
760
761
|
S = await b.json();
|
|
761
762
|
}
|
|
762
|
-
if (
|
|
763
|
-
|
|
764
|
-
} catch (
|
|
765
|
-
|
|
763
|
+
if (u) return;
|
|
764
|
+
u || (ce.current = !0, Y(S.data), f(!1), k(null));
|
|
765
|
+
} catch (g) {
|
|
766
|
+
u || k(String(g));
|
|
766
767
|
} finally {
|
|
767
|
-
|
|
768
|
+
u || U(!1);
|
|
768
769
|
}
|
|
769
770
|
})(), () => {
|
|
770
|
-
|
|
771
|
+
u = !0;
|
|
771
772
|
};
|
|
772
|
-
}, [n, E,
|
|
773
|
-
if (
|
|
774
|
-
if (
|
|
775
|
-
|
|
773
|
+
}, [n, E, Me, c, W, r == null ? void 0 : r.widget_type]), re(() => {
|
|
774
|
+
if (q) {
|
|
775
|
+
if (x) {
|
|
776
|
+
q(!0);
|
|
776
777
|
return;
|
|
777
778
|
}
|
|
778
779
|
if (i) {
|
|
779
780
|
if ((r == null ? void 0 : r.widget_type) === "review_list" || (r == null ? void 0 : r.widget_type) === "rollup") {
|
|
780
|
-
const
|
|
781
|
-
|
|
781
|
+
const l = i.rows;
|
|
782
|
+
q(Array.isArray(l) && l.length > 0);
|
|
782
783
|
return;
|
|
783
784
|
}
|
|
784
785
|
if ((r == null ? void 0 : r.widget_type) === "custom-query" && "rows" in i) {
|
|
785
|
-
const
|
|
786
|
-
|
|
786
|
+
const l = i.rows;
|
|
787
|
+
q(Array.isArray(l) && l.length > 0);
|
|
787
788
|
return;
|
|
788
789
|
}
|
|
789
|
-
|
|
790
|
+
q(!0);
|
|
790
791
|
}
|
|
791
792
|
}
|
|
792
|
-
}, [i,
|
|
793
|
-
const
|
|
794
|
-
const
|
|
795
|
-
if (!Array.isArray(
|
|
796
|
-
const
|
|
797
|
-
const S = s.find((
|
|
798
|
-
return String((S == null ? void 0 : S.binding_value) ??
|
|
793
|
+
}, [i, x, r == null ? void 0 : r.widget_type, q]);
|
|
794
|
+
const V = m || (r == null ? void 0 : r.name) || "", ee = (r == null ? void 0 : r.widget_type) === "report_widget" && i ? mr(i) : i, M = (() => {
|
|
795
|
+
const l = i == null ? void 0 : i.awaiting;
|
|
796
|
+
if (!Array.isArray(l) || l.length === 0) return null;
|
|
797
|
+
const u = l.map((g) => {
|
|
798
|
+
const S = s.find((T) => T.key === g && T.binding_type === "item_field");
|
|
799
|
+
return String((S == null ? void 0 : S.binding_value) ?? g).split(".")[0].replace(/_id$/, "").replace(/_/g, " ").replace(/^\w/, (T) => T.toUpperCase());
|
|
799
800
|
});
|
|
800
|
-
return [...new Set(
|
|
801
|
-
})(),
|
|
802
|
-
if ((r == null ? void 0 : r.widget_type) === "review_list" &&
|
|
803
|
-
if (
|
|
804
|
-
const
|
|
805
|
-
if (
|
|
806
|
-
return /* @__PURE__ */ t("span", { className: "text-[11px] text-red-400", title:
|
|
801
|
+
return [...new Set(u)].join(", ");
|
|
802
|
+
})(), ke = O.record_id, Se = ke == null || ke === "";
|
|
803
|
+
if ((r == null ? void 0 : r.widget_type) === "review_list" && Se || (r == null ? void 0 : r.widget_type) === "rollup" && Se && !F) return null;
|
|
804
|
+
if (R) {
|
|
805
|
+
const l = ((Ee = r == null ? void 0 : r.config) == null ? void 0 : Ee.compact_style) ?? "default", u = l === "pill-dark" || l === "pill-light";
|
|
806
|
+
if (x)
|
|
807
|
+
return /* @__PURE__ */ t("span", { className: "text-[11px] text-red-400", title: x, children: "!" });
|
|
807
808
|
if ($) {
|
|
808
809
|
if (e)
|
|
809
|
-
return /* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ y("div", { className: "flex h-full w-36 flex-col justify-center px-4 py-2.5", children: [
|
|
810
811
|
/* @__PURE__ */ t("span", { className: "animate-pulse h-2 w-10 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] mb-1" }),
|
|
811
812
|
/* @__PURE__ */ t("span", { className: "animate-pulse h-3.5 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
812
813
|
] });
|
|
813
814
|
if (r.widget_type === "button-group")
|
|
814
815
|
return /* @__PURE__ */ t("div", { className: "h-full flex items-center px-3", children: d ? /* @__PURE__ */ t("div", { className: "animate-pulse h-7 w-24 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : i && /* @__PURE__ */ t(
|
|
815
|
-
|
|
816
|
+
ge,
|
|
816
817
|
{
|
|
817
818
|
buttons: i.buttons ?? [],
|
|
818
819
|
layout: i.layout ?? "flat",
|
|
819
820
|
widgetId: n,
|
|
820
|
-
inputs:
|
|
821
|
+
inputs: O,
|
|
821
822
|
apiBase: E,
|
|
822
823
|
onClientAction: N
|
|
823
824
|
}
|
|
824
825
|
) });
|
|
825
826
|
{
|
|
826
|
-
const
|
|
827
|
-
|
|
827
|
+
const g = /* @__PURE__ */ t(
|
|
828
|
+
xr,
|
|
828
829
|
{
|
|
829
|
-
data: d ? null :
|
|
830
|
-
label:
|
|
830
|
+
data: d ? null : ee ?? null,
|
|
831
|
+
label: m || r.name,
|
|
831
832
|
loading: d,
|
|
832
833
|
widgetConfig: r.config,
|
|
833
|
-
awaiting:
|
|
834
|
+
awaiting: M
|
|
834
835
|
}
|
|
835
|
-
), S =
|
|
836
|
+
), S = pe ? /* @__PURE__ */ t(
|
|
836
837
|
"button",
|
|
837
838
|
{
|
|
838
839
|
type: "button",
|
|
839
|
-
onClick: () => void
|
|
840
|
+
onClick: () => void _e(),
|
|
840
841
|
title: (h == null ? void 0 : h.title) ?? "Open details",
|
|
841
842
|
className: "h-full w-full cursor-pointer text-left transition-colors hover:bg-nvr-cyan/5",
|
|
842
843
|
"data-nvr-widget-drill": h == null ? void 0 : h.collection,
|
|
843
|
-
children:
|
|
844
|
+
children: g
|
|
844
845
|
}
|
|
845
|
-
) :
|
|
846
|
-
return b != null && b.cache_ttl ? /* @__PURE__ */
|
|
846
|
+
) : g, b = i == null ? void 0 : i.cache;
|
|
847
|
+
return b != null && b.cache_ttl ? /* @__PURE__ */ y(
|
|
847
848
|
"div",
|
|
848
849
|
{
|
|
849
850
|
className: "group/cache relative h-full w-full",
|
|
@@ -854,13 +855,13 @@ function Ar({
|
|
|
854
855
|
"button",
|
|
855
856
|
{
|
|
856
857
|
type: "button",
|
|
857
|
-
onClick:
|
|
858
|
+
onClick: H,
|
|
858
859
|
disabled: d,
|
|
859
860
|
"data-cache-refresh": !0,
|
|
860
861
|
"aria-label": "Refresh this figure",
|
|
861
|
-
"data-tip":
|
|
862
|
+
"data-tip": dr(b),
|
|
862
863
|
className: "absolute bottom-1 right-1 rounded p-0.5 text-muted-foreground opacity-0 transition-opacity hover:bg-muted group-hover/cache:opacity-100 focus-visible:opacity-100 disabled:opacity-50",
|
|
863
|
-
children: /* @__PURE__ */ t(
|
|
864
|
+
children: /* @__PURE__ */ t(Ae, { className: `h-3 w-3 ${d ? "animate-spin" : ""}` })
|
|
864
865
|
}
|
|
865
866
|
)
|
|
866
867
|
]
|
|
@@ -868,171 +869,186 @@ function Ar({
|
|
|
868
869
|
) : S;
|
|
869
870
|
}
|
|
870
871
|
}
|
|
871
|
-
if (
|
|
872
|
+
if (u) {
|
|
872
873
|
if (e)
|
|
873
874
|
return /* @__PURE__ */ t(
|
|
874
875
|
"div",
|
|
875
876
|
{
|
|
876
|
-
className: `animate-pulse h-8 w-36 rounded-md ${
|
|
877
|
+
className: `animate-pulse h-8 w-36 rounded-md ${l === "pill-dark" ? "bg-slate-700 border border-slate-700" : "bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))] border border-slate-200"}`
|
|
877
878
|
}
|
|
878
879
|
);
|
|
879
880
|
{
|
|
880
|
-
const
|
|
881
|
-
|
|
881
|
+
const g = /* @__PURE__ */ t(
|
|
882
|
+
vr,
|
|
882
883
|
{
|
|
883
|
-
data: d ? null :
|
|
884
|
-
label:
|
|
885
|
-
style:
|
|
884
|
+
data: d ? null : ee ?? null,
|
|
885
|
+
label: m || r.name,
|
|
886
|
+
style: l,
|
|
886
887
|
loading: d,
|
|
887
888
|
widgetConfig: r.config,
|
|
888
|
-
awaiting:
|
|
889
|
+
awaiting: M
|
|
889
890
|
}
|
|
890
891
|
);
|
|
891
|
-
return
|
|
892
|
+
return pe ? /* @__PURE__ */ t(
|
|
892
893
|
"button",
|
|
893
894
|
{
|
|
894
895
|
type: "button",
|
|
895
|
-
onClick: () => void
|
|
896
|
+
onClick: () => void _e(),
|
|
896
897
|
title: (h == null ? void 0 : h.title) ?? "Open details",
|
|
897
898
|
className: "cursor-pointer text-left",
|
|
898
899
|
"data-nvr-widget-drill": h == null ? void 0 : h.collection,
|
|
899
|
-
children:
|
|
900
|
+
children: g
|
|
900
901
|
}
|
|
901
|
-
) :
|
|
902
|
+
) : g;
|
|
902
903
|
}
|
|
903
904
|
}
|
|
904
|
-
return e ? /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: d ? /* @__PURE__ */ t("div", { className: "flex items-baseline gap-1", children: /* @__PURE__ */ t("div", { className: "animate-pulse h-5 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) }) : i && r && /* @__PURE__ */
|
|
905
|
-
(r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(
|
|
906
|
-
r.widget_type === "report_widget" &&
|
|
907
|
-
r.widget_type === "custom-query" && "values" in i && /* @__PURE__ */ t(
|
|
905
|
+
return e ? /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ t("div", { className: "flex items-center gap-1.5", children: d ? /* @__PURE__ */ t("div", { className: "flex items-baseline gap-1", children: /* @__PURE__ */ t("div", { className: "animate-pulse h-5 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) }) : i && r && /* @__PURE__ */ y(ye, { children: [
|
|
906
|
+
(r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(me, { data: i, awaiting: M }),
|
|
907
|
+
r.widget_type === "report_widget" && ee && /* @__PURE__ */ t(me, { data: ee, awaiting: M }),
|
|
908
|
+
r.widget_type === "custom-query" && "values" in i && /* @__PURE__ */ t(De, { data: i }),
|
|
908
909
|
r.widget_type === "action-buttons" && /* @__PURE__ */ t(
|
|
909
|
-
|
|
910
|
+
Ue,
|
|
910
911
|
{
|
|
911
912
|
data: i,
|
|
912
913
|
widgetId: n,
|
|
913
|
-
inputs:
|
|
914
|
+
inputs: O,
|
|
914
915
|
apiBase: E
|
|
915
916
|
}
|
|
916
917
|
),
|
|
917
918
|
r.widget_type === "button-group" && /* @__PURE__ */ t(
|
|
918
|
-
|
|
919
|
+
ge,
|
|
919
920
|
{
|
|
920
921
|
buttons: i.buttons ?? [],
|
|
921
922
|
layout: i.layout ?? "flat",
|
|
922
923
|
widgetId: n,
|
|
923
|
-
inputs:
|
|
924
|
+
inputs: O,
|
|
924
925
|
apiBase: E,
|
|
925
926
|
onClientAction: N
|
|
926
927
|
}
|
|
927
928
|
)
|
|
928
929
|
] }) });
|
|
929
930
|
}
|
|
930
|
-
const
|
|
931
|
+
const Re = /* @__PURE__ */ y("div", { className: "space-y-2 py-0.5", children: [
|
|
931
932
|
/* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-2/3 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
932
933
|
/* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-full rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
933
934
|
/* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-5/6 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
934
|
-
] })
|
|
935
|
+
] }), Le = X ? /* @__PURE__ */ t(
|
|
936
|
+
cr,
|
|
937
|
+
{
|
|
938
|
+
className: "mt-2",
|
|
939
|
+
pending: d && !!r,
|
|
940
|
+
request: B ? { method: "POST", url: `/widgets-internal/${n}/render`, body: B } : null,
|
|
941
|
+
label: V || "Widget",
|
|
942
|
+
onResult: (l) => {
|
|
943
|
+
const u = l == null ? void 0 : l.data;
|
|
944
|
+
u && (ce.current = !0, Y(u), f(!1), U(!1), k(null));
|
|
945
|
+
},
|
|
946
|
+
onGone: () => A((l) => l + 1)
|
|
947
|
+
}
|
|
948
|
+
) : null;
|
|
935
949
|
if (w)
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
950
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
951
|
+
j && Re,
|
|
952
|
+
j && Le,
|
|
953
|
+
x && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-500", children: x }),
|
|
954
|
+
!j && !x && i && r && $e()
|
|
940
955
|
] });
|
|
941
|
-
return /* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
956
|
+
return /* @__PURE__ */ y("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
957
|
+
/* @__PURE__ */ y(
|
|
943
958
|
"button",
|
|
944
959
|
{
|
|
945
960
|
type: "button",
|
|
946
961
|
className: "flex w-full items-center justify-between px-4 py-3 text-left",
|
|
947
|
-
onClick: () =>
|
|
962
|
+
onClick: () => se((l) => !l),
|
|
948
963
|
children: [
|
|
949
|
-
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children:
|
|
964
|
+
/* @__PURE__ */ t("span", { className: "text-[13px] font-medium text-slate-800 dark:text-slate-200", children: V || /* @__PURE__ */ t("span", { className: "inline-block h-3 w-28 animate-pulse rounded bg-[hsl(var(--nvr-skeleton))] align-middle" }) }),
|
|
950
965
|
/* @__PURE__ */ t("span", { className: `text-slate-400 transition-transform ${G ? "rotate-90" : ""}`, children: "›" })
|
|
951
966
|
]
|
|
952
967
|
}
|
|
953
968
|
),
|
|
954
|
-
G && /* @__PURE__ */
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
969
|
+
G && /* @__PURE__ */ y("div", { className: "border-t border-slate-100 px-4 py-3 dark:border-border", children: [
|
|
970
|
+
j && Re,
|
|
971
|
+
j && Le,
|
|
972
|
+
x && /* @__PURE__ */ t("p", { className: "text-[12px] text-red-500", children: x }),
|
|
973
|
+
!j && !x && i && r && $e()
|
|
958
974
|
] })
|
|
959
975
|
] });
|
|
960
|
-
function
|
|
961
|
-
var
|
|
962
|
-
return !i || !r ? null : /* @__PURE__ */
|
|
963
|
-
(r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(
|
|
964
|
-
r.widget_type === "custom-query" && "values" in i && (
|
|
976
|
+
function $e() {
|
|
977
|
+
var l;
|
|
978
|
+
return !i || !r ? null : /* @__PURE__ */ y(ye, { children: [
|
|
979
|
+
(r.widget_type === "stat" || r.widget_type === "custom-query" && "value" in i) && /* @__PURE__ */ t(me, { data: i, awaiting: M }),
|
|
980
|
+
r.widget_type === "custom-query" && "values" in i && (M ? /* @__PURE__ */ y(
|
|
965
981
|
"p",
|
|
966
982
|
{
|
|
967
983
|
className: "text-[12px] text-slate-500 dark:text-slate-400",
|
|
968
|
-
"data-widget-awaiting":
|
|
984
|
+
"data-widget-awaiting": M,
|
|
969
985
|
children: [
|
|
970
986
|
"Set ",
|
|
971
|
-
|
|
987
|
+
M,
|
|
972
988
|
" on this record to see ",
|
|
973
|
-
|
|
989
|
+
V || "this",
|
|
974
990
|
"."
|
|
975
991
|
]
|
|
976
992
|
}
|
|
977
|
-
) : /* @__PURE__ */ t(
|
|
978
|
-
r.widget_type === "list" && /* @__PURE__ */ t(
|
|
979
|
-
|
|
993
|
+
) : /* @__PURE__ */ t(De, { data: i })),
|
|
994
|
+
r.widget_type === "list" && /* @__PURE__ */ t(_r, { data: i }),
|
|
995
|
+
M && r.widget_type === "custom-query" && "rows" in i && /* @__PURE__ */ y(
|
|
980
996
|
"p",
|
|
981
997
|
{
|
|
982
998
|
className: "text-[12px] text-slate-500 dark:text-slate-400",
|
|
983
|
-
"data-widget-awaiting":
|
|
999
|
+
"data-widget-awaiting": M,
|
|
984
1000
|
children: [
|
|
985
1001
|
"Set ",
|
|
986
|
-
|
|
1002
|
+
M,
|
|
987
1003
|
" on this record to see ",
|
|
988
|
-
|
|
1004
|
+
V || "this",
|
|
989
1005
|
"."
|
|
990
1006
|
]
|
|
991
1007
|
}
|
|
992
1008
|
),
|
|
993
|
-
!
|
|
994
|
-
|
|
1009
|
+
!M && r.widget_type === "custom-query" && "rows" in i && /* @__PURE__ */ t(
|
|
1010
|
+
fr,
|
|
995
1011
|
{
|
|
996
1012
|
rows: i.rows ?? [],
|
|
997
|
-
config: (
|
|
998
|
-
emptyLabel:
|
|
1013
|
+
config: (l = r.config) == null ? void 0 : l.table,
|
|
1014
|
+
emptyLabel: V
|
|
999
1015
|
}
|
|
1000
1016
|
),
|
|
1001
1017
|
r.widget_type === "review_list" && /* @__PURE__ */ t(
|
|
1002
|
-
|
|
1018
|
+
gr,
|
|
1003
1019
|
{
|
|
1004
1020
|
data: i,
|
|
1005
1021
|
config: r.config ?? {},
|
|
1006
|
-
onRefetch: () =>
|
|
1007
|
-
hostRecordId:
|
|
1008
|
-
emptyLabel:
|
|
1022
|
+
onRefetch: () => A((u) => u + 1),
|
|
1023
|
+
hostRecordId: O.record_id,
|
|
1024
|
+
emptyLabel: V
|
|
1009
1025
|
}
|
|
1010
1026
|
),
|
|
1011
1027
|
r.widget_type === "rollup" && /* @__PURE__ */ t(
|
|
1012
|
-
|
|
1028
|
+
yr,
|
|
1013
1029
|
{
|
|
1014
1030
|
data: i,
|
|
1015
1031
|
config: r.config ?? {},
|
|
1016
|
-
emptyLabel:
|
|
1032
|
+
emptyLabel: V
|
|
1017
1033
|
}
|
|
1018
1034
|
),
|
|
1019
|
-
r.widget_type === "report_widget" && /* @__PURE__ */ t(
|
|
1035
|
+
r.widget_type === "report_widget" && /* @__PURE__ */ t(hr, { payload: i }),
|
|
1020
1036
|
r.widget_type === "action-buttons" && /* @__PURE__ */ t(
|
|
1021
|
-
|
|
1037
|
+
Ue,
|
|
1022
1038
|
{
|
|
1023
1039
|
data: i,
|
|
1024
1040
|
widgetId: n,
|
|
1025
|
-
inputs:
|
|
1041
|
+
inputs: O,
|
|
1026
1042
|
apiBase: E
|
|
1027
1043
|
}
|
|
1028
1044
|
),
|
|
1029
1045
|
r.widget_type === "button-group" && /* @__PURE__ */ t(
|
|
1030
|
-
|
|
1046
|
+
ge,
|
|
1031
1047
|
{
|
|
1032
1048
|
buttons: i.buttons ?? [],
|
|
1033
1049
|
layout: i.layout ?? "flat",
|
|
1034
1050
|
widgetId: n,
|
|
1035
|
-
inputs:
|
|
1051
|
+
inputs: O,
|
|
1036
1052
|
apiBase: E,
|
|
1037
1053
|
onClientAction: N
|
|
1038
1054
|
}
|
|
@@ -1048,10 +1064,10 @@ function Ar({
|
|
|
1048
1064
|
"report_widget"
|
|
1049
1065
|
].includes(r.widget_type) && /* @__PURE__ */ t("pre", { className: "whitespace-pre-wrap text-[11px] text-slate-500", children: JSON.stringify(i, null, 2) }),
|
|
1050
1066
|
i.cache ? /* @__PURE__ */ t(
|
|
1051
|
-
|
|
1067
|
+
ur,
|
|
1052
1068
|
{
|
|
1053
1069
|
envelope: i.cache,
|
|
1054
|
-
onRefresh:
|
|
1070
|
+
onRefresh: H,
|
|
1055
1071
|
refreshing: d,
|
|
1056
1072
|
className: "mt-2 justify-end"
|
|
1057
1073
|
}
|
|
@@ -1060,5 +1076,5 @@ function Ar({
|
|
|
1060
1076
|
}
|
|
1061
1077
|
}
|
|
1062
1078
|
export {
|
|
1063
|
-
|
|
1079
|
+
Br as WidgetSlot
|
|
1064
1080
|
};
|