@plumile/backoffice-react 0.2.3 → 0.2.6
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/README.md +14 -3
- package/lib/esm/auth/AuthRefreshNotice.js +21 -18
- package/lib/esm/auth/AuthRefreshNotice.js.map +1 -1
- package/lib/esm/auth/TotpQrCode.js +20 -12
- package/lib/esm/auth/TotpQrCode.js.map +1 -1
- package/lib/esm/auth/authRefreshNotice.css.js +2 -1
- package/lib/esm/auth/authRefreshNotice.css.js.map +1 -1
- package/lib/esm/auth/login/AuthPanel.js.map +1 -1
- package/lib/esm/auth/login/EmailCapturePanel.js +26 -28
- package/lib/esm/auth/login/EmailCapturePanel.js.map +1 -1
- package/lib/esm/auth/login/LoginFlow.js +11 -11
- package/lib/esm/auth/login/LoginFlow.js.map +1 -1
- package/lib/esm/auth/login/MethodChooser.js +18 -16
- package/lib/esm/auth/login/MethodChooser.js.map +1 -1
- package/lib/esm/auth/login/MfaChallengeForm.js +47 -52
- package/lib/esm/auth/login/MfaChallengeForm.js.map +1 -1
- package/lib/esm/auth/login/OidcButtons.js +3 -2
- package/lib/esm/auth/login/OidcButtons.js.map +1 -1
- package/lib/esm/auth/login/PasskeyLoginForm.js +13 -15
- package/lib/esm/auth/login/PasskeyLoginForm.js.map +1 -1
- package/lib/esm/auth/login/PasswordLoginPanel.js +8 -8
- package/lib/esm/auth/login/PasswordLoginPanel.js.map +1 -1
- package/lib/esm/auth/login/loginPage.css.js +1 -1
- package/lib/esm/auth/login/loginPage.css.js.map +1 -1
- package/lib/esm/auth/pages/AcceptInvitationScreen.js +80 -75
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js +31 -31
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js +33 -29
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -1
- package/lib/esm/auth/pages/VerifyEmailScreen.js +42 -40
- package/lib/esm/auth/pages/VerifyEmailScreen.js.map +1 -1
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +202 -210
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js +1 -1
- package/lib/esm/components/backoffice/actions/backofficeEntityActionFormDialog.css.js.map +1 -1
- package/lib/esm/components/backoffice/actions/toastViewAction.js.map +1 -1
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +36 -30
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js.map +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +1 -1
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js.map +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +36 -33
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailBadgeRow.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailErrorList.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js +24 -20
- package/lib/esm/components/backoffice/detail/BackofficeEntitySummaryHeader.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeRelationsSummaryGrid.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js +7 -8
- package/lib/esm/components/backoffice/detail/BackofficeTokenUsageBreakdown.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js +49 -45
- package/lib/esm/components/backoffice/detail/BackofficeUsageCostBreakdown.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailBadgeRow.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailErrorList.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailLayout.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeDetailRelationList.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeEntitySummaryHeader.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeRelationsSummaryGrid.css.js.map +1 -1
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js +1 -1
- package/lib/esm/components/backoffice/detail/backofficeUsageCostBreakdown.css.js.map +1 -1
- package/lib/esm/components/backoffice/errors/BackofficeErrorBoundary.js +1 -1
- package/lib/esm/components/backoffice/errors/BackofficeErrorBoundary.js.map +1 -1
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js +1 -1
- package/lib/esm/components/backoffice/filters/BackofficeFilterAction.js.map +1 -1
- package/lib/esm/components/backoffice/filters/DeferredFilterSearchInput.js +15 -15
- package/lib/esm/components/backoffice/filters/DeferredFilterSearchInput.js.map +1 -1
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +53 -65
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js.map +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js +1 -1
- package/lib/esm/components/backoffice/filters/backofficeFilterAction.css.js.map +1 -1
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js +1 -1
- package/lib/esm/components/backoffice/filters/deferredFilterSearchInput.css.js.map +1 -1
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js +2 -2
- package/lib/esm/components/backoffice/filters/entityIdFilterField.css.js.map +1 -1
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js +6 -6
- package/lib/esm/components/backoffice/hub/BackofficeHubTemplate.js.map +1 -1
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js +1 -1
- package/lib/esm/components/backoffice/hub/backofficeHubTemplate.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js +1 -1
- package/lib/esm/components/backoffice/layout/backofficeSidebarActions.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +3 -3
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.js.map +1 -1
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js +152 -172
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -1
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js +2 -5
- package/lib/esm/components/backoffice/layout/mapViewerToSidebarProfileView.js.map +1 -1
- package/lib/esm/components/backoffice/layout/sidebarUtils.js +1 -1
- package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +1 -1
- package/lib/esm/components/backoffice/links/backofficeLink.css.js +1 -1
- package/lib/esm/components/backoffice/links/backofficeLink.css.js.map +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js +1 -1
- package/lib/esm/components/backoffice/list/RowFlagsCell.css.js.map +1 -1
- package/lib/esm/components/backoffice/overview/BackofficeOverviewLayout.js +1 -1
- package/lib/esm/components/backoffice/overview/BackofficeOverviewLayout.js.map +1 -1
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js +1 -1
- package/lib/esm/components/backoffice/overview/backofficeOverviewLayout.css.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +93 -82
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js.map +1 -1
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js +1 -1
- package/lib/esm/components/backoffice/refs/backofficeRelatedCountLink.css.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js +6 -3
- package/lib/esm/components/backoffice/routing/BackofficeContentError.js.map +1 -1
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js +7 -7
- package/lib/esm/components/backoffice/routing/BackofficeRouteFallback.js.map +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentBoundary.css.js.map +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentError.css.js.map +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js +1 -1
- package/lib/esm/components/backoffice/routing/backofficeContentFallback.css.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js +3 -2
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +314 -309
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeTabbedDetailShell.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeTabbedDetailShell.css.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js +2 -2
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeInlineFilterRow.js.map +1 -1
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js +5 -5
- package/lib/esm/components/backoffice/shared/backofficeFilterableCell.css.js.map +1 -1
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js +1 -1
- package/lib/esm/components/backoffice/shared/backofficeInlineFilterRow.css.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js +12 -12
- package/lib/esm/components/backoffice/tools/BackofficeToolsDocPanel.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js +3 -2
- package/lib/esm/components/backoffice/tools/BackofficeToolsErrorFallback.js.map +1 -1
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js +15 -19
- package/lib/esm/components/backoffice/tools/BackofficeToolsJsonForm.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsDocPanel.css.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsForm.css.js.map +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js +1 -1
- package/lib/esm/components/backoffice/tools/backofficeToolsJsonForm.css.js.map +1 -1
- package/lib/esm/hooks/useBackofficeInfiniteScrollSentinel.js +17 -9
- package/lib/esm/hooks/useBackofficeInfiniteScrollSentinel.js.map +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js +1 -1
- package/lib/esm/hooks/useCopyToClipboard.js.map +1 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js +21 -2
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js +21 -2
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardPage.js +42 -41
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js +291 -255
- package/lib/esm/pages/BackofficeDashboardWidgetContent.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js +47 -49
- package/lib/esm/pages/BackofficeEntityDetailLayoutPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +111 -105
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +213 -213
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListDataPage.js +101 -83
- package/lib/esm/pages/BackofficeEntityListDataPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js +10 -4
- package/lib/esm/pages/BackofficeEntityListPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.js +55 -54
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListRouteContext.js.map +1 -1
- package/lib/esm/pages/BackofficeHubPage.js +1 -1
- package/lib/esm/pages/BackofficeHubPage.js.map +1 -1
- package/lib/esm/pages/BackofficeLayoutPage.js +64 -56
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/pages/backofficeDashboardPage.css.js +1 -1
- package/lib/esm/pages/backofficeDashboardPage.css.js.map +1 -1
- package/lib/esm/pages/backofficeEntityDetailPage.css.js +1 -1
- package/lib/esm/pages/backofficeEntityDetailPage.css.js.map +1 -1
- package/lib/esm/pages/backofficeEntityListPage.css.js +1 -1
- package/lib/esm/pages/backofficeEntityListPage.css.js.map +1 -1
- package/lib/esm/pages/detail/BackofficeEntityDetailLayoutContext.js.map +1 -1
- package/lib/esm/pages/detail/BackofficeEntityDetailManifestFallback.js +11 -11
- package/lib/esm/pages/detail/BackofficeEntityDetailManifestFallback.js.map +1 -1
- package/lib/esm/pages/detail/buildTabsItems.js.map +1 -1
- package/lib/esm/provider/BackofficeProvider.js +41 -39
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/router/createBackofficeRoutes.js +23 -23
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/esm/storybook/backofficeDashboardPageStory.css.js +6 -0
- package/lib/esm/storybook/backofficeDashboardPageStory.css.js.map +1 -0
- package/lib/esm/storybook/relay/RelayStory.css.js +1 -1
- package/lib/esm/storybook/relay/RelayStory.css.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/auth/AuthRefreshNotice.d.ts +5 -1
- package/lib/types/auth/AuthRefreshNotice.d.ts.map +1 -1
- package/lib/types/auth/TotpQrCode.d.ts +2 -1
- package/lib/types/auth/TotpQrCode.d.ts.map +1 -1
- package/lib/types/auth/authRefreshNotice.css.d.ts.map +1 -1
- package/lib/types/auth/login/AuthPanel.d.ts.map +1 -1
- package/lib/types/auth/login/EmailCapturePanel.d.ts.map +1 -1
- package/lib/types/auth/login/LoginFlow.d.ts.map +1 -1
- package/lib/types/auth/login/MethodChooser.d.ts.map +1 -1
- package/lib/types/auth/login/MfaChallengeForm.d.ts.map +1 -1
- package/lib/types/auth/login/OidcButtons.d.ts.map +1 -1
- package/lib/types/auth/login/PasskeyLoginForm.d.ts.map +1 -1
- package/lib/types/auth/login/PasswordLoginPanel.d.ts +1 -1
- package/lib/types/auth/login/PasswordLoginPanel.d.ts.map +1 -1
- package/lib/types/auth/login/loginPage.css.d.ts.map +1 -1
- package/lib/types/auth/pages/AcceptInvitationScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetCompleteScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/PasswordResetRequestScreen.d.ts.map +1 -1
- package/lib/types/auth/pages/VerifyEmailScreen.d.ts.map +1 -1
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts +3 -3
- package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/actions/toastViewAction.d.ts +1 -1
- package/lib/types/components/backoffice/actions/toastViewAction.d.ts.map +1 -1
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts +2 -1
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts.map +1 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts +2 -2
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailBadgeRow.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeEntitySummaryHeader.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeRelationsSummaryGrid.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeTokenUsageBreakdown.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts +1 -1
- package/lib/types/components/backoffice/detail/BackofficeUsageCostBreakdown.d.ts.map +1 -1
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.d.ts +1 -1
- package/lib/types/components/backoffice/errors/BackofficeErrorBoundary.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/backofficeFilterAction.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/deferredFilterSearchInput.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts +0 -1
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/hub/backofficeHubTemplate.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/backofficeSidebarActions.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +2 -2
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts +1 -1
- package/lib/types/components/backoffice/layout/mapViewerToSidebarProfileView.d.ts.map +1 -1
- package/lib/types/components/backoffice/list/RowFlagsCell.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/overview/backofficeOverviewLayout.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts +3 -3
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/backofficeRelatedCountLink.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/routing/BackofficeContentError.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailNotFound.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts +2 -2
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeTabbedDetailShell.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/backofficeFilterableCell.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsErrorFallback.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/BackofficeToolsJsonForm.d.ts.map +1 -1
- package/lib/types/components/backoffice/tools/backofficeToolsDocPanel.css.d.ts.map +1 -1
- package/lib/types/hooks/useBackofficeInfiniteScrollSentinel.d.ts +1 -2
- package/lib/types/hooks/useBackofficeInfiniteScrollSentinel.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +44 -2
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardWidgetContent.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListDataPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +9 -9
- package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListRouteContext.d.ts +2 -2
- package/lib/types/pages/BackofficeEntityListRouteContext.d.ts.map +1 -1
- package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
- package/lib/types/pages/backofficeEntityListPage.css.d.ts.map +1 -1
- package/lib/types/pages/detail/BackofficeEntityDetailLayoutContext.d.ts +1 -1
- package/lib/types/pages/detail/BackofficeEntityDetailLayoutContext.d.ts.map +1 -1
- package/lib/types/pages/detail/buildTabsItems.d.ts +1 -1
- package/lib/types/pages/detail/buildTabsItems.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/provider/types.d.ts +2 -0
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +0 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/lib/types/storybook/backofficeDashboardPageStory.css.d.ts +2 -0
- package/lib/types/storybook/backofficeDashboardPageStory.css.d.ts.map +1 -0
- package/package.json +17 -17
- package/lib/esm/components/backoffice/technical/TechnicalIdentifierValue.js +0 -2
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts +0 -2
- package/lib/types/components/backoffice/technical/TechnicalIdentifierValue.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityListPage.helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityListPage.helpers.tsx"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"BackofficeEntityListPage.helpers.js","names":[],"sources":["../../../src/pages/BackofficeEntityListPage.helpers.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport type {\n BackofficeRuntimeEntityFormMutationActionSpec,\n BackofficeActionTone,\n BackofficeEntityRouteActionSpec,\n BackofficeActionVariant,\n BackofficeListActionSpec,\n BackofficeRuntimeConnectionListConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\nimport type { ResponsiveRecordListColumn } from '@plumile/ui';\nimport type { TFunction } from 'i18next';\n\nimport type { BackofficeSizedDataTableColumn } from '../components/backoffice/columns/buildDataTableColumns.js';\n\nconst ROW_FLAGS_SLOT_PX = 24;\nconst ROW_FLAGS_GAP_PX = 6;\nconst ROW_FLAGS_PADDING_X_PX = 4;\n\nconst ACTIONS_SLOT_PX = 32;\nconst ACTIONS_GAP_PX = 8;\nconst ACTIONS_PADDING_X_PX = 12;\nconst ACTIONS_SAFETY_PX = 4;\n\nconst listColumnTrackBySize: Record<\n BackofficeSizedDataTableColumn<unknown>['size'],\n string\n> = {\n xs: 'minmax(3.5rem, 7rem)',\n s: 'minmax(5rem, 10rem)',\n statusAction: 'minmax(7rem, 12rem)',\n m: 'minmax(7rem, 14rem)',\n l: 'minmax(9rem, 18rem)',\n xl: 'minmax(11rem, 24rem)',\n fluid: 'minmax(0, 1fr)',\n};\n\nexport const computeRowFlagsColumnWidthPx = (flagCount: number): number => {\n if (flagCount <= 0) {\n return 0;\n }\n return (\n ROW_FLAGS_PADDING_X_PX * 2 +\n ROW_FLAGS_SLOT_PX * flagCount +\n ROW_FLAGS_GAP_PX * Math.max(0, flagCount - 1)\n );\n};\n\nexport const computeActionsColumnWidthPx = (actionCount: number): number => {\n if (actionCount <= 0) {\n return 0;\n }\n return (\n ACTIONS_SAFETY_PX +\n ACTIONS_PADDING_X_PX * 2 +\n ACTIONS_SLOT_PX * actionCount +\n ACTIONS_GAP_PX * Math.max(0, actionCount - 1)\n );\n};\n\nexport const resolveTrackBySize = (\n column: ResponsiveRecordListColumn<unknown>,\n fallback: string,\n): string => {\n if (column.mobileRole === 'action') {\n return '60px';\n }\n if (column.isPrimary === true) {\n return 'minmax(0, 1.4fr)';\n }\n if ('size' in column && typeof column.size === 'string') {\n return listColumnTrackBySize[\n column.size as BackofficeSizedDataTableColumn<unknown>['size']\n ];\n }\n return fallback;\n};\n\nexport const isRouteAction = (\n action: BackofficeListActionSpec,\n): action is BackofficeEntityRouteActionSpec<null> => {\n return action.kind === 'route';\n};\n\nexport const isFormMutationAction = (\n action: BackofficeListActionSpec,\n): action is BackofficeRuntimeEntityFormMutationActionSpec<null> => {\n return action.kind === 'formMutation';\n};\n\nexport const resolveActionPresentation = (\n actionVariant: BackofficeActionVariant | undefined,\n actionTone: BackofficeActionTone | undefined,\n index: number,\n): { variant: BackofficeActionVariant; tone: BackofficeActionTone } => {\n const isPrimary = index === 0;\n let variant = actionVariant;\n let tone = actionTone;\n if (variant == null) {\n variant = 'soft';\n if (isPrimary) {\n variant = 'solid';\n }\n }\n if (tone == null) {\n tone = 'neutral';\n if (isPrimary) {\n tone = 'brand';\n }\n }\n return {\n variant,\n tone,\n };\n};\n\nexport const resolveRowId = (row: unknown): string | null => {\n if (row == null || typeof row !== 'object') {\n return null;\n }\n if (!('id' in row)) {\n return null;\n }\n const value = (row as { id?: unknown }).id;\n if (typeof value !== 'string') {\n return null;\n }\n const trimmed = value.trim();\n if (trimmed === '') {\n return null;\n }\n return trimmed;\n};\n\nexport type ConnectionListConfig = BackofficeRuntimeResolvedListFacetConfig & {\n list: BackofficeRuntimeConnectionListConfig;\n};\n\nexport const resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const buildActionsColumn = (options: {\n ariaLabel: string;\n fallback: string;\n resolveDetailHref: (id: string) => string | null;\n className?: string;\n renderAction: (input: { href: string; ariaLabel: string }) => JSX.Element;\n}): ResponsiveRecordListColumn<unknown> => {\n const { ariaLabel, fallback, resolveDetailHref, className, renderAction } =\n options;\n\n return {\n id: 'actions',\n header: ariaLabel,\n ...(className == null ? {} : { classes: { cell: className } }),\n mobileRole: 'action',\n cell: (row) => {\n const id = resolveRowId(row);\n if (id == null) {\n return fallback;\n }\n const href = resolveDetailHref(id);\n if (href == null) {\n return fallback;\n }\n return renderAction({ href, ariaLabel });\n },\n };\n};\n"],"mappings":";AAiBA,IASM,IAGF;CACF,IAAI;CACJ,GAAG;CACH,cAAc;CACd,GAAG;CACH,GAAG;CACH,IAAI;CACJ,OAAO;AACT,GAEa,KAAgC,MACvC,KAAa,IACR,IAGP,IACA,KAAoB,IACpB,IAAmB,KAAK,IAAI,GAAG,IAAY,CAAC,GAInC,KAA+B,MACtC,KAAe,IACV,IAGP,KAEA,KAAkB,IAClB,IAAiB,KAAK,IAAI,GAAG,IAAc,CAAC,GAInC,KACX,GACA,MAEI,EAAO,eAAe,WACjB,SAEL,EAAO,cAAc,KAChB,qBAEL,UAAU,KAAU,OAAO,EAAO,QAAS,WACtC,EACL,EAAO,QAGJ,GAGI,KACX,MAEO,EAAO,SAAS,SAGZ,KACX,MAEO,EAAO,SAAS,gBAGZ,KACX,GACA,GACA,MACqE;CACrE,IAAM,IAAY,MAAU,GACxB,IAAU,GACV,IAAO;CAaX,OAZI,MACF,IAAU,QACN,MACF,IAAU,WAGV,MACF,IAAO,WACH,MACF,IAAO,WAGJ;EACL;EACA;CACF;AACF,GAEa,KAAgB,MAAgC;CAI3D,IAHmB,OAAO,KAAQ,aAA9B,KAGA,EAAE,QAAQ,IACZ,OAAO;CAET,IAAM,IAAS,EAAyB;CACxC,IAAI,OAAO,KAAU,UACnB,OAAO;CAET,IAAM,IAAU,EAAM,KAAK;CAI3B,OAHI,MAAY,KACP,OAEF;AACT,GAMa,KAAgB,GAAkB,MACtC,EAAM,CAAI,GAGN,KAAsB,MAMQ;CACzC,IAAM,EAAE,cAAW,aAAU,sBAAmB,cAAW,oBACzD;CAEF,OAAO;EACL,IAAI;EACJ,QAAQ;EACR,GAAI,KAAa,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAU,EAAE;EAC5D,YAAY;EACZ,OAAO,MAAQ;GACb,IAAM,IAAK,EAAa,CAAG;GAC3B,IAAI,KAAM,MACR,OAAO;GAET,IAAM,IAAO,EAAkB,CAAE;GAIjC,OAHI,KAAQ,OACH,IAEF,EAAa;IAAE;IAAM;GAAU,CAAC;EACzC;CACF;AACF"}
|
|
@@ -8,47 +8,46 @@ import { RowFlagsCell as o } from "../components/backoffice/list/RowFlagsCell.js
|
|
|
8
8
|
import { BackofficeEntityListScaffold as s } from "../components/backoffice/scaffolds/BackofficeEntityListScaffold.js";
|
|
9
9
|
import { useBackofficeListUrlState as c } from "../hooks/useBackofficeListUrlState.js";
|
|
10
10
|
import { BackofficeEntityListRouteProvider as l } from "./BackofficeEntityListRouteContext.js";
|
|
11
|
-
import { buildActionsColumn as u, computeActionsColumnWidthPx as d, computeRowFlagsColumnWidthPx as f, isFormMutationAction as p, isRouteAction as m,
|
|
11
|
+
import { buildActionsColumn as u, computeActionsColumnWidthPx as d, computeRowFlagsColumnWidthPx as f, isFormMutationAction as p, isRouteAction as m, resolveActionPresentation as h, resolveLabel as g, resolveTrackBySize as _ } from "./BackofficeEntityListPage.helpers.js";
|
|
12
12
|
import { actionTrigger as v, actionsColumnCell as y, headerActions as b } from "./backofficeEntityListPage.css.js";
|
|
13
13
|
import { Suspense as x, useCallback as S, useMemo as C, useRef as w, useState as T } from "react";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import A from "@plumile/
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import { EyeSvg as N } from "@plumile/ui/icons/EyeSvg.js";
|
|
14
|
+
import { TableCellContent as E } from "@plumile/ui";
|
|
15
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
16
|
+
import { useTranslation as k } from "react-i18next";
|
|
17
|
+
import { Button as A, RouterButtonLink as j } from "@plumile/ui/button";
|
|
18
|
+
import M from "@plumile/router/routing/Link.js";
|
|
19
|
+
import { EyeSvg as N } from "@plumile/ui/icons/EyeSvg";
|
|
21
20
|
//#region src/pages/BackofficeEntityListPage.tsx
|
|
22
|
-
var P = (e, t, n, r) => {
|
|
23
|
-
let
|
|
24
|
-
if (
|
|
21
|
+
var P = (e, t, n, r, i) => {
|
|
22
|
+
let s = t != null && t.length > 0, c = e;
|
|
23
|
+
if (s) {
|
|
25
24
|
let n = [{
|
|
26
25
|
id: "__rowFlags",
|
|
27
|
-
header:
|
|
28
|
-
|
|
26
|
+
header: i,
|
|
27
|
+
classes: { cell: a },
|
|
29
28
|
mobileRole: "badge",
|
|
30
|
-
cell: (e) => /* @__PURE__ */
|
|
29
|
+
cell: (e) => /* @__PURE__ */ D(o, {
|
|
31
30
|
row: e,
|
|
32
31
|
flags: t,
|
|
33
32
|
tApp: r
|
|
34
33
|
})
|
|
35
|
-
}, ...e],
|
|
36
|
-
|
|
34
|
+
}, ...e], s = n.some((e) => e.isPrimary === !0);
|
|
35
|
+
c = n, s || (c = n.map((e, t) => t === 1 ? {
|
|
37
36
|
...e,
|
|
38
37
|
isPrimary: !0
|
|
39
38
|
} : e));
|
|
40
39
|
}
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
let
|
|
46
|
-
return
|
|
47
|
-
columns:
|
|
48
|
-
gridTemplateColumns:
|
|
40
|
+
let l = 0;
|
|
41
|
+
s && (l = t.length);
|
|
42
|
+
let u = f(l), p = d(n), m = 0;
|
|
43
|
+
s && (m = 1);
|
|
44
|
+
let h = c.length - m - 1, g = c.slice(m, m + Math.max(0, h)).map((e) => _(e, "1fr")).join(" "), v = "";
|
|
45
|
+
return v = s ? `${u}px ${g} ${p}px` : `${g} ${p}px`, {
|
|
46
|
+
columns: c,
|
|
47
|
+
gridTemplateColumns: v
|
|
49
48
|
};
|
|
50
49
|
}, F = ({ children: i, config: a, breadcrumb: o }) => {
|
|
51
|
-
let d = a.list, { t: f } =
|
|
50
|
+
let d = a.list, { t: f } = k(), { t: _ } = e(), [F, I] = T(null), [L, R] = T(0), z = w(null), B = S((e) => {
|
|
52
51
|
z.current = e;
|
|
53
52
|
}, []), { columns: V, gridTemplateColumns: H } = C(() => {
|
|
54
53
|
let e = n(d.columns, {
|
|
@@ -59,19 +58,19 @@ var P = (e, t, n, r) => {
|
|
|
59
58
|
fallback: _("common.notAvailable"),
|
|
60
59
|
className: y,
|
|
61
60
|
resolveDetailHref: (e) => a.routes.detail(e),
|
|
62
|
-
renderAction: ({ href: e, ariaLabel: t }) => /* @__PURE__ */ E
|
|
61
|
+
renderAction: ({ href: e, ariaLabel: t }) => /* @__PURE__ */ D(E.Actions, { children: /* @__PURE__ */ D(M, {
|
|
63
62
|
to: e,
|
|
64
63
|
className: v,
|
|
65
64
|
"aria-label": t,
|
|
66
65
|
title: t,
|
|
67
66
|
preloadOnHover: "code",
|
|
68
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ D(N, {
|
|
69
68
|
width: 16,
|
|
70
69
|
height: 16
|
|
71
70
|
})
|
|
72
71
|
}) })
|
|
73
72
|
});
|
|
74
|
-
return P([...e, t], d.rowFlags, 1, f);
|
|
73
|
+
return P([...e, t], d.rowFlags, 1, f, _("list.columns.flags"));
|
|
75
74
|
}, [
|
|
76
75
|
a.routes,
|
|
77
76
|
d.columns,
|
|
@@ -81,38 +80,40 @@ var P = (e, t, n, r) => {
|
|
|
81
80
|
]), U = S((e) => d.getRowId(e), [d]), { state: W, pushState: G } = c(a), K = S(() => {
|
|
82
81
|
R((e) => e + 1), z.current?.();
|
|
83
82
|
}, []), q = C(() => a.listActions ?? [], [a.listActions]), J = C(() => q.filter((e) => e.isVisible == null || e.isVisible(null)), [q]), Y = C(() => {
|
|
84
|
-
if (J.length !== 0) return /* @__PURE__ */
|
|
83
|
+
if (J.length !== 0) return /* @__PURE__ */ D("div", {
|
|
85
84
|
className: b,
|
|
86
85
|
children: J.map((e, t) => {
|
|
87
|
-
let
|
|
88
|
-
e.ariaLabel != null && (
|
|
89
|
-
let
|
|
86
|
+
let n = g(e.label, f), r = n;
|
|
87
|
+
e.ariaLabel != null && (r = g(e.ariaLabel, f));
|
|
88
|
+
let i = h(e.variant, e.tone, t), a = e.size ?? "small", o = e.isDisabled?.(null) === !0;
|
|
90
89
|
if (m(e)) {
|
|
91
90
|
let t = e.to(null);
|
|
92
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ D(j, {
|
|
93
92
|
to: t,
|
|
94
|
-
variant:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
variant: i.variant,
|
|
94
|
+
tone: i.tone,
|
|
95
|
+
size: a,
|
|
96
|
+
disabled: o,
|
|
97
|
+
"aria-label": r,
|
|
98
98
|
preloadOnHover: "code-and-data",
|
|
99
|
-
children:
|
|
99
|
+
children: n
|
|
100
100
|
}, e.id);
|
|
101
101
|
}
|
|
102
|
-
return p(e) ? /* @__PURE__ */
|
|
102
|
+
return p(e) ? /* @__PURE__ */ D(A, {
|
|
103
103
|
type: "button",
|
|
104
|
-
variant:
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
variant: i.variant,
|
|
105
|
+
tone: i.tone,
|
|
106
|
+
size: a,
|
|
107
|
+
disabled: o,
|
|
107
108
|
onClick: () => {
|
|
108
109
|
I(e.id);
|
|
109
110
|
},
|
|
110
|
-
"aria-label":
|
|
111
|
-
children:
|
|
111
|
+
"aria-label": r,
|
|
112
|
+
children: n
|
|
112
113
|
}, e.id) : null;
|
|
113
114
|
})
|
|
114
115
|
});
|
|
115
|
-
}, [f, J]), X = q.find((e) => e.id === F), Z = () => /* @__PURE__ */
|
|
116
|
+
}, [f, J]), X = q.find((e) => e.id === F), Z = () => /* @__PURE__ */ D(s, {
|
|
116
117
|
config: a,
|
|
117
118
|
state: W,
|
|
118
119
|
pushState: G,
|
|
@@ -154,27 +155,27 @@ var P = (e, t, n, r) => {
|
|
|
154
155
|
B,
|
|
155
156
|
W
|
|
156
157
|
]);
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ O(r, {
|
|
158
159
|
breadcrumb: o,
|
|
159
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ D(l, {
|
|
160
161
|
value: Q,
|
|
161
|
-
children: /* @__PURE__ */
|
|
162
|
+
children: /* @__PURE__ */ D(x, {
|
|
162
163
|
fallback: Z(),
|
|
163
164
|
children: i
|
|
164
165
|
})
|
|
165
|
-
}), X != null && p(X) && /* @__PURE__ */
|
|
166
|
-
|
|
166
|
+
}), X != null && p(X) && /* @__PURE__ */ D(t, {
|
|
167
|
+
open: !0,
|
|
167
168
|
action: X,
|
|
168
169
|
node: null,
|
|
169
|
-
|
|
170
|
-
I(null);
|
|
170
|
+
onOpenChange: (e) => {
|
|
171
|
+
e || I(null);
|
|
171
172
|
},
|
|
172
173
|
onSuccess: K
|
|
173
174
|
})]
|
|
174
175
|
});
|
|
175
176
|
}, I = ({ children: e, entityManifest: t, config: n }) => {
|
|
176
|
-
let { t: r } =
|
|
177
|
-
return /* @__PURE__ */
|
|
177
|
+
let { t: r } = k(), a = i(n, r);
|
|
178
|
+
return /* @__PURE__ */ D(F, {
|
|
178
179
|
children: e,
|
|
179
180
|
entityManifest: t,
|
|
180
181
|
config: n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityListPage.js","names":[],"sources":["../../../src/pages/BackofficeEntityListPage.tsx"],"sourcesContent":["import {\n Suspense,\n type JSX,\n type ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { TFunction } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport Link from '@plumile/router/routing/Link.js';\nimport type {\n BackofficeEntityManifestItem,\n BackofficePreparedListLayoutRoute,\n BackofficeRuntimeResolvedListFacetConfig,\n BackofficeRowFlagSpec,\n} from '@plumile/backoffice-core/types.js';\nimport { Button } from '@plumile/ui/atomic/atoms/button/Button.js';\nimport { LinkButton } from '@plumile/ui/atomic/atoms/button/LinkButton.js';\nimport {\n type DataTableColumn,\n type GetRowId,\n} from '@plumile/ui/components/data-table/DataTable.js';\nimport { TableCell } from '@plumile/ui/components/data-table/TableCell.js';\nimport { EyeSvg } from '@plumile/ui/icons/EyeSvg.js';\nimport { BackofficeEntityListScaffold } from '../components/backoffice/scaffolds/BackofficeEntityListScaffold.js';\nimport { LazyBackofficeEntityActionFormDialog } from '../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js';\nimport { buildDataTableColumns } from '../components/backoffice/columns/buildDataTableColumns.js';\nimport { RowFlagsCell } from '../components/backoffice/list/RowFlagsCell.js';\nimport { useBackofficeListUrlState } from '../hooks/useBackofficeListUrlState.js';\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport * as pageStyles from './backofficeEntityListPage.css.js';\nimport { rowFlagsColumnCell } from '../components/backoffice/list/RowFlagsCell.css.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildEntityListBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\nimport { BackofficeEntityListRouteProvider } from './BackofficeEntityListRouteContext.js';\nimport {\n buildActionsColumn,\n computeActionsColumnWidthPx,\n computeRowFlagsColumnWidthPx,\n isFormMutationAction,\n isRouteAction,\n resolveLabel,\n resolveActionVariant,\n resolveTrackBySize,\n type ConnectionListConfig,\n} from './BackofficeEntityListPage.helpers.js';\n\nexport type BackofficeEntityListPageProps = {\n children?: ReactNode;\n entityManifest: BackofficeEntityManifestItem;\n config: BackofficeRuntimeResolvedListFacetConfig;\n prepared: BackofficePreparedListLayoutRoute;\n};\n\nconst applyListEdgeColumns = <Row,>(\n inputColumns: readonly DataTableColumn<Row>[],\n rowFlags: readonly BackofficeRowFlagSpec<Row>[] | undefined,\n actionCount: number,\n tApp: TFunction,\n): {\n columns: readonly DataTableColumn<Row>[];\n gridTemplateColumns?: string;\n} => {\n const hasFlags = rowFlags != null && rowFlags.length > 0;\n\n let columns = inputColumns;\n if (hasFlags) {\n const flagsColumn: DataTableColumn<Row> = {\n id: '__rowFlags',\n header: '',\n className: rowFlagsColumnCell,\n mobileRole: 'badge',\n cell: (row) => {\n return <RowFlagsCell row={row} flags={rowFlags} tApp={tApp} />;\n },\n };\n\n // Ensure we never pick the flags column as \"primary\".\n const withFlags = [flagsColumn, ...inputColumns];\n const hasPrimary = withFlags.some((col) => {\n return col.isPrimary === true;\n });\n\n columns = withFlags;\n if (!hasPrimary) {\n columns = withFlags.map((col, index) => {\n if (index === 1) {\n return { ...col, isPrimary: true };\n }\n return col;\n });\n }\n }\n\n let flagCount = 0;\n if (hasFlags) {\n flagCount = rowFlags.length;\n }\n const flagsWidthPx = computeRowFlagsColumnWidthPx(flagCount);\n const actionsWidthPx = computeActionsColumnWidthPx(actionCount);\n\n // We always include the right-side \"actions\" column in list pages.\n let leftColumnCount = 0;\n if (hasFlags) {\n leftColumnCount = 1;\n }\n const middleCount = columns.length - leftColumnCount - 1;\n\n const middleTracks = columns\n .slice(leftColumnCount, leftColumnCount + Math.max(0, middleCount))\n .map((column) => {\n return resolveTrackBySize(column as DataTableColumn<unknown>, '1fr');\n })\n .join(' ');\n\n let gridTemplateColumns = '';\n if (hasFlags) {\n gridTemplateColumns = `${flagsWidthPx}px ${middleTracks} ${actionsWidthPx}px`;\n } else {\n gridTemplateColumns = `${middleTracks} ${actionsWidthPx}px`;\n }\n\n return { columns, gridTemplateColumns };\n};\n\nconst BackofficeEntityConnectionListPage = ({\n children,\n config,\n breadcrumb,\n}: Omit<BackofficeEntityListPageProps, 'config' | 'prepared'> & {\n config: ConnectionListConfig;\n breadcrumb: ReturnType<typeof buildEntityListBreadcrumb>;\n}): JSX.Element | null => {\n const listConfig = config.list;\n\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const [activeFormActionId, setActiveFormActionId] = useState<string | null>(\n null,\n );\n const [countFetchKey, setCountFetchKey] = useState(0);\n const refreshRef = useRef<(() => void) | null>(null);\n\n const registerRefresh = useCallback((refresh: (() => void) | null) => {\n refreshRef.current = refresh;\n }, []);\n\n const { columns, gridTemplateColumns } = useMemo((): {\n columns: readonly DataTableColumn<unknown>[];\n gridTemplateColumns?: string;\n } => {\n const baseColumns = buildDataTableColumns(listConfig.columns, {\n tApp,\n t,\n });\n const actionsColumn = buildActionsColumn({\n ariaLabel: t('actions.view'),\n fallback: t('common.notAvailable'),\n className: pageStyles.actionsColumnCell,\n resolveDetailHref: (id) => {\n return config.routes.detail(id);\n },\n renderAction: ({ href, ariaLabel }) => {\n return (\n <TableCell.Actions>\n <Link\n to={href}\n className={pageStyles.actionTrigger}\n aria-label={ariaLabel}\n title={ariaLabel}\n preloadOnHover=\"code\"\n >\n <EyeSvg width={16} height={16} />\n </Link>\n </TableCell.Actions>\n );\n },\n });\n const allColumns = [...baseColumns, actionsColumn];\n return applyListEdgeColumns(allColumns, listConfig.rowFlags, 1, tApp);\n }, [config.routes, listConfig.columns, listConfig.rowFlags, t, tApp]);\n\n const getRowId = useCallback<GetRowId<unknown>>(\n (row) => {\n return listConfig.getRowId(row);\n },\n [listConfig],\n );\n\n const { state, pushState } = useBackofficeListUrlState(config);\n\n const handleRefreshRequest = useCallback(() => {\n setCountFetchKey((current) => {\n return current + 1;\n });\n refreshRef.current?.();\n }, []);\n\n const listActions = useMemo(() => {\n return config.listActions ?? [];\n }, [config.listActions]);\n const visibleActions = useMemo(() => {\n return listActions.filter((action) => {\n if (action.isVisible == null) {\n return true;\n }\n return action.isVisible(null);\n });\n }, [listActions]);\n\n const headerActions = useMemo(() => {\n if (visibleActions.length === 0) {\n return undefined;\n }\n return (\n <div className={pageStyles.headerActions}>\n {visibleActions.map((action, index) => {\n const { variant: actionVariant } = action;\n const label = resolveLabel(action.label, tApp);\n let ariaLabel = label;\n if (action.ariaLabel != null) {\n ariaLabel = resolveLabel(action.ariaLabel, tApp);\n }\n const variant = resolveActionVariant(actionVariant, index);\n const size = action.size ?? 'small';\n const isDisabled = action.isDisabled?.(null) === true;\n\n if (isRouteAction(action)) {\n const href = action.to(null);\n return (\n <LinkButton\n key={action.id}\n to={href}\n variant={variant}\n size={size}\n isDisabled={isDisabled}\n aria-label={ariaLabel}\n preloadOnHover=\"code-and-data\"\n >\n {label}\n </LinkButton>\n );\n }\n\n if (isFormMutationAction(action)) {\n return (\n <Button\n key={action.id}\n type=\"button\"\n variant={variant}\n size={size}\n disabled={isDisabled}\n onClick={() => {\n setActiveFormActionId(action.id);\n }}\n aria-label={ariaLabel}\n >\n {label}\n </Button>\n );\n }\n\n return null;\n })}\n </div>\n );\n }, [tApp, visibleActions]);\n\n const activeFormAction = listActions.find((action) => {\n return action.id === activeFormActionId;\n });\n\n const renderLoadingScaffold = () => {\n return (\n <BackofficeEntityListScaffold\n config={config}\n state={state}\n pushState={pushState}\n headerActions={headerActions}\n rows={[]}\n columns={columns}\n gridTemplateColumns={gridTemplateColumns}\n getRowId={getRowId}\n hasNextPage={false}\n isLoadingMore={false}\n incrementalError={null}\n isRefreshing={false}\n onLoadMore={() => {}}\n onRetryLoadMore={() => {}}\n onRefresh={handleRefreshRequest}\n totalCount={null}\n isLoadingInitial\n />\n );\n };\n\n const contextValue = useMemo(() => {\n return {\n config,\n state,\n pushState,\n headerActions,\n columns,\n gridTemplateColumns,\n getRowId,\n countFetchKey,\n bumpCountFetchKey: () => {\n setCountFetchKey((current) => {\n return current + 1;\n });\n },\n registerRefresh,\n };\n }, [\n columns,\n config,\n countFetchKey,\n getRowId,\n gridTemplateColumns,\n headerActions,\n pushState,\n registerRefresh,\n state,\n ]);\n\n return (\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <BackofficeEntityListRouteProvider value={contextValue}>\n <Suspense fallback={renderLoadingScaffold()}>{children}</Suspense>\n </BackofficeEntityListRouteProvider>\n {activeFormAction != null && isFormMutationAction(activeFormAction) && (\n <LazyBackofficeEntityActionFormDialog\n isOpen\n action={activeFormAction}\n node={null}\n onClose={() => {\n setActiveFormActionId(null);\n }}\n onSuccess={handleRefreshRequest}\n />\n )}\n </BackofficeRightPageLayout>\n );\n};\n\nexport const BackofficeEntityListPage = ({\n children,\n entityManifest,\n config,\n}: BackofficeEntityListPageProps): JSX.Element | null => {\n const { t: tApp } = useTranslation();\n const breadcrumb = buildEntityListBreadcrumb(config, tApp);\n\n return (\n <BackofficeEntityConnectionListPage\n children={children}\n entityManifest={entityManifest}\n config={config}\n breadcrumb={breadcrumb}\n />\n );\n};\n\nexport default BackofficeEntityListPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwDA,IAAM,KACJ,GACA,GACA,GACA,MAIG;CACH,IAAM,IAAW,KAAY,QAAQ,EAAS,SAAS,GAEnD,IAAU;CACd,IAAI,GAAU;EAYZ,IAAM,IAAY,CAAC;GAVjB,IAAI;GACJ,QAAQ;GACR,WAAW;GACX,YAAY;GACZ,OAAO,MACE,kBAAC,GAAD;IAAmB;IAAK,OAAO;IAAgB;GAAO,CAAA;EAK9C,GAAa,GAAG,CAAY,GACzC,IAAa,EAAU,MAAM,MAC1B,EAAI,cAAc,EAC1B;EAGD,AADA,IAAU,GACL,MACH,IAAU,EAAU,KAAK,GAAK,MACxB,MAAU,IACL;GAAE,GAAG;GAAK,WAAW;EAAK,IAE5B,CACR;CAEL;CAEA,IAAI,IAAY;CAChB,AAAI,MACF,IAAY,EAAS;CAEvB,IAAM,IAAe,EAA6B,CAAS,G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ACtB,GAEK,UAEF,kBAAC,GAAD;EACU;EACD;EACI;EACI,eAAA;EACf,MAAM,CAAC;EACE;EACY;EACX;EACV,aAAa;EACb,eAAe;EACf,kBAAkB;EAClB,cAAc;EACd,kBAAkB,CAAC;EACnB,uBAAuB,CAAC;EACxB,WAAW;EACX,YAAY;EACZ,kBAAA;CACD,CAAA,GAIC,IAAe,SACZ;EACL;EACA;EACA;EACA,eAAA;EACA;EACA;EACA;EACA;EACA,yBAAyB;GACvB,GAAkB,MACT,IAAU,CAClB;EACH;EACA;CACF,IACC;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,kBAAC,GAAD;EAAuC;EAAvC,UAAA,CACE,kBAAC,GAAD;GAAmC,OAAO;GACxC,UAAA,kBAAC,GAAD;IAAU,UAAU,EAAsB;IAAI;GAAmB,CAAA;EAChC,CAAA,GAClC,KAAoB,QAAQ,EAAqB,CAAgB,KAChE,kBAAC,GAAD;GACE,QAAA;GACA,QAAQ;GACR,MAAM;GACN,eAAe;IACb,EAAsB,IAAI;GAC5B;GACA,WAAW;EACZ,CAAA,CAEsB;;AAE/B,GAEa,KAA4B,EACvC,aACA,mBACA,gBACuD;CACvD,IAAM,EAAE,GAAG,MAAS,EAAe,GAC7B,IAAa,EAA0B,GAAQ,CAAI;CAEzD,OACE,kBAAC,GAAD;EACY;EACM;EACR;EACI;CACb,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"BackofficeEntityListPage.js","names":[],"sources":["../../../src/pages/BackofficeEntityListPage.tsx"],"sourcesContent":["import {\n Suspense,\n type JSX,\n type ReactNode,\n useCallback,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { TFunction } from 'i18next';\nimport { useTranslation } from 'react-i18next';\nimport Link from '@plumile/router/routing/Link.js';\nimport type {\n BackofficeEntityManifestItem,\n BackofficePreparedListLayoutRoute,\n BackofficeRuntimeResolvedListFacetConfig,\n BackofficeRowFlagSpec,\n} from '@plumile/backoffice-core/types.js';\nimport { Button, RouterButtonLink } from '@plumile/ui/button';\nimport {\n type GetRowId,\n type ResponsiveRecordListColumn,\n TableCellContent,\n} from '@plumile/ui';\nimport { EyeSvg } from '@plumile/ui/icons/EyeSvg';\nimport { BackofficeEntityListScaffold } from '../components/backoffice/scaffolds/BackofficeEntityListScaffold.js';\nimport { LazyBackofficeEntityActionFormDialog } from '../components/backoffice/actions/LazyBackofficeEntityActionFormDialog.js';\nimport { buildDataTableColumns } from '../components/backoffice/columns/buildDataTableColumns.js';\nimport { RowFlagsCell } from '../components/backoffice/list/RowFlagsCell.js';\nimport { useBackofficeListUrlState } from '../hooks/useBackofficeListUrlState.js';\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport * as pageStyles from './backofficeEntityListPage.css.js';\nimport { rowFlagsColumnCell } from '../components/backoffice/list/RowFlagsCell.css.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildEntityListBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\nimport { BackofficeEntityListRouteProvider } from './BackofficeEntityListRouteContext.js';\nimport {\n buildActionsColumn,\n computeActionsColumnWidthPx,\n computeRowFlagsColumnWidthPx,\n isFormMutationAction,\n isRouteAction,\n resolveLabel,\n resolveActionPresentation,\n resolveTrackBySize,\n type ConnectionListConfig,\n} from './BackofficeEntityListPage.helpers.js';\n\nexport type BackofficeEntityListPageProps = {\n children?: ReactNode;\n entityManifest: BackofficeEntityManifestItem;\n config: BackofficeRuntimeResolvedListFacetConfig;\n prepared: BackofficePreparedListLayoutRoute;\n};\n\nconst applyListEdgeColumns = <Row,>(\n inputColumns: readonly ResponsiveRecordListColumn<Row>[],\n rowFlags: readonly BackofficeRowFlagSpec<Row>[] | undefined,\n actionCount: number,\n tApp: TFunction,\n flagsHeader: string,\n): {\n columns: readonly ResponsiveRecordListColumn<Row>[];\n gridTemplateColumns?: string;\n} => {\n const hasFlags = rowFlags != null && rowFlags.length > 0;\n\n let columns = inputColumns;\n if (hasFlags) {\n const flagsColumn: ResponsiveRecordListColumn<Row> = {\n id: '__rowFlags',\n header: flagsHeader,\n classes: { cell: rowFlagsColumnCell },\n mobileRole: 'badge',\n cell: (row) => {\n return <RowFlagsCell row={row} flags={rowFlags} tApp={tApp} />;\n },\n };\n\n // Ensure we never pick the flags column as \"primary\".\n const withFlags = [flagsColumn, ...inputColumns];\n const hasPrimary = withFlags.some((col) => {\n return col.isPrimary === true;\n });\n\n columns = withFlags;\n if (!hasPrimary) {\n columns = withFlags.map((col, index) => {\n if (index === 1) {\n return { ...col, isPrimary: true };\n }\n return col;\n });\n }\n }\n\n let flagCount = 0;\n if (hasFlags) {\n flagCount = rowFlags.length;\n }\n const flagsWidthPx = computeRowFlagsColumnWidthPx(flagCount);\n const actionsWidthPx = computeActionsColumnWidthPx(actionCount);\n\n // We always include the right-side \"actions\" column in list pages.\n let leftColumnCount = 0;\n if (hasFlags) {\n leftColumnCount = 1;\n }\n const middleCount = columns.length - leftColumnCount - 1;\n\n const middleTracks = columns\n .slice(leftColumnCount, leftColumnCount + Math.max(0, middleCount))\n .map((column) => {\n return resolveTrackBySize(\n column as ResponsiveRecordListColumn<unknown>,\n '1fr',\n );\n })\n .join(' ');\n\n let gridTemplateColumns = '';\n if (hasFlags) {\n gridTemplateColumns = `${flagsWidthPx}px ${middleTracks} ${actionsWidthPx}px`;\n } else {\n gridTemplateColumns = `${middleTracks} ${actionsWidthPx}px`;\n }\n\n return { columns, gridTemplateColumns };\n};\n\nconst BackofficeEntityConnectionListPage = ({\n children,\n config,\n breadcrumb,\n}: Omit<BackofficeEntityListPageProps, 'config' | 'prepared'> & {\n config: ConnectionListConfig;\n breadcrumb: ReturnType<typeof buildEntityListBreadcrumb>;\n}): JSX.Element | null => {\n const listConfig = config.list;\n\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const [activeFormActionId, setActiveFormActionId] = useState<string | null>(\n null,\n );\n const [countFetchKey, setCountFetchKey] = useState(0);\n const refreshRef = useRef<(() => void) | null>(null);\n\n const registerRefresh = useCallback((refresh: (() => void) | null) => {\n refreshRef.current = refresh;\n }, []);\n\n const { columns, gridTemplateColumns } = useMemo((): {\n columns: readonly ResponsiveRecordListColumn<unknown>[];\n gridTemplateColumns?: string;\n } => {\n const baseColumns = buildDataTableColumns(listConfig.columns, {\n tApp,\n t,\n });\n const actionsColumn = buildActionsColumn({\n ariaLabel: t('actions.view'),\n fallback: t('common.notAvailable'),\n className: pageStyles.actionsColumnCell,\n resolveDetailHref: (id) => {\n return config.routes.detail(id);\n },\n renderAction: ({ href, ariaLabel }) => {\n return (\n <TableCellContent.Actions>\n <Link\n to={href}\n className={pageStyles.actionTrigger}\n aria-label={ariaLabel}\n title={ariaLabel}\n preloadOnHover=\"code\"\n >\n <EyeSvg width={16} height={16} />\n </Link>\n </TableCellContent.Actions>\n );\n },\n });\n const allColumns = [...baseColumns, actionsColumn];\n return applyListEdgeColumns(\n allColumns,\n listConfig.rowFlags,\n 1,\n tApp,\n t('list.columns.flags'),\n );\n }, [config.routes, listConfig.columns, listConfig.rowFlags, t, tApp]);\n\n const getRowId = useCallback<GetRowId<unknown>>(\n (row) => {\n return listConfig.getRowId(row);\n },\n [listConfig],\n );\n\n const { state, pushState } = useBackofficeListUrlState(config);\n\n const handleRefreshRequest = useCallback(() => {\n setCountFetchKey((current) => {\n return current + 1;\n });\n refreshRef.current?.();\n }, []);\n\n const listActions = useMemo(() => {\n return config.listActions ?? [];\n }, [config.listActions]);\n const visibleActions = useMemo(() => {\n return listActions.filter((action) => {\n if (action.isVisible == null) {\n return true;\n }\n return action.isVisible(null);\n });\n }, [listActions]);\n\n const headerActions = useMemo(() => {\n if (visibleActions.length === 0) {\n return undefined;\n }\n return (\n <div className={pageStyles.headerActions}>\n {visibleActions.map((action, index) => {\n const label = resolveLabel(action.label, tApp);\n let ariaLabel = label;\n if (action.ariaLabel != null) {\n ariaLabel = resolveLabel(action.ariaLabel, tApp);\n }\n const presentation = resolveActionPresentation(\n action.variant,\n action.tone,\n index,\n );\n const size = action.size ?? 'small';\n const isDisabled = action.isDisabled?.(null) === true;\n\n if (isRouteAction(action)) {\n const href = action.to(null);\n return (\n <RouterButtonLink\n key={action.id}\n to={href}\n variant={presentation.variant}\n tone={presentation.tone}\n size={size}\n disabled={isDisabled}\n aria-label={ariaLabel}\n preloadOnHover=\"code-and-data\"\n >\n {label}\n </RouterButtonLink>\n );\n }\n\n if (isFormMutationAction(action)) {\n return (\n <Button\n key={action.id}\n type=\"button\"\n variant={presentation.variant}\n tone={presentation.tone}\n size={size}\n disabled={isDisabled}\n onClick={() => {\n setActiveFormActionId(action.id);\n }}\n aria-label={ariaLabel}\n >\n {label}\n </Button>\n );\n }\n\n return null;\n })}\n </div>\n );\n }, [tApp, visibleActions]);\n\n const activeFormAction = listActions.find((action) => {\n return action.id === activeFormActionId;\n });\n\n const renderLoadingScaffold = () => {\n return (\n <BackofficeEntityListScaffold\n config={config}\n state={state}\n pushState={pushState}\n headerActions={headerActions}\n rows={[]}\n columns={columns}\n gridTemplateColumns={gridTemplateColumns}\n getRowId={getRowId}\n hasNextPage={false}\n isLoadingMore={false}\n incrementalError={null}\n isRefreshing={false}\n onLoadMore={() => {}}\n onRetryLoadMore={() => {}}\n onRefresh={handleRefreshRequest}\n totalCount={null}\n isLoadingInitial\n />\n );\n };\n\n const contextValue = useMemo(() => {\n return {\n config,\n state,\n pushState,\n headerActions,\n columns,\n gridTemplateColumns,\n getRowId,\n countFetchKey,\n bumpCountFetchKey: () => {\n setCountFetchKey((current) => {\n return current + 1;\n });\n },\n registerRefresh,\n };\n }, [\n columns,\n config,\n countFetchKey,\n getRowId,\n gridTemplateColumns,\n headerActions,\n pushState,\n registerRefresh,\n state,\n ]);\n\n return (\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <BackofficeEntityListRouteProvider value={contextValue}>\n <Suspense fallback={renderLoadingScaffold()}>{children}</Suspense>\n </BackofficeEntityListRouteProvider>\n {activeFormAction != null && isFormMutationAction(activeFormAction) && (\n <LazyBackofficeEntityActionFormDialog\n open\n action={activeFormAction}\n node={null}\n onOpenChange={(open) => {\n if (!open) setActiveFormActionId(null);\n }}\n onSuccess={handleRefreshRequest}\n />\n )}\n </BackofficeRightPageLayout>\n );\n};\n\nexport const BackofficeEntityListPage = ({\n children,\n entityManifest,\n config,\n}: BackofficeEntityListPageProps): JSX.Element | null => {\n const { t: tApp } = useTranslation();\n const breadcrumb = buildEntityListBreadcrumb(config, tApp);\n\n return (\n <BackofficeEntityConnectionListPage\n children={children}\n entityManifest={entityManifest}\n config={config}\n breadcrumb={breadcrumb}\n />\n );\n};\n\nexport default BackofficeEntityListPage;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuDA,IAAM,KACJ,GACA,GACA,GACA,GACA,MAIG;CACH,IAAM,IAAW,KAAY,QAAQ,EAAS,SAAS,GAEnD,IAAU;CACd,IAAI,GAAU;EAYZ,IAAM,IAAY,CAAC;GAVjB,IAAI;GACJ,QAAQ;GACR,SAAS,EAAE,MAAM,EAAmB;GACpC,YAAY;GACZ,OAAO,MACE,kBAAC,GAAD;IAAmB;IAAK,OAAO;IAAgB;GAAO,CAAA;EAK9C,GAAa,GAAG,CAAY,GACzC,IAAa,EAAU,MAAM,MAC1B,EAAI,cAAc,EAC1B;EAGD,AADA,IAAU,GACL,MACH,IAAU,EAAU,KAAK,GAAK,MACxB,MAAU,IACL;GAAE,GAAG;GAAK,WAAW;EAAK,IAE5B,CACR;CAEL;CAEA,IAAI,IAAY;CAChB,AAAI,MACF,IAAY,EAAS;CAEvB,IAAM,IAAe,EAA6B,CAAS,GACrD,IAAiB,EAA4B,CAAW,GAG1D,IAAkB;CACtB,AAAI,MACF,IAAkB;CAEpB,IAAM,IAAc,EAAQ,SAAS,IAAkB,GAEjD,IAAe,EAClB,MAAM,GAAiB,IAAkB,KAAK,IAAI,GAAG,CAAW,CAAC,CAAC,CAClE,KA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EAClB,cAAc;EACd,kBAAkB,CAAC;EACnB,uBAAuB,CAAC;EACxB,WAAW;EACX,YAAY;EACZ,kBAAA;CACD,CAAA,GAIC,IAAe,SACZ;EACL;EACA;EACA;EACA,eAAA;EACA;EACA;EACA;EACA;EACA,yBAAyB;GACvB,GAAkB,MACT,IAAU,CAClB;EACH;EACA;CACF,IACC;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,OACE,kBAAC,GAAD;EAAuC;EAAvC,UAAA,CACE,kBAAC,GAAD;GAAmC,OAAO;GACxC,UAAA,kBAAC,GAAD;IAAU,UAAU,EAAsB;IAAI;GAAmB,CAAA;EAChC,CAAA,GAClC,KAAoB,QAAQ,EAAqB,CAAgB,KAChE,kBAAC,GAAD;GACE,MAAA;GACA,QAAQ;GACR,MAAM;GACN,eAAe,MAAS;IACtB,AAAK,KAAM,EAAsB,IAAI;GACvC;GACA,WAAW;EACZ,CAAA,CAEsB;;AAE/B,GAEa,KAA4B,EACvC,aACA,mBACA,gBACuD;CACvD,IAAM,EAAE,GAAG,MAAS,EAAe,GAC7B,IAAa,EAA0B,GAAQ,CAAI;CAEzD,OACE,kBAAC,GAAD;EACY;EACM;EACR;EACI;CACb,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeEntityListRouteContext.js","names":[],"sources":["../../../src/pages/BackofficeEntityListRouteContext.tsx"],"sourcesContent":["import { createContext, useContext, type JSX } from 'react';\nimport {
|
|
1
|
+
{"version":3,"file":"BackofficeEntityListRouteContext.js","names":[],"sources":["../../../src/pages/BackofficeEntityListRouteContext.tsx"],"sourcesContent":["import { createContext, useContext, type JSX } from 'react';\nimport { type GetRowId, type ResponsiveRecordListColumn } from '@plumile/ui';\n\nimport type { useBackofficeListUrlState } from '../hooks/useBackofficeListUrlState.js';\nimport type { ConnectionListConfig } from './BackofficeEntityListPage.helpers.js';\n\nexport type BackofficeEntityListRouteContextValue = {\n config: ConnectionListConfig;\n state: ReturnType<typeof useBackofficeListUrlState>['state'];\n pushState: ReturnType<typeof useBackofficeListUrlState>['pushState'];\n headerActions: JSX.Element | undefined;\n columns: readonly ResponsiveRecordListColumn<unknown>[];\n gridTemplateColumns?: string;\n getRowId: GetRowId<unknown>;\n countFetchKey: number;\n bumpCountFetchKey: () => void;\n registerRefresh: (refresh: (() => void) | null) => void;\n};\n\nconst BackofficeEntityListRouteContext =\n createContext<BackofficeEntityListRouteContextValue | null>(null);\n\nexport const BackofficeEntityListRouteProvider = ({\n children,\n value,\n}: {\n children: JSX.Element;\n value: BackofficeEntityListRouteContextValue;\n}): JSX.Element => {\n return (\n <BackofficeEntityListRouteContext.Provider value={value}>\n {children}\n </BackofficeEntityListRouteContext.Provider>\n );\n};\n\nexport const useBackofficeEntityListRouteContext =\n (): BackofficeEntityListRouteContextValue => {\n const value = useContext(BackofficeEntityListRouteContext);\n if (value == null) {\n throw new Error('BackofficeEntityListRouteContext is missing.');\n }\n return value;\n };\n"],"mappings":";;;AAmBA,IAAM,IACJ,EAA4D,IAAI,GAErD,KAAqC,EAChD,aACA,eAME,kBAAC,EAAiC,UAAlC;CAAkD;CAC/C;AACwC,CAAA,GAIlC,UACkC;CAC3C,IAAM,IAAQ,EAAW,CAAgC;CACzD,IAAI,KAAS,MACX,MAAU,MAAM,8CAA8C;CAEhE,OAAO;AACT"}
|
|
@@ -8,7 +8,7 @@ import { buildHubBreadcrumb as o } from "../components/backoffice/layout/breadcr
|
|
|
8
8
|
import { useMemo as s, useState as c } from "react";
|
|
9
9
|
import { jsx as l } from "react/jsx-runtime";
|
|
10
10
|
import { useTranslation as u } from "react-i18next";
|
|
11
|
-
import { SidebarTasksSvg as d } from "@plumile/ui/icons/SidebarTasksSvg
|
|
11
|
+
import { SidebarTasksSvg as d } from "@plumile/ui/icons/SidebarTasksSvg";
|
|
12
12
|
import { DetailPageTemplate as f } from "@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js";
|
|
13
13
|
//#region src/pages/BackofficeHubPage.tsx
|
|
14
14
|
var p = (e, t) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeHubPage.js","names":[],"sources":["../../../src/pages/BackofficeHubPage.tsx"],"sourcesContent":["import { useMemo, useState, type JSX, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { DetailPageTemplate } from '@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js';\nimport { SidebarTasksSvg } from '@plumile/ui/icons/SidebarTasksSvg.js';\nimport type { BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { BackofficeIconComponent } from '../provider/types.js';\nimport type { BackofficePreparedHubRoute } from '../router/createBackofficeRoutes.js';\nimport {\n BackofficeHubTemplate,\n type BackofficeHubTemplateGroup,\n type BackofficeHubTemplateSearch,\n} from '../components/backoffice/hub/BackofficeHubTemplate.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildHubBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\nimport { useBackofficePermissions } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport { resolveLabel } from '../components/backoffice/layout/sidebarUtils.js';\n\nexport type BackofficeHubPageProps = {\n prepared: BackofficePreparedHubRoute;\n};\n\ntype HubPageItemView = {\n id: string;\n kind: 'entity' | 'tool';\n label: string;\n href: string;\n icon: ReactNode;\n};\n\ntype HubPageGroupView = {\n id: string;\n title: string;\n description: string | null;\n icon: ReactNode | undefined;\n items: readonly HubPageItemView[];\n};\n\nconst renderIcon = (\n Icon: BackofficeIconComponent | undefined,\n size: number,\n): ReactNode | undefined => {\n if (Icon == null) {\n return undefined;\n }\n return <Icon width={size} height={size} aria-hidden=\"true\" />;\n};\n\nconst isItemVisible = (input: {\n entity: BackofficeEntityManifestMap[string] | null | undefined;\n kind: 'entity' | 'tool';\n permissions: unknown;\n sidebar: ReturnType<typeof useBackofficeConfig>['sidebar'];\n}): boolean => {\n const { entity, kind, permissions, sidebar } = input;\n if (entity == null) {\n return false;\n }\n if (kind === 'entity' && entity.kind !== 'tool' && !entity.hasList) {\n return false;\n }\n const isVisible = sidebar?.isItemVisible?.(\n {\n kind,\n id: entity.id,\n },\n permissions,\n );\n return isVisible !== false;\n};\n\nexport const BackofficeHubPage = ({\n prepared,\n}: BackofficeHubPageProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities, sidebar } = useBackofficeConfig();\n const permissions = useBackofficePermissions();\n const [search, setSearch] = useState('');\n const { hub } = prepared;\n const title = resolveLabel(hub.title, tApp);\n let description: string | undefined;\n if (hub.description != null) {\n description = resolveLabel(hub.description, tApp);\n }\n const breadcrumb = buildHubBreadcrumb({ id: hub.id, title });\n const normalizedSearch = search.trim().toLowerCase();\n const searchEnabled = hub.search?.enabled !== false;\n let searchPlaceholder = t('hub.search.placeholder');\n if (hub.search?.placeholder != null) {\n searchPlaceholder = resolveLabel(hub.search.placeholder, tApp);\n }\n\n const groups = useMemo<readonly HubPageGroupView[]>(() => {\n return hub.groups\n .map((group) => {\n const items = group.items\n .map((item): HubPageItemView | null => {\n const entity = entities[item.id];\n if (entity == null) {\n return null;\n }\n if (\n !isItemVisible({\n entity,\n kind: item.kind,\n permissions,\n sidebar,\n })\n ) {\n return null;\n }\n const entityConfig = entity;\n const label = resolveLabel(entityConfig.label, tApp);\n if (\n normalizedSearch !== '' &&\n !label.toLowerCase().includes(normalizedSearch)\n ) {\n return null;\n }\n return {\n id: item.id,\n kind: item.kind,\n label,\n href: entityConfig.routes.list,\n icon: renderIcon(item.icon, 20),\n };\n })\n .filter((item): item is HubPageItemView => {\n return item != null;\n });\n let groupDescription: string | null = null;\n if (group.description != null) {\n groupDescription = resolveLabel(group.description, tApp);\n }\n return {\n id: group.id,\n title: resolveLabel(group.title, tApp),\n description: groupDescription,\n icon: renderIcon(group.icon, 18),\n items,\n };\n })\n .filter((group) => {\n return group.items.length > 0;\n });\n }, [entities, hub.groups, normalizedSearch, permissions, sidebar, tApp]);\n\n let emptyTitle = t('hub.empty.title');\n if (hub.emptyState?.title != null) {\n emptyTitle = resolveLabel(hub.emptyState.title, tApp);\n }\n let emptyDescription = t('hub.empty.description');\n if (hub.emptyState?.description != null) {\n emptyDescription = resolveLabel(hub.emptyState.description, tApp);\n }\n let subtitle = t('hub.subtitle');\n if (description != null) {\n subtitle = description;\n }\n const hasMixedKinds = groups.some((group) => {\n const kinds = new Set(\n group.items.map((item) => {\n return item.kind;\n }),\n );\n return kinds.size > 1;\n });\n\n const templateGroups = useMemo<readonly BackofficeHubTemplateGroup[]>(() => {\n return groups.map((group) => {\n return {\n id: group.id,\n title: group.title,\n description: group.description,\n icon: group.icon,\n items: group.items.map((item) => {\n let metaLabel: string | null = null;\n if (hasMixedKinds) {\n metaLabel = t('hub.itemKinds.entity');\n if (item.kind === 'tool') {\n metaLabel = t('hub.itemKinds.tool');\n }\n }\n return {\n id: item.id,\n kind: item.kind,\n label: item.label,\n href: item.href,\n icon: item.icon,\n metaLabel,\n };\n }),\n };\n });\n }, [groups, hasMixedKinds, t]);\n\n let searchConfig: BackofficeHubTemplateSearch | undefined;\n if (searchEnabled) {\n searchConfig = {\n value: search,\n onChange: setSearch,\n placeholder: searchPlaceholder,\n };\n }\n\n return (\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <DetailPageTemplate\n header={{\n title,\n subtitle,\n }}\n >\n <BackofficeHubTemplate\n groups={templateGroups}\n search={searchConfig}\n emptyState={{\n title: emptyTitle,\n description: emptyDescription,\n icon: <SidebarTasksSvg width={28} height={28} aria-hidden=\"true\" />,\n }}\n />\n </DetailPageTemplate>\n </BackofficeRightPageLayout>\n );\n};\n\nexport default BackofficeHubPage;\n"],"mappings":";;;;;;;;;;;;;AAyCA,IA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CASJ,OARI,MACF,IAAe;EACb,OAAO;EACP,UAAU;EACV,aAAa;CACf,IAIA,kBAAC,GAAD;EAAuC;EACrC,UAAA,kBAAC,GAAD;GACE,QAAQ;IACN;IACA;GACF;GAEA,UAAA,kBAAC,GAAD;IACE,QAAQ;IACR,QAAQ;IACR,YAAY;KACV,OAAO;KACP,aAAa;KACb,MAAM,kBAAC,GAAD;MAAiB,OAAO;MAAI,QAAQ;MAAI,eAAY;KAAQ,CAAA;IACpE;GACD,CAAA;EACiB,CAAA;CACK,CAAA;AAE/B"}
|
|
1
|
+
{"version":3,"file":"BackofficeHubPage.js","names":[],"sources":["../../../src/pages/BackofficeHubPage.tsx"],"sourcesContent":["import { useMemo, useState, type JSX, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { DetailPageTemplate } from '@plumile/ui/backoffice/templates/detail_page_template/DetailPageTemplate.js';\nimport { SidebarTasksSvg } from '@plumile/ui/icons/SidebarTasksSvg';\nimport type { BackofficeEntityManifestMap } from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { BackofficeIconComponent } from '../provider/types.js';\nimport type { BackofficePreparedHubRoute } from '../router/createBackofficeRoutes.js';\nimport {\n BackofficeHubTemplate,\n type BackofficeHubTemplateGroup,\n type BackofficeHubTemplateSearch,\n} from '../components/backoffice/hub/BackofficeHubTemplate.js';\nimport { BackofficeRightPageLayout } from '../components/backoffice/layout/breadcrumb/BackofficeRightPageLayout.js';\nimport { buildHubBreadcrumb } from '../components/backoffice/layout/breadcrumb/buildBreadcrumbs.js';\nimport { useBackofficePermissions } from '../components/backoffice/layout/BackofficePermissionsContext.js';\nimport { resolveLabel } from '../components/backoffice/layout/sidebarUtils.js';\n\nexport type BackofficeHubPageProps = {\n prepared: BackofficePreparedHubRoute;\n};\n\ntype HubPageItemView = {\n id: string;\n kind: 'entity' | 'tool';\n label: string;\n href: string;\n icon: ReactNode;\n};\n\ntype HubPageGroupView = {\n id: string;\n title: string;\n description: string | null;\n icon: ReactNode | undefined;\n items: readonly HubPageItemView[];\n};\n\nconst renderIcon = (\n Icon: BackofficeIconComponent | undefined,\n size: number,\n): ReactNode | undefined => {\n if (Icon == null) {\n return undefined;\n }\n return <Icon width={size} height={size} aria-hidden=\"true\" />;\n};\n\nconst isItemVisible = (input: {\n entity: BackofficeEntityManifestMap[string] | null | undefined;\n kind: 'entity' | 'tool';\n permissions: unknown;\n sidebar: ReturnType<typeof useBackofficeConfig>['sidebar'];\n}): boolean => {\n const { entity, kind, permissions, sidebar } = input;\n if (entity == null) {\n return false;\n }\n if (kind === 'entity' && entity.kind !== 'tool' && !entity.hasList) {\n return false;\n }\n const isVisible = sidebar?.isItemVisible?.(\n {\n kind,\n id: entity.id,\n },\n permissions,\n );\n return isVisible !== false;\n};\n\nexport const BackofficeHubPage = ({\n prepared,\n}: BackofficeHubPageProps): JSX.Element => {\n const { t: tApp } = useTranslation();\n const { t } = useBackofficeReactTranslation();\n const { entities, sidebar } = useBackofficeConfig();\n const permissions = useBackofficePermissions();\n const [search, setSearch] = useState('');\n const { hub } = prepared;\n const title = resolveLabel(hub.title, tApp);\n let description: string | undefined;\n if (hub.description != null) {\n description = resolveLabel(hub.description, tApp);\n }\n const breadcrumb = buildHubBreadcrumb({ id: hub.id, title });\n const normalizedSearch = search.trim().toLowerCase();\n const searchEnabled = hub.search?.enabled !== false;\n let searchPlaceholder = t('hub.search.placeholder');\n if (hub.search?.placeholder != null) {\n searchPlaceholder = resolveLabel(hub.search.placeholder, tApp);\n }\n\n const groups = useMemo<readonly HubPageGroupView[]>(() => {\n return hub.groups\n .map((group) => {\n const items = group.items\n .map((item): HubPageItemView | null => {\n const entity = entities[item.id];\n if (entity == null) {\n return null;\n }\n if (\n !isItemVisible({\n entity,\n kind: item.kind,\n permissions,\n sidebar,\n })\n ) {\n return null;\n }\n const entityConfig = entity;\n const label = resolveLabel(entityConfig.label, tApp);\n if (\n normalizedSearch !== '' &&\n !label.toLowerCase().includes(normalizedSearch)\n ) {\n return null;\n }\n return {\n id: item.id,\n kind: item.kind,\n label,\n href: entityConfig.routes.list,\n icon: renderIcon(item.icon, 20),\n };\n })\n .filter((item): item is HubPageItemView => {\n return item != null;\n });\n let groupDescription: string | null = null;\n if (group.description != null) {\n groupDescription = resolveLabel(group.description, tApp);\n }\n return {\n id: group.id,\n title: resolveLabel(group.title, tApp),\n description: groupDescription,\n icon: renderIcon(group.icon, 18),\n items,\n };\n })\n .filter((group) => {\n return group.items.length > 0;\n });\n }, [entities, hub.groups, normalizedSearch, permissions, sidebar, tApp]);\n\n let emptyTitle = t('hub.empty.title');\n if (hub.emptyState?.title != null) {\n emptyTitle = resolveLabel(hub.emptyState.title, tApp);\n }\n let emptyDescription = t('hub.empty.description');\n if (hub.emptyState?.description != null) {\n emptyDescription = resolveLabel(hub.emptyState.description, tApp);\n }\n let subtitle = t('hub.subtitle');\n if (description != null) {\n subtitle = description;\n }\n const hasMixedKinds = groups.some((group) => {\n const kinds = new Set(\n group.items.map((item) => {\n return item.kind;\n }),\n );\n return kinds.size > 1;\n });\n\n const templateGroups = useMemo<readonly BackofficeHubTemplateGroup[]>(() => {\n return groups.map((group) => {\n return {\n id: group.id,\n title: group.title,\n description: group.description,\n icon: group.icon,\n items: group.items.map((item) => {\n let metaLabel: string | null = null;\n if (hasMixedKinds) {\n metaLabel = t('hub.itemKinds.entity');\n if (item.kind === 'tool') {\n metaLabel = t('hub.itemKinds.tool');\n }\n }\n return {\n id: item.id,\n kind: item.kind,\n label: item.label,\n href: item.href,\n icon: item.icon,\n metaLabel,\n };\n }),\n };\n });\n }, [groups, hasMixedKinds, t]);\n\n let searchConfig: BackofficeHubTemplateSearch | undefined;\n if (searchEnabled) {\n searchConfig = {\n value: search,\n onChange: setSearch,\n placeholder: searchPlaceholder,\n };\n }\n\n return (\n <BackofficeRightPageLayout breadcrumb={breadcrumb}>\n <DetailPageTemplate\n header={{\n title,\n subtitle,\n }}\n >\n <BackofficeHubTemplate\n groups={templateGroups}\n search={searchConfig}\n emptyState={{\n title: emptyTitle,\n description: emptyDescription,\n icon: <SidebarTasksSvg width={28} height={28} aria-hidden=\"true\" />,\n }}\n />\n </DetailPageTemplate>\n </BackofficeRightPageLayout>\n );\n};\n\nexport default BackofficeHubPage;\n"],"mappings":";;;;;;;;;;;;;AAyCA,IAAM,KACJ,GACA,MAC0B;CACtB,SAAQ,MAGZ,OAAO,kBAAC,GAAD;EAAM,OAAO;EAAM,QAAQ;EAAM,eAAY;CAAQ,CAAA;AAC9D,GAEM,KAAiB,MAKR;CACb,IAAM,EAAE,WAAQ,SAAM,gBAAa,eAAY;CAc/C,OAbI,KAAU,QAGV,MAAS,YAAY,EAAO,SAAS,UAAU,CAAC,EAAO,UAClD,KAES,GAAS,gBACzB;EACE;EACA,IAAI,EAAO;CACb,GACA,CACF,MACqB;AACvB,GAEa,KAAqB,EAChC,kBACyC;CACzC,IAAM,EAAE,GAAG,MAAS,EAAe,GAC7B,EAAE,SAAM,EAA8B,GACtC,EAAE,aAAU,eAAY,EAAoB,GAC5C,IAAc,EAAyB,GACvC,CAAC,GAAQ,KAAa,EAAS,EAAE,GACjC,EAAE,WAAQ,GACV,IAAQ,EAAa,EAAI,OAAO,CAAI,GACtC;CACJ,AAAI,EAAI,eAAe,SACrB,IAAc,EAAa,EAAI,aAAa,CAAI;CAElD,IAAM,IAAa,EAAmB;EAAE,IAAI,EAAI;EAAI;CAAM,CAAC,GACrD,IAAmB,EAAO,KAAK,CAAC,CAAC,YAAY,GAC7C,IAAgB,EAAI,QAAQ,YAAY,IAC1C,IAAoB,EAAE,wBAAwB;CAClD,AAAI,EAAI,QAAQ,eAAe,SAC7B,IAAoB,EAAa,EAAI,OAAO,aAAa,CAAI;CAG/D,IAAM,IAAS,QACN,EAAI,OACR,KAAK,MAAU;EACd,IAAM,IAAQ,EAAM,MACjB,KAAK,MAAiC;GACrC,IAAM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AC/B,IAAI,IAA2B;GAO/B,OANI,MACF,IAAY,EAAE,sBAAsB,GAChC,EAAK,SAAS,WAChB,IAAY,EAAE,oBAAoB,KAG/B;IACL,IAAI,EAAK;IACT,MAAM,EAAK;IACX,OAAO,EAAK;IACZ,MAAM,EAAK;IACX,MAAM,EAAK;IACX;GACF;EACF,CAAC;CACH,EACD,GACA;EAAC;EAAQ;EAAe;CAAC,CAAC,GAEzB;CASJ,OARI,MACF,IAAe;EACb,OAAO;EACP,UAAU;EACV,aAAa;CACf,IAIA,kBAAC,GAAD;EAAuC;EACrC,UAAA,kBAAC,GAAD;GACE,QAAQ;IACN;IACA;GACF;GAEA,UAAA,kBAAC,GAAD;IACE,QAAQ;IACR,QAAQ;IACR,YAAY;KACV,OAAO;KACP,aAAa;KACb,MAAM,kBAAC,GAAD;MAAiB,OAAO;MAAI,QAAQ;MAAI,eAAY;KAAQ,CAAA;IACpE;GACD,CAAA;EACiB,CAAA;CACK,CAAA;AAE/B"}
|
|
@@ -3,26 +3,24 @@ import { useBackofficeReactTranslation as t } from "../i18n/useBackofficeReactTr
|
|
|
3
3
|
import { useBackofficeConfig as n } from "../provider/BackofficeConfigContext.js";
|
|
4
4
|
import { BackofficeTopbarPortalContextProvider as r } from "../components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js";
|
|
5
5
|
import { resolveActiveEntityId as i, resolveSidebarGroups as a, resolveVisibleEntityIds as ee } from "../components/backoffice/layout/sidebarUtils.js";
|
|
6
|
-
import { BackofficePermissionsProvider as
|
|
7
|
-
import { buildSidebarSections as
|
|
8
|
-
import
|
|
9
|
-
import { BackofficeContentBoundary as
|
|
10
|
-
import { useRelayEnvironment as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useCallback as
|
|
6
|
+
import { BackofficePermissionsProvider as te } from "../components/backoffice/layout/BackofficePermissionsContext.js";
|
|
7
|
+
import { buildSidebarSections as o } from "../components/backoffice/layout/buildSidebarSections.js";
|
|
8
|
+
import ne from "../components/backoffice/layout/mapViewerToSidebarProfileView.js";
|
|
9
|
+
import { BackofficeContentBoundary as re } from "../components/backoffice/routing/BackofficeContentBoundary.js";
|
|
10
|
+
import { useRelayEnvironment as ie } from "../relay/useRelayEnvironment.js";
|
|
11
|
+
import ae from "../hooks/useBackofficeSidebarPins.js";
|
|
12
|
+
import oe from "../hooks/useSidebarGroupCollapse.js";
|
|
13
|
+
import { useCallback as se, useContext as ce, useEffect as s, useMemo as c, useState as l } from "react";
|
|
14
|
+
import { AdminShellLayout as le, SidebarProfileMenu as u, ToastProvider as ue } from "@plumile/ui";
|
|
14
15
|
import { jsx as d } from "react/jsx-runtime";
|
|
15
|
-
import { useTranslation as
|
|
16
|
-
import { commitMutation as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { resetRelayStore as me } from "@plumile/relay/environment.js";
|
|
22
|
-
import { AdminShellLayout as he } from "@plumile/ui/admin/templates/admin_shell_layout/AdminShellLayout.js";
|
|
23
|
-
import { SidebarProfileMenu as p } from "@plumile/ui/components/navigation/sidebar/SidebarProfileMenu.js";
|
|
16
|
+
import { useTranslation as de } from "react-i18next";
|
|
17
|
+
import { commitMutation as fe, usePreloadedQuery as f } from "react-relay";
|
|
18
|
+
import pe from "@plumile/router/routing/RoutingContext.js";
|
|
19
|
+
import { GlobalSearchInput as me } from "@plumile/ui/backoffice/molecules/global_search_input/GlobalSearchInput.js";
|
|
20
|
+
import he from "@plumile/router/routing/useLocation.js";
|
|
21
|
+
import { resetRelayStore as ge } from "@plumile/relay/environment.js";
|
|
24
22
|
//#region src/pages/BackofficeLayoutPage.tsx
|
|
25
|
-
var
|
|
23
|
+
var _e = "plumile:backoffice:recent-items", ve = "plumile:backoffice:sidebar", ye = (e) => {
|
|
26
24
|
if (typeof window > "u") return [];
|
|
27
25
|
try {
|
|
28
26
|
let t = window.localStorage.getItem(e);
|
|
@@ -36,20 +34,20 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
36
34
|
} catch {
|
|
37
35
|
return [];
|
|
38
36
|
}
|
|
39
|
-
},
|
|
37
|
+
}, p = (e, t) => {
|
|
40
38
|
if (!(typeof window > "u")) try {
|
|
41
39
|
window.localStorage.setItem(e, JSON.stringify(t));
|
|
42
40
|
} catch {}
|
|
43
41
|
}, m = ({ children: f, permissions: m, authStatus: h, activeGroupId: g }) => {
|
|
44
|
-
let { t: _ } =
|
|
42
|
+
let { t: _ } = de(), { t: v } = t(), { pathname: y } = he(), b = ce(pe), x = ie(), { auth: S, basePath: C, dashboards: w, entities: T, sidebar: E } = n(), [D, be] = l(""), O = E?.preferences?.storageKey ?? ve, k = E?.preferences?.persistCollapsed === !0, [A, xe] = l(() => {
|
|
45
43
|
if (!k || typeof window > "u") return !1;
|
|
46
44
|
try {
|
|
47
45
|
return window.localStorage.getItem(`${O}:collapsed`) === "true";
|
|
48
46
|
} catch {
|
|
49
47
|
return !1;
|
|
50
48
|
}
|
|
51
|
-
}), [j, M] =
|
|
52
|
-
|
|
49
|
+
}), [j, M] = l(!1), [N, P] = l(null), F = E?.recentItems, I = F?.enabled === !0, L = F?.storageKey ?? _e, R = F?.maxItems ?? 8, [z, Se] = l(() => I ? ye(L) : []);
|
|
50
|
+
s(() => {
|
|
53
51
|
if (!(!k || typeof window > "u")) try {
|
|
54
52
|
window.localStorage.setItem(`${O}:collapsed`, String(A));
|
|
55
53
|
} catch {}
|
|
@@ -58,13 +56,13 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
58
56
|
k,
|
|
59
57
|
O
|
|
60
58
|
]);
|
|
61
|
-
let B =
|
|
59
|
+
let B = c(() => a(T, E), [T, E]), Ce = c(() => Object.keys(B), [B]), we = c(() => Object.fromEntries(Object.entries(B).map(([e, t]) => [e, t.behavior?.defaultCollapsed ?? !0])), [B]), Te = c(() => ee(B, T, E, m), [
|
|
62
60
|
T,
|
|
63
61
|
B,
|
|
64
62
|
m,
|
|
65
63
|
E
|
|
66
|
-
]), V =
|
|
67
|
-
|
|
64
|
+
]), V = c(() => i(y, T), [T, y]);
|
|
65
|
+
s(() => {
|
|
68
66
|
if (!I || V == null) return;
|
|
69
67
|
let e = T[V];
|
|
70
68
|
if (e == null || e.kind !== "tool" && !e.hasList) return;
|
|
@@ -79,7 +77,7 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
79
77
|
};
|
|
80
78
|
Se((e) => {
|
|
81
79
|
let t = [r, ...e.filter((e) => e.id !== r.id || e.kind !== r.kind)].slice(0, R);
|
|
82
|
-
return
|
|
80
|
+
return p(L, t), t;
|
|
83
81
|
});
|
|
84
82
|
}, [
|
|
85
83
|
V,
|
|
@@ -89,7 +87,7 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
89
87
|
L,
|
|
90
88
|
_
|
|
91
89
|
]);
|
|
92
|
-
let H = E?.pinnedItems?.enabled === !0, { pins: Ee, toggle: De, reorder: Oe } =
|
|
90
|
+
let H = E?.pinnedItems?.enabled === !0, { pins: Ee, toggle: De, reorder: Oe } = ae({
|
|
93
91
|
enabled: H,
|
|
94
92
|
storageKey: E?.pinnedItems?.storageKey,
|
|
95
93
|
visibleEntityIds: Te
|
|
@@ -97,13 +95,13 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
97
95
|
H && (U = Ee, W = De, G = Oe);
|
|
98
96
|
let K;
|
|
99
97
|
E?.preferences?.storageKey != null && (K = `${E.preferences.storageKey}:groups`);
|
|
100
|
-
let { collapsedByGroupId: q, setCollapsed: J } =
|
|
98
|
+
let { collapsedByGroupId: q, setCollapsed: J } = oe({
|
|
101
99
|
groupIds: Ce,
|
|
102
100
|
activeGroupId: g,
|
|
103
101
|
defaultCollapsedByGroupId: we,
|
|
104
102
|
persist: E?.preferences?.persistGroups === !0,
|
|
105
103
|
storageKey: K
|
|
106
|
-
}), ke =
|
|
104
|
+
}), ke = c(() => o({
|
|
107
105
|
basePath: C,
|
|
108
106
|
pathname: y,
|
|
109
107
|
entities: T,
|
|
@@ -136,7 +134,7 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
136
134
|
W,
|
|
137
135
|
v,
|
|
138
136
|
_
|
|
139
|
-
]), Ae =
|
|
137
|
+
]), Ae = c(() => o({
|
|
140
138
|
basePath: C,
|
|
141
139
|
pathname: y,
|
|
142
140
|
entities: T,
|
|
@@ -169,12 +167,12 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
169
167
|
W,
|
|
170
168
|
v,
|
|
171
169
|
_
|
|
172
|
-
]), Y =
|
|
170
|
+
]), Y = se(() => {
|
|
173
171
|
j || (M(!0), (async () => {
|
|
174
172
|
try {
|
|
175
173
|
let t = await S.logout.load();
|
|
176
174
|
await new Promise((e, n) => {
|
|
177
|
-
|
|
175
|
+
fe(x, {
|
|
178
176
|
mutation: t.logoutMutation,
|
|
179
177
|
variables: {},
|
|
180
178
|
onCompleted: () => {
|
|
@@ -184,7 +182,7 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
184
182
|
n(e);
|
|
185
183
|
}
|
|
186
184
|
});
|
|
187
|
-
}), localStorage.removeItem("auth_token"), localStorage.removeItem("remember_me"),
|
|
185
|
+
}), localStorage.removeItem("auth_token"), localStorage.removeItem("remember_me"), ge(), b?.history.push({ pathname: e(C) });
|
|
188
186
|
} finally {
|
|
189
187
|
M(!1);
|
|
190
188
|
}
|
|
@@ -195,59 +193,69 @@ var ge = "plumile:backoffice:recent-items", _e = "plumile:backoffice:sidebar", v
|
|
|
195
193
|
j,
|
|
196
194
|
x,
|
|
197
195
|
b
|
|
198
|
-
]), X = h?.me ?? null, Z =
|
|
196
|
+
]), X = h?.me ?? null, Z = c(() => ne({
|
|
199
197
|
viewer: X,
|
|
200
198
|
unknownUserLabel: v("sidebar.profile.unknownUser")
|
|
201
|
-
}), [v, X]), je = /* @__PURE__ */ d(
|
|
202
|
-
collapsed: !1,
|
|
199
|
+
}), [v, X]), je = /* @__PURE__ */ d(u, {
|
|
203
200
|
viewer: Z,
|
|
201
|
+
sectionTitle: v("sidebar.profile.title"),
|
|
204
202
|
labels: {
|
|
205
|
-
sectionTitle: v("sidebar.profile.title"),
|
|
206
203
|
menuAriaLabel: v("sidebar.profile.menuAriaLabel"),
|
|
207
|
-
|
|
204
|
+
triggerAriaLabel: `${v("sidebar.profile.menuAriaLabel")}: ${Z.displayName}`
|
|
208
205
|
},
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
items: [{
|
|
207
|
+
kind: "action",
|
|
208
|
+
id: "sign-out",
|
|
209
|
+
label: v("sidebar.profile.actions.signOut"),
|
|
210
|
+
onSelect: Y,
|
|
211
|
+
disabled: j,
|
|
212
|
+
tone: "danger"
|
|
213
|
+
}]
|
|
214
|
+
}), Me = /* @__PURE__ */ d(u, {
|
|
213
215
|
viewer: Z,
|
|
216
|
+
sectionTitle: v("sidebar.profile.title"),
|
|
214
217
|
labels: {
|
|
215
|
-
sectionTitle: v("sidebar.profile.title"),
|
|
216
218
|
menuAriaLabel: v("sidebar.profile.menuAriaLabel"),
|
|
217
|
-
|
|
219
|
+
triggerAriaLabel: `${v("sidebar.profile.menuAriaLabel")}: ${Z.displayName}`
|
|
218
220
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
+
items: [{
|
|
222
|
+
kind: "action",
|
|
223
|
+
id: "sign-out",
|
|
224
|
+
label: v("sidebar.profile.actions.signOut"),
|
|
225
|
+
onSelect: Y,
|
|
226
|
+
disabled: j,
|
|
227
|
+
tone: "danger"
|
|
228
|
+
}]
|
|
221
229
|
}), Q = null;
|
|
222
|
-
N != null && (Q = /* @__PURE__ */ d(
|
|
223
|
-
let $ = /* @__PURE__ */ d(
|
|
230
|
+
N != null && (Q = /* @__PURE__ */ d(re, { children: f }));
|
|
231
|
+
let $ = /* @__PURE__ */ d(me, {
|
|
224
232
|
value: D,
|
|
225
233
|
onChange: be,
|
|
226
234
|
placeholder: v("sidebar.search.placeholder"),
|
|
227
235
|
ariaLabel: v("sidebar.search.placeholder")
|
|
228
236
|
});
|
|
229
|
-
return /* @__PURE__ */ d(ue, { children: /* @__PURE__ */ d(
|
|
237
|
+
return /* @__PURE__ */ d(ue, { children: /* @__PURE__ */ d(le, {
|
|
230
238
|
sidebar: {
|
|
231
239
|
sections: ke,
|
|
232
240
|
search: $,
|
|
233
241
|
footer: je,
|
|
234
|
-
|
|
242
|
+
collapsed: A,
|
|
235
243
|
onCollapsedChange: xe,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
244
|
+
collapseLabel: v("sidebar.actions.collapseSidebar"),
|
|
245
|
+
expandLabel: v("sidebar.actions.expandSidebar"),
|
|
246
|
+
navigationLabel: v("sidebar.navigationAriaLabel")
|
|
239
247
|
},
|
|
240
248
|
mobileSidebar: {
|
|
241
249
|
sections: Ae,
|
|
242
250
|
search: $,
|
|
243
251
|
footer: Me,
|
|
244
|
-
isCollapsed: !1,
|
|
245
252
|
hideCollapseToggle: !0,
|
|
246
|
-
|
|
253
|
+
navigationLabel: v("sidebar.navigationAriaLabel")
|
|
247
254
|
},
|
|
248
255
|
topbar: { breadcrumb: /* @__PURE__ */ d("div", { ref: P }) },
|
|
256
|
+
containedScrollLabel: v("sidebar.contentAriaLabel"),
|
|
249
257
|
contentScrollMode: "contained",
|
|
250
|
-
children: /* @__PURE__ */ d(
|
|
258
|
+
children: /* @__PURE__ */ d(te, {
|
|
251
259
|
permissions: m,
|
|
252
260
|
children: /* @__PURE__ */ d(r, {
|
|
253
261
|
value: {
|