@declarion/react 0.61.1 → 0.63.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/ActionDialog-uiuse5W8.js +374 -0
- package/dist-lib/ActionResultDialog.impl-BUBm9Ck3.js +273 -0
- package/dist-lib/ActionRunner-DAxgnKB3.js +1440 -0
- package/dist-lib/AdminCatalogPage.impl-BJGn7EvA.js +441 -0
- package/dist-lib/{AgentChatPanel.impl-rgkewyMl.js → AgentChatPanel.impl-8bw8J-xV.js} +358 -319
- package/dist-lib/AgentOpenFollower.impl-Cga1q7_e.js +81 -0
- package/dist-lib/AssociatedBlock-D6qDYmRO.js +1515 -0
- package/dist-lib/AuthShell-DdiughRT.js +361 -0
- package/dist-lib/ChangePasswordDialog-DFe7lVQg.js +12 -0
- package/dist-lib/ChangePasswordDialog.impl-DtSIaP-A.js +194 -0
- package/dist-lib/CommandPalette.impl-Db3AFA5w.js +383 -0
- package/dist-lib/CopyButton-C0iEvaT1.js +119 -0
- package/dist-lib/DirtyTabsCloseDialog.impl-DWaFaWKn.js +191 -0
- package/dist-lib/{DraggableChildrenTable-DruYOxKm.js → DraggableChildrenTable-Cy8uevS_.js} +45 -44
- package/dist-lib/DynamicIcon-DuBSz6TZ.js +133 -0
- package/dist-lib/FieldRow-BXBBFOZh.js +157 -0
- package/dist-lib/FilterChips-8fMDBXHp.js +1031 -0
- package/dist-lib/Forgot.impl-CmT5A__V.js +105 -0
- package/dist-lib/{Grid-Dsf3I0xG.js → Grid-Cg29k0jv.js} +98 -99
- package/dist-lib/Icons-Dzl-AkD_.d.ts +159 -0
- package/dist-lib/Icons-lt-7lhYR.js +151 -0
- package/dist-lib/ImpersonationBanner.impl-CBJJx6an.js +76 -0
- package/dist-lib/ImpersonationStartModal.impl-RaZcsJpG.js +158 -0
- package/dist-lib/Kbd-CNttVu0z.js +23 -0
- package/dist-lib/{LayoutRenderer-QN7Wp2W6.js → LayoutRenderer-DEHtYtzV.js} +965 -942
- package/dist-lib/{ListCardsBody-CNaZ0xwz.js → ListCardsBody-BAwFR3yO.js} +46 -52
- package/dist-lib/{MarkdownRenderer-BuO5hYJh.js → MarkdownRenderer-kNEMr6K_.js} +15 -16
- package/dist-lib/MenuItem-CfkVXPvC.js +140 -0
- package/dist-lib/NotFoundPage.impl-ZSBn4WWb.js +68 -0
- package/dist-lib/PageHeader-tw4pX3lI.js +71 -0
- package/dist-lib/PageShell-tI-mm0C5.js +47 -0
- package/dist-lib/Pill-D-wsfRhx.js +42 -0
- package/dist-lib/Preferences.impl-BG9XBZDf.js +162 -0
- package/dist-lib/Profile.impl-CbzSzxyG.js +527 -0
- package/dist-lib/PropertyGridEditor-BTjscqfz.js +4378 -0
- package/dist-lib/RecordHeader-Bv9nJXnG.js +217 -0
- package/dist-lib/RecordIdBadge-C3MgoZvt.js +25 -0
- package/dist-lib/RefreshControl-Ce-T_wSQ.js +195 -0
- package/dist-lib/Reset.impl-Cesyqt5p.js +168 -0
- package/dist-lib/SSOCallbackPage.impl-BC_W9nQA.js +31 -0
- package/dist-lib/SectionCard-VonaiLrx.js +150 -0
- package/dist-lib/SignUp.impl-C1KCQbfZ.js +212 -0
- package/dist-lib/SmartDetailPage.impl-8iOAMYQh.js +1609 -0
- package/dist-lib/SmartListPage.impl-Cc4Zwz5f.js +2818 -0
- package/dist-lib/SmartRecordListPage.impl-xTSohkqG.js +795 -0
- package/dist-lib/{SortHeaderMenu-BV-aQbPy.js → SortHeaderMenu-BKTrq0Wb.js} +23 -23
- package/dist-lib/TenantParamsPage.impl-DMuSs3eP.js +306 -0
- package/dist-lib/TwoFA.impl-BClZ3ndk.js +125 -0
- package/dist-lib/{cardProjection-BnmWukxk.js → cardProjection-Cr7fG6wJ.js} +134 -133
- package/dist-lib/declarion-react.css +1 -1
- package/dist-lib/format-count-CSEFw2ht.js +943 -0
- package/dist-lib/headerActionZone-bef-tZZ7.js +14 -0
- package/dist-lib/{stores/icon-registry.d.ts → icon-registry-CUT4eF63.d.ts} +14 -11
- package/dist-lib/icons.d.ts +20 -4
- package/dist-lib/icons.js +3 -2
- package/dist-lib/index.d.ts +2516 -150
- package/dist-lib/index.js +1588 -5117
- package/dist-lib/page-inset-D_kkVwwN.js +9 -0
- package/dist-lib/page-state-eA6J_KIR.js +124 -0
- package/dist-lib/param-editors-9yJr7xmN.js +201 -0
- package/dist-lib/payload-B2wODLAX.js +86 -0
- package/dist-lib/{peekDraftStore-Dk1Ha5u3.js → peekDraftStore-D4GRsRKW.js} +44 -43
- package/dist-lib/registry-BpzE8-h8.js +119 -0
- package/dist-lib/screen-back-Cs4kzeqD.js +44 -0
- package/dist-lib/testing.d.ts +53 -56
- package/dist-lib/testing.js +54 -55
- package/dist-lib/use-filter-value-labels-DuqvAIVG.js +413 -0
- package/dist-lib/{useAgentConversation-nT5UypJX.js → useAgentConversation-D210VDCQ.js} +158 -169
- package/dist-lib/useAuth-CR2YKKXb.js +49 -0
- package/dist-lib/useBranding-Ckp_AuJb.js +41 -0
- package/dist-lib/useBrandingChrome-bKTXXDLy.js +170 -0
- package/dist-lib/useCurrentLocation-BdngVeQv.js +22 -0
- package/dist-lib/useCurrentScreen--UovgvRj.js +2511 -0
- package/dist-lib/useImpersonation-DNV23Ks1.js +35 -0
- package/dist-lib/useObject-1OCeV34A.js +26 -0
- package/dist-lib/useOwnRefresh-DkOuM4yo.js +435 -0
- package/dist-lib/useParams-ei6w4I7w.js +133 -0
- package/dist-lib/useProperties-CbdhlhZd.js +81 -0
- package/dist-lib/useResponsiveMode-DIR1bZfo.d.ts +1786 -0
- package/dist-lib/useScreenBack-J861tbwn.js +71 -0
- package/dist-lib/useTabNavigate-BZiW4q3M.js +78 -0
- package/dist-lib/useTabTitle-CZZnWIQi.js +22 -0
- package/dist-lib/utils-D_QDpB8_.js +11 -0
- package/dist-lib/{value-Dwfyghtj.js → value-CDCeHgOv.js} +8 -22
- package/dist-lib/{action-dispatch-gWmOYjOP.js → variants-CbAwl3Mn.js} +734 -740
- package/dist-lib/vite/index.d.ts +42 -16
- package/dist-lib/window-election-CHIvIZwx.js +45 -0
- package/package.json +16 -23
- package/dist-lib/DetailAuditStrip-CSXZoy7v.js +0 -288
- package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
- package/dist-lib/RefreshControl-DO9rYcdq.js +0 -399
- package/dist-lib/SmartDetailPage.impl-DFIIx80b.js +0 -1565
- package/dist-lib/SmartListPage.impl-D694R32H.js +0 -3051
- package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.js +0 -780
- package/dist-lib/api/agents.d.ts +0 -140
- package/dist-lib/api/auth-redirect.d.ts +0 -3
- package/dist-lib/api/auth.d.ts +0 -26
- package/dist-lib/api/batch.d.ts +0 -25
- package/dist-lib/api/client.d.ts +0 -51
- package/dist-lib/api/data.d.ts +0 -153
- package/dist-lib/api/entities.d.ts +0 -149
- package/dist-lib/api/events.d.ts +0 -91
- package/dist-lib/api/params.d.ts +0 -28
- package/dist-lib/api/properties.d.ts +0 -3
- package/dist-lib/api/schema.d.ts +0 -2
- package/dist-lib/api/status.d.ts +0 -2
- package/dist-lib/app.d.ts +0 -1
- package/dist-lib/components/actions/ActionButton.d.ts +0 -18
- package/dist-lib/components/actions/ActionDialog.d.ts +0 -20
- package/dist-lib/components/actions/ActionResultDialog.d.ts +0 -22
- package/dist-lib/components/actions/ActionRunner.d.ts +0 -62
- package/dist-lib/components/actions/ObjectActionBar.d.ts +0 -29
- package/dist-lib/components/actions/PropertyGridEditor.d.ts +0 -20
- package/dist-lib/components/actions/ResponsiveActionBar.d.ts +0 -259
- package/dist-lib/components/actions/RowActionsKebab.d.ts +0 -20
- package/dist-lib/components/agents/AgentChatPanel.d.ts +0 -3
- package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +0 -14
- package/dist-lib/components/agents/AgentConversationDrawer.d.ts +0 -11
- package/dist-lib/components/agents/AgentElicitForm.d.ts +0 -27
- package/dist-lib/components/agents/AgentPicker.d.ts +0 -8
- package/dist-lib/components/agents/transcript-runs.d.ts +0 -29
- package/dist-lib/components/chrome/AssociationTabs.d.ts +0 -9
- package/dist-lib/components/chrome/AuditMetaStrip.d.ts +0 -11
- package/dist-lib/components/chrome/Breadcrumbs.d.ts +0 -14
- package/dist-lib/components/chrome/HighlightsStrip.d.ts +0 -10
- package/dist-lib/components/chrome/PageHeader.d.ts +0 -16
- package/dist-lib/components/chrome/PageShell.d.ts +0 -7
- package/dist-lib/components/chrome/RecordHeader.d.ts +0 -17
- package/dist-lib/components/chrome/headerActionZone.d.ts +0 -27
- package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +0 -20
- package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +0 -13
- package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +0 -16
- package/dist-lib/components/detail-layout/ChildrenCards.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenList.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenTable.d.ts +0 -2
- package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +0 -2
- package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +0 -12
- package/dist-lib/components/detail-layout/DetailHighlights.d.ts +0 -14
- package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +0 -16
- package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +0 -16
- package/dist-lib/components/detail-layout/ErrorSummary.d.ts +0 -11
- package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +0 -6
- package/dist-lib/components/detail-layout/FieldRow.d.ts +0 -23
- package/dist-lib/components/detail-layout/FieldsBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/LayoutColumn.d.ts +0 -9
- package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +0 -46
- package/dist-lib/components/detail-layout/LayoutRow.d.ts +0 -8
- package/dist-lib/components/detail-layout/LayoutTabs.d.ts +0 -8
- package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/QuickAddForm.d.ts +0 -10
- package/dist-lib/components/detail-layout/SectionBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/StatusesBlock.d.ts +0 -8
- package/dist-lib/components/detail-layout/TimelineComposer.d.ts +0 -10
- package/dist-lib/components/detail-layout/blockMeta.d.ts +0 -5
- package/dist-lib/components/detail-layout/index.d.ts +0 -21
- package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +0 -25
- package/dist-lib/components/detail-layout/useQuickAdd.d.ts +0 -16
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.d.ts +0 -2
- package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.d.ts +0 -2
- package/dist-lib/components/detail-layout/widgets/MonacoJson.d.ts +0 -9
- package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +0 -9
- package/dist-lib/components/detail-layout/widgets/builtins.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/canonicalizeJson.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/monacoBootstrap.d.ts +0 -1
- package/dist-lib/components/detail-layout/widgets/registry.d.ts +0 -14
- package/dist-lib/components/fields/BoolField.d.ts +0 -2
- package/dist-lib/components/fields/EmailField.d.ts +0 -2
- package/dist-lib/components/fields/EnumField.d.ts +0 -2
- package/dist-lib/components/fields/IntArrayField.d.ts +0 -2
- package/dist-lib/components/fields/JsonEditor.d.ts +0 -10
- package/dist-lib/components/fields/JsonField.d.ts +0 -3
- package/dist-lib/components/fields/MultilangArrayField.d.ts +0 -2
- package/dist-lib/components/fields/MultilangField.d.ts +0 -2
- package/dist-lib/components/fields/MultilangTextField.d.ts +0 -2
- package/dist-lib/components/fields/NumberField.d.ts +0 -2
- package/dist-lib/components/fields/PasswordField.d.ts +0 -2
- package/dist-lib/components/fields/PhoneField.d.ts +0 -2
- package/dist-lib/components/fields/RefCombobox.d.ts +0 -45
- package/dist-lib/components/fields/RefField.d.ts +0 -2
- package/dist-lib/components/fields/RichTextField.d.ts +0 -2
- package/dist-lib/components/fields/SecretField.d.ts +0 -2
- package/dist-lib/components/fields/StringArrayField.d.ts +0 -2
- package/dist-lib/components/fields/StringField.d.ts +0 -2
- package/dist-lib/components/fields/StructureField.d.ts +0 -2
- package/dist-lib/components/fields/TextField.d.ts +0 -2
- package/dist-lib/components/fields/TimestampField.d.ts +0 -2
- package/dist-lib/components/fields/UrlField.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/badge.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/boolPill.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/code.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/date.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/email.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/host-icons.d.ts +0 -17
- package/dist-lib/components/fields/cells/factories/json.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/link.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/markdown.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/markdownPreview.d.ts +0 -9
- package/dist-lib/components/fields/cells/factories/money.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/multilangInline.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/nextRun.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/number.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/passwordMask.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/phone.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/refLink.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/richTextPreview.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/statusPill.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/tagList.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/text.d.ts +0 -2
- package/dist-lib/components/fields/cells/factories/timestamp.d.ts +0 -3
- package/dist-lib/components/fields/cells/factories/url-helpers.d.ts +0 -12
- package/dist-lib/components/fields/cells/factories/url.d.ts +0 -2
- package/dist-lib/components/fields/cells/registry.d.ts +0 -21
- package/dist-lib/components/fields/index.d.ts +0 -28
- package/dist-lib/components/fields/langMap.d.ts +0 -2
- package/dist-lib/components/fields/secretValue.d.ts +0 -2
- package/dist-lib/components/file-widgets/CircleImage.d.ts +0 -2
- package/dist-lib/components/file-widgets/DocumentCard.d.ts +0 -2
- package/dist-lib/components/file-widgets/FileList.d.ts +0 -2
- package/dist-lib/components/file-widgets/Grid.d.ts +0 -2
- package/dist-lib/components/file-widgets/GridLazy.d.ts +0 -2
- package/dist-lib/components/file-widgets/ImageWidget.d.ts +0 -12
- package/dist-lib/components/file-widgets/LabeledSlots.d.ts +0 -2
- package/dist-lib/components/file-widgets/SquareImage.d.ts +0 -2
- package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +0 -3
- package/dist-lib/components/file-widgets/UploadFailureText.d.ts +0 -4
- package/dist-lib/components/file-widgets/WideBanner.d.ts +0 -2
- package/dist-lib/components/file-widgets/builtins.d.ts +0 -1
- package/dist-lib/components/file-widgets/cropper.d.ts +0 -14
- package/dist-lib/components/file-widgets/draft-scope.d.ts +0 -22
- package/dist-lib/components/file-widgets/helpers.d.ts +0 -15
- package/dist-lib/components/file-widgets/host.d.ts +0 -28
- package/dist-lib/components/file-widgets/index.d.ts +0 -16
- package/dist-lib/components/file-widgets/payload.d.ts +0 -21
- package/dist-lib/components/file-widgets/registry.d.ts +0 -5
- package/dist-lib/components/file-widgets/types.d.ts +0 -17
- package/dist-lib/components/file-widgets/upload.d.ts +0 -45
- package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +0 -42
- package/dist-lib/components/file-widgets/value.d.ts +0 -4
- package/dist-lib/components/filters/FilterChips.d.ts +0 -14
- package/dist-lib/components/filters/FilterDrawer.d.ts +0 -32
- package/dist-lib/components/filters/filter-op-label.d.ts +0 -3
- package/dist-lib/components/layout/CommandPalette.d.ts +0 -21
- package/dist-lib/components/layout/DirtyTabsCloseDialog.d.ts +0 -9
- package/dist-lib/components/layout/ImpersonationBanner.d.ts +0 -11
- package/dist-lib/components/layout/ImpersonationFrame.d.ts +0 -11
- package/dist-lib/components/layout/ImpersonationStartModal.d.ts +0 -22
- package/dist-lib/components/layout/Layout.d.ts +0 -6
- package/dist-lib/components/layout/Rail.d.ts +0 -22
- package/dist-lib/components/layout/Sidebar.d.ts +0 -12
- package/dist-lib/components/layout/TabStrip.d.ts +0 -6
- package/dist-lib/components/layout/TenantChip.d.ts +0 -26
- package/dist-lib/components/layout/TopBar.d.ts +0 -22
- package/dist-lib/components/layout/tab-close.d.ts +0 -13
- package/dist-lib/components/list/ColumnPicker.d.ts +0 -20
- package/dist-lib/components/list/InlineEditCell.d.ts +0 -15
- package/dist-lib/components/list/PeekFieldCell.d.ts +0 -16
- package/dist-lib/components/list/QuickPeek.d.ts +0 -59
- package/dist-lib/components/list/ViewSwitcher.d.ts +0 -24
- package/dist-lib/components/list/peekDraftStore.d.ts +0 -6
- package/dist-lib/components/pages/AdminCatalogPage.d.ts +0 -1
- package/dist-lib/components/pages/DocumentsMenu.d.ts +0 -21
- package/dist-lib/components/pages/ExportMenu.d.ts +0 -30
- package/dist-lib/components/pages/NotFoundPage.d.ts +0 -1
- package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +0 -41
- package/dist-lib/components/pages/SSOCallbackPage.d.ts +0 -1
- package/dist-lib/components/pages/SmartDetailPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/SmartListPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartListPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/SmartRecordListPage.d.ts +0 -2
- package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +0 -4
- package/dist-lib/components/pages/auth/AuthShell.d.ts +0 -18
- package/dist-lib/components/pages/auth/Forgot.d.ts +0 -1
- package/dist-lib/components/pages/auth/Reset.d.ts +0 -1
- package/dist-lib/components/pages/auth/SignIn.d.ts +0 -1
- package/dist-lib/components/pages/auth/SignUp.d.ts +0 -1
- package/dist-lib/components/pages/auth/TwoFA.d.ts +0 -1
- package/dist-lib/components/pages/auth/icons.d.ts +0 -6
- package/dist-lib/components/pages/exportRequest.d.ts +0 -69
- package/dist-lib/components/pages/list/DataCell.d.ts +0 -4
- package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +0 -8
- package/dist-lib/components/pages/list/ListCardRow.d.ts +0 -39
- package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -33
- package/dist-lib/components/pages/list/ListFloatbar.d.ts +0 -29
- package/dist-lib/components/pages/list/ListFooter.d.ts +0 -26
- package/dist-lib/components/pages/list/ListHeader.d.ts +0 -26
- package/dist-lib/components/pages/list/ListNoRows.d.ts +0 -31
- package/dist-lib/components/pages/list/ListTable.d.ts +0 -33
- package/dist-lib/components/pages/list/ListTableRow.d.ts +0 -17
- package/dist-lib/components/pages/list/ListToolbar.d.ts +0 -46
- package/dist-lib/components/pages/list/ListUrlBanner.d.ts +0 -10
- package/dist-lib/components/pages/list/RowActionsCell.d.ts +0 -34
- package/dist-lib/components/pages/list/RowContextMenu.d.ts +0 -28
- package/dist-lib/components/pages/list/SaveViewDialog.d.ts +0 -10
- package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +0 -14
- package/dist-lib/components/pages/list/cardProjection.d.ts +0 -67
- package/dist-lib/components/pages/list/column-sizing.d.ts +0 -14
- package/dist-lib/components/pages/list/columns.d.ts +0 -46
- package/dist-lib/components/pages/list/filter-meta.d.ts +0 -25
- package/dist-lib/components/pages/list/page-size.d.ts +0 -3
- package/dist-lib/components/pages/list/sortable-header.d.ts +0 -2
- package/dist-lib/components/pages/list/table-features.d.ts +0 -14
- package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +0 -24
- package/dist-lib/components/pages/list/useActiveView.d.ts +0 -45
- package/dist-lib/components/pages/list/useHeaderReorder.d.ts +0 -26
- package/dist-lib/components/pages/list/useListColumnLayout.d.ts +0 -38
- package/dist-lib/components/pages/list/useListQuery.d.ts +0 -67
- package/dist-lib/components/pages/list/useListRowInteraction.d.ts +0 -61
- package/dist-lib/components/pages/list/useListSelection.d.ts +0 -31
- package/dist-lib/components/pages/list/useListSort.d.ts +0 -46
- package/dist-lib/components/pages/list/useListViews.d.ts +0 -57
- package/dist-lib/components/pages/list/useRowMenu.d.ts +0 -46
- package/dist-lib/components/pages/profile/Preferences.d.ts +0 -1
- package/dist-lib/components/pages/profile/Profile.d.ts +0 -7
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +0 -2
- package/dist-lib/components/params/ParamsBlock.d.ts +0 -13
- package/dist-lib/components/params/param-editors.d.ts +0 -20
- package/dist-lib/components/primitives/Avatar.d.ts +0 -6
- package/dist-lib/components/primitives/BoolToggle.d.ts +0 -7
- package/dist-lib/components/primitives/BrandGlyph.d.ts +0 -8
- package/dist-lib/components/primitives/BrandLogo.d.ts +0 -12
- package/dist-lib/components/primitives/Btn.d.ts +0 -19
- package/dist-lib/components/primitives/Check.d.ts +0 -7
- package/dist-lib/components/primitives/Chip.d.ts +0 -9
- package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +0 -9
- package/dist-lib/components/primitives/Dropdown.d.ts +0 -20
- package/dist-lib/components/primitives/Fields.d.ts +0 -111
- package/dist-lib/components/primitives/HoverCard.d.ts +0 -15
- package/dist-lib/components/primitives/IconBtn.d.ts +0 -11
- package/dist-lib/components/primitives/Icons.d.ts +0 -136
- package/dist-lib/components/primitives/Kbd.d.ts +0 -4
- package/dist-lib/components/primitives/MenuItem.d.ts +0 -14
- package/dist-lib/components/primitives/Pill.d.ts +0 -11
- package/dist-lib/components/primitives/RecordIdBadge.d.ts +0 -8
- package/dist-lib/components/primitives/RowField.d.ts +0 -10
- package/dist-lib/components/primitives/SectionCard.d.ts +0 -24
- package/dist-lib/components/primitives/Spinner.d.ts +0 -3
- package/dist-lib/components/primitives/Tooltip.d.ts +0 -34
- package/dist-lib/components/primitives/dataTableStyles.d.ts +0 -4
- package/dist-lib/components/primitives/index.d.ts +0 -37
- package/dist-lib/components/shared/ChangePasswordDialog.d.ts +0 -9
- package/dist-lib/components/shared/ConfirmDialog.d.ts +0 -11
- package/dist-lib/components/shared/CopyButton.d.ts +0 -8
- package/dist-lib/components/shared/DynamicIcon.d.ts +0 -20
- package/dist-lib/components/shared/EmptyState.d.ts +0 -9
- package/dist-lib/components/shared/ErrorBoundary.d.ts +0 -17
- package/dist-lib/components/shared/LoadingSkeleton.d.ts +0 -6
- package/dist-lib/components/shared/LucideIcon.d.ts +0 -16
- package/dist-lib/components/shared/Markdown.d.ts +0 -3
- package/dist-lib/components/shared/MarkdownRenderer.d.ts +0 -11
- package/dist-lib/components/shared/RefreshControl.d.ts +0 -25
- package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +0 -11
- package/dist-lib/components/shared/StatusStepper.d.ts +0 -13
- package/dist-lib/components/shared/toast/DeclarionToast.d.ts +0 -31
- package/dist-lib/components/shared/useOwnRefresh.d.ts +0 -9
- package/dist-lib/embed/EmbedAuthBootstrap.d.ts +0 -8
- package/dist-lib/embed/EmbedContext.d.ts +0 -50
- package/dist-lib/embed/EmbedDirtyReporter.d.ts +0 -10
- package/dist-lib/embed/EmbedHistoryTracker.d.ts +0 -1
- package/dist-lib/embed/EmbedLocationReporter.d.ts +0 -8
- package/dist-lib/embed/EmbedResizeReporter.d.ts +0 -6
- package/dist-lib/embed/EmbedUnsavedGuard.d.ts +0 -7
- package/dist-lib/embed/embed-dirty.d.ts +0 -24
- package/dist-lib/embed/embed-history.d.ts +0 -19
- package/dist-lib/embed/embed-nav-guard.d.ts +0 -20
- package/dist-lib/embed/file-src.d.ts +0 -63
- package/dist-lib/embed/handshake.d.ts +0 -57
- package/dist-lib/embed/index.d.ts +0 -19
- package/dist-lib/embed/params.d.ts +0 -75
- package/dist-lib/embed/protocol.d.ts +0 -165
- package/dist-lib/embed/screen-location.d.ts +0 -50
- package/dist-lib/embed/theme.d.ts +0 -34
- package/dist-lib/embed/token.d.ts +0 -57
- package/dist-lib/embed/useEmbedNavigate.d.ts +0 -48
- package/dist-lib/embed/useGlobalLinkInterceptor.d.ts +0 -66
- package/dist-lib/failure-BUxXuP4c.js +0 -158
- package/dist-lib/format-count-bXVfHzbI.js +0 -1771
- package/dist-lib/hooks/useActionData.d.ts +0 -61
- package/dist-lib/hooks/useAgentConversation.d.ts +0 -24
- package/dist-lib/hooks/useAllEntityData.d.ts +0 -16
- package/dist-lib/hooks/useAssociatedData.d.ts +0 -10
- package/dist-lib/hooks/useAuth.d.ts +0 -22
- package/dist-lib/hooks/useBranding.d.ts +0 -8
- package/dist-lib/hooks/useBrandingChrome.d.ts +0 -59
- package/dist-lib/hooks/useChildrenData.d.ts +0 -3
- package/dist-lib/hooks/useColumns.d.ts +0 -13
- package/dist-lib/hooks/useCurrentScreen.d.ts +0 -34
- package/dist-lib/hooks/useCursorEntityData.d.ts +0 -79
- package/dist-lib/hooks/useDebounce.d.ts +0 -1
- package/dist-lib/hooks/useEntity.d.ts +0 -2
- package/dist-lib/hooks/useEntityData.d.ts +0 -41
- package/dist-lib/hooks/useFilters.d.ts +0 -14
- package/dist-lib/hooks/useImpersonation.d.ts +0 -23
- package/dist-lib/hooks/useLanguage.d.ts +0 -4
- package/dist-lib/hooks/useLiveObject.d.ts +0 -9
- package/dist-lib/hooks/useLongPress.d.ts +0 -29
- package/dist-lib/hooks/useMutations.d.ts +0 -13
- package/dist-lib/hooks/useObject.d.ts +0 -11
- package/dist-lib/hooks/useObjectStatus.d.ts +0 -5
- package/dist-lib/hooks/usePageState.d.ts +0 -32
- package/dist-lib/hooks/usePageStateRuntime.d.ts +0 -27
- package/dist-lib/hooks/usePageStateTtl.d.ts +0 -11
- package/dist-lib/hooks/useParams.d.ts +0 -49
- package/dist-lib/hooks/useProperties.d.ts +0 -5
- package/dist-lib/hooks/useRealtimeThresholds.d.ts +0 -1
- package/dist-lib/hooks/useRegisterScreenTab.d.ts +0 -11
- package/dist-lib/hooks/useResponsiveMode.d.ts +0 -27
- package/dist-lib/hooks/useSSE.d.ts +0 -31
- package/dist-lib/hooks/useSchema.d.ts +0 -1
- package/dist-lib/hooks/useScreen.d.ts +0 -2
- package/dist-lib/hooks/useScreenBack.d.ts +0 -21
- package/dist-lib/hooks/useScreenTab.d.ts +0 -10
- package/dist-lib/hooks/useTabNavigate.d.ts +0 -34
- package/dist-lib/hooks/useTabSearchMirror.d.ts +0 -1
- package/dist-lib/hooks/useTabTitle.d.ts +0 -2
- package/dist-lib/hooks/useText.d.ts +0 -3
- package/dist-lib/hooks/useTimelineData.d.ts +0 -10
- package/dist-lib/hooks/useVersionWatcher.d.ts +0 -30
- package/dist-lib/hooks/useViews.d.ts +0 -26
- package/dist-lib/lib/action-dispatch.d.ts +0 -8
- package/dist-lib/lib/actions.d.ts +0 -254
- package/dist-lib/lib/anchor.d.ts +0 -36
- package/dist-lib/lib/brand-tokens.d.ts +0 -43
- package/dist-lib/lib/branding.d.ts +0 -20
- package/dist-lib/lib/canonical-url.d.ts +0 -27
- package/dist-lib/lib/capabilityPrefetch.d.ts +0 -6
- package/dist-lib/lib/child-config.d.ts +0 -24
- package/dist-lib/lib/children-validation.d.ts +0 -5
- package/dist-lib/lib/decimal-text.d.ts +0 -1
- package/dist-lib/lib/display-value.d.ts +0 -1
- package/dist-lib/lib/document-templates.d.ts +0 -11
- package/dist-lib/lib/download.d.ts +0 -21
- package/dist-lib/lib/evidence-verdict.d.ts +0 -11
- package/dist-lib/lib/failure.d.ts +0 -2
- package/dist-lib/lib/field-classification.d.ts +0 -61
- package/dist-lib/lib/field-regions.d.ts +0 -8
- package/dist-lib/lib/filter-evaluator.d.ts +0 -16
- package/dist-lib/lib/filters.d.ts +0 -93
- package/dist-lib/lib/format-count.d.ts +0 -41
- package/dist-lib/lib/html-state.d.ts +0 -11
- package/dist-lib/lib/language.d.ts +0 -19
- package/dist-lib/lib/longPressGesture.d.ts +0 -55
- package/dist-lib/lib/mass-edit.d.ts +0 -32
- package/dist-lib/lib/page-inset.d.ts +0 -3
- package/dist-lib/lib/quick-add.d.ts +0 -2
- package/dist-lib/lib/realtime-query-keys.d.ts +0 -22
- package/dist-lib/lib/realtime-reconcile.d.ts +0 -33
- package/dist-lib/lib/realtime-resync.d.ts +0 -23
- package/dist-lib/lib/record-documents-key.d.ts +0 -1
- package/dist-lib/lib/rich-text.d.ts +0 -14
- package/dist-lib/lib/rowClickGesture.d.ts +0 -26
- package/dist-lib/lib/safe-url.d.ts +0 -15
- package/dist-lib/lib/schema-routing.d.ts +0 -3
- package/dist-lib/lib/screen-back.d.ts +0 -70
- package/dist-lib/lib/scroll-restoration.d.ts +0 -90
- package/dist-lib/lib/size-value.d.ts +0 -16
- package/dist-lib/lib/sort.d.ts +0 -72
- package/dist-lib/lib/timestamp.d.ts +0 -53
- package/dist-lib/lib/toast.d.ts +0 -49
- package/dist-lib/lib/ui-actions.d.ts +0 -12
- package/dist-lib/lib/utils.d.ts +0 -9
- package/dist-lib/lib/variants.d.ts +0 -7
- package/dist-lib/lib/versionTracker.d.ts +0 -72
- package/dist-lib/lib/viewport-category.d.ts +0 -44
- package/dist-lib/main.d.ts +0 -1
- package/dist-lib/registry-nSeHd5si.js +0 -1956
- package/dist-lib/safe-url-oSJw5pzO.js +0 -34
- package/dist-lib/stores/auth.d.ts +0 -16
- package/dist-lib/stores/list-layout.d.ts +0 -85
- package/dist-lib/stores/page-state.d.ts +0 -61
- package/dist-lib/stores/preferences.d.ts +0 -37
- package/dist-lib/stores/realtime.d.ts +0 -96
- package/dist-lib/stores/screen-registry.d.ts +0 -17
- package/dist-lib/stores/tabs.d.ts +0 -73
- package/dist-lib/types/api.d.ts +0 -579
- package/dist-lib/types/fieldType.d.ts +0 -2
- package/dist-lib/types/files.d.ts +0 -79
- package/dist-lib/types/ordmap.d.ts +0 -39
- package/dist-lib/types/schema.d.ts +0 -1089
- package/dist-lib/useCurrentScreen-0WBj7wT6.js +0 -7860
- package/dist-lib/useListQuery-C7dq_sEo.js +0 -103
- package/dist-lib/useOwnRefresh-q80kCMMh.js +0 -1167
- package/dist-lib/useProperties-CeGKtq7Q.js +0 -83
- package/dist-lib/useTabSearchMirror-CzNAj82Q.js +0 -175
- package/dist-lib/useText-BsedsJ-J.js +0 -952
- package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
|
@@ -1,21 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { Cn as e, Dn as t, Pt as n, Q as r, Qt as i, U as a, an as o, c as s, cn as c, ct as l, dn as u, fn as d, gn as f, hn as p, in as m, l as h, o as g, on as _, ot as v, st as y, wn as b, wt as x, xt as S, yt as C } from "./useCurrentScreen--UovgvRj.js";
|
|
2
|
+
import { t as w } from "./Icons-lt-7lhYR.js";
|
|
3
|
+
import { n as T, r as E } from "./CopyButton-C0iEvaT1.js";
|
|
4
|
+
import { t as D } from "./Pill-D-wsfRhx.js";
|
|
5
|
+
import { Q as O, f as k, p as A, q as j, tt as M, u as N } from "./PropertyGridEditor-BTjscqfz.js";
|
|
6
|
+
import { t as P } from "./SectionCard-VonaiLrx.js";
|
|
7
|
+
import { a as F, i as I, r as L, t as ee } from "./registry-BpzE8-h8.js";
|
|
8
|
+
import { t as R } from "./DynamicIcon-DuBSz6TZ.js";
|
|
9
|
+
import { t as z } from "./utils-D_QDpB8_.js";
|
|
10
|
+
import { n as B } from "./useTabNavigate-BZiW4q3M.js";
|
|
11
|
+
import { E as V, T as te, v as H } from "./ActionRunner-DAxgnKB3.js";
|
|
12
|
+
import { g as ne, i as U, t as re, v as ie } from "./useOwnRefresh-DkOuM4yo.js";
|
|
13
|
+
import { h as ae, m as oe, p as se } from "./variants-CbAwl3Mn.js";
|
|
14
|
+
import { n as ce, r as le, t as ue } from "./dataTableStyles-vwD1mVOP.js";
|
|
15
|
+
import { n as de, t as fe } from "./AssociatedBlock-D6qDYmRO.js";
|
|
16
|
+
import { i as pe, n as me, r as he, t as ge } from "./FieldRow-BXBBFOZh.js";
|
|
17
|
+
import { Suspense as _e, lazy as ve, useCallback as W, useEffect as G, useId as ye, useLayoutEffect as be, useMemo as xe, useRef as K, useState as q } from "react";
|
|
18
|
+
import { useInfiniteQuery as Se, useMutation as Ce, useQueryClient as we } from "@tanstack/react-query";
|
|
11
19
|
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
12
20
|
//#region src/lib/size-value.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
21
|
+
var Te = /^(\d+)px$/;
|
|
22
|
+
function Ee(e) {
|
|
15
23
|
if (e == null || e === "") return null;
|
|
16
24
|
if (e === "auto") return { kind: "auto" };
|
|
17
25
|
if (e === "fill") return { kind: "fill" };
|
|
18
|
-
let t =
|
|
26
|
+
let t = Te.exec(e);
|
|
19
27
|
if (t) {
|
|
20
28
|
let e = parseInt(t[1], 10);
|
|
21
29
|
return e > 0 ? {
|
|
@@ -31,7 +39,7 @@ function we(e) {
|
|
|
31
39
|
}
|
|
32
40
|
//#endregion
|
|
33
41
|
//#region src/components/detail-layout/LayoutRow.tsx
|
|
34
|
-
function
|
|
42
|
+
function De({ config: e, ctx: t }) {
|
|
35
43
|
let { items: n, gap: r = 0, resizable: i = !1, stack_below: a } = e, o = a === "never" ? 0 : a ?? 768, [s, c] = q(!1), l = K(null);
|
|
36
44
|
G(() => {
|
|
37
45
|
if (o === 0) return;
|
|
@@ -43,7 +51,7 @@ function Te({ config: e, ctx: t }) {
|
|
|
43
51
|
return t.observe(e), () => t.disconnect();
|
|
44
52
|
}, [o]);
|
|
45
53
|
let [u, d] = q(null), f = K(null), p = W(() => n.map((t) => {
|
|
46
|
-
let n =
|
|
54
|
+
let n = Ee(t.width ?? t.column?.width ?? t.row?.width ?? e.width);
|
|
47
55
|
return n && n.kind === "weight" ? n.value : 1;
|
|
48
56
|
}), [n, e.width]), m = W((e, t) => {
|
|
49
57
|
t.preventDefault();
|
|
@@ -62,20 +70,20 @@ function Te({ config: e, ctx: t }) {
|
|
|
62
70
|
f.current = null, document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i);
|
|
63
71
|
};
|
|
64
72
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", i);
|
|
65
|
-
}, [u, p]), h = u ?? p(), g = e.height ?
|
|
73
|
+
}, [u, p]), h = u ?? p(), g = e.height ? ke(e.height) : void 0;
|
|
66
74
|
return /* @__PURE__ */ Y("div", {
|
|
67
75
|
ref: l,
|
|
68
|
-
className:
|
|
76
|
+
className: z("flex", s && "flex-col"),
|
|
69
77
|
style: {
|
|
70
78
|
gap: r ? `${r}px` : void 0,
|
|
71
79
|
...g
|
|
72
80
|
},
|
|
73
81
|
children: n.map((r, a) => /* @__PURE__ */ X("div", {
|
|
74
|
-
className:
|
|
75
|
-
style: s ? void 0 :
|
|
82
|
+
className: z("min-w-0 flex items-stretch", s && "w-full"),
|
|
83
|
+
style: s ? void 0 : Oe(r.width ?? r.column?.width ?? r.row?.width ?? e.width, h[a], r.min_width, r.max_width),
|
|
76
84
|
children: [/* @__PURE__ */ Y("div", {
|
|
77
|
-
className:
|
|
78
|
-
children: /* @__PURE__ */ Y(
|
|
85
|
+
className: z("flex-1 min-w-0 flex flex-col", g && "overflow-y-auto overflow-x-hidden"),
|
|
86
|
+
children: /* @__PURE__ */ Y(fn, {
|
|
79
87
|
node: r,
|
|
80
88
|
ctx: t
|
|
81
89
|
})
|
|
@@ -86,17 +94,17 @@ function Te({ config: e, ctx: t }) {
|
|
|
86
94
|
}, a))
|
|
87
95
|
});
|
|
88
96
|
}
|
|
89
|
-
function
|
|
90
|
-
let i =
|
|
97
|
+
function Oe(e, t, n, r) {
|
|
98
|
+
let i = Ee(e), a;
|
|
91
99
|
return a = !i || i.kind === "weight" ? `${t} 1 0%` : i.kind === "px" ? `0 0 ${i.value}px` : i.kind === "fill" ? "1 1 0%" : "0 0 auto", {
|
|
92
100
|
flex: a,
|
|
93
101
|
minWidth: n,
|
|
94
102
|
maxWidth: r
|
|
95
103
|
};
|
|
96
104
|
}
|
|
97
|
-
function
|
|
105
|
+
function ke(e) {
|
|
98
106
|
if (!e) return;
|
|
99
|
-
let t =
|
|
107
|
+
let t = Ee(e);
|
|
100
108
|
if (t?.kind === "px") return {
|
|
101
109
|
height: `${t.value}px`,
|
|
102
110
|
overflow: "hidden"
|
|
@@ -108,12 +116,12 @@ function De(e) {
|
|
|
108
116
|
}
|
|
109
117
|
//#endregion
|
|
110
118
|
//#region src/components/detail-layout/LayoutColumn.tsx
|
|
111
|
-
function
|
|
119
|
+
function Ae({ config: e, ctx: t }) {
|
|
112
120
|
let { items: n, gap: r = 12 } = e;
|
|
113
121
|
return /* @__PURE__ */ Y("div", {
|
|
114
122
|
className: "flex flex-col h-full",
|
|
115
123
|
style: { gap: r ? `${r}px` : void 0 },
|
|
116
|
-
children: n.map((e, n) => /* @__PURE__ */ Y(
|
|
124
|
+
children: n.map((e, n) => /* @__PURE__ */ Y(fn, {
|
|
117
125
|
node: e,
|
|
118
126
|
ctx: t
|
|
119
127
|
}, n))
|
|
@@ -121,11 +129,11 @@ function Oe({ config: e, ctx: t }) {
|
|
|
121
129
|
}
|
|
122
130
|
//#endregion
|
|
123
131
|
//#region src/components/detail-layout/blockMeta.ts
|
|
124
|
-
function
|
|
132
|
+
function je(e) {
|
|
125
133
|
return e.children ?? e.associated;
|
|
126
134
|
}
|
|
127
|
-
function
|
|
128
|
-
let r =
|
|
135
|
+
function Me(e, t, n) {
|
|
136
|
+
let r = je(e);
|
|
129
137
|
if (r) {
|
|
130
138
|
if (e.label) return n(e.label);
|
|
131
139
|
let i = t.entity.children?.find((e) => e.entity === r);
|
|
@@ -135,9 +143,9 @@ function Ae(e, t, n) {
|
|
|
135
143
|
}
|
|
136
144
|
return e.section ? n(e.section.name) : n("record.tabs.fallback", "Tab");
|
|
137
145
|
}
|
|
138
|
-
function
|
|
146
|
+
function Ne(e, t) {
|
|
139
147
|
if (e.icon) return e.icon;
|
|
140
|
-
let n =
|
|
148
|
+
let n = je(e);
|
|
141
149
|
if (n) {
|
|
142
150
|
let e = t.entity.children?.find((e) => e.entity === n);
|
|
143
151
|
if (e?.display?.icon) return e.display.icon;
|
|
@@ -147,11 +155,11 @@ function je(e, t) {
|
|
|
147
155
|
}
|
|
148
156
|
//#endregion
|
|
149
157
|
//#region src/components/detail-layout/LayoutTabs.tsx
|
|
150
|
-
function
|
|
151
|
-
let
|
|
152
|
-
if (
|
|
153
|
-
if (
|
|
154
|
-
let e =
|
|
158
|
+
function Pe({ config: e, ctx: t }) {
|
|
159
|
+
let n = x(), { items: r } = e, [i, a] = q(0), o = S(), s = t.detailTabsPresentation ?? (o.isPhone ? "sections" : "scroll");
|
|
160
|
+
if (r.length === 0) return null;
|
|
161
|
+
if (s === "sections") {
|
|
162
|
+
let e = r.map((e, t) => `detail-tab-section-${t}`);
|
|
155
163
|
return /* @__PURE__ */ X("div", {
|
|
156
164
|
style: {
|
|
157
165
|
display: "flex",
|
|
@@ -159,8 +167,8 @@ function Me({ config: e, ctx: n }) {
|
|
|
159
167
|
gap: 10,
|
|
160
168
|
minWidth: 0
|
|
161
169
|
},
|
|
162
|
-
children: [
|
|
163
|
-
"aria-label":
|
|
170
|
+
children: [r.length > 1 && /* @__PURE__ */ Y("nav", {
|
|
171
|
+
"aria-label": n("record.tabs.sections", "Detail sections"),
|
|
164
172
|
style: {
|
|
165
173
|
display: "flex",
|
|
166
174
|
gap: 6,
|
|
@@ -168,11 +176,11 @@ function Me({ config: e, ctx: n }) {
|
|
|
168
176
|
padding: "0 2px 2px",
|
|
169
177
|
WebkitOverflowScrolling: "touch"
|
|
170
178
|
},
|
|
171
|
-
children:
|
|
172
|
-
let
|
|
179
|
+
children: r.map((r, i) => {
|
|
180
|
+
let a = Me(r, t, n), o = Ne(r, t);
|
|
173
181
|
return /* @__PURE__ */ X("button", {
|
|
174
182
|
type: "button",
|
|
175
|
-
onClick: () => document.getElementById(e[
|
|
183
|
+
onClick: () => document.getElementById(e[i])?.scrollIntoView({
|
|
176
184
|
block: "start",
|
|
177
185
|
behavior: "smooth"
|
|
178
186
|
}),
|
|
@@ -192,22 +200,22 @@ function Me({ config: e, ctx: n }) {
|
|
|
192
200
|
whiteSpace: "nowrap",
|
|
193
201
|
cursor: "pointer"
|
|
194
202
|
},
|
|
195
|
-
children: [
|
|
196
|
-
name:
|
|
203
|
+
children: [o && /* @__PURE__ */ Y(R, {
|
|
204
|
+
name: o,
|
|
197
205
|
size: 13
|
|
198
206
|
}), /* @__PURE__ */ Y("span", {
|
|
199
207
|
style: {
|
|
200
208
|
overflow: "hidden",
|
|
201
209
|
textOverflow: "ellipsis"
|
|
202
210
|
},
|
|
203
|
-
children:
|
|
211
|
+
children: a
|
|
204
212
|
})]
|
|
205
|
-
},
|
|
213
|
+
}, i);
|
|
206
214
|
})
|
|
207
|
-
}),
|
|
208
|
-
let
|
|
215
|
+
}), r.map((r, i) => {
|
|
216
|
+
let a = Me(r, t, n), o = Ne(r, t);
|
|
209
217
|
return /* @__PURE__ */ X("section", {
|
|
210
|
-
id: e[
|
|
218
|
+
id: e[i],
|
|
211
219
|
style: {
|
|
212
220
|
background: "var(--surface)",
|
|
213
221
|
border: "1px solid var(--border)",
|
|
@@ -228,27 +236,27 @@ function Me({ config: e, ctx: n }) {
|
|
|
228
236
|
fontSize: 13,
|
|
229
237
|
fontWeight: 700
|
|
230
238
|
},
|
|
231
|
-
children: [
|
|
232
|
-
name:
|
|
239
|
+
children: [o && /* @__PURE__ */ Y(R, {
|
|
240
|
+
name: o,
|
|
233
241
|
size: 14
|
|
234
242
|
}), /* @__PURE__ */ Y("span", {
|
|
235
243
|
style: { overflowWrap: "anywhere" },
|
|
236
|
-
children:
|
|
244
|
+
children: a
|
|
237
245
|
})]
|
|
238
246
|
}), /* @__PURE__ */ Y("div", {
|
|
239
247
|
style: {
|
|
240
248
|
padding: 14,
|
|
241
249
|
minWidth: 0
|
|
242
250
|
},
|
|
243
|
-
children: /* @__PURE__ */ Y(
|
|
244
|
-
node:
|
|
251
|
+
children: /* @__PURE__ */ Y(fn, {
|
|
252
|
+
node: r,
|
|
245
253
|
ctx: {
|
|
246
|
-
...
|
|
254
|
+
...t,
|
|
247
255
|
withinCard: !0
|
|
248
256
|
}
|
|
249
257
|
})
|
|
250
258
|
})]
|
|
251
|
-
},
|
|
259
|
+
}, i);
|
|
252
260
|
})]
|
|
253
261
|
});
|
|
254
262
|
}
|
|
@@ -271,13 +279,13 @@ function Me({ config: e, ctx: n }) {
|
|
|
271
279
|
padding: "6px 10px 0 10px",
|
|
272
280
|
overflowX: "auto"
|
|
273
281
|
},
|
|
274
|
-
children:
|
|
275
|
-
let
|
|
282
|
+
children: r.map((e, r) => {
|
|
283
|
+
let o = Me(e, t, n), s = Ne(e, t), c = r === i;
|
|
276
284
|
return /* @__PURE__ */ X("button", {
|
|
277
285
|
role: "tab",
|
|
278
|
-
"aria-selected":
|
|
286
|
+
"aria-selected": c,
|
|
279
287
|
onClick: (e) => {
|
|
280
|
-
e.stopPropagation(),
|
|
288
|
+
e.stopPropagation(), a(r);
|
|
281
289
|
},
|
|
282
290
|
style: {
|
|
283
291
|
position: "relative",
|
|
@@ -291,23 +299,23 @@ function Me({ config: e, ctx: n }) {
|
|
|
291
299
|
fontSize: 12.5,
|
|
292
300
|
fontWeight: 500,
|
|
293
301
|
fontFamily: "inherit",
|
|
294
|
-
color:
|
|
302
|
+
color: c ? "var(--text)" : "var(--text-3)",
|
|
295
303
|
whiteSpace: "nowrap",
|
|
296
304
|
transition: "color .12s"
|
|
297
305
|
},
|
|
298
306
|
onMouseEnter: (e) => {
|
|
299
|
-
|
|
307
|
+
c || (e.currentTarget.style.color = "var(--text-2)");
|
|
300
308
|
},
|
|
301
309
|
onMouseLeave: (e) => {
|
|
302
|
-
|
|
310
|
+
c || (e.currentTarget.style.color = "var(--text-3)");
|
|
303
311
|
},
|
|
304
312
|
children: [
|
|
305
|
-
|
|
306
|
-
name:
|
|
313
|
+
s && /* @__PURE__ */ Y(R, {
|
|
314
|
+
name: s,
|
|
307
315
|
size: 13
|
|
308
316
|
}),
|
|
309
|
-
|
|
310
|
-
|
|
317
|
+
o,
|
|
318
|
+
c && /* @__PURE__ */ Y("span", { style: {
|
|
311
319
|
position: "absolute",
|
|
312
320
|
left: 4,
|
|
313
321
|
right: 4,
|
|
@@ -317,67 +325,80 @@ function Me({ config: e, ctx: n }) {
|
|
|
317
325
|
borderRadius: 2
|
|
318
326
|
} })
|
|
319
327
|
]
|
|
320
|
-
},
|
|
328
|
+
}, r);
|
|
321
329
|
})
|
|
322
330
|
}), /* @__PURE__ */ Y("div", {
|
|
323
331
|
role: "tabpanel",
|
|
324
332
|
style: { padding: 14 },
|
|
325
|
-
children: /* @__PURE__ */ Y(
|
|
326
|
-
node: i
|
|
333
|
+
children: /* @__PURE__ */ Y(fn, {
|
|
334
|
+
node: r[i],
|
|
327
335
|
ctx: {
|
|
328
|
-
...
|
|
336
|
+
...t,
|
|
329
337
|
withinCard: !0
|
|
330
338
|
}
|
|
331
|
-
},
|
|
339
|
+
}, i)
|
|
332
340
|
})]
|
|
333
341
|
});
|
|
334
342
|
}
|
|
335
343
|
//#endregion
|
|
336
344
|
//#region src/components/detail-layout/SectionBlock.tsx
|
|
337
|
-
function
|
|
338
|
-
let
|
|
339
|
-
|
|
345
|
+
function Fe({ config: e, ctx: t }) {
|
|
346
|
+
let n = x(), { name: r, items: i, collapsed: a = !1, columns: o, icon: s, badge: c, emphasis: l } = e, u = e.hide_empty_fields === !0 && t.mode === "display";
|
|
347
|
+
if (u && !Ie(i, t)) return null;
|
|
348
|
+
let d = {
|
|
349
|
+
...t,
|
|
340
350
|
withinCard: !0,
|
|
341
|
-
...
|
|
342
|
-
|
|
343
|
-
|
|
351
|
+
...o ? { columns: o } : null,
|
|
352
|
+
...u ? { hideEmptyFields: u } : null
|
|
353
|
+
}, f = s ? /* @__PURE__ */ Y(R, {
|
|
354
|
+
name: s,
|
|
344
355
|
size: 14
|
|
345
|
-
}) : void 0, p =
|
|
346
|
-
text:
|
|
347
|
-
tone:
|
|
348
|
-
dot:
|
|
356
|
+
}) : void 0, p = c ? {
|
|
357
|
+
text: n(c.text),
|
|
358
|
+
tone: c.tone,
|
|
359
|
+
dot: c.dot
|
|
349
360
|
} : void 0;
|
|
350
|
-
return /* @__PURE__ */ Y(
|
|
351
|
-
title: r
|
|
352
|
-
defaultOpen: !
|
|
361
|
+
return /* @__PURE__ */ Y(P, {
|
|
362
|
+
title: n(r),
|
|
363
|
+
defaultOpen: !a,
|
|
353
364
|
icon: f,
|
|
354
365
|
badge: p,
|
|
355
|
-
emphasis:
|
|
356
|
-
headingLevel:
|
|
357
|
-
children: /* @__PURE__ */ Y(
|
|
358
|
-
|
|
359
|
-
|
|
366
|
+
emphasis: l,
|
|
367
|
+
headingLevel: t.withinCard ? 3 : 2,
|
|
368
|
+
children: /* @__PURE__ */ Y("div", {
|
|
369
|
+
style: {
|
|
370
|
+
display: "flex",
|
|
371
|
+
flexDirection: "column",
|
|
372
|
+
gap: 12
|
|
373
|
+
},
|
|
374
|
+
children: /* @__PURE__ */ Y(dn, {
|
|
375
|
+
nodes: i,
|
|
376
|
+
ctx: d
|
|
377
|
+
})
|
|
360
378
|
})
|
|
361
379
|
});
|
|
362
380
|
}
|
|
381
|
+
function Ie(e, t) {
|
|
382
|
+
return e.some((e) => !e.fields || e.fields.some((e) => ae(t.entity, t.record, e.code)));
|
|
383
|
+
}
|
|
363
384
|
//#endregion
|
|
364
385
|
//#region src/lib/child-config.ts
|
|
365
|
-
function
|
|
386
|
+
function Le(e, t, n) {
|
|
366
387
|
let r = e.display, i = Z(n?.mode, r?.mode, "table"), a = i === "timeline" ? 50 : 20, o = {
|
|
367
388
|
entity: e.entity,
|
|
368
389
|
foreign_key: e.foreign_key,
|
|
369
|
-
name: Z(n?.label, r?.name,
|
|
390
|
+
name: Z(n?.label, r?.name, ze(t)),
|
|
370
391
|
icon: Z(n?.icon, r?.icon, t.display.icon) ?? "",
|
|
371
392
|
mode: i,
|
|
372
|
-
columns: Z(n?.columns, r?.columns,
|
|
373
|
-
sort: Z(n?.sort, r?.sort,
|
|
393
|
+
columns: Z(n?.columns, r?.columns, Ve(t, e.foreign_key)),
|
|
394
|
+
sort: Z(n?.sort, r?.sort, Be(t)),
|
|
374
395
|
limit: Z(n?.limit, r?.limit, a),
|
|
375
396
|
editable: Z(n?.editable, r?.editable, !0),
|
|
376
|
-
interaction: Z(n?.interaction, r?.interaction,
|
|
397
|
+
interaction: Z(n?.interaction, r?.interaction, Re(t))
|
|
377
398
|
}, s = Z(n?.position_field, r?.position_field, void 0);
|
|
378
399
|
s && (o.position_field = s, o.sort = s + ":asc");
|
|
379
400
|
let c = n?.timeline ?? r?.timeline;
|
|
380
|
-
o.mode === "timeline" ? o.timeline =
|
|
401
|
+
o.mode === "timeline" ? o.timeline = He(c ?? {}, t) : c && (o.timeline = c);
|
|
381
402
|
let l = n?.cards ?? r?.cards;
|
|
382
403
|
l && (o.cards = l);
|
|
383
404
|
let u = n?.quick_add ?? e.quick_add;
|
|
@@ -386,13 +407,13 @@ function Pe(e, t, n) {
|
|
|
386
407
|
function Z(e, t, n) {
|
|
387
408
|
return e ?? t ?? n;
|
|
388
409
|
}
|
|
389
|
-
function
|
|
410
|
+
function Re(e) {
|
|
390
411
|
return m(e, "update") ? "inline_edit" : "readonly";
|
|
391
412
|
}
|
|
392
|
-
function
|
|
413
|
+
function ze(e) {
|
|
393
414
|
return e.display.name_plural && Object.keys(e.display.name_plural).length > 0 ? e.display.name_plural : e.display.name;
|
|
394
415
|
}
|
|
395
|
-
function
|
|
416
|
+
function Be(e) {
|
|
396
417
|
if (e.fields.get("created_at")?.type === "timestamp") return "created_at:desc";
|
|
397
418
|
if (e.fields.get("updated_at")?.type === "timestamp") return "updated_at:desc";
|
|
398
419
|
for (let t of e.fields.names()) {
|
|
@@ -403,10 +424,10 @@ function Le(e) {
|
|
|
403
424
|
let n = e.fields.get(t);
|
|
404
425
|
if (n && n.type === "date") return t + ":desc";
|
|
405
426
|
}
|
|
406
|
-
let t =
|
|
427
|
+
let t = Je(e);
|
|
407
428
|
return t ? t + ":asc" : "";
|
|
408
429
|
}
|
|
409
|
-
function
|
|
430
|
+
function Ve(e, t) {
|
|
410
431
|
let n = new Set(Array.isArray(t) ? t : [t]), r = [];
|
|
411
432
|
for (let t of e.fields.names()) {
|
|
412
433
|
if (r.length >= 6) break;
|
|
@@ -415,11 +436,11 @@ function Re(e, t) {
|
|
|
415
436
|
}
|
|
416
437
|
return r;
|
|
417
438
|
}
|
|
418
|
-
function
|
|
439
|
+
function He(e, t) {
|
|
419
440
|
let n = { ...e };
|
|
420
|
-
return n.time_field ||=
|
|
441
|
+
return n.time_field ||= Ge(t), n.type_field ||= Ke(t, "enum"), n.summary_field ||= qe(t, "string", "text", "rich_text"), n.content_field ||= qe(t, "rich_text", "text"), n.summary_field && n.content_field && n.summary_field === n.content_field && (n.summary_field = void 0), n.author_field || t.fields.get("created_by") && (n.author_field = "created_by"), n.direction_field ||= Ue(t), n.intent_field ||= We(t), n;
|
|
421
442
|
}
|
|
422
|
-
function
|
|
443
|
+
function Ue(e) {
|
|
423
444
|
let t = e.fields.get("direction");
|
|
424
445
|
if (t && t.type === "enum") return "direction";
|
|
425
446
|
for (let t of [
|
|
@@ -432,11 +453,11 @@ function Be(e) {
|
|
|
432
453
|
if (n && n.type === "bool") return t;
|
|
433
454
|
}
|
|
434
455
|
}
|
|
435
|
-
function
|
|
456
|
+
function We(e) {
|
|
436
457
|
let t = e.fields.get("intent");
|
|
437
458
|
if (t && t.type === "enum") return "intent";
|
|
438
459
|
}
|
|
439
|
-
function
|
|
460
|
+
function Ge(e) {
|
|
440
461
|
for (let t of e.fields.names()) {
|
|
441
462
|
let n = e.fields.get(t);
|
|
442
463
|
if (n && n.type === "timestamp" && !n.auto) return t;
|
|
@@ -448,13 +469,13 @@ function He(e) {
|
|
|
448
469
|
if (n && n.type === "timestamp") return t;
|
|
449
470
|
}
|
|
450
471
|
}
|
|
451
|
-
function
|
|
472
|
+
function Ke(e, t) {
|
|
452
473
|
for (let n of e.fields.names()) {
|
|
453
474
|
let r = e.fields.get(n);
|
|
454
475
|
if (r && r.type === t) return n;
|
|
455
476
|
}
|
|
456
477
|
}
|
|
457
|
-
function
|
|
478
|
+
function qe(e, ...t) {
|
|
458
479
|
for (let n of e.fields.names()) {
|
|
459
480
|
let r = e.fields.get(n);
|
|
460
481
|
if (r) {
|
|
@@ -462,28 +483,28 @@ function We(e, ...t) {
|
|
|
462
483
|
}
|
|
463
484
|
}
|
|
464
485
|
}
|
|
465
|
-
function
|
|
466
|
-
let t =
|
|
486
|
+
function Je(e) {
|
|
487
|
+
let t = c(e);
|
|
467
488
|
return t.length > 0 ? t[0] : void 0;
|
|
468
489
|
}
|
|
469
|
-
function
|
|
490
|
+
function Ye(e, t) {
|
|
470
491
|
return e.children?.find((e) => e.entity === t);
|
|
471
492
|
}
|
|
472
493
|
//#endregion
|
|
473
494
|
//#region src/lib/quick-add.ts
|
|
474
|
-
function
|
|
495
|
+
function Xe(e, t, n, r) {
|
|
475
496
|
let i = {
|
|
476
497
|
...t ?? {},
|
|
477
498
|
...e
|
|
478
499
|
};
|
|
479
500
|
if (Array.isArray(n)) {
|
|
480
|
-
let e = Array.isArray(r) ? r.map(String) :
|
|
501
|
+
let e = Array.isArray(r) ? r.map(String) : d(String(r), n.length);
|
|
481
502
|
if (!e || e.length !== n.length) throw Error("invalid composite parent id");
|
|
482
503
|
for (let t = 0; t < n.length; t++) i[n[t]] = e[t];
|
|
483
504
|
} else i[n] = Array.isArray(r) ? r[0] : r;
|
|
484
505
|
return i;
|
|
485
506
|
}
|
|
486
|
-
function
|
|
507
|
+
function Ze(e, t) {
|
|
487
508
|
for (let n of t) {
|
|
488
509
|
let t = e[n];
|
|
489
510
|
if (t == null || t === "") return !1;
|
|
@@ -492,27 +513,27 @@ function Je(e, t) {
|
|
|
492
513
|
}
|
|
493
514
|
//#endregion
|
|
494
515
|
//#region src/components/detail-layout/useQuickAdd.ts
|
|
495
|
-
function
|
|
496
|
-
let [
|
|
497
|
-
let
|
|
498
|
-
if (
|
|
499
|
-
return
|
|
500
|
-
}),
|
|
501
|
-
mutationFn: (
|
|
502
|
-
onMutate: async (
|
|
503
|
-
let
|
|
516
|
+
function Qe(t, n, r, i) {
|
|
517
|
+
let [a, o] = q(() => {
|
|
518
|
+
let n = t.quick_add, r = i.entities[t.entity], a = {};
|
|
519
|
+
if (n?.fields) for (let t of n.fields) n.defaults?.[t] == null ? r?.fields.get(t)?.type === "timestamp" && (a[t] = e()) : a[t] = n.defaults[t];
|
|
520
|
+
return a;
|
|
521
|
+
}), s = we(), { mutate: c, isPending: l, error: d, reset: f } = Ce({
|
|
522
|
+
mutationFn: (e) => v(t.entity, e),
|
|
523
|
+
onMutate: async (e) => {
|
|
524
|
+
let i = Array.isArray(r) ? u(r.map(String)) : r, a = [
|
|
525
|
+
te,
|
|
526
|
+
n,
|
|
504
527
|
i,
|
|
505
|
-
t
|
|
506
|
-
o,
|
|
507
|
-
e.entity
|
|
528
|
+
t.entity
|
|
508
529
|
];
|
|
509
|
-
await
|
|
510
|
-
let
|
|
511
|
-
...
|
|
530
|
+
await s.cancelQueries({ queryKey: a });
|
|
531
|
+
let o = s.getQueriesData({ queryKey: a }), c = {
|
|
532
|
+
...e,
|
|
512
533
|
id: `__optimistic_${crypto.randomUUID()}`,
|
|
513
534
|
__optimistic: !0
|
|
514
535
|
};
|
|
515
|
-
return
|
|
536
|
+
return s.setQueriesData({ queryKey: a }, (e) => {
|
|
516
537
|
if (!e || typeof e != "object") return e;
|
|
517
538
|
if ("pages" in e && Array.isArray(e.pages) && e.pages.length > 0) {
|
|
518
539
|
let t = e, [n, ...r] = t.pages;
|
|
@@ -520,80 +541,80 @@ function Ye(e, t, a, o) {
|
|
|
520
541
|
...t,
|
|
521
542
|
pages: [{
|
|
522
543
|
...n,
|
|
523
|
-
data: [
|
|
544
|
+
data: [c, ...n.data]
|
|
524
545
|
}, ...r]
|
|
525
546
|
};
|
|
526
547
|
}
|
|
527
548
|
return e;
|
|
528
|
-
}), { snapshots:
|
|
549
|
+
}), { snapshots: o };
|
|
529
550
|
},
|
|
530
551
|
onError: (e, t, n) => {
|
|
531
|
-
if (n?.snapshots) for (let [e, t] of n.snapshots)
|
|
552
|
+
if (n?.snapshots) for (let [e, t] of n.snapshots) s.setQueryData(e, t);
|
|
532
553
|
},
|
|
533
554
|
onSuccess: () => {
|
|
534
|
-
let
|
|
535
|
-
if (
|
|
536
|
-
|
|
555
|
+
let n = t.quick_add, r = i.entities[t.entity], a = {};
|
|
556
|
+
if (n?.fields) for (let t of n.fields) a[t] = n?.defaults?.[t] == null ? r?.fields.get(t)?.type === "timestamp" ? e() : "" : n.defaults[t];
|
|
557
|
+
o(a);
|
|
537
558
|
},
|
|
538
559
|
onSettled: () => {
|
|
539
|
-
let
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
560
|
+
let e = Array.isArray(r) ? u(r.map(String)) : r;
|
|
561
|
+
s.invalidateQueries({ queryKey: [
|
|
562
|
+
te,
|
|
563
|
+
n,
|
|
564
|
+
e,
|
|
565
|
+
t.entity
|
|
545
566
|
] });
|
|
546
567
|
}
|
|
547
|
-
}),
|
|
548
|
-
function
|
|
549
|
-
if (
|
|
550
|
-
let n =
|
|
551
|
-
|
|
568
|
+
}), p = t.quick_add, m = i.entities[t.entity], h = Ze(a, p?.fields.filter((e) => m?.fields.get(e)?.required) ?? []);
|
|
569
|
+
function g(e) {
|
|
570
|
+
if (e.preventDefault(), !p) return;
|
|
571
|
+
let n = Xe(a, p.defaults, t.foreign_key, r);
|
|
572
|
+
c(n);
|
|
552
573
|
}
|
|
553
|
-
function
|
|
554
|
-
|
|
574
|
+
function _(e, t) {
|
|
575
|
+
d && f(), o((n) => ({
|
|
555
576
|
...n,
|
|
556
577
|
[e]: t
|
|
557
578
|
}));
|
|
558
579
|
}
|
|
559
580
|
return {
|
|
560
|
-
values:
|
|
561
|
-
quickAdd:
|
|
562
|
-
childEntity:
|
|
563
|
-
isPending:
|
|
564
|
-
error:
|
|
565
|
-
isReady:
|
|
566
|
-
handleSubmit:
|
|
567
|
-
handleFieldChange:
|
|
581
|
+
values: a,
|
|
582
|
+
quickAdd: p,
|
|
583
|
+
childEntity: m,
|
|
584
|
+
isPending: l,
|
|
585
|
+
error: d,
|
|
586
|
+
isReady: h,
|
|
587
|
+
handleSubmit: g,
|
|
588
|
+
handleFieldChange: _
|
|
568
589
|
};
|
|
569
590
|
}
|
|
570
591
|
//#endregion
|
|
571
592
|
//#region src/components/detail-layout/QuickAddForm.tsx
|
|
572
|
-
function
|
|
573
|
-
let
|
|
574
|
-
return !
|
|
575
|
-
onSubmit:
|
|
593
|
+
function $e({ config: e, parentEntity: t, parentId: n, schema: i }) {
|
|
594
|
+
let a = x(), o = x("errors"), { values: s, quickAdd: c, childEntity: l, isPending: u, error: d, isReady: f, handleSubmit: p, handleFieldChange: m } = Qe(e, t, n, i), h = S(), g = ye();
|
|
595
|
+
return !c || c.fields.length === 0 || !l ? null : /* @__PURE__ */ X("form", {
|
|
596
|
+
onSubmit: p,
|
|
576
597
|
style: {
|
|
577
598
|
display: "flex",
|
|
578
|
-
flexDirection:
|
|
599
|
+
flexDirection: h.isPhone ? "column" : "row",
|
|
579
600
|
alignItems: "flex-end",
|
|
580
601
|
gap: 8,
|
|
581
602
|
padding: "8px 0",
|
|
582
603
|
borderBottom: "1px solid var(--divider)"
|
|
583
604
|
},
|
|
584
605
|
children: [
|
|
585
|
-
|
|
586
|
-
let n =
|
|
606
|
+
c.fields.map((t) => {
|
|
607
|
+
let n = l.fields.get(t);
|
|
587
608
|
if (!n) return null;
|
|
588
|
-
let r = `${
|
|
609
|
+
let r = `${g}-quick-add-${e.entity}-${t}`, o = `${r}-label`;
|
|
589
610
|
return /* @__PURE__ */ X("div", {
|
|
590
611
|
style: {
|
|
591
612
|
flex: 1,
|
|
592
613
|
minWidth: 0,
|
|
593
|
-
width:
|
|
614
|
+
width: h.isPhone ? "100%" : void 0
|
|
594
615
|
},
|
|
595
616
|
children: [/* @__PURE__ */ Y("label", {
|
|
596
|
-
id:
|
|
617
|
+
id: o,
|
|
597
618
|
htmlFor: r,
|
|
598
619
|
style: {
|
|
599
620
|
fontSize: 11,
|
|
@@ -602,56 +623,56 @@ function Xe({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
602
623
|
display: "block",
|
|
603
624
|
fontWeight: 500
|
|
604
625
|
},
|
|
605
|
-
children: a
|
|
606
|
-
}),
|
|
626
|
+
children: _(a, n, t, i.entities)
|
|
627
|
+
}), k({
|
|
607
628
|
field: n,
|
|
608
|
-
fieldName:
|
|
609
|
-
value:
|
|
629
|
+
fieldName: t,
|
|
630
|
+
value: s[t] ?? "",
|
|
610
631
|
mode: "edit",
|
|
611
|
-
onChange: (
|
|
612
|
-
record:
|
|
632
|
+
onChange: (e) => m(t, e),
|
|
633
|
+
record: s,
|
|
613
634
|
fieldId: r,
|
|
614
|
-
labelId:
|
|
615
|
-
t:
|
|
635
|
+
labelId: o,
|
|
636
|
+
t: a
|
|
616
637
|
})]
|
|
617
|
-
},
|
|
638
|
+
}, t);
|
|
618
639
|
}),
|
|
619
|
-
/* @__PURE__ */ Y(
|
|
640
|
+
/* @__PURE__ */ Y(E, {
|
|
620
641
|
type: "submit",
|
|
621
642
|
kind: "primary",
|
|
622
|
-
size:
|
|
623
|
-
icon: /* @__PURE__ */ Y(
|
|
624
|
-
disabled:
|
|
625
|
-
style:
|
|
626
|
-
children:
|
|
643
|
+
size: h.isPhone ? "md" : "sm",
|
|
644
|
+
icon: /* @__PURE__ */ Y(w.plus, { size: 12 }),
|
|
645
|
+
disabled: u || !f,
|
|
646
|
+
style: h.isPhone ? { alignSelf: "flex-end" } : void 0,
|
|
647
|
+
children: a("record.related.add", "Add")
|
|
627
648
|
}),
|
|
628
|
-
|
|
649
|
+
d != null && /* @__PURE__ */ Y("span", {
|
|
629
650
|
style: {
|
|
630
651
|
fontSize: 11,
|
|
631
652
|
color: "var(--danger)",
|
|
632
653
|
alignSelf: "flex-end",
|
|
633
654
|
marginBottom: 4
|
|
634
655
|
},
|
|
635
|
-
children:
|
|
656
|
+
children: r(o, d)
|
|
636
657
|
})
|
|
637
658
|
]
|
|
638
659
|
});
|
|
639
660
|
}
|
|
640
661
|
//#endregion
|
|
641
662
|
//#region src/components/detail-layout/useManualColumnResize.tsx
|
|
642
|
-
function
|
|
663
|
+
function et(e, t, n) {
|
|
643
664
|
return `${e}::child::${t}.${n}`;
|
|
644
665
|
}
|
|
645
|
-
function
|
|
646
|
-
return Math.min(
|
|
666
|
+
function tt(e) {
|
|
667
|
+
return Math.min(ne, Math.max(60, Math.round(e)));
|
|
647
668
|
}
|
|
648
|
-
function
|
|
649
|
-
let { widths: t, setWidths: n, resetWidths: r } =
|
|
669
|
+
function nt(e) {
|
|
670
|
+
let { widths: t, setWidths: n, resetWidths: r } = ie(e), [i, a] = q({}), o = K(null);
|
|
650
671
|
G(() => {
|
|
651
672
|
let e = (e) => {
|
|
652
673
|
let t = o.current;
|
|
653
674
|
if (!t) return;
|
|
654
|
-
let n =
|
|
675
|
+
let n = tt(t.startWidth + (e.clientX - t.startX));
|
|
655
676
|
t.current = n, a({ [t.colId]: n });
|
|
656
677
|
}, t = () => {
|
|
657
678
|
let e = o.current;
|
|
@@ -701,7 +722,7 @@ function $e(e) {
|
|
|
701
722
|
resetWidths: r
|
|
702
723
|
};
|
|
703
724
|
}
|
|
704
|
-
function
|
|
725
|
+
function rt({ colId: e, onMouseDown: t }) {
|
|
705
726
|
return /* @__PURE__ */ Y("span", {
|
|
706
727
|
"data-testid": "col-resize-handle",
|
|
707
728
|
"aria-hidden": "true",
|
|
@@ -729,47 +750,49 @@ function et({ colId: e, onMouseDown: t }) {
|
|
|
729
750
|
}
|
|
730
751
|
//#endregion
|
|
731
752
|
//#region src/components/detail-layout/ChildrenTable.tsx
|
|
732
|
-
function
|
|
733
|
-
let
|
|
734
|
-
|
|
735
|
-
let
|
|
736
|
-
let
|
|
737
|
-
if (!
|
|
738
|
-
for (let
|
|
739
|
-
let
|
|
740
|
-
|
|
741
|
-
field:
|
|
742
|
-
fieldName:
|
|
753
|
+
function it({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
754
|
+
let i = x(), a = x("errors"), o = r.entities[e.entity], s = Array.isArray(e.foreign_key) ? e.foreign_key.join(",") : e.foreign_key, c = nt(et(t, e.entity, s)), l = H(o?.realtime, e.entity), { data: u, isLoading: d, isError: p, refetch: m } = V(t, n, e.entity, e.foreign_key, e.sort, e.limit), { refreshing: h, refresh: g } = re(m), v = u?.data ?? [], y = u?.$refs, S = K(y);
|
|
755
|
+
S.current = y;
|
|
756
|
+
let C = e.columns, E = e.interaction === "navigate", k = C[0], j = E && o ? f(void 0, o, r.screens) : null, M = o ? Je(o) : void 0, N = xe(() => {
|
|
757
|
+
let t = /* @__PURE__ */ new Map();
|
|
758
|
+
if (!o) return t;
|
|
759
|
+
for (let n of C) {
|
|
760
|
+
let a = o.fields.get(n);
|
|
761
|
+
a && t.set(n, A({
|
|
762
|
+
field: a,
|
|
763
|
+
fieldName: n,
|
|
743
764
|
surface: "list",
|
|
744
|
-
entity:
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
765
|
+
entity: o,
|
|
766
|
+
entityCode: e.entity,
|
|
767
|
+
entities: r.entities,
|
|
768
|
+
screens: r.screens,
|
|
769
|
+
refs: () => S.current,
|
|
770
|
+
t: i
|
|
749
771
|
}));
|
|
750
772
|
}
|
|
751
|
-
return
|
|
773
|
+
return t;
|
|
752
774
|
}, [
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
775
|
+
o,
|
|
776
|
+
e.entity,
|
|
777
|
+
C,
|
|
778
|
+
r.entities,
|
|
779
|
+
r.screens,
|
|
780
|
+
i
|
|
758
781
|
]);
|
|
759
|
-
if (!
|
|
782
|
+
if (!o) return /* @__PURE__ */ Y("div", {
|
|
760
783
|
style: {
|
|
761
784
|
fontSize: 12.5,
|
|
762
785
|
color: "var(--text-3)",
|
|
763
786
|
padding: "8px 0"
|
|
764
787
|
},
|
|
765
|
-
children:
|
|
788
|
+
children: a("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
766
789
|
});
|
|
767
|
-
let
|
|
768
|
-
config:
|
|
769
|
-
parentEntity:
|
|
770
|
-
parentId:
|
|
771
|
-
schema:
|
|
772
|
-
}),
|
|
790
|
+
let P = /* @__PURE__ */ Y($e, {
|
|
791
|
+
config: e,
|
|
792
|
+
parentEntity: t,
|
|
793
|
+
parentId: n,
|
|
794
|
+
schema: r
|
|
795
|
+
}), F = l ? i("record.related.live", "Live") : i("record.related.paused", "Updates paused"), I = /* @__PURE__ */ X("div", {
|
|
773
796
|
style: {
|
|
774
797
|
display: "flex",
|
|
775
798
|
alignItems: "center",
|
|
@@ -778,40 +801,40 @@ function tt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
778
801
|
justifyContent: "flex-end"
|
|
779
802
|
},
|
|
780
803
|
children: [
|
|
781
|
-
|
|
782
|
-
icon: /* @__PURE__ */ Y(
|
|
783
|
-
title:
|
|
804
|
+
c.hasWidths && /* @__PURE__ */ Y(T, {
|
|
805
|
+
icon: /* @__PURE__ */ Y(w.columns, { size: 13 }),
|
|
806
|
+
title: i("record.related.reset_widths", "Reset column widths (this device)"),
|
|
784
807
|
size: 24,
|
|
785
|
-
onClick:
|
|
808
|
+
onClick: c.resetWidths
|
|
786
809
|
}),
|
|
787
|
-
|
|
810
|
+
o.realtime === !0 && /* @__PURE__ */ Y("span", {
|
|
788
811
|
"data-testid": "children-live-indicator",
|
|
789
812
|
role: "status",
|
|
790
|
-
"aria-label":
|
|
791
|
-
title:
|
|
792
|
-
children: /* @__PURE__ */ Y(
|
|
793
|
-
tone:
|
|
813
|
+
"aria-label": F,
|
|
814
|
+
title: l ? i("record.related.live_hint", "This table updates automatically in realtime.") : i("record.related.paused_hint", "Realtime updates are paused. Refresh manually to load the latest data."),
|
|
815
|
+
children: /* @__PURE__ */ Y(D, {
|
|
816
|
+
tone: l ? "emerald" : "amber",
|
|
794
817
|
size: "xs",
|
|
795
818
|
dot: !0,
|
|
796
|
-
children:
|
|
819
|
+
children: F
|
|
797
820
|
})
|
|
798
821
|
}),
|
|
799
|
-
/* @__PURE__ */ Y(
|
|
800
|
-
icon:
|
|
822
|
+
/* @__PURE__ */ Y(T, {
|
|
823
|
+
icon: h ? /* @__PURE__ */ Y("span", {
|
|
801
824
|
"data-testid": "children-refresh-spinner",
|
|
802
825
|
style: { display: "inline-flex" },
|
|
803
|
-
children: /* @__PURE__ */ Y(
|
|
804
|
-
}) : /* @__PURE__ */ Y(
|
|
805
|
-
title:
|
|
826
|
+
children: /* @__PURE__ */ Y(O, { size: 13 })
|
|
827
|
+
}) : /* @__PURE__ */ Y(w.refresh, { size: 13 }),
|
|
828
|
+
title: i("record.related.refresh", "Refresh"),
|
|
806
829
|
size: 24,
|
|
807
|
-
disabled:
|
|
808
|
-
onClick:
|
|
830
|
+
disabled: h,
|
|
831
|
+
onClick: g
|
|
809
832
|
})
|
|
810
833
|
]
|
|
811
834
|
});
|
|
812
|
-
return
|
|
835
|
+
return p ? /* @__PURE__ */ X("div", { children: [
|
|
836
|
+
P,
|
|
813
837
|
I,
|
|
814
|
-
R,
|
|
815
838
|
/* @__PURE__ */ X("div", {
|
|
816
839
|
style: {
|
|
817
840
|
fontSize: 12.5,
|
|
@@ -819,14 +842,14 @@ function tt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
819
842
|
padding: "8px 0"
|
|
820
843
|
},
|
|
821
844
|
children: [
|
|
822
|
-
|
|
845
|
+
a("record.related_rows_unreadable", "The related records could not be loaded."),
|
|
823
846
|
" ",
|
|
824
|
-
|
|
847
|
+
i("record.related.try_again", "Try again.")
|
|
825
848
|
]
|
|
826
849
|
})
|
|
827
|
-
] }) :
|
|
850
|
+
] }) : d ? /* @__PURE__ */ X("div", { children: [
|
|
851
|
+
P,
|
|
828
852
|
I,
|
|
829
|
-
R,
|
|
830
853
|
/* @__PURE__ */ Y("div", {
|
|
831
854
|
style: {
|
|
832
855
|
display: "flex",
|
|
@@ -844,40 +867,40 @@ function tt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
844
867
|
borderRadius: 4
|
|
845
868
|
} }, e))
|
|
846
869
|
})
|
|
847
|
-
] }) :
|
|
870
|
+
] }) : v.length === 0 ? /* @__PURE__ */ X("div", { children: [
|
|
871
|
+
P,
|
|
848
872
|
I,
|
|
849
|
-
R,
|
|
850
873
|
/* @__PURE__ */ Y("div", {
|
|
851
874
|
style: {
|
|
852
875
|
fontSize: 12.5,
|
|
853
876
|
color: "var(--text-3)",
|
|
854
877
|
padding: "12px 0"
|
|
855
878
|
},
|
|
856
|
-
children:
|
|
879
|
+
children: i("record.related.empty", "No records yet.")
|
|
857
880
|
})
|
|
858
881
|
] }) : /* @__PURE__ */ X("div", { children: [
|
|
882
|
+
P,
|
|
859
883
|
I,
|
|
860
|
-
R,
|
|
861
884
|
/* @__PURE__ */ Y("div", {
|
|
862
885
|
style: { overflowX: "auto" },
|
|
863
886
|
children: /* @__PURE__ */ X("table", {
|
|
864
|
-
style:
|
|
865
|
-
children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children:
|
|
866
|
-
let t =
|
|
887
|
+
style: le,
|
|
888
|
+
children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: C.map((e) => {
|
|
889
|
+
let t = o.fields.get(e);
|
|
867
890
|
return /* @__PURE__ */ X("th", {
|
|
868
|
-
style:
|
|
869
|
-
children: [t ?
|
|
891
|
+
style: c.headerStyle(e, ce),
|
|
892
|
+
children: [t ? _(i, t, e, r.entities) : e, /* @__PURE__ */ Y(rt, {
|
|
870
893
|
colId: e,
|
|
871
|
-
onMouseDown:
|
|
894
|
+
onMouseDown: c.onHandleMouseDown
|
|
872
895
|
})]
|
|
873
896
|
}, e);
|
|
874
|
-
}) }) }), /* @__PURE__ */ Y("tbody", { children:
|
|
875
|
-
let n =
|
|
876
|
-
return /* @__PURE__ */ Y("tr", { children:
|
|
877
|
-
let n = t ===
|
|
897
|
+
}) }) }), /* @__PURE__ */ Y("tbody", { children: v.map((e, t) => {
|
|
898
|
+
let n = M ? b(e[M]) : "", r = E && j && n ? j.replace(/:\w+/, n) : void 0;
|
|
899
|
+
return /* @__PURE__ */ Y("tr", { children: C.map((t) => {
|
|
900
|
+
let n = t === k, i = N.get(t), a = i ? i(e[t], e) : b(e[t]);
|
|
878
901
|
return /* @__PURE__ */ Y("td", {
|
|
879
902
|
title: typeof a == "string" ? a : void 0,
|
|
880
|
-
style:
|
|
903
|
+
style: c.cellStyle(t, ue),
|
|
881
904
|
children: n && r ? /* @__PURE__ */ Y("a", {
|
|
882
905
|
href: r,
|
|
883
906
|
style: {
|
|
@@ -890,7 +913,7 @@ function tt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
890
913
|
children: a
|
|
891
914
|
}) : a
|
|
892
915
|
}, t);
|
|
893
|
-
}) },
|
|
916
|
+
}) }, b(e.id ?? t));
|
|
894
917
|
}) })]
|
|
895
918
|
})
|
|
896
919
|
})
|
|
@@ -898,35 +921,35 @@ function tt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
898
921
|
}
|
|
899
922
|
//#endregion
|
|
900
923
|
//#region src/components/detail-layout/ChildrenList.tsx
|
|
901
|
-
function
|
|
902
|
-
let
|
|
903
|
-
if (!
|
|
924
|
+
function at({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
925
|
+
let a = r.entities[e.entity], o = x(), s = x("errors"), { data: c, isLoading: l, isError: u } = V(t, n, e.entity, e.foreign_key, e.sort, e.limit), d = c?.data ?? [], f = c?.$refs, p = e.columns;
|
|
926
|
+
if (!a) return /* @__PURE__ */ Y("div", {
|
|
904
927
|
style: {
|
|
905
928
|
fontSize: 12.5,
|
|
906
929
|
color: "var(--text-3)",
|
|
907
930
|
padding: "8px 0"
|
|
908
931
|
},
|
|
909
|
-
children:
|
|
932
|
+
children: s("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
910
933
|
});
|
|
911
|
-
let m = /* @__PURE__ */ Y(
|
|
934
|
+
let m = /* @__PURE__ */ Y($e, {
|
|
912
935
|
config: e,
|
|
913
936
|
parentEntity: t,
|
|
914
937
|
parentId: n,
|
|
915
938
|
schema: r
|
|
916
939
|
});
|
|
917
|
-
if (
|
|
940
|
+
if (u) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ X("div", {
|
|
918
941
|
style: {
|
|
919
942
|
fontSize: 12.5,
|
|
920
943
|
color: "var(--danger)",
|
|
921
944
|
padding: "8px 0"
|
|
922
945
|
},
|
|
923
946
|
children: [
|
|
924
|
-
|
|
947
|
+
s("record.related_rows_unreadable", "The related records could not be loaded."),
|
|
925
948
|
" ",
|
|
926
|
-
|
|
949
|
+
o("record.related.try_again", "Try again.")
|
|
927
950
|
]
|
|
928
951
|
})] });
|
|
929
|
-
if (
|
|
952
|
+
if (l) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ X("div", {
|
|
930
953
|
style: {
|
|
931
954
|
display: "flex",
|
|
932
955
|
flexDirection: "column",
|
|
@@ -952,22 +975,22 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
952
975
|
} })
|
|
953
976
|
]
|
|
954
977
|
})] });
|
|
955
|
-
if (
|
|
978
|
+
if (d.length === 0) return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ Y("div", {
|
|
956
979
|
style: {
|
|
957
980
|
fontSize: 12.5,
|
|
958
981
|
color: "var(--text-3)",
|
|
959
982
|
padding: "12px 0"
|
|
960
983
|
},
|
|
961
|
-
children:
|
|
984
|
+
children: o("record.related.empty", "No records yet.")
|
|
962
985
|
})] });
|
|
963
|
-
let h = p.length > 0 ?
|
|
986
|
+
let h = p.length > 0 ? a.display.display_field ?? p[0] : a.display.display_field;
|
|
964
987
|
return /* @__PURE__ */ X("div", { children: [m, /* @__PURE__ */ Y("div", {
|
|
965
988
|
style: {
|
|
966
989
|
display: "flex",
|
|
967
990
|
flexDirection: "column"
|
|
968
991
|
},
|
|
969
|
-
children:
|
|
970
|
-
let n = typeof e.$display == "string" ? e[
|
|
992
|
+
children: d.map((e, t) => {
|
|
993
|
+
let n = typeof e.$display == "string" ? e[i] : "";
|
|
971
994
|
return /* @__PURE__ */ Y("div", {
|
|
972
995
|
style: {
|
|
973
996
|
display: "flex",
|
|
@@ -988,15 +1011,15 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
988
1011
|
textOverflow: "ellipsis",
|
|
989
1012
|
whiteSpace: "nowrap"
|
|
990
1013
|
},
|
|
991
|
-
children: n || (h &&
|
|
992
|
-
field:
|
|
1014
|
+
children: n || (h && a.fields.get(h) ? k({
|
|
1015
|
+
field: a.fields.get(h),
|
|
993
1016
|
fieldName: h,
|
|
994
1017
|
value: e[h],
|
|
995
1018
|
mode: "display",
|
|
996
1019
|
record: e,
|
|
997
1020
|
refs: f,
|
|
998
|
-
t:
|
|
999
|
-
}) : h && e[h] != null ?
|
|
1021
|
+
t: o
|
|
1022
|
+
}) : h && e[h] != null ? b(e[h]) : null)
|
|
1000
1023
|
}), p.length > 1 && (() => {
|
|
1001
1024
|
let t = p.slice(1, 3).filter((t) => e[t] != null);
|
|
1002
1025
|
return t.length === 0 ? null : /* @__PURE__ */ Y("div", {
|
|
@@ -1007,58 +1030,58 @@ function nt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1007
1030
|
textOverflow: "ellipsis",
|
|
1008
1031
|
whiteSpace: "nowrap"
|
|
1009
1032
|
},
|
|
1010
|
-
children: t.map((t, n) => /* @__PURE__ */ X("span", { children: [n > 0 && " · ",
|
|
1011
|
-
field:
|
|
1033
|
+
children: t.map((t, n) => /* @__PURE__ */ X("span", { children: [n > 0 && " · ", a.fields.get(t) ? k({
|
|
1034
|
+
field: a.fields.get(t),
|
|
1012
1035
|
fieldName: t,
|
|
1013
1036
|
value: e[t],
|
|
1014
1037
|
mode: "display",
|
|
1015
1038
|
record: e,
|
|
1016
1039
|
refs: f,
|
|
1017
|
-
t:
|
|
1040
|
+
t: o
|
|
1018
1041
|
}) : String(e[t])] }, t))
|
|
1019
1042
|
});
|
|
1020
1043
|
})()]
|
|
1021
1044
|
})
|
|
1022
|
-
},
|
|
1045
|
+
}, b(e.id ?? t));
|
|
1023
1046
|
})
|
|
1024
1047
|
})] });
|
|
1025
1048
|
}
|
|
1026
1049
|
//#endregion
|
|
1027
1050
|
//#region src/components/detail-layout/ChildrenCards.tsx
|
|
1028
|
-
function
|
|
1029
|
-
let i = r.entities[e.entity],
|
|
1051
|
+
function ot({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
1052
|
+
let i = r.entities[e.entity], a = x(), o = x("errors"), { data: s, isLoading: c, isError: l } = V(t, n, e.entity, e.foreign_key, e.sort, e.limit), u = s?.data ?? [], d = s?.$refs, f = e.columns, p = e.cards, m = p?.header_field ?? f[0], h = p?.badge_field, g = p?.columns_count ?? 3;
|
|
1030
1053
|
if (!i) return /* @__PURE__ */ Y("div", {
|
|
1031
1054
|
style: {
|
|
1032
1055
|
fontSize: 12.5,
|
|
1033
1056
|
color: "var(--text-3)",
|
|
1034
1057
|
padding: "8px 0"
|
|
1035
1058
|
},
|
|
1036
|
-
children:
|
|
1059
|
+
children: o("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
1037
1060
|
});
|
|
1038
|
-
let
|
|
1061
|
+
let v = {
|
|
1039
1062
|
display: "grid",
|
|
1040
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${
|
|
1063
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${g >= 4 ? 180 : 240}px, 1fr))`,
|
|
1041
1064
|
gap: 12
|
|
1042
|
-
},
|
|
1065
|
+
}, y = /* @__PURE__ */ Y($e, {
|
|
1043
1066
|
config: e,
|
|
1044
1067
|
parentEntity: t,
|
|
1045
1068
|
parentId: n,
|
|
1046
1069
|
schema: r
|
|
1047
1070
|
});
|
|
1048
|
-
if (
|
|
1071
|
+
if (l) return /* @__PURE__ */ X("div", { children: [y, /* @__PURE__ */ X("div", {
|
|
1049
1072
|
style: {
|
|
1050
1073
|
fontSize: 12.5,
|
|
1051
1074
|
color: "var(--danger)",
|
|
1052
1075
|
padding: "8px 0"
|
|
1053
1076
|
},
|
|
1054
1077
|
children: [
|
|
1055
|
-
|
|
1078
|
+
o("record.related_rows_unreadable", "The related records could not be loaded."),
|
|
1056
1079
|
" ",
|
|
1057
|
-
|
|
1080
|
+
a("record.related.try_again", "Try again.")
|
|
1058
1081
|
]
|
|
1059
1082
|
})] });
|
|
1060
|
-
if (
|
|
1061
|
-
style:
|
|
1083
|
+
if (c) return /* @__PURE__ */ X("div", { children: [y, /* @__PURE__ */ Y("div", {
|
|
1084
|
+
style: v,
|
|
1062
1085
|
children: [
|
|
1063
1086
|
0,
|
|
1064
1087
|
1,
|
|
@@ -1069,18 +1092,18 @@ function rt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1069
1092
|
borderRadius: 10
|
|
1070
1093
|
} }, e))
|
|
1071
1094
|
})] });
|
|
1072
|
-
if (
|
|
1095
|
+
if (u.length === 0) return /* @__PURE__ */ X("div", { children: [y, /* @__PURE__ */ Y("div", {
|
|
1073
1096
|
style: {
|
|
1074
1097
|
fontSize: 12.5,
|
|
1075
1098
|
color: "var(--text-3)",
|
|
1076
1099
|
padding: "12px 0"
|
|
1077
1100
|
},
|
|
1078
|
-
children:
|
|
1101
|
+
children: a("record.related.empty", "No records yet.")
|
|
1079
1102
|
})] });
|
|
1080
|
-
let
|
|
1081
|
-
return /* @__PURE__ */ X("div", { children: [
|
|
1082
|
-
style:
|
|
1083
|
-
children:
|
|
1103
|
+
let S = f.filter((e) => e !== m && e !== h);
|
|
1104
|
+
return /* @__PURE__ */ X("div", { children: [y, /* @__PURE__ */ Y("div", {
|
|
1105
|
+
style: v,
|
|
1106
|
+
children: u.map((e, t) => /* @__PURE__ */ X("div", {
|
|
1084
1107
|
style: {
|
|
1085
1108
|
background: "var(--surface)",
|
|
1086
1109
|
border: "1px solid var(--border)",
|
|
@@ -1094,7 +1117,7 @@ function rt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1094
1117
|
alignItems: "center",
|
|
1095
1118
|
justifyContent: "space-between",
|
|
1096
1119
|
gap: 8,
|
|
1097
|
-
borderBottom:
|
|
1120
|
+
borderBottom: S.length > 0 ? "1px solid var(--divider)" : "none"
|
|
1098
1121
|
},
|
|
1099
1122
|
children: [/* @__PURE__ */ Y("div", {
|
|
1100
1123
|
style: {
|
|
@@ -1104,36 +1127,36 @@ function rt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1104
1127
|
textOverflow: "ellipsis",
|
|
1105
1128
|
whiteSpace: "nowrap"
|
|
1106
1129
|
},
|
|
1107
|
-
children:
|
|
1108
|
-
field: i.fields.get(
|
|
1109
|
-
fieldName:
|
|
1110
|
-
value: e[
|
|
1130
|
+
children: m && i.fields.get(m) ? k({
|
|
1131
|
+
field: i.fields.get(m),
|
|
1132
|
+
fieldName: m,
|
|
1133
|
+
value: e[m],
|
|
1111
1134
|
mode: "display",
|
|
1112
1135
|
record: e,
|
|
1113
|
-
refs:
|
|
1114
|
-
t:
|
|
1115
|
-
}) :
|
|
1116
|
-
}),
|
|
1136
|
+
refs: d,
|
|
1137
|
+
t: a
|
|
1138
|
+
}) : a("record.related.card_title", "Record {number}", { number: t + 1 })
|
|
1139
|
+
}), h && e[h] != null && /* @__PURE__ */ Y(D, {
|
|
1117
1140
|
tone: "slate",
|
|
1118
1141
|
size: "xs",
|
|
1119
|
-
children: i.fields.get(
|
|
1120
|
-
field: i.fields.get(
|
|
1121
|
-
fieldName:
|
|
1122
|
-
value: e[
|
|
1142
|
+
children: i.fields.get(h) ? k({
|
|
1143
|
+
field: i.fields.get(h),
|
|
1144
|
+
fieldName: h,
|
|
1145
|
+
value: e[h],
|
|
1123
1146
|
mode: "display",
|
|
1124
1147
|
record: e,
|
|
1125
|
-
refs:
|
|
1126
|
-
t:
|
|
1127
|
-
}) :
|
|
1148
|
+
refs: d,
|
|
1149
|
+
t: a
|
|
1150
|
+
}) : b(e[h])
|
|
1128
1151
|
})]
|
|
1129
|
-
}),
|
|
1152
|
+
}), S.length > 0 && /* @__PURE__ */ Y("div", {
|
|
1130
1153
|
style: {
|
|
1131
1154
|
padding: "10px 14px",
|
|
1132
1155
|
display: "flex",
|
|
1133
1156
|
flexDirection: "column",
|
|
1134
1157
|
gap: 4
|
|
1135
1158
|
},
|
|
1136
|
-
children:
|
|
1159
|
+
children: S.slice(0, 4).map((t) => {
|
|
1137
1160
|
let n = i.fields.get(t);
|
|
1138
1161
|
return n ? /* @__PURE__ */ X("div", {
|
|
1139
1162
|
style: {
|
|
@@ -1147,59 +1170,59 @@ function rt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1147
1170
|
color: "var(--text-3)",
|
|
1148
1171
|
flexShrink: 0
|
|
1149
1172
|
},
|
|
1150
|
-
children: [a
|
|
1173
|
+
children: [_(a, n, t, r.entities), ":"]
|
|
1151
1174
|
}), /* @__PURE__ */ Y("span", {
|
|
1152
1175
|
style: {
|
|
1153
1176
|
overflow: "hidden",
|
|
1154
1177
|
textOverflow: "ellipsis",
|
|
1155
1178
|
whiteSpace: "nowrap"
|
|
1156
1179
|
},
|
|
1157
|
-
children:
|
|
1180
|
+
children: k({
|
|
1158
1181
|
field: n,
|
|
1159
1182
|
fieldName: t,
|
|
1160
1183
|
value: e[t],
|
|
1161
1184
|
mode: "display",
|
|
1162
1185
|
record: e,
|
|
1163
|
-
refs:
|
|
1164
|
-
t:
|
|
1186
|
+
refs: d,
|
|
1187
|
+
t: a
|
|
1165
1188
|
})
|
|
1166
1189
|
})]
|
|
1167
1190
|
}, t) : null;
|
|
1168
1191
|
})
|
|
1169
1192
|
})]
|
|
1170
|
-
},
|
|
1193
|
+
}, b(e.id ?? t)))
|
|
1171
1194
|
})] });
|
|
1172
1195
|
}
|
|
1173
1196
|
//#endregion
|
|
1174
1197
|
//#region src/hooks/useTimelineData.ts
|
|
1175
|
-
var
|
|
1176
|
-
function
|
|
1177
|
-
let s = Array.isArray(
|
|
1198
|
+
var st = 50;
|
|
1199
|
+
function ct(e, n, r, i, a, o) {
|
|
1200
|
+
let s = Array.isArray(i) ? i : [i], c = Array.isArray(i) ? d(n, s.length) : [n], l = o ?? st, u = Se({
|
|
1178
1201
|
queryKey: [
|
|
1179
|
-
|
|
1202
|
+
te,
|
|
1180
1203
|
e,
|
|
1181
|
-
t,
|
|
1182
1204
|
n,
|
|
1205
|
+
r,
|
|
1183
1206
|
"timeline",
|
|
1184
1207
|
a,
|
|
1185
1208
|
l
|
|
1186
1209
|
],
|
|
1187
1210
|
queryFn: ({ pageParam: e }) => {
|
|
1188
|
-
let
|
|
1211
|
+
let n = new URLSearchParams();
|
|
1189
1212
|
if (!c) throw Error("invalid composite parent id");
|
|
1190
|
-
let
|
|
1213
|
+
let i = s.map((e, t) => ({
|
|
1191
1214
|
field: e,
|
|
1192
1215
|
op: "eq",
|
|
1193
1216
|
value: c[t]
|
|
1194
1217
|
}));
|
|
1195
|
-
return
|
|
1218
|
+
return n.set("filters", JSON.stringify(i)), a ? n.set("sort", `${a}:desc`) : typeof console < "u" && console.warn(`[useTimelineData] no time_field for ${r}; fetch order falls back to API default`), n.set("limit", String(l)), e && n.set("after", e), t(`/api/data/${r}?${n.toString()}`);
|
|
1196
1219
|
},
|
|
1197
1220
|
getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
|
|
1198
1221
|
initialPageParam: void 0,
|
|
1199
|
-
enabled: !!e && !!
|
|
1222
|
+
enabled: !!e && !!n && !!r && !!i && c !== null
|
|
1200
1223
|
});
|
|
1201
1224
|
return {
|
|
1202
|
-
rows:
|
|
1225
|
+
rows: xe(() => u.data?.pages.flatMap((e) => e.data) ?? [], [u.data?.pages]),
|
|
1203
1226
|
refs: u.data?.pages[0]?.$refs,
|
|
1204
1227
|
fetchNextPage: u.fetchNextPage,
|
|
1205
1228
|
hasOlder: !!u.hasNextPage,
|
|
@@ -1210,15 +1233,15 @@ function at(e, t, n, r, a, o) {
|
|
|
1210
1233
|
}
|
|
1211
1234
|
//#endregion
|
|
1212
1235
|
//#region src/components/detail-layout/TimelineComposer.tsx
|
|
1213
|
-
var
|
|
1214
|
-
function
|
|
1215
|
-
let { values:
|
|
1236
|
+
var lt = "quick_entry", ut = 100, dt = 240, ft = 800, pt = 80;
|
|
1237
|
+
function mt({ config: e, parentEntity: t, parentId: i, schema: a }) {
|
|
1238
|
+
let { values: o, quickAdd: s, childEntity: c, isPending: l, error: u, isReady: d, handleSubmit: f, handleFieldChange: p } = Qe(e, t, i, a), m = x(), h = x("errors"), [g, _] = q(dt), v = K(null), y = K(null), [b, S] = q(ft);
|
|
1216
1239
|
G(() => {
|
|
1217
1240
|
let e = y.current?.parentElement;
|
|
1218
1241
|
if (!e) return;
|
|
1219
1242
|
let t = () => {
|
|
1220
|
-
let t = Math.max(
|
|
1221
|
-
|
|
1243
|
+
let t = Math.max(ut, e.clientHeight - pt);
|
|
1244
|
+
S(Math.min(ft, t));
|
|
1222
1245
|
};
|
|
1223
1246
|
t();
|
|
1224
1247
|
let n = new ResizeObserver(t);
|
|
@@ -1226,58 +1249,58 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1226
1249
|
}, []), G(() => {
|
|
1227
1250
|
_((e) => Math.min(e, b));
|
|
1228
1251
|
}, [b]);
|
|
1229
|
-
let
|
|
1230
|
-
|
|
1231
|
-
let
|
|
1232
|
-
|
|
1233
|
-
let
|
|
1234
|
-
getField: (e) =>
|
|
1252
|
+
let C = K(o);
|
|
1253
|
+
C.current = o;
|
|
1254
|
+
let T = K(p);
|
|
1255
|
+
T.current = p;
|
|
1256
|
+
let D = K({}), O = xe(() => ({
|
|
1257
|
+
getField: (e) => C.current[e],
|
|
1235
1258
|
setField: (e, t) => {
|
|
1236
|
-
|
|
1259
|
+
T.current(e, t);
|
|
1237
1260
|
},
|
|
1238
1261
|
focusField: (e) => {
|
|
1239
|
-
let t =
|
|
1262
|
+
let t = D.current[e];
|
|
1240
1263
|
t && (t.querySelector("textarea, input, select, [contenteditable]") ?? t).focus();
|
|
1241
1264
|
}
|
|
1242
1265
|
}), []);
|
|
1243
|
-
G(() =>
|
|
1244
|
-
let
|
|
1266
|
+
G(() => N(lt, O), [O]);
|
|
1267
|
+
let A = W((e) => {
|
|
1245
1268
|
e.preventDefault(), v.current = {
|
|
1246
1269
|
startY: e.clientY,
|
|
1247
1270
|
startHeight: g
|
|
1248
1271
|
};
|
|
1249
1272
|
let t = (e) => {
|
|
1250
1273
|
if (!v.current) return;
|
|
1251
|
-
let t = v.current.startY - e.clientY, n = Math.min(b, Math.max(
|
|
1274
|
+
let t = v.current.startY - e.clientY, n = Math.min(b, Math.max(ut, v.current.startHeight + t));
|
|
1252
1275
|
_(n);
|
|
1253
1276
|
}, n = () => {
|
|
1254
1277
|
v.current = null, document.removeEventListener("mousemove", t), document.removeEventListener("mouseup", n);
|
|
1255
1278
|
};
|
|
1256
1279
|
document.addEventListener("mousemove", t), document.addEventListener("mouseup", n);
|
|
1257
1280
|
}, [g, b]);
|
|
1258
|
-
if (!
|
|
1259
|
-
let
|
|
1260
|
-
let t =
|
|
1281
|
+
if (!s || s.fields.length === 0 || !c) return null;
|
|
1282
|
+
let j = s.fields.find((e) => {
|
|
1283
|
+
let t = c.fields.get(e);
|
|
1261
1284
|
return t && (t.type === "text" || t.type === "string");
|
|
1262
|
-
}),
|
|
1263
|
-
for (let e of
|
|
1264
|
-
if (e ===
|
|
1265
|
-
let t =
|
|
1266
|
-
t && (t.type === "enum" ?
|
|
1285
|
+
}), M = [], P = [];
|
|
1286
|
+
for (let e of s.fields) {
|
|
1287
|
+
if (e === j) continue;
|
|
1288
|
+
let t = c.fields.get(e);
|
|
1289
|
+
t && (t.type === "enum" ? M.push(e) : P.push(e));
|
|
1267
1290
|
}
|
|
1268
|
-
let
|
|
1269
|
-
let t =
|
|
1291
|
+
let F = (e) => {
|
|
1292
|
+
let t = c.fields.get(e);
|
|
1270
1293
|
return t ? /* @__PURE__ */ Y("div", {
|
|
1271
1294
|
ref: (t) => {
|
|
1272
|
-
|
|
1295
|
+
D.current[e] = t;
|
|
1273
1296
|
},
|
|
1274
|
-
children:
|
|
1297
|
+
children: k({
|
|
1275
1298
|
field: t,
|
|
1276
1299
|
fieldName: e,
|
|
1277
|
-
value:
|
|
1300
|
+
value: o[e] ?? "",
|
|
1278
1301
|
mode: "edit",
|
|
1279
1302
|
onChange: (t) => p(e, t),
|
|
1280
|
-
record:
|
|
1303
|
+
record: o,
|
|
1281
1304
|
t: m
|
|
1282
1305
|
})
|
|
1283
1306
|
}, e) : null;
|
|
@@ -1293,7 +1316,7 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1293
1316
|
height: `${g}px`
|
|
1294
1317
|
},
|
|
1295
1318
|
children: [/* @__PURE__ */ Y("div", {
|
|
1296
|
-
onMouseDown:
|
|
1319
|
+
onMouseDown: A,
|
|
1297
1320
|
title: m("record.layout.drag_to_resize", "Drag to resize"),
|
|
1298
1321
|
style: {
|
|
1299
1322
|
height: 12,
|
|
@@ -1323,7 +1346,7 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1323
1346
|
padding: "0 12px 8px"
|
|
1324
1347
|
},
|
|
1325
1348
|
children: [
|
|
1326
|
-
|
|
1349
|
+
M.length > 0 && /* @__PURE__ */ Y("div", {
|
|
1327
1350
|
style: {
|
|
1328
1351
|
display: "flex",
|
|
1329
1352
|
flexWrap: "wrap",
|
|
@@ -1331,24 +1354,24 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1331
1354
|
gap: 6,
|
|
1332
1355
|
flexShrink: 0
|
|
1333
1356
|
},
|
|
1334
|
-
children:
|
|
1357
|
+
children: M.map(F)
|
|
1335
1358
|
}),
|
|
1336
|
-
|
|
1359
|
+
j && c.fields.get(j) && /* @__PURE__ */ Y("div", {
|
|
1337
1360
|
style: {
|
|
1338
1361
|
flex: 1,
|
|
1339
1362
|
minHeight: 0,
|
|
1340
1363
|
display: "flex"
|
|
1341
1364
|
},
|
|
1342
1365
|
ref: (e) => {
|
|
1343
|
-
|
|
1366
|
+
D.current[j] = e;
|
|
1344
1367
|
},
|
|
1345
|
-
children:
|
|
1346
|
-
field:
|
|
1347
|
-
fieldName:
|
|
1348
|
-
value:
|
|
1368
|
+
children: k({
|
|
1369
|
+
field: c.fields.get(j),
|
|
1370
|
+
fieldName: j,
|
|
1371
|
+
value: o[j] ?? "",
|
|
1349
1372
|
mode: "edit",
|
|
1350
|
-
onChange: (e) => p(
|
|
1351
|
-
record:
|
|
1373
|
+
onChange: (e) => p(j, e),
|
|
1374
|
+
record: o,
|
|
1352
1375
|
fill: !0,
|
|
1353
1376
|
t: m
|
|
1354
1377
|
})
|
|
@@ -1361,7 +1384,7 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1361
1384
|
gap: 6,
|
|
1362
1385
|
flexShrink: 0
|
|
1363
1386
|
},
|
|
1364
|
-
children: [
|
|
1387
|
+
children: [P.map(F), /* @__PURE__ */ X("div", {
|
|
1365
1388
|
style: {
|
|
1366
1389
|
marginLeft: "auto",
|
|
1367
1390
|
display: "flex",
|
|
@@ -1373,18 +1396,18 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1373
1396
|
fontSize: 10.5,
|
|
1374
1397
|
color: "var(--text-4)"
|
|
1375
1398
|
},
|
|
1376
|
-
children:
|
|
1399
|
+
children: n(m("record.related.shortcut_to_add", "{keys} to add"), { keys: /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y("span", {
|
|
1377
1400
|
className: "mono",
|
|
1378
1401
|
children: "⌘"
|
|
1379
1402
|
}), /* @__PURE__ */ Y("span", {
|
|
1380
1403
|
className: "mono",
|
|
1381
1404
|
children: "↵"
|
|
1382
1405
|
})] }) })
|
|
1383
|
-
}), /* @__PURE__ */ Y(
|
|
1406
|
+
}), /* @__PURE__ */ Y(E, {
|
|
1384
1407
|
type: "submit",
|
|
1385
1408
|
kind: "primary",
|
|
1386
|
-
icon: /* @__PURE__ */ Y(
|
|
1387
|
-
disabled:
|
|
1409
|
+
icon: /* @__PURE__ */ Y(w.plus, { size: 13 }),
|
|
1410
|
+
disabled: l || !d,
|
|
1388
1411
|
children: m("record.related.add", "Add")
|
|
1389
1412
|
})]
|
|
1390
1413
|
})]
|
|
@@ -1396,7 +1419,7 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1396
1419
|
margin: 0,
|
|
1397
1420
|
flexShrink: 0
|
|
1398
1421
|
},
|
|
1399
|
-
children:
|
|
1422
|
+
children: r(h, u)
|
|
1400
1423
|
})
|
|
1401
1424
|
]
|
|
1402
1425
|
})]
|
|
@@ -1404,72 +1427,72 @@ function dt({ config: t, parentEntity: n, parentId: r, schema: i }) {
|
|
|
1404
1427
|
}
|
|
1405
1428
|
//#endregion
|
|
1406
1429
|
//#region src/components/detail-layout/ChildrenTimeline.tsx
|
|
1407
|
-
var
|
|
1408
|
-
function
|
|
1409
|
-
if (e.length >
|
|
1430
|
+
var ht = 80, gt = 200, _t = 6, vt = 2e4, yt = 280;
|
|
1431
|
+
function bt(e) {
|
|
1432
|
+
if (e.length > yt) return !0;
|
|
1410
1433
|
let t = 0;
|
|
1411
|
-
for (let n of e) if (n === "\n" && ++t >=
|
|
1434
|
+
for (let n of e) if (n === "\n" && ++t >= _t) return !0;
|
|
1412
1435
|
return !1;
|
|
1413
1436
|
}
|
|
1414
|
-
function
|
|
1415
|
-
if (
|
|
1437
|
+
function xt(e, t) {
|
|
1438
|
+
if (St(t)) {
|
|
1416
1439
|
let e = t.id;
|
|
1417
|
-
return e == null ? "" :
|
|
1440
|
+
return e == null ? "" : b(e);
|
|
1418
1441
|
}
|
|
1419
|
-
return
|
|
1442
|
+
return l(o(e, t));
|
|
1420
1443
|
}
|
|
1421
|
-
function
|
|
1444
|
+
function St(e) {
|
|
1422
1445
|
return e.__optimistic === !0;
|
|
1423
1446
|
}
|
|
1424
|
-
function
|
|
1425
|
-
let i =
|
|
1447
|
+
function Ct({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
1448
|
+
let i = x(), a = x("errors"), o = r.entities[e.entity], { rows: s, refs: c, fetchNextPage: l, hasOlder: u, isFetchingOlder: d, isLoading: f, isError: p } = ct(t, n, e.entity, e.foreign_key, e.timeline?.time_field, e.limit), m = e.timeline, h = m?.scroll ?? !1, g = (e.sort ?? "").endsWith(":asc"), _ = xe(() => g ? [...s].reverse() : s, [s, g]), v = m?.auto_scroll ?? "none", y = K(null), b = K(null), S = K(!1), C = K(0), w = K(null), T = K(null), D = K(!0), k = K(null);
|
|
1426
1449
|
G(() => {
|
|
1427
|
-
|
|
1428
|
-
}, [n]),
|
|
1429
|
-
|
|
1430
|
-
scrollHeight:
|
|
1431
|
-
scrollTop:
|
|
1450
|
+
S.current = !1, C.current = 0, w.current = null, T.current = null, D.current = !0, k.current = null;
|
|
1451
|
+
}, [n]), be(() => {
|
|
1452
|
+
d && y.current && (k.current = {
|
|
1453
|
+
scrollHeight: y.current.scrollHeight,
|
|
1454
|
+
scrollTop: y.current.scrollTop
|
|
1432
1455
|
});
|
|
1433
|
-
}, [
|
|
1434
|
-
let e =
|
|
1435
|
-
if (!e ||
|
|
1436
|
-
|
|
1456
|
+
}, [d]), be(() => {
|
|
1457
|
+
let e = y.current;
|
|
1458
|
+
if (!e || _.length === 0 || !o) {
|
|
1459
|
+
C.current = _.length;
|
|
1437
1460
|
return;
|
|
1438
1461
|
}
|
|
1439
|
-
let t =
|
|
1440
|
-
if (r)
|
|
1441
|
-
else if (a &&
|
|
1442
|
-
let t =
|
|
1443
|
-
|
|
1444
|
-
} else s &&
|
|
1445
|
-
|
|
1462
|
+
let t = xt(o, _[0]), n = xt(o, _[_.length - 1]), r = !S.current, i = _.length > C.current && C.current > 0, a = i && (g && t !== w.current && n === T.current || !g && n !== T.current && t === w.current), s = i && !a;
|
|
1463
|
+
if (r) g && v === "bottom" && (e.scrollTop = e.scrollHeight), S.current = !0;
|
|
1464
|
+
else if (a && k.current) {
|
|
1465
|
+
let t = k.current;
|
|
1466
|
+
g && (e.scrollTop = t.scrollTop + (e.scrollHeight - t.scrollHeight)), k.current = null;
|
|
1467
|
+
} else s && g && D.current && (e.scrollTop = e.scrollHeight);
|
|
1468
|
+
C.current = _.length, w.current = t, T.current = n;
|
|
1446
1469
|
}, [
|
|
1447
|
-
y,
|
|
1448
|
-
b,
|
|
1449
1470
|
_,
|
|
1471
|
+
v,
|
|
1472
|
+
g,
|
|
1450
1473
|
o
|
|
1451
1474
|
]);
|
|
1452
|
-
let
|
|
1453
|
-
let e =
|
|
1454
|
-
e && (D.current = e.scrollHeight - e.scrollTop - e.clientHeight <
|
|
1475
|
+
let A = W(() => {
|
|
1476
|
+
let e = y.current;
|
|
1477
|
+
e && (D.current = e.scrollHeight - e.scrollTop - e.clientHeight < ht);
|
|
1455
1478
|
}, []);
|
|
1456
1479
|
G(() => {
|
|
1457
|
-
let e =
|
|
1480
|
+
let e = b.current;
|
|
1458
1481
|
if (!e || typeof IntersectionObserver > "u") return;
|
|
1459
1482
|
let t = new IntersectionObserver((e) => {
|
|
1460
|
-
for (let t of e) t.isIntersecting &&
|
|
1483
|
+
for (let t of e) t.isIntersecting && u && !d && l();
|
|
1461
1484
|
}, {
|
|
1462
|
-
root:
|
|
1463
|
-
rootMargin: `${
|
|
1485
|
+
root: y.current ?? null,
|
|
1486
|
+
rootMargin: `${gt}px 0px 0px 0px`,
|
|
1464
1487
|
threshold: 0
|
|
1465
1488
|
});
|
|
1466
1489
|
return t.observe(e), () => t.disconnect();
|
|
1467
1490
|
}, [
|
|
1491
|
+
u,
|
|
1468
1492
|
d,
|
|
1469
|
-
|
|
1470
|
-
u
|
|
1493
|
+
l
|
|
1471
1494
|
]);
|
|
1472
|
-
let [
|
|
1495
|
+
let [j, M] = q(null);
|
|
1473
1496
|
if (!o) return /* @__PURE__ */ Y("div", {
|
|
1474
1497
|
style: {
|
|
1475
1498
|
fontSize: 12.5,
|
|
@@ -1478,25 +1501,25 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1478
1501
|
},
|
|
1479
1502
|
children: a("record.related_entity_not_found", "The related record type is not declared in this deployment.")
|
|
1480
1503
|
});
|
|
1481
|
-
let N = e.quick_add?.fields ?? [
|
|
1504
|
+
let N = e.quick_add?.fields ?? [m?.content_field].filter(Boolean), P = i(o.display?.name_plural) || i(o.display?.name) || e.entity, F = u ? /* @__PURE__ */ Y("div", {
|
|
1482
1505
|
style: {
|
|
1483
1506
|
display: "flex",
|
|
1484
1507
|
justifyContent: "center",
|
|
1485
1508
|
padding: "6px 0"
|
|
1486
1509
|
},
|
|
1487
|
-
children: /* @__PURE__ */ Y(
|
|
1510
|
+
children: /* @__PURE__ */ Y(E, {
|
|
1488
1511
|
size: "xs",
|
|
1489
|
-
onClick: () =>
|
|
1490
|
-
disabled:
|
|
1491
|
-
icon:
|
|
1492
|
-
children:
|
|
1512
|
+
onClick: () => l(),
|
|
1513
|
+
disabled: d,
|
|
1514
|
+
icon: d ? /* @__PURE__ */ Y(O, { size: 11 }) : void 0,
|
|
1515
|
+
children: d ? i("record.loading", "Loading…") : i("record.timeline.load_older", "Load older")
|
|
1493
1516
|
})
|
|
1494
1517
|
}) : null, I = /* @__PURE__ */ Y("div", {
|
|
1495
|
-
ref:
|
|
1518
|
+
ref: b,
|
|
1496
1519
|
"aria-hidden": "true",
|
|
1497
1520
|
style: { height: 1 }
|
|
1498
1521
|
}), L;
|
|
1499
|
-
if (
|
|
1522
|
+
if (p) L = /* @__PURE__ */ Y("div", {
|
|
1500
1523
|
style: {
|
|
1501
1524
|
fontSize: 12.5,
|
|
1502
1525
|
color: "var(--danger)",
|
|
@@ -1504,7 +1527,7 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1504
1527
|
},
|
|
1505
1528
|
children: a("record.related_rows_unreadable", "The related records could not be loaded.")
|
|
1506
1529
|
});
|
|
1507
|
-
else if (
|
|
1530
|
+
else if (f) L = /* @__PURE__ */ X("div", {
|
|
1508
1531
|
style: {
|
|
1509
1532
|
display: "flex",
|
|
1510
1533
|
flexDirection: "column",
|
|
@@ -1521,7 +1544,7 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1521
1544
|
borderRadius: 8
|
|
1522
1545
|
} })]
|
|
1523
1546
|
});
|
|
1524
|
-
else if (
|
|
1547
|
+
else if (_.length === 0) L = /* @__PURE__ */ X(J, { children: [I, /* @__PURE__ */ Y("div", {
|
|
1525
1548
|
style: {
|
|
1526
1549
|
fontSize: 12.5,
|
|
1527
1550
|
color: "var(--text-3)",
|
|
@@ -1531,32 +1554,32 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1531
1554
|
})] });
|
|
1532
1555
|
else {
|
|
1533
1556
|
let a = (i, a) => {
|
|
1534
|
-
let s =
|
|
1535
|
-
return /* @__PURE__ */ Y(
|
|
1557
|
+
let s = xt(o, i) || String(a);
|
|
1558
|
+
return /* @__PURE__ */ Y(wt, {
|
|
1536
1559
|
row: i,
|
|
1537
1560
|
rowId: s,
|
|
1538
1561
|
childEntity: o,
|
|
1539
1562
|
entityCode: e.entity,
|
|
1540
1563
|
parentEntity: t,
|
|
1541
1564
|
parentId: n,
|
|
1542
|
-
timeline:
|
|
1565
|
+
timeline: m,
|
|
1543
1566
|
editableFields: N,
|
|
1544
1567
|
refs: c,
|
|
1545
|
-
isEditing:
|
|
1546
|
-
onStartEdit: () =>
|
|
1547
|
-
onCancelEdit: () =>
|
|
1548
|
-
onSaved: () =>
|
|
1568
|
+
isEditing: j === s,
|
|
1569
|
+
onStartEdit: () => M(s),
|
|
1570
|
+
onCancelEdit: () => M(null),
|
|
1571
|
+
onSaved: () => M(null),
|
|
1549
1572
|
schema: r,
|
|
1550
|
-
optimistic:
|
|
1573
|
+
optimistic: St(i)
|
|
1551
1574
|
}, s);
|
|
1552
|
-
}, s =
|
|
1575
|
+
}, s = m?.time_field, l;
|
|
1553
1576
|
if (s) {
|
|
1554
1577
|
let e = [];
|
|
1555
|
-
|
|
1556
|
-
let r = t[s], a =
|
|
1578
|
+
_.forEach((t, n) => {
|
|
1579
|
+
let r = t[s], a = Et(r), o = e[e.length - 1];
|
|
1557
1580
|
!o || o.key !== a ? e.push({
|
|
1558
1581
|
key: a,
|
|
1559
|
-
label:
|
|
1582
|
+
label: Dt(i, r),
|
|
1560
1583
|
rows: [{
|
|
1561
1584
|
row: t,
|
|
1562
1585
|
idx: n
|
|
@@ -1571,19 +1594,19 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1571
1594
|
flexDirection: "column",
|
|
1572
1595
|
gap: 8
|
|
1573
1596
|
},
|
|
1574
|
-
children: [/* @__PURE__ */ Y(
|
|
1597
|
+
children: [/* @__PURE__ */ Y(Ot, {
|
|
1575
1598
|
label: e.label,
|
|
1576
1599
|
count: e.rows.length
|
|
1577
1600
|
}), e.rows.map(({ row: e, idx: t }) => a(e, t))]
|
|
1578
1601
|
}, `day-${e.key}`));
|
|
1579
|
-
} else l =
|
|
1602
|
+
} else l = _.map((e, t) => a(e, t));
|
|
1580
1603
|
L = /* @__PURE__ */ X(J, { children: [
|
|
1581
1604
|
I,
|
|
1582
1605
|
F,
|
|
1583
1606
|
l
|
|
1584
1607
|
] });
|
|
1585
1608
|
}
|
|
1586
|
-
return
|
|
1609
|
+
return h ? /* @__PURE__ */ X("div", {
|
|
1587
1610
|
style: {
|
|
1588
1611
|
display: "flex",
|
|
1589
1612
|
flexDirection: "column",
|
|
@@ -1609,8 +1632,8 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1609
1632
|
})
|
|
1610
1633
|
}),
|
|
1611
1634
|
/* @__PURE__ */ Y("div", {
|
|
1612
|
-
ref:
|
|
1613
|
-
onScroll:
|
|
1635
|
+
ref: y,
|
|
1636
|
+
onScroll: A,
|
|
1614
1637
|
style: {
|
|
1615
1638
|
flex: 1,
|
|
1616
1639
|
overflowY: "auto",
|
|
@@ -1621,7 +1644,7 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1621
1644
|
},
|
|
1622
1645
|
children: L
|
|
1623
1646
|
}),
|
|
1624
|
-
/* @__PURE__ */ Y(
|
|
1647
|
+
/* @__PURE__ */ Y(mt, {
|
|
1625
1648
|
config: e,
|
|
1626
1649
|
parentEntity: t,
|
|
1627
1650
|
parentId: n,
|
|
@@ -1635,59 +1658,59 @@ function bt({ config: e, parentEntity: t, parentId: n, schema: r }) {
|
|
|
1635
1658
|
gap: 8
|
|
1636
1659
|
},
|
|
1637
1660
|
children: L
|
|
1638
|
-
}), /* @__PURE__ */ Y(
|
|
1661
|
+
}), /* @__PURE__ */ Y(mt, {
|
|
1639
1662
|
config: e,
|
|
1640
1663
|
parentEntity: t,
|
|
1641
1664
|
parentId: n,
|
|
1642
1665
|
schema: r
|
|
1643
1666
|
})] });
|
|
1644
1667
|
}
|
|
1645
|
-
function
|
|
1646
|
-
let S =
|
|
1647
|
-
|
|
1648
|
-
|
|
1668
|
+
function wt({ row: e, rowId: t, childEntity: i, entityCode: o, parentEntity: s, parentId: c, timeline: l, editableFields: u, refs: d, isEditing: f, onStartEdit: p, onCancelEdit: m, onSaved: h, schema: g, optimistic: v = !1 }) {
|
|
1669
|
+
let S = x(), A = x("errors"), j = we(), [M, N] = q({}), P = W(() => {
|
|
1670
|
+
j.invalidateQueries({ queryKey: [
|
|
1671
|
+
te,
|
|
1649
1672
|
s,
|
|
1650
1673
|
c,
|
|
1651
1674
|
o
|
|
1652
1675
|
] });
|
|
1653
1676
|
}, [
|
|
1654
|
-
|
|
1677
|
+
j,
|
|
1655
1678
|
s,
|
|
1656
1679
|
c,
|
|
1657
1680
|
o
|
|
1658
|
-
]),
|
|
1659
|
-
mutationFn: (
|
|
1660
|
-
let r =
|
|
1661
|
-
...
|
|
1681
|
+
]), F = Ce({
|
|
1682
|
+
mutationFn: (n) => {
|
|
1683
|
+
let r = e.$row_version, i = typeof r == "string" && r !== "" ? {
|
|
1684
|
+
...n,
|
|
1662
1685
|
$row_version: r
|
|
1663
|
-
} :
|
|
1664
|
-
return
|
|
1686
|
+
} : n;
|
|
1687
|
+
return C(o, t, i);
|
|
1665
1688
|
},
|
|
1666
1689
|
onSuccess: () => {
|
|
1667
|
-
|
|
1690
|
+
P(), a.success(S("record.timeline.updated", "Updated")), h();
|
|
1668
1691
|
},
|
|
1669
|
-
onError: (e) =>
|
|
1670
|
-
}),
|
|
1671
|
-
mutationFn: () =>
|
|
1692
|
+
onError: (e) => a.error(r(A, e))
|
|
1693
|
+
}), I = Ce({
|
|
1694
|
+
mutationFn: () => y(o, t),
|
|
1672
1695
|
onSuccess: () => {
|
|
1673
|
-
|
|
1696
|
+
P(), a.success(S("record.timeline.deleted", "Deleted"));
|
|
1674
1697
|
},
|
|
1675
|
-
onError: (e) =>
|
|
1676
|
-
}),
|
|
1677
|
-
let
|
|
1678
|
-
for (let n of
|
|
1679
|
-
|
|
1698
|
+
onError: (e) => a.error(r(A, e))
|
|
1699
|
+
}), L = W(() => {
|
|
1700
|
+
let t = {};
|
|
1701
|
+
for (let n of u) t[n] = e[n] ?? "";
|
|
1702
|
+
N(t), p();
|
|
1680
1703
|
}, [
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
]),
|
|
1685
|
-
|
|
1704
|
+
e,
|
|
1705
|
+
u,
|
|
1706
|
+
p
|
|
1707
|
+
]), ee = W((e, t) => {
|
|
1708
|
+
N((n) => ({
|
|
1686
1709
|
...n,
|
|
1687
1710
|
[e]: t
|
|
1688
1711
|
}));
|
|
1689
|
-
}, []),
|
|
1690
|
-
return
|
|
1712
|
+
}, []), R = l?.time_field, z = l?.type_field, B = l?.summary_field, V = l?.content_field, H = l?.author_field, ne = l?.direction_field, U = l?.intent_field;
|
|
1713
|
+
return f ? /* @__PURE__ */ X("div", {
|
|
1691
1714
|
style: {
|
|
1692
1715
|
borderRadius: 10,
|
|
1693
1716
|
border: "1px solid var(--accent)",
|
|
@@ -1697,8 +1720,8 @@ function xt({ row: t, rowId: n, childEntity: r, entityCode: o, parentEntity: s,
|
|
|
1697
1720
|
flexDirection: "column",
|
|
1698
1721
|
gap: 8
|
|
1699
1722
|
},
|
|
1700
|
-
children: [
|
|
1701
|
-
let t =
|
|
1723
|
+
children: [u.map((e) => {
|
|
1724
|
+
let t = i.fields.get(e);
|
|
1702
1725
|
return t ? /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("label", {
|
|
1703
1726
|
style: {
|
|
1704
1727
|
fontSize: 11,
|
|
@@ -1706,14 +1729,14 @@ function xt({ row: t, rowId: n, childEntity: r, entityCode: o, parentEntity: s,
|
|
|
1706
1729
|
marginBottom: 4,
|
|
1707
1730
|
display: "block"
|
|
1708
1731
|
},
|
|
1709
|
-
children:
|
|
1710
|
-
}),
|
|
1732
|
+
children: _(S, t, e, g.entities)
|
|
1733
|
+
}), k({
|
|
1711
1734
|
field: t,
|
|
1712
1735
|
fieldName: e,
|
|
1713
|
-
value:
|
|
1736
|
+
value: M[e] ?? "",
|
|
1714
1737
|
mode: "edit",
|
|
1715
|
-
onChange: (t) =>
|
|
1716
|
-
record:
|
|
1738
|
+
onChange: (t) => ee(e, t),
|
|
1739
|
+
record: M,
|
|
1717
1740
|
t: S
|
|
1718
1741
|
})] }, e) : null;
|
|
1719
1742
|
}), /* @__PURE__ */ X("div", {
|
|
@@ -1723,33 +1746,33 @@ function xt({ row: t, rowId: n, childEntity: r, entityCode: o, parentEntity: s,
|
|
|
1723
1746
|
gap: 6,
|
|
1724
1747
|
paddingTop: 4
|
|
1725
1748
|
},
|
|
1726
|
-
children: [/* @__PURE__ */ Y(
|
|
1749
|
+
children: [/* @__PURE__ */ Y(E, {
|
|
1727
1750
|
kind: "primary",
|
|
1728
1751
|
size: "xs",
|
|
1729
|
-
icon:
|
|
1730
|
-
onClick: () =>
|
|
1731
|
-
disabled:
|
|
1732
|
-
children:
|
|
1733
|
-
}), /* @__PURE__ */ Y(
|
|
1752
|
+
icon: F.isPending ? /* @__PURE__ */ Y(O, { size: 12 }) : /* @__PURE__ */ Y(w.check, { size: 12 }),
|
|
1753
|
+
onClick: () => F.mutate(M),
|
|
1754
|
+
disabled: F.isPending,
|
|
1755
|
+
children: F.isPending ? S("dialog.saving", "Saving…") : S("dialog.save", "Save")
|
|
1756
|
+
}), /* @__PURE__ */ Y(E, {
|
|
1734
1757
|
size: "xs",
|
|
1735
|
-
icon: /* @__PURE__ */ Y(
|
|
1758
|
+
icon: /* @__PURE__ */ Y(w.x, { size: 12 }),
|
|
1736
1759
|
onClick: () => {
|
|
1737
|
-
|
|
1760
|
+
N({}), m();
|
|
1738
1761
|
},
|
|
1739
|
-
disabled:
|
|
1762
|
+
disabled: F.isPending,
|
|
1740
1763
|
children: S("dialog.cancel", "Cancel")
|
|
1741
1764
|
})]
|
|
1742
1765
|
})]
|
|
1743
1766
|
}) : /* @__PURE__ */ X("div", {
|
|
1744
1767
|
className: "group",
|
|
1745
|
-
"data-optimistic":
|
|
1768
|
+
"data-optimistic": v || void 0,
|
|
1746
1769
|
style: {
|
|
1747
1770
|
borderRadius: 10,
|
|
1748
1771
|
border: "1px solid var(--border)",
|
|
1749
1772
|
background: "var(--surface)",
|
|
1750
1773
|
padding: 12,
|
|
1751
1774
|
transition: "border-color .12s",
|
|
1752
|
-
opacity:
|
|
1775
|
+
opacity: v ? .6 : 1
|
|
1753
1776
|
},
|
|
1754
1777
|
onMouseEnter: (e) => e.currentTarget.style.borderColor = "var(--border-strong)",
|
|
1755
1778
|
onMouseLeave: (e) => e.currentTarget.style.borderColor = "var(--border)",
|
|
@@ -1764,131 +1787,131 @@ function xt({ row: t, rowId: n, childEntity: r, entityCode: o, parentEntity: s,
|
|
|
1764
1787
|
color: "var(--text-3)"
|
|
1765
1788
|
},
|
|
1766
1789
|
children: [
|
|
1767
|
-
|
|
1790
|
+
R && e[R] != null && i.fields.get(R) && /* @__PURE__ */ Y("span", {
|
|
1768
1791
|
style: { fontWeight: 500 },
|
|
1769
|
-
children:
|
|
1770
|
-
field:
|
|
1771
|
-
fieldName:
|
|
1772
|
-
value:
|
|
1792
|
+
children: k({
|
|
1793
|
+
field: i.fields.get(R),
|
|
1794
|
+
fieldName: R,
|
|
1795
|
+
value: e[R],
|
|
1773
1796
|
mode: "display",
|
|
1774
|
-
record:
|
|
1775
|
-
refs:
|
|
1797
|
+
record: e,
|
|
1798
|
+
refs: d,
|
|
1776
1799
|
t: S
|
|
1777
1800
|
})
|
|
1778
1801
|
}),
|
|
1779
|
-
|
|
1802
|
+
z && e[z] != null && i.fields.get(z) && /* @__PURE__ */ Y(D, {
|
|
1780
1803
|
tone: "slate",
|
|
1781
1804
|
size: "xs",
|
|
1782
|
-
children:
|
|
1783
|
-
field:
|
|
1784
|
-
fieldName:
|
|
1785
|
-
value:
|
|
1805
|
+
children: k({
|
|
1806
|
+
field: i.fields.get(z),
|
|
1807
|
+
fieldName: z,
|
|
1808
|
+
value: e[z],
|
|
1786
1809
|
mode: "display",
|
|
1787
|
-
record:
|
|
1788
|
-
refs:
|
|
1810
|
+
record: e,
|
|
1811
|
+
refs: d,
|
|
1789
1812
|
t: S
|
|
1790
1813
|
})
|
|
1791
1814
|
}),
|
|
1792
|
-
|
|
1793
|
-
value:
|
|
1794
|
-
field:
|
|
1815
|
+
ne && e[ne] != null && i.fields.get(ne) && /* @__PURE__ */ Y(kt, {
|
|
1816
|
+
value: e[ne],
|
|
1817
|
+
field: i.fields.get(ne)
|
|
1795
1818
|
}),
|
|
1796
|
-
U &&
|
|
1819
|
+
U && e[U] != null && i.fields.get(U) && /* @__PURE__ */ Y(D, {
|
|
1797
1820
|
tone: "slate",
|
|
1798
1821
|
size: "xs",
|
|
1799
|
-
children:
|
|
1800
|
-
field:
|
|
1822
|
+
children: k({
|
|
1823
|
+
field: i.fields.get(U),
|
|
1801
1824
|
fieldName: U,
|
|
1802
|
-
value:
|
|
1825
|
+
value: e[U],
|
|
1803
1826
|
mode: "display",
|
|
1804
|
-
record:
|
|
1805
|
-
refs:
|
|
1827
|
+
record: e,
|
|
1828
|
+
refs: d,
|
|
1806
1829
|
t: S
|
|
1807
1830
|
})
|
|
1808
1831
|
}),
|
|
1809
|
-
|
|
1810
|
-
field:
|
|
1811
|
-
fieldName:
|
|
1812
|
-
value:
|
|
1832
|
+
H && e[H] != null && i.fields.get(H) && /* @__PURE__ */ Y("span", { children: n(S("record.timeline.by_author", "by {author}"), { author: k({
|
|
1833
|
+
field: i.fields.get(H),
|
|
1834
|
+
fieldName: H,
|
|
1835
|
+
value: e[H],
|
|
1813
1836
|
mode: "display",
|
|
1814
|
-
record:
|
|
1815
|
-
refs:
|
|
1837
|
+
record: e,
|
|
1838
|
+
refs: d,
|
|
1816
1839
|
t: S
|
|
1817
1840
|
}) }) }),
|
|
1818
|
-
!
|
|
1841
|
+
!v && /* @__PURE__ */ X("div", {
|
|
1819
1842
|
style: {
|
|
1820
1843
|
marginLeft: "auto",
|
|
1821
1844
|
display: "flex",
|
|
1822
1845
|
alignItems: "center",
|
|
1823
1846
|
gap: 2
|
|
1824
1847
|
},
|
|
1825
|
-
children: [/* @__PURE__ */ Y(
|
|
1848
|
+
children: [/* @__PURE__ */ Y(T, {
|
|
1826
1849
|
size: 22,
|
|
1827
|
-
icon: /* @__PURE__ */ Y(
|
|
1828
|
-
onClick:
|
|
1850
|
+
icon: /* @__PURE__ */ Y(w.edit, { size: 11 }),
|
|
1851
|
+
onClick: L,
|
|
1829
1852
|
title: S("record.action.edit", "Edit")
|
|
1830
|
-
}), /* @__PURE__ */ Y(
|
|
1853
|
+
}), /* @__PURE__ */ Y(T, {
|
|
1831
1854
|
size: 22,
|
|
1832
|
-
icon: /* @__PURE__ */ Y(
|
|
1833
|
-
onClick: () =>
|
|
1855
|
+
icon: /* @__PURE__ */ Y(w.trash, { size: 11 }),
|
|
1856
|
+
onClick: () => I.mutate(),
|
|
1834
1857
|
title: S("record.action.delete", "Delete")
|
|
1835
1858
|
})]
|
|
1836
1859
|
})
|
|
1837
1860
|
]
|
|
1838
1861
|
}),
|
|
1839
|
-
|
|
1862
|
+
B && e[B] != null && i.fields.get(B) && /* @__PURE__ */ Y("div", {
|
|
1840
1863
|
style: {
|
|
1841
1864
|
fontSize: 12.5,
|
|
1842
1865
|
fontWeight: 500,
|
|
1843
1866
|
marginTop: 6
|
|
1844
1867
|
},
|
|
1845
|
-
children:
|
|
1846
|
-
field:
|
|
1847
|
-
fieldName:
|
|
1848
|
-
value:
|
|
1868
|
+
children: k({
|
|
1869
|
+
field: i.fields.get(B),
|
|
1870
|
+
fieldName: B,
|
|
1871
|
+
value: e[B],
|
|
1849
1872
|
mode: "display",
|
|
1850
|
-
record:
|
|
1851
|
-
refs:
|
|
1873
|
+
record: e,
|
|
1874
|
+
refs: d,
|
|
1852
1875
|
t: S
|
|
1853
1876
|
})
|
|
1854
1877
|
}),
|
|
1855
|
-
|
|
1856
|
-
rendered:
|
|
1857
|
-
field:
|
|
1858
|
-
fieldName:
|
|
1859
|
-
value:
|
|
1878
|
+
V && e[V] != null && V !== B && i.fields.get(V) && /* @__PURE__ */ Y(Tt, {
|
|
1879
|
+
rendered: k({
|
|
1880
|
+
field: i.fields.get(V),
|
|
1881
|
+
fieldName: V,
|
|
1882
|
+
value: e[V],
|
|
1860
1883
|
mode: "display",
|
|
1861
|
-
record:
|
|
1862
|
-
refs:
|
|
1884
|
+
record: e,
|
|
1885
|
+
refs: d,
|
|
1863
1886
|
t: S
|
|
1864
1887
|
}),
|
|
1865
|
-
text:
|
|
1888
|
+
text: b(e[V])
|
|
1866
1889
|
})
|
|
1867
1890
|
]
|
|
1868
1891
|
});
|
|
1869
1892
|
}
|
|
1870
|
-
function
|
|
1871
|
-
let n =
|
|
1893
|
+
function Tt({ rendered: e, text: t }) {
|
|
1894
|
+
let n = x(), r = {
|
|
1872
1895
|
fontSize: 12.5,
|
|
1873
1896
|
fontWeight: 400,
|
|
1874
1897
|
marginTop: 6
|
|
1875
1898
|
};
|
|
1876
|
-
if (!
|
|
1899
|
+
if (!bt(t)) return /* @__PURE__ */ Y("div", {
|
|
1877
1900
|
style: r,
|
|
1878
1901
|
children: e
|
|
1879
1902
|
});
|
|
1880
|
-
let i = t.length >
|
|
1903
|
+
let i = t.length > vt, a = i ? t.slice(0, vt) : t;
|
|
1881
1904
|
return /* @__PURE__ */ Y("div", {
|
|
1882
1905
|
style: {
|
|
1883
1906
|
...r,
|
|
1884
1907
|
display: "-webkit-box",
|
|
1885
1908
|
WebkitBoxOrient: "vertical",
|
|
1886
|
-
WebkitLineClamp:
|
|
1909
|
+
WebkitLineClamp: _t,
|
|
1887
1910
|
overflow: "hidden",
|
|
1888
1911
|
whiteSpace: "pre-wrap",
|
|
1889
1912
|
overflowWrap: "anywhere"
|
|
1890
1913
|
},
|
|
1891
|
-
children: /* @__PURE__ */ Y(
|
|
1914
|
+
children: /* @__PURE__ */ Y(M, {
|
|
1892
1915
|
width: 380,
|
|
1893
1916
|
content: /* @__PURE__ */ X("div", {
|
|
1894
1917
|
style: {
|
|
@@ -1909,14 +1932,14 @@ function St({ rendered: e, text: t }) {
|
|
|
1909
1932
|
})
|
|
1910
1933
|
});
|
|
1911
1934
|
}
|
|
1912
|
-
function
|
|
1935
|
+
function Et(e) {
|
|
1913
1936
|
if (e == null) return "";
|
|
1914
|
-
let t = new Date(
|
|
1937
|
+
let t = new Date(b(e));
|
|
1915
1938
|
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${t.getMonth()}-${t.getDate()}`;
|
|
1916
1939
|
}
|
|
1917
|
-
function
|
|
1940
|
+
function Dt(e, t) {
|
|
1918
1941
|
if (t == null) return "—";
|
|
1919
|
-
let n = new Date(
|
|
1942
|
+
let n = new Date(b(t));
|
|
1920
1943
|
if (Number.isNaN(n.getTime())) return "—";
|
|
1921
1944
|
let r = /* @__PURE__ */ new Date(), i = /* @__PURE__ */ new Date();
|
|
1922
1945
|
i.setDate(r.getDate() - 1);
|
|
@@ -1927,7 +1950,7 @@ function wt(e, t) {
|
|
|
1927
1950
|
day: "numeric"
|
|
1928
1951
|
});
|
|
1929
1952
|
}
|
|
1930
|
-
function
|
|
1953
|
+
function Ot({ label: e, count: t }) {
|
|
1931
1954
|
return /* @__PURE__ */ X("div", {
|
|
1932
1955
|
style: {
|
|
1933
1956
|
position: "sticky",
|
|
@@ -1964,9 +1987,9 @@ function Tt({ label: e, count: t }) {
|
|
|
1964
1987
|
]
|
|
1965
1988
|
});
|
|
1966
1989
|
}
|
|
1967
|
-
function
|
|
1968
|
-
let
|
|
1969
|
-
return
|
|
1990
|
+
function kt({ value: e, field: t }) {
|
|
1991
|
+
let n = x(), r = At(e, t);
|
|
1992
|
+
return r === null ? null : /* @__PURE__ */ X("span", {
|
|
1970
1993
|
style: {
|
|
1971
1994
|
display: "inline-flex",
|
|
1972
1995
|
alignItems: "center",
|
|
@@ -1975,13 +1998,13 @@ function Et({ value: t, field: n }) {
|
|
|
1975
1998
|
borderRadius: 999,
|
|
1976
1999
|
fontSize: 10.5,
|
|
1977
2000
|
fontWeight: 600,
|
|
1978
|
-
background:
|
|
1979
|
-
color:
|
|
2001
|
+
background: r ? "var(--accent-soft)" : "var(--info-soft)",
|
|
2002
|
+
color: r ? "var(--accent)" : "var(--info)"
|
|
1980
2003
|
},
|
|
1981
|
-
children: [Y(
|
|
2004
|
+
children: [Y(r ? w.arrowUp : w.arrowDown, { size: 10 }), r ? n("record.timeline.outbound", "Out") : n("record.timeline.inbound", "In")]
|
|
1982
2005
|
});
|
|
1983
2006
|
}
|
|
1984
|
-
function
|
|
2007
|
+
function At(e, t) {
|
|
1985
2008
|
if (t.type === "bool") return e === !0;
|
|
1986
2009
|
if (typeof e == "string") {
|
|
1987
2010
|
let t = e.toLowerCase();
|
|
@@ -1992,70 +2015,70 @@ function Dt(e, t) {
|
|
|
1992
2015
|
}
|
|
1993
2016
|
//#endregion
|
|
1994
2017
|
//#region src/components/detail-layout/EditableChildrenTable.tsx
|
|
1995
|
-
function
|
|
1996
|
-
let
|
|
1997
|
-
if (
|
|
1998
|
-
let r =
|
|
2018
|
+
function jt({ config: e, childEntity: t, schema: n, rows: r, onChange: i, validationErrors: a, refs: o, forceTablePresentation: s = !1 }) {
|
|
2019
|
+
let c = x(), l = S(), u = K(null), d = e.columns, f = e.position_field, p = new Set(Array.isArray(e.foreign_key) ? e.foreign_key : [e.foreign_key]), m = d.filter((n) => {
|
|
2020
|
+
if (p.has(n) || e.position_field && n === e.position_field) return !1;
|
|
2021
|
+
let r = t.fields.get(n);
|
|
1999
2022
|
return !(!r || r.auto || r.primary || r.source);
|
|
2000
|
-
}),
|
|
2001
|
-
if (
|
|
2002
|
-
let r =
|
|
2023
|
+
}), h = new Set(d.filter((n) => {
|
|
2024
|
+
if (e.position_field && n === e.position_field) return !0;
|
|
2025
|
+
let r = t.fields.get(n);
|
|
2003
2026
|
return r && (r.auto || r.primary || r.source);
|
|
2004
|
-
})),
|
|
2005
|
-
|
|
2027
|
+
})), g = W((e, t, n) => {
|
|
2028
|
+
i(r.map((r) => r._key === e ? {
|
|
2006
2029
|
...r,
|
|
2007
2030
|
[t]: n,
|
|
2008
2031
|
_dirty: !0
|
|
2009
2032
|
} : r));
|
|
2010
|
-
}, [
|
|
2011
|
-
let
|
|
2033
|
+
}, [r, i]), v = W(() => {
|
|
2034
|
+
let n = {
|
|
2012
2035
|
_key: crypto.randomUUID(),
|
|
2013
2036
|
_dirty: !0
|
|
2014
2037
|
};
|
|
2015
|
-
if (
|
|
2016
|
-
let
|
|
2017
|
-
let n = typeof t[
|
|
2038
|
+
if (f) {
|
|
2039
|
+
let e = r.filter((e) => !e._deleted).reduce((e, t) => {
|
|
2040
|
+
let n = typeof t[f] == "number" ? t[f] : -1;
|
|
2018
2041
|
return Math.max(e, n);
|
|
2019
2042
|
}, -1);
|
|
2020
|
-
|
|
2043
|
+
n[f] = e + 1;
|
|
2021
2044
|
}
|
|
2022
|
-
let
|
|
2023
|
-
for (let
|
|
2024
|
-
let
|
|
2025
|
-
|
|
2045
|
+
let a = e.quick_add?.defaults ?? {};
|
|
2046
|
+
for (let e of m) {
|
|
2047
|
+
let r = t.fields.get(e);
|
|
2048
|
+
r && (a[e] === void 0 ? r.default === void 0 ? r.type === "bool" && (n[e] = !1) : n[e] = r.default : n[e] = a[e]);
|
|
2026
2049
|
}
|
|
2027
|
-
|
|
2050
|
+
i([...r, n]);
|
|
2028
2051
|
}, [
|
|
2052
|
+
r,
|
|
2029
2053
|
i,
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
o(i.map((t) => t._key === e ? {
|
|
2054
|
+
m,
|
|
2055
|
+
t,
|
|
2056
|
+
e.quick_add?.defaults,
|
|
2057
|
+
f
|
|
2058
|
+
]), y = W((e) => {
|
|
2059
|
+
i(r.map((t) => t._key === e ? {
|
|
2037
2060
|
...t,
|
|
2038
2061
|
_deleted: !0
|
|
2039
2062
|
} : t));
|
|
2040
|
-
}, [
|
|
2041
|
-
|
|
2063
|
+
}, [r, i]), C = W((e) => {
|
|
2064
|
+
i(r.map((t) => t._key === e ? {
|
|
2042
2065
|
...t,
|
|
2043
2066
|
_deleted: !1
|
|
2044
2067
|
} : t));
|
|
2045
|
-
}, [
|
|
2046
|
-
if (!
|
|
2047
|
-
let n =
|
|
2048
|
-
if (
|
|
2049
|
-
let c = [...n], [l] = c.splice(
|
|
2050
|
-
c.splice(s, 0, l),
|
|
2068
|
+
}, [r, i]), D = W((e, t) => {
|
|
2069
|
+
if (!f) return;
|
|
2070
|
+
let n = r.filter((e) => !e._deleted), a = r.filter((e) => e._deleted), o = n.findIndex((t) => t._key === e), s = o + t;
|
|
2071
|
+
if (o < 0 || s < 0 || s >= n.length) return;
|
|
2072
|
+
let c = [...n], [l] = c.splice(o, 1);
|
|
2073
|
+
c.splice(s, 0, l), i([...c.map((e, t) => ({
|
|
2051
2074
|
...e,
|
|
2052
|
-
[
|
|
2053
|
-
_dirty: e[
|
|
2054
|
-
})), ...
|
|
2075
|
+
[f]: t,
|
|
2076
|
+
_dirty: e[f] !== t || e._dirty
|
|
2077
|
+
})), ...a]);
|
|
2055
2078
|
}, [
|
|
2079
|
+
r,
|
|
2056
2080
|
i,
|
|
2057
|
-
|
|
2058
|
-
h
|
|
2081
|
+
f
|
|
2059
2082
|
]), O = W((e) => {
|
|
2060
2083
|
let t = e.target, n = t.closest("td");
|
|
2061
2084
|
if (!n) return;
|
|
@@ -2080,7 +2103,7 @@ function Ot({ config: t, childEntity: n, schema: r, rows: i, onChange: o, valida
|
|
|
2080
2103
|
if (o < t.length - 1) {
|
|
2081
2104
|
let e = t[o + 1].cells[a]?.querySelector("input, select, textarea, [tabindex]");
|
|
2082
2105
|
e && e.focus();
|
|
2083
|
-
} else
|
|
2106
|
+
} else v(), requestAnimationFrame(() => {
|
|
2084
2107
|
let e = i.querySelectorAll("tr"), t = e[e.length - 1];
|
|
2085
2108
|
if (t) {
|
|
2086
2109
|
let e = t.querySelector("input, select, textarea, [tabindex]");
|
|
@@ -2088,21 +2111,21 @@ function Ot({ config: t, childEntity: n, schema: r, rows: i, onChange: o, valida
|
|
|
2088
2111
|
}
|
|
2089
2112
|
});
|
|
2090
2113
|
} else e.key === "Escape" && t.blur?.();
|
|
2091
|
-
}, [
|
|
2092
|
-
return
|
|
2114
|
+
}, [v]), A = ce;
|
|
2115
|
+
return l.isPhone && !s ? /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("div", {
|
|
2093
2116
|
style: {
|
|
2094
2117
|
display: "flex",
|
|
2095
2118
|
flexDirection: "column",
|
|
2096
2119
|
gap: 10
|
|
2097
2120
|
},
|
|
2098
|
-
children:
|
|
2099
|
-
let
|
|
2121
|
+
children: r.map((e, i) => {
|
|
2122
|
+
let s = !!e._deleted, l = a?.[e._key], u = f ? r.filter((e) => !e._deleted) : [], p = f ? u.findIndex((t) => t._key === e._key) : -1;
|
|
2100
2123
|
return /* @__PURE__ */ X("div", {
|
|
2101
2124
|
style: {
|
|
2102
2125
|
border: "1px solid var(--border)",
|
|
2103
2126
|
borderRadius: 8,
|
|
2104
2127
|
background: "var(--surface)",
|
|
2105
|
-
opacity:
|
|
2128
|
+
opacity: s ? .58 : 1,
|
|
2106
2129
|
overflow: "hidden"
|
|
2107
2130
|
},
|
|
2108
2131
|
children: [/* @__PURE__ */ X("div", {
|
|
@@ -2121,35 +2144,35 @@ function Ot({ config: t, childEntity: n, schema: r, rows: i, onChange: o, valida
|
|
|
2121
2144
|
fontWeight: 600,
|
|
2122
2145
|
color: "var(--text-2)"
|
|
2123
2146
|
},
|
|
2124
|
-
children:
|
|
2147
|
+
children: c("record.row.number", "Row {number}", { number: i + 1 })
|
|
2125
2148
|
}), /* @__PURE__ */ X("div", {
|
|
2126
2149
|
style: {
|
|
2127
2150
|
display: "flex",
|
|
2128
2151
|
alignItems: "center",
|
|
2129
2152
|
gap: 4
|
|
2130
2153
|
},
|
|
2131
|
-
children: [
|
|
2154
|
+
children: [f && !s && /* @__PURE__ */ X(J, { children: [/* @__PURE__ */ Y(T, {
|
|
2132
2155
|
size: 32,
|
|
2133
|
-
icon: /* @__PURE__ */ Y(
|
|
2134
|
-
onClick: () => D(
|
|
2156
|
+
icon: /* @__PURE__ */ Y(w.up, { size: 14 }),
|
|
2157
|
+
onClick: () => D(e._key, -1),
|
|
2135
2158
|
disabled: p <= 0,
|
|
2136
|
-
title:
|
|
2137
|
-
}), /* @__PURE__ */ Y(
|
|
2159
|
+
title: c("record.row.move_up", "Move row up")
|
|
2160
|
+
}), /* @__PURE__ */ Y(T, {
|
|
2138
2161
|
size: 32,
|
|
2139
|
-
icon: /* @__PURE__ */ Y(
|
|
2140
|
-
onClick: () => D(
|
|
2141
|
-
disabled: p === -1 || p >=
|
|
2142
|
-
title:
|
|
2143
|
-
})] }),
|
|
2162
|
+
icon: /* @__PURE__ */ Y(w.down, { size: 14 }),
|
|
2163
|
+
onClick: () => D(e._key, 1),
|
|
2164
|
+
disabled: p === -1 || p >= u.length - 1,
|
|
2165
|
+
title: c("record.row.move_down", "Move row down")
|
|
2166
|
+
})] }), s ? /* @__PURE__ */ Y(T, {
|
|
2144
2167
|
size: 32,
|
|
2145
|
-
icon: /* @__PURE__ */ Y(
|
|
2146
|
-
onClick: () =>
|
|
2147
|
-
title:
|
|
2148
|
-
}) : /* @__PURE__ */ Y(
|
|
2168
|
+
icon: /* @__PURE__ */ Y(w.refresh, { size: 14 }),
|
|
2169
|
+
onClick: () => C(e._key),
|
|
2170
|
+
title: c("record.row.undo_delete", "Undo delete")
|
|
2171
|
+
}) : /* @__PURE__ */ Y(T, {
|
|
2149
2172
|
size: 32,
|
|
2150
|
-
icon: /* @__PURE__ */ Y(
|
|
2151
|
-
onClick: () =>
|
|
2152
|
-
title:
|
|
2173
|
+
icon: /* @__PURE__ */ Y(w.trash, { size: 14 }),
|
|
2174
|
+
onClick: () => y(e._key),
|
|
2175
|
+
title: c("record.row.delete", "Delete row")
|
|
2153
2176
|
})]
|
|
2154
2177
|
})]
|
|
2155
2178
|
}), /* @__PURE__ */ Y("div", {
|
|
@@ -2159,299 +2182,299 @@ function Ot({ config: t, childEntity: n, schema: r, rows: i, onChange: o, valida
|
|
|
2159
2182
|
flexDirection: "column",
|
|
2160
2183
|
gap: 12
|
|
2161
2184
|
},
|
|
2162
|
-
children:
|
|
2163
|
-
let i =
|
|
2164
|
-
outline:
|
|
2185
|
+
children: d.map((r) => {
|
|
2186
|
+
let i = t.fields.get(r), a = l?.includes(r), u = h.has(r), d = i ? _(c, i, r, n.entities) : r, f = `child-${e._key}-${r}`, p = `${f}-label`, m = {
|
|
2187
|
+
outline: a ? "1px solid var(--danger)" : "none",
|
|
2165
2188
|
outlineOffset: 3,
|
|
2166
|
-
borderRadius:
|
|
2167
|
-
},
|
|
2189
|
+
borderRadius: a ? 5 : 0
|
|
2190
|
+
}, v = {
|
|
2168
2191
|
fontSize: 11.5,
|
|
2169
2192
|
fontWeight: 600,
|
|
2170
2193
|
color: "var(--text-3)"
|
|
2171
|
-
},
|
|
2194
|
+
}, y = !s && !u && !!i;
|
|
2172
2195
|
return /* @__PURE__ */ X("div", {
|
|
2173
2196
|
style: {
|
|
2174
2197
|
display: "flex",
|
|
2175
2198
|
flexDirection: "column",
|
|
2176
2199
|
gap: 5,
|
|
2177
2200
|
minWidth: 0,
|
|
2178
|
-
textDecoration:
|
|
2201
|
+
textDecoration: s ? "line-through" : "none"
|
|
2179
2202
|
},
|
|
2180
|
-
title:
|
|
2181
|
-
children: [
|
|
2182
|
-
id:
|
|
2183
|
-
htmlFor:
|
|
2184
|
-
style:
|
|
2185
|
-
children:
|
|
2203
|
+
title: a ? c("record.row.field_required", "{field} is required", { field: r }) : void 0,
|
|
2204
|
+
children: [y ? /* @__PURE__ */ Y("label", {
|
|
2205
|
+
id: p,
|
|
2206
|
+
htmlFor: f,
|
|
2207
|
+
style: v,
|
|
2208
|
+
children: d
|
|
2186
2209
|
}) : /* @__PURE__ */ Y("div", {
|
|
2187
|
-
id:
|
|
2188
|
-
style:
|
|
2189
|
-
children:
|
|
2210
|
+
id: p,
|
|
2211
|
+
style: v,
|
|
2212
|
+
children: d
|
|
2190
2213
|
}), /* @__PURE__ */ Y("div", {
|
|
2191
|
-
style:
|
|
2192
|
-
children:
|
|
2214
|
+
style: m,
|
|
2215
|
+
children: s || u ? i ? k({
|
|
2193
2216
|
field: i,
|
|
2194
|
-
fieldName:
|
|
2195
|
-
value:
|
|
2217
|
+
fieldName: r,
|
|
2218
|
+
value: e[r],
|
|
2196
2219
|
mode: "display",
|
|
2197
|
-
record:
|
|
2198
|
-
refs:
|
|
2199
|
-
fieldId:
|
|
2200
|
-
labelId:
|
|
2201
|
-
t:
|
|
2202
|
-
}) :
|
|
2220
|
+
record: e,
|
|
2221
|
+
refs: o,
|
|
2222
|
+
fieldId: f,
|
|
2223
|
+
labelId: p,
|
|
2224
|
+
t: c
|
|
2225
|
+
}) : b(e[r]) : i ? k({
|
|
2203
2226
|
field: i,
|
|
2204
|
-
fieldName:
|
|
2205
|
-
value:
|
|
2227
|
+
fieldName: r,
|
|
2228
|
+
value: e[r],
|
|
2206
2229
|
mode: "edit",
|
|
2207
|
-
onChange: (
|
|
2208
|
-
record:
|
|
2209
|
-
refs:
|
|
2230
|
+
onChange: (t) => g(e._key, r, t),
|
|
2231
|
+
record: e,
|
|
2232
|
+
refs: o,
|
|
2210
2233
|
compact: !0,
|
|
2211
|
-
fieldId:
|
|
2212
|
-
labelId:
|
|
2213
|
-
t:
|
|
2214
|
-
}) :
|
|
2234
|
+
fieldId: f,
|
|
2235
|
+
labelId: p,
|
|
2236
|
+
t: c
|
|
2237
|
+
}) : b(e[r])
|
|
2215
2238
|
})]
|
|
2216
|
-
},
|
|
2239
|
+
}, r);
|
|
2217
2240
|
})
|
|
2218
2241
|
})]
|
|
2219
|
-
},
|
|
2242
|
+
}, e._key);
|
|
2220
2243
|
})
|
|
2221
2244
|
}), /* @__PURE__ */ Y("div", {
|
|
2222
2245
|
style: { marginTop: 10 },
|
|
2223
|
-
children: /* @__PURE__ */ Y(
|
|
2246
|
+
children: /* @__PURE__ */ Y(E, {
|
|
2224
2247
|
kind: "ghost",
|
|
2225
2248
|
size: "sm",
|
|
2226
|
-
icon: /* @__PURE__ */ Y(
|
|
2227
|
-
onClick:
|
|
2228
|
-
children:
|
|
2249
|
+
icon: /* @__PURE__ */ Y(w.plus, { size: 14 }),
|
|
2250
|
+
onClick: v,
|
|
2251
|
+
children: c("record.row.add", "Add row")
|
|
2229
2252
|
})
|
|
2230
2253
|
})] }) : /* @__PURE__ */ X("div", { children: [/* @__PURE__ */ Y("div", {
|
|
2231
2254
|
style: { overflowX: "auto" },
|
|
2232
2255
|
children: /* @__PURE__ */ X("table", {
|
|
2233
|
-
ref:
|
|
2234
|
-
style:
|
|
2256
|
+
ref: u,
|
|
2257
|
+
style: le,
|
|
2235
2258
|
onKeyDown: O,
|
|
2236
|
-
children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ X("tr", { children: [
|
|
2237
|
-
let
|
|
2259
|
+
children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ X("tr", { children: [d.map((e) => {
|
|
2260
|
+
let r = t.fields.get(e);
|
|
2238
2261
|
return /* @__PURE__ */ Y("th", {
|
|
2239
|
-
style:
|
|
2240
|
-
children:
|
|
2262
|
+
style: A,
|
|
2263
|
+
children: r ? _(c, r, e, n.entities) : e
|
|
2241
2264
|
}, e);
|
|
2242
2265
|
}), /* @__PURE__ */ Y("th", { style: {
|
|
2243
|
-
...
|
|
2266
|
+
...A,
|
|
2244
2267
|
width: 40
|
|
2245
|
-
} })] }) }), /* @__PURE__ */ Y("tbody", { children:
|
|
2246
|
-
let
|
|
2268
|
+
} })] }) }), /* @__PURE__ */ Y("tbody", { children: r.map((e) => {
|
|
2269
|
+
let n = !!e._deleted, r = a?.[e._key];
|
|
2247
2270
|
return /* @__PURE__ */ X("tr", {
|
|
2248
|
-
style: { opacity:
|
|
2249
|
-
children: [
|
|
2250
|
-
let a =
|
|
2251
|
-
return
|
|
2271
|
+
style: { opacity: n ? .5 : 1 },
|
|
2272
|
+
children: [d.map((i) => {
|
|
2273
|
+
let a = t.fields.get(i), s = r?.includes(i), l = h.has(i);
|
|
2274
|
+
return n || l ? /* @__PURE__ */ Y("td", {
|
|
2252
2275
|
style: {
|
|
2253
2276
|
padding: "6px 12px",
|
|
2254
2277
|
borderBottom: "1px solid var(--divider)",
|
|
2255
2278
|
verticalAlign: "middle",
|
|
2256
|
-
textDecoration:
|
|
2279
|
+
textDecoration: n ? "line-through" : "none",
|
|
2257
2280
|
color: "var(--text-2)"
|
|
2258
2281
|
},
|
|
2259
|
-
children: a ?
|
|
2282
|
+
children: a ? k({
|
|
2260
2283
|
field: a,
|
|
2261
|
-
fieldName:
|
|
2262
|
-
value:
|
|
2284
|
+
fieldName: i,
|
|
2285
|
+
value: e[i],
|
|
2263
2286
|
mode: "display",
|
|
2264
|
-
record:
|
|
2265
|
-
refs:
|
|
2266
|
-
t:
|
|
2267
|
-
}) :
|
|
2268
|
-
},
|
|
2287
|
+
record: e,
|
|
2288
|
+
refs: o,
|
|
2289
|
+
t: c
|
|
2290
|
+
}) : b(e[i])
|
|
2291
|
+
}, i) : /* @__PURE__ */ Y("td", {
|
|
2269
2292
|
style: {
|
|
2270
2293
|
padding: "4px 4px",
|
|
2271
2294
|
borderBottom: "1px solid var(--divider)",
|
|
2272
2295
|
verticalAlign: "middle",
|
|
2273
|
-
outline:
|
|
2296
|
+
outline: s ? "1px solid var(--danger)" : "none",
|
|
2274
2297
|
outlineOffset: -1,
|
|
2275
|
-
borderRadius:
|
|
2298
|
+
borderRadius: s ? 4 : 0
|
|
2276
2299
|
},
|
|
2277
|
-
title:
|
|
2278
|
-
children: a ?
|
|
2300
|
+
title: s ? c("record.row.field_required", "{field} is required", { field: i }) : void 0,
|
|
2301
|
+
children: a ? k({
|
|
2279
2302
|
field: a,
|
|
2280
|
-
fieldName:
|
|
2281
|
-
value:
|
|
2303
|
+
fieldName: i,
|
|
2304
|
+
value: e[i],
|
|
2282
2305
|
mode: "edit",
|
|
2283
|
-
onChange: (
|
|
2284
|
-
record:
|
|
2285
|
-
refs:
|
|
2306
|
+
onChange: (t) => g(e._key, i, t),
|
|
2307
|
+
record: e,
|
|
2308
|
+
refs: o,
|
|
2286
2309
|
compact: !0,
|
|
2287
|
-
t:
|
|
2288
|
-
}) :
|
|
2289
|
-
},
|
|
2310
|
+
t: c
|
|
2311
|
+
}) : b(e[i])
|
|
2312
|
+
}, i);
|
|
2290
2313
|
}), /* @__PURE__ */ Y("td", {
|
|
2291
2314
|
style: {
|
|
2292
2315
|
padding: "4px 8px",
|
|
2293
2316
|
borderBottom: "1px solid var(--divider)",
|
|
2294
2317
|
verticalAlign: "middle"
|
|
2295
2318
|
},
|
|
2296
|
-
children:
|
|
2319
|
+
children: n ? /* @__PURE__ */ Y(T, {
|
|
2297
2320
|
size: 24,
|
|
2298
|
-
icon: /* @__PURE__ */ Y(
|
|
2299
|
-
onClick: () =>
|
|
2300
|
-
title:
|
|
2301
|
-
}) : /* @__PURE__ */ Y(
|
|
2321
|
+
icon: /* @__PURE__ */ Y(w.refresh, { size: 12 }),
|
|
2322
|
+
onClick: () => C(e._key),
|
|
2323
|
+
title: c("record.row.undo_delete", "Undo delete")
|
|
2324
|
+
}) : /* @__PURE__ */ Y(T, {
|
|
2302
2325
|
size: 24,
|
|
2303
|
-
icon: /* @__PURE__ */ Y(
|
|
2304
|
-
onClick: () =>
|
|
2305
|
-
title:
|
|
2326
|
+
icon: /* @__PURE__ */ Y(w.trash, { size: 12 }),
|
|
2327
|
+
onClick: () => y(e._key),
|
|
2328
|
+
title: c("record.row.delete", "Delete row")
|
|
2306
2329
|
})
|
|
2307
2330
|
})]
|
|
2308
|
-
},
|
|
2331
|
+
}, e._key);
|
|
2309
2332
|
}) })]
|
|
2310
2333
|
})
|
|
2311
2334
|
}), /* @__PURE__ */ Y("div", {
|
|
2312
2335
|
style: { marginTop: 8 },
|
|
2313
|
-
children: /* @__PURE__ */ Y(
|
|
2336
|
+
children: /* @__PURE__ */ Y(E, {
|
|
2314
2337
|
kind: "ghost",
|
|
2315
2338
|
size: "xs",
|
|
2316
|
-
icon: /* @__PURE__ */ Y(
|
|
2317
|
-
onClick:
|
|
2318
|
-
children:
|
|
2339
|
+
icon: /* @__PURE__ */ Y(w.plus, { size: 12 }),
|
|
2340
|
+
onClick: v,
|
|
2341
|
+
children: c("record.row.add", "Add row")
|
|
2319
2342
|
})
|
|
2320
2343
|
})] });
|
|
2321
2344
|
}
|
|
2322
2345
|
//#endregion
|
|
2323
2346
|
//#region src/components/detail-layout/ChildrenBlock.tsx
|
|
2324
|
-
var
|
|
2325
|
-
function
|
|
2326
|
-
let
|
|
2327
|
-
if (!
|
|
2328
|
-
let
|
|
2329
|
-
if (
|
|
2330
|
-
let
|
|
2331
|
-
if (!
|
|
2347
|
+
var Mt = ve(() => import("./DraggableChildrenTable-Cy8uevS_.js").then((e) => ({ default: e.DraggableChildrenTable })));
|
|
2348
|
+
function Nt({ node: e, ctx: t }) {
|
|
2349
|
+
let n = x(), r = x("errors"), i = S(), a = e.children;
|
|
2350
|
+
if (!a) return null;
|
|
2351
|
+
let o = i.isPhone && t.relatedRecordsPresentation === "table";
|
|
2352
|
+
if (t.isNew && t.mode !== "edit") return null;
|
|
2353
|
+
let s = Ye(t.entity, a);
|
|
2354
|
+
if (!s) return /* @__PURE__ */ X("div", {
|
|
2332
2355
|
className: "text-sm text-muted-foreground py-2",
|
|
2333
2356
|
children: [
|
|
2334
|
-
|
|
2357
|
+
r("record.child_relation_unknown", "This record type has no child relation by that name."),
|
|
2335
2358
|
" ",
|
|
2336
|
-
/* @__PURE__ */ Y("code", { children:
|
|
2359
|
+
/* @__PURE__ */ Y("code", { children: a })
|
|
2337
2360
|
]
|
|
2338
2361
|
});
|
|
2339
|
-
let
|
|
2340
|
-
if (!
|
|
2362
|
+
let c = t.schema.entities[s.entity];
|
|
2363
|
+
if (!c) return /* @__PURE__ */ X("div", {
|
|
2341
2364
|
className: "text-sm text-muted-foreground py-2",
|
|
2342
2365
|
children: [
|
|
2343
|
-
|
|
2366
|
+
r("record.related_entity_not_found", "The related record type is not declared in this deployment."),
|
|
2344
2367
|
" ",
|
|
2345
|
-
/* @__PURE__ */ Y("code", { children:
|
|
2368
|
+
/* @__PURE__ */ Y("code", { children: s.entity })
|
|
2346
2369
|
]
|
|
2347
2370
|
});
|
|
2348
|
-
let
|
|
2349
|
-
title:
|
|
2350
|
-
icon:
|
|
2351
|
-
name:
|
|
2371
|
+
let l = Le(s, c, e), u = Me(e, t, n), d = Ne(e, t), f = (e) => l.mode === "timeline" || t.withinCard ? e : /* @__PURE__ */ Y(P, {
|
|
2372
|
+
title: u,
|
|
2373
|
+
icon: d ? /* @__PURE__ */ Y(R, {
|
|
2374
|
+
name: d,
|
|
2352
2375
|
size: 14
|
|
2353
2376
|
}) : void 0,
|
|
2354
2377
|
children: e
|
|
2355
2378
|
});
|
|
2356
|
-
if (
|
|
2357
|
-
let e =
|
|
2358
|
-
return
|
|
2359
|
-
fallback: /* @__PURE__ */ Y(
|
|
2379
|
+
if (t.mode === "edit" && l.editable && l.interaction !== "navigate" && l.interaction !== "readonly" && m(c, "update") && l.mode === "table" && t.pendingChildren !== void 0 && t.onChildrenChange) {
|
|
2380
|
+
let e = t.pendingChildren[a] ?? [], n = t.childValidationErrors?.[a], r = l.position_field ? i.isPhone && !o ? jt : Mt : jt;
|
|
2381
|
+
return f(/* @__PURE__ */ Y(_e, {
|
|
2382
|
+
fallback: /* @__PURE__ */ Y(U, {}),
|
|
2360
2383
|
children: /* @__PURE__ */ Y(r, {
|
|
2361
|
-
config:
|
|
2362
|
-
childEntity:
|
|
2363
|
-
schema:
|
|
2384
|
+
config: l,
|
|
2385
|
+
childEntity: c,
|
|
2386
|
+
schema: t.schema,
|
|
2364
2387
|
rows: e,
|
|
2365
|
-
onChange: (e) =>
|
|
2366
|
-
validationErrors:
|
|
2367
|
-
refs:
|
|
2368
|
-
forceTablePresentation:
|
|
2388
|
+
onChange: (e) => t.onChildrenChange(a, e),
|
|
2389
|
+
validationErrors: n,
|
|
2390
|
+
refs: t.refs,
|
|
2391
|
+
forceTablePresentation: o
|
|
2369
2392
|
})
|
|
2370
2393
|
}));
|
|
2371
2394
|
}
|
|
2372
|
-
if (
|
|
2373
|
-
let
|
|
2374
|
-
config:
|
|
2375
|
-
parentEntity:
|
|
2376
|
-
parentId:
|
|
2377
|
-
schema:
|
|
2395
|
+
if (t.isNew) return null;
|
|
2396
|
+
let p = {
|
|
2397
|
+
config: l,
|
|
2398
|
+
parentEntity: t.entityCode,
|
|
2399
|
+
parentId: t.recordId,
|
|
2400
|
+
schema: t.schema
|
|
2378
2401
|
};
|
|
2379
|
-
switch (
|
|
2380
|
-
case "list": return
|
|
2381
|
-
case "cards": return
|
|
2382
|
-
case "timeline": return
|
|
2383
|
-
default: return
|
|
2402
|
+
switch (l.mode) {
|
|
2403
|
+
case "list": return f(/* @__PURE__ */ Y(at, { ...p }));
|
|
2404
|
+
case "cards": return f(/* @__PURE__ */ Y(ot, { ...p }));
|
|
2405
|
+
case "timeline": return f(/* @__PURE__ */ Y(Ct, { ...p }));
|
|
2406
|
+
default: return i.isPhone && !o ? f(/* @__PURE__ */ Y(ot, { ...p })) : f(/* @__PURE__ */ Y(it, { ...p }));
|
|
2384
2407
|
}
|
|
2385
2408
|
}
|
|
2386
2409
|
//#endregion
|
|
2387
2410
|
//#region src/components/detail-layout/FieldsBlock.tsx
|
|
2388
|
-
function
|
|
2389
|
-
let n =
|
|
2390
|
-
return /* @__PURE__ */ Y(
|
|
2391
|
-
columns:
|
|
2392
|
-
children:
|
|
2393
|
-
let
|
|
2411
|
+
function Pt({ fields: e, ctx: t }) {
|
|
2412
|
+
let n = x(), { entity: r, entityCode: i, record: a, mode: o, onFieldChange: c, schema: l } = t, u = t.columns ?? 2, d = t.hideEmptyFields && o === "display" ? e.filter((e) => ae(r, a, e.code)) : e, f = u === 1 && e.length === 1;
|
|
2413
|
+
return d.length === 0 ? null : /* @__PURE__ */ Y(me, {
|
|
2414
|
+
columns: u,
|
|
2415
|
+
children: d.map((e) => {
|
|
2416
|
+
let u = e.code, d = `${i ?? "field"}-${u}`, p = `${d}-label`, m = r.fields.get(u), g = !!(m?.auto || m?.readonly || m?.source), _ = h(r, u), v = _?.read === "denied", y = _?.write === "denied", b = o === "display" ? v : y || v, x = g || o === "edit" && y ? "display" : o, S = b ? /* @__PURE__ */ Y(F, {
|
|
2394
2417
|
tier: _.classification,
|
|
2395
|
-
tierDef:
|
|
2418
|
+
tierDef: s(l, r, u),
|
|
2396
2419
|
requiredPermission: _?.required_permission,
|
|
2397
2420
|
variant: x === "edit" ? "input" : "value"
|
|
2398
|
-
}) :
|
|
2421
|
+
}) : se({
|
|
2399
2422
|
entity: r,
|
|
2400
2423
|
entityCode: i,
|
|
2401
|
-
fieldName:
|
|
2424
|
+
fieldName: u,
|
|
2402
2425
|
record: a,
|
|
2403
2426
|
mode: x,
|
|
2404
|
-
onChange:
|
|
2427
|
+
onChange: c && !g ? (e) => c(u, e) : void 0,
|
|
2405
2428
|
refs: t.refs,
|
|
2406
|
-
entities:
|
|
2407
|
-
screens:
|
|
2429
|
+
entities: l?.entities,
|
|
2430
|
+
screens: l?.screens,
|
|
2408
2431
|
t: n,
|
|
2409
2432
|
fieldId: d,
|
|
2410
|
-
labelId:
|
|
2433
|
+
labelId: p,
|
|
2411
2434
|
structure: e.structure,
|
|
2412
2435
|
detailScreen: e.detail_screen
|
|
2413
2436
|
});
|
|
2414
2437
|
if (!S) return null;
|
|
2415
|
-
let C = o === "display" && e.actions && e.actions.length > 0 ? /* @__PURE__ */ Y(J, { children: e.actions.map((e, t) => /* @__PURE__ */ Y(
|
|
2416
|
-
actionCode: `${
|
|
2438
|
+
let C = o === "display" && e.actions && e.actions.length > 0 ? /* @__PURE__ */ Y(J, { children: e.actions.map((e, t) => /* @__PURE__ */ Y(de, {
|
|
2439
|
+
actionCode: `${u}.action[${t}]`,
|
|
2417
2440
|
action: e,
|
|
2418
2441
|
entityCode: i,
|
|
2419
2442
|
row: a,
|
|
2420
2443
|
variant: "ghost",
|
|
2421
2444
|
size: "icon"
|
|
2422
|
-
}, t)) }) : void 0, w = !!m &&
|
|
2423
|
-
return
|
|
2445
|
+
}, t)) }) : void 0, w = !!m && he.has(m.type), T = x === "display" ? pe(m, a?.[u]) : void 0, E = n(m?.display?.description);
|
|
2446
|
+
return f && (w || e.structure) ? /* @__PURE__ */ X("div", {
|
|
2424
2447
|
style: { gridColumn: "1 / -1" },
|
|
2425
|
-
children: [S, x === "edit" &&
|
|
2448
|
+
children: [S, x === "edit" && E && /* @__PURE__ */ Y("div", {
|
|
2426
2449
|
style: {
|
|
2427
2450
|
fontSize: 11.5,
|
|
2428
2451
|
lineHeight: 1.4,
|
|
2429
2452
|
color: "var(--text-3)",
|
|
2430
2453
|
marginTop: 3
|
|
2431
2454
|
},
|
|
2432
|
-
children:
|
|
2455
|
+
children: E
|
|
2433
2456
|
})]
|
|
2434
|
-
},
|
|
2435
|
-
"data-testid": `field-${
|
|
2436
|
-
label:
|
|
2457
|
+
}, u) : /* @__PURE__ */ Y(ge, {
|
|
2458
|
+
"data-testid": `field-${u}`,
|
|
2459
|
+
label: oe(n, r, u, l.entities),
|
|
2437
2460
|
htmlFor: x === "edit" ? d : void 0,
|
|
2438
|
-
labelId:
|
|
2439
|
-
labelTitle:
|
|
2461
|
+
labelId: p,
|
|
2462
|
+
labelTitle: E || void 0,
|
|
2440
2463
|
required: m?.required ?? !1,
|
|
2441
2464
|
mode: x,
|
|
2442
2465
|
span: w,
|
|
2443
|
-
error: t.fieldErrors?.[
|
|
2444
|
-
hint: x === "edit" &&
|
|
2466
|
+
error: t.fieldErrors?.[u],
|
|
2467
|
+
hint: x === "edit" && E ? E : void 0,
|
|
2445
2468
|
actions: C,
|
|
2446
|
-
copyValue:
|
|
2469
|
+
copyValue: T,
|
|
2447
2470
|
children: S
|
|
2448
|
-
},
|
|
2471
|
+
}, u);
|
|
2449
2472
|
})
|
|
2450
2473
|
});
|
|
2451
2474
|
}
|
|
2452
2475
|
//#endregion
|
|
2453
2476
|
//#region src/components/detail-layout/PropertiesBlock.tsx
|
|
2454
|
-
var
|
|
2477
|
+
var Ft = /* @__PURE__ */ new Set([
|
|
2455
2478
|
"string",
|
|
2456
2479
|
"text",
|
|
2457
2480
|
"int",
|
|
@@ -2459,16 +2482,16 @@ var Mt = /* @__PURE__ */ new Set([
|
|
|
2459
2482
|
"decimal",
|
|
2460
2483
|
"email",
|
|
2461
2484
|
"url"
|
|
2462
|
-
]),
|
|
2463
|
-
function
|
|
2485
|
+
]), It = 500;
|
|
2486
|
+
function Lt({ node: e, ctx: t }) {
|
|
2464
2487
|
let { entity: n, objectProperties: r, onSetProperty: i, isNew: a, mode: o, refs: s } = t, c = n.properties ?? {};
|
|
2465
2488
|
if (a) return null;
|
|
2466
2489
|
let l = e.properties === !0 || e.properties, u = l === !0 ? Object.entries(c).sort(([e], [t]) => e.localeCompare(t)) : l.filter((e) => c[e] != null).map((e) => [e, c[e]]);
|
|
2467
|
-
return u.length === 0 ? null : /* @__PURE__ */ Y(
|
|
2490
|
+
return u.length === 0 ? null : /* @__PURE__ */ Y(me, {
|
|
2468
2491
|
columns: 2,
|
|
2469
2492
|
children: u.map(([e, a]) => {
|
|
2470
|
-
let c = r?.find((t) => t.property_code === e), l =
|
|
2471
|
-
return /* @__PURE__ */ Y(
|
|
2493
|
+
let c = r?.find((t) => t.property_code === e), l = p(a), u = a.readonly || !i ? "display" : o;
|
|
2494
|
+
return /* @__PURE__ */ Y(Rt, {
|
|
2472
2495
|
propCode: e,
|
|
2473
2496
|
prop: a,
|
|
2474
2497
|
field: l,
|
|
@@ -2482,42 +2505,42 @@ function Pt({ node: e, ctx: t }) {
|
|
|
2482
2505
|
})
|
|
2483
2506
|
});
|
|
2484
2507
|
}
|
|
2485
|
-
function
|
|
2486
|
-
let
|
|
2508
|
+
function Rt({ propCode: e, prop: t, field: n, value: r, mode: i, onSetProperty: a, refs: o, entity: c, schema: l }) {
|
|
2509
|
+
let u = x(), d = K(null);
|
|
2487
2510
|
G(() => () => {
|
|
2488
|
-
|
|
2511
|
+
d.current && clearTimeout(d.current);
|
|
2489
2512
|
}, []);
|
|
2490
|
-
let
|
|
2491
|
-
a && (
|
|
2513
|
+
let f = W((n) => {
|
|
2514
|
+
a && (Ft.has(t.type) ? (d.current && clearTimeout(d.current), d.current = setTimeout(() => a(e, n), It)) : a(e, n));
|
|
2492
2515
|
}, [
|
|
2493
2516
|
e,
|
|
2494
2517
|
t.type,
|
|
2495
2518
|
a
|
|
2496
|
-
]),
|
|
2497
|
-
return /* @__PURE__ */ Y(
|
|
2498
|
-
label:
|
|
2499
|
-
mode:
|
|
2500
|
-
span:
|
|
2501
|
-
children:
|
|
2502
|
-
tier:
|
|
2503
|
-
tierDef:
|
|
2504
|
-
requiredPermission:
|
|
2505
|
-
variant:
|
|
2506
|
-
}) :
|
|
2519
|
+
]), p = h(c, e), m = p?.read === "denied", g = p?.write === "denied", _ = i === "display" ? m : g || m, v = i === "edit" && g ? "display" : i;
|
|
2520
|
+
return /* @__PURE__ */ Y(ge, {
|
|
2521
|
+
label: u(t.display?.name ?? t.name),
|
|
2522
|
+
mode: v,
|
|
2523
|
+
span: he.has(t.type),
|
|
2524
|
+
children: _ ? /* @__PURE__ */ Y(F, {
|
|
2525
|
+
tier: p.classification,
|
|
2526
|
+
tierDef: s(l, c, e),
|
|
2527
|
+
requiredPermission: p?.required_permission,
|
|
2528
|
+
variant: v === "edit" ? "input" : "value"
|
|
2529
|
+
}) : k({
|
|
2507
2530
|
field: n,
|
|
2508
2531
|
fieldName: e,
|
|
2509
2532
|
value: r,
|
|
2510
|
-
mode:
|
|
2511
|
-
onChange:
|
|
2533
|
+
mode: v,
|
|
2534
|
+
onChange: v === "edit" ? f : void 0,
|
|
2512
2535
|
refs: o,
|
|
2513
|
-
t:
|
|
2536
|
+
t: u
|
|
2514
2537
|
})
|
|
2515
2538
|
});
|
|
2516
2539
|
}
|
|
2517
2540
|
//#endregion
|
|
2518
2541
|
//#region src/components/shared/StatusStepper.tsx
|
|
2519
|
-
function
|
|
2520
|
-
let
|
|
2542
|
+
function zt({ stages: e, current: t, selectable: n, onSelect: r, compact: i = !1 }) {
|
|
2543
|
+
let a = e.findIndex((e) => e.code === t);
|
|
2521
2544
|
return /* @__PURE__ */ Y("div", {
|
|
2522
2545
|
role: "list",
|
|
2523
2546
|
style: {
|
|
@@ -2528,30 +2551,30 @@ function It({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
|
|
|
2528
2551
|
border: "1px solid var(--border)",
|
|
2529
2552
|
background: "var(--surface)"
|
|
2530
2553
|
},
|
|
2531
|
-
children:
|
|
2532
|
-
let
|
|
2554
|
+
children: e.map((t, o) => {
|
|
2555
|
+
let s = a >= 0 && o < a, c = o === a, l = a < 0 || o > a, u = !!r && (n?.has(t.code) ?? !1), d = o === 0, f = o === e.length - 1, p = c ? "var(--accent-soft)" : s ? "var(--success-soft)" : "transparent", m = c ? "var(--accent)" : s ? "var(--success)" : "var(--text-3)", h = d && f ? void 0 : d ? "polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%)" : f ? "polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%)" : "polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%)";
|
|
2533
2556
|
return /* @__PURE__ */ X("button", {
|
|
2534
2557
|
role: "listitem",
|
|
2535
2558
|
type: "button",
|
|
2536
|
-
disabled: !
|
|
2537
|
-
onClick:
|
|
2538
|
-
title:
|
|
2559
|
+
disabled: !u,
|
|
2560
|
+
onClick: u ? () => r(t.code) : void 0,
|
|
2561
|
+
title: t.label,
|
|
2539
2562
|
style: {
|
|
2540
2563
|
flex: 1,
|
|
2541
2564
|
minWidth: 0,
|
|
2542
2565
|
display: "flex",
|
|
2543
2566
|
alignItems: "center",
|
|
2544
2567
|
gap: 6,
|
|
2545
|
-
padding:
|
|
2568
|
+
padding: i ? `6px 8px 6px ${d ? 10 : 20}px` : `8px 10px 8px ${d ? 12 : 24}px`,
|
|
2546
2569
|
border: 0,
|
|
2547
|
-
borderLeft:
|
|
2548
|
-
background:
|
|
2549
|
-
color:
|
|
2550
|
-
fontSize:
|
|
2570
|
+
borderLeft: o > 0 ? "1px solid var(--divider)" : "none",
|
|
2571
|
+
background: p,
|
|
2572
|
+
color: m,
|
|
2573
|
+
fontSize: i ? 11.5 : 12.5,
|
|
2551
2574
|
fontFamily: "inherit",
|
|
2552
|
-
fontWeight:
|
|
2553
|
-
cursor:
|
|
2554
|
-
clipPath:
|
|
2575
|
+
fontWeight: c ? 600 : 500,
|
|
2576
|
+
cursor: u ? "pointer" : "default",
|
|
2577
|
+
clipPath: h,
|
|
2555
2578
|
whiteSpace: "nowrap"
|
|
2556
2579
|
},
|
|
2557
2580
|
children: [/* @__PURE__ */ Y("span", {
|
|
@@ -2560,31 +2583,31 @@ function It({ stages: t, current: n, selectable: r, onSelect: i, compact: a = !1
|
|
|
2560
2583
|
height: 16,
|
|
2561
2584
|
borderRadius: 999,
|
|
2562
2585
|
flexShrink: 0,
|
|
2563
|
-
background:
|
|
2564
|
-
border:
|
|
2565
|
-
color:
|
|
2586
|
+
background: l ? "transparent" : m,
|
|
2587
|
+
border: l ? "1px solid var(--border-strong)" : "none",
|
|
2588
|
+
color: l ? "var(--text-4)" : c ? "var(--accent-soft)" : "var(--success-soft)",
|
|
2566
2589
|
display: "flex",
|
|
2567
2590
|
alignItems: "center",
|
|
2568
2591
|
justifyContent: "center",
|
|
2569
2592
|
fontSize: 9.5,
|
|
2570
2593
|
fontWeight: 700
|
|
2571
2594
|
},
|
|
2572
|
-
children:
|
|
2595
|
+
children: s ? /* @__PURE__ */ Y(w.check, { size: 10 }) : o + 1
|
|
2573
2596
|
}), /* @__PURE__ */ Y("span", {
|
|
2574
2597
|
style: {
|
|
2575
2598
|
overflow: "hidden",
|
|
2576
2599
|
textOverflow: "ellipsis"
|
|
2577
2600
|
},
|
|
2578
|
-
children:
|
|
2601
|
+
children: t.label
|
|
2579
2602
|
})]
|
|
2580
|
-
},
|
|
2603
|
+
}, t.code);
|
|
2581
2604
|
})
|
|
2582
2605
|
});
|
|
2583
2606
|
}
|
|
2584
2607
|
//#endregion
|
|
2585
2608
|
//#region src/components/shared/StatusGroupsDisplay.tsx
|
|
2586
|
-
function
|
|
2587
|
-
let a =
|
|
2609
|
+
function Bt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r, mode: i = "edit" }) {
|
|
2610
|
+
let a = x();
|
|
2588
2611
|
return /* @__PURE__ */ Y("div", {
|
|
2589
2612
|
style: {
|
|
2590
2613
|
display: "flex",
|
|
@@ -2616,7 +2639,7 @@ function Lt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2616
2639
|
opacity: r ? .6 : 1,
|
|
2617
2640
|
pointerEvents: r ? "none" : "auto"
|
|
2618
2641
|
},
|
|
2619
|
-
children: /* @__PURE__ */ Y(
|
|
2642
|
+
children: /* @__PURE__ */ Y(zt, {
|
|
2620
2643
|
stages: o.statuses.map((e) => ({
|
|
2621
2644
|
code: e.code,
|
|
2622
2645
|
label: a(e.name)
|
|
@@ -2641,7 +2664,7 @@ function Lt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2641
2664
|
color: "var(--text-3)"
|
|
2642
2665
|
},
|
|
2643
2666
|
children: [a(o.name), ":"]
|
|
2644
|
-
}), c ? /* @__PURE__ */ Y(
|
|
2667
|
+
}), c ? /* @__PURE__ */ Y(D, {
|
|
2645
2668
|
tone: c.color ?? "slate",
|
|
2646
2669
|
size: "xs",
|
|
2647
2670
|
children: a(c.name)
|
|
@@ -2688,7 +2711,7 @@ function Lt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2688
2711
|
opacity: r ? .6 : 1,
|
|
2689
2712
|
pointerEvents: r ? "none" : "auto"
|
|
2690
2713
|
},
|
|
2691
|
-
children: /* @__PURE__ */ Y(
|
|
2714
|
+
children: /* @__PURE__ */ Y(j, {
|
|
2692
2715
|
value: s ?? "",
|
|
2693
2716
|
options: l,
|
|
2694
2717
|
onChange: (t) => n(e, t)
|
|
@@ -2700,31 +2723,31 @@ function Lt({ statusGroups: e, objectStatuses: t, onSetStatus: n, isPending: r,
|
|
|
2700
2723
|
}
|
|
2701
2724
|
//#endregion
|
|
2702
2725
|
//#region src/components/detail-layout/StatusesBlock.tsx
|
|
2703
|
-
var
|
|
2704
|
-
function
|
|
2726
|
+
var Vt = () => {};
|
|
2727
|
+
function Ht({ node: e, ctx: t }) {
|
|
2705
2728
|
let { entity: n, objectStatuses: r, onSetStatus: i, isStatusPending: a, isNew: o } = t, s = n.status_groups ?? {};
|
|
2706
2729
|
if (o) return null;
|
|
2707
2730
|
let c = e.statuses === !0 || e.statuses, l = Object.fromEntries(Object.entries(s).filter(([e]) => c === !0 || c.includes(e)));
|
|
2708
|
-
return Object.keys(l).length === 0 ? null : /* @__PURE__ */ Y(
|
|
2731
|
+
return Object.keys(l).length === 0 ? null : /* @__PURE__ */ Y(Bt, {
|
|
2709
2732
|
statusGroups: l,
|
|
2710
2733
|
objectStatuses: r,
|
|
2711
|
-
onSetStatus: i ??
|
|
2734
|
+
onSetStatus: i ?? Vt,
|
|
2712
2735
|
isPending: a ?? !1,
|
|
2713
2736
|
mode: t.mode
|
|
2714
2737
|
});
|
|
2715
2738
|
}
|
|
2716
2739
|
//#endregion
|
|
2717
2740
|
//#region src/components/detail-layout/widgets/canonicalizeJson.ts
|
|
2718
|
-
function
|
|
2719
|
-
if (Array.isArray(e)) return e.map(
|
|
2741
|
+
function Ut(e) {
|
|
2742
|
+
if (Array.isArray(e)) return e.map(Ut);
|
|
2720
2743
|
if (typeof e == "object" && e) {
|
|
2721
2744
|
let t = e, n = {};
|
|
2722
|
-
for (let e of Object.keys(t).sort()) n[e] =
|
|
2745
|
+
for (let e of Object.keys(t).sort()) n[e] = Ut(t[e]);
|
|
2723
2746
|
return n;
|
|
2724
2747
|
}
|
|
2725
2748
|
return e;
|
|
2726
2749
|
}
|
|
2727
|
-
function
|
|
2750
|
+
function Wt(e) {
|
|
2728
2751
|
switch (typeof e) {
|
|
2729
2752
|
case "string": return e;
|
|
2730
2753
|
case "number":
|
|
@@ -2736,44 +2759,44 @@ function Vt(e) {
|
|
|
2736
2759
|
default: return "";
|
|
2737
2760
|
}
|
|
2738
2761
|
}
|
|
2739
|
-
function
|
|
2762
|
+
function Gt(e) {
|
|
2740
2763
|
if (e == null) return "";
|
|
2741
2764
|
try {
|
|
2742
|
-
return JSON.stringify(
|
|
2765
|
+
return JSON.stringify(Ut(e), null, 2) ?? Wt(e);
|
|
2743
2766
|
} catch {
|
|
2744
|
-
return
|
|
2767
|
+
return Wt(e);
|
|
2745
2768
|
}
|
|
2746
2769
|
}
|
|
2747
2770
|
//#endregion
|
|
2748
2771
|
//#region src/components/detail-layout/widgets/JsonDiffWidget.tsx
|
|
2749
|
-
function
|
|
2772
|
+
function Kt(e) {
|
|
2750
2773
|
return e("record.diff.editor", "Audit change diff");
|
|
2751
2774
|
}
|
|
2752
|
-
var
|
|
2753
|
-
function
|
|
2754
|
-
let e =
|
|
2775
|
+
var qt = ve(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonDiff }))), Jt = ve(() => import("./MonacoJson-BG3S3GHX.js").then((e) => ({ default: e.MonacoJsonSource }))), Yt = ve(() => import("./JsonEditor-Dz1PQHC8.js").then((e) => ({ default: e.JsonEditor })));
|
|
2776
|
+
function Xt() {
|
|
2777
|
+
let e = x();
|
|
2755
2778
|
return /* @__PURE__ */ Y("div", {
|
|
2756
2779
|
className: "flex h-full w-full items-center justify-center text-sm text-muted-foreground",
|
|
2757
2780
|
children: e("record.diff.loading_editor", "Loading editor…")
|
|
2758
2781
|
});
|
|
2759
2782
|
}
|
|
2760
|
-
function
|
|
2761
|
-
let n =
|
|
2762
|
-
return /* @__PURE__ */ Y(
|
|
2763
|
-
fallback: /* @__PURE__ */ Y(
|
|
2783
|
+
function Zt({ before: e, after: t }) {
|
|
2784
|
+
let n = x();
|
|
2785
|
+
return /* @__PURE__ */ Y(_e, {
|
|
2786
|
+
fallback: /* @__PURE__ */ Y(Xt, {}),
|
|
2764
2787
|
children: /* @__PURE__ */ X("div", {
|
|
2765
2788
|
className: "flex h-full w-full gap-2",
|
|
2766
2789
|
role: "group",
|
|
2767
|
-
"aria-label":
|
|
2790
|
+
"aria-label": Kt(n),
|
|
2768
2791
|
children: [/* @__PURE__ */ Y("div", {
|
|
2769
2792
|
className: "min-w-0 flex-1",
|
|
2770
|
-
children: /* @__PURE__ */ Y(
|
|
2793
|
+
children: /* @__PURE__ */ Y(Yt, {
|
|
2771
2794
|
value: e,
|
|
2772
2795
|
readOnly: !0
|
|
2773
2796
|
})
|
|
2774
2797
|
}), /* @__PURE__ */ Y("div", {
|
|
2775
2798
|
className: "min-w-0 flex-1",
|
|
2776
|
-
children: /* @__PURE__ */ Y(
|
|
2799
|
+
children: /* @__PURE__ */ Y(Yt, {
|
|
2777
2800
|
value: t,
|
|
2778
2801
|
readOnly: !0
|
|
2779
2802
|
})
|
|
@@ -2781,8 +2804,8 @@ function Jt({ before: e, after: t }) {
|
|
|
2781
2804
|
})
|
|
2782
2805
|
});
|
|
2783
2806
|
}
|
|
2784
|
-
function
|
|
2785
|
-
let n =
|
|
2807
|
+
function Qt({ mode: e, onChange: t }) {
|
|
2808
|
+
let n = x();
|
|
2786
2809
|
return /* @__PURE__ */ X("div", {
|
|
2787
2810
|
className: "inline-flex gap-1",
|
|
2788
2811
|
role: "group",
|
|
@@ -2802,13 +2825,13 @@ function Yt({ mode: e, onChange: t }) {
|
|
|
2802
2825
|
})]
|
|
2803
2826
|
});
|
|
2804
2827
|
}
|
|
2805
|
-
function
|
|
2806
|
-
let n =
|
|
2828
|
+
function $t({ values: e, options: t }) {
|
|
2829
|
+
let n = x(), r = e.before, i = e.after, a = t?.default_mode === "source" ? "source" : "diff", [o, s] = q(a), c = Gt(r), l = Gt(i);
|
|
2807
2830
|
return /* @__PURE__ */ X("div", {
|
|
2808
2831
|
className: "flex flex-col gap-2",
|
|
2809
2832
|
children: [/* @__PURE__ */ X("div", {
|
|
2810
2833
|
className: "flex items-center justify-between",
|
|
2811
|
-
children: [/* @__PURE__ */ Y(
|
|
2834
|
+
children: [/* @__PURE__ */ Y(Qt, {
|
|
2812
2835
|
mode: o,
|
|
2813
2836
|
onChange: s
|
|
2814
2837
|
}), c === l && /* @__PURE__ */ Y("span", {
|
|
@@ -2819,25 +2842,25 @@ function Xt({ values: e, options: t }) {
|
|
|
2819
2842
|
}), /* @__PURE__ */ Y("div", {
|
|
2820
2843
|
className: "h-[480px] w-full overflow-hidden rounded border",
|
|
2821
2844
|
role: "group",
|
|
2822
|
-
"aria-label":
|
|
2823
|
-
children: /* @__PURE__ */ Y(
|
|
2824
|
-
fallback: /* @__PURE__ */ Y(
|
|
2845
|
+
"aria-label": Kt(n),
|
|
2846
|
+
children: /* @__PURE__ */ Y(I, {
|
|
2847
|
+
fallback: /* @__PURE__ */ Y(Zt, {
|
|
2825
2848
|
before: r,
|
|
2826
2849
|
after: i
|
|
2827
2850
|
}),
|
|
2828
|
-
children: /* @__PURE__ */ Y(
|
|
2829
|
-
fallback: /* @__PURE__ */ Y(
|
|
2830
|
-
children: o === "diff" ? /* @__PURE__ */ Y(
|
|
2851
|
+
children: /* @__PURE__ */ Y(_e, {
|
|
2852
|
+
fallback: /* @__PURE__ */ Y(Xt, {}),
|
|
2853
|
+
children: o === "diff" ? /* @__PURE__ */ Y(qt, {
|
|
2831
2854
|
before: c,
|
|
2832
2855
|
after: l
|
|
2833
2856
|
}) : /* @__PURE__ */ X("div", {
|
|
2834
2857
|
className: "flex h-full w-full gap-2",
|
|
2835
2858
|
children: [/* @__PURE__ */ Y("div", {
|
|
2836
2859
|
className: "min-w-0 flex-1",
|
|
2837
|
-
children: /* @__PURE__ */ Y(
|
|
2860
|
+
children: /* @__PURE__ */ Y(Jt, { value: c })
|
|
2838
2861
|
}), /* @__PURE__ */ Y("div", {
|
|
2839
2862
|
className: "min-w-0 flex-1",
|
|
2840
|
-
children: /* @__PURE__ */ Y(
|
|
2863
|
+
children: /* @__PURE__ */ Y(Jt, { value: l })
|
|
2841
2864
|
})]
|
|
2842
2865
|
})
|
|
2843
2866
|
})
|
|
@@ -2856,7 +2879,7 @@ function $(e) {
|
|
|
2856
2879
|
let n = Object.entries(t).filter((e) => typeof e[1] == "string");
|
|
2857
2880
|
return n.length > 0 ? Object.fromEntries(n) : void 0;
|
|
2858
2881
|
}
|
|
2859
|
-
function
|
|
2882
|
+
function en(e) {
|
|
2860
2883
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
2861
2884
|
let t = Q(e);
|
|
2862
2885
|
return !t || typeof t.field != "string" ? [] : [{
|
|
@@ -2866,7 +2889,7 @@ function Zt(e) {
|
|
|
2866
2889
|
}];
|
|
2867
2890
|
}) : [];
|
|
2868
2891
|
}
|
|
2869
|
-
function
|
|
2892
|
+
function tn(e) {
|
|
2870
2893
|
if (!e || typeof e.entity != "string" || typeof e.scope_field != "string" || typeof e.window_field != "string") return;
|
|
2871
2894
|
let t = Array.isArray(e.windows) ? e.windows.flatMap((e) => {
|
|
2872
2895
|
let t = Q(e);
|
|
@@ -2901,7 +2924,7 @@ function Qt(e) {
|
|
|
2901
2924
|
filter_label: $(r.filter_label),
|
|
2902
2925
|
all_label: $(r.all_label),
|
|
2903
2926
|
empty_label: $(r.empty_label),
|
|
2904
|
-
columns:
|
|
2927
|
+
columns: en(r.columns),
|
|
2905
2928
|
sort: typeof r.sort == "string" ? r.sort : void 0,
|
|
2906
2929
|
limit: typeof r.limit == "number" ? Math.min(500, Math.max(1, r.limit)) : 200
|
|
2907
2930
|
} : void 0, a = Q(e.drillthrough), o = a && typeof a.route == "string" && typeof a.scope_field == "string" && typeof a.window_field == "string" ? {
|
|
@@ -2926,7 +2949,7 @@ function Qt(e) {
|
|
|
2926
2949
|
drillthrough: o
|
|
2927
2950
|
};
|
|
2928
2951
|
}
|
|
2929
|
-
function
|
|
2952
|
+
function nn(e, t) {
|
|
2930
2953
|
let n = (e, n) => new Intl.NumberFormat(t, {
|
|
2931
2954
|
style: "unit",
|
|
2932
2955
|
unit: e,
|
|
@@ -2934,7 +2957,7 @@ function $t(e, t) {
|
|
|
2934
2957
|
}).format(n);
|
|
2935
2958
|
return e >= 86400 ? n("day", Math.floor(e / 86400)) : e >= 3600 ? n("hour", Math.floor(e / 3600)) : e >= 60 ? n("minute", Math.floor(e / 60)) : n("second", Math.max(0, Math.floor(e)));
|
|
2936
2959
|
}
|
|
2937
|
-
function
|
|
2960
|
+
function rn(e, t, n) {
|
|
2938
2961
|
let r = e("record.scorecard.not_available", "N/A"), i = e.language;
|
|
2939
2962
|
if (t == null || t === "") return r;
|
|
2940
2963
|
if (n === "number") return new Intl.NumberFormat(i).format(Number(t));
|
|
@@ -2944,7 +2967,7 @@ function en(e, t, n) {
|
|
|
2944
2967
|
}).format(Number(t));
|
|
2945
2968
|
if (n === "duration_seconds") {
|
|
2946
2969
|
let e = Number(t);
|
|
2947
|
-
return Number.isFinite(e) ?
|
|
2970
|
+
return Number.isFinite(e) ? nn(e, i) : r;
|
|
2948
2971
|
}
|
|
2949
2972
|
if (n === "timestamp") {
|
|
2950
2973
|
if (typeof t != "string" && typeof t != "number" && !(t instanceof Date)) return r;
|
|
@@ -2953,55 +2976,55 @@ function en(e, t, n) {
|
|
|
2953
2976
|
}
|
|
2954
2977
|
return typeof t == "string" ? t : typeof t == "number" || typeof t == "bigint" || typeof t == "boolean" ? String(t) : r;
|
|
2955
2978
|
}
|
|
2956
|
-
function
|
|
2979
|
+
function an(e, t) {
|
|
2957
2980
|
return typeof e.id == "string" || typeof e.id == "number" ? String(e.id) : `row-${t}`;
|
|
2958
2981
|
}
|
|
2959
|
-
function
|
|
2982
|
+
function on(e, t) {
|
|
2960
2983
|
return !t || Object.entries(t).every(([t, n]) => e[t] === n);
|
|
2961
2984
|
}
|
|
2962
|
-
function
|
|
2963
|
-
let n =
|
|
2985
|
+
function sn({ values: e, options: t }) {
|
|
2986
|
+
let n = x(), i = x("errors"), a = xe(() => tn(t), [t]), o = B(), s = e.scope, c = a?.windows.some((e) => e.code === a.default_window) ? a.default_window : a?.windows[0]?.code ?? "", [l, u] = q(c), [d, f] = q("");
|
|
2964
2987
|
G(() => {
|
|
2965
|
-
u(
|
|
2966
|
-
}, [
|
|
2988
|
+
u(c);
|
|
2989
|
+
}, [c]), G(() => {
|
|
2967
2990
|
f("");
|
|
2968
2991
|
}, [l]);
|
|
2969
|
-
let p =
|
|
2970
|
-
field:
|
|
2992
|
+
let p = a ? [{
|
|
2993
|
+
field: a.scope_field,
|
|
2971
2994
|
op: "eq",
|
|
2972
|
-
value:
|
|
2995
|
+
value: s
|
|
2973
2996
|
}, {
|
|
2974
|
-
field:
|
|
2997
|
+
field: a.window_field,
|
|
2975
2998
|
op: "eq",
|
|
2976
2999
|
value: l
|
|
2977
|
-
}] : [], m =
|
|
3000
|
+
}] : [], m = g(a?.entity, {
|
|
2978
3001
|
per_page: 1,
|
|
2979
3002
|
filters: p
|
|
2980
|
-
}, !!(
|
|
3003
|
+
}, !!(a && s && l)), h = a?.breakdown, _ = h ? [{
|
|
2981
3004
|
field: h.scope_field,
|
|
2982
3005
|
op: "eq",
|
|
2983
|
-
value:
|
|
3006
|
+
value: s
|
|
2984
3007
|
}, {
|
|
2985
3008
|
field: h.window_field,
|
|
2986
3009
|
op: "eq",
|
|
2987
3010
|
value: l
|
|
2988
|
-
}] : [],
|
|
3011
|
+
}] : [], v = g(h?.entity, {
|
|
2989
3012
|
per_page: h?.limit ?? 200,
|
|
2990
3013
|
sort: h?.sort,
|
|
2991
|
-
filters:
|
|
2992
|
-
}, !!(h &&
|
|
2993
|
-
if (!
|
|
3014
|
+
filters: _
|
|
3015
|
+
}, !!(h && s && l));
|
|
3016
|
+
if (!a || !s) return /* @__PURE__ */ Y("div", {
|
|
2994
3017
|
role: "alert",
|
|
2995
3018
|
className: "rounded border border-destructive p-3 text-sm text-destructive",
|
|
2996
|
-
children:
|
|
3019
|
+
children: i("record.scorecard_config_invalid", "Invalid entity_scorecard configuration.")
|
|
2997
3020
|
});
|
|
2998
|
-
let
|
|
2999
|
-
let t =
|
|
3021
|
+
let y = m.data?.data?.[0], b = v.data?.data ?? [], S = h?.filter_field ? Array.from(new Set(b.map((e) => e[h.filter_field]).filter((e) => typeof e == "string" && e !== ""))).sort() : [], C = d && h?.filter_field ? b.filter((e) => e[h.filter_field] === d) : b, w = (e) => !d || !e.filtered || !h?.filter_field ? y?.[e.field] : b.find((t) => t[h.filter_field] === d && on(t, e.filtered?.where))?.[e.filtered.field], T = (e) => {
|
|
3022
|
+
let t = a.drillthrough;
|
|
3000
3023
|
if (!t || !e.drillthrough_value) return;
|
|
3001
3024
|
let n = [{
|
|
3002
3025
|
field: t.scope_field,
|
|
3003
3026
|
op: "eq",
|
|
3004
|
-
value:
|
|
3027
|
+
value: s
|
|
3005
3028
|
}, {
|
|
3006
3029
|
field: t.window_field,
|
|
3007
3030
|
op: "eq",
|
|
@@ -3015,28 +3038,28 @@ function rn({ values: e, options: t }) {
|
|
|
3015
3038
|
field: t.metric_field,
|
|
3016
3039
|
op: "eq",
|
|
3017
3040
|
value: e.drillthrough_value
|
|
3018
|
-
}),
|
|
3019
|
-
},
|
|
3041
|
+
}), o(t.route, { search: new URLSearchParams({ filters: JSON.stringify(n) }).toString() });
|
|
3042
|
+
}, E = m.error ?? v.error, D = n(h?.filter_label) || n("record.scorecard.filter", "Filter");
|
|
3020
3043
|
return /* @__PURE__ */ X("div", {
|
|
3021
3044
|
className: "flex min-w-0 flex-col gap-4",
|
|
3022
|
-
"aria-label": n(
|
|
3045
|
+
"aria-label": n(a.title) || n("record.scorecard.title", "Scorecard"),
|
|
3023
3046
|
children: [
|
|
3024
3047
|
/* @__PURE__ */ X("div", {
|
|
3025
3048
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
3026
3049
|
children: [/* @__PURE__ */ X("div", {
|
|
3027
3050
|
className: "min-w-0",
|
|
3028
3051
|
children: [
|
|
3029
|
-
|
|
3052
|
+
a.title && /* @__PURE__ */ Y("h3", {
|
|
3030
3053
|
className: "text-base font-semibold text-foreground",
|
|
3031
|
-
children: n(
|
|
3054
|
+
children: n(a.title)
|
|
3032
3055
|
}),
|
|
3033
|
-
|
|
3056
|
+
a.description && /* @__PURE__ */ Y("p", {
|
|
3034
3057
|
className: "mt-1 text-sm text-muted-foreground",
|
|
3035
|
-
children: n(
|
|
3058
|
+
children: n(a.description)
|
|
3036
3059
|
}),
|
|
3037
|
-
|
|
3060
|
+
a.intended_note && /* @__PURE__ */ Y("p", {
|
|
3038
3061
|
className: "mt-1 text-xs text-muted-foreground",
|
|
3039
|
-
children: n(
|
|
3062
|
+
children: n(a.intended_note)
|
|
3040
3063
|
})
|
|
3041
3064
|
]
|
|
3042
3065
|
}), /* @__PURE__ */ X("div", {
|
|
@@ -3045,7 +3068,7 @@ function rn({ values: e, options: t }) {
|
|
|
3045
3068
|
role: "group",
|
|
3046
3069
|
"aria-label": n("record.scorecard.window", "Scorecard window"),
|
|
3047
3070
|
className: "inline-flex rounded border border-border p-1",
|
|
3048
|
-
children:
|
|
3071
|
+
children: a.windows.map((e) => /* @__PURE__ */ Y("button", {
|
|
3049
3072
|
type: "button",
|
|
3050
3073
|
"aria-pressed": l === e.code,
|
|
3051
3074
|
onClick: () => u(e.code),
|
|
@@ -3054,15 +3077,15 @@ function rn({ values: e, options: t }) {
|
|
|
3054
3077
|
}, e.code))
|
|
3055
3078
|
}), h?.filter_field && /* @__PURE__ */ X("label", {
|
|
3056
3079
|
className: "flex items-center gap-2 text-xs text-muted-foreground",
|
|
3057
|
-
children: [
|
|
3058
|
-
"aria-label":
|
|
3080
|
+
children: [D, /* @__PURE__ */ X("select", {
|
|
3081
|
+
"aria-label": D,
|
|
3059
3082
|
value: d,
|
|
3060
3083
|
onChange: (e) => f(e.target.value),
|
|
3061
3084
|
className: "rounded border border-border bg-background px-2 py-1.5 text-foreground",
|
|
3062
3085
|
children: [/* @__PURE__ */ Y("option", {
|
|
3063
3086
|
value: "",
|
|
3064
3087
|
children: n(h.all_label) || n("record.scorecard.all", "All")
|
|
3065
|
-
}),
|
|
3088
|
+
}), S.map((e) => /* @__PURE__ */ Y("option", {
|
|
3066
3089
|
value: e,
|
|
3067
3090
|
children: e
|
|
3068
3091
|
}, e))]
|
|
@@ -3070,26 +3093,26 @@ function rn({ values: e, options: t }) {
|
|
|
3070
3093
|
})]
|
|
3071
3094
|
})]
|
|
3072
3095
|
}),
|
|
3073
|
-
|
|
3096
|
+
E && /* @__PURE__ */ Y("div", {
|
|
3074
3097
|
role: "alert",
|
|
3075
3098
|
className: "rounded border border-destructive p-3 text-sm text-destructive",
|
|
3076
|
-
children:
|
|
3099
|
+
children: r(i, E)
|
|
3077
3100
|
}),
|
|
3078
|
-
!
|
|
3101
|
+
!E && !m.isLoading && !y && /* @__PURE__ */ Y("div", {
|
|
3079
3102
|
className: "rounded border border-border p-6 text-center text-sm text-muted-foreground",
|
|
3080
|
-
children: n(
|
|
3103
|
+
children: n(a.empty_label) || n("record.scorecard.empty", "No scorecard data.")
|
|
3081
3104
|
}),
|
|
3082
|
-
|
|
3105
|
+
y && /* @__PURE__ */ Y("div", {
|
|
3083
3106
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
3084
|
-
children:
|
|
3085
|
-
let t =
|
|
3107
|
+
children: a.metrics.map((e) => {
|
|
3108
|
+
let t = w(e), r = !!(a.drillthrough && e.drillthrough_value), i = /* @__PURE__ */ X(J, { children: [
|
|
3086
3109
|
/* @__PURE__ */ Y("span", {
|
|
3087
3110
|
className: "text-xs font-medium text-muted-foreground",
|
|
3088
3111
|
children: n(e.label) || e.field
|
|
3089
3112
|
}),
|
|
3090
3113
|
/* @__PURE__ */ Y("strong", {
|
|
3091
3114
|
className: `mt-2 block text-2xl font-semibold ${e.attention && Number(t) > 0 ? "text-destructive" : "text-foreground"}`,
|
|
3092
|
-
children:
|
|
3115
|
+
children: rn(n, t, e.format)
|
|
3093
3116
|
}),
|
|
3094
3117
|
e.help && /* @__PURE__ */ Y("span", {
|
|
3095
3118
|
className: "mt-1 block text-xs text-muted-foreground",
|
|
@@ -3098,12 +3121,12 @@ function rn({ values: e, options: t }) {
|
|
|
3098
3121
|
] });
|
|
3099
3122
|
return r ? /* @__PURE__ */ Y("button", {
|
|
3100
3123
|
type: "button",
|
|
3101
|
-
onClick: () =>
|
|
3124
|
+
onClick: () => T(e),
|
|
3102
3125
|
className: "rounded border border-border bg-card p-3 text-left hover:bg-surface",
|
|
3103
|
-
children:
|
|
3126
|
+
children: i
|
|
3104
3127
|
}, e.field) : /* @__PURE__ */ Y("article", {
|
|
3105
3128
|
className: "rounded border border-border bg-card p-3",
|
|
3106
|
-
children:
|
|
3129
|
+
children: i
|
|
3107
3130
|
}, e.field);
|
|
3108
3131
|
})
|
|
3109
3132
|
}),
|
|
@@ -3117,13 +3140,13 @@ function rn({ values: e, options: t }) {
|
|
|
3117
3140
|
className: "border-b border-divider px-3 py-2 font-medium",
|
|
3118
3141
|
children: n(e.label) || e.field
|
|
3119
3142
|
}, e.field)) })
|
|
3120
|
-
}), /* @__PURE__ */ X("tbody", { children: [
|
|
3143
|
+
}), /* @__PURE__ */ X("tbody", { children: [C.map((e, t) => /* @__PURE__ */ Y("tr", {
|
|
3121
3144
|
className: "border-b border-divider last:border-0",
|
|
3122
3145
|
children: h.columns.map((t) => /* @__PURE__ */ Y("td", {
|
|
3123
3146
|
className: "px-3 py-2 text-foreground",
|
|
3124
|
-
children:
|
|
3147
|
+
children: rn(n, e[t.field], t.format)
|
|
3125
3148
|
}, t.field))
|
|
3126
|
-
},
|
|
3149
|
+
}, an(e, t))), !v.isLoading && C.length === 0 && /* @__PURE__ */ Y("tr", { children: /* @__PURE__ */ Y("td", {
|
|
3127
3150
|
colSpan: Math.max(1, h.columns.length),
|
|
3128
3151
|
className: "px-3 py-6 text-center text-muted-foreground",
|
|
3129
3152
|
children: n(h.empty_label) || n("record.scorecard.breakdown_empty", "No breakdown rows.")
|
|
@@ -3135,15 +3158,15 @@ function rn({ values: e, options: t }) {
|
|
|
3135
3158
|
}
|
|
3136
3159
|
//#endregion
|
|
3137
3160
|
//#region src/components/detail-layout/widgets/builtins.ts
|
|
3138
|
-
var
|
|
3139
|
-
function
|
|
3140
|
-
|
|
3161
|
+
var cn = !1;
|
|
3162
|
+
function ln() {
|
|
3163
|
+
cn ||= (L("json_diff", $t), L("entity_scorecard", sn), !0);
|
|
3141
3164
|
}
|
|
3142
3165
|
//#endregion
|
|
3143
3166
|
//#region src/components/detail-layout/widgets/WidgetHost.tsx
|
|
3144
|
-
|
|
3145
|
-
function
|
|
3146
|
-
let n =
|
|
3167
|
+
ln();
|
|
3168
|
+
function un({ config: e, ctx: t }) {
|
|
3169
|
+
let n = x("errors"), r = ee(e.type);
|
|
3147
3170
|
if (!r) return /* @__PURE__ */ X("span", {
|
|
3148
3171
|
className: "text-sm text-muted-foreground",
|
|
3149
3172
|
children: [
|
|
@@ -3172,45 +3195,45 @@ function sn({ config: e, ctx: t }) {
|
|
|
3172
3195
|
}
|
|
3173
3196
|
//#endregion
|
|
3174
3197
|
//#region src/components/detail-layout/LayoutRenderer.tsx
|
|
3175
|
-
function
|
|
3176
|
-
return /* @__PURE__ */ Y(J, { children: e.map((e, n) => /* @__PURE__ */ Y(
|
|
3198
|
+
function dn({ nodes: e, ctx: t }) {
|
|
3199
|
+
return /* @__PURE__ */ Y(J, { children: e.map((e, n) => /* @__PURE__ */ Y(fn, {
|
|
3177
3200
|
node: e,
|
|
3178
3201
|
ctx: t
|
|
3179
3202
|
}, n)) });
|
|
3180
3203
|
}
|
|
3181
|
-
function
|
|
3182
|
-
return e.row ? /* @__PURE__ */ Y(
|
|
3204
|
+
function fn({ node: e, ctx: t }) {
|
|
3205
|
+
return e.row ? /* @__PURE__ */ Y(De, {
|
|
3183
3206
|
config: e.row,
|
|
3184
3207
|
ctx: t
|
|
3185
|
-
}) : e.column ? /* @__PURE__ */ Y(
|
|
3208
|
+
}) : e.column ? /* @__PURE__ */ Y(Ae, {
|
|
3186
3209
|
config: e.column,
|
|
3187
3210
|
node: e,
|
|
3188
3211
|
ctx: t
|
|
3189
|
-
}) : e.tabs ? /* @__PURE__ */ Y(
|
|
3212
|
+
}) : e.tabs ? /* @__PURE__ */ Y(Pe, {
|
|
3190
3213
|
config: e.tabs,
|
|
3191
3214
|
ctx: t
|
|
3192
|
-
}) : e.section ? /* @__PURE__ */ Y(
|
|
3215
|
+
}) : e.section ? /* @__PURE__ */ Y(Fe, {
|
|
3193
3216
|
config: e.section,
|
|
3194
3217
|
ctx: t
|
|
3195
|
-
}) : e.children ? /* @__PURE__ */ Y(
|
|
3218
|
+
}) : e.children ? /* @__PURE__ */ Y(Nt, {
|
|
3196
3219
|
node: e,
|
|
3197
3220
|
ctx: t
|
|
3198
|
-
}) : e.associated ? /* @__PURE__ */ Y(
|
|
3221
|
+
}) : e.associated ? /* @__PURE__ */ Y(fe, {
|
|
3199
3222
|
node: e,
|
|
3200
3223
|
ctx: t
|
|
3201
|
-
}) : e.fields ? /* @__PURE__ */ Y(
|
|
3224
|
+
}) : e.fields ? /* @__PURE__ */ Y(Pt, {
|
|
3202
3225
|
fields: e.fields,
|
|
3203
3226
|
ctx: t
|
|
3204
|
-
}) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ Y(
|
|
3227
|
+
}) : e.properties == null ? e.statuses == null ? e.widget ? /* @__PURE__ */ Y(un, {
|
|
3205
3228
|
config: e.widget,
|
|
3206
3229
|
ctx: t
|
|
3207
|
-
}) : null : /* @__PURE__ */ Y(
|
|
3230
|
+
}) : null : /* @__PURE__ */ Y(Ht, {
|
|
3208
3231
|
node: e,
|
|
3209
3232
|
ctx: t
|
|
3210
|
-
}) : /* @__PURE__ */ Y(
|
|
3233
|
+
}) : /* @__PURE__ */ Y(Lt, {
|
|
3211
3234
|
node: e,
|
|
3212
3235
|
ctx: t
|
|
3213
3236
|
});
|
|
3214
3237
|
}
|
|
3215
3238
|
//#endregion
|
|
3216
|
-
export {
|
|
3239
|
+
export { Bt as n, dn as t };
|