@declarion/react 0.65.1 → 0.66.0
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-lib/api/access-expiry.js +32 -0
- package/dist-lib/api/agents.js +105 -0
- package/dist-lib/api/auth-redirect.js +30 -0
- package/dist-lib/api/auth.js +67 -0
- package/dist-lib/api/batch.js +34 -0
- package/dist-lib/api/client.js +241 -0
- package/dist-lib/api/data.js +122 -0
- package/dist-lib/api/entities.js +160 -0
- package/dist-lib/api/events.js +120 -0
- package/dist-lib/api/fileReferences.js +8 -0
- package/dist-lib/api/params.js +20 -0
- package/dist-lib/api/properties.js +25 -0
- package/dist-lib/api/request-bounds.js +28 -0
- package/dist-lib/api/schema.js +71 -0
- package/dist-lib/api/session-renewal.js +36 -0
- package/dist-lib/api/status.js +17 -0
- package/dist-lib/app.js +262 -0
- package/dist-lib/components/actions/ActionButton.js +116 -0
- package/dist-lib/{ActionDialog-C6EG-AmC.js → components/actions/ActionDialog.js} +63 -53
- package/dist-lib/{ActionResultDialog.impl-BATutW8J.js → components/actions/ActionResultDialog.impl.js} +53 -48
- package/dist-lib/components/actions/ActionResultDialog.js +12 -0
- package/dist-lib/components/actions/ActionRunner.js +274 -0
- package/dist-lib/components/actions/ObjectActionBar.js +127 -0
- package/dist-lib/components/actions/PropertyGridEditor.js +202 -0
- package/dist-lib/components/actions/ResponsiveActionBar.js +773 -0
- package/dist-lib/components/actions/RowActionsKebab.js +90 -0
- package/dist-lib/{AgentChatPanel.impl-D5y_qEex.js → components/agents/AgentChatPanel.impl.js} +314 -362
- package/dist-lib/components/agents/AgentChatPanel.js +12 -0
- package/dist-lib/components/agents/AgentConversationDrawer.js +59 -0
- package/dist-lib/components/agents/AgentElicitForm.js +152 -0
- package/dist-lib/components/agents/AgentOpenFollower.impl.js +7 -0
- package/dist-lib/components/agents/AgentOpenFollower.js +12 -0
- package/dist-lib/components/agents/AgentPicker.js +58 -0
- package/dist-lib/components/agents/transcript-runs.js +52 -0
- package/dist-lib/components/chrome/AssociationTabs.js +176 -0
- package/dist-lib/components/chrome/AuditMetaStrip.js +64 -0
- package/dist-lib/components/chrome/Breadcrumbs.js +67 -0
- package/dist-lib/components/chrome/HighlightsStrip.js +39 -0
- package/dist-lib/{PageHeader-DiwLe7CO.js → components/chrome/PageHeader.js} +19 -15
- package/dist-lib/{PageShell-BJz1MiTH.js → components/chrome/PageShell.js} +3 -3
- package/dist-lib/components/chrome/RecordHeader.js +119 -0
- package/dist-lib/{headerActionZone-bef-tZZ7.js → components/chrome/headerActionZone.js} +1 -1
- package/dist-lib/components/detail-layout/AssociatedBlock.js +1244 -0
- package/dist-lib/components/detail-layout/AssociatedToolbar.js +87 -0
- package/dist-lib/components/detail-layout/ChildrenBlock.js +80 -0
- package/dist-lib/components/detail-layout/ChildrenCards.js +156 -0
- package/dist-lib/components/detail-layout/ChildrenList.js +135 -0
- package/dist-lib/components/detail-layout/ChildrenTable.js +189 -0
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +609 -0
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +40 -0
- package/dist-lib/components/detail-layout/DetailHighlights.js +54 -0
- package/dist-lib/{DraggableChildrenTable-Dd5SeuF6.js → components/detail-layout/DraggableChildrenTable.js} +56 -53
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +341 -0
- package/dist-lib/components/detail-layout/ErrorSummary.js +89 -0
- package/dist-lib/components/detail-layout/EvidenceBlock.js +66 -0
- package/dist-lib/{FieldRow-DedGIY9R.js → components/detail-layout/FieldRow.js} +8 -7
- package/dist-lib/components/detail-layout/FieldsBlock.js +74 -0
- package/dist-lib/components/detail-layout/LayoutColumn.js +16 -0
- package/dist-lib/components/detail-layout/LayoutRenderer.js +54 -0
- package/dist-lib/components/detail-layout/LayoutRow.js +83 -0
- package/dist-lib/components/detail-layout/LayoutTabs.js +195 -0
- package/dist-lib/components/detail-layout/PropertiesBlock.js +74 -0
- package/dist-lib/components/detail-layout/QuickAddForm.js +81 -0
- package/dist-lib/components/detail-layout/SectionBlock.js +48 -0
- package/dist-lib/components/detail-layout/StatusesBlock.js +18 -0
- package/dist-lib/components/detail-layout/TimelineComposer.js +205 -0
- package/dist-lib/components/detail-layout/blockMeta.js +27 -0
- package/dist-lib/components/detail-layout/useManualColumnResize.js +94 -0
- package/dist-lib/components/detail-layout/useQuickAdd.js +85 -0
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +295 -0
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.js +107 -0
- package/dist-lib/components/detail-layout/widgets/MonacoJson.js +47 -0
- package/dist-lib/components/detail-layout/widgets/WidgetHost.js +36 -0
- package/dist-lib/components/detail-layout/widgets/builtins.js +10 -0
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.js +32 -0
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.js +16 -0
- package/dist-lib/components/detail-layout/widgets/registry.js +13 -0
- package/dist-lib/components/fields/BoolField.js +13 -0
- package/dist-lib/components/fields/EmailField.js +16 -0
- package/dist-lib/components/fields/EnumField.js +38 -0
- package/dist-lib/components/fields/FileReferenceField.js +60 -0
- package/dist-lib/components/fields/IntArrayField.js +83 -0
- package/dist-lib/components/fields/JsonField.js +51 -0
- package/dist-lib/components/fields/MultilangArrayField.js +56 -0
- package/dist-lib/components/fields/MultilangField.js +65 -0
- package/dist-lib/components/fields/MultilangTextField.js +65 -0
- package/dist-lib/components/fields/NumberField.js +64 -0
- package/dist-lib/components/fields/PasswordField.js +34 -0
- package/dist-lib/components/fields/PhoneField.js +84 -0
- package/dist-lib/components/fields/RefCombobox.js +112 -0
- package/dist-lib/components/fields/RefField.js +45 -0
- package/dist-lib/components/fields/RichTextField.js +225 -0
- package/dist-lib/components/fields/SecretField.js +34 -0
- package/dist-lib/components/fields/StringArrayField.js +165 -0
- package/dist-lib/components/fields/StringField.js +39 -0
- package/dist-lib/components/fields/StructureField.js +221 -0
- package/dist-lib/components/fields/TextField.js +76 -0
- package/dist-lib/components/fields/TimestampField.js +110 -0
- package/dist-lib/components/fields/UrlField.js +18 -0
- package/dist-lib/components/fields/cells/factories/badge.js +42 -0
- package/dist-lib/components/fields/cells/factories/boolPill.js +17 -0
- package/dist-lib/components/fields/cells/factories/code.js +11 -0
- package/dist-lib/components/fields/cells/factories/date.js +30 -0
- package/dist-lib/components/fields/cells/factories/email.js +26 -0
- package/dist-lib/components/fields/cells/factories/emptyCell.js +10 -0
- package/dist-lib/components/fields/cells/factories/fileReference.js +17 -0
- package/dist-lib/components/fields/cells/factories/host-icons.js +146 -0
- package/dist-lib/components/fields/cells/factories/json.js +61 -0
- package/dist-lib/components/fields/cells/factories/link.js +32 -0
- package/dist-lib/components/fields/cells/factories/markdown.js +31 -0
- package/dist-lib/components/fields/cells/factories/markdownPreview.js +81 -0
- package/dist-lib/components/fields/cells/factories/money.js +37 -0
- package/dist-lib/components/fields/cells/factories/multilangInline.js +35 -0
- package/dist-lib/components/fields/cells/factories/nextRun.js +46 -0
- package/dist-lib/components/fields/cells/factories/number.js +42 -0
- package/dist-lib/components/fields/cells/factories/passwordMask.js +23 -0
- package/dist-lib/components/fields/cells/factories/phone.js +35 -0
- package/dist-lib/components/fields/cells/factories/refLink.js +57 -0
- package/dist-lib/components/fields/cells/factories/richTextPreview.js +34 -0
- package/dist-lib/components/fields/cells/factories/statusPill.js +35 -0
- package/dist-lib/components/fields/cells/factories/tagList.js +44 -0
- package/dist-lib/components/fields/cells/factories/text.js +5 -0
- package/dist-lib/components/fields/cells/factories/timestamp.js +18 -0
- package/dist-lib/components/fields/cells/factories/url-helpers.js +49 -0
- package/dist-lib/components/fields/cells/factories/url.js +45 -0
- package/dist-lib/components/fields/cells/registry.js +58 -0
- package/dist-lib/components/fields/index.js +80 -0
- package/dist-lib/components/fields/langMap.js +6 -0
- package/dist-lib/components/fields/secretValue.js +7 -0
- package/dist-lib/components/file-widgets/CircleImage.js +11 -0
- package/dist-lib/components/file-widgets/DocumentCard.js +277 -0
- package/dist-lib/components/file-widgets/FileList.js +213 -0
- package/dist-lib/{Grid-XUHm5SDe.js → components/file-widgets/Grid.js} +45 -40
- package/dist-lib/components/file-widgets/GridLazy.js +15 -0
- package/dist-lib/components/file-widgets/ImageWidget.js +354 -0
- package/dist-lib/components/file-widgets/LabeledSlots.js +69 -0
- package/dist-lib/components/file-widgets/SquareImage.js +11 -0
- package/dist-lib/components/file-widgets/UnknownFileWidget.js +22 -0
- package/dist-lib/components/file-widgets/UploadFailureText.js +10 -0
- package/dist-lib/components/file-widgets/WideBanner.js +11 -0
- package/dist-lib/components/file-widgets/builtins.js +15 -0
- package/dist-lib/components/file-widgets/cropper.js +13 -0
- package/dist-lib/components/file-widgets/draft-scope.js +59 -0
- package/dist-lib/components/file-widgets/helpers.js +75 -0
- package/dist-lib/components/file-widgets/host.js +75 -0
- package/dist-lib/{payload-DioMoxMX.js → components/file-widgets/payload.js} +14 -14
- package/dist-lib/components/file-widgets/registry.js +13 -0
- package/dist-lib/components/file-widgets/upload.js +180 -0
- package/dist-lib/components/file-widgets/useEmbedFileSrc.js +45 -0
- package/dist-lib/components/file-widgets/value.js +12 -0
- package/dist-lib/components/filters/FilterChips.js +123 -0
- package/dist-lib/components/filters/FilterConditionValue.js +40 -0
- package/dist-lib/components/filters/FilterDrawer.js +670 -0
- package/dist-lib/components/filters/FilterOmittedNotice.js +14 -0
- package/dist-lib/components/filters/filter-op-label.js +8 -0
- package/dist-lib/{CommandPalette.impl-DRI5kxVY.js → components/layout/CommandPalette.impl.js} +62 -61
- package/dist-lib/components/layout/CommandPalette.js +12 -0
- package/dist-lib/{DirtyTabsCloseDialog.impl-FhAiOmEb.js → components/layout/DirtyTabsCloseDialog.impl.js} +16 -14
- package/dist-lib/components/layout/DirtyTabsCloseDialog.js +12 -0
- package/dist-lib/{ImpersonationBanner.impl--g0iYwcV.js → components/layout/ImpersonationBanner.impl.js} +4 -3
- package/dist-lib/components/layout/ImpersonationBanner.js +12 -0
- package/dist-lib/components/layout/ImpersonationFrame.js +29 -0
- package/dist-lib/{ImpersonationStartModal.impl-BFBN0YJe.js → components/layout/ImpersonationStartModal.impl.js} +9 -9
- package/dist-lib/components/layout/ImpersonationStartModal.js +12 -0
- package/dist-lib/components/layout/Layout.js +755 -0
- package/dist-lib/components/layout/Rail.js +149 -0
- package/dist-lib/components/layout/Sidebar.js +362 -0
- package/dist-lib/components/layout/TabStrip.js +321 -0
- package/dist-lib/components/layout/TenantChip.js +355 -0
- package/dist-lib/components/layout/TopBar.js +305 -0
- package/dist-lib/components/layout/tab-close.js +24 -0
- package/dist-lib/components/list/ColumnPicker.js +112 -0
- package/dist-lib/components/list/InlineEditCell.js +107 -0
- package/dist-lib/components/list/PeekFieldCell.js +143 -0
- package/dist-lib/components/list/QuickPeek.js +263 -0
- package/dist-lib/components/list/ViewSwitcher.js +156 -0
- package/dist-lib/components/list/peekDraftStore.js +14 -0
- package/dist-lib/{AdminCatalogPage.impl-B-7MLqa1.js → components/pages/AdminCatalogPage.impl.js} +53 -49
- package/dist-lib/components/pages/AdminCatalogPage.js +12 -0
- package/dist-lib/components/pages/DocumentsMenu.js +150 -0
- package/dist-lib/components/pages/ExportMenu.js +123 -0
- package/dist-lib/{NotFoundPage.impl-BoX11u-P.js → components/pages/NotFoundPage.impl.js} +6 -4
- package/dist-lib/components/pages/NotFoundPage.js +12 -0
- package/dist-lib/components/pages/RecordDocumentsPanel.js +230 -0
- package/dist-lib/components/pages/RecordNotesPanel.js +200 -0
- package/dist-lib/components/pages/RecordPanels.js +18 -0
- package/dist-lib/components/pages/SSOCallbackPage.impl.js +28 -0
- package/dist-lib/components/pages/SSOCallbackPage.js +12 -0
- package/dist-lib/components/pages/SmartDetailPage.impl.js +986 -0
- package/dist-lib/components/pages/SmartDetailPage.js +12 -0
- package/dist-lib/components/pages/SmartListPage.impl.js +708 -0
- package/dist-lib/components/pages/SmartListPage.js +12 -0
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +818 -0
- package/dist-lib/components/pages/SmartRecordListPage.js +12 -0
- package/dist-lib/components/pages/auth/AuthShell.js +350 -0
- package/dist-lib/{Forgot.impl-6tL6SBlS.js → components/pages/auth/Forgot.impl.js} +13 -12
- package/dist-lib/components/pages/auth/Forgot.js +12 -0
- package/dist-lib/{Reset.impl-D0pjhS6d.js → components/pages/auth/Reset.impl.js} +17 -15
- package/dist-lib/components/pages/auth/Reset.js +12 -0
- package/dist-lib/components/pages/auth/SignIn.js +252 -0
- package/dist-lib/{SignUp.impl-CfEXrUeg.js → components/pages/auth/SignUp.impl.js} +31 -27
- package/dist-lib/components/pages/auth/SignUp.js +12 -0
- package/dist-lib/{TwoFA.impl-B2HtPduH.js → components/pages/auth/TwoFA.impl.js} +9 -8
- package/dist-lib/components/pages/auth/TwoFA.js +12 -0
- package/dist-lib/components/pages/auth/icons.js +56 -0
- package/dist-lib/components/pages/exportRequest.js +17 -0
- package/dist-lib/components/pages/list/DataCell.js +27 -0
- package/dist-lib/components/pages/list/DeleteViewDialog.js +22 -0
- package/dist-lib/{ListCardsBody-BEoYjSZ2.js → components/pages/list/ListCardRow.js} +47 -72
- package/dist-lib/components/pages/list/ListCardsBody.js +31 -0
- package/dist-lib/components/pages/list/ListFloatbar.js +130 -0
- package/dist-lib/components/pages/list/ListFooter.js +138 -0
- package/dist-lib/components/pages/list/ListHeader.js +120 -0
- package/dist-lib/components/pages/list/ListNoRows.js +72 -0
- package/dist-lib/components/pages/list/ListTable.js +191 -0
- package/dist-lib/components/pages/list/ListTableRow.js +37 -0
- package/dist-lib/components/pages/list/ListToolbar.js +261 -0
- package/dist-lib/components/pages/list/ListUrlBanner.js +45 -0
- package/dist-lib/components/pages/list/RowActionsCell.js +49 -0
- package/dist-lib/components/pages/list/RowContextMenu.js +55 -0
- package/dist-lib/components/pages/list/SaveViewDialog.js +111 -0
- package/dist-lib/{SortHeaderMenu-Co5PvhTA.js → components/pages/list/SortHeaderMenu.js} +18 -17
- package/dist-lib/{cardProjection-Cxlogzh8.js → components/pages/list/cardProjection.js} +3 -3
- package/dist-lib/components/pages/list/column-sizing.js +17 -0
- package/dist-lib/components/pages/list/columns.js +168 -0
- package/dist-lib/components/pages/list/filter-meta.js +84 -0
- package/dist-lib/components/pages/list/page-size.js +11 -0
- package/dist-lib/components/pages/list/sortable-header.js +18 -0
- package/dist-lib/components/pages/list/table-features.js +11 -0
- package/dist-lib/components/pages/list/use-filter-value-labels.js +115 -0
- package/dist-lib/components/pages/list/useActiveView.js +98 -0
- package/dist-lib/components/pages/list/useHeaderReorder.js +93 -0
- package/dist-lib/components/pages/list/useListColumnLayout.js +56 -0
- package/dist-lib/components/pages/list/useListFilterPresentation.js +34 -0
- package/dist-lib/components/pages/list/useListQuery.js +101 -0
- package/dist-lib/components/pages/list/useListRowInteraction.js +120 -0
- package/dist-lib/components/pages/list/useListSelection.js +53 -0
- package/dist-lib/components/pages/list/useListSort.js +44 -0
- package/dist-lib/components/pages/list/useListViews.js +148 -0
- package/dist-lib/components/pages/list/useRowMenu.js +106 -0
- package/dist-lib/components/pages/list/visible-filters.js +19 -0
- package/dist-lib/{Preferences.impl-Ct5xwZtT.js → components/pages/profile/Preferences.impl.js} +34 -31
- package/dist-lib/components/pages/profile/Preferences.js +12 -0
- package/dist-lib/components/pages/profile/Profile.impl.js +437 -0
- package/dist-lib/components/pages/profile/Profile.js +12 -0
- package/dist-lib/{TenantParamsPage.impl-BGpdmEZg.js → components/pages/tenant-params/TenantParamsPage.impl.js} +45 -40
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.js +12 -0
- package/dist-lib/components/params/ParamsBlock.js +119 -0
- package/dist-lib/{param-editors-TYYU7HKK.js → components/params/param-editors.js} +32 -28
- package/dist-lib/components/primitives/Avatar.js +33 -0
- package/dist-lib/components/primitives/BoolToggle.js +35 -0
- package/dist-lib/components/primitives/BrandGlyph.js +38 -0
- package/dist-lib/components/primitives/BrandLogo.js +20 -0
- package/dist-lib/components/primitives/Btn.js +67 -0
- package/dist-lib/{Check-DAfMbQIw.js → components/primitives/Check.js} +2 -2
- package/dist-lib/components/primitives/Chip.js +44 -0
- package/dist-lib/components/primitives/ClassifiedFieldLocked.js +15 -0
- package/dist-lib/components/primitives/Dropdown.js +85 -0
- package/dist-lib/components/primitives/Fields.js +751 -0
- package/dist-lib/components/primitives/HoverCard.js +115 -0
- package/dist-lib/components/primitives/IconBtn.js +37 -0
- package/dist-lib/{Icons-lt-7lhYR.js → components/primitives/Icons.js} +1 -1
- package/dist-lib/{Kbd-CNttVu0z.js → components/primitives/Kbd.js} +2 -2
- package/dist-lib/components/primitives/MenuItem.js +57 -0
- package/dist-lib/{Pill-D-wsfRhx.js → components/primitives/Pill.js} +1 -1
- package/dist-lib/{RecordIdBadge-wbigZaFc.js → components/primitives/RecordIdBadge.js} +5 -5
- package/dist-lib/components/primitives/RowField.js +47 -0
- package/dist-lib/{SectionCard-BYHoHWJc.js → components/primitives/SectionCard.js} +10 -10
- package/dist-lib/components/primitives/Spinner.js +31 -0
- package/dist-lib/components/primitives/StatTile.js +108 -0
- package/dist-lib/components/primitives/Tooltip.js +115 -0
- package/dist-lib/{dataTableStyles-vwD1mVOP.js → components/primitives/dataTableStyles.js} +1 -1
- package/dist-lib/components/shared/BlankScreen.js +13 -0
- package/dist-lib/{ChangePasswordDialog.impl-5hDc0wpE.js → components/shared/ChangePasswordDialog.impl.js} +27 -22
- package/dist-lib/{ChangePasswordDialog-C_T_3pjl.js → components/shared/ChangePasswordDialog.js} +2 -2
- package/dist-lib/components/shared/ConfirmDialog.js +129 -0
- package/dist-lib/components/shared/ConnectionNotice.js +12 -0
- package/dist-lib/components/shared/CopyButton.js +25 -0
- package/dist-lib/components/shared/DynamicIcon.js +73 -0
- package/dist-lib/components/shared/EmptyState.js +56 -0
- package/dist-lib/components/shared/ErrorBoundary.js +96 -0
- package/dist-lib/components/shared/LoadingSkeleton.js +117 -0
- package/dist-lib/components/shared/LucideIcon.js +43 -0
- package/dist-lib/components/shared/Markdown.js +15 -0
- package/dist-lib/{MarkdownRenderer-sK2TRZS-.js → components/shared/MarkdownRenderer.js} +10 -9
- package/dist-lib/components/shared/RefreshControl.js +42 -0
- package/dist-lib/components/shared/StatusGroupsDisplay.js +123 -0
- package/dist-lib/components/shared/StatusStepper.js +70 -0
- package/dist-lib/components/shared/toast/DeclarionToast.js +308 -0
- package/dist-lib/components/shared/useOwnRefresh.js +19 -0
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/embed/EmbedAuthBootstrap.js +71 -0
- package/dist-lib/embed/EmbedContext.js +38 -0
- package/dist-lib/embed/EmbedDirtyReporter.js +17 -0
- package/dist-lib/embed/EmbedHistoryTracker.js +17 -0
- package/dist-lib/embed/EmbedLocationReporter.js +26 -0
- package/dist-lib/embed/EmbedResizeReporter.js +25 -0
- package/dist-lib/embed/EmbedUnsavedGuard.js +23 -0
- package/dist-lib/embed/embed-dirty.js +21 -0
- package/dist-lib/embed/embed-history.js +17 -0
- package/dist-lib/embed/embed-nav-guard.js +13 -0
- package/dist-lib/embed/file-src.js +60 -0
- package/dist-lib/embed/handshake.js +37 -0
- package/dist-lib/embed/params.js +45 -0
- package/dist-lib/embed/protocol.js +26 -0
- package/dist-lib/embed/screen-location.js +44 -0
- package/dist-lib/embed/theme.js +11 -0
- package/dist-lib/embed/token.js +54 -0
- package/dist-lib/embed/useEmbedNavigate.js +65 -0
- package/dist-lib/embed/useGlobalLinkInterceptor.js +63 -0
- package/dist-lib/hooks/useActionData.js +58 -0
- package/dist-lib/hooks/useAgentConversation.js +311 -0
- package/dist-lib/hooks/useAggregate.js +18 -0
- package/dist-lib/hooks/useAllEntityData.js +53 -0
- package/dist-lib/hooks/useAssociatedData.js +37 -0
- package/dist-lib/hooks/useAuth.js +56 -0
- package/dist-lib/hooks/useBranding.js +18 -0
- package/dist-lib/hooks/useBrandingChrome.js +58 -0
- package/dist-lib/hooks/useChildrenData.js +33 -0
- package/dist-lib/hooks/useColumns.js +44 -0
- package/dist-lib/hooks/useConnectionNotice.js +35 -0
- package/dist-lib/{useCurrentLocation-Bq1T72AW.js → hooks/useCurrentLocation.js} +2 -2
- package/dist-lib/hooks/useCurrentScreen.js +20 -0
- package/dist-lib/hooks/useCursorEntityData.js +77 -0
- package/dist-lib/hooks/useDebounce.js +11 -0
- package/dist-lib/hooks/useEntity.js +8 -0
- package/dist-lib/hooks/useEntityData.js +64 -0
- package/dist-lib/hooks/useFileReferenceJSON.js +29 -0
- package/dist-lib/hooks/useFilters.js +28 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +84 -0
- package/dist-lib/hooks/useImpersonation.js +40 -0
- package/dist-lib/hooks/useIntentPrefetch.js +43 -0
- package/dist-lib/hooks/useJsonSnapshot.js +8 -0
- package/dist-lib/hooks/useLanguage.js +21 -0
- package/dist-lib/hooks/useLiveObject.js +17 -0
- package/dist-lib/hooks/useLongPress.js +49 -0
- package/dist-lib/hooks/useMutations.js +70 -0
- package/dist-lib/{useObject-B45F96rC.js → hooks/useObject.js} +2 -2
- package/dist-lib/hooks/useObjectStatus.js +20 -0
- package/dist-lib/hooks/usePageState.js +18 -0
- package/dist-lib/hooks/usePageStateRuntime.js +46 -0
- package/dist-lib/hooks/usePageStateTtl.js +10 -0
- package/dist-lib/hooks/useParams.js +123 -0
- package/dist-lib/hooks/useProperties.js +32 -0
- package/dist-lib/hooks/useRealtimeThresholds.js +31 -0
- package/dist-lib/hooks/useRegisterScreenTab.js +28 -0
- package/dist-lib/hooks/useResponsiveMode.js +84 -0
- package/dist-lib/hooks/useSSE.js +307 -0
- package/dist-lib/hooks/useSchema.js +73 -0
- package/dist-lib/hooks/useScreen.js +8 -0
- package/dist-lib/hooks/useScreenBack.js +60 -0
- package/dist-lib/hooks/useScreenTab.js +11 -0
- package/dist-lib/hooks/useTabNavigate.js +82 -0
- package/dist-lib/hooks/useTabSearchMirror.js +19 -0
- package/dist-lib/{useTabTitle-KrzEo118.js → hooks/useTabTitle.js} +9 -7
- package/dist-lib/hooks/useText.js +15 -0
- package/dist-lib/hooks/useTimelineData.js +44 -0
- package/dist-lib/hooks/useUnsavedInput.js +18 -0
- package/dist-lib/hooks/useVersionWatcher.js +62 -0
- package/dist-lib/hooks/useViews.js +88 -0
- package/dist-lib/hooks/useWindowConversation.js +11 -0
- package/dist-lib/icons.js +5 -3
- package/dist-lib/index.d.ts +42 -20
- package/dist-lib/index.js +131 -3926
- package/dist-lib/lib/action-dispatch.js +7 -0
- package/dist-lib/lib/actions.js +279 -0
- package/dist-lib/lib/anchor.js +41 -0
- package/dist-lib/lib/brand-tokens.js +95 -0
- package/dist-lib/lib/branding.js +25 -0
- package/dist-lib/lib/canonical-url.js +17 -0
- package/dist-lib/lib/capabilityPrefetch.js +57 -0
- package/dist-lib/lib/child-config.js +111 -0
- package/dist-lib/lib/children-validation.js +52 -0
- package/dist-lib/lib/decimal-text.js +15 -0
- package/dist-lib/lib/display-value.js +19 -0
- package/dist-lib/lib/document-templates.js +6 -0
- package/dist-lib/lib/download.js +41 -0
- package/dist-lib/lib/evidence-verdict.js +23 -0
- package/dist-lib/lib/failure.js +9 -0
- package/dist-lib/lib/field-classification.js +58 -0
- package/dist-lib/lib/field-regions.js +13 -0
- package/dist-lib/lib/filter-evaluator.js +98 -0
- package/dist-lib/lib/filters.js +118 -0
- package/dist-lib/lib/format-count.js +24 -0
- package/dist-lib/lib/html-state.js +9 -0
- package/dist-lib/lib/language.js +52 -0
- package/dist-lib/lib/longPressGesture.js +34 -0
- package/dist-lib/lib/mass-edit.js +65 -0
- package/dist-lib/{page-inset-D_kkVwwN.js → lib/page-inset.js} +1 -1
- package/dist-lib/lib/phone.js +28 -0
- package/dist-lib/lib/query-retry.js +7 -0
- package/dist-lib/lib/quick-add.js +23 -0
- package/dist-lib/lib/realtime-query-keys.js +23 -0
- package/dist-lib/lib/realtime-reconcile.js +148 -0
- package/dist-lib/lib/realtime-resync.js +192 -0
- package/dist-lib/lib/record-documents-key.js +4 -0
- package/dist-lib/lib/ref-choices.js +6 -0
- package/dist-lib/lib/refetch-when-idle.js +25 -0
- package/dist-lib/lib/rich-text.js +46 -0
- package/dist-lib/lib/rowClickGesture.js +10 -0
- package/dist-lib/lib/safe-url.js +34 -0
- package/dist-lib/lib/schema-routing.js +51 -0
- package/dist-lib/{screen-back-BtbEp5sO.js → lib/screen-back.js} +2 -2
- package/dist-lib/lib/scroll-restoration.js +156 -0
- package/dist-lib/lib/size-value.js +22 -0
- package/dist-lib/lib/sort.js +59 -0
- package/dist-lib/lib/timestamp.js +97 -0
- package/dist-lib/lib/toast.js +78 -0
- package/dist-lib/lib/ui-actions.js +81 -0
- package/dist-lib/{utils-D_QDpB8_.js → lib/utils.js} +1 -1
- package/dist-lib/lib/variants.js +63 -0
- package/dist-lib/lib/versionTracker.js +102 -0
- package/dist-lib/lib/viewport-category.js +12 -0
- package/dist-lib/{window-election-CHIvIZwx.js → lib/window-election.js} +1 -1
- package/dist-lib/stores/auth.js +84 -0
- package/dist-lib/stores/icon-registry.js +24 -0
- package/dist-lib/stores/list-layout.js +178 -0
- package/dist-lib/{page-state-eA6J_KIR.js → stores/page-state.js} +1 -1
- package/dist-lib/stores/preferences.js +126 -0
- package/dist-lib/stores/realtime.js +115 -0
- package/dist-lib/stores/screen-registry.js +10 -0
- package/dist-lib/stores/tabs.js +220 -0
- package/dist-lib/test/seed-schema.js +8 -0
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +80 -76
- package/dist-lib/types/api.js +48 -0
- package/dist-lib/types/fieldType.js +4 -0
- package/dist-lib/types/ordmap.js +50 -0
- package/dist-lib/types/schema.js +173 -0
- package/dist-lib/{useResponsiveMode-DIR1bZfo.d.ts → useResponsiveMode-DmrpMbZX.d.ts} +44 -16
- package/package.json +13 -12
- package/dist-lib/ActionRunner-DdBFhqGe.js +0 -1440
- package/dist-lib/AgentOpenFollower.impl-BAs_wGEZ.js +0 -81
- package/dist-lib/AssociatedBlock-BOoPLOjw.js +0 -1515
- package/dist-lib/AuthShell-C8aVwHS7.js +0 -361
- package/dist-lib/BlankScreen-DVc7fh8C.js +0 -61
- package/dist-lib/CopyButton-DRIT_f0k.js +0 -119
- package/dist-lib/DynamicIcon-DuBSz6TZ.js +0 -133
- package/dist-lib/FilterChips-Cv1tlXyo.js +0 -1031
- package/dist-lib/LayoutRenderer-d-tXYPze.js +0 -3239
- package/dist-lib/MenuItem-CfkVXPvC.js +0 -140
- package/dist-lib/MonacoJson-BG3S3GHX.js +0 -60
- package/dist-lib/Profile.impl-Cypk27ah.js +0 -527
- package/dist-lib/PropertyGridEditor-XrP6TZ5s.js +0 -4378
- package/dist-lib/RecordHeader-BfQ0_4wq.js +0 -217
- package/dist-lib/RefreshControl-CRdWPoF5.js +0 -195
- package/dist-lib/SSOCallbackPage.impl-Cfi2pQ59.js +0 -31
- package/dist-lib/SmartDetailPage.impl-BiIX0n7K.js +0 -1609
- package/dist-lib/SmartListPage.impl-Cu83Gv_G.js +0 -2818
- package/dist-lib/SmartRecordListPage.impl-DR6lq7HA.js +0 -795
- package/dist-lib/format-count-lyB4CPen.js +0 -943
- package/dist-lib/peekDraftStore-CaimrOhW.js +0 -200
- package/dist-lib/registry-CGe5kCXN.js +0 -119
- package/dist-lib/use-filter-value-labels-D3YDgUzg.js +0 -413
- package/dist-lib/useAgentConversation-rru-7hnF.js +0 -612
- package/dist-lib/useBranding-zcxEic2k.js +0 -41
- package/dist-lib/useBrandingChrome-bxaR3G1R.js +0 -170
- package/dist-lib/useCurrentScreen-BZOHBGQZ.js +0 -2522
- package/dist-lib/useImpersonation-DBIRRR70.js +0 -35
- package/dist-lib/useOwnRefresh-DJjaje52.js +0 -435
- package/dist-lib/useParams-BFLJi4n3.js +0 -133
- package/dist-lib/useProperties-B7opZ-iy.js +0 -81
- package/dist-lib/useScreenBack-DENlz844.js +0 -71
- package/dist-lib/useTabNavigate-CUqOmcMj.js +0 -78
- package/dist-lib/value-BuQVYx52.js +0 -194
- package/dist-lib/variants-vUtfBbE6.js +0 -1961
- /package/dist-lib/{JsonEditor-Dz1PQHC8.js → components/fields/JsonEditor.js} +0 -0
|
@@ -0,0 +1,986 @@
|
|
|
1
|
+
import { ApiError as e } from "../../types/api.js";
|
|
2
|
+
import { coerceDisplayString as t } from "../../lib/display-value.js";
|
|
3
|
+
import { formatOffsetTimestamp as n, formatWireDateTime as r } from "../../lib/timestamp.js";
|
|
4
|
+
import { entityAllowsCreateRoute as i, entityAllowsMutation as a, extractPkValues as o, fieldDisplayName as s, getDisplayValue as c, getPrimaryKeyFields as l, pkValuesFromId as u, pkValuesToId as d } from "../../types/schema.js";
|
|
5
|
+
import { useEmbed as f } from "../../embed/EmbedContext.js";
|
|
6
|
+
import { useFirstScreenSettled as p } from "../../lib/capabilityPrefetch.js";
|
|
7
|
+
import { useAuthStore as m } from "../../stores/auth.js";
|
|
8
|
+
import { useSchema as h } from "../../hooks/useSchema.js";
|
|
9
|
+
import { Icon as g } from "../primitives/Icons.js";
|
|
10
|
+
import { Btn as _ } from "../primitives/Btn.js";
|
|
11
|
+
import { IconBtn as ee } from "../primitives/IconBtn.js";
|
|
12
|
+
import { useText as v } from "../../hooks/useText.js";
|
|
13
|
+
import { useResponsiveMode as te } from "../../hooks/useResponsiveMode.js";
|
|
14
|
+
import { Spinner as ne } from "../primitives/Spinner.js";
|
|
15
|
+
import { DynamicIcon as re } from "../shared/DynamicIcon.js";
|
|
16
|
+
import { buildActionBody as y, executeAction as ie } from "../../api/data.js";
|
|
17
|
+
import { useTabStore as ae } from "../../stores/tabs.js";
|
|
18
|
+
import { useReportEmbedDirty as oe } from "../../embed/embed-dirty.js";
|
|
19
|
+
import { useEmbedNavigate as se } from "../../embed/useEmbedNavigate.js";
|
|
20
|
+
import { useTabNavigate as ce } from "../../hooks/useTabNavigate.js";
|
|
21
|
+
import { usePageStateStore as le } from "../../stores/page-state.js";
|
|
22
|
+
import { applyRowState as b, resolveActionLayoutForSlot as ue } from "../../lib/actions.js";
|
|
23
|
+
import { useScreenIsLive as de } from "../../stores/realtime.js";
|
|
24
|
+
import { useActionRunner as x } from "../actions/ActionRunner.js";
|
|
25
|
+
import { canonicalUrl as fe } from "../../lib/canonical-url.js";
|
|
26
|
+
import { useRegisterRetainedQuery as pe } from "../../hooks/usePageStateRuntime.js";
|
|
27
|
+
import { useBrandingChrome as me } from "../../hooks/useBrandingChrome.js";
|
|
28
|
+
import { objectQueryKey as he, useObject as ge } from "../../hooks/useObject.js";
|
|
29
|
+
import { discardFile as _e } from "../file-widgets/upload.js";
|
|
30
|
+
import { FileDraftScope as S, useFileDraftScope as ve } from "../file-widgets/draft-scope.js";
|
|
31
|
+
import { getEntityFileField as ye, getSchemaFieldValue as C, serializeSchemaFieldValue as w } from "../file-widgets/host.js";
|
|
32
|
+
import { buildFilesPayload as be, collectCommittedFileIds as T } from "../file-widgets/payload.js";
|
|
33
|
+
import { useCreateObject as xe, useRestoreEntity as Se, useUpdateObject as Ce } from "../../hooks/useMutations.js";
|
|
34
|
+
import { useScreenBack as we } from "../../hooks/useScreenBack.js";
|
|
35
|
+
import { usePlainScrollRestoration as Te } from "../../lib/scroll-restoration.js";
|
|
36
|
+
import { DetailSkeleton as Ee } from "../shared/LoadingSkeleton.js";
|
|
37
|
+
import { dispatchAction as E } from "../../lib/action-dispatch.js";
|
|
38
|
+
import { ResponsiveActionBar as D } from "../actions/ResponsiveActionBar.js";
|
|
39
|
+
import { effectiveScreenForRecord as De, variantActionCodesForRecord as O } from "../../lib/variants.js";
|
|
40
|
+
import { RefreshControl as Oe } from "../shared/RefreshControl.js";
|
|
41
|
+
import { useUnsavedInput as ke } from "../../hooks/useUnsavedInput.js";
|
|
42
|
+
import { AssociationTabs as Ae } from "../chrome/AssociationTabs.js";
|
|
43
|
+
import { DocumentsMenu as je } from "./DocumentsMenu.js";
|
|
44
|
+
import { canManageDocumentTemplates as Me } from "../../lib/document-templates.js";
|
|
45
|
+
import { RecordPanels as Ne } from "./RecordPanels.js";
|
|
46
|
+
import { StatusGroupsDisplay as Pe } from "../shared/StatusGroupsDisplay.js";
|
|
47
|
+
import { LayoutRenderer as Fe } from "../detail-layout/LayoutRenderer.js";
|
|
48
|
+
import { ErrorSummary as Ie } from "../detail-layout/ErrorSummary.js";
|
|
49
|
+
import { DetailHighlights as Le } from "../detail-layout/DetailHighlights.js";
|
|
50
|
+
import { DetailAuditStrip as Re } from "../detail-layout/DetailAuditStrip.js";
|
|
51
|
+
import { EvidenceBlock as ze } from "../detail-layout/EvidenceBlock.js";
|
|
52
|
+
import { RecordHeader as k } from "../chrome/RecordHeader.js";
|
|
53
|
+
import { PageShell as Be } from "../chrome/PageShell.js";
|
|
54
|
+
import { findInvalidEmailFields as Ve, findMissingRequiredFields as He, validatePendingChildren as Ue } from "../../lib/children-validation.js";
|
|
55
|
+
import { takePeekDraft as We } from "../list/peekDraftStore.js";
|
|
56
|
+
import { resolveCard as Ge } from "./list/cardProjection.js";
|
|
57
|
+
import { useCallback as A, useEffect as j, useMemo as M, useRef as Ke, useState as N } from "react";
|
|
58
|
+
import { Fragment as qe, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
59
|
+
import { useLocation as Je, useParams as Ye, useSearchParams as Xe } from "react-router";
|
|
60
|
+
//#region src/components/pages/SmartDetailPage.impl.tsx
|
|
61
|
+
var Ze = () => {}, Qe = { expand: ["evidence"] };
|
|
62
|
+
function I(e, t) {
|
|
63
|
+
return e.length === t.length && JSON.stringify(e) === JSON.stringify(t);
|
|
64
|
+
}
|
|
65
|
+
function $e({ entity: e, formData: t, record: n, isNew: r, pendingStatuses: i, pendingProperties: a, pendingChildren: o, childrenSnapshot: s }) {
|
|
66
|
+
let c = {}, l = be({
|
|
67
|
+
entity: e,
|
|
68
|
+
formData: t,
|
|
69
|
+
record: n,
|
|
70
|
+
isNew: r
|
|
71
|
+
}), u = T(l);
|
|
72
|
+
if (r) for (let [n, r] of Object.entries(t)) {
|
|
73
|
+
if (e.files?.has(n)) continue;
|
|
74
|
+
let t = w(e, n, r);
|
|
75
|
+
t !== "" && t != null && (c[n] = t);
|
|
76
|
+
}
|
|
77
|
+
else for (let [r, i] of Object.entries(t)) {
|
|
78
|
+
if (e.files?.has(r)) continue;
|
|
79
|
+
let t = n ? C(e, n, r) : void 0, a = w(e, r, i), o = w(e, r, t);
|
|
80
|
+
(a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (c[r] = a);
|
|
81
|
+
}
|
|
82
|
+
if (Object.keys(l).length > 0 && (c.$files = l), Object.keys(i).length > 0 && (c.$statuses = Object.entries(i).map(([e, t]) => ({
|
|
83
|
+
status_group_code: e,
|
|
84
|
+
status_code: t
|
|
85
|
+
}))), Object.keys(a).length > 0 && (c.$properties = Object.entries(a).map(([e, t]) => ({
|
|
86
|
+
property_code: e,
|
|
87
|
+
value: t
|
|
88
|
+
}))), o) {
|
|
89
|
+
let e = {};
|
|
90
|
+
for (let [t, n] of Object.entries(o)) {
|
|
91
|
+
let i = n.filter((e) => !e._deleted).map((e) => {
|
|
92
|
+
let { _key: t, _deleted: n, _dirty: r, ...i } = e;
|
|
93
|
+
return i;
|
|
94
|
+
}), a = s?.[t] ?? [];
|
|
95
|
+
(r || !I(i, a)) && (e[t] = i);
|
|
96
|
+
}
|
|
97
|
+
Object.keys(e).length > 0 && (c.$children = e);
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
payload: c,
|
|
101
|
+
committedFileIds: u
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function et(e, n) {
|
|
105
|
+
if (e) {
|
|
106
|
+
let t = o(e, n), r = d(t);
|
|
107
|
+
if (r.replace(/^\|+|\|+$/g, "")) return r;
|
|
108
|
+
}
|
|
109
|
+
return n.id == null ? crypto.randomUUID() : t(n.id);
|
|
110
|
+
}
|
|
111
|
+
function L({ screenCode: e }) {
|
|
112
|
+
return /* @__PURE__ */ P(S, { children: /* @__PURE__ */ P(R, { screenCode: e }) });
|
|
113
|
+
}
|
|
114
|
+
function R({ screenCode: t }) {
|
|
115
|
+
let _ = v(), ne = v("errors"), { id: re } = Ye(), y = se(), [ie, ce] = Xe(), { data: b } = h(), ue = m((e) => e.user), x = ve(), me = te(), S = b?.screens[t], w = S?.entity ? b?.entities[S.entity] : void 0, E = S?.entity, D = a(w, "create"), O = a(w, "update"), Oe = a(w, "restore"), je = (() => {
|
|
116
|
+
if (!w || !w.singleton || !w.prefilter) return;
|
|
117
|
+
let e = l(w);
|
|
118
|
+
if (e.length !== 1) return;
|
|
119
|
+
let t = w.prefilter[e[0]];
|
|
120
|
+
if (t === "$caller.user_id") return ue?.id;
|
|
121
|
+
if (t === "$caller.tenant_id") return ue?.tenant?.id;
|
|
122
|
+
})(), k = je !== void 0, I = k ? je : re, L = !k && I === "new", R = M(() => {
|
|
123
|
+
if (!I || L) return;
|
|
124
|
+
if (!w) return I;
|
|
125
|
+
let e = l(w);
|
|
126
|
+
if (e.length === 1) return { [e[0]]: I };
|
|
127
|
+
let t = u(I, e.length);
|
|
128
|
+
if (!t) return;
|
|
129
|
+
let n = {};
|
|
130
|
+
for (let r = 0; r < e.length; r++) n[e[r]] = t[r] ?? "";
|
|
131
|
+
return n;
|
|
132
|
+
}, [
|
|
133
|
+
I,
|
|
134
|
+
L,
|
|
135
|
+
w
|
|
136
|
+
]), z = M(() => {
|
|
137
|
+
if (R) return typeof R == "string" ? R : d(R);
|
|
138
|
+
}, [R]), nt = ge(E, R, Qe), { data: it, isLoading: at, error: ot } = nt;
|
|
139
|
+
p(!at);
|
|
140
|
+
let st = de(w?.realtime, E ?? ""), ct = E ? st : !1;
|
|
141
|
+
pe(he(E, R, Qe), !L);
|
|
142
|
+
let lt = xe(E ?? ""), ut = Ce(E ?? ""), dt = Se(E ?? ""), ft = Object.keys(w?.status_groups ?? {}).length > 0, pt = it?.data, mt = pt?.$statuses, ht = pt?.$properties, gt = ie.get("edit") === "true", [_t, vt] = N(L || gt), [B, yt] = N({}), [V, bt] = N({}), [H, xt] = N({}), [U, W] = N(void 0), [St, Ct] = N(!1), [wt, G] = N(void 0), [Tt, Et] = N(!1), Dt = L ? D : O, K = _t && Dt, Ot = f();
|
|
143
|
+
oe(K && !L, Ot.enabled);
|
|
144
|
+
let [kt, At] = N(() => {
|
|
145
|
+
let e = parseInt(S?.sidebar_width || "380", 10);
|
|
146
|
+
return isNaN(e) ? 380 : e;
|
|
147
|
+
}), jt = Ke(null), q = Ke(null), Mt = A((e) => {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
let t = jt.current;
|
|
150
|
+
if (!t) return;
|
|
151
|
+
let n = t.offsetWidth;
|
|
152
|
+
q.current = {
|
|
153
|
+
startX: e.clientX,
|
|
154
|
+
startW: n
|
|
155
|
+
};
|
|
156
|
+
let r = (e) => {
|
|
157
|
+
if (!q.current) return;
|
|
158
|
+
let n = q.current.startX - e.clientX, r = Math.max(280, Math.min(800, q.current.startW + n));
|
|
159
|
+
t.style.width = `${r}px`;
|
|
160
|
+
}, i = () => {
|
|
161
|
+
q.current && t && At(parseInt(t.style.width, 10) || q.current.startW), q.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
162
|
+
};
|
|
163
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
164
|
+
}, []), J = it?.data, Y = De(w, S, J ?? {});
|
|
165
|
+
j(() => {
|
|
166
|
+
let e = parseInt(Y?.sidebar_width || "380", 10);
|
|
167
|
+
At(Number.isNaN(e) ? 380 : e);
|
|
168
|
+
}, [Y?.sidebar_width]);
|
|
169
|
+
let X = typeof J?.$row_version == "string" ? J.$row_version : void 0, Nt = J?.$refs, Pt = Ke(X);
|
|
170
|
+
j(() => {
|
|
171
|
+
if (!X) return;
|
|
172
|
+
let e = Pt.current;
|
|
173
|
+
Pt.current = X, e && e !== X && _t && Ct(!0);
|
|
174
|
+
}, [_t, X]);
|
|
175
|
+
let Ft = !!w?.soft_delete && J != null && J[w.soft_delete] != null, Z = Je(), It = Ke(null);
|
|
176
|
+
Te({ scrollElementRef: It });
|
|
177
|
+
let Lt = !L && ot instanceof e && ot.status === 404, Rt = L && !i(w), zt = Ke(null);
|
|
178
|
+
j(() => {
|
|
179
|
+
if (!Lt) return;
|
|
180
|
+
let e = fe(Z);
|
|
181
|
+
zt.current !== e && (zt.current = e, le.getState().kill(e));
|
|
182
|
+
}, [Lt, Z]);
|
|
183
|
+
let { openTab: Bt, updateTabTitle: Vt, findTabByPathname: Ht } = ae();
|
|
184
|
+
j(() => {
|
|
185
|
+
if (!w || k || Ot.enabled) return;
|
|
186
|
+
let e = Z.pathname, t = _(Y?.display?.name) || _(w.display.name), n = Y?.display?.icon || w.display.icon;
|
|
187
|
+
Bt({
|
|
188
|
+
pathname: e,
|
|
189
|
+
search: "",
|
|
190
|
+
title: L ? _("record.new_title", "New {name}", { name: t }) : t,
|
|
191
|
+
derivedTitle: !L,
|
|
192
|
+
icon: n,
|
|
193
|
+
closable: !0
|
|
194
|
+
});
|
|
195
|
+
}, [
|
|
196
|
+
Z.pathname,
|
|
197
|
+
_,
|
|
198
|
+
Y?.display?.icon,
|
|
199
|
+
w?.display.icon,
|
|
200
|
+
L,
|
|
201
|
+
k,
|
|
202
|
+
Ot.enabled
|
|
203
|
+
]), j(() => {
|
|
204
|
+
if (!J || !w || k || Ot.enabled) return;
|
|
205
|
+
let e = Ht(Z.pathname);
|
|
206
|
+
if (e) {
|
|
207
|
+
let t = _(Y?.display?.name) || _(w.display.name), n = c(_, J, w), r = n && !String(n).startsWith("/") ? String(n) : t;
|
|
208
|
+
Vt(e.id, r, r === t);
|
|
209
|
+
}
|
|
210
|
+
}, [
|
|
211
|
+
J,
|
|
212
|
+
_,
|
|
213
|
+
w?.display.display_field,
|
|
214
|
+
Z.pathname,
|
|
215
|
+
k,
|
|
216
|
+
Ot.enabled
|
|
217
|
+
]);
|
|
218
|
+
let Ut = M(() => {
|
|
219
|
+
if (!w || !Dt) return /* @__PURE__ */ new Set();
|
|
220
|
+
let e = /* @__PURE__ */ new Set();
|
|
221
|
+
for (let [t, n] of w.fields) !n.auto && !n.primary && e.add(t);
|
|
222
|
+
for (let [t] of w.files ?? []) e.add(t);
|
|
223
|
+
return e;
|
|
224
|
+
}, [w, Dt]);
|
|
225
|
+
j(() => {
|
|
226
|
+
if (gt && J && w && O) {
|
|
227
|
+
if (_t || vt(!0), Object.keys(B).length === 0) {
|
|
228
|
+
let e = I ? We(I) : null;
|
|
229
|
+
if (e) {
|
|
230
|
+
let t = be({
|
|
231
|
+
entity: w,
|
|
232
|
+
formData: e,
|
|
233
|
+
record: void 0,
|
|
234
|
+
isNew: !0
|
|
235
|
+
});
|
|
236
|
+
T(t).forEach((e) => {
|
|
237
|
+
x.registerDraft({
|
|
238
|
+
fileId: e,
|
|
239
|
+
discard: () => _e(e)
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
let t = {};
|
|
244
|
+
Ut.forEach((n) => {
|
|
245
|
+
let r = e ? e[n] : void 0;
|
|
246
|
+
if (r !== void 0) {
|
|
247
|
+
t[n] = r;
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
let i = C(w, J, n);
|
|
251
|
+
t[n] = ye(w, n) ? i ?? null : i ?? "";
|
|
252
|
+
}), yt(t);
|
|
253
|
+
}
|
|
254
|
+
if (w.children !== void 0 && w.children.length > 0 && U === void 0) {
|
|
255
|
+
let e = J.$children;
|
|
256
|
+
if (e && Object.keys(e).length > 0) {
|
|
257
|
+
let t = {};
|
|
258
|
+
for (let [n, r] of Object.entries(e)) {
|
|
259
|
+
let e = b?.entities[n];
|
|
260
|
+
t[n] = r.map((t) => ({
|
|
261
|
+
...t,
|
|
262
|
+
_key: et(e, t)
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
265
|
+
W(t), G(e);
|
|
266
|
+
} else W({}), G({});
|
|
267
|
+
}
|
|
268
|
+
ce((e) => {
|
|
269
|
+
let t = new URLSearchParams(e);
|
|
270
|
+
return t.delete("edit"), t;
|
|
271
|
+
}, { replace: !0 });
|
|
272
|
+
}
|
|
273
|
+
}, [
|
|
274
|
+
gt,
|
|
275
|
+
J,
|
|
276
|
+
Ut,
|
|
277
|
+
O,
|
|
278
|
+
w,
|
|
279
|
+
U,
|
|
280
|
+
b
|
|
281
|
+
]), j(() => {
|
|
282
|
+
L && D && w?.children && w.children.length !== 0 && U === void 0 && (W({}), G({}));
|
|
283
|
+
}, [
|
|
284
|
+
L,
|
|
285
|
+
D,
|
|
286
|
+
w?.children
|
|
287
|
+
]);
|
|
288
|
+
let Wt = A(async () => {
|
|
289
|
+
if (await x.flushAllDrafts(), L) {
|
|
290
|
+
let e = Y?.route?.replace("/:id", "") ?? "/";
|
|
291
|
+
y(e);
|
|
292
|
+
} else vt(!1), yt({}), bt({}), xt({}), W(void 0), G(void 0), Et(!1);
|
|
293
|
+
}, [
|
|
294
|
+
x,
|
|
295
|
+
L,
|
|
296
|
+
Y,
|
|
297
|
+
y
|
|
298
|
+
]), Gt = A((e, t) => {
|
|
299
|
+
yt((n) => ({
|
|
300
|
+
...n,
|
|
301
|
+
[e]: t
|
|
302
|
+
}));
|
|
303
|
+
}, []), Q = M(() => {
|
|
304
|
+
if (!Y?.route) return "/";
|
|
305
|
+
let e = Y.route.split("/");
|
|
306
|
+
return e.pop(), e.join("/") || "/";
|
|
307
|
+
}, [Y]), Kt = M(() => !b?.screens || !Q || Q === "/" ? !1 : Object.values(b.screens).some((e) => e.route === Q), [b, Q]), qt = A(() => {
|
|
308
|
+
if (!Kt) {
|
|
309
|
+
y("/");
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
let e = Ht(Q)?.search ?? "";
|
|
313
|
+
y(e ? `${Q}?${e}` : Q);
|
|
314
|
+
}, [
|
|
315
|
+
Kt,
|
|
316
|
+
Q,
|
|
317
|
+
Ht,
|
|
318
|
+
y
|
|
319
|
+
]), Jt = we({ fallback: qt }), Yt = !k && (Jt.hasOriginBack || Jt.allowFallbackBack && !!Kt), Xt = M(() => {
|
|
320
|
+
if (!w) return {};
|
|
321
|
+
let e = {};
|
|
322
|
+
for (let t of He(w, B, L)) Ut.has(t) && (e[t] = _("record.field.required", "Required"));
|
|
323
|
+
for (let t of Ve(w, B)) Ut.has(t) && (e[t] = ne("record.email_invalid", "This is not a valid email address."));
|
|
324
|
+
return e;
|
|
325
|
+
}, [
|
|
326
|
+
_,
|
|
327
|
+
ne,
|
|
328
|
+
w,
|
|
329
|
+
B,
|
|
330
|
+
L,
|
|
331
|
+
Ut
|
|
332
|
+
]), Zt = Object.keys(Xt).length > 0, Qt = M(() => w ? $e({
|
|
333
|
+
entity: w,
|
|
334
|
+
formData: B,
|
|
335
|
+
record: J,
|
|
336
|
+
isNew: L,
|
|
337
|
+
pendingStatuses: V,
|
|
338
|
+
pendingProperties: H,
|
|
339
|
+
pendingChildren: U,
|
|
340
|
+
childrenSnapshot: wt
|
|
341
|
+
}) : {
|
|
342
|
+
payload: {},
|
|
343
|
+
committedFileIds: []
|
|
344
|
+
}, [
|
|
345
|
+
w,
|
|
346
|
+
B,
|
|
347
|
+
J,
|
|
348
|
+
L,
|
|
349
|
+
V,
|
|
350
|
+
H,
|
|
351
|
+
U,
|
|
352
|
+
wt
|
|
353
|
+
]), $t = Object.keys(Qt.payload).length > 0, en = K && (L || $t);
|
|
354
|
+
ke(en);
|
|
355
|
+
let tn = A(() => {
|
|
356
|
+
if (!E || !w || L && !D || !L && !O || (Et(!0), Zt)) return;
|
|
357
|
+
let t = { ...Qt.payload }, { committedFileIds: n } = Qt;
|
|
358
|
+
if (!L && !$t) {
|
|
359
|
+
vt(!1), bt({}), xt({}), W(void 0), G(void 0), Et(!1);
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
!L && X && (t.$row_version = X);
|
|
363
|
+
let r = () => {
|
|
364
|
+
vt(!1), Ct(!1), Et(!1), bt({}), xt({}), W(void 0), G(void 0);
|
|
365
|
+
};
|
|
366
|
+
L ? lt.mutate(t, { onSuccess: (e) => {
|
|
367
|
+
n.forEach((e) => x.markCommitted(e));
|
|
368
|
+
let t = e.data, i = w ? o(w, t) : {}, a = d(i);
|
|
369
|
+
y(a ? `${Q}/${encodeURIComponent(a)}` : Q, { replace: !0 }), r();
|
|
370
|
+
} }) : R && ut.mutate({
|
|
371
|
+
pkValues: R,
|
|
372
|
+
data: t
|
|
373
|
+
}, {
|
|
374
|
+
onSuccess: () => {
|
|
375
|
+
n.forEach((e) => x.markCommitted(e)), r();
|
|
376
|
+
},
|
|
377
|
+
onError: (t) => {
|
|
378
|
+
t instanceof e && t.code === "entity.stale_object" && Ct(!0);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}, [
|
|
382
|
+
x,
|
|
383
|
+
L,
|
|
384
|
+
D,
|
|
385
|
+
O,
|
|
386
|
+
E,
|
|
387
|
+
Zt,
|
|
388
|
+
Qt,
|
|
389
|
+
$t,
|
|
390
|
+
lt,
|
|
391
|
+
ut,
|
|
392
|
+
w,
|
|
393
|
+
y,
|
|
394
|
+
Q,
|
|
395
|
+
X,
|
|
396
|
+
R
|
|
397
|
+
]), nn = A((e, t) => {
|
|
398
|
+
W((n) => ({
|
|
399
|
+
...n ?? {},
|
|
400
|
+
[e]: t
|
|
401
|
+
}));
|
|
402
|
+
}, []), rn = A(() => {
|
|
403
|
+
R && !L && Oe && dt.mutate(R);
|
|
404
|
+
}, [
|
|
405
|
+
R,
|
|
406
|
+
L,
|
|
407
|
+
Oe,
|
|
408
|
+
dt
|
|
409
|
+
]), an = M(() => Ue(U, b), [U, b]), on = Object.keys(an).length > 0;
|
|
410
|
+
if (!Y || !w) return null;
|
|
411
|
+
if (!L && at) return /* @__PURE__ */ P(Ee, {});
|
|
412
|
+
if (Rt) return /* @__PURE__ */ F("div", {
|
|
413
|
+
style: { padding: 24 },
|
|
414
|
+
children: [/* @__PURE__ */ F("div", {
|
|
415
|
+
style: {
|
|
416
|
+
display: "flex",
|
|
417
|
+
alignItems: "center",
|
|
418
|
+
gap: 8,
|
|
419
|
+
marginBottom: 8
|
|
420
|
+
},
|
|
421
|
+
children: [Yt && /* @__PURE__ */ P(ee, {
|
|
422
|
+
icon: /* @__PURE__ */ P(g.back, { size: 14 }),
|
|
423
|
+
onClick: Jt.goBack,
|
|
424
|
+
title: _("record.back", "Back")
|
|
425
|
+
}), /* @__PURE__ */ P("h1", {
|
|
426
|
+
style: {
|
|
427
|
+
margin: 0,
|
|
428
|
+
fontSize: 18,
|
|
429
|
+
fontWeight: 600,
|
|
430
|
+
color: "var(--text)"
|
|
431
|
+
},
|
|
432
|
+
children: _("record.create_closed.title", "Not Available")
|
|
433
|
+
})]
|
|
434
|
+
}), /* @__PURE__ */ P("p", {
|
|
435
|
+
style: { color: "var(--text-3)" },
|
|
436
|
+
children: _("record.create_closed.body", "This record type is not created from a form.")
|
|
437
|
+
})]
|
|
438
|
+
});
|
|
439
|
+
if (!L && !J || Lt) return /* @__PURE__ */ F("div", {
|
|
440
|
+
style: { padding: 24 },
|
|
441
|
+
children: [/* @__PURE__ */ F("div", {
|
|
442
|
+
style: {
|
|
443
|
+
display: "flex",
|
|
444
|
+
alignItems: "center",
|
|
445
|
+
gap: 8,
|
|
446
|
+
marginBottom: 8
|
|
447
|
+
},
|
|
448
|
+
children: [Yt && /* @__PURE__ */ P(ee, {
|
|
449
|
+
icon: /* @__PURE__ */ P(g.back, { size: 14 }),
|
|
450
|
+
onClick: Jt.goBack,
|
|
451
|
+
title: _("record.back", "Back")
|
|
452
|
+
}), /* @__PURE__ */ P("h1", {
|
|
453
|
+
style: {
|
|
454
|
+
margin: 0,
|
|
455
|
+
fontSize: 18,
|
|
456
|
+
fontWeight: 600,
|
|
457
|
+
color: "var(--text)"
|
|
458
|
+
},
|
|
459
|
+
children: _("record.missing.title", "Not Found")
|
|
460
|
+
})]
|
|
461
|
+
}), /* @__PURE__ */ P("p", {
|
|
462
|
+
style: { color: "var(--text-3)" },
|
|
463
|
+
children: ne("entity.not_found", "This record does not exist.")
|
|
464
|
+
})]
|
|
465
|
+
});
|
|
466
|
+
let sn = w.display, cn = _(Y.display?.name) || _(sn.name), ln = c(_, J, w), un = L ? _("record.new_title", "New {name}", { name: cn }) : ln ? String(ln) : cn, dn = lt.isPending || ut.isPending, fn = Y.responsive?.[me.category]?.layout, pn = fn?.tabs ?? (me.isPhone ? "sections" : void 0), mn = fn?.header_card === !0 ? Ge({
|
|
467
|
+
entity: w,
|
|
468
|
+
screen: Y
|
|
469
|
+
}) : void 0, $ = {
|
|
470
|
+
schema: b,
|
|
471
|
+
entity: w,
|
|
472
|
+
entityCode: E,
|
|
473
|
+
recordId: z ?? I ?? "",
|
|
474
|
+
record: K ? {
|
|
475
|
+
...J ?? {},
|
|
476
|
+
...B
|
|
477
|
+
} : J ?? {},
|
|
478
|
+
isNew: L,
|
|
479
|
+
mode: K ? "edit" : "display",
|
|
480
|
+
onFieldChange: K ? Gt : void 0,
|
|
481
|
+
refs: Nt,
|
|
482
|
+
objectProperties: (() => {
|
|
483
|
+
let e = ht ?? [];
|
|
484
|
+
if (!K || Object.keys(H).length === 0) return e.length > 0 ? e : void 0;
|
|
485
|
+
let t = e.map((e) => H[e.property_code] === void 0 ? e : {
|
|
486
|
+
...e,
|
|
487
|
+
value: H[e.property_code]
|
|
488
|
+
});
|
|
489
|
+
for (let [n, r] of Object.entries(H)) e.some((e) => e.property_code === n) || t.push({
|
|
490
|
+
property_code: n,
|
|
491
|
+
name: {},
|
|
492
|
+
type: "string",
|
|
493
|
+
value: r
|
|
494
|
+
});
|
|
495
|
+
return t;
|
|
496
|
+
})(),
|
|
497
|
+
onSetProperty: L || !O ? void 0 : K ? (e, t) => xt((n) => ({
|
|
498
|
+
...n,
|
|
499
|
+
[e]: t
|
|
500
|
+
})) : void 0,
|
|
501
|
+
isPropertyPending: !1,
|
|
502
|
+
objectStatuses: (() => {
|
|
503
|
+
let e = mt ?? [];
|
|
504
|
+
if (!K || Object.keys(V).length === 0) return e.length > 0 ? e : void 0;
|
|
505
|
+
let t = e.map((e) => V[e.group_code] === void 0 ? e : {
|
|
506
|
+
...e,
|
|
507
|
+
status_code: V[e.group_code]
|
|
508
|
+
});
|
|
509
|
+
for (let [n, i] of Object.entries(V)) e.some((e) => e.group_code === n) || t.push({
|
|
510
|
+
group_code: n,
|
|
511
|
+
status_code: i,
|
|
512
|
+
status_name: {},
|
|
513
|
+
set_at: r()
|
|
514
|
+
});
|
|
515
|
+
return t;
|
|
516
|
+
})(),
|
|
517
|
+
onSetStatus: L || !O ? void 0 : K ? (e, t) => bt((n) => ({
|
|
518
|
+
...n,
|
|
519
|
+
[e]: t
|
|
520
|
+
})) : void 0,
|
|
521
|
+
isStatusPending: !1,
|
|
522
|
+
pendingChildren: K ? U : void 0,
|
|
523
|
+
onChildrenChange: K ? nn : void 0,
|
|
524
|
+
childValidationErrors: K ? an : void 0,
|
|
525
|
+
fieldErrors: K && Tt ? Xt : void 0,
|
|
526
|
+
detailTabsPresentation: pn,
|
|
527
|
+
relatedRecordsPresentation: fn?.related_records
|
|
528
|
+
}, hn = !!Y.sidebar && Y.sidebar.length > 0, gn = fn?.sidebar === "hidden", _n = hn && !gn && !me.isDesktop, vn = hn && !gn && me.isDesktop, yn = !L && J ? /* @__PURE__ */ P(Le, {
|
|
529
|
+
screen: Y,
|
|
530
|
+
entity: w,
|
|
531
|
+
entityCode: E,
|
|
532
|
+
record: J,
|
|
533
|
+
refs: Nt,
|
|
534
|
+
objectStatuses: mt,
|
|
535
|
+
schema: b
|
|
536
|
+
}) : void 0, bn = /* @__PURE__ */ P(rt, {
|
|
537
|
+
title: un,
|
|
538
|
+
recordId: I,
|
|
539
|
+
editing: K,
|
|
540
|
+
isNew: L,
|
|
541
|
+
isRecordDeleted: Ft,
|
|
542
|
+
dirty: en,
|
|
543
|
+
isSaving: dn,
|
|
544
|
+
hasChildErrors: on,
|
|
545
|
+
hasFieldErrors: Tt && Zt,
|
|
546
|
+
canRestore: Oe,
|
|
547
|
+
entity: w,
|
|
548
|
+
screen: Y,
|
|
549
|
+
globalActions: b?.actions,
|
|
550
|
+
entityCode: E,
|
|
551
|
+
record: J,
|
|
552
|
+
id: I,
|
|
553
|
+
listRoute: Q,
|
|
554
|
+
listRouteExists: !!Kt,
|
|
555
|
+
highlights: yn,
|
|
556
|
+
showBack: Yt,
|
|
557
|
+
onBack: Jt.goBack,
|
|
558
|
+
onCancelEdit: Wt,
|
|
559
|
+
onSave: tn,
|
|
560
|
+
onRestore: rn,
|
|
561
|
+
isRestoring: dt.isPending,
|
|
562
|
+
refreshControl: {
|
|
563
|
+
refetch: nt.refetch,
|
|
564
|
+
isLoading: nt.isLoading,
|
|
565
|
+
isLive: ct
|
|
566
|
+
},
|
|
567
|
+
isRealtimeEntity: w?.realtime === !0,
|
|
568
|
+
canManageTemplates: Me(b)
|
|
569
|
+
}), xn = Ft && /* @__PURE__ */ F("div", {
|
|
570
|
+
style: {
|
|
571
|
+
display: "flex",
|
|
572
|
+
alignItems: "center",
|
|
573
|
+
gap: 8,
|
|
574
|
+
padding: "10px 14px",
|
|
575
|
+
marginBottom: 12,
|
|
576
|
+
borderRadius: "var(--radius-md)",
|
|
577
|
+
border: "1px solid var(--danger)",
|
|
578
|
+
background: "var(--danger-soft)",
|
|
579
|
+
color: "var(--danger)",
|
|
580
|
+
fontSize: 12.5
|
|
581
|
+
},
|
|
582
|
+
children: [/* @__PURE__ */ P(g.warning, { size: 14 }), /* @__PURE__ */ P("span", { children: _("record.deleted_banner", "This record was deleted on {date}", { date: n(String(J[w.soft_delete])) }) })]
|
|
583
|
+
}), Sn = St && /* @__PURE__ */ F("div", {
|
|
584
|
+
style: {
|
|
585
|
+
display: "flex",
|
|
586
|
+
alignItems: "center",
|
|
587
|
+
gap: 8,
|
|
588
|
+
padding: "10px 14px",
|
|
589
|
+
marginBottom: 12,
|
|
590
|
+
borderRadius: "var(--radius-md)",
|
|
591
|
+
border: "1px solid var(--warn)",
|
|
592
|
+
background: "var(--warn-soft)",
|
|
593
|
+
color: "var(--warn)",
|
|
594
|
+
fontSize: 12.5
|
|
595
|
+
},
|
|
596
|
+
children: [/* @__PURE__ */ P(g.warning, { size: 14 }), /* @__PURE__ */ P("span", { children: _("record.changed_on_server", "This record changed on the server while you were viewing or editing it.") })]
|
|
597
|
+
}), Cn = K && Tt && Zt && /* @__PURE__ */ P(Ie, {
|
|
598
|
+
errors: Object.entries(Xt).map(([e, t]) => {
|
|
599
|
+
let n = w.fields.get(e);
|
|
600
|
+
return {
|
|
601
|
+
name: e,
|
|
602
|
+
label: n ? s(_, n, e, b?.entities) : e,
|
|
603
|
+
message: t
|
|
604
|
+
};
|
|
605
|
+
}),
|
|
606
|
+
onJump: (e) => {
|
|
607
|
+
let t = document.getElementById(`${E}-${e}`);
|
|
608
|
+
t && (t.scrollIntoView({
|
|
609
|
+
block: "center",
|
|
610
|
+
behavior: "smooth"
|
|
611
|
+
}), t.focus?.());
|
|
612
|
+
}
|
|
613
|
+
}), wn = ft && !L && !(Y.items && Y.items.length > 0) && /* @__PURE__ */ P("div", {
|
|
614
|
+
className: "mb-4",
|
|
615
|
+
children: /* @__PURE__ */ P(Pe, {
|
|
616
|
+
statusGroups: w.status_groups ?? {},
|
|
617
|
+
objectStatuses: $.objectStatuses,
|
|
618
|
+
onSetStatus: O && K ? (e, t) => bt((n) => ({
|
|
619
|
+
...n,
|
|
620
|
+
[e]: t
|
|
621
|
+
})) : Ze,
|
|
622
|
+
isPending: !1,
|
|
623
|
+
mode: K ? "edit" : "display"
|
|
624
|
+
})
|
|
625
|
+
}), Tn = w.evidence_covered && !L && J && /* @__PURE__ */ P("div", {
|
|
626
|
+
className: "mb-4",
|
|
627
|
+
children: /* @__PURE__ */ P(ze, { evidence: J.$evidence })
|
|
628
|
+
}), En = /* @__PURE__ */ F(qe, { children: [
|
|
629
|
+
mn && (J || L) && /* @__PURE__ */ P(tt, {
|
|
630
|
+
card: mn,
|
|
631
|
+
entity: w,
|
|
632
|
+
record: $.record,
|
|
633
|
+
objectStatuses: $.objectStatuses,
|
|
634
|
+
objectProperties: $.objectProperties
|
|
635
|
+
}),
|
|
636
|
+
Y.items && Y.items.length > 0 && (J || L) && b && /* @__PURE__ */ P(Fe, {
|
|
637
|
+
nodes: Y.items,
|
|
638
|
+
ctx: $
|
|
639
|
+
}),
|
|
640
|
+
!L && I && E && w.associations && Object.keys(w.associations).length > 0 && b && /* @__PURE__ */ P(Ae, {
|
|
641
|
+
entityCode: E,
|
|
642
|
+
recordId: z ?? I ?? "",
|
|
643
|
+
associations: w.associations,
|
|
644
|
+
schema: b
|
|
645
|
+
}),
|
|
646
|
+
!L && I && E && /* @__PURE__ */ P(Ne, {
|
|
647
|
+
entity: w,
|
|
648
|
+
entityCode: E,
|
|
649
|
+
objectId: z ?? I,
|
|
650
|
+
schema: b
|
|
651
|
+
}),
|
|
652
|
+
!L && J && b && /* @__PURE__ */ P(Re, {
|
|
653
|
+
screen: Y,
|
|
654
|
+
entity: w,
|
|
655
|
+
entityCode: E,
|
|
656
|
+
record: J,
|
|
657
|
+
refs: Nt,
|
|
658
|
+
schema: b
|
|
659
|
+
})
|
|
660
|
+
] }), Dn = /* @__PURE__ */ F(qe, { children: [
|
|
661
|
+
bn,
|
|
662
|
+
Sn,
|
|
663
|
+
xn,
|
|
664
|
+
Cn,
|
|
665
|
+
wn,
|
|
666
|
+
Tn
|
|
667
|
+
] });
|
|
668
|
+
return vn ? /* @__PURE__ */ F("div", {
|
|
669
|
+
style: {
|
|
670
|
+
height: "100%",
|
|
671
|
+
display: "flex",
|
|
672
|
+
overflow: "hidden",
|
|
673
|
+
background: "var(--background)"
|
|
674
|
+
},
|
|
675
|
+
children: [
|
|
676
|
+
/* @__PURE__ */ P("div", {
|
|
677
|
+
style: {
|
|
678
|
+
flex: 1,
|
|
679
|
+
minWidth: 0,
|
|
680
|
+
height: "100%"
|
|
681
|
+
},
|
|
682
|
+
children: /* @__PURE__ */ P(Be, {
|
|
683
|
+
scrollRef: It,
|
|
684
|
+
header: Dn,
|
|
685
|
+
children: En
|
|
686
|
+
})
|
|
687
|
+
}),
|
|
688
|
+
/* @__PURE__ */ P("div", {
|
|
689
|
+
className: "detail-resize-handle",
|
|
690
|
+
onMouseDown: Mt,
|
|
691
|
+
title: _("record.layout.drag_to_resize", "Drag to resize"),
|
|
692
|
+
children: /* @__PURE__ */ P("div", { style: {
|
|
693
|
+
position: "absolute",
|
|
694
|
+
top: 0,
|
|
695
|
+
bottom: 0,
|
|
696
|
+
left: "50%",
|
|
697
|
+
transform: "translateX(-50%)",
|
|
698
|
+
width: 1,
|
|
699
|
+
background: "var(--border)"
|
|
700
|
+
} })
|
|
701
|
+
}),
|
|
702
|
+
/* @__PURE__ */ P("div", {
|
|
703
|
+
ref: jt,
|
|
704
|
+
style: {
|
|
705
|
+
flexShrink: 0,
|
|
706
|
+
height: "100%",
|
|
707
|
+
width: `${kt}px`
|
|
708
|
+
},
|
|
709
|
+
children: (J || L) && b && /* @__PURE__ */ P(Fe, {
|
|
710
|
+
nodes: Y.sidebar,
|
|
711
|
+
ctx: $
|
|
712
|
+
})
|
|
713
|
+
})
|
|
714
|
+
]
|
|
715
|
+
}) : /* @__PURE__ */ F(Be, {
|
|
716
|
+
scrollRef: It,
|
|
717
|
+
header: Dn,
|
|
718
|
+
children: [En, _n && (J || L) && b && /* @__PURE__ */ P("div", {
|
|
719
|
+
"data-testid": "detail-sidebar-inline",
|
|
720
|
+
style: {
|
|
721
|
+
display: "flex",
|
|
722
|
+
flexDirection: "column",
|
|
723
|
+
gap: 16,
|
|
724
|
+
minWidth: 0
|
|
725
|
+
},
|
|
726
|
+
children: /* @__PURE__ */ P(Fe, {
|
|
727
|
+
nodes: Y.sidebar,
|
|
728
|
+
ctx: $
|
|
729
|
+
})
|
|
730
|
+
})]
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
function tt({ card: e, entity: n, record: r, objectStatuses: i, objectProperties: a }) {
|
|
734
|
+
let o = v(), s = (e) => {
|
|
735
|
+
let s = z(o, n, e, r, i, a);
|
|
736
|
+
return s != null && t(s) !== "";
|
|
737
|
+
}, l = (e) => {
|
|
738
|
+
let s = z(o, n, e, r, i, a);
|
|
739
|
+
return t(s) || /* @__PURE__ */ P("span", {
|
|
740
|
+
style: { color: "var(--text-3)" },
|
|
741
|
+
children: "-"
|
|
742
|
+
});
|
|
743
|
+
}, u = e.titleUsesDisplay ? c(o, r, n) : e.titleField ? z(o, n, e.titleField, r, i, a) : void 0, d = t(u) || o(n.display?.name) || o("record.fallback_title", "Record"), f = e.badgeFields.filter((t) => !e.hideEmptyFields || s(t)), p = e.bodyFields.filter((t) => !e.hideEmptyFields || s(t)), m = e.metaFields.filter((t) => !e.hideEmptyFields || s(t));
|
|
744
|
+
return /* @__PURE__ */ F("section", {
|
|
745
|
+
"data-testid": "detail-header-card",
|
|
746
|
+
style: {
|
|
747
|
+
width: "100%",
|
|
748
|
+
minWidth: 0,
|
|
749
|
+
border: "1px solid var(--border)",
|
|
750
|
+
borderRadius: "var(--radius-md)",
|
|
751
|
+
background: "var(--surface)",
|
|
752
|
+
boxShadow: "var(--shadow-xs)",
|
|
753
|
+
padding: 14,
|
|
754
|
+
boxSizing: "border-box"
|
|
755
|
+
},
|
|
756
|
+
children: [
|
|
757
|
+
/* @__PURE__ */ F("div", {
|
|
758
|
+
style: { minWidth: 0 },
|
|
759
|
+
children: [/* @__PURE__ */ P("div", {
|
|
760
|
+
style: {
|
|
761
|
+
fontSize: 15,
|
|
762
|
+
lineHeight: 1.25,
|
|
763
|
+
fontWeight: 700,
|
|
764
|
+
color: "var(--text)",
|
|
765
|
+
overflowWrap: "anywhere"
|
|
766
|
+
},
|
|
767
|
+
children: d
|
|
768
|
+
}), e.subtitleField && /* @__PURE__ */ P("div", {
|
|
769
|
+
style: {
|
|
770
|
+
marginTop: 4,
|
|
771
|
+
fontSize: 12.5,
|
|
772
|
+
lineHeight: 1.35,
|
|
773
|
+
color: "var(--text-3)",
|
|
774
|
+
overflowWrap: "anywhere"
|
|
775
|
+
},
|
|
776
|
+
children: l(e.subtitleField)
|
|
777
|
+
})]
|
|
778
|
+
}),
|
|
779
|
+
f.length > 0 && /* @__PURE__ */ P("div", {
|
|
780
|
+
style: {
|
|
781
|
+
display: "flex",
|
|
782
|
+
flexWrap: "wrap",
|
|
783
|
+
gap: 6,
|
|
784
|
+
marginTop: 10
|
|
785
|
+
},
|
|
786
|
+
children: f.map((e) => /* @__PURE__ */ P("span", {
|
|
787
|
+
style: {
|
|
788
|
+
minWidth: 0,
|
|
789
|
+
maxWidth: "100%",
|
|
790
|
+
borderRadius: 999,
|
|
791
|
+
background: "var(--surface-2)",
|
|
792
|
+
color: "var(--text-2)",
|
|
793
|
+
padding: "2px 8px",
|
|
794
|
+
fontSize: 12,
|
|
795
|
+
lineHeight: 1.4,
|
|
796
|
+
overflowWrap: "anywhere"
|
|
797
|
+
},
|
|
798
|
+
children: l(e)
|
|
799
|
+
}, e))
|
|
800
|
+
}),
|
|
801
|
+
p.length > 0 && /* @__PURE__ */ P("dl", {
|
|
802
|
+
style: {
|
|
803
|
+
display: "grid",
|
|
804
|
+
gridTemplateColumns: "minmax(84px, max-content) minmax(0, 1fr)",
|
|
805
|
+
gap: "6px 10px",
|
|
806
|
+
margin: "12px 0 0",
|
|
807
|
+
fontSize: 12.5,
|
|
808
|
+
lineHeight: 1.35
|
|
809
|
+
},
|
|
810
|
+
children: p.map((e) => /* @__PURE__ */ F("div", {
|
|
811
|
+
style: { display: "contents" },
|
|
812
|
+
children: [/* @__PURE__ */ P("dt", {
|
|
813
|
+
style: { color: "var(--text-3)" },
|
|
814
|
+
children: nt(o, n, e)
|
|
815
|
+
}), /* @__PURE__ */ P("dd", {
|
|
816
|
+
style: {
|
|
817
|
+
margin: 0,
|
|
818
|
+
color: "var(--text-2)",
|
|
819
|
+
minWidth: 0,
|
|
820
|
+
overflowWrap: "anywhere"
|
|
821
|
+
},
|
|
822
|
+
children: l(e)
|
|
823
|
+
})]
|
|
824
|
+
}, e))
|
|
825
|
+
}),
|
|
826
|
+
m.length > 0 && /* @__PURE__ */ P("div", {
|
|
827
|
+
style: {
|
|
828
|
+
display: "flex",
|
|
829
|
+
flexWrap: "wrap",
|
|
830
|
+
gap: 10,
|
|
831
|
+
marginTop: 10,
|
|
832
|
+
color: "var(--text-3)",
|
|
833
|
+
fontSize: 11.5
|
|
834
|
+
},
|
|
835
|
+
children: m.map((e) => /* @__PURE__ */ F("span", {
|
|
836
|
+
style: {
|
|
837
|
+
minWidth: 0,
|
|
838
|
+
overflowWrap: "anywhere"
|
|
839
|
+
},
|
|
840
|
+
children: [
|
|
841
|
+
nt(o, n, e),
|
|
842
|
+
": ",
|
|
843
|
+
l(e)
|
|
844
|
+
]
|
|
845
|
+
}, e))
|
|
846
|
+
})
|
|
847
|
+
]
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
function z(e, t, n, r, i, a) {
|
|
851
|
+
if (n.startsWith("$status.")) {
|
|
852
|
+
let t = n.slice(8), r = i?.find((e) => e.group_code === t);
|
|
853
|
+
return e(r?.status_name) || r?.status_code;
|
|
854
|
+
}
|
|
855
|
+
if (n.startsWith("$property.")) {
|
|
856
|
+
let e = n.slice(10);
|
|
857
|
+
return a?.find((t) => t.property_code === e)?.value;
|
|
858
|
+
}
|
|
859
|
+
return C(t, r, n);
|
|
860
|
+
}
|
|
861
|
+
function nt(e, t, n) {
|
|
862
|
+
if (n.startsWith("$status.")) return n.slice(8);
|
|
863
|
+
if (n.startsWith("$property.")) return n.slice(10);
|
|
864
|
+
let r = t.fields.get(n);
|
|
865
|
+
return r ? s(e, r, n) : n;
|
|
866
|
+
}
|
|
867
|
+
function rt({ title: e, recordId: t, editing: n, isNew: r, isRecordDeleted: i, dirty: a, isSaving: o, hasChildErrors: s, hasFieldErrors: c, canRestore: l, entity: u, screen: d, globalActions: f, entityCode: p, record: m, id: h, listRoute: ee, listRouteExists: te, highlights: ae, showBack: oe, onBack: de, onCancelEdit: pe, onSave: he, onRestore: ge, isRestoring: _e, refreshControl: S, isRealtimeEntity: ve, canManageTemplates: ye }) {
|
|
868
|
+
let C = v(), w = v("errors"), { run: be } = x(), T = me("detail"), xe = ce(), Se = se(), Ce = ue(d?.action_layout, u?.action_layout, u?.actions, f, "detail_toolbar"), we = ue(d?.action_layout, u?.action_layout, u?.actions, f, "detail"), Te = b(C, we, u?.actions, f, m ?? {}, [], O(u, m ?? {})), Ee = b(C, Ce, u?.actions, f, m ?? {}, [], O(u, m ?? {})), De = M(() => {
|
|
869
|
+
if (!u) return;
|
|
870
|
+
let e = h ? [h] : [];
|
|
871
|
+
return {
|
|
872
|
+
entity: u,
|
|
873
|
+
entityCode: p ?? "",
|
|
874
|
+
screen: d,
|
|
875
|
+
screenRoute: d?.route ?? "",
|
|
876
|
+
selectedRows: m ? [m] : [],
|
|
877
|
+
selectedIds: e,
|
|
878
|
+
t: C,
|
|
879
|
+
tabNavigate: (e, t) => xe(e, {
|
|
880
|
+
title: t?.title,
|
|
881
|
+
icon: t?.icon,
|
|
882
|
+
search: t?.search
|
|
883
|
+
}),
|
|
884
|
+
runActionApi: (e, t) => ie(e, t),
|
|
885
|
+
recordHref: (e) => e === h && d?.route ? d.route.replace(":id", encodeURIComponent(e)) : null
|
|
886
|
+
};
|
|
887
|
+
}, [
|
|
888
|
+
u,
|
|
889
|
+
p,
|
|
890
|
+
d,
|
|
891
|
+
h,
|
|
892
|
+
m,
|
|
893
|
+
C,
|
|
894
|
+
xe
|
|
895
|
+
]), ke = (e, t) => {
|
|
896
|
+
let n = E(w, e, t, { row: m ?? void 0 });
|
|
897
|
+
if (n === null) return;
|
|
898
|
+
let r = h ? [h] : [], i = e === "__delete" && te ? ee : null;
|
|
899
|
+
return be({
|
|
900
|
+
action: t,
|
|
901
|
+
title: C(t.display?.name) || e,
|
|
902
|
+
row: m ?? void 0,
|
|
903
|
+
execute: (e) => ie(n, y(e, r)),
|
|
904
|
+
onSuccess: i ? () => {
|
|
905
|
+
le.getState().kill(fe(location)), Se(i, { replace: !0 });
|
|
906
|
+
} : void 0
|
|
907
|
+
});
|
|
908
|
+
}, Ae = T.isVisible("show_actions") && !r && h && Te.length > 0 ? /* @__PURE__ */ P(D, {
|
|
909
|
+
layout: Te,
|
|
910
|
+
row: m,
|
|
911
|
+
onRun: ke,
|
|
912
|
+
kind: "detail",
|
|
913
|
+
entityActions: u?.actions,
|
|
914
|
+
globalActions: f,
|
|
915
|
+
reservedRightWidth: 0,
|
|
916
|
+
widgetContext: De
|
|
917
|
+
}) : null, Me = !r && h ? /* @__PURE__ */ P(Oe, {
|
|
918
|
+
liveObject: S,
|
|
919
|
+
realtime: ve
|
|
920
|
+
}) : null, Ne = T.isVisible("show_actions") && !r && h && Ee.length > 0 ? /* @__PURE__ */ F("div", {
|
|
921
|
+
style: {
|
|
922
|
+
display: "flex",
|
|
923
|
+
justifyContent: "flex-end",
|
|
924
|
+
alignItems: "center",
|
|
925
|
+
gap: 8,
|
|
926
|
+
marginTop: 10
|
|
927
|
+
},
|
|
928
|
+
children: [Ae ? null : Me, /* @__PURE__ */ P(D, {
|
|
929
|
+
layout: Ee,
|
|
930
|
+
row: m,
|
|
931
|
+
onRun: ke,
|
|
932
|
+
kind: "detail",
|
|
933
|
+
entityActions: u?.actions,
|
|
934
|
+
globalActions: f,
|
|
935
|
+
reservedRightWidth: 0,
|
|
936
|
+
widgetContext: De,
|
|
937
|
+
ariaLabel: Ae ? C("record.toolbar_actions", "Detail toolbar actions") : C("record.page_actions", "Page actions")
|
|
938
|
+
})]
|
|
939
|
+
}) : null, Pe = T.isVisible("show_actions") && !r && h && p ? /* @__PURE__ */ P(je, {
|
|
940
|
+
entityCode: p,
|
|
941
|
+
scope: "detail",
|
|
942
|
+
objectIds: [h],
|
|
943
|
+
capability: u?.documents,
|
|
944
|
+
canManageTemplates: ye
|
|
945
|
+
}) : null, Fe = i ? l ? /* @__PURE__ */ P(_, {
|
|
946
|
+
kind: "primary",
|
|
947
|
+
icon: P(_e ? ne : g.refresh, { size: 13 }),
|
|
948
|
+
onClick: ge,
|
|
949
|
+
disabled: _e,
|
|
950
|
+
children: _e ? C("record.restoring", "Restoring…") : C("record.restore", "Restore")
|
|
951
|
+
}) : null : n ? /* @__PURE__ */ F(qe, { children: [/* @__PURE__ */ P(_, {
|
|
952
|
+
icon: /* @__PURE__ */ P(g.x, { size: 13 }),
|
|
953
|
+
onClick: pe,
|
|
954
|
+
disabled: o,
|
|
955
|
+
children: C("dialog.cancel", "Cancel")
|
|
956
|
+
}), /* @__PURE__ */ P(_, {
|
|
957
|
+
kind: "primary",
|
|
958
|
+
icon: P(o ? ne : g.save, { size: 13 }),
|
|
959
|
+
onClick: he,
|
|
960
|
+
disabled: o || s || c,
|
|
961
|
+
title: s ? C("record.save.fix_child_rows", "Fix errors in child rows") : c ? C("record.save.fix_fields", "Fix the highlighted fields") : void 0,
|
|
962
|
+
children: o ? C("dialog.saving", "Saving…") : C("dialog.save", "Save")
|
|
963
|
+
})] }) : !r && h ? Ae ? /* @__PURE__ */ F("span", {
|
|
964
|
+
style: { display: "contents" },
|
|
965
|
+
children: [Pe, Ae]
|
|
966
|
+
}) : Pe : null;
|
|
967
|
+
return /* @__PURE__ */ F(qe, { children: [/* @__PURE__ */ P(k, {
|
|
968
|
+
icon: u?.display.icon ? /* @__PURE__ */ P(re, {
|
|
969
|
+
name: u.display.icon,
|
|
970
|
+
size: 16
|
|
971
|
+
}) : void 0,
|
|
972
|
+
title: e,
|
|
973
|
+
description: C(d?.display?.description) || C(u?.display?.description),
|
|
974
|
+
recordId: t,
|
|
975
|
+
highlights: ae,
|
|
976
|
+
identityControls: !i && !n && !r ? Me : null,
|
|
977
|
+
mode: r ? "create" : n ? "edit" : "display",
|
|
978
|
+
dirty: a,
|
|
979
|
+
showBack: oe,
|
|
980
|
+
onBack: de,
|
|
981
|
+
right: Fe,
|
|
982
|
+
showTitle: T.isVisible("show_title")
|
|
983
|
+
}), Ne] });
|
|
984
|
+
}
|
|
985
|
+
//#endregion
|
|
986
|
+
export { L as SmartDetailPage };
|