@declarion/react 0.141.0 → 0.146.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/{Icons-Dzl-AkD_.d.ts → Icons-BdXCxyw3.d.ts} +0 -4
- package/dist-lib/api/access-expiry.js +1 -2
- package/dist-lib/api/agents.js +1 -2
- package/dist-lib/api/audience.js +1 -2
- package/dist-lib/api/auth-redirect.js +1 -2
- package/dist-lib/api/auth.js +1 -2
- package/dist-lib/api/batch.js +1 -2
- package/dist-lib/api/client.js +27 -28
- package/dist-lib/api/data.js +23 -24
- package/dist-lib/api/entities.js +36 -37
- package/dist-lib/api/events.js +6 -7
- package/dist-lib/api/fileReferences.js +1 -2
- package/dist-lib/api/params.js +1 -2
- package/dist-lib/api/properties.js +1 -2
- package/dist-lib/api/request-bounds.js +1 -2
- package/dist-lib/api/schema.js +5 -6
- package/dist-lib/api/session-renewal.js +6 -7
- package/dist-lib/api/status.js +1 -2
- package/dist-lib/app.js +154 -155
- package/dist-lib/components/actions/ActionButton.js +32 -33
- package/dist-lib/components/actions/ActionDialog.js +85 -86
- package/dist-lib/components/actions/ActionResultDialog.impl.js +48 -49
- package/dist-lib/components/actions/ActionResultDialog.js +1 -2
- package/dist-lib/components/actions/ActionRunner.js +96 -97
- package/dist-lib/components/actions/ObjectActionBar.js +49 -50
- package/dist-lib/components/actions/PropertyGridEditor.js +50 -51
- package/dist-lib/components/actions/ResponsiveActionBar.js +127 -128
- package/dist-lib/components/actions/RowActionsKebab.js +27 -28
- package/dist-lib/components/agents/AgentChatPanel.impl.js +317 -318
- package/dist-lib/components/agents/AgentChatPanel.js +1 -2
- package/dist-lib/components/agents/AgentConversationDrawer.js +6 -7
- package/dist-lib/components/agents/AgentElicitForm.js +13 -14
- package/dist-lib/components/agents/AgentOpenFollower.impl.js +1 -2
- package/dist-lib/components/agents/AgentOpenFollower.js +1 -2
- package/dist-lib/components/agents/AgentPicker.js +1 -2
- package/dist-lib/components/agents/ChatAttachments.js +22 -23
- package/dist-lib/components/agents/transcript-runs.js +1 -2
- package/dist-lib/components/chrome/AssociationTabs.js +44 -45
- package/dist-lib/components/chrome/AuditMetaStrip.js +1 -2
- package/dist-lib/components/chrome/Breadcrumbs.js +1 -2
- package/dist-lib/components/chrome/HighlightsStrip.js +1 -2
- package/dist-lib/components/chrome/PageHeader.js +12 -13
- package/dist-lib/components/chrome/PageShell.js +1 -2
- package/dist-lib/components/chrome/RecordHeader.js +1 -2
- package/dist-lib/components/chrome/headerActionZone.js +0 -1
- package/dist-lib/components/detail-layout/AssociatedBlock.js +463 -464
- package/dist-lib/components/detail-layout/AssociatedToolbar.js +43 -44
- package/dist-lib/components/detail-layout/ChildrenBlock.js +24 -25
- package/dist-lib/components/detail-layout/ChildrenCards.js +29 -30
- package/dist-lib/components/detail-layout/ChildrenList.js +23 -24
- package/dist-lib/components/detail-layout/ChildrenTable.js +50 -51
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +164 -165
- package/dist-lib/components/detail-layout/DetailAuditStrip.js +14 -15
- package/dist-lib/components/detail-layout/DetailHighlights.js +23 -24
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +76 -77
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +90 -91
- package/dist-lib/components/detail-layout/ErrorSummary.js +7 -8
- package/dist-lib/components/detail-layout/EvidenceBlock.js +15 -16
- package/dist-lib/components/detail-layout/FieldRow.js +11 -12
- package/dist-lib/components/detail-layout/FieldsBlock.js +31 -32
- package/dist-lib/components/detail-layout/LayoutColumn.js +1 -2
- package/dist-lib/components/detail-layout/LayoutRenderer.js +11 -12
- package/dist-lib/components/detail-layout/LayoutRow.js +1 -2
- package/dist-lib/components/detail-layout/LayoutTabs.js +23 -24
- package/dist-lib/components/detail-layout/PropertiesBlock.js +38 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +28 -29
- package/dist-lib/components/detail-layout/SectionBlock.js +9 -10
- package/dist-lib/components/detail-layout/StatusesBlock.js +1 -2
- package/dist-lib/components/detail-layout/TimelineComposer.js +19 -20
- package/dist-lib/components/detail-layout/blockMeta.js +1 -2
- package/dist-lib/components/detail-layout/useManualColumnResize.js +1 -2
- package/dist-lib/components/detail-layout/useQuickAdd.js +21 -22
- package/dist-lib/components/detail-layout/visibility.js +1 -2
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +25 -26
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.js +18 -19
- package/dist-lib/components/detail-layout/widgets/MonacoJson.js +1 -2
- package/dist-lib/components/detail-layout/widgets/WidgetHost.js +10 -11
- package/dist-lib/components/detail-layout/widgets/builtins.js +1 -2
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.js +1 -2
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.js +1 -2
- package/dist-lib/components/detail-layout/widgets/registry.js +1 -2
- package/dist-lib/components/fields/BoolField.js +1 -2
- package/dist-lib/components/fields/EmailField.js +5 -6
- package/dist-lib/components/fields/EnumField.js +7 -8
- package/dist-lib/components/fields/FileReferenceField.js +18 -19
- package/dist-lib/components/fields/IntArrayField.js +11 -12
- package/dist-lib/components/fields/JsonEditor.js +1 -2
- package/dist-lib/components/fields/JsonField.js +1 -2
- package/dist-lib/components/fields/MultilangArrayField.js +22 -23
- package/dist-lib/components/fields/MultilangField.js +13 -14
- package/dist-lib/components/fields/MultilangTextField.js +13 -14
- package/dist-lib/components/fields/NumberField.js +5 -6
- package/dist-lib/components/fields/PasswordField.js +1 -2
- package/dist-lib/components/fields/PhoneField.js +24 -25
- package/dist-lib/components/fields/RefCombobox.js +42 -43
- package/dist-lib/components/fields/RefField.js +14 -15
- package/dist-lib/components/fields/RichTextField.js +29 -30
- package/dist-lib/components/fields/SecretField.js +1 -2
- package/dist-lib/components/fields/StringArrayField.js +29 -30
- package/dist-lib/components/fields/StringField.js +12 -13
- package/dist-lib/components/fields/StructureField.js +60 -61
- package/dist-lib/components/fields/TextField.js +18 -19
- package/dist-lib/components/fields/TimestampField.js +17 -18
- package/dist-lib/components/fields/UrlField.js +5 -6
- package/dist-lib/components/fields/cells/factories/badge.js +5 -6
- package/dist-lib/components/fields/cells/factories/boolPill.js +1 -2
- package/dist-lib/components/fields/cells/factories/code.js +1 -2
- package/dist-lib/components/fields/cells/factories/date.js +1 -2
- package/dist-lib/components/fields/cells/factories/email.js +1 -2
- package/dist-lib/components/fields/cells/factories/emptyCell.js +0 -1
- package/dist-lib/components/fields/cells/factories/fileReference.js +1 -2
- package/dist-lib/components/fields/cells/factories/host-icons.js +1 -2
- package/dist-lib/components/fields/cells/factories/json.js +1 -2
- package/dist-lib/components/fields/cells/factories/link.js +10 -11
- package/dist-lib/components/fields/cells/factories/markdown.js +14 -15
- package/dist-lib/components/fields/cells/factories/markdownPreview.js +1 -2
- package/dist-lib/components/fields/cells/factories/money.js +1 -2
- package/dist-lib/components/fields/cells/factories/multilangInline.js +1 -2
- package/dist-lib/components/fields/cells/factories/nextRun.js +8 -9
- package/dist-lib/components/fields/cells/factories/number.js +1 -2
- package/dist-lib/components/fields/cells/factories/passwordMask.js +1 -2
- package/dist-lib/components/fields/cells/factories/phone.js +1 -2
- package/dist-lib/components/fields/cells/factories/refLink.js +13 -14
- package/dist-lib/components/fields/cells/factories/richTextPreview.js +16 -17
- package/dist-lib/components/fields/cells/factories/statusPill.js +5 -6
- package/dist-lib/components/fields/cells/factories/tagList.js +6 -7
- package/dist-lib/components/fields/cells/factories/text.js +1 -2
- package/dist-lib/components/fields/cells/factories/timestamp.js +1 -2
- package/dist-lib/components/fields/cells/factories/url-helpers.js +1 -2
- package/dist-lib/components/fields/cells/factories/url.js +13 -14
- package/dist-lib/components/fields/cells/registry.js +1 -2
- package/dist-lib/components/fields/index.js +19 -20
- package/dist-lib/components/fields/langMap.js +1 -2
- package/dist-lib/components/fields/secretValue.js +1 -2
- package/dist-lib/components/file-widgets/CircleImage.js +1 -2
- package/dist-lib/components/file-widgets/DocumentCard.js +101 -102
- package/dist-lib/components/file-widgets/FileList.js +35 -36
- package/dist-lib/components/file-widgets/Grid.js +119 -120
- package/dist-lib/components/file-widgets/GridLazy.js +1 -2
- package/dist-lib/components/file-widgets/ImageWidget.js +189 -190
- package/dist-lib/components/file-widgets/LabeledSlots.js +14 -15
- package/dist-lib/components/file-widgets/SquareImage.js +1 -2
- package/dist-lib/components/file-widgets/UnknownFileWidget.js +1 -2
- package/dist-lib/components/file-widgets/UploadFailureText.js +1 -2
- package/dist-lib/components/file-widgets/WideBanner.js +1 -2
- package/dist-lib/components/file-widgets/builtins.js +1 -2
- package/dist-lib/components/file-widgets/cropper.js +1 -2
- package/dist-lib/components/file-widgets/draft-scope.js +1 -2
- package/dist-lib/components/file-widgets/helpers.js +1 -2
- package/dist-lib/components/file-widgets/host.js +33 -34
- package/dist-lib/components/file-widgets/payload.js +1 -2
- package/dist-lib/components/file-widgets/registry.js +1 -2
- package/dist-lib/components/file-widgets/upload.js +41 -42
- package/dist-lib/components/file-widgets/useEmbedFileSrc.js +12 -13
- package/dist-lib/components/file-widgets/useFileSelection.js +1 -2
- package/dist-lib/components/file-widgets/value.js +1 -2
- package/dist-lib/components/filters/FilterChips.js +15 -16
- package/dist-lib/components/filters/FilterConditionValue.js +15 -16
- package/dist-lib/components/filters/FilterDrawer.js +141 -142
- package/dist-lib/components/filters/FilterOmittedNotice.js +1 -2
- package/dist-lib/components/filters/filter-op-label.js +1 -2
- package/dist-lib/components/layout/CommandPalette.impl.js +24 -25
- package/dist-lib/components/layout/CommandPalette.js +1 -2
- package/dist-lib/components/layout/DirtyTabsCloseDialog.impl.js +15 -16
- package/dist-lib/components/layout/DirtyTabsCloseDialog.js +1 -2
- package/dist-lib/components/layout/ImpersonationBanner.impl.js +6 -7
- package/dist-lib/components/layout/ImpersonationBanner.js +1 -2
- package/dist-lib/components/layout/ImpersonationFrame.js +4 -5
- package/dist-lib/components/layout/ImpersonationStartModal.impl.js +4 -5
- package/dist-lib/components/layout/ImpersonationStartModal.js +1 -2
- package/dist-lib/components/layout/Layout.js +132 -140
- package/dist-lib/components/layout/Rail.js +11 -12
- package/dist-lib/components/layout/Sidebar.js +60 -61
- package/dist-lib/components/layout/TabStrip.js +66 -67
- package/dist-lib/components/layout/TenantChip.js +21 -22
- package/dist-lib/components/layout/TopBar.js +89 -90
- package/dist-lib/components/layout/tab-close.js +1 -2
- package/dist-lib/components/list/ColumnPicker.js +35 -36
- package/dist-lib/components/list/InlineEditCell.js +22 -23
- package/dist-lib/components/list/PeekFieldCell.js +7 -8
- package/dist-lib/components/list/QuickPeek.js +29 -30
- package/dist-lib/components/list/ViewSwitcher.js +44 -45
- package/dist-lib/components/list/peekDraftStore.js +1 -2
- package/dist-lib/components/pages/AdminCatalogPage.impl.js +59 -60
- package/dist-lib/components/pages/AdminCatalogPage.js +1 -2
- package/dist-lib/components/pages/DocumentsMenu.js +53 -54
- package/dist-lib/components/pages/ExportMenu.js +37 -38
- package/dist-lib/components/pages/NoScreensPage.impl.js +5 -6
- package/dist-lib/components/pages/NoScreensPage.js +1 -2
- package/dist-lib/components/pages/NotFoundPage.impl.js +7 -8
- package/dist-lib/components/pages/NotFoundPage.js +1 -2
- package/dist-lib/components/pages/RecordDocumentsPanel.js +40 -41
- package/dist-lib/components/pages/RecordNotesPanel.js +43 -44
- package/dist-lib/components/pages/RecordPanels.js +1 -2
- package/dist-lib/components/pages/SSOCallbackPage.impl.js +6 -7
- package/dist-lib/components/pages/SSOCallbackPage.js +1 -2
- package/dist-lib/components/pages/SmartDetailPage.impl.js +501 -502
- package/dist-lib/components/pages/SmartDetailPage.js +1 -2
- package/dist-lib/components/pages/SmartListPage.impl.js +316 -317
- package/dist-lib/components/pages/SmartListPage.js +1 -2
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +316 -317
- package/dist-lib/components/pages/SmartRecordListPage.js +1 -2
- package/dist-lib/components/pages/auth/AuthShell.js +14 -15
- package/dist-lib/components/pages/auth/CodeInput.js +0 -1
- package/dist-lib/components/pages/auth/Forgot.impl.js +12 -13
- package/dist-lib/components/pages/auth/Forgot.js +1 -2
- package/dist-lib/components/pages/auth/Reset.impl.js +20 -21
- package/dist-lib/components/pages/auth/Reset.js +1 -2
- package/dist-lib/components/pages/auth/SignIn.js +44 -45
- package/dist-lib/components/pages/auth/SignUp.impl.js +35 -36
- package/dist-lib/components/pages/auth/SignUp.js +1 -2
- package/dist-lib/components/pages/auth/SignUpCode.js +17 -18
- package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -10
- package/dist-lib/components/pages/auth/TwoFA.js +1 -2
- package/dist-lib/components/pages/auth/icons.js +1 -2
- package/dist-lib/components/pages/exportRequest.js +1 -2
- package/dist-lib/components/pages/list/DataCell.js +1 -2
- package/dist-lib/components/pages/list/DeleteViewDialog.js +5 -6
- package/dist-lib/components/pages/list/ListCardRow.js +53 -54
- package/dist-lib/components/pages/list/ListCardsBody.js +1 -2
- package/dist-lib/components/pages/list/ListFloatbar.js +25 -26
- package/dist-lib/components/pages/list/ListFooter.js +17 -18
- package/dist-lib/components/pages/list/ListHeader.js +31 -32
- package/dist-lib/components/pages/list/ListNoRows.js +32 -33
- package/dist-lib/components/pages/list/ListTable.js +29 -30
- package/dist-lib/components/pages/list/ListTableRow.js +1 -2
- package/dist-lib/components/pages/list/ListToolbar.js +58 -59
- package/dist-lib/components/pages/list/ListUrlBanner.js +1 -2
- package/dist-lib/components/pages/list/RowActionsCell.js +6 -7
- package/dist-lib/components/pages/list/RowContextMenu.js +1 -2
- package/dist-lib/components/pages/list/SaveViewDialog.js +5 -6
- package/dist-lib/components/pages/list/SortHeaderMenu.js +25 -26
- package/dist-lib/components/pages/list/cardProjection.js +16 -17
- package/dist-lib/components/pages/list/column-sizing.js +1 -2
- package/dist-lib/components/pages/list/columns.js +74 -75
- package/dist-lib/components/pages/list/filter-meta.js +1 -2
- package/dist-lib/components/pages/list/page-size.js +1 -2
- package/dist-lib/components/pages/list/sortable-header.js +1 -2
- package/dist-lib/components/pages/list/table-features.js +1 -2
- package/dist-lib/components/pages/list/use-filter-value-labels.js +15 -16
- package/dist-lib/components/pages/list/useActiveView.js +1 -2
- package/dist-lib/components/pages/list/useHeaderReorder.js +1 -2
- package/dist-lib/components/pages/list/useListColumnLayout.js +6 -7
- package/dist-lib/components/pages/list/useListFilterPresentation.js +1 -2
- package/dist-lib/components/pages/list/useListQuery.js +1 -2
- package/dist-lib/components/pages/list/useListRowInteraction.js +37 -38
- package/dist-lib/components/pages/list/useListSelection.js +16 -17
- package/dist-lib/components/pages/list/useListSort.js +1 -2
- package/dist-lib/components/pages/list/useListViews.js +31 -32
- package/dist-lib/components/pages/list/useRowMenu.js +20 -21
- package/dist-lib/components/pages/list/visible-filters.js +1 -2
- package/dist-lib/components/pages/profile/Preferences.impl.js +44 -45
- package/dist-lib/components/pages/profile/Preferences.js +1 -2
- package/dist-lib/components/pages/profile/Profile.impl.js +223 -224
- package/dist-lib/components/pages/profile/Profile.js +1 -2
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +133 -134
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.js +1 -2
- package/dist-lib/components/params/ParamsBlock.js +30 -31
- package/dist-lib/components/params/param-editors.js +58 -59
- package/dist-lib/components/primitives/Avatar.js +1 -2
- package/dist-lib/components/primitives/BoolToggle.js +1 -2
- package/dist-lib/components/primitives/BrandGlyph.js +1 -2
- package/dist-lib/components/primitives/BrandLogo.js +1 -2
- package/dist-lib/components/primitives/Btn.js +1 -2
- package/dist-lib/components/primitives/Check.js +1 -2
- package/dist-lib/components/primitives/Chip.js +1 -2
- package/dist-lib/components/primitives/ClassifiedFieldLocked.js +1 -2
- package/dist-lib/components/primitives/Dropdown.js +2 -3
- package/dist-lib/components/primitives/Fields.js +128 -129
- package/dist-lib/components/primitives/HoverCard.js +2 -3
- package/dist-lib/components/primitives/IconBtn.js +1 -2
- package/dist-lib/components/primitives/Icons.js +1 -2
- package/dist-lib/components/primitives/Kbd.js +1 -2
- package/dist-lib/components/primitives/MenuItem.js +1 -2
- package/dist-lib/components/primitives/Pill.js +1 -2
- package/dist-lib/components/primitives/RecordIdBadge.js +1 -2
- package/dist-lib/components/primitives/RetryButton.js +5 -6
- package/dist-lib/components/primitives/RowField.js +1 -2
- package/dist-lib/components/primitives/SectionCard.js +1 -2
- package/dist-lib/components/primitives/Spinner.js +1 -2
- package/dist-lib/components/primitives/StatTile.js +1 -2
- package/dist-lib/components/primitives/Tooltip.js +1 -2
- package/dist-lib/components/primitives/dataTableStyles.js +1 -2
- package/dist-lib/components/shared/BlankScreen.js +1 -2
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +20 -21
- package/dist-lib/components/shared/ChangePasswordDialog.js +1 -2
- package/dist-lib/components/shared/ConfirmDialog.js +7 -8
- package/dist-lib/components/shared/ConnectionNotice.js +1 -2
- package/dist-lib/components/shared/CopyButton.js +1 -2
- package/dist-lib/components/shared/DynamicIcon.js +1 -2
- package/dist-lib/components/shared/EmptyState.js +1 -2
- package/dist-lib/components/shared/ErrorBoundary.js +10 -11
- package/dist-lib/components/shared/LoadingSkeleton.js +1 -2
- package/dist-lib/components/shared/LucideIcon.js +1 -2
- package/dist-lib/components/shared/Markdown.js +1 -2
- package/dist-lib/components/shared/MarkdownRenderer.js +22 -23
- package/dist-lib/components/shared/ModalFrame.js +1 -2
- package/dist-lib/components/shared/RefreshControl.js +6 -7
- package/dist-lib/components/shared/StatusGroupsDisplay.js +16 -17
- package/dist-lib/components/shared/StatusStepper.js +1 -2
- package/dist-lib/components/shared/toast/DeclarionToast.js +1 -2
- package/dist-lib/components/shared/useOwnRefresh.js +1 -2
- package/dist-lib/embed/EmbedAuthBootstrap.js +30 -31
- package/dist-lib/embed/EmbedContext.js +1 -2
- package/dist-lib/embed/EmbedDirtyReporter.js +6 -7
- package/dist-lib/embed/EmbedHistoryTracker.js +1 -2
- package/dist-lib/embed/EmbedLocationReporter.js +11 -12
- package/dist-lib/embed/EmbedResizeReporter.js +9 -10
- package/dist-lib/embed/EmbedUnsavedGuard.js +5 -6
- package/dist-lib/embed/embed-dirty.js +1 -2
- package/dist-lib/embed/embed-history.js +1 -2
- package/dist-lib/embed/embed-nav-guard.js +1 -2
- package/dist-lib/embed/file-src.js +12 -13
- package/dist-lib/embed/handshake.js +1 -2
- package/dist-lib/embed/params.js +1 -2
- package/dist-lib/embed/protocol.js +1 -2
- package/dist-lib/embed/screen-location.js +1 -2
- package/dist-lib/embed/theme.js +1 -2
- package/dist-lib/embed/token.js +1 -2
- package/dist-lib/embed/useEmbedNavigate.js +25 -26
- package/dist-lib/embed/useGlobalLinkInterceptor.js +9 -10
- package/dist-lib/hooks/useActionData.js +1 -2
- package/dist-lib/hooks/useActiveTabFollowsRoute.js +7 -8
- package/dist-lib/hooks/useAgentConversation.js +122 -123
- package/dist-lib/hooks/useAggregate.js +1 -2
- package/dist-lib/hooks/useAllEntityData.js +9 -10
- package/dist-lib/hooks/useAssociatedData.js +1 -2
- package/dist-lib/hooks/useAuth.js +26 -27
- package/dist-lib/hooks/useBranding.js +1 -2
- package/dist-lib/hooks/useBrandingChrome.js +16 -17
- package/dist-lib/hooks/useChildrenData.js +4 -5
- package/dist-lib/hooks/useColumns.js +1 -2
- package/dist-lib/hooks/useConnectionNotice.js +16 -17
- package/dist-lib/hooks/useCurrentLocation.js +1 -2
- package/dist-lib/hooks/useCurrentScreen.js +1 -2
- package/dist-lib/hooks/useCursorEntityData.js +1 -2
- package/dist-lib/hooks/useDebounce.js +1 -2
- package/dist-lib/hooks/useDisplayTimeZone.js +4 -5
- package/dist-lib/hooks/useDocumentTitle.js +5 -6
- package/dist-lib/hooks/useEntity.js +1 -2
- package/dist-lib/hooks/useEntityData.js +1 -2
- package/dist-lib/hooks/useFileReferenceJSON.js +9 -10
- package/dist-lib/hooks/useFilters.js +5 -6
- package/dist-lib/hooks/useFollowAgentOpen.js +40 -41
- package/dist-lib/hooks/useImpersonation.js +15 -16
- package/dist-lib/hooks/useIntentPrefetch.js +6 -7
- package/dist-lib/hooks/useJsonSnapshot.js +1 -2
- package/dist-lib/hooks/useLanguage.js +11 -12
- package/dist-lib/hooks/useLiveObject.js +6 -7
- package/dist-lib/hooks/useLongPress.js +1 -2
- package/dist-lib/hooks/useMutations.js +31 -32
- package/dist-lib/hooks/useObject.js +1 -2
- package/dist-lib/hooks/useObjectStatus.js +4 -5
- package/dist-lib/hooks/usePageState.js +9 -10
- package/dist-lib/hooks/usePageStateRuntime.js +16 -17
- package/dist-lib/hooks/usePageStateTtl.js +1 -2
- package/dist-lib/hooks/useParams.js +58 -59
- package/dist-lib/hooks/useProperties.js +5 -6
- package/dist-lib/hooks/useRealtimeThresholds.js +4 -5
- package/dist-lib/hooks/useRefRecords.js +31 -32
- package/dist-lib/hooks/useRegisterScreenTab.js +12 -13
- package/dist-lib/hooks/useResponsiveMode.js +1 -2
- package/dist-lib/hooks/useRowTenant.js +1 -2
- package/dist-lib/hooks/useSSE.js +100 -101
- package/dist-lib/hooks/useSchema.js +16 -17
- package/dist-lib/hooks/useScreen.js +1 -2
- package/dist-lib/hooks/useScreenBack.js +17 -18
- package/dist-lib/hooks/useScreenTab.js +1 -2
- package/dist-lib/hooks/useTabNavigate.js +25 -26
- package/dist-lib/hooks/useTabSearchMirror.js +6 -7
- package/dist-lib/hooks/useTabTitle.js +10 -11
- package/dist-lib/hooks/useText.js +6 -7
- package/dist-lib/hooks/useTimelineData.js +5 -6
- package/dist-lib/hooks/useUiPreferences.js +31 -32
- package/dist-lib/hooks/useUnsavedInput.js +1 -2
- package/dist-lib/hooks/useVersionWatcher.js +16 -17
- package/dist-lib/hooks/useViews.js +16 -17
- package/dist-lib/hooks/useWindowConversation.js +1 -2
- package/dist-lib/{icon-registry-CUT4eF63.d.ts → icon-registry-BY2tt-GF.d.ts} +0 -2
- package/dist-lib/icons.d.ts +2 -4
- package/dist-lib/icons.js +5 -5
- package/dist-lib/index.d.ts +4 -272
- package/dist-lib/index.js +129 -129
- package/dist-lib/lib/action-dispatch.js +1 -2
- package/dist-lib/lib/actions.js +26 -27
- package/dist-lib/lib/anchor.js +1 -2
- package/dist-lib/lib/brand-tokens.js +1 -2
- package/dist-lib/lib/branding.js +1 -2
- package/dist-lib/lib/canonical-url.js +1 -2
- package/dist-lib/lib/capabilityPrefetch.js +1 -2
- package/dist-lib/lib/child-config.js +1 -2
- package/dist-lib/lib/children-validation.js +2 -3
- package/dist-lib/lib/date-text.js +1 -2
- package/dist-lib/lib/decimal-text.js +1 -2
- package/dist-lib/lib/display-value.js +1 -2
- package/dist-lib/lib/document-templates.js +1 -2
- package/dist-lib/lib/download.js +13 -14
- package/dist-lib/lib/evidence-verdict.js +1 -2
- package/dist-lib/lib/failure.js +4 -5
- package/dist-lib/lib/field-classification.js +1 -2
- package/dist-lib/lib/field-regions.js +1 -2
- package/dist-lib/lib/filter-evaluator.js +1 -2
- package/dist-lib/lib/filters.js +1 -2
- package/dist-lib/lib/format-count.js +1 -2
- package/dist-lib/lib/html-state.js +1 -2
- package/dist-lib/lib/language.js +1 -2
- package/dist-lib/lib/longPressGesture.js +0 -1
- package/dist-lib/lib/mass-edit.js +1 -2
- package/dist-lib/lib/money-text.js +1 -2
- package/dist-lib/lib/number-text.js +1 -2
- package/dist-lib/lib/page-inset.js +1 -2
- package/dist-lib/lib/phone.js +1 -2
- package/dist-lib/lib/profile.js +1 -2
- package/dist-lib/lib/query-retry.js +1 -2
- package/dist-lib/lib/quick-add.js +1 -2
- package/dist-lib/lib/read-display-state.js +1 -2
- package/dist-lib/lib/realtime-query-keys.js +2 -3
- package/dist-lib/lib/realtime-reconcile.js +32 -33
- package/dist-lib/lib/realtime-resync.js +40 -41
- package/dist-lib/lib/record-documents-key.js +1 -2
- package/dist-lib/lib/ref-choices.js +1 -2
- package/dist-lib/lib/refetch-when-idle.js +1 -2
- package/dist-lib/lib/rich-text.js +1 -2
- package/dist-lib/lib/role-label.js +1 -2
- package/dist-lib/lib/rowClickGesture.js +1 -2
- package/dist-lib/lib/safe-url.js +1 -2
- package/dist-lib/lib/schema-routing.js +1 -2
- package/dist-lib/lib/screen-back.js +1 -2
- package/dist-lib/lib/scroll-restoration.js +21 -22
- package/dist-lib/lib/shortcut.js +1 -2
- package/dist-lib/lib/size-value.js +1 -2
- package/dist-lib/lib/sort.js +1 -2
- package/dist-lib/lib/timestamp.js +1 -2
- package/dist-lib/lib/toast.js +1 -2
- package/dist-lib/lib/ui-actions.js +43 -44
- package/dist-lib/lib/utils.js +1 -2
- package/dist-lib/lib/variants.js +1 -2
- package/dist-lib/lib/versionTracker.js +26 -27
- package/dist-lib/lib/viewport-category.js +1 -2
- package/dist-lib/lib/window-election.js +1 -2
- package/dist-lib/stores/auth.js +32 -33
- package/dist-lib/stores/icon-registry.js +1 -2
- package/dist-lib/stores/list-layout.js +0 -1
- package/dist-lib/stores/page-state.js +1 -2
- package/dist-lib/stores/preferences.js +1 -2
- package/dist-lib/stores/realtime.js +1 -2
- package/dist-lib/stores/screen-registry.js +1 -2
- package/dist-lib/stores/tabs.js +1 -2
- package/dist-lib/test/seed-schema.js +4 -5
- package/dist-lib/testing.d.ts +2 -4
- package/dist-lib/testing.js +49 -50
- package/dist-lib/types/api.js +1 -2
- package/dist-lib/types/fieldType.js +1 -2
- package/dist-lib/types/ordmap.js +1 -2
- package/dist-lib/types/schema.js +1 -2
- package/dist-lib/{useResponsiveMode-C4MeAgoS.d.ts → useResponsiveMode-BElw02Gh.d.ts} +1 -19
- package/dist-lib/vite/index.d.ts +0 -2
- package/dist-lib/vite/index.js +1 -2
- package/package.json +11 -11
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { OrderedMap as e } from "../../types/ordmap.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { useTabNavigate as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { ResponsiveActionBar as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
2
|
+
import { Btn as t } from "../primitives/Btn.js";
|
|
3
|
+
import { Icon as n } from "../primitives/Icons.js";
|
|
4
|
+
import { IconBtn as r } from "../primitives/IconBtn.js";
|
|
5
|
+
import { SectionCard as i } from "../primitives/SectionCard.js";
|
|
6
|
+
import { Spinner as a } from "../primitives/Spinner.js";
|
|
7
|
+
import { dataTableCellStyle as o, dataTableHeadCellStyle as s, dataTableStyle as c } from "../primitives/dataTableStyles.js";
|
|
8
|
+
import { DynamicIcon as l } from "../shared/DynamicIcon.js";
|
|
9
|
+
import { entityAllowsMutation as u, extractPkValues as d, fieldDisplayName as f, getPrimaryKeyFields as p, isUserEditableField as m, resolveDetailRoute as h, rowSetInTenant as g } from "../../types/schema.js";
|
|
10
|
+
import { renderField as _ } from "../fields/index.js";
|
|
11
|
+
import { ENTITY_CHILDREN_KEY as v, useChildrenData as y } from "../../hooks/useChildrenData.js";
|
|
12
|
+
import { useAssociatedData as b } from "../../hooks/useAssociatedData.js";
|
|
13
|
+
import { readDisplayState as x } from "../../lib/read-display-state.js";
|
|
14
|
+
import { RetryButton as S } from "../primitives/RetryButton.js";
|
|
15
|
+
import { buildActionBody as C, createEntity as w, deleteObject as T, encodeObjectId as E, executeAction as D, updateEntity as O } from "../../api/data.js";
|
|
16
|
+
import { useTabNavigate as k } from "../../hooks/useTabNavigate.js";
|
|
17
|
+
import { ActionButton as A } from "../actions/ActionButton.js";
|
|
18
|
+
import { RowActionsKebab as j } from "../actions/RowActionsKebab.js";
|
|
19
|
+
import { AssociatedToolbar as M } from "./AssociatedToolbar.js";
|
|
20
|
+
import { applyRowState as N, defaultFlatForSlot as P } from "../../lib/actions.js";
|
|
21
|
+
import { coerceDisplayString as F } from "../../lib/display-value.js";
|
|
22
|
+
import { ResponsiveActionBar as I } from "../actions/ResponsiveActionBar.js";
|
|
23
|
+
import { useActionRunner as ee } from "../actions/ActionRunner.js";
|
|
24
|
+
import { dispatchAction as te } from "../../lib/action-dispatch.js";
|
|
25
|
+
import { useResponsiveMode as ne } from "../../hooks/useResponsiveMode.js";
|
|
26
|
+
import { useText as L } from "../../hooks/useText.js";
|
|
27
|
+
import { useRowTenant as re } from "../../hooks/useRowTenant.js";
|
|
28
|
+
import { failureTitle as R } from "../../lib/failure.js";
|
|
29
29
|
import { useCallback as z, useEffect as B, useId as ie, useMemo as V, useRef as ae, useState as H } from "react";
|
|
30
30
|
import { useQueryClient as U } from "@tanstack/react-query";
|
|
31
31
|
import { Fragment as oe, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
32
|
-
|
|
32
|
+
// src/components/detail-layout/AssociatedBlock.tsx
|
|
33
33
|
function se(e) {
|
|
34
34
|
if (!e) return [];
|
|
35
35
|
let t = [];
|
|
@@ -88,17 +88,17 @@ function ce(e, t, n) {
|
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
90
|
function q(e, t, n, r, i) {
|
|
91
|
-
let
|
|
92
|
-
if (!
|
|
93
|
-
let
|
|
94
|
-
return typeof
|
|
91
|
+
let a = e.fields.get(t)?.ref?.field;
|
|
92
|
+
if (!a || p(n).includes(a)) return i;
|
|
93
|
+
let o = r[a];
|
|
94
|
+
return typeof o == "string" || typeof o == "number" ? String(o) : "";
|
|
95
95
|
}
|
|
96
96
|
function le(e, t, n) {
|
|
97
|
-
let r = new Set(
|
|
97
|
+
let r = new Set(p(e));
|
|
98
98
|
return new Set(t.filter((t) => {
|
|
99
99
|
if (t === n || r.has(t)) return !1;
|
|
100
100
|
let i = e.fields.get(t);
|
|
101
|
-
return i ?
|
|
101
|
+
return i ? m(i) : !1;
|
|
102
102
|
}));
|
|
103
103
|
}
|
|
104
104
|
function ue(e, t, n) {
|
|
@@ -119,7 +119,7 @@ function de(e, t, n, r) {
|
|
|
119
119
|
return i;
|
|
120
120
|
}
|
|
121
121
|
function J({ node: e, ctx: t }) {
|
|
122
|
-
let n =
|
|
122
|
+
let n = L("errors"), r = e.associated;
|
|
123
123
|
if (!r || t.isNew) return null;
|
|
124
124
|
let i = t.schema.entities[r];
|
|
125
125
|
if (!i) return null;
|
|
@@ -145,67 +145,67 @@ function J({ node: e, ctx: t }) {
|
|
|
145
145
|
]
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function Y({ node: e, ctx:
|
|
149
|
-
let
|
|
150
|
-
if (e ===
|
|
151
|
-
let t =
|
|
148
|
+
function Y({ node: e, ctx: r, assocCode: a, assocEntity: o, fkField: s }) {
|
|
149
|
+
let c = L(), d = L("errors"), f = e.columns && e.columns.length > 0 ? e.columns.filter((e) => e !== s && !!o.fields.get(e)) : o.fields.names().filter((e) => {
|
|
150
|
+
if (e === s) return !1;
|
|
151
|
+
let t = o.fields.get(e);
|
|
152
152
|
return !(!t || t.primary || t.display?.is_listable === !1);
|
|
153
|
-
}),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
]),
|
|
153
|
+
}), p = u(o, "update"), m = re(o), h = e.interaction ?? "navigate", g = (h === "inline_edit" || h === "row_edit") && p && e.editable !== !1, _ = c(o.display?.name_plural) || c(o.display?.name) || a, v = e.searchable === !0 || e.filters && e.filters.length > 0, y = q(o, s, r.entity, r.record, r.recordId), b = V(() => K(o.actions, s, y), [
|
|
154
|
+
o.actions,
|
|
155
|
+
s,
|
|
156
|
+
y
|
|
157
|
+
]), x = V(() => {
|
|
158
158
|
let e = {};
|
|
159
|
-
for (let { code: t, action: n } of
|
|
159
|
+
for (let { code: t, action: n } of b) e[t] = n;
|
|
160
160
|
return e;
|
|
161
|
-
}, [
|
|
162
|
-
let e =
|
|
163
|
-
return
|
|
161
|
+
}, [b]), S = V(() => {
|
|
162
|
+
let e = o.action_layout ?? null;
|
|
163
|
+
return N(c, e ?? P(x, "list_toolbar"), x, void 0, {}, [], m);
|
|
164
164
|
}, [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
]), { run:
|
|
170
|
-
entity:
|
|
171
|
-
entityCode:
|
|
165
|
+
c,
|
|
166
|
+
o.action_layout,
|
|
167
|
+
x,
|
|
168
|
+
m
|
|
169
|
+
]), { run: w } = ee(), T = k(), E = V(() => ({
|
|
170
|
+
entity: o,
|
|
171
|
+
entityCode: a,
|
|
172
172
|
screenRoute: typeof window < "u" ? window.location.pathname : "",
|
|
173
173
|
selectedRows: [],
|
|
174
174
|
selectedIds: [],
|
|
175
|
-
t:
|
|
176
|
-
tabNavigate: (e, t) =>
|
|
175
|
+
t: c,
|
|
176
|
+
tabNavigate: (e, t) => T(e, {
|
|
177
177
|
title: t?.title,
|
|
178
178
|
icon: t?.icon,
|
|
179
179
|
search: t?.search
|
|
180
180
|
}),
|
|
181
|
-
runActionApi: (e, t) =>
|
|
181
|
+
runActionApi: (e, t) => D(e, t)
|
|
182
182
|
}), [
|
|
183
|
-
i,
|
|
184
|
-
r,
|
|
185
183
|
o,
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
184
|
+
a,
|
|
185
|
+
c,
|
|
186
|
+
T
|
|
187
|
+
]), O = U(), j = z(() => {
|
|
188
|
+
O.invalidateQueries({ predicate: (e) => {
|
|
189
189
|
let t = e.queryKey;
|
|
190
|
-
return t[0] === "entity-children" && t[3] ===
|
|
190
|
+
return t[0] === "entity-children" && t[3] === a;
|
|
191
191
|
} });
|
|
192
|
-
}, [
|
|
193
|
-
let n =
|
|
194
|
-
if (n !== null) return
|
|
192
|
+
}, [O, a]), M = z((e, t) => {
|
|
193
|
+
let n = te(d, e, t, {}, a);
|
|
194
|
+
if (n !== null) return w({
|
|
195
195
|
action: t,
|
|
196
|
-
title:
|
|
196
|
+
title: c(t.display?.name) || e,
|
|
197
197
|
execute: async (e) => {
|
|
198
|
-
let t = await
|
|
199
|
-
return
|
|
198
|
+
let t = await D(n, C(e, void 0));
|
|
199
|
+
return j(), t;
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
202
|
}, [
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
]), [
|
|
203
|
+
c,
|
|
204
|
+
d,
|
|
205
|
+
w,
|
|
206
|
+
a,
|
|
207
|
+
j
|
|
208
|
+
]), [F, ne] = H(0), R = /* @__PURE__ */ G("div", {
|
|
209
209
|
style: {
|
|
210
210
|
display: "flex",
|
|
211
211
|
alignItems: "center",
|
|
@@ -214,65 +214,65 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
|
|
|
214
214
|
minWidth: 0,
|
|
215
215
|
justifyContent: "flex-end"
|
|
216
216
|
},
|
|
217
|
-
children: [
|
|
217
|
+
children: [o.action_layout ? S.length > 0 && /* @__PURE__ */ W(I, {
|
|
218
218
|
kind: "toolbar",
|
|
219
|
-
layout:
|
|
220
|
-
entityActions:
|
|
221
|
-
onRun:
|
|
222
|
-
widgetContext:
|
|
223
|
-
ariaLabel:
|
|
224
|
-
}) :
|
|
219
|
+
layout: S,
|
|
220
|
+
entityActions: x,
|
|
221
|
+
onRun: M,
|
|
222
|
+
widgetContext: E,
|
|
223
|
+
ariaLabel: c("record.associated.toolbar_actions", "{name} toolbar actions", { name: _ })
|
|
224
|
+
}) : b.map(({ code: e, action: t }) => /* @__PURE__ */ W(A, {
|
|
225
225
|
actionCode: e,
|
|
226
226
|
action: t,
|
|
227
|
-
entityCode:
|
|
227
|
+
entityCode: a,
|
|
228
228
|
variant: "ghost",
|
|
229
229
|
size: "sm",
|
|
230
|
-
onSuccess:
|
|
231
|
-
}, e)),
|
|
230
|
+
onSuccess: j
|
|
231
|
+
}, e)), g && /* @__PURE__ */ W(t, {
|
|
232
232
|
kind: "ghost",
|
|
233
233
|
size: "xs",
|
|
234
|
-
icon: /* @__PURE__ */ W(
|
|
235
|
-
onClick: () =>
|
|
236
|
-
children:
|
|
234
|
+
icon: /* @__PURE__ */ W(n.plus, { size: 12 }),
|
|
235
|
+
onClick: () => ne((e) => e + 1),
|
|
236
|
+
children: c("record.row.add", "Add row")
|
|
237
237
|
})]
|
|
238
238
|
}), B = v ? /* @__PURE__ */ W(X, {
|
|
239
|
-
entityCode:
|
|
240
|
-
entity:
|
|
241
|
-
parentEntity:
|
|
242
|
-
parentId:
|
|
243
|
-
foreignKey:
|
|
244
|
-
columns:
|
|
245
|
-
editable:
|
|
246
|
-
interaction:
|
|
247
|
-
ctx:
|
|
239
|
+
entityCode: a,
|
|
240
|
+
entity: o,
|
|
241
|
+
parentEntity: r.entityCode,
|
|
242
|
+
parentId: y,
|
|
243
|
+
foreignKey: s,
|
|
244
|
+
columns: f,
|
|
245
|
+
editable: g,
|
|
246
|
+
interaction: h,
|
|
247
|
+
ctx: r,
|
|
248
248
|
searchable: e.searchable,
|
|
249
249
|
filterFields: e.filters,
|
|
250
250
|
sort: e.sort,
|
|
251
|
-
startDraftSignal:
|
|
251
|
+
startDraftSignal: F
|
|
252
252
|
}) : /* @__PURE__ */ W(fe, {
|
|
253
|
-
entityCode:
|
|
254
|
-
entity:
|
|
255
|
-
parentEntity:
|
|
256
|
-
parentId:
|
|
257
|
-
foreignKey:
|
|
258
|
-
columns:
|
|
259
|
-
editable:
|
|
260
|
-
interaction:
|
|
261
|
-
ctx:
|
|
253
|
+
entityCode: a,
|
|
254
|
+
entity: o,
|
|
255
|
+
parentEntity: r.entityCode,
|
|
256
|
+
parentId: y,
|
|
257
|
+
foreignKey: s,
|
|
258
|
+
columns: f,
|
|
259
|
+
editable: g,
|
|
260
|
+
interaction: h,
|
|
261
|
+
ctx: r,
|
|
262
262
|
sort: e.sort,
|
|
263
|
-
startDraftSignal:
|
|
263
|
+
startDraftSignal: F
|
|
264
264
|
});
|
|
265
|
-
return
|
|
265
|
+
return r.withinCard ? /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W("div", {
|
|
266
266
|
style: {
|
|
267
267
|
display: "flex",
|
|
268
268
|
justifyContent: "flex-end",
|
|
269
269
|
marginBottom: 8
|
|
270
270
|
},
|
|
271
271
|
children: R
|
|
272
|
-
}), B] }) : /* @__PURE__ */ W(
|
|
273
|
-
title:
|
|
274
|
-
icon:
|
|
275
|
-
name:
|
|
272
|
+
}), B] }) : /* @__PURE__ */ W(i, {
|
|
273
|
+
title: _,
|
|
274
|
+
icon: o.display?.icon ? /* @__PURE__ */ W(l, {
|
|
275
|
+
name: o.display.icon,
|
|
276
276
|
size: 14
|
|
277
277
|
}) : void 0,
|
|
278
278
|
right: R,
|
|
@@ -280,9 +280,9 @@ function Y({ node: e, ctx: t, assocCode: r, assocEntity: i, fkField: a }) {
|
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
function fe({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, sort: l, startDraftSignal: u }) {
|
|
283
|
-
let d = U(), f =
|
|
283
|
+
let d = U(), f = y(n, r, e, i, l), p = f.data, m = x(f), h = p?.data ?? [], g = p?.$refs, _ = z(() => {
|
|
284
284
|
d.invalidateQueries({ queryKey: [
|
|
285
|
-
|
|
285
|
+
v,
|
|
286
286
|
n,
|
|
287
287
|
r,
|
|
288
288
|
e
|
|
@@ -311,15 +311,15 @@ function fe({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey
|
|
|
311
311
|
startDraftSignal: u
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
|
-
function X({ entityCode: e, entity:
|
|
315
|
-
let
|
|
314
|
+
function X({ entityCode: e, entity: n, parentEntity: r, parentId: i, foreignKey: o, columns: s, editable: c, interaction: l, ctx: u, searchable: d, filterFields: f, sort: p, startDraftSignal: m }) {
|
|
315
|
+
let h = L(), g = U(), [_, v] = H(""), [y, S] = H(""), [C, w] = H({}), T = ae(void 0);
|
|
316
316
|
B(() => (T.current && clearTimeout(T.current), T.current = setTimeout(() => {
|
|
317
|
-
|
|
317
|
+
S(_);
|
|
318
318
|
}, 300), () => {
|
|
319
319
|
T.current && clearTimeout(T.current);
|
|
320
|
-
}), [
|
|
320
|
+
}), [_]);
|
|
321
321
|
let E = z((e, t) => {
|
|
322
|
-
|
|
322
|
+
w((n) => {
|
|
323
323
|
if (t === "__all__") {
|
|
324
324
|
let { [e]: t, ...r } = n;
|
|
325
325
|
return r;
|
|
@@ -329,7 +329,7 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
|
|
|
329
329
|
[e]: t
|
|
330
330
|
};
|
|
331
331
|
});
|
|
332
|
-
}, []), D = V(() => Object.keys(
|
|
332
|
+
}, []), D = V(() => Object.keys(C).length > 0 ? C : void 0, [C]), O = b(r, i, e, o, p, void 0, y || void 0, D), { data: k, hasNextPage: A, fetchNextPage: j, isFetchingNextPage: N } = O, P = x(O), { rows: F, refs: I } = V(() => {
|
|
333
333
|
if (!k?.pages) return {
|
|
334
334
|
rows: [],
|
|
335
335
|
refs: void 0
|
|
@@ -346,82 +346,82 @@ function X({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey:
|
|
|
346
346
|
rows: e,
|
|
347
347
|
refs: t
|
|
348
348
|
};
|
|
349
|
-
}, [k]),
|
|
350
|
-
|
|
349
|
+
}, [k]), ee = z(() => {
|
|
350
|
+
g.invalidateQueries({ predicate: (t) => {
|
|
351
351
|
let n = t.queryKey;
|
|
352
352
|
return n[0] === "entity-children" && n[3] === e;
|
|
353
353
|
} });
|
|
354
|
-
}, [
|
|
354
|
+
}, [g, e]);
|
|
355
355
|
return /* @__PURE__ */ G("div", { children: [
|
|
356
|
-
/* @__PURE__ */ W(
|
|
357
|
-
entity:
|
|
358
|
-
searchable:
|
|
359
|
-
filterFields:
|
|
360
|
-
searchValue:
|
|
361
|
-
onSearchChange:
|
|
362
|
-
filters:
|
|
356
|
+
/* @__PURE__ */ W(M, {
|
|
357
|
+
entity: n,
|
|
358
|
+
searchable: d,
|
|
359
|
+
filterFields: f,
|
|
360
|
+
searchValue: _,
|
|
361
|
+
onSearchChange: v,
|
|
362
|
+
filters: C,
|
|
363
363
|
onFilterChange: E,
|
|
364
|
-
allEntities:
|
|
364
|
+
allEntities: u.schema.entities
|
|
365
365
|
}),
|
|
366
366
|
/* @__PURE__ */ W(Z, {
|
|
367
367
|
entityCode: e,
|
|
368
|
-
entity:
|
|
369
|
-
parentId:
|
|
370
|
-
foreignKey:
|
|
371
|
-
columns:
|
|
372
|
-
editable:
|
|
373
|
-
interaction:
|
|
374
|
-
ctx:
|
|
375
|
-
rows:
|
|
376
|
-
refs:
|
|
377
|
-
isLoading:
|
|
378
|
-
isError:
|
|
379
|
-
onRetry:
|
|
380
|
-
invalidateQuery:
|
|
381
|
-
startDraftSignal:
|
|
368
|
+
entity: n,
|
|
369
|
+
parentId: i,
|
|
370
|
+
foreignKey: o,
|
|
371
|
+
columns: s,
|
|
372
|
+
editable: c,
|
|
373
|
+
interaction: l,
|
|
374
|
+
ctx: u,
|
|
375
|
+
rows: F,
|
|
376
|
+
refs: I,
|
|
377
|
+
isLoading: P.loading,
|
|
378
|
+
isError: P.error !== null,
|
|
379
|
+
onRetry: P.retry,
|
|
380
|
+
invalidateQuery: ee,
|
|
381
|
+
startDraftSignal: m
|
|
382
382
|
}),
|
|
383
383
|
A && /* @__PURE__ */ W("div", {
|
|
384
384
|
style: { marginTop: 4 },
|
|
385
|
-
children: /* @__PURE__ */ W(
|
|
385
|
+
children: /* @__PURE__ */ W(t, {
|
|
386
386
|
kind: "ghost",
|
|
387
387
|
size: "xs",
|
|
388
|
-
icon:
|
|
388
|
+
icon: N ? /* @__PURE__ */ W(a, { size: 12 }) : void 0,
|
|
389
389
|
onClick: () => j(),
|
|
390
|
-
disabled:
|
|
391
|
-
children:
|
|
390
|
+
disabled: N,
|
|
391
|
+
children: h("record.associated.load_more", "Load more")
|
|
392
392
|
})
|
|
393
393
|
})
|
|
394
394
|
] });
|
|
395
395
|
}
|
|
396
|
-
function Z({ entityCode: e, entity: t, parentId: n, foreignKey:
|
|
397
|
-
let
|
|
398
|
-
p,
|
|
399
|
-
t,
|
|
400
|
-
g.schema.screens
|
|
401
|
-
]), F = V(() => l ? le(t, o, a) : /* @__PURE__ */ new Set(), [
|
|
396
|
+
function Z({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: i, editable: a, interaction: o, ctx: l, rows: u, refs: p, isLoading: m, isError: _, onRetry: v, invalidateQuery: y, startDraftSignal: b }) {
|
|
397
|
+
let x = L(), C = L("errors"), D = ne(), k = re(t), A = D.isPhone && l.relatedRecordsPresentation === "table", j = i.find((e) => e !== r), M = V(() => o === "navigate" ? h(void 0, t, l.schema.screens) : null, [
|
|
402
398
|
o,
|
|
403
|
-
a,
|
|
404
399
|
t,
|
|
405
|
-
l
|
|
406
|
-
]),
|
|
407
|
-
|
|
408
|
-
|
|
400
|
+
l.schema.screens
|
|
401
|
+
]), N = V(() => a ? le(t, i, r) : /* @__PURE__ */ new Set(), [
|
|
402
|
+
i,
|
|
403
|
+
r,
|
|
404
|
+
t,
|
|
405
|
+
a
|
|
406
|
+
]), P = V(() => ue(t, i, r), [
|
|
407
|
+
i,
|
|
408
|
+
r,
|
|
409
409
|
t
|
|
410
|
-
]),
|
|
410
|
+
]), F = V(() => {
|
|
411
411
|
let e = /* @__PURE__ */ new Map();
|
|
412
|
-
for (let n of
|
|
413
|
-
let
|
|
414
|
-
e.set(
|
|
412
|
+
for (let n of u) {
|
|
413
|
+
let r = d(t, n);
|
|
414
|
+
e.set(E(r), r);
|
|
415
415
|
}
|
|
416
416
|
return e;
|
|
417
|
-
}, [
|
|
417
|
+
}, [u, t]), I = V(() => {
|
|
418
418
|
let e = /* @__PURE__ */ new Map();
|
|
419
|
-
for (let n of
|
|
420
|
-
let
|
|
421
|
-
typeof
|
|
419
|
+
for (let n of u) {
|
|
420
|
+
let r = n.$row_version;
|
|
421
|
+
typeof r == "string" && r !== "" && e.set(E(d(t, n)), r);
|
|
422
422
|
}
|
|
423
423
|
return e;
|
|
424
|
-
}, [
|
|
424
|
+
}, [u, t]), te = V(() => se(t.actions), [t.actions]), [ie, U] = H(null), [oe, K] = H(null), [ce, q] = H([]), [J, Y] = H({}), fe = ae(J);
|
|
425
425
|
fe.current = J;
|
|
426
426
|
let X = ae({});
|
|
427
427
|
B(() => {
|
|
@@ -430,7 +430,7 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
430
430
|
for (let t of Object.values(e)) clearTimeout(t);
|
|
431
431
|
};
|
|
432
432
|
}, []);
|
|
433
|
-
let [Z, Q] = H(null), [he, $] = H([]), [ve, ye] = H(!1), { run: be } =
|
|
433
|
+
let [Z, Q] = H(null), [he, $] = H([]), [ve, ye] = H(!1), { run: be } = ee(), [xe, Se] = H(/* @__PURE__ */ new Set()), Ce = z(async (t, n, r) => {
|
|
434
434
|
Y((e) => ({
|
|
435
435
|
...e,
|
|
436
436
|
[t]: {
|
|
@@ -440,11 +440,11 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
440
440
|
}
|
|
441
441
|
}));
|
|
442
442
|
try {
|
|
443
|
-
let i =
|
|
443
|
+
let i = I.get(t), a = i ? {
|
|
444
444
|
...n,
|
|
445
445
|
$row_version: i
|
|
446
446
|
} : n;
|
|
447
|
-
return await
|
|
447
|
+
return await O(e, F.get(t) ?? t, a), Y((e) => {
|
|
448
448
|
let n = e[t];
|
|
449
449
|
if (!n) return e;
|
|
450
450
|
if (n.ver > r) return {
|
|
@@ -456,9 +456,9 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
456
456
|
};
|
|
457
457
|
let { [t]: i, ...a } = e;
|
|
458
458
|
return a;
|
|
459
|
-
}),
|
|
459
|
+
}), y(), !0;
|
|
460
460
|
} catch (e) {
|
|
461
|
-
let n =
|
|
461
|
+
let n = R(C, e);
|
|
462
462
|
return Y((e) => ({
|
|
463
463
|
...e,
|
|
464
464
|
[t]: {
|
|
@@ -470,10 +470,10 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
470
470
|
}
|
|
471
471
|
}, [
|
|
472
472
|
e,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
473
|
+
C,
|
|
474
|
+
y,
|
|
475
|
+
F,
|
|
476
|
+
I
|
|
477
477
|
]), we = z((e, t, n) => {
|
|
478
478
|
Y((r) => {
|
|
479
479
|
let i = r[e] ?? {
|
|
@@ -492,41 +492,41 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
492
492
|
ver: a
|
|
493
493
|
}
|
|
494
494
|
};
|
|
495
|
-
}),
|
|
495
|
+
}), o === "inline_edit" && (X.current[e] && clearTimeout(X.current[e]), X.current[e] = setTimeout(() => {
|
|
496
496
|
let t = fe.current[e];
|
|
497
497
|
t && Object.keys(t.buffer).length > 0 && Ce(e, { ...t.buffer }, t.ver);
|
|
498
498
|
}, 500));
|
|
499
|
-
}, [Ce,
|
|
499
|
+
}, [Ce, o]), Te = z(() => {
|
|
500
500
|
let e = {};
|
|
501
|
-
e[
|
|
502
|
-
for (let n of
|
|
501
|
+
e[r] = n;
|
|
502
|
+
for (let n of i) {
|
|
503
503
|
let r = t.fields.get(n);
|
|
504
504
|
r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
|
|
505
505
|
}
|
|
506
506
|
Q(e), $([]);
|
|
507
507
|
}, [
|
|
508
|
-
|
|
508
|
+
r,
|
|
509
509
|
n,
|
|
510
|
-
|
|
510
|
+
i,
|
|
511
511
|
t.fields
|
|
512
|
-
]), Ee = ae(
|
|
512
|
+
]), Ee = ae(b);
|
|
513
513
|
B(() => {
|
|
514
|
-
|
|
514
|
+
b !== void 0 && b !== Ee.current && (Ee.current = b, Z || Te());
|
|
515
515
|
}, [
|
|
516
|
-
|
|
516
|
+
b,
|
|
517
517
|
Z,
|
|
518
518
|
Te
|
|
519
519
|
]);
|
|
520
520
|
let De = z(async () => {
|
|
521
521
|
if (!Z) return;
|
|
522
|
-
let n = de(Z,
|
|
522
|
+
let n = de(Z, i, t, r);
|
|
523
523
|
if (n.length > 0) $(n);
|
|
524
524
|
else {
|
|
525
525
|
ye(!0);
|
|
526
526
|
try {
|
|
527
|
-
await
|
|
527
|
+
await w(e, Z), Q(null), $([]), y();
|
|
528
528
|
} catch (e) {
|
|
529
|
-
let t =
|
|
529
|
+
let t = R(C, e);
|
|
530
530
|
$([`_error:${t}`]);
|
|
531
531
|
} finally {
|
|
532
532
|
ye(!1);
|
|
@@ -534,30 +534,30 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
534
534
|
}
|
|
535
535
|
}, [
|
|
536
536
|
Z,
|
|
537
|
-
|
|
537
|
+
i,
|
|
538
538
|
t,
|
|
539
|
-
|
|
539
|
+
r,
|
|
540
540
|
e,
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
C,
|
|
542
|
+
y
|
|
543
543
|
]), Oe = z((e) => {
|
|
544
544
|
Y({}), q([]), K(e);
|
|
545
545
|
}, []), ke = z(async (e) => {
|
|
546
|
-
let n = fe.current[e],
|
|
547
|
-
if (Object.keys(
|
|
546
|
+
let n = fe.current[e], a = n?.buffer ?? {};
|
|
547
|
+
if (Object.keys(a).length === 0) {
|
|
548
548
|
K(null), q([]);
|
|
549
549
|
return;
|
|
550
550
|
}
|
|
551
|
-
let
|
|
552
|
-
...
|
|
553
|
-
...
|
|
554
|
-
},
|
|
555
|
-
|
|
551
|
+
let o = de({
|
|
552
|
+
...u.find((n) => E(d(t, n)) === e) ?? {},
|
|
553
|
+
...a
|
|
554
|
+
}, i, t, r);
|
|
555
|
+
o.length > 0 ? q(o) : await Ce(e, { ...a }, n?.ver ?? 0) && (K(null), q([]));
|
|
556
556
|
}, [
|
|
557
|
-
|
|
557
|
+
u,
|
|
558
558
|
t,
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
i,
|
|
560
|
+
r,
|
|
561
561
|
Ce
|
|
562
562
|
]), Ae = z((e) => {
|
|
563
563
|
Y((t) => {
|
|
@@ -566,17 +566,17 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
566
566
|
return r;
|
|
567
567
|
}), q([]), K(null);
|
|
568
568
|
}, []), je = z((n, r) => {
|
|
569
|
-
let i =
|
|
569
|
+
let i = F.get(n) ?? n;
|
|
570
570
|
return be({
|
|
571
571
|
action: t.actions?.__delete,
|
|
572
572
|
destructive: !0,
|
|
573
|
-
title:
|
|
573
|
+
title: x(t.display?.name) || x("record.action.delete", "Delete"),
|
|
574
574
|
row: r,
|
|
575
575
|
entity: e,
|
|
576
576
|
execute: async () => {
|
|
577
577
|
Se((e) => new Set(e).add(n));
|
|
578
578
|
try {
|
|
579
|
-
return await
|
|
579
|
+
return await T(e, i);
|
|
580
580
|
} finally {
|
|
581
581
|
Se((e) => {
|
|
582
582
|
let t = new Set(e);
|
|
@@ -584,29 +584,29 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
},
|
|
587
|
-
onSuccess: () =>
|
|
587
|
+
onSuccess: () => y()
|
|
588
588
|
});
|
|
589
589
|
}, [
|
|
590
|
-
|
|
590
|
+
x,
|
|
591
591
|
be,
|
|
592
592
|
t,
|
|
593
593
|
e,
|
|
594
|
-
|
|
595
|
-
|
|
594
|
+
y,
|
|
595
|
+
F
|
|
596
596
|
]);
|
|
597
|
-
if (
|
|
597
|
+
if (_) return /* @__PURE__ */ G("div", {
|
|
598
598
|
style: {
|
|
599
599
|
fontSize: 12.5,
|
|
600
600
|
color: "var(--danger)",
|
|
601
601
|
padding: "8px 0"
|
|
602
602
|
},
|
|
603
603
|
children: [
|
|
604
|
-
|
|
604
|
+
C("record.related_rows_unreadable", "The related records could not be loaded."),
|
|
605
605
|
" ",
|
|
606
|
-
/* @__PURE__ */ W(
|
|
606
|
+
/* @__PURE__ */ W(S, { onRetry: v })
|
|
607
607
|
]
|
|
608
608
|
});
|
|
609
|
-
if (
|
|
609
|
+
if (m) return /* @__PURE__ */ G("div", {
|
|
610
610
|
style: {
|
|
611
611
|
display: "flex",
|
|
612
612
|
flexDirection: "column",
|
|
@@ -623,56 +623,56 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
623
623
|
borderRadius: "var(--radius-md)"
|
|
624
624
|
} })]
|
|
625
625
|
});
|
|
626
|
-
let Me =
|
|
627
|
-
return
|
|
626
|
+
let Me = u.length === 0 && !Z;
|
|
627
|
+
return D.isPhone && !A ? /* @__PURE__ */ G("div", { children: [Me && /* @__PURE__ */ W("div", {
|
|
628
628
|
style: {
|
|
629
629
|
fontSize: 12.5,
|
|
630
630
|
color: "var(--text-3)",
|
|
631
631
|
padding: "12px 0"
|
|
632
632
|
},
|
|
633
|
-
children:
|
|
633
|
+
children: x("record.related.empty", "No records yet.")
|
|
634
634
|
}), !Me && /* @__PURE__ */ G("div", {
|
|
635
635
|
style: {
|
|
636
636
|
display: "flex",
|
|
637
637
|
flexDirection: "column",
|
|
638
638
|
gap: 10
|
|
639
639
|
},
|
|
640
|
-
children: [
|
|
641
|
-
let
|
|
640
|
+
children: [u.map((n) => {
|
|
641
|
+
let r = E(d(t, n)), s = xe.has(r), c = J[r], u = M && r ? M.replace(/:\w+/, r) : void 0;
|
|
642
642
|
return /* @__PURE__ */ W(pe, {
|
|
643
|
-
rowId:
|
|
643
|
+
rowId: r,
|
|
644
644
|
row: n,
|
|
645
645
|
entity: t,
|
|
646
|
-
entities:
|
|
647
|
-
screens:
|
|
648
|
-
columns:
|
|
649
|
-
editableColumns:
|
|
650
|
-
editable:
|
|
651
|
-
interaction:
|
|
652
|
-
isEditing: oe ===
|
|
646
|
+
entities: l.schema.entities,
|
|
647
|
+
screens: l.schema.screens,
|
|
648
|
+
columns: i,
|
|
649
|
+
editableColumns: N,
|
|
650
|
+
editable: a && g(t, n, k.tenantId),
|
|
651
|
+
interaction: o,
|
|
652
|
+
isEditing: oe === r,
|
|
653
653
|
editErrors: ce,
|
|
654
|
-
isDeleting:
|
|
654
|
+
isDeleting: s,
|
|
655
655
|
activeCell: ie,
|
|
656
656
|
setActiveCell: U,
|
|
657
|
-
rowState:
|
|
657
|
+
rowState: c,
|
|
658
658
|
onCellChange: we,
|
|
659
659
|
onDeleteClick: (e) => void je(e, n),
|
|
660
660
|
onStartEdit: Oe,
|
|
661
661
|
onConfirmEdit: ke,
|
|
662
662
|
onCancelEdit: Ae,
|
|
663
|
-
refs:
|
|
664
|
-
identityCol:
|
|
663
|
+
refs: p,
|
|
664
|
+
identityCol: j,
|
|
665
665
|
href: u,
|
|
666
|
-
rowActions:
|
|
666
|
+
rowActions: te,
|
|
667
667
|
entityCode: e,
|
|
668
|
-
onRowActionSuccess:
|
|
669
|
-
},
|
|
668
|
+
onRowActionSuccess: y
|
|
669
|
+
}, r);
|
|
670
670
|
}), Z && /* @__PURE__ */ W(_e, {
|
|
671
671
|
draftRow: Z,
|
|
672
672
|
entity: t,
|
|
673
|
-
columns:
|
|
674
|
-
editableColumns:
|
|
675
|
-
foreignKey:
|
|
673
|
+
columns: i,
|
|
674
|
+
editableColumns: P,
|
|
675
|
+
foreignKey: r,
|
|
676
676
|
draftErrors: he,
|
|
677
677
|
draftSaving: ve,
|
|
678
678
|
onChange: (e, t) => Q((n) => n && {
|
|
@@ -683,7 +683,7 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
683
683
|
onCancel: () => {
|
|
684
684
|
Q(null), $([]);
|
|
685
685
|
},
|
|
686
|
-
refs:
|
|
686
|
+
refs: p
|
|
687
687
|
})]
|
|
688
688
|
})] }) : /* @__PURE__ */ G("div", { children: [Me && /* @__PURE__ */ W("div", {
|
|
689
689
|
style: {
|
|
@@ -691,63 +691,63 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
691
691
|
color: "var(--text-3)",
|
|
692
692
|
padding: "12px 0"
|
|
693
693
|
},
|
|
694
|
-
children:
|
|
694
|
+
children: x("record.related.empty", "No records yet.")
|
|
695
695
|
}), !Me && /* @__PURE__ */ W("div", {
|
|
696
696
|
style: { overflowX: "auto" },
|
|
697
697
|
children: /* @__PURE__ */ G("table", {
|
|
698
|
-
style:
|
|
698
|
+
style: c,
|
|
699
699
|
children: [/* @__PURE__ */ W("thead", { children: /* @__PURE__ */ G("tr", { children: [
|
|
700
|
-
|
|
700
|
+
i.map((e) => {
|
|
701
701
|
let n = t.fields.get(e);
|
|
702
702
|
return /* @__PURE__ */ W("th", {
|
|
703
|
-
style:
|
|
704
|
-
children: n ?
|
|
703
|
+
style: s,
|
|
704
|
+
children: n ? f(x, n, e, l.schema.entities) : e
|
|
705
705
|
}, e);
|
|
706
706
|
}),
|
|
707
|
-
|
|
707
|
+
a && /* @__PURE__ */ W("th", { style: {
|
|
708
708
|
height: 30,
|
|
709
709
|
width: 72
|
|
710
710
|
} }),
|
|
711
|
-
!
|
|
711
|
+
!a && te.length > 0 && /* @__PURE__ */ W("th", { style: {
|
|
712
712
|
height: 30,
|
|
713
713
|
width: 40
|
|
714
714
|
} })
|
|
715
|
-
] }) }), /* @__PURE__ */ G("tbody", { children: [
|
|
716
|
-
let
|
|
715
|
+
] }) }), /* @__PURE__ */ G("tbody", { children: [u.map((n) => {
|
|
716
|
+
let r = E(d(t, n)), s = xe.has(r), c = J[r], u = M && r ? M.replace(/:\w+/, r) : void 0;
|
|
717
717
|
return /* @__PURE__ */ W(me, {
|
|
718
|
-
rowId:
|
|
718
|
+
rowId: r,
|
|
719
719
|
row: n,
|
|
720
720
|
entity: t,
|
|
721
|
-
entities:
|
|
722
|
-
screens:
|
|
723
|
-
columns:
|
|
724
|
-
editableColumns:
|
|
725
|
-
editable:
|
|
726
|
-
interaction:
|
|
727
|
-
isEditing: oe ===
|
|
721
|
+
entities: l.schema.entities,
|
|
722
|
+
screens: l.schema.screens,
|
|
723
|
+
columns: i,
|
|
724
|
+
editableColumns: N,
|
|
725
|
+
editable: a && g(t, n, k.tenantId),
|
|
726
|
+
interaction: o,
|
|
727
|
+
isEditing: oe === r,
|
|
728
728
|
editErrors: ce,
|
|
729
|
-
isDeleting:
|
|
729
|
+
isDeleting: s,
|
|
730
730
|
activeCell: ie,
|
|
731
731
|
setActiveCell: U,
|
|
732
|
-
rowState:
|
|
732
|
+
rowState: c,
|
|
733
733
|
onCellChange: we,
|
|
734
734
|
onDeleteClick: (e) => void je(e, n),
|
|
735
735
|
onStartEdit: Oe,
|
|
736
736
|
onConfirmEdit: ke,
|
|
737
737
|
onCancelEdit: Ae,
|
|
738
|
-
refs:
|
|
739
|
-
identityCol:
|
|
738
|
+
refs: p,
|
|
739
|
+
identityCol: j,
|
|
740
740
|
href: u,
|
|
741
|
-
rowActions:
|
|
741
|
+
rowActions: te,
|
|
742
742
|
entityCode: e,
|
|
743
|
-
onRowActionSuccess:
|
|
744
|
-
},
|
|
743
|
+
onRowActionSuccess: y
|
|
744
|
+
}, r);
|
|
745
745
|
}), Z && /* @__PURE__ */ W(ge, {
|
|
746
746
|
draftRow: Z,
|
|
747
747
|
entity: t,
|
|
748
|
-
columns:
|
|
749
|
-
editableColumns:
|
|
750
|
-
foreignKey:
|
|
748
|
+
columns: i,
|
|
749
|
+
editableColumns: P,
|
|
750
|
+
foreignKey: r,
|
|
751
751
|
draftErrors: he,
|
|
752
752
|
draftSaving: ve,
|
|
753
753
|
onChange: (e, t) => Q((n) => n && {
|
|
@@ -758,29 +758,29 @@ function Z({ entityCode: e, entity: t, parentId: n, foreignKey: a, columns: o, e
|
|
|
758
758
|
onCancel: () => {
|
|
759
759
|
Q(null), $([]);
|
|
760
760
|
},
|
|
761
|
-
refs:
|
|
761
|
+
refs: p
|
|
762
762
|
})] })]
|
|
763
763
|
})
|
|
764
764
|
})] });
|
|
765
765
|
}
|
|
766
|
-
function pe({ rowId: e, row:
|
|
767
|
-
let
|
|
768
|
-
...
|
|
769
|
-
...
|
|
770
|
-
}, [
|
|
771
|
-
if (
|
|
772
|
-
let t =
|
|
766
|
+
function pe({ rowId: e, row: t, entity: i, entities: o, screens: s, columns: c, editableColumns: l, editable: u, interaction: d, isEditing: p, editErrors: m, isDeleting: h, rowState: g, onCellChange: v, onDeleteClick: y, onStartEdit: b, onConfirmEdit: x, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
|
|
767
|
+
let O = L(), k = ie(), A = V(() => !g || Object.keys(g.buffer).length === 0 ? t : {
|
|
768
|
+
...t,
|
|
769
|
+
...g.buffer
|
|
770
|
+
}, [t, g]);
|
|
771
|
+
if (d === "row_edit" && p) {
|
|
772
|
+
let t = g?.error ? [...m, `_error:${g.error}`] : m;
|
|
773
773
|
return /* @__PURE__ */ W(he, {
|
|
774
|
-
values:
|
|
775
|
-
entity:
|
|
776
|
-
columns:
|
|
777
|
-
editableColumns:
|
|
774
|
+
values: A,
|
|
775
|
+
entity: i,
|
|
776
|
+
columns: c,
|
|
777
|
+
editableColumns: l,
|
|
778
778
|
errors: t,
|
|
779
|
-
saving:
|
|
780
|
-
onChange: (t, n) =>
|
|
779
|
+
saving: g?.saving ?? !1,
|
|
780
|
+
onChange: (t, n) => v(e, t, n),
|
|
781
781
|
onConfirm: () => x(e),
|
|
782
782
|
onCancel: () => S(e),
|
|
783
|
-
refs:
|
|
783
|
+
refs: C
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
786
|
return /* @__PURE__ */ G("div", {
|
|
@@ -788,7 +788,7 @@ function pe({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
|
|
|
788
788
|
border: "1px solid var(--border)",
|
|
789
789
|
borderRadius: "var(--radius-md)",
|
|
790
790
|
background: "var(--surface)",
|
|
791
|
-
opacity:
|
|
791
|
+
opacity: h ? .58 : 1,
|
|
792
792
|
overflow: "hidden"
|
|
793
793
|
},
|
|
794
794
|
children: [/* @__PURE__ */ W("div", {
|
|
@@ -798,27 +798,27 @@ function pe({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
|
|
|
798
798
|
flexDirection: "column",
|
|
799
799
|
gap: 12
|
|
800
800
|
},
|
|
801
|
-
children:
|
|
802
|
-
let
|
|
801
|
+
children: c.map((t) => {
|
|
802
|
+
let n = i.fields.get(t), r = u && d === "inline_edit" && l.has(t), a = T && t === w, c = n ? f(O, n, t, o) : t, p = `${k}-${e}-${t}`, m = `${p}-label`, h = {
|
|
803
803
|
fontSize: 11.5,
|
|
804
804
|
fontWeight: 600,
|
|
805
805
|
color: "var(--text-3)"
|
|
806
|
-
},
|
|
807
|
-
field:
|
|
808
|
-
fieldName:
|
|
809
|
-
value:
|
|
810
|
-
mode:
|
|
811
|
-
onChange:
|
|
812
|
-
record:
|
|
813
|
-
refs:
|
|
814
|
-
compact:
|
|
815
|
-
entity:
|
|
816
|
-
entities:
|
|
817
|
-
screens:
|
|
818
|
-
fieldId:
|
|
819
|
-
labelId:
|
|
820
|
-
t:
|
|
821
|
-
}) :
|
|
806
|
+
}, g = n ? _({
|
|
807
|
+
field: n,
|
|
808
|
+
fieldName: t,
|
|
809
|
+
value: A[t],
|
|
810
|
+
mode: r ? "edit" : "display",
|
|
811
|
+
onChange: r ? (n) => v(e, t, n) : void 0,
|
|
812
|
+
record: A,
|
|
813
|
+
refs: C,
|
|
814
|
+
compact: r,
|
|
815
|
+
entity: i,
|
|
816
|
+
entities: o,
|
|
817
|
+
screens: a ? void 0 : s,
|
|
818
|
+
fieldId: p,
|
|
819
|
+
labelId: m,
|
|
820
|
+
t: O
|
|
821
|
+
}) : F(A[t]);
|
|
822
822
|
return /* @__PURE__ */ G("div", {
|
|
823
823
|
style: {
|
|
824
824
|
display: "flex",
|
|
@@ -826,30 +826,30 @@ function pe({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
|
|
|
826
826
|
gap: 5,
|
|
827
827
|
minWidth: 0
|
|
828
828
|
},
|
|
829
|
-
children: [
|
|
830
|
-
id:
|
|
831
|
-
htmlFor:
|
|
832
|
-
style:
|
|
833
|
-
children:
|
|
829
|
+
children: [r && n ? /* @__PURE__ */ W("label", {
|
|
830
|
+
id: m,
|
|
831
|
+
htmlFor: p,
|
|
832
|
+
style: h,
|
|
833
|
+
children: c
|
|
834
834
|
}) : /* @__PURE__ */ W("div", {
|
|
835
|
-
id:
|
|
836
|
-
style:
|
|
837
|
-
children:
|
|
835
|
+
id: m,
|
|
836
|
+
style: h,
|
|
837
|
+
children: c
|
|
838
838
|
}), /* @__PURE__ */ W("div", {
|
|
839
839
|
style: { minWidth: 0 },
|
|
840
|
-
children:
|
|
841
|
-
href:
|
|
840
|
+
children: a && !r ? /* @__PURE__ */ W("a", {
|
|
841
|
+
href: T,
|
|
842
842
|
style: {
|
|
843
843
|
color: "var(--accent-text)",
|
|
844
844
|
textDecoration: "none",
|
|
845
845
|
fontWeight: 500
|
|
846
846
|
},
|
|
847
|
-
children:
|
|
848
|
-
}) :
|
|
847
|
+
children: g
|
|
848
|
+
}) : g
|
|
849
849
|
})]
|
|
850
|
-
},
|
|
850
|
+
}, t);
|
|
851
851
|
})
|
|
852
|
-
}), (
|
|
852
|
+
}), (u || E && E.length > 0) && /* @__PURE__ */ G("div", {
|
|
853
853
|
style: {
|
|
854
854
|
minHeight: 42,
|
|
855
855
|
padding: "6px 8px",
|
|
@@ -859,104 +859,104 @@ function pe({ rowId: e, row: n, entity: r, entities: a, screens: o, columns: s,
|
|
|
859
859
|
justifyContent: "flex-end",
|
|
860
860
|
gap: 6
|
|
861
861
|
},
|
|
862
|
-
children: [
|
|
863
|
-
|
|
864
|
-
|
|
862
|
+
children: [u && /* @__PURE__ */ G(oe, { children: [
|
|
863
|
+
g?.saving && /* @__PURE__ */ W(a, { size: 12 }),
|
|
864
|
+
g?.error && /* @__PURE__ */ W("span", {
|
|
865
865
|
style: {
|
|
866
866
|
fontSize: 11,
|
|
867
867
|
color: "var(--danger)"
|
|
868
868
|
},
|
|
869
|
-
title:
|
|
869
|
+
title: g.error,
|
|
870
870
|
children: "!"
|
|
871
871
|
}),
|
|
872
|
-
|
|
872
|
+
d === "row_edit" && /* @__PURE__ */ W(r, {
|
|
873
873
|
size: 32,
|
|
874
|
-
icon: /* @__PURE__ */ W(
|
|
874
|
+
icon: /* @__PURE__ */ W(n.edit, { size: 14 }),
|
|
875
875
|
onClick: () => b(e),
|
|
876
|
-
title:
|
|
876
|
+
title: O("record.row.edit", "Edit row")
|
|
877
877
|
}),
|
|
878
|
-
/* @__PURE__ */ W(
|
|
878
|
+
/* @__PURE__ */ W(r, {
|
|
879
879
|
size: 32,
|
|
880
|
-
icon: /* @__PURE__ */ W(
|
|
881
|
-
onClick: () =>
|
|
882
|
-
title:
|
|
880
|
+
icon: /* @__PURE__ */ W(n.trash, { size: 14 }),
|
|
881
|
+
onClick: () => y(e),
|
|
882
|
+
title: O("record.row.delete", "Delete row")
|
|
883
883
|
})
|
|
884
|
-
] }), !
|
|
885
|
-
entity:
|
|
886
|
-
actions:
|
|
884
|
+
] }), !u && E && E.length > 0 && /* @__PURE__ */ W(j, {
|
|
885
|
+
entity: i,
|
|
886
|
+
actions: E,
|
|
887
887
|
objectIds: [e],
|
|
888
|
-
row:
|
|
889
|
-
onSuccess:
|
|
888
|
+
row: A,
|
|
889
|
+
onSuccess: D
|
|
890
890
|
})]
|
|
891
891
|
})]
|
|
892
892
|
});
|
|
893
893
|
}
|
|
894
|
-
function me({ rowId: e, row:
|
|
895
|
-
let A =
|
|
896
|
-
...
|
|
897
|
-
...
|
|
898
|
-
}, [
|
|
899
|
-
if (
|
|
900
|
-
let t =
|
|
894
|
+
function me({ rowId: e, row: t, entity: i, entities: s, screens: c, columns: l, editableColumns: u, editable: d, interaction: f, isEditing: p, editErrors: m, isDeleting: h, activeCell: g, setActiveCell: v, rowState: y, onCellChange: b, onDeleteClick: x, onStartEdit: S, onConfirmEdit: C, onCancelEdit: w, refs: T, identityCol: E, href: D, rowActions: O, onRowActionSuccess: k }) {
|
|
895
|
+
let A = L(), M = V(() => !y || Object.keys(y.buffer).length === 0 ? t : {
|
|
896
|
+
...t,
|
|
897
|
+
...y.buffer
|
|
898
|
+
}, [t, y]);
|
|
899
|
+
if (f === "row_edit" && p) {
|
|
900
|
+
let t = y?.error ? [...m, `_error:${y.error}`] : m;
|
|
901
901
|
return /* @__PURE__ */ W(Q, {
|
|
902
|
-
values:
|
|
903
|
-
entity:
|
|
904
|
-
columns:
|
|
905
|
-
editableColumns:
|
|
902
|
+
values: M,
|
|
903
|
+
entity: i,
|
|
904
|
+
columns: l,
|
|
905
|
+
editableColumns: u,
|
|
906
906
|
errors: t,
|
|
907
|
-
saving:
|
|
908
|
-
onChange: (t, n) =>
|
|
909
|
-
onConfirm: () =>
|
|
907
|
+
saving: y?.saving ?? !1,
|
|
908
|
+
onChange: (t, n) => b(e, t, n),
|
|
909
|
+
onConfirm: () => C(e),
|
|
910
910
|
onCancel: () => w(e),
|
|
911
911
|
refs: T
|
|
912
912
|
});
|
|
913
913
|
}
|
|
914
|
-
let N =
|
|
914
|
+
let N = o, P = {
|
|
915
915
|
padding: "4px 4px",
|
|
916
916
|
borderBottom: "1px solid var(--divider)",
|
|
917
917
|
verticalAlign: "middle"
|
|
918
|
-
},
|
|
918
|
+
}, I = f === "inline_edit";
|
|
919
919
|
return /* @__PURE__ */ G("tr", {
|
|
920
|
-
style: { opacity:
|
|
920
|
+
style: { opacity: h ? .5 : 1 },
|
|
921
921
|
children: [
|
|
922
|
-
|
|
923
|
-
let
|
|
924
|
-
if (
|
|
922
|
+
l.map((t) => {
|
|
923
|
+
let n = i.fields.get(t), r = u.has(t);
|
|
924
|
+
if (I && g?.rowId === e && g?.col === t && r) return /* @__PURE__ */ W("td", {
|
|
925
925
|
style: P,
|
|
926
|
-
children:
|
|
927
|
-
field:
|
|
928
|
-
fieldName:
|
|
929
|
-
value:
|
|
926
|
+
children: n ? _({
|
|
927
|
+
field: n,
|
|
928
|
+
fieldName: t,
|
|
929
|
+
value: M[t],
|
|
930
930
|
mode: "edit",
|
|
931
|
-
onChange: (
|
|
932
|
-
record:
|
|
931
|
+
onChange: (n) => b(e, t, n),
|
|
932
|
+
record: M,
|
|
933
933
|
refs: T,
|
|
934
934
|
compact: !0,
|
|
935
935
|
t: A
|
|
936
|
-
}) :
|
|
937
|
-
},
|
|
938
|
-
let
|
|
939
|
-
field:
|
|
940
|
-
fieldName:
|
|
941
|
-
value:
|
|
936
|
+
}) : F(M[t])
|
|
937
|
+
}, t);
|
|
938
|
+
let a = D && t === E, o = n ? _({
|
|
939
|
+
field: n,
|
|
940
|
+
fieldName: t,
|
|
941
|
+
value: M[t],
|
|
942
942
|
mode: "display",
|
|
943
|
-
record:
|
|
943
|
+
record: M,
|
|
944
944
|
refs: T,
|
|
945
|
-
entity:
|
|
946
|
-
entities:
|
|
947
|
-
screens:
|
|
945
|
+
entity: i,
|
|
946
|
+
entities: s,
|
|
947
|
+
screens: a ? void 0 : c,
|
|
948
948
|
t: A
|
|
949
|
-
}) :
|
|
949
|
+
}) : F(M[t]), l = I && r && !h;
|
|
950
950
|
return /* @__PURE__ */ W("td", {
|
|
951
951
|
style: {
|
|
952
952
|
...N,
|
|
953
|
-
cursor:
|
|
953
|
+
cursor: l ? "pointer" : "default"
|
|
954
954
|
},
|
|
955
|
-
onClick:
|
|
955
|
+
onClick: l ? () => v({
|
|
956
956
|
rowId: e,
|
|
957
|
-
col:
|
|
957
|
+
col: t
|
|
958
958
|
}) : void 0,
|
|
959
|
-
children:
|
|
959
|
+
children: a ? /* @__PURE__ */ W("a", {
|
|
960
960
|
href: D,
|
|
961
961
|
style: {
|
|
962
962
|
color: "var(--accent-text)",
|
|
@@ -965,11 +965,11 @@ function me({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
|
|
|
965
965
|
},
|
|
966
966
|
onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
|
|
967
967
|
onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
|
|
968
|
-
children:
|
|
969
|
-
}) :
|
|
970
|
-
},
|
|
968
|
+
children: o
|
|
969
|
+
}) : o
|
|
970
|
+
}, t);
|
|
971
971
|
}),
|
|
972
|
-
|
|
972
|
+
d && /* @__PURE__ */ W("td", {
|
|
973
973
|
style: {
|
|
974
974
|
padding: "4px 8px",
|
|
975
975
|
borderBottom: "1px solid var(--divider)",
|
|
@@ -982,97 +982,97 @@ function me({ rowId: e, row: n, entity: r, entities: i, screens: a, columns: o,
|
|
|
982
982
|
gap: 4
|
|
983
983
|
},
|
|
984
984
|
children: [
|
|
985
|
-
|
|
986
|
-
|
|
985
|
+
y?.saving && /* @__PURE__ */ W(a, { size: 12 }),
|
|
986
|
+
y?.error && /* @__PURE__ */ W("span", {
|
|
987
987
|
style: {
|
|
988
988
|
fontSize: 11,
|
|
989
989
|
color: "var(--danger)"
|
|
990
990
|
},
|
|
991
|
-
title:
|
|
991
|
+
title: y.error,
|
|
992
992
|
children: "!"
|
|
993
993
|
}),
|
|
994
|
-
|
|
994
|
+
f === "row_edit" && /* @__PURE__ */ W(r, {
|
|
995
995
|
size: 24,
|
|
996
|
-
icon: /* @__PURE__ */ W(
|
|
997
|
-
onClick: () =>
|
|
996
|
+
icon: /* @__PURE__ */ W(n.edit, { size: 12 }),
|
|
997
|
+
onClick: () => S(e),
|
|
998
998
|
title: A("record.row.edit", "Edit row")
|
|
999
999
|
}),
|
|
1000
|
-
/* @__PURE__ */ W(
|
|
1000
|
+
/* @__PURE__ */ W(r, {
|
|
1001
1001
|
size: 24,
|
|
1002
|
-
icon: /* @__PURE__ */ W(
|
|
1003
|
-
onClick: () =>
|
|
1002
|
+
icon: /* @__PURE__ */ W(n.trash, { size: 12 }),
|
|
1003
|
+
onClick: () => x(e),
|
|
1004
1004
|
title: A("record.row.delete", "Delete row")
|
|
1005
1005
|
})
|
|
1006
1006
|
]
|
|
1007
1007
|
})
|
|
1008
1008
|
}),
|
|
1009
|
-
!
|
|
1009
|
+
!d && O && O.length > 0 && /* @__PURE__ */ W("td", {
|
|
1010
1010
|
style: {
|
|
1011
1011
|
padding: "4px 8px",
|
|
1012
1012
|
borderBottom: "1px solid var(--divider)",
|
|
1013
1013
|
verticalAlign: "middle"
|
|
1014
1014
|
},
|
|
1015
|
-
children: /* @__PURE__ */ W(
|
|
1016
|
-
entity:
|
|
1015
|
+
children: /* @__PURE__ */ W(j, {
|
|
1016
|
+
entity: i,
|
|
1017
1017
|
actions: O,
|
|
1018
1018
|
objectIds: [e],
|
|
1019
|
-
row:
|
|
1019
|
+
row: M,
|
|
1020
1020
|
onSuccess: k
|
|
1021
1021
|
})
|
|
1022
1022
|
})
|
|
1023
1023
|
]
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
1026
|
-
function Q({ values: e, entity:
|
|
1027
|
-
let
|
|
1026
|
+
function Q({ values: e, entity: t, columns: i, editableColumns: o, errors: s, saving: c, onChange: l, onConfirm: u, onCancel: d, refs: f, accent: p }) {
|
|
1027
|
+
let m = L(), h = s.find((e) => e.startsWith("_error:")), g = new Set(s.filter((e) => !e.startsWith("_error:"))), v = {
|
|
1028
1028
|
padding: "6px 12px",
|
|
1029
1029
|
borderBottom: "1px solid var(--divider)",
|
|
1030
1030
|
verticalAlign: "middle",
|
|
1031
1031
|
height: 40,
|
|
1032
1032
|
minWidth: 0
|
|
1033
|
-
},
|
|
1033
|
+
}, y = {
|
|
1034
1034
|
display: "block",
|
|
1035
1035
|
width: "100%",
|
|
1036
1036
|
maxWidth: "100%",
|
|
1037
1037
|
minWidth: 0
|
|
1038
1038
|
};
|
|
1039
1039
|
return /* @__PURE__ */ G("tr", {
|
|
1040
|
-
style:
|
|
1040
|
+
style: p ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
|
|
1041
1041
|
onKeyDown: (e) => {
|
|
1042
|
-
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(),
|
|
1042
|
+
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), u()) : e.key === "Escape" && (e.preventDefault(), d());
|
|
1043
1043
|
},
|
|
1044
|
-
children: [
|
|
1045
|
-
let
|
|
1046
|
-
return
|
|
1044
|
+
children: [i.map((n) => {
|
|
1045
|
+
let r = t.fields.get(n), i = o.has(n), a = g.has(n);
|
|
1046
|
+
return i ? /* @__PURE__ */ W("td", {
|
|
1047
1047
|
style: {
|
|
1048
|
-
...
|
|
1049
|
-
outline:
|
|
1048
|
+
...v,
|
|
1049
|
+
outline: a ? "1px solid var(--danger)" : "none",
|
|
1050
1050
|
outlineOffset: -1
|
|
1051
1051
|
},
|
|
1052
|
-
title:
|
|
1052
|
+
title: a ? m("record.row.field_required", "{field} is required", { field: n }) : void 0,
|
|
1053
1053
|
children: /* @__PURE__ */ W("div", {
|
|
1054
|
-
style:
|
|
1055
|
-
children:
|
|
1056
|
-
field:
|
|
1057
|
-
fieldName:
|
|
1058
|
-
value: e[
|
|
1054
|
+
style: y,
|
|
1055
|
+
children: r ? _({
|
|
1056
|
+
field: r,
|
|
1057
|
+
fieldName: n,
|
|
1058
|
+
value: e[n],
|
|
1059
1059
|
mode: "edit",
|
|
1060
|
-
onChange: (e) =>
|
|
1060
|
+
onChange: (e) => l(n, e),
|
|
1061
1061
|
record: e,
|
|
1062
|
-
refs:
|
|
1062
|
+
refs: f,
|
|
1063
1063
|
compact: !0,
|
|
1064
|
-
t:
|
|
1065
|
-
}) :
|
|
1064
|
+
t: m
|
|
1065
|
+
}) : F(e[n])
|
|
1066
1066
|
})
|
|
1067
|
-
},
|
|
1067
|
+
}, n) : /* @__PURE__ */ W("td", {
|
|
1068
1068
|
style: {
|
|
1069
|
-
...
|
|
1069
|
+
...v,
|
|
1070
1070
|
color: "var(--text-3)"
|
|
1071
1071
|
},
|
|
1072
|
-
children:
|
|
1073
|
-
},
|
|
1072
|
+
children: r?.auto ? "—" : F(e[n])
|
|
1073
|
+
}, n);
|
|
1074
1074
|
}), /* @__PURE__ */ W("td", {
|
|
1075
|
-
style:
|
|
1075
|
+
style: v,
|
|
1076
1076
|
children: /* @__PURE__ */ G("div", {
|
|
1077
1077
|
style: {
|
|
1078
1078
|
display: "flex",
|
|
@@ -1081,43 +1081,43 @@ function Q({ values: e, entity: n, columns: r, editableColumns: i, errors: a, sa
|
|
|
1081
1081
|
justifyContent: "flex-end"
|
|
1082
1082
|
},
|
|
1083
1083
|
children: [
|
|
1084
|
-
|
|
1084
|
+
h && /* @__PURE__ */ W("span", {
|
|
1085
1085
|
style: {
|
|
1086
1086
|
fontSize: 11,
|
|
1087
1087
|
color: "var(--danger)"
|
|
1088
1088
|
},
|
|
1089
|
-
title:
|
|
1089
|
+
title: h.slice(7),
|
|
1090
1090
|
children: "!"
|
|
1091
1091
|
}),
|
|
1092
|
-
/* @__PURE__ */ W(
|
|
1092
|
+
/* @__PURE__ */ W(r, {
|
|
1093
1093
|
size: 24,
|
|
1094
|
-
icon: W(
|
|
1095
|
-
onClick:
|
|
1096
|
-
title:
|
|
1094
|
+
icon: W(c ? a : n.check, { size: 12 }),
|
|
1095
|
+
onClick: u,
|
|
1096
|
+
title: m("record.row.confirm", "Confirm (Enter)")
|
|
1097
1097
|
}),
|
|
1098
|
-
/* @__PURE__ */ W(
|
|
1098
|
+
/* @__PURE__ */ W(r, {
|
|
1099
1099
|
size: 24,
|
|
1100
|
-
icon: /* @__PURE__ */ W(
|
|
1101
|
-
onClick:
|
|
1102
|
-
title:
|
|
1100
|
+
icon: /* @__PURE__ */ W(n.x, { size: 12 }),
|
|
1101
|
+
onClick: d,
|
|
1102
|
+
title: m("record.row.cancel", "Cancel (Esc)")
|
|
1103
1103
|
})
|
|
1104
1104
|
]
|
|
1105
1105
|
})
|
|
1106
1106
|
})]
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
|
-
function he({ values: e, entity:
|
|
1110
|
-
let
|
|
1109
|
+
function he({ values: e, entity: t, columns: i, editableColumns: o, errors: s, saving: c, onChange: l, onConfirm: u, onCancel: d, refs: p, accent: m }) {
|
|
1110
|
+
let h = L(), g = ie(), v = s.find((e) => e.startsWith("_error:")), y = new Set(s.filter((e) => !e.startsWith("_error:")));
|
|
1111
1111
|
return /* @__PURE__ */ G("div", {
|
|
1112
1112
|
style: {
|
|
1113
1113
|
border: "1px solid var(--border)",
|
|
1114
1114
|
borderRadius: "var(--radius-md)",
|
|
1115
1115
|
background: "var(--surface)",
|
|
1116
1116
|
overflow: "hidden",
|
|
1117
|
-
boxShadow:
|
|
1117
|
+
boxShadow: m ? "inset 3px 0 0 var(--accent)" : void 0
|
|
1118
1118
|
},
|
|
1119
1119
|
onKeyDown: (e) => {
|
|
1120
|
-
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(),
|
|
1120
|
+
e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), u()) : e.key === "Escape" && (e.preventDefault(), d());
|
|
1121
1121
|
},
|
|
1122
1122
|
children: [/* @__PURE__ */ W("div", {
|
|
1123
1123
|
style: {
|
|
@@ -1126,8 +1126,8 @@ function he({ values: e, entity: n, columns: r, editableColumns: a, errors: o, s
|
|
|
1126
1126
|
flexDirection: "column",
|
|
1127
1127
|
gap: 12
|
|
1128
1128
|
},
|
|
1129
|
-
children:
|
|
1130
|
-
let
|
|
1129
|
+
children: i.map((n) => {
|
|
1130
|
+
let r = t.fields.get(n), i = o.has(n), a = y.has(n), s = r ? f(h, r, n) : n, c = `${g}-${n}`, u = `${c}-label`, d = {
|
|
1131
1131
|
fontSize: 11.5,
|
|
1132
1132
|
fontWeight: 600,
|
|
1133
1133
|
color: "var(--text-3)"
|
|
@@ -1139,38 +1139,38 @@ function he({ values: e, entity: n, columns: r, editableColumns: a, errors: o, s
|
|
|
1139
1139
|
gap: 5,
|
|
1140
1140
|
minWidth: 0
|
|
1141
1141
|
},
|
|
1142
|
-
children: [
|
|
1143
|
-
id:
|
|
1144
|
-
htmlFor:
|
|
1145
|
-
style:
|
|
1146
|
-
children:
|
|
1142
|
+
children: [i && r ? /* @__PURE__ */ W("label", {
|
|
1143
|
+
id: u,
|
|
1144
|
+
htmlFor: c,
|
|
1145
|
+
style: d,
|
|
1146
|
+
children: s
|
|
1147
1147
|
}) : /* @__PURE__ */ W("div", {
|
|
1148
|
-
id:
|
|
1149
|
-
style:
|
|
1150
|
-
children:
|
|
1148
|
+
id: u,
|
|
1149
|
+
style: d,
|
|
1150
|
+
children: s
|
|
1151
1151
|
}), /* @__PURE__ */ W("div", {
|
|
1152
1152
|
style: {
|
|
1153
1153
|
minWidth: 0,
|
|
1154
|
-
outline:
|
|
1154
|
+
outline: a ? "1px solid var(--danger)" : "none",
|
|
1155
1155
|
outlineOffset: 3,
|
|
1156
|
-
borderRadius:
|
|
1156
|
+
borderRadius: a ? "var(--radius-sm)" : 0
|
|
1157
1157
|
},
|
|
1158
|
-
title:
|
|
1159
|
-
children:
|
|
1160
|
-
field:
|
|
1161
|
-
fieldName:
|
|
1162
|
-
value: e[
|
|
1158
|
+
title: a ? h("record.row.field_required", "{field} is required", { field: n }) : void 0,
|
|
1159
|
+
children: i ? r ? _({
|
|
1160
|
+
field: r,
|
|
1161
|
+
fieldName: n,
|
|
1162
|
+
value: e[n],
|
|
1163
1163
|
mode: "edit",
|
|
1164
|
-
onChange: (e) =>
|
|
1164
|
+
onChange: (e) => l(n, e),
|
|
1165
1165
|
record: e,
|
|
1166
|
-
refs:
|
|
1166
|
+
refs: p,
|
|
1167
1167
|
compact: !0,
|
|
1168
|
-
fieldId:
|
|
1169
|
-
labelId:
|
|
1170
|
-
t:
|
|
1171
|
-
}) :
|
|
1168
|
+
fieldId: c,
|
|
1169
|
+
labelId: u,
|
|
1170
|
+
t: h
|
|
1171
|
+
}) : F(e[n]) : r?.auto ? "—" : F(e[n])
|
|
1172
1172
|
})]
|
|
1173
|
-
},
|
|
1173
|
+
}, n);
|
|
1174
1174
|
})
|
|
1175
1175
|
}), /* @__PURE__ */ G("div", {
|
|
1176
1176
|
style: {
|
|
@@ -1183,25 +1183,25 @@ function he({ values: e, entity: n, columns: r, editableColumns: a, errors: o, s
|
|
|
1183
1183
|
gap: 6
|
|
1184
1184
|
},
|
|
1185
1185
|
children: [
|
|
1186
|
-
|
|
1186
|
+
v && /* @__PURE__ */ W("span", {
|
|
1187
1187
|
style: {
|
|
1188
1188
|
fontSize: 11,
|
|
1189
1189
|
color: "var(--danger)"
|
|
1190
1190
|
},
|
|
1191
|
-
title:
|
|
1191
|
+
title: v.slice(7),
|
|
1192
1192
|
children: "!"
|
|
1193
1193
|
}),
|
|
1194
|
-
/* @__PURE__ */ W(
|
|
1194
|
+
/* @__PURE__ */ W(r, {
|
|
1195
1195
|
size: 32,
|
|
1196
|
-
icon: W(
|
|
1197
|
-
onClick:
|
|
1198
|
-
title:
|
|
1196
|
+
icon: W(c ? a : n.check, { size: 14 }),
|
|
1197
|
+
onClick: u,
|
|
1198
|
+
title: h("record.row.confirm", "Confirm (Enter)")
|
|
1199
1199
|
}),
|
|
1200
|
-
/* @__PURE__ */ W(
|
|
1200
|
+
/* @__PURE__ */ W(r, {
|
|
1201
1201
|
size: 32,
|
|
1202
|
-
icon: /* @__PURE__ */ W(
|
|
1203
|
-
onClick:
|
|
1204
|
-
title:
|
|
1202
|
+
icon: /* @__PURE__ */ W(n.x, { size: 14 }),
|
|
1203
|
+
onClick: d,
|
|
1204
|
+
title: h("record.row.cancel", "Cancel (Esc)")
|
|
1205
1205
|
})
|
|
1206
1206
|
]
|
|
1207
1207
|
})]
|
|
@@ -1245,5 +1245,4 @@ function _e({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey
|
|
|
1245
1245
|
accent: !0
|
|
1246
1246
|
});
|
|
1247
1247
|
}
|
|
1248
|
-
//#endregion
|
|
1249
1248
|
export { J as AssociatedBlock, ue as associatedDraftEditableColumns, le as associatedEditableColumns, q as associatedParentValue, de as findMissingRequiredAssociatedFields, ce as resolveAssociatedForeignKey, se as resolveAssociatedRowActions, K as resolveAssociatedToolbarActions };
|