@declarion/react 0.65.1 → 0.66.1
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
|
@@ -1,1515 +0,0 @@
|
|
|
1
|
-
import { A as e, Dn as t, Ft as n, I as r, N as i, Q as a, Qt as o, R as s, Tn as c, U as l, V as u, an as d, at as f, cn as p, ct as m, gn as h, in as g, j as _, mt as v, o as y, on as b, ot as x, s as S, st as C, ut as w, wn as T, wt as E, xt as D, yt as O } from "./useCurrentScreen-BZOHBGQZ.js";
|
|
2
|
-
import { t as k } from "./Icons-lt-7lhYR.js";
|
|
3
|
-
import { n as A, r as j } from "./CopyButton-DRIT_f0k.js";
|
|
4
|
-
import { n as M, t as N } from "./MenuItem-CfkVXPvC.js";
|
|
5
|
-
import { Q as P, X as F, f as I, l as ee, q as L, s as te } from "./PropertyGridEditor-XrP6TZ5s.js";
|
|
6
|
-
import { t as R } from "./SectionCard-BYHoHWJc.js";
|
|
7
|
-
import { t as z } from "./DynamicIcon-DuBSz6TZ.js";
|
|
8
|
-
import { n as B } from "./useTabNavigate-CUqOmcMj.js";
|
|
9
|
-
import { E as V, T as H, n as ne } from "./ActionRunner-DdBFhqGe.js";
|
|
10
|
-
import { a as U, c as W, l as re, s as G } from "./variants-vUtfBbE6.js";
|
|
11
|
-
import { n as ie, r as ae, t as oe } from "./dataTableStyles-vwD1mVOP.js";
|
|
12
|
-
import { useCallback as K, useEffect as se, useId as ce, useMemo as q, useRef as J, useState as Y } from "react";
|
|
13
|
-
import { useInfiniteQuery as le, useQueryClient as X } from "@tanstack/react-query";
|
|
14
|
-
import { Fragment as ue, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
15
|
-
//#region src/hooks/useAssociatedData.ts
|
|
16
|
-
function $(e, n, r, i, a, o, s, c) {
|
|
17
|
-
let l = c ? JSON.stringify(Object.entries(c).sort()) : void 0;
|
|
18
|
-
return le({
|
|
19
|
-
queryKey: [
|
|
20
|
-
H,
|
|
21
|
-
e,
|
|
22
|
-
n,
|
|
23
|
-
r,
|
|
24
|
-
a,
|
|
25
|
-
o,
|
|
26
|
-
s,
|
|
27
|
-
l
|
|
28
|
-
],
|
|
29
|
-
queryFn: ({ pageParam: e }) => {
|
|
30
|
-
let l = new URLSearchParams(), u = [{
|
|
31
|
-
field: i,
|
|
32
|
-
op: "eq",
|
|
33
|
-
value: n
|
|
34
|
-
}];
|
|
35
|
-
if (c) for (let [e, t] of Object.entries(c)) t && t !== "__all__" && u.push({
|
|
36
|
-
field: e,
|
|
37
|
-
op: "eq",
|
|
38
|
-
value: t
|
|
39
|
-
});
|
|
40
|
-
return l.set("filters", JSON.stringify(u)), a && l.set("sort", a), o && l.set("limit", String(o)), s && l.set("search", s), e && l.set("after", e), t(`/api/data/${r}?${l.toString()}`);
|
|
41
|
-
},
|
|
42
|
-
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
43
|
-
initialPageParam: void 0,
|
|
44
|
-
enabled: !!e && !!n && !!r && !!i
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/components/actions/ActionButton.tsx
|
|
49
|
-
function de({ actionCode: e, action: t, entityCode: o, objectIds: c = [], row: d, variant: p = "outline", size: m = "default", onSuccess: h }) {
|
|
50
|
-
let g = E(), _ = E("errors"), [y, b] = Y(!1), [x, S] = Y(!1), { data: C } = n(), T = B(), { run: D } = ne(), O = s(t), M = !d || i(t.conditions, d), N = K(async () => {
|
|
51
|
-
if (t.association && c.length !== 0) {
|
|
52
|
-
b(!0);
|
|
53
|
-
try {
|
|
54
|
-
let e = o ? `${o}.${t.association}` : t.association, n = await v(e, c), i = r(C, n.target_entity);
|
|
55
|
-
if (!i) {
|
|
56
|
-
l.error(_("action.list_screen_missing", "No list screen is declared for this entity."), n.target_entity);
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
let a = C?.entities[n.target_entity], s = g(t.display?.name) || n.target_entity;
|
|
60
|
-
if (n.ids.length === 0) {
|
|
61
|
-
l.info(g("action.association.none_related", "No related {name} found", { name: s }));
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
let u = a?.fields.names().find((e) => a.fields.get(e)?.primary) ?? "id", d = new URLSearchParams();
|
|
65
|
-
d.set(`filter_${u}`, n.ids.join(",")), T(i.route, {
|
|
66
|
-
title: s,
|
|
67
|
-
icon: t.display?.icon || i.icon,
|
|
68
|
-
search: d.toString()
|
|
69
|
-
}), h?.();
|
|
70
|
-
} catch (e) {
|
|
71
|
-
l.error(a(_, e));
|
|
72
|
-
} finally {
|
|
73
|
-
b(!1);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, [
|
|
77
|
-
g,
|
|
78
|
-
_,
|
|
79
|
-
t,
|
|
80
|
-
o,
|
|
81
|
-
c,
|
|
82
|
-
C,
|
|
83
|
-
T,
|
|
84
|
-
h
|
|
85
|
-
]), P = t.entity ? `${t.entity}.${e}` : e, F = c.length > 0 ? c : void 0, I = K(() => {
|
|
86
|
-
S(!0), D({
|
|
87
|
-
action: t,
|
|
88
|
-
title: g(t.display?.name) || e,
|
|
89
|
-
row: d,
|
|
90
|
-
entity: o,
|
|
91
|
-
execute: (e) => w(P, f(e, F)),
|
|
92
|
-
onSuccess: () => h?.()
|
|
93
|
-
}).finally(() => S(!1));
|
|
94
|
-
}, [
|
|
95
|
-
g,
|
|
96
|
-
D,
|
|
97
|
-
t,
|
|
98
|
-
e,
|
|
99
|
-
d,
|
|
100
|
-
o,
|
|
101
|
-
P,
|
|
102
|
-
F,
|
|
103
|
-
h
|
|
104
|
-
]), L = K(() => {
|
|
105
|
-
if (ee(t)) te(_, t.ui_steps, { row: d }).then(() => h?.());
|
|
106
|
-
else if (O) N();
|
|
107
|
-
else if (t.href && !t.handler && !t.association) {
|
|
108
|
-
let n = o ? C?.entities[o] : void 0, r = u(d, n), i = t.href;
|
|
109
|
-
o && (i = i.replaceAll("${entity}", o)), r && (i = i.replaceAll("${id}", encodeURIComponent(r))), T(i, {
|
|
110
|
-
title: g(t.display?.name) || e,
|
|
111
|
-
icon: t.display?.icon
|
|
112
|
-
}), h?.();
|
|
113
|
-
} else I();
|
|
114
|
-
}, [
|
|
115
|
-
g,
|
|
116
|
-
_,
|
|
117
|
-
t,
|
|
118
|
-
d,
|
|
119
|
-
o,
|
|
120
|
-
C?.entities,
|
|
121
|
-
e,
|
|
122
|
-
T,
|
|
123
|
-
O,
|
|
124
|
-
N,
|
|
125
|
-
I,
|
|
126
|
-
h
|
|
127
|
-
]), R = g(t.display?.name), V = t.display?.icon, H = V && k[V], U = H ? /* @__PURE__ */ Z(H, { size: 13 }) : V ? /* @__PURE__ */ Z(z, {
|
|
128
|
-
name: V,
|
|
129
|
-
size: 13
|
|
130
|
-
}) : null, W = !M || x || y;
|
|
131
|
-
return m === "icon" ? /* @__PURE__ */ Z(A, {
|
|
132
|
-
icon: U ?? /* @__PURE__ */ Z(k.bolt, { size: 13 }),
|
|
133
|
-
onClick: L,
|
|
134
|
-
title: R
|
|
135
|
-
}) : /* @__PURE__ */ Z(j, {
|
|
136
|
-
kind: p === "default" ? "primary" : p === "ghost" ? "ghost" : "default",
|
|
137
|
-
size: "sm",
|
|
138
|
-
icon: U,
|
|
139
|
-
danger: t.destructive,
|
|
140
|
-
onClick: L,
|
|
141
|
-
disabled: W,
|
|
142
|
-
title: R,
|
|
143
|
-
"aria-label": R,
|
|
144
|
-
children: R
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/components/actions/RowActionsKebab.tsx
|
|
149
|
-
function fe({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: s, size: c = 22, align: l = "end" }) {
|
|
150
|
-
let u = E(), d = E("errors"), p = J(null), [m, h] = Y(!1), [g, _] = Y(null), { run: v } = ne(), y = q(() => {
|
|
151
|
-
let e = {};
|
|
152
|
-
for (let { code: n, action: r } of t) e[n] = r;
|
|
153
|
-
return e;
|
|
154
|
-
}, [t]), b = q(() => {
|
|
155
|
-
let n = t.map(({ code: e }) => ({
|
|
156
|
-
kind: "action",
|
|
157
|
-
code: e,
|
|
158
|
-
enabled: !0,
|
|
159
|
-
reason: null
|
|
160
|
-
}));
|
|
161
|
-
return r ? e(u, n, y, void 0, r, [], U(i, r)) : n;
|
|
162
|
-
}, [
|
|
163
|
-
u,
|
|
164
|
-
t,
|
|
165
|
-
y,
|
|
166
|
-
r,
|
|
167
|
-
i
|
|
168
|
-
]), x = K((e, t) => {
|
|
169
|
-
h(!1);
|
|
170
|
-
let i = re(d, e, t, { row: r });
|
|
171
|
-
if (i !== null) return v({
|
|
172
|
-
action: t,
|
|
173
|
-
title: u(t.display?.name) || e,
|
|
174
|
-
row: r,
|
|
175
|
-
execute: async (e) => {
|
|
176
|
-
let t = await w(i, f(e, n));
|
|
177
|
-
return a?.(), t;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}, [
|
|
181
|
-
u,
|
|
182
|
-
d,
|
|
183
|
-
v,
|
|
184
|
-
r,
|
|
185
|
-
n,
|
|
186
|
-
a
|
|
187
|
-
]);
|
|
188
|
-
return !o && b.length === 0 ? null : /* @__PURE__ */ Q("div", {
|
|
189
|
-
className: "sl-row-actions",
|
|
190
|
-
"data-open": m ? "true" : void 0,
|
|
191
|
-
style: {
|
|
192
|
-
display: "flex",
|
|
193
|
-
alignItems: "center",
|
|
194
|
-
justifyContent: "flex-end"
|
|
195
|
-
},
|
|
196
|
-
children: [/* @__PURE__ */ Z(A, {
|
|
197
|
-
ref: p,
|
|
198
|
-
size: c,
|
|
199
|
-
icon: /* @__PURE__ */ Z(k.more, { size: Math.round(c * .55) }),
|
|
200
|
-
onClick: () => h((e) => !e),
|
|
201
|
-
title: u("action.menu.title", "Actions")
|
|
202
|
-
}), /* @__PURE__ */ Q(M, {
|
|
203
|
-
open: m,
|
|
204
|
-
anchor: p.current,
|
|
205
|
-
onClose: () => h(!1),
|
|
206
|
-
width: 200,
|
|
207
|
-
align: l,
|
|
208
|
-
children: [
|
|
209
|
-
o,
|
|
210
|
-
o && s && b.length > 0 && /* @__PURE__ */ Z(N, { divider: !0 }),
|
|
211
|
-
/* @__PURE__ */ Z(W, {
|
|
212
|
-
layout: b,
|
|
213
|
-
entityActions: y,
|
|
214
|
-
onRun: x,
|
|
215
|
-
loading: g,
|
|
216
|
-
onLoadingChange: _,
|
|
217
|
-
row: r
|
|
218
|
-
})
|
|
219
|
-
]
|
|
220
|
-
})]
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
|
-
//#region src/components/detail-layout/AssociatedToolbar.tsx
|
|
225
|
-
function pe({ entity: e, searchable: t, filterFields: n, searchValue: r, onSearchChange: i, filters: a, onFilterChange: o, allEntities: s }) {
|
|
226
|
-
let c = E(), l = t === !0, u = n && n.length > 0;
|
|
227
|
-
return !l && !u ? null : /* @__PURE__ */ Q("div", {
|
|
228
|
-
style: {
|
|
229
|
-
display: "flex",
|
|
230
|
-
alignItems: "center",
|
|
231
|
-
gap: 6,
|
|
232
|
-
marginBottom: 8
|
|
233
|
-
},
|
|
234
|
-
children: [l && /* @__PURE__ */ Z("div", {
|
|
235
|
-
style: {
|
|
236
|
-
flex: 1,
|
|
237
|
-
maxWidth: 220
|
|
238
|
-
},
|
|
239
|
-
children: /* @__PURE__ */ Z(F, {
|
|
240
|
-
value: r,
|
|
241
|
-
onChange: i,
|
|
242
|
-
placeholder: c("record.associated.search", "Search…"),
|
|
243
|
-
prefix: /* @__PURE__ */ Z(k.search, { size: 12 })
|
|
244
|
-
})
|
|
245
|
-
}), u && n.map((t) => {
|
|
246
|
-
let n = e.fields.get(t);
|
|
247
|
-
if (!n) return null;
|
|
248
|
-
let r = a[t] ?? "__all__", i = b(c, n, t, s);
|
|
249
|
-
if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ Z(me, {
|
|
250
|
-
field: n,
|
|
251
|
-
label: i,
|
|
252
|
-
value: r,
|
|
253
|
-
onChange: (e) => o(t, e)
|
|
254
|
-
}, t);
|
|
255
|
-
if (!n.values) return null;
|
|
256
|
-
let l = [{
|
|
257
|
-
value: "__all__",
|
|
258
|
-
label: c("record.associated.filter_all", "All {name}", { name: i })
|
|
259
|
-
}, ...n.values.map((e) => ({
|
|
260
|
-
value: e.code,
|
|
261
|
-
label: c(e.name) || e.code
|
|
262
|
-
}))];
|
|
263
|
-
return /* @__PURE__ */ Z("div", {
|
|
264
|
-
style: { width: 160 },
|
|
265
|
-
children: /* @__PURE__ */ Z(L, {
|
|
266
|
-
value: r,
|
|
267
|
-
options: l,
|
|
268
|
-
onChange: (e) => o(t, e),
|
|
269
|
-
placeholder: i
|
|
270
|
-
})
|
|
271
|
-
}, t);
|
|
272
|
-
})]
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
function me({ field: e, label: t, value: n, onChange: r }) {
|
|
276
|
-
let i = E(), a = S(e.ref?.entity), s = e.display?.ref_display_field ?? a?.display?.display_field, c = q(() => a ? [...a.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [a]), { data: l } = y(e.ref?.entity, {
|
|
277
|
-
per_page: 200,
|
|
278
|
-
sort: s ? `${s}:asc` : void 0
|
|
279
|
-
}), u = l?.data ?? [], d = (e) => e == null ? "—" : typeof e == "object" && !Array.isArray(e) ? i(e) || "—" : T(e), f = [{
|
|
280
|
-
value: "__all__",
|
|
281
|
-
label: i("record.associated.filter_all", "All {name}", { name: t })
|
|
282
|
-
}, ...u.map((e) => {
|
|
283
|
-
let t = String(e[c]), n = e[o];
|
|
284
|
-
return {
|
|
285
|
-
value: t,
|
|
286
|
-
label: typeof n == "string" && n !== "" ? n : s ? d(e[s] ?? t) : t
|
|
287
|
-
};
|
|
288
|
-
})];
|
|
289
|
-
return /* @__PURE__ */ Z("div", {
|
|
290
|
-
style: { width: 160 },
|
|
291
|
-
children: /* @__PURE__ */ Z(L, {
|
|
292
|
-
value: n,
|
|
293
|
-
options: f,
|
|
294
|
-
onChange: r,
|
|
295
|
-
placeholder: t
|
|
296
|
-
})
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
//#endregion
|
|
300
|
-
//#region src/components/detail-layout/AssociatedBlock.tsx
|
|
301
|
-
function he(e) {
|
|
302
|
-
if (!e) return [];
|
|
303
|
-
let t = [];
|
|
304
|
-
for (let [n, r] of Object.entries(e)) (r.visibility ?? []).includes("list_row") && (r.association || r.href || n.startsWith("__") || t.push({
|
|
305
|
-
code: n,
|
|
306
|
-
action: r
|
|
307
|
-
}));
|
|
308
|
-
return t;
|
|
309
|
-
}
|
|
310
|
-
function ge(e, t, n) {
|
|
311
|
-
if (!e) return [];
|
|
312
|
-
let r = [];
|
|
313
|
-
for (let [i, a] of Object.entries(e)) {
|
|
314
|
-
if (!(a.visibility ?? []).includes("list_toolbar") || a.association || i.startsWith("__")) continue;
|
|
315
|
-
let e = {
|
|
316
|
-
...a,
|
|
317
|
-
resolved_hidden_defaults: {
|
|
318
|
-
...a.resolved_hidden_defaults ?? {},
|
|
319
|
-
[t]: n
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
if (a.resolved_params?.has(t)) {
|
|
323
|
-
let n = a.resolved_params.items().filter((e) => e.name !== t);
|
|
324
|
-
e = {
|
|
325
|
-
...e,
|
|
326
|
-
resolved_params: new c(n)
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
r.push({
|
|
330
|
-
code: i,
|
|
331
|
-
action: e
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
return r;
|
|
335
|
-
}
|
|
336
|
-
function _e(e, t, n) {
|
|
337
|
-
let r = e[n];
|
|
338
|
-
if (!r) return null;
|
|
339
|
-
let i = e[t], a = i?.children?.find((e) => e.entity === n);
|
|
340
|
-
if (a) {
|
|
341
|
-
let e = a.foreign_key;
|
|
342
|
-
if (typeof e == "string") return e;
|
|
343
|
-
if (Array.isArray(e) && e.length === 1) return e[0];
|
|
344
|
-
}
|
|
345
|
-
let o = i?.table;
|
|
346
|
-
for (let [n, i] of r.fields) {
|
|
347
|
-
let r = i.ref?.entity;
|
|
348
|
-
if (r) {
|
|
349
|
-
if (r === t) return n;
|
|
350
|
-
if (o) {
|
|
351
|
-
let t = e[r]?.table;
|
|
352
|
-
if (t && t === o) return n;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return null;
|
|
357
|
-
}
|
|
358
|
-
function ve(e, t, n) {
|
|
359
|
-
let r = new Set(p(e));
|
|
360
|
-
return new Set(t.filter((t) => {
|
|
361
|
-
if (t === n || r.has(t)) return !1;
|
|
362
|
-
let i = e.fields.get(t);
|
|
363
|
-
return !(!i || i.auto || i.primary || i.source);
|
|
364
|
-
}));
|
|
365
|
-
}
|
|
366
|
-
function ye(e, t, n) {
|
|
367
|
-
return new Set(t.filter((t) => {
|
|
368
|
-
if (t === n) return !1;
|
|
369
|
-
let r = e.fields.get(t);
|
|
370
|
-
return !(!r || r.auto);
|
|
371
|
-
}));
|
|
372
|
-
}
|
|
373
|
-
function be(e, t, n, r) {
|
|
374
|
-
let i = [];
|
|
375
|
-
for (let a of t) {
|
|
376
|
-
let t = n.fields.get(a);
|
|
377
|
-
if (!t || !t.required || t.auto || t.primary || a === r || n.tenant_key && a === n.tenant_key) continue;
|
|
378
|
-
let o = e[a];
|
|
379
|
-
(o == null || o === "") && i.push(a);
|
|
380
|
-
}
|
|
381
|
-
return i;
|
|
382
|
-
}
|
|
383
|
-
function xe({ node: e, ctx: t }) {
|
|
384
|
-
let n = E("errors"), r = e.associated;
|
|
385
|
-
if (!r || t.isNew) return null;
|
|
386
|
-
let i = t.schema.entities[r];
|
|
387
|
-
if (!i) return /* @__PURE__ */ Q("div", {
|
|
388
|
-
style: {
|
|
389
|
-
fontSize: 12.5,
|
|
390
|
-
color: "var(--text-3)",
|
|
391
|
-
padding: "8px 0"
|
|
392
|
-
},
|
|
393
|
-
children: [
|
|
394
|
-
n("record.related_entity_not_found", "The related record type is not declared in this deployment."),
|
|
395
|
-
" ",
|
|
396
|
-
/* @__PURE__ */ Z("code", { children: r })
|
|
397
|
-
]
|
|
398
|
-
});
|
|
399
|
-
let a = e.foreign_key ?? _e(t.schema.entities, t.entityCode, r);
|
|
400
|
-
return a ? /* @__PURE__ */ Z(Se, {
|
|
401
|
-
node: e,
|
|
402
|
-
ctx: t,
|
|
403
|
-
assocCode: r,
|
|
404
|
-
assocEntity: i,
|
|
405
|
-
fkField: a
|
|
406
|
-
}) : /* @__PURE__ */ Q("div", {
|
|
407
|
-
style: {
|
|
408
|
-
fontSize: 12.5,
|
|
409
|
-
color: "var(--text-3)",
|
|
410
|
-
padding: "8px 0"
|
|
411
|
-
},
|
|
412
|
-
children: [
|
|
413
|
-
n("record.associated_foreign_key_not_found", "No foreign key joins these two entities."),
|
|
414
|
-
" ",
|
|
415
|
-
r,
|
|
416
|
-
" → ",
|
|
417
|
-
t.entityCode
|
|
418
|
-
]
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
function Se({ node: t, ctx: n, assocCode: r, assocEntity: i, fkField: a }) {
|
|
422
|
-
let o = E(), s = E("errors"), c = t.columns && t.columns.length > 0 ? t.columns.filter((e) => e !== a && !!i.fields.get(e)) : i.fields.names().filter((e) => {
|
|
423
|
-
if (e === a) return !1;
|
|
424
|
-
let t = i.fields.get(e);
|
|
425
|
-
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
426
|
-
}), l = g(i, "update"), u = t.interaction ?? "navigate", d = (u === "inline_edit" || u === "row_edit") && l && t.editable !== !1, p = o(i.display?.name_plural) || o(i.display?.name) || r, m = t.searchable === !0 || t.filters && t.filters.length > 0, h = q(() => ge(i.actions, a, n.recordId), [
|
|
427
|
-
i.actions,
|
|
428
|
-
a,
|
|
429
|
-
n.recordId
|
|
430
|
-
]), v = q(() => {
|
|
431
|
-
let e = {};
|
|
432
|
-
for (let { code: t, action: n } of h) e[t] = n;
|
|
433
|
-
return e;
|
|
434
|
-
}, [h]), y = q(() => {
|
|
435
|
-
let t = i.action_layout ?? null;
|
|
436
|
-
return e(o, t ?? _(v, "list_toolbar"), v, void 0, {}, []);
|
|
437
|
-
}, [
|
|
438
|
-
o,
|
|
439
|
-
i.action_layout,
|
|
440
|
-
v
|
|
441
|
-
]), { run: b } = ne(), x = B(), S = q(() => ({
|
|
442
|
-
entity: i,
|
|
443
|
-
entityCode: r,
|
|
444
|
-
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
445
|
-
selectedRows: [],
|
|
446
|
-
selectedIds: [],
|
|
447
|
-
t: o,
|
|
448
|
-
tabNavigate: (e, t) => x(e, {
|
|
449
|
-
title: t?.title,
|
|
450
|
-
icon: t?.icon,
|
|
451
|
-
search: t?.search
|
|
452
|
-
}),
|
|
453
|
-
runActionApi: (e, t) => w(e, t)
|
|
454
|
-
}), [
|
|
455
|
-
i,
|
|
456
|
-
r,
|
|
457
|
-
o,
|
|
458
|
-
x
|
|
459
|
-
]), C = X(), T = K(() => {
|
|
460
|
-
C.invalidateQueries({ predicate: (e) => {
|
|
461
|
-
let t = e.queryKey;
|
|
462
|
-
return t[0] === "entity-children" && t[3] === r;
|
|
463
|
-
} });
|
|
464
|
-
}, [C, r]), D = K((e, t) => {
|
|
465
|
-
let n = re(s, e, t, {}, r);
|
|
466
|
-
if (n !== null) return b({
|
|
467
|
-
action: t,
|
|
468
|
-
title: o(t.display?.name) || e,
|
|
469
|
-
execute: async (e) => {
|
|
470
|
-
let t = await w(n, f(e, void 0));
|
|
471
|
-
return T(), t;
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
}, [
|
|
475
|
-
o,
|
|
476
|
-
s,
|
|
477
|
-
b,
|
|
478
|
-
r,
|
|
479
|
-
T
|
|
480
|
-
]), [O, A] = Y(0), M = /* @__PURE__ */ Q("div", {
|
|
481
|
-
style: {
|
|
482
|
-
display: "flex",
|
|
483
|
-
alignItems: "center",
|
|
484
|
-
gap: 6,
|
|
485
|
-
flex: "1 1 auto",
|
|
486
|
-
minWidth: 0,
|
|
487
|
-
justifyContent: "flex-end"
|
|
488
|
-
},
|
|
489
|
-
children: [i.action_layout ? y.length > 0 && /* @__PURE__ */ Z(G, {
|
|
490
|
-
kind: "toolbar",
|
|
491
|
-
layout: y,
|
|
492
|
-
entityActions: v,
|
|
493
|
-
onRun: D,
|
|
494
|
-
widgetContext: S,
|
|
495
|
-
ariaLabel: o("record.associated.toolbar_actions", "{name} toolbar actions", { name: p })
|
|
496
|
-
}) : h.map(({ code: e, action: t }) => /* @__PURE__ */ Z(de, {
|
|
497
|
-
actionCode: e,
|
|
498
|
-
action: t,
|
|
499
|
-
entityCode: r,
|
|
500
|
-
variant: "ghost",
|
|
501
|
-
size: "sm",
|
|
502
|
-
onSuccess: T
|
|
503
|
-
}, e)), d && /* @__PURE__ */ Z(j, {
|
|
504
|
-
kind: "ghost",
|
|
505
|
-
size: "xs",
|
|
506
|
-
icon: /* @__PURE__ */ Z(k.plus, { size: 12 }),
|
|
507
|
-
onClick: () => A((e) => e + 1),
|
|
508
|
-
children: o("record.row.add", "Add row")
|
|
509
|
-
})]
|
|
510
|
-
}), N = m ? /* @__PURE__ */ Z(we, {
|
|
511
|
-
entityCode: r,
|
|
512
|
-
entity: i,
|
|
513
|
-
parentEntity: n.entityCode,
|
|
514
|
-
parentId: n.recordId,
|
|
515
|
-
foreignKey: a,
|
|
516
|
-
columns: c,
|
|
517
|
-
editable: d,
|
|
518
|
-
interaction: u,
|
|
519
|
-
ctx: n,
|
|
520
|
-
searchable: t.searchable,
|
|
521
|
-
filterFields: t.filters,
|
|
522
|
-
sort: t.sort,
|
|
523
|
-
startDraftSignal: O
|
|
524
|
-
}) : /* @__PURE__ */ Z(Ce, {
|
|
525
|
-
entityCode: r,
|
|
526
|
-
entity: i,
|
|
527
|
-
parentEntity: n.entityCode,
|
|
528
|
-
parentId: n.recordId,
|
|
529
|
-
foreignKey: a,
|
|
530
|
-
columns: c,
|
|
531
|
-
editable: d,
|
|
532
|
-
interaction: u,
|
|
533
|
-
ctx: n,
|
|
534
|
-
sort: t.sort,
|
|
535
|
-
startDraftSignal: O
|
|
536
|
-
});
|
|
537
|
-
return n.withinCard ? /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Z("div", {
|
|
538
|
-
style: {
|
|
539
|
-
display: "flex",
|
|
540
|
-
justifyContent: "flex-end",
|
|
541
|
-
marginBottom: 8
|
|
542
|
-
},
|
|
543
|
-
children: M
|
|
544
|
-
}), N] }) : /* @__PURE__ */ Z(R, {
|
|
545
|
-
title: p,
|
|
546
|
-
icon: i.display?.icon ? /* @__PURE__ */ Z(z, {
|
|
547
|
-
name: i.display.icon,
|
|
548
|
-
size: 14
|
|
549
|
-
}) : void 0,
|
|
550
|
-
right: M,
|
|
551
|
-
children: N
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
function Ce({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
|
|
555
|
-
let d = X(), { data: f, isLoading: p, isError: m } = V(n, r, e, i, l), h = f?.data ?? [], g = f?.$refs, _ = K(() => {
|
|
556
|
-
d.invalidateQueries({ queryKey: [
|
|
557
|
-
H,
|
|
558
|
-
n,
|
|
559
|
-
r,
|
|
560
|
-
e
|
|
561
|
-
] });
|
|
562
|
-
}, [
|
|
563
|
-
d,
|
|
564
|
-
n,
|
|
565
|
-
r,
|
|
566
|
-
e
|
|
567
|
-
]);
|
|
568
|
-
return /* @__PURE__ */ Z(Te, {
|
|
569
|
-
entityCode: e,
|
|
570
|
-
entity: t,
|
|
571
|
-
parentId: r,
|
|
572
|
-
foreignKey: i,
|
|
573
|
-
columns: a,
|
|
574
|
-
editable: o,
|
|
575
|
-
interaction: s,
|
|
576
|
-
ctx: c,
|
|
577
|
-
rows: h,
|
|
578
|
-
refs: g,
|
|
579
|
-
isLoading: p,
|
|
580
|
-
isError: m,
|
|
581
|
-
invalidateQuery: _,
|
|
582
|
-
startDraftSignal: u
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
function we({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: l, filterFields: u, sort: d, startDraftSignal: f }) {
|
|
586
|
-
let p = E(), m = X(), [h, g] = Y(""), [_, v] = Y(""), [y, b] = Y({}), x = J(void 0);
|
|
587
|
-
se(() => (x.current && clearTimeout(x.current), x.current = setTimeout(() => {
|
|
588
|
-
v(h);
|
|
589
|
-
}, 300), () => {
|
|
590
|
-
x.current && clearTimeout(x.current);
|
|
591
|
-
}), [h]);
|
|
592
|
-
let S = K((e, t) => {
|
|
593
|
-
b((n) => {
|
|
594
|
-
if (t === "__all__") {
|
|
595
|
-
let { [e]: t, ...r } = n;
|
|
596
|
-
return r;
|
|
597
|
-
}
|
|
598
|
-
return {
|
|
599
|
-
...n,
|
|
600
|
-
[e]: t
|
|
601
|
-
};
|
|
602
|
-
});
|
|
603
|
-
}, []), C = q(() => Object.keys(y).length > 0 ? y : void 0, [y]), { data: w, isLoading: T, isError: D, hasNextPage: O, fetchNextPage: k, isFetchingNextPage: A } = $(n, r, e, i, d, void 0, _ || void 0, C), { rows: M, refs: N } = q(() => {
|
|
604
|
-
if (!w?.pages) return {
|
|
605
|
-
rows: [],
|
|
606
|
-
refs: void 0
|
|
607
|
-
};
|
|
608
|
-
let e = [], t;
|
|
609
|
-
for (let n of w.pages) if (e.push(...n.data), n.$refs) {
|
|
610
|
-
if (!t) t = { ...n.$refs };
|
|
611
|
-
else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
|
|
612
|
-
...t[e],
|
|
613
|
-
...r
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
return {
|
|
617
|
-
rows: e,
|
|
618
|
-
refs: t
|
|
619
|
-
};
|
|
620
|
-
}, [w]), F = K(() => {
|
|
621
|
-
m.invalidateQueries({ predicate: (t) => {
|
|
622
|
-
let n = t.queryKey;
|
|
623
|
-
return n[0] === "entity-children" && n[3] === e;
|
|
624
|
-
} });
|
|
625
|
-
}, [m, e]);
|
|
626
|
-
return /* @__PURE__ */ Q("div", { children: [
|
|
627
|
-
/* @__PURE__ */ Z(pe, {
|
|
628
|
-
entity: t,
|
|
629
|
-
searchable: l,
|
|
630
|
-
filterFields: u,
|
|
631
|
-
searchValue: h,
|
|
632
|
-
onSearchChange: g,
|
|
633
|
-
filters: y,
|
|
634
|
-
onFilterChange: S,
|
|
635
|
-
allEntities: c.schema.entities
|
|
636
|
-
}),
|
|
637
|
-
/* @__PURE__ */ Z(Te, {
|
|
638
|
-
entityCode: e,
|
|
639
|
-
entity: t,
|
|
640
|
-
parentId: r,
|
|
641
|
-
foreignKey: i,
|
|
642
|
-
columns: a,
|
|
643
|
-
editable: o,
|
|
644
|
-
interaction: s,
|
|
645
|
-
ctx: c,
|
|
646
|
-
rows: M,
|
|
647
|
-
refs: N,
|
|
648
|
-
isLoading: T,
|
|
649
|
-
isError: D,
|
|
650
|
-
invalidateQuery: F,
|
|
651
|
-
startDraftSignal: f
|
|
652
|
-
}),
|
|
653
|
-
O && /* @__PURE__ */ Z("div", {
|
|
654
|
-
style: { marginTop: 4 },
|
|
655
|
-
children: /* @__PURE__ */ Z(j, {
|
|
656
|
-
kind: "ghost",
|
|
657
|
-
size: "xs",
|
|
658
|
-
icon: A ? /* @__PURE__ */ Z(P, { size: 12 }) : void 0,
|
|
659
|
-
onClick: () => k(),
|
|
660
|
-
disabled: A,
|
|
661
|
-
children: p("record.associated.load_more", "Load more")
|
|
662
|
-
})
|
|
663
|
-
})
|
|
664
|
-
] });
|
|
665
|
-
}
|
|
666
|
-
function Te({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: o, interaction: s, ctx: c, rows: l, refs: u, isLoading: f, isError: p, invalidateQuery: g, startDraftSignal: _ }) {
|
|
667
|
-
let v = E(), y = E("errors"), S = D(), w = S.isPhone && c.relatedRecordsPresentation === "table", T = i.find((e) => e !== r), k = q(() => s === "navigate" ? h(void 0, t, c.schema.screens) : null, [
|
|
668
|
-
s,
|
|
669
|
-
t,
|
|
670
|
-
c.schema.screens
|
|
671
|
-
]), A = q(() => o ? ve(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
672
|
-
i,
|
|
673
|
-
r,
|
|
674
|
-
t,
|
|
675
|
-
o
|
|
676
|
-
]), j = q(() => ye(t, i, r), [
|
|
677
|
-
i,
|
|
678
|
-
r,
|
|
679
|
-
t
|
|
680
|
-
]), M = q(() => {
|
|
681
|
-
let e = /* @__PURE__ */ new Map();
|
|
682
|
-
for (let n of l) {
|
|
683
|
-
let r = d(t, n);
|
|
684
|
-
e.set(m(r), r);
|
|
685
|
-
}
|
|
686
|
-
return e;
|
|
687
|
-
}, [l, t]), N = q(() => {
|
|
688
|
-
let e = /* @__PURE__ */ new Map();
|
|
689
|
-
for (let n of l) {
|
|
690
|
-
let r = n.$row_version;
|
|
691
|
-
typeof r == "string" && r !== "" && e.set(m(d(t, n)), r);
|
|
692
|
-
}
|
|
693
|
-
return e;
|
|
694
|
-
}, [l, t]), P = q(() => he(t.actions), [t.actions]), [F, I] = Y(null), [ee, L] = Y(null), [te, R] = Y([]), [z, B] = Y({}), V = J(z);
|
|
695
|
-
V.current = z;
|
|
696
|
-
let H = J({});
|
|
697
|
-
se(() => {
|
|
698
|
-
let e = H.current;
|
|
699
|
-
return () => {
|
|
700
|
-
for (let t of Object.values(e)) clearTimeout(t);
|
|
701
|
-
};
|
|
702
|
-
}, []);
|
|
703
|
-
let [U, W] = Y(null), [re, G] = Y([]), [oe, ce] = Y(!1), { run: le } = ne(), [X, ue] = Y(/* @__PURE__ */ new Set()), $ = K(async (t, n, r) => {
|
|
704
|
-
B((e) => ({
|
|
705
|
-
...e,
|
|
706
|
-
[t]: {
|
|
707
|
-
...e[t],
|
|
708
|
-
saving: !0,
|
|
709
|
-
error: void 0
|
|
710
|
-
}
|
|
711
|
-
}));
|
|
712
|
-
try {
|
|
713
|
-
let i = N.get(t), a = i ? {
|
|
714
|
-
...n,
|
|
715
|
-
$row_version: i
|
|
716
|
-
} : n;
|
|
717
|
-
return await O(e, M.get(t) ?? t, a), B((e) => {
|
|
718
|
-
let n = e[t];
|
|
719
|
-
if (!n) return e;
|
|
720
|
-
if (n.ver > r) return {
|
|
721
|
-
...e,
|
|
722
|
-
[t]: {
|
|
723
|
-
...n,
|
|
724
|
-
saving: !1
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
let { [t]: i, ...a } = e;
|
|
728
|
-
return a;
|
|
729
|
-
}), g(), !0;
|
|
730
|
-
} catch (e) {
|
|
731
|
-
let n = a(y, e);
|
|
732
|
-
return B((e) => ({
|
|
733
|
-
...e,
|
|
734
|
-
[t]: {
|
|
735
|
-
...e[t],
|
|
736
|
-
saving: !1,
|
|
737
|
-
error: n
|
|
738
|
-
}
|
|
739
|
-
})), !1;
|
|
740
|
-
}
|
|
741
|
-
}, [
|
|
742
|
-
e,
|
|
743
|
-
y,
|
|
744
|
-
g,
|
|
745
|
-
M,
|
|
746
|
-
N
|
|
747
|
-
]), de = K((e, t, n) => {
|
|
748
|
-
B((r) => {
|
|
749
|
-
let i = r[e] ?? {
|
|
750
|
-
buffer: {},
|
|
751
|
-
ver: 0,
|
|
752
|
-
saving: !1
|
|
753
|
-
}, a = i.ver + 1;
|
|
754
|
-
return {
|
|
755
|
-
...r,
|
|
756
|
-
[e]: {
|
|
757
|
-
...i,
|
|
758
|
-
buffer: {
|
|
759
|
-
...i.buffer,
|
|
760
|
-
[t]: n
|
|
761
|
-
},
|
|
762
|
-
ver: a
|
|
763
|
-
}
|
|
764
|
-
};
|
|
765
|
-
}), s === "inline_edit" && (H.current[e] && clearTimeout(H.current[e]), H.current[e] = setTimeout(() => {
|
|
766
|
-
let t = V.current[e];
|
|
767
|
-
t && Object.keys(t.buffer).length > 0 && $(e, { ...t.buffer }, t.ver);
|
|
768
|
-
}, 500));
|
|
769
|
-
}, [$, s]), fe = K(() => {
|
|
770
|
-
let e = {};
|
|
771
|
-
e[r] = n;
|
|
772
|
-
for (let n of i) {
|
|
773
|
-
let r = t.fields.get(n);
|
|
774
|
-
r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
|
|
775
|
-
}
|
|
776
|
-
W(e), G([]);
|
|
777
|
-
}, [
|
|
778
|
-
r,
|
|
779
|
-
n,
|
|
780
|
-
i,
|
|
781
|
-
t.fields
|
|
782
|
-
]), pe = J(_);
|
|
783
|
-
se(() => {
|
|
784
|
-
_ !== void 0 && _ !== pe.current && (pe.current = _, !U && fe());
|
|
785
|
-
}, [
|
|
786
|
-
_,
|
|
787
|
-
U,
|
|
788
|
-
fe
|
|
789
|
-
]);
|
|
790
|
-
let me = K(async () => {
|
|
791
|
-
if (!U) return;
|
|
792
|
-
let n = be(U, i, t, r);
|
|
793
|
-
if (n.length > 0) G(n);
|
|
794
|
-
else {
|
|
795
|
-
ce(!0);
|
|
796
|
-
try {
|
|
797
|
-
await x(e, U), W(null), G([]), g();
|
|
798
|
-
} catch (e) {
|
|
799
|
-
let t = a(y, e);
|
|
800
|
-
G([`_error:${t}`]);
|
|
801
|
-
} finally {
|
|
802
|
-
ce(!1);
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
}, [
|
|
806
|
-
U,
|
|
807
|
-
i,
|
|
808
|
-
t,
|
|
809
|
-
r,
|
|
810
|
-
e,
|
|
811
|
-
y,
|
|
812
|
-
g
|
|
813
|
-
]), ge = K((e) => {
|
|
814
|
-
B({}), R([]), L(e);
|
|
815
|
-
}, []), _e = K(async (e) => {
|
|
816
|
-
let n = V.current[e], a = n?.buffer ?? {};
|
|
817
|
-
if (Object.keys(a).length === 0) {
|
|
818
|
-
L(null), R([]);
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
let o = be({
|
|
822
|
-
...l.find((n) => m(d(t, n)) === e) ?? {},
|
|
823
|
-
...a
|
|
824
|
-
}, i, t, r);
|
|
825
|
-
o.length > 0 ? R(o) : await $(e, { ...a }, n?.ver ?? 0) && (L(null), R([]));
|
|
826
|
-
}, [
|
|
827
|
-
l,
|
|
828
|
-
t,
|
|
829
|
-
i,
|
|
830
|
-
r,
|
|
831
|
-
$
|
|
832
|
-
]), xe = K((e) => {
|
|
833
|
-
B((t) => {
|
|
834
|
-
if (!t[e]) return t;
|
|
835
|
-
let { [e]: n, ...r } = t;
|
|
836
|
-
return r;
|
|
837
|
-
}), R([]), L(null);
|
|
838
|
-
}, []), Se = K((n, r) => {
|
|
839
|
-
let i = M.get(n) ?? n;
|
|
840
|
-
return le({
|
|
841
|
-
action: t.actions?.__delete,
|
|
842
|
-
destructive: !0,
|
|
843
|
-
title: v(t.display?.name) || v("record.action.delete", "Delete"),
|
|
844
|
-
row: r,
|
|
845
|
-
entity: e,
|
|
846
|
-
execute: async () => {
|
|
847
|
-
ue((e) => new Set(e).add(n));
|
|
848
|
-
try {
|
|
849
|
-
return await C(e, i);
|
|
850
|
-
} finally {
|
|
851
|
-
ue((e) => {
|
|
852
|
-
let t = new Set(e);
|
|
853
|
-
return t.delete(n), t;
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
},
|
|
857
|
-
onSuccess: () => g()
|
|
858
|
-
});
|
|
859
|
-
}, [
|
|
860
|
-
v,
|
|
861
|
-
le,
|
|
862
|
-
t,
|
|
863
|
-
e,
|
|
864
|
-
g,
|
|
865
|
-
M
|
|
866
|
-
]);
|
|
867
|
-
if (p) return /* @__PURE__ */ Z("div", {
|
|
868
|
-
style: {
|
|
869
|
-
fontSize: 12.5,
|
|
870
|
-
color: "var(--danger)",
|
|
871
|
-
padding: "8px 0"
|
|
872
|
-
},
|
|
873
|
-
children: y("record.related_rows_unreadable", "The related records could not be loaded.")
|
|
874
|
-
});
|
|
875
|
-
if (f) return /* @__PURE__ */ Q("div", {
|
|
876
|
-
style: {
|
|
877
|
-
display: "flex",
|
|
878
|
-
flexDirection: "column",
|
|
879
|
-
gap: 8,
|
|
880
|
-
padding: "8px 0"
|
|
881
|
-
},
|
|
882
|
-
children: [/* @__PURE__ */ Z("div", { style: {
|
|
883
|
-
height: 32,
|
|
884
|
-
background: "var(--surface-3)",
|
|
885
|
-
borderRadius: 6
|
|
886
|
-
} }), /* @__PURE__ */ Z("div", { style: {
|
|
887
|
-
height: 32,
|
|
888
|
-
background: "var(--surface-3)",
|
|
889
|
-
borderRadius: 6
|
|
890
|
-
} })]
|
|
891
|
-
});
|
|
892
|
-
let Ce = l.length === 0 && !U;
|
|
893
|
-
return S.isPhone && !w ? /* @__PURE__ */ Q("div", { children: [Ce && /* @__PURE__ */ Z("div", {
|
|
894
|
-
style: {
|
|
895
|
-
fontSize: 12.5,
|
|
896
|
-
color: "var(--text-3)",
|
|
897
|
-
padding: "12px 0"
|
|
898
|
-
},
|
|
899
|
-
children: v("record.related.empty", "No records yet.")
|
|
900
|
-
}), !Ce && /* @__PURE__ */ Q("div", {
|
|
901
|
-
style: {
|
|
902
|
-
display: "flex",
|
|
903
|
-
flexDirection: "column",
|
|
904
|
-
gap: 10
|
|
905
|
-
},
|
|
906
|
-
children: [l.map((n) => {
|
|
907
|
-
let r = m(d(t, n)), a = X.has(r), l = z[r], f = k && r ? k.replace(/:\w+/, r) : void 0;
|
|
908
|
-
return /* @__PURE__ */ Z(Ee, {
|
|
909
|
-
rowId: r,
|
|
910
|
-
row: n,
|
|
911
|
-
entity: t,
|
|
912
|
-
entities: c.schema.entities,
|
|
913
|
-
screens: c.schema.screens,
|
|
914
|
-
columns: i,
|
|
915
|
-
editableColumns: A,
|
|
916
|
-
editable: o,
|
|
917
|
-
interaction: s,
|
|
918
|
-
isEditing: ee === r,
|
|
919
|
-
editErrors: te,
|
|
920
|
-
isDeleting: a,
|
|
921
|
-
activeCell: F,
|
|
922
|
-
setActiveCell: I,
|
|
923
|
-
rowState: l,
|
|
924
|
-
onCellChange: de,
|
|
925
|
-
onDeleteClick: (e) => void Se(e, n),
|
|
926
|
-
onStartEdit: ge,
|
|
927
|
-
onConfirmEdit: _e,
|
|
928
|
-
onCancelEdit: xe,
|
|
929
|
-
refs: u,
|
|
930
|
-
identityCol: T,
|
|
931
|
-
href: f,
|
|
932
|
-
rowActions: P,
|
|
933
|
-
entityCode: e,
|
|
934
|
-
onRowActionSuccess: g
|
|
935
|
-
}, r);
|
|
936
|
-
}), U && /* @__PURE__ */ Z(je, {
|
|
937
|
-
draftRow: U,
|
|
938
|
-
entity: t,
|
|
939
|
-
columns: i,
|
|
940
|
-
editableColumns: j,
|
|
941
|
-
foreignKey: r,
|
|
942
|
-
draftErrors: re,
|
|
943
|
-
draftSaving: oe,
|
|
944
|
-
onChange: (e, t) => W((n) => n && {
|
|
945
|
-
...n,
|
|
946
|
-
[e]: t
|
|
947
|
-
}),
|
|
948
|
-
onConfirm: me,
|
|
949
|
-
onCancel: () => {
|
|
950
|
-
W(null), G([]);
|
|
951
|
-
},
|
|
952
|
-
refs: u
|
|
953
|
-
})]
|
|
954
|
-
})] }) : /* @__PURE__ */ Q("div", { children: [Ce && /* @__PURE__ */ Z("div", {
|
|
955
|
-
style: {
|
|
956
|
-
fontSize: 12.5,
|
|
957
|
-
color: "var(--text-3)",
|
|
958
|
-
padding: "12px 0"
|
|
959
|
-
},
|
|
960
|
-
children: v("record.related.empty", "No records yet.")
|
|
961
|
-
}), !Ce && /* @__PURE__ */ Z("div", {
|
|
962
|
-
style: { overflowX: "auto" },
|
|
963
|
-
children: /* @__PURE__ */ Q("table", {
|
|
964
|
-
style: ae,
|
|
965
|
-
children: [/* @__PURE__ */ Z("thead", { children: /* @__PURE__ */ Q("tr", { children: [
|
|
966
|
-
i.map((e) => {
|
|
967
|
-
let n = t.fields.get(e);
|
|
968
|
-
return /* @__PURE__ */ Z("th", {
|
|
969
|
-
style: ie,
|
|
970
|
-
children: n ? b(v, n, e, c.schema.entities) : e
|
|
971
|
-
}, e);
|
|
972
|
-
}),
|
|
973
|
-
o && /* @__PURE__ */ Z("th", { style: {
|
|
974
|
-
height: 30,
|
|
975
|
-
width: 72
|
|
976
|
-
} }),
|
|
977
|
-
!o && P.length > 0 && /* @__PURE__ */ Z("th", { style: {
|
|
978
|
-
height: 30,
|
|
979
|
-
width: 40
|
|
980
|
-
} })
|
|
981
|
-
] }) }), /* @__PURE__ */ Q("tbody", { children: [l.map((n) => {
|
|
982
|
-
let r = m(d(t, n)), a = X.has(r), l = z[r], f = k && r ? k.replace(/:\w+/, r) : void 0;
|
|
983
|
-
return /* @__PURE__ */ Z(De, {
|
|
984
|
-
rowId: r,
|
|
985
|
-
row: n,
|
|
986
|
-
entity: t,
|
|
987
|
-
entities: c.schema.entities,
|
|
988
|
-
screens: c.schema.screens,
|
|
989
|
-
columns: i,
|
|
990
|
-
editableColumns: A,
|
|
991
|
-
editable: o,
|
|
992
|
-
interaction: s,
|
|
993
|
-
isEditing: ee === r,
|
|
994
|
-
editErrors: te,
|
|
995
|
-
isDeleting: a,
|
|
996
|
-
activeCell: F,
|
|
997
|
-
setActiveCell: I,
|
|
998
|
-
rowState: l,
|
|
999
|
-
onCellChange: de,
|
|
1000
|
-
onDeleteClick: (e) => void Se(e, n),
|
|
1001
|
-
onStartEdit: ge,
|
|
1002
|
-
onConfirmEdit: _e,
|
|
1003
|
-
onCancelEdit: xe,
|
|
1004
|
-
refs: u,
|
|
1005
|
-
identityCol: T,
|
|
1006
|
-
href: f,
|
|
1007
|
-
rowActions: P,
|
|
1008
|
-
entityCode: e,
|
|
1009
|
-
onRowActionSuccess: g
|
|
1010
|
-
}, r);
|
|
1011
|
-
}), U && /* @__PURE__ */ Z(Ae, {
|
|
1012
|
-
draftRow: U,
|
|
1013
|
-
entity: t,
|
|
1014
|
-
columns: i,
|
|
1015
|
-
editableColumns: j,
|
|
1016
|
-
foreignKey: r,
|
|
1017
|
-
draftErrors: re,
|
|
1018
|
-
draftSaving: oe,
|
|
1019
|
-
onChange: (e, t) => W((n) => n && {
|
|
1020
|
-
...n,
|
|
1021
|
-
[e]: t
|
|
1022
|
-
}),
|
|
1023
|
-
onConfirm: me,
|
|
1024
|
-
onCancel: () => {
|
|
1025
|
-
W(null), G([]);
|
|
1026
|
-
},
|
|
1027
|
-
refs: u
|
|
1028
|
-
})] })]
|
|
1029
|
-
})
|
|
1030
|
-
})] });
|
|
1031
|
-
}
|
|
1032
|
-
function Ee({ rowId: e, row: t, entity: n, entities: r, screens: i, columns: a, editableColumns: o, editable: s, interaction: c, isEditing: l, editErrors: u, isDeleting: d, rowState: f, onCellChange: p, onDeleteClick: m, onStartEdit: h, onConfirmEdit: g, onCancelEdit: _, refs: v, identityCol: y, href: x, rowActions: S, onRowActionSuccess: C }) {
|
|
1033
|
-
let w = E(), D = ce(), O = q(() => !f || Object.keys(f.buffer).length === 0 ? t : {
|
|
1034
|
-
...t,
|
|
1035
|
-
...f.buffer
|
|
1036
|
-
}, [t, f]);
|
|
1037
|
-
if (c === "row_edit" && l) {
|
|
1038
|
-
let t = f?.error ? [...u, `_error:${f.error}`] : u;
|
|
1039
|
-
return /* @__PURE__ */ Z(ke, {
|
|
1040
|
-
values: O,
|
|
1041
|
-
entity: n,
|
|
1042
|
-
columns: a,
|
|
1043
|
-
editableColumns: o,
|
|
1044
|
-
errors: t,
|
|
1045
|
-
saving: f?.saving ?? !1,
|
|
1046
|
-
onChange: (t, n) => p(e, t, n),
|
|
1047
|
-
onConfirm: () => g(e),
|
|
1048
|
-
onCancel: () => _(e),
|
|
1049
|
-
refs: v
|
|
1050
|
-
});
|
|
1051
|
-
}
|
|
1052
|
-
return /* @__PURE__ */ Q("div", {
|
|
1053
|
-
style: {
|
|
1054
|
-
border: "1px solid var(--border)",
|
|
1055
|
-
borderRadius: 8,
|
|
1056
|
-
background: "var(--surface)",
|
|
1057
|
-
opacity: d ? .58 : 1,
|
|
1058
|
-
overflow: "hidden"
|
|
1059
|
-
},
|
|
1060
|
-
children: [/* @__PURE__ */ Z("div", {
|
|
1061
|
-
style: {
|
|
1062
|
-
padding: 10,
|
|
1063
|
-
display: "flex",
|
|
1064
|
-
flexDirection: "column",
|
|
1065
|
-
gap: 12
|
|
1066
|
-
},
|
|
1067
|
-
children: a.map((t) => {
|
|
1068
|
-
let a = n.fields.get(t), l = s && c === "inline_edit" && o.has(t), u = x && t === y, d = a ? b(w, a, t, r) : t, f = `${D}-${e}-${t}`, m = `${f}-label`, h = {
|
|
1069
|
-
fontSize: 11.5,
|
|
1070
|
-
fontWeight: 600,
|
|
1071
|
-
color: "var(--text-3)"
|
|
1072
|
-
}, g = a ? I({
|
|
1073
|
-
field: a,
|
|
1074
|
-
fieldName: t,
|
|
1075
|
-
value: O[t],
|
|
1076
|
-
mode: l ? "edit" : "display",
|
|
1077
|
-
onChange: l ? (n) => p(e, t, n) : void 0,
|
|
1078
|
-
record: O,
|
|
1079
|
-
refs: v,
|
|
1080
|
-
compact: l,
|
|
1081
|
-
entity: n,
|
|
1082
|
-
entities: r,
|
|
1083
|
-
screens: u ? void 0 : i,
|
|
1084
|
-
fieldId: f,
|
|
1085
|
-
labelId: m,
|
|
1086
|
-
t: w
|
|
1087
|
-
}) : T(O[t]);
|
|
1088
|
-
return /* @__PURE__ */ Q("div", {
|
|
1089
|
-
style: {
|
|
1090
|
-
display: "flex",
|
|
1091
|
-
flexDirection: "column",
|
|
1092
|
-
gap: 5,
|
|
1093
|
-
minWidth: 0
|
|
1094
|
-
},
|
|
1095
|
-
children: [l && a ? /* @__PURE__ */ Z("label", {
|
|
1096
|
-
id: m,
|
|
1097
|
-
htmlFor: f,
|
|
1098
|
-
style: h,
|
|
1099
|
-
children: d
|
|
1100
|
-
}) : /* @__PURE__ */ Z("div", {
|
|
1101
|
-
id: m,
|
|
1102
|
-
style: h,
|
|
1103
|
-
children: d
|
|
1104
|
-
}), /* @__PURE__ */ Z("div", {
|
|
1105
|
-
style: { minWidth: 0 },
|
|
1106
|
-
children: u && !l ? /* @__PURE__ */ Z("a", {
|
|
1107
|
-
href: x,
|
|
1108
|
-
style: {
|
|
1109
|
-
color: "var(--accent)",
|
|
1110
|
-
textDecoration: "none",
|
|
1111
|
-
fontWeight: 500
|
|
1112
|
-
},
|
|
1113
|
-
children: g
|
|
1114
|
-
}) : g
|
|
1115
|
-
})]
|
|
1116
|
-
}, t);
|
|
1117
|
-
})
|
|
1118
|
-
}), (s || S && S.length > 0) && /* @__PURE__ */ Q("div", {
|
|
1119
|
-
style: {
|
|
1120
|
-
minHeight: 42,
|
|
1121
|
-
padding: "6px 8px",
|
|
1122
|
-
borderTop: "1px solid var(--divider)",
|
|
1123
|
-
display: "flex",
|
|
1124
|
-
alignItems: "center",
|
|
1125
|
-
justifyContent: "flex-end",
|
|
1126
|
-
gap: 6
|
|
1127
|
-
},
|
|
1128
|
-
children: [s && /* @__PURE__ */ Q(ue, { children: [
|
|
1129
|
-
f?.saving && /* @__PURE__ */ Z(P, { size: 12 }),
|
|
1130
|
-
f?.error && /* @__PURE__ */ Z("span", {
|
|
1131
|
-
style: {
|
|
1132
|
-
fontSize: 11,
|
|
1133
|
-
color: "var(--danger)"
|
|
1134
|
-
},
|
|
1135
|
-
title: f.error,
|
|
1136
|
-
children: "!"
|
|
1137
|
-
}),
|
|
1138
|
-
c === "row_edit" && /* @__PURE__ */ Z(A, {
|
|
1139
|
-
size: 32,
|
|
1140
|
-
icon: /* @__PURE__ */ Z(k.edit, { size: 14 }),
|
|
1141
|
-
onClick: () => h(e),
|
|
1142
|
-
title: w("record.row.edit", "Edit row")
|
|
1143
|
-
}),
|
|
1144
|
-
/* @__PURE__ */ Z(A, {
|
|
1145
|
-
size: 32,
|
|
1146
|
-
icon: /* @__PURE__ */ Z(k.trash, { size: 14 }),
|
|
1147
|
-
onClick: () => m(e),
|
|
1148
|
-
title: w("record.row.delete", "Delete row")
|
|
1149
|
-
})
|
|
1150
|
-
] }), !s && S && S.length > 0 && /* @__PURE__ */ Z(fe, {
|
|
1151
|
-
entity: n,
|
|
1152
|
-
actions: S,
|
|
1153
|
-
objectIds: [e],
|
|
1154
|
-
row: O,
|
|
1155
|
-
onSuccess: C
|
|
1156
|
-
})]
|
|
1157
|
-
})]
|
|
1158
|
-
});
|
|
1159
|
-
}
|
|
1160
|
-
function De({ rowId: e, row: t, entity: n, entities: r, screens: i, columns: a, editableColumns: o, editable: s, interaction: c, isEditing: l, editErrors: u, isDeleting: d, activeCell: f, setActiveCell: p, rowState: m, onCellChange: h, onDeleteClick: g, onStartEdit: _, onConfirmEdit: v, onCancelEdit: y, refs: b, identityCol: x, href: S, rowActions: C, onRowActionSuccess: w }) {
|
|
1161
|
-
let D = E(), O = q(() => !m || Object.keys(m.buffer).length === 0 ? t : {
|
|
1162
|
-
...t,
|
|
1163
|
-
...m.buffer
|
|
1164
|
-
}, [t, m]);
|
|
1165
|
-
if (c === "row_edit" && l) {
|
|
1166
|
-
let t = m?.error ? [...u, `_error:${m.error}`] : u;
|
|
1167
|
-
return /* @__PURE__ */ Z(Oe, {
|
|
1168
|
-
values: O,
|
|
1169
|
-
entity: n,
|
|
1170
|
-
columns: a,
|
|
1171
|
-
editableColumns: o,
|
|
1172
|
-
errors: t,
|
|
1173
|
-
saving: m?.saving ?? !1,
|
|
1174
|
-
onChange: (t, n) => h(e, t, n),
|
|
1175
|
-
onConfirm: () => v(e),
|
|
1176
|
-
onCancel: () => y(e),
|
|
1177
|
-
refs: b
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
let j = oe, M = {
|
|
1181
|
-
padding: "4px 4px",
|
|
1182
|
-
borderBottom: "1px solid var(--divider)",
|
|
1183
|
-
verticalAlign: "middle"
|
|
1184
|
-
}, N = c === "inline_edit";
|
|
1185
|
-
return /* @__PURE__ */ Q("tr", {
|
|
1186
|
-
style: { opacity: d ? .5 : 1 },
|
|
1187
|
-
children: [
|
|
1188
|
-
a.map((t) => {
|
|
1189
|
-
let a = n.fields.get(t), s = o.has(t);
|
|
1190
|
-
if (N && f?.rowId === e && f?.col === t && s) return /* @__PURE__ */ Z("td", {
|
|
1191
|
-
style: M,
|
|
1192
|
-
children: a ? I({
|
|
1193
|
-
field: a,
|
|
1194
|
-
fieldName: t,
|
|
1195
|
-
value: O[t],
|
|
1196
|
-
mode: "edit",
|
|
1197
|
-
onChange: (n) => h(e, t, n),
|
|
1198
|
-
record: O,
|
|
1199
|
-
refs: b,
|
|
1200
|
-
compact: !0,
|
|
1201
|
-
t: D
|
|
1202
|
-
}) : T(O[t])
|
|
1203
|
-
}, t);
|
|
1204
|
-
let c = S && t === x, l = a ? I({
|
|
1205
|
-
field: a,
|
|
1206
|
-
fieldName: t,
|
|
1207
|
-
value: O[t],
|
|
1208
|
-
mode: "display",
|
|
1209
|
-
record: O,
|
|
1210
|
-
refs: b,
|
|
1211
|
-
entity: n,
|
|
1212
|
-
entities: r,
|
|
1213
|
-
screens: c ? void 0 : i,
|
|
1214
|
-
t: D
|
|
1215
|
-
}) : T(O[t]), u = N && s && !d;
|
|
1216
|
-
return /* @__PURE__ */ Z("td", {
|
|
1217
|
-
style: {
|
|
1218
|
-
...j,
|
|
1219
|
-
cursor: u ? "pointer" : "default"
|
|
1220
|
-
},
|
|
1221
|
-
onClick: u ? () => p({
|
|
1222
|
-
rowId: e,
|
|
1223
|
-
col: t
|
|
1224
|
-
}) : void 0,
|
|
1225
|
-
children: c ? /* @__PURE__ */ Z("a", {
|
|
1226
|
-
href: S,
|
|
1227
|
-
style: {
|
|
1228
|
-
color: "var(--accent)",
|
|
1229
|
-
textDecoration: "none",
|
|
1230
|
-
fontWeight: 500
|
|
1231
|
-
},
|
|
1232
|
-
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
1233
|
-
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
1234
|
-
children: l
|
|
1235
|
-
}) : l
|
|
1236
|
-
}, t);
|
|
1237
|
-
}),
|
|
1238
|
-
s && /* @__PURE__ */ Z("td", {
|
|
1239
|
-
style: {
|
|
1240
|
-
padding: "4px 8px",
|
|
1241
|
-
borderBottom: "1px solid var(--divider)",
|
|
1242
|
-
verticalAlign: "middle"
|
|
1243
|
-
},
|
|
1244
|
-
children: /* @__PURE__ */ Q("div", {
|
|
1245
|
-
style: {
|
|
1246
|
-
display: "flex",
|
|
1247
|
-
alignItems: "center",
|
|
1248
|
-
gap: 4
|
|
1249
|
-
},
|
|
1250
|
-
children: [
|
|
1251
|
-
m?.saving && /* @__PURE__ */ Z(P, { size: 12 }),
|
|
1252
|
-
m?.error && /* @__PURE__ */ Z("span", {
|
|
1253
|
-
style: {
|
|
1254
|
-
fontSize: 11,
|
|
1255
|
-
color: "var(--danger)"
|
|
1256
|
-
},
|
|
1257
|
-
title: m.error,
|
|
1258
|
-
children: "!"
|
|
1259
|
-
}),
|
|
1260
|
-
c === "row_edit" && /* @__PURE__ */ Z(A, {
|
|
1261
|
-
size: 24,
|
|
1262
|
-
icon: /* @__PURE__ */ Z(k.edit, { size: 12 }),
|
|
1263
|
-
onClick: () => _(e),
|
|
1264
|
-
title: D("record.row.edit", "Edit row")
|
|
1265
|
-
}),
|
|
1266
|
-
/* @__PURE__ */ Z(A, {
|
|
1267
|
-
size: 24,
|
|
1268
|
-
icon: /* @__PURE__ */ Z(k.trash, { size: 12 }),
|
|
1269
|
-
onClick: () => g(e),
|
|
1270
|
-
title: D("record.row.delete", "Delete row")
|
|
1271
|
-
})
|
|
1272
|
-
]
|
|
1273
|
-
})
|
|
1274
|
-
}),
|
|
1275
|
-
!s && C && C.length > 0 && /* @__PURE__ */ Z("td", {
|
|
1276
|
-
style: {
|
|
1277
|
-
padding: "4px 8px",
|
|
1278
|
-
borderBottom: "1px solid var(--divider)",
|
|
1279
|
-
verticalAlign: "middle"
|
|
1280
|
-
},
|
|
1281
|
-
children: /* @__PURE__ */ Z(fe, {
|
|
1282
|
-
entity: n,
|
|
1283
|
-
actions: C,
|
|
1284
|
-
objectIds: [e],
|
|
1285
|
-
row: O,
|
|
1286
|
-
onSuccess: w
|
|
1287
|
-
})
|
|
1288
|
-
})
|
|
1289
|
-
]
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1292
|
-
function Oe({ values: e, entity: t, columns: n, editableColumns: r, errors: i, saving: a, onChange: o, onConfirm: s, onCancel: c, refs: l, accent: u }) {
|
|
1293
|
-
let d = E(), f = i.find((e) => e.startsWith("_error:")), p = new Set(i.filter((e) => !e.startsWith("_error:"))), m = {
|
|
1294
|
-
padding: "6px 12px",
|
|
1295
|
-
borderBottom: "1px solid var(--divider)",
|
|
1296
|
-
verticalAlign: "middle",
|
|
1297
|
-
height: 40,
|
|
1298
|
-
minWidth: 0
|
|
1299
|
-
}, h = {
|
|
1300
|
-
display: "block",
|
|
1301
|
-
width: "100%",
|
|
1302
|
-
maxWidth: "100%",
|
|
1303
|
-
minWidth: 0
|
|
1304
|
-
};
|
|
1305
|
-
return /* @__PURE__ */ Q("tr", {
|
|
1306
|
-
style: u ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
|
|
1307
|
-
onKeyDown: (e) => {
|
|
1308
|
-
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), s()) : e.key === "Escape" && (e.preventDefault(), c());
|
|
1309
|
-
},
|
|
1310
|
-
children: [n.map((n) => {
|
|
1311
|
-
let i = t.fields.get(n), a = r.has(n), s = p.has(n);
|
|
1312
|
-
return a ? /* @__PURE__ */ Z("td", {
|
|
1313
|
-
style: {
|
|
1314
|
-
...m,
|
|
1315
|
-
outline: s ? "1px solid var(--danger)" : "none",
|
|
1316
|
-
outlineOffset: -1
|
|
1317
|
-
},
|
|
1318
|
-
title: s ? d("record.row.field_required", "{field} is required", { field: n }) : void 0,
|
|
1319
|
-
children: /* @__PURE__ */ Z("div", {
|
|
1320
|
-
style: h,
|
|
1321
|
-
children: i ? I({
|
|
1322
|
-
field: i,
|
|
1323
|
-
fieldName: n,
|
|
1324
|
-
value: e[n],
|
|
1325
|
-
mode: "edit",
|
|
1326
|
-
onChange: (e) => o(n, e),
|
|
1327
|
-
record: e,
|
|
1328
|
-
refs: l,
|
|
1329
|
-
compact: !0,
|
|
1330
|
-
t: d
|
|
1331
|
-
}) : T(e[n])
|
|
1332
|
-
})
|
|
1333
|
-
}, n) : /* @__PURE__ */ Z("td", {
|
|
1334
|
-
style: {
|
|
1335
|
-
...m,
|
|
1336
|
-
color: "var(--text-3)"
|
|
1337
|
-
},
|
|
1338
|
-
children: i?.auto ? "—" : T(e[n])
|
|
1339
|
-
}, n);
|
|
1340
|
-
}), /* @__PURE__ */ Z("td", {
|
|
1341
|
-
style: m,
|
|
1342
|
-
children: /* @__PURE__ */ Q("div", {
|
|
1343
|
-
style: {
|
|
1344
|
-
display: "flex",
|
|
1345
|
-
alignItems: "center",
|
|
1346
|
-
gap: 4,
|
|
1347
|
-
justifyContent: "flex-end"
|
|
1348
|
-
},
|
|
1349
|
-
children: [
|
|
1350
|
-
f && /* @__PURE__ */ Z("span", {
|
|
1351
|
-
style: {
|
|
1352
|
-
fontSize: 11,
|
|
1353
|
-
color: "var(--danger)"
|
|
1354
|
-
},
|
|
1355
|
-
title: f.slice(7),
|
|
1356
|
-
children: "!"
|
|
1357
|
-
}),
|
|
1358
|
-
/* @__PURE__ */ Z(A, {
|
|
1359
|
-
size: 24,
|
|
1360
|
-
icon: Z(a ? P : k.check, { size: 12 }),
|
|
1361
|
-
onClick: s,
|
|
1362
|
-
title: d("record.row.confirm", "Confirm (Enter)")
|
|
1363
|
-
}),
|
|
1364
|
-
/* @__PURE__ */ Z(A, {
|
|
1365
|
-
size: 24,
|
|
1366
|
-
icon: /* @__PURE__ */ Z(k.x, { size: 12 }),
|
|
1367
|
-
onClick: c,
|
|
1368
|
-
title: d("record.row.cancel", "Cancel (Esc)")
|
|
1369
|
-
})
|
|
1370
|
-
]
|
|
1371
|
-
})
|
|
1372
|
-
})]
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
function ke({ values: e, entity: t, columns: n, editableColumns: r, errors: i, saving: a, onChange: o, onConfirm: s, onCancel: c, refs: l, accent: u }) {
|
|
1376
|
-
let d = E(), f = ce(), p = i.find((e) => e.startsWith("_error:")), m = new Set(i.filter((e) => !e.startsWith("_error:")));
|
|
1377
|
-
return /* @__PURE__ */ Q("div", {
|
|
1378
|
-
style: {
|
|
1379
|
-
border: "1px solid var(--border)",
|
|
1380
|
-
borderRadius: 8,
|
|
1381
|
-
background: "var(--surface)",
|
|
1382
|
-
overflow: "hidden",
|
|
1383
|
-
boxShadow: u ? "inset 3px 0 0 var(--accent)" : void 0
|
|
1384
|
-
},
|
|
1385
|
-
onKeyDown: (e) => {
|
|
1386
|
-
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), s()) : e.key === "Escape" && (e.preventDefault(), c());
|
|
1387
|
-
},
|
|
1388
|
-
children: [/* @__PURE__ */ Z("div", {
|
|
1389
|
-
style: {
|
|
1390
|
-
padding: 10,
|
|
1391
|
-
display: "flex",
|
|
1392
|
-
flexDirection: "column",
|
|
1393
|
-
gap: 12
|
|
1394
|
-
},
|
|
1395
|
-
children: n.map((n) => {
|
|
1396
|
-
let i = t.fields.get(n), a = r.has(n), s = m.has(n), c = i ? b(d, i, n) : n, u = `${f}-${n}`, p = `${u}-label`, h = {
|
|
1397
|
-
fontSize: 11.5,
|
|
1398
|
-
fontWeight: 600,
|
|
1399
|
-
color: "var(--text-3)"
|
|
1400
|
-
};
|
|
1401
|
-
return /* @__PURE__ */ Q("div", {
|
|
1402
|
-
style: {
|
|
1403
|
-
display: "flex",
|
|
1404
|
-
flexDirection: "column",
|
|
1405
|
-
gap: 5,
|
|
1406
|
-
minWidth: 0
|
|
1407
|
-
},
|
|
1408
|
-
children: [a && i ? /* @__PURE__ */ Z("label", {
|
|
1409
|
-
id: p,
|
|
1410
|
-
htmlFor: u,
|
|
1411
|
-
style: h,
|
|
1412
|
-
children: c
|
|
1413
|
-
}) : /* @__PURE__ */ Z("div", {
|
|
1414
|
-
id: p,
|
|
1415
|
-
style: h,
|
|
1416
|
-
children: c
|
|
1417
|
-
}), /* @__PURE__ */ Z("div", {
|
|
1418
|
-
style: {
|
|
1419
|
-
minWidth: 0,
|
|
1420
|
-
outline: s ? "1px solid var(--danger)" : "none",
|
|
1421
|
-
outlineOffset: 3,
|
|
1422
|
-
borderRadius: s ? 5 : 0
|
|
1423
|
-
},
|
|
1424
|
-
title: s ? d("record.row.field_required", "{field} is required", { field: n }) : void 0,
|
|
1425
|
-
children: a ? i ? I({
|
|
1426
|
-
field: i,
|
|
1427
|
-
fieldName: n,
|
|
1428
|
-
value: e[n],
|
|
1429
|
-
mode: "edit",
|
|
1430
|
-
onChange: (e) => o(n, e),
|
|
1431
|
-
record: e,
|
|
1432
|
-
refs: l,
|
|
1433
|
-
compact: !0,
|
|
1434
|
-
fieldId: u,
|
|
1435
|
-
labelId: p,
|
|
1436
|
-
t: d
|
|
1437
|
-
}) : T(e[n]) : i?.auto ? "—" : T(e[n])
|
|
1438
|
-
})]
|
|
1439
|
-
}, n);
|
|
1440
|
-
})
|
|
1441
|
-
}), /* @__PURE__ */ Q("div", {
|
|
1442
|
-
style: {
|
|
1443
|
-
minHeight: 42,
|
|
1444
|
-
padding: "6px 8px",
|
|
1445
|
-
borderTop: "1px solid var(--divider)",
|
|
1446
|
-
display: "flex",
|
|
1447
|
-
alignItems: "center",
|
|
1448
|
-
justifyContent: "flex-end",
|
|
1449
|
-
gap: 6
|
|
1450
|
-
},
|
|
1451
|
-
children: [
|
|
1452
|
-
p && /* @__PURE__ */ Z("span", {
|
|
1453
|
-
style: {
|
|
1454
|
-
fontSize: 11,
|
|
1455
|
-
color: "var(--danger)"
|
|
1456
|
-
},
|
|
1457
|
-
title: p.slice(7),
|
|
1458
|
-
children: "!"
|
|
1459
|
-
}),
|
|
1460
|
-
/* @__PURE__ */ Z(A, {
|
|
1461
|
-
size: 32,
|
|
1462
|
-
icon: Z(a ? P : k.check, { size: 14 }),
|
|
1463
|
-
onClick: s,
|
|
1464
|
-
title: d("record.row.confirm", "Confirm (Enter)")
|
|
1465
|
-
}),
|
|
1466
|
-
/* @__PURE__ */ Z(A, {
|
|
1467
|
-
size: 32,
|
|
1468
|
-
icon: /* @__PURE__ */ Z(k.x, { size: 14 }),
|
|
1469
|
-
onClick: c,
|
|
1470
|
-
title: d("record.row.cancel", "Cancel (Esc)")
|
|
1471
|
-
})
|
|
1472
|
-
]
|
|
1473
|
-
})]
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
function Ae({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
1477
|
-
let d = q(() => {
|
|
1478
|
-
let e = new Set(r);
|
|
1479
|
-
return e.delete(i), e;
|
|
1480
|
-
}, [r, i]);
|
|
1481
|
-
return /* @__PURE__ */ Z(Oe, {
|
|
1482
|
-
values: e,
|
|
1483
|
-
entity: t,
|
|
1484
|
-
columns: n,
|
|
1485
|
-
editableColumns: d,
|
|
1486
|
-
errors: a,
|
|
1487
|
-
saving: o,
|
|
1488
|
-
onChange: s,
|
|
1489
|
-
onConfirm: c,
|
|
1490
|
-
onCancel: l,
|
|
1491
|
-
refs: u,
|
|
1492
|
-
accent: !0
|
|
1493
|
-
});
|
|
1494
|
-
}
|
|
1495
|
-
function je({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
|
|
1496
|
-
let d = q(() => {
|
|
1497
|
-
let e = new Set(r);
|
|
1498
|
-
return e.delete(i), e;
|
|
1499
|
-
}, [r, i]);
|
|
1500
|
-
return /* @__PURE__ */ Z(ke, {
|
|
1501
|
-
values: e,
|
|
1502
|
-
entity: t,
|
|
1503
|
-
columns: n,
|
|
1504
|
-
editableColumns: d,
|
|
1505
|
-
errors: a,
|
|
1506
|
-
saving: o,
|
|
1507
|
-
onChange: s,
|
|
1508
|
-
onConfirm: c,
|
|
1509
|
-
onCancel: l,
|
|
1510
|
-
refs: u,
|
|
1511
|
-
accent: !0
|
|
1512
|
-
});
|
|
1513
|
-
}
|
|
1514
|
-
//#endregion
|
|
1515
|
-
export { de as n, xe as t };
|