@plumile/backoffice-react 0.1.107 → 0.1.109
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/lib/esm/auth/TotpQrCode.js +1 -1
- package/lib/esm/auth/TotpQrCode.js.map +1 -1
- package/lib/esm/auth/login/EmailCapturePanel.js +27 -23
- package/lib/esm/auth/login/EmailCapturePanel.js.map +1 -1
- package/lib/esm/auth/login/MfaChallengeForm.js +38 -36
- package/lib/esm/auth/login/MfaChallengeForm.js.map +1 -1
- package/lib/esm/auth/login/PasskeyLoginForm.js +40 -37
- package/lib/esm/auth/login/PasskeyLoginForm.js.map +1 -1
- package/lib/esm/auth/pages/AcceptInvitationScreen.js +63 -62
- package/lib/esm/auth/pages/AcceptInvitationScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js +56 -55
- package/lib/esm/auth/pages/PasswordResetCompleteScreen.js.map +1 -1
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js +45 -45
- package/lib/esm/auth/pages/PasswordResetRequestScreen.js.map +1 -1
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js +1 -0
- package/lib/esm/components/backoffice/actions/BackofficeEntityActionFormDialog.js.map +1 -1
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +44 -39
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeCopyButton.js +15 -0
- package/lib/esm/components/backoffice/detail/BackofficeCopyButton.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailActionBar.js +11 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailActionBar.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailBlock.js +7 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailBlock.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailHeader.js +15 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailHeader.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailPage.js +19 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailPage.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationLink.js +47 -40
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationLink.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js +83 -90
- package/lib/esm/components/backoffice/detail/BackofficeDetailRelationListBlock.js.map +1 -1
- package/lib/esm/components/backoffice/detail/BackofficeDetailTable.js +8 -0
- package/lib/esm/components/backoffice/detail/BackofficeDetailTable.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeEmptyValue.js +7 -0
- package/lib/esm/components/backoffice/detail/BackofficeEmptyValue.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js +8 -0
- package/lib/esm/components/backoffice/detail/BackofficeStatusGroup.js.map +1 -0
- package/lib/esm/components/backoffice/detail/BackofficeTechnicalFacts.js +2 -0
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js +16 -8
- package/lib/esm/components/backoffice/filters/EntityFilterValue.js.map +1 -1
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.js +85 -53
- package/lib/esm/components/backoffice/filters/EntityIdFilterField.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/layout/breadcrumb/BackofficeTopbarBreadcrumb.js +53 -48
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js +2 -2
- package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.js +15 -11
- package/lib/esm/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.js.map +1 -1
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js +50 -23
- package/lib/esm/components/backoffice/layout/breadcrumb/buildBreadcrumbs.js.map +1 -1
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js +69 -69
- package/lib/esm/components/backoffice/layout/sidebarUtils.js +16 -16
- package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
- package/lib/esm/components/backoffice/links/BackofficeInlineLink.js +29 -0
- package/lib/esm/components/backoffice/links/BackofficeInlineLink.js.map +1 -0
- package/lib/esm/components/backoffice/links/BackofficeLink.js +21 -0
- package/lib/esm/components/backoffice/links/BackofficeLink.js.map +1 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js +26 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkContent.js.map +1 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkLabel.js +19 -0
- package/lib/esm/components/backoffice/links/BackofficeLinkLabel.js.map +1 -0
- package/lib/esm/components/backoffice/links/backofficeLink.css.js +7 -0
- package/lib/esm/components/backoffice/links/backofficeLink.css.js.map +1 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeLink.js +81 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeLink.js.map +1 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js +50 -0
- package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js.map +1 -0
- package/lib/esm/components/backoffice/links/types.js +0 -0
- package/lib/esm/components/backoffice/links/useBackofficeLink.js +21 -0
- package/lib/esm/components/backoffice/links/useBackofficeLink.js.map +1 -0
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js +1 -0
- package/lib/esm/components/backoffice/pickers/EntityIdPickerDialog.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js +2 -2
- package/lib/esm/components/backoffice/pickers/entityIdPickerDialog.css.js.map +1 -1
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js +27 -21
- package/lib/esm/components/backoffice/pickers/shared/EntityPickerList.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityIdRef.js +27 -27
- package/lib/esm/components/backoffice/refs/BackofficeEntityIdRef.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js +24 -21
- package/lib/esm/components/backoffice/refs/BackofficeEntityLink.js.map +1 -1
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js +45 -44
- package/lib/esm/components/backoffice/refs/BackofficeRelatedCountLink.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +277 -227
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js +25 -30
- package/lib/esm/components/backoffice/shared/BackofficeFilterableCell.js.map +1 -1
- package/lib/esm/i18n/locales/en/backofficeReact.js +8 -0
- package/lib/esm/i18n/locales/en/backofficeReact.js.map +1 -1
- package/lib/esm/i18n/locales/fr/backofficeReact.js +8 -0
- package/lib/esm/i18n/locales/fr/backofficeReact.js.map +1 -1
- package/lib/esm/index.js +88 -73
- package/lib/esm/pages/BackofficeDashboardPage.js +1 -5
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +231 -222
- package/lib/esm/pages/BackofficeEntityDetailPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js +170 -54
- package/lib/esm/pages/BackofficeEntityDetailPage.view-helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityListPage.js +196 -207
- package/lib/esm/pages/BackofficeEntityListPage.js.map +1 -1
- package/lib/esm/pages/BackofficeHubPage.js +21 -21
- package/lib/esm/pages/BackofficeLayoutPage.js +7 -7
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/router/createBackofficeRoutes.js +132 -126
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/esm/style.css +1 -1
- package/lib/types/auth/login/EmailCapturePanel.d.ts.map +1 -1
- package/lib/types/auth/login/MfaChallengeForm.d.ts.map +1 -1
- package/lib/types/auth/login/PasskeyLoginForm.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/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts +0 -1
- package/lib/types/components/backoffice/columns/buildDataTableColumns.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeCopyButton.d.ts +8 -0
- package/lib/types/components/backoffice/detail/BackofficeCopyButton.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailActionBar.d.ts +9 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailActionBar.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailBlock.d.ts +7 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailBlock.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailHeader.d.ts +12 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailHeader.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.d.ts +16 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.stories.d.ts +11 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailPage.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailRelationLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts.map +1 -1
- package/lib/types/components/backoffice/detail/BackofficeDetailTable.d.ts +6 -0
- package/lib/types/components/backoffice/detail/BackofficeDetailTable.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeEmptyValue.d.ts +7 -0
- package/lib/types/components/backoffice/detail/BackofficeEmptyValue.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts +8 -0
- package/lib/types/components/backoffice/detail/BackofficeStatusGroup.d.ts.map +1 -0
- package/lib/types/components/backoffice/detail/BackofficeTechnicalFacts.d.ts +2 -0
- package/lib/types/components/backoffice/detail/BackofficeTechnicalFacts.d.ts.map +1 -0
- package/lib/types/components/backoffice/filters/EntityFilterValue.d.ts +5 -1
- package/lib/types/components/backoffice/filters/EntityFilterValue.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts +1 -0
- package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts.map +1 -1
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts +5 -2
- package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.d.ts +1 -0
- package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts +10 -8
- package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/breadcrumb/types.d.ts +10 -5
- package/lib/types/components/backoffice/layout/breadcrumb/types.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/sidebarUtils.d.ts +6 -2
- package/lib/types/components/backoffice/layout/sidebarUtils.d.ts.map +1 -1
- package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts +18 -0
- package/lib/types/components/backoffice/links/BackofficeInlineLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/BackofficeLink.d.ts +13 -0
- package/lib/types/components/backoffice/links/BackofficeLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/BackofficeLinkContent.d.ts +10 -0
- package/lib/types/components/backoffice/links/BackofficeLinkContent.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/BackofficeLinkLabel.d.ts +12 -0
- package/lib/types/components/backoffice/links/BackofficeLinkLabel.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/backofficeLink.css.d.ts +4 -0
- package/lib/types/components/backoffice/links/backofficeLink.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/resolveBackofficeLink.d.ts +15 -0
- package/lib/types/components/backoffice/links/resolveBackofficeLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/resolveBackofficeTargetIcon.d.ts +8 -0
- package/lib/types/components/backoffice/links/resolveBackofficeTargetIcon.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/types.d.ts +45 -0
- package/lib/types/components/backoffice/links/types.d.ts.map +1 -0
- package/lib/types/components/backoffice/links/useBackofficeLink.d.ts +7 -0
- package/lib/types/components/backoffice/links/useBackofficeLink.d.ts.map +1 -0
- package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts +2 -0
- package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/pickers/shared/EntityPickerList.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/BackofficeEntityLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/refs/BackofficeRelatedCountLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/shared/BackofficeFilterableCell.d.ts +6 -3
- package/lib/types/components/backoffice/shared/BackofficeFilterableCell.d.ts.map +1 -1
- package/lib/types/i18n/resources.d.ts +16 -0
- package/lib/types/i18n/resources.d.ts.map +1 -1
- package/lib/types/index.d.ts +24 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +49 -22
- package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
- package/lib/types/provider/types.d.ts +26 -22
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +36 -1
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityIdFilterField.css.js","names":[],"sources":["../../../../../src/components/backoffice/filters/entityIdFilterField.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { sprinkles, vars } from '@plumile/ui';\n\nexport const container = sprinkles({\n display: 'flex',\n alignItems: 'center',\n
|
|
1
|
+
{"version":3,"file":"entityIdFilterField.css.js","names":[],"sources":["../../../../../src/components/backoffice/filters/entityIdFilterField.css.ts"],"sourcesContent":["import { style } from '@vanilla-extract/css';\nimport { sprinkles, vars } from '@plumile/ui';\n\nexport const container = sprinkles({\n display: 'flex',\n alignItems: 'center',\n width: 72,\n maxWidth: 'full',\n minWidth: 0,\n});\n\nexport const pickerControl = style([\n sprinkles({\n display: 'grid',\n alignItems: 'center',\n flex: 1,\n minWidth: 0,\n borderRadius: 'xl',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'border',\n backgroundColor: 'surface',\n color: 'text',\n paddingX: 3,\n paddingY: 1.5,\n transitionProperty: 'default',\n transitionDuration: 150,\n transitionTimingFunction: 'ease',\n }),\n {\n gridTemplateColumns: 'minmax(0, 1fr) auto auto',\n gridTemplateAreas: '\"content pickAction clearAction\"',\n columnGap: vars.spacing[1],\n minHeight: '2.5rem',\n width: '100%',\n selectors: {\n '&:hover': {\n backgroundColor: vars.colors.surfaceMuted,\n },\n },\n },\n]);\n\nexport const pickerButton = style([\n sprinkles({\n appearance: 'none',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n minWidth: 0,\n width: 'full',\n textAlign: 'left',\n cursor: 'pointer',\n borderWidth: 0,\n backgroundColor: 'transparent',\n color: 'text',\n padding: 0,\n }),\n {\n gridArea: 'content',\n minHeight: '100%',\n selectors: {\n '&:focus-visible': {\n outline: `2px solid ${vars.colors.primary}`,\n outlineOffset: '2px',\n },\n '&:disabled': {\n cursor: 'not-allowed',\n opacity: 0.65,\n },\n },\n },\n]);\n\nexport const content = style([\n sprinkles({\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n gap: 0.5,\n minWidth: 0,\n width: 'full',\n }),\n {\n maxWidth: '100%',\n },\n]);\n\nexport const valueBox = sprinkles({\n flex: 1,\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n overflow: 'hidden',\n});\n\nexport const labelText = style([\n sprinkles({\n display: 'block',\n color: 'textMuted',\n fontSize: 'xs',\n fontWeight: 'medium',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n }),\n {\n minWidth: 0,\n },\n]);\n\nexport const valueText = sprinkles({\n display: 'block',\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n fontSize: 'sm',\n fontWeight: 'semibold',\n});\n\nexport const placeholder = sprinkles({\n display: 'block',\n minWidth: 0,\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n color: 'textMuted',\n fontSize: 'sm',\n});\n\nconst actionButtonBase = style([\n sprinkles({\n appearance: 'none',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: 7,\n height: 7,\n padding: 0,\n borderRadius: 'lg',\n borderWidth: 'default',\n borderStyle: 'solid',\n borderColor: 'borderSubtle',\n backgroundColor: 'surface',\n color: 'textMuted',\n cursor: 'pointer',\n transitionProperty: 'colors',\n transitionDuration: 120,\n transitionTimingFunction: 'ease',\n }),\n {\n alignSelf: 'center',\n selectors: {\n '&:hover:not(:disabled)': {\n color: vars.colors.text,\n backgroundColor: vars.colors.surfaceMuted,\n borderColor: vars.colors.borderStrong,\n },\n '&:focus-visible': {\n outline: `2px solid ${vars.colors.primary}`,\n outlineOffset: '2px',\n },\n '&:disabled': {\n cursor: 'not-allowed',\n opacity: 0.65,\n },\n },\n },\n]);\n\nexport const pickActionButton = style([\n actionButtonBase,\n {\n gridArea: 'pickAction',\n },\n]);\n\nexport const clearButton = style([\n actionButtonBase,\n sprinkles({\n borderRadius: 'full',\n backgroundColor: 'surfaceMuted',\n }),\n {\n gridArea: 'clearAction',\n },\n]);\n\nexport const actionIcon = style({\n width: '1rem',\n height: '1rem',\n});\n"],"mappings":""}
|
|
@@ -1,69 +1,74 @@
|
|
|
1
1
|
import { useBackofficeReactTranslation as e } from "../../../../i18n/useBackofficeReactTranslation.js";
|
|
2
2
|
import { useBackofficeTopbarPortalContext as t } from "./BackofficeTopbarPortalContext.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { BackofficeLink as n } from "../../links/BackofficeLink.js";
|
|
4
|
+
import { BackofficeLinkLabel as r } from "../../links/BackofficeLinkLabel.js";
|
|
5
|
+
import { current as i, homeLabel as a, item as o, link as s, list as c, nav as l, separator as u } from "./backofficeTopbarBreadcrumb.css.js";
|
|
6
|
+
import { SidebarHomeSvg as d } from "@plumile/ui";
|
|
7
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { Link as h } from "@plumile/router";
|
|
7
9
|
//#region src/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.tsx
|
|
8
|
-
var
|
|
9
|
-
let {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
v
|
|
13
|
-
|
|
10
|
+
var g = (e) => {
|
|
11
|
+
let { target: t } = e;
|
|
12
|
+
return t.kind === "dashboard" ? `${e.kind}-dashboard` : t.kind === "entity-list" ? `${e.kind}-entity-list-${t.entityId}` : t.kind === "entity-detail" ? `${e.kind}-entity-detail-${t.entityId}-${t.id}` : t.kind === "entity-detail-page" ? `${e.kind}-entity-detail-page-${t.entityId}-${t.id}-${t.pageId}` : t.kind === "tool" ? `${e.kind}-tool-${t.toolId}` : t.kind === "hub" ? `${e.kind}-hub-${t.hubId}` : `${e.kind}-href-${t.href}`;
|
|
13
|
+
}, _ = ({ items: _ }) => {
|
|
14
|
+
let { t: v } = e(), { dashboardHref: y, dashboardLabel: b } = t(), x = !1, [S] = _;
|
|
15
|
+
_.length === 1 && S != null && (x = S.target.kind === "dashboard" && S.kind === "current");
|
|
16
|
+
let C = _;
|
|
17
|
+
x && (C = []);
|
|
18
|
+
let w = /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, {
|
|
14
19
|
width: 16,
|
|
15
20
|
height: 16,
|
|
16
21
|
"aria-hidden": "true"
|
|
17
|
-
}), /* @__PURE__ */
|
|
18
|
-
className:
|
|
19
|
-
children:
|
|
22
|
+
}), /* @__PURE__ */ p("span", {
|
|
23
|
+
className: a,
|
|
24
|
+
children: b
|
|
20
25
|
})] });
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
className:
|
|
23
|
-
"aria-label":
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
className:
|
|
26
|
-
children: [/* @__PURE__ */
|
|
27
|
-
className:
|
|
28
|
-
children: [
|
|
26
|
+
return /* @__PURE__ */ p("nav", {
|
|
27
|
+
className: l,
|
|
28
|
+
"aria-label": v("common.breadcrumb"),
|
|
29
|
+
children: /* @__PURE__ */ m("ol", {
|
|
30
|
+
className: c,
|
|
31
|
+
children: [/* @__PURE__ */ m("li", {
|
|
32
|
+
className: o,
|
|
33
|
+
children: [x && /* @__PURE__ */ p("span", {
|
|
29
34
|
className: "_80s44h3 _80s44h1 txvbqb9jg txvbqbcp txvbqbdoy txvbqbty7 txvbqbc77 txvbqb1rg txvbqbva1 txvbqb77 txvbqb6x txvbqb7k txvbqbv45 txvbqbv9z",
|
|
30
35
|
"aria-current": "page",
|
|
31
|
-
title:
|
|
32
|
-
children:
|
|
33
|
-
}), !
|
|
34
|
-
to:
|
|
36
|
+
title: b,
|
|
37
|
+
children: w
|
|
38
|
+
}), !x && /* @__PURE__ */ p(h, {
|
|
39
|
+
to: y,
|
|
35
40
|
className: "_80s44h2 _80s44h1 txvbqb9jg txvbqbcp txvbqbdoy txvbqbty7 txvbqbc77 txvbqb1rg txvbqbva1 txvbqb77 txvbqb6x txvbqb7k",
|
|
36
|
-
"aria-label":
|
|
37
|
-
title:
|
|
38
|
-
children:
|
|
41
|
+
"aria-label": b,
|
|
42
|
+
title: b,
|
|
43
|
+
children: w
|
|
39
44
|
})]
|
|
40
|
-
}),
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
else {
|
|
48
|
-
let r = a;
|
|
49
|
-
t && (r = n), s = /* @__PURE__ */ d("span", {
|
|
50
|
-
className: r,
|
|
51
|
-
children: e.label
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return /* @__PURE__ */ f("li", {
|
|
45
|
+
}), C.map((e, t) => {
|
|
46
|
+
let a = e.kind === "current", c = g(e), l = "none";
|
|
47
|
+
t === 0 && (l = "auto");
|
|
48
|
+
let d;
|
|
49
|
+
return d = a ? /* @__PURE__ */ p(r, {
|
|
50
|
+
target: e.target,
|
|
51
|
+
label: e.label,
|
|
55
52
|
className: i,
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
icon: l
|
|
54
|
+
}) : /* @__PURE__ */ p(n, {
|
|
55
|
+
target: e.target,
|
|
56
|
+
label: e.label,
|
|
57
|
+
className: s,
|
|
58
|
+
icon: l
|
|
59
|
+
}), /* @__PURE__ */ m("li", {
|
|
60
|
+
className: o,
|
|
61
|
+
children: [/* @__PURE__ */ p("span", {
|
|
62
|
+
className: u,
|
|
58
63
|
"aria-hidden": "true",
|
|
59
64
|
children: "/"
|
|
60
|
-
}),
|
|
61
|
-
},
|
|
65
|
+
}), d]
|
|
66
|
+
}, c);
|
|
62
67
|
})]
|
|
63
68
|
})
|
|
64
69
|
});
|
|
65
70
|
};
|
|
66
71
|
//#endregion
|
|
67
|
-
export {
|
|
72
|
+
export { _ as BackofficeTopbarBreadcrumb, _ as default };
|
|
68
73
|
|
|
69
74
|
//# sourceMappingURL=BackofficeTopbarBreadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeTopbarBreadcrumb.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport { Link } from '@plumile/router';\nimport { SidebarHomeSvg } from '@plumile/ui';\n\nimport { useBackofficeReactTranslation } from '../../../../i18n/useBackofficeReactTranslation.js';\nimport type { BackofficeTopbarBreadcrumbItem } from './types.js';\nimport { useBackofficeTopbarPortalContext } from './BackofficeTopbarPortalContext.js';\nimport * as styles from './backofficeTopbarBreadcrumb.css.js';\n\nexport type BackofficeTopbarBreadcrumbProps = {\n items: readonly BackofficeTopbarBreadcrumbItem[];\n};\n\nexport const BackofficeTopbarBreadcrumb = ({\n items,\n}: BackofficeTopbarBreadcrumbProps): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n const { dashboardHref, dashboardLabel } = useBackofficeTopbarPortalContext();\n let isDashboardCurrent = false;\n const firstItem = items
|
|
1
|
+
{"version":3,"file":"BackofficeTopbarBreadcrumb.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.tsx"],"sourcesContent":["import { type JSX } from 'react';\nimport { Link } from '@plumile/router';\nimport { SidebarHomeSvg } from '@plumile/ui';\n\nimport { BackofficeLink } from '../../links/BackofficeLink.js';\nimport { BackofficeLinkLabel } from '../../links/BackofficeLinkLabel.js';\nimport { useBackofficeReactTranslation } from '../../../../i18n/useBackofficeReactTranslation.js';\nimport type { BackofficeTopbarBreadcrumbItem } from './types.js';\nimport { useBackofficeTopbarPortalContext } from './BackofficeTopbarPortalContext.js';\nimport * as styles from './backofficeTopbarBreadcrumb.css.js';\n\nexport type BackofficeTopbarBreadcrumbProps = {\n items: readonly BackofficeTopbarBreadcrumbItem[];\n};\n\nconst getBreadcrumbItemKey = (item: BackofficeTopbarBreadcrumbItem): string => {\n const { target } = item;\n if (target.kind === 'dashboard') {\n return `${item.kind}-dashboard`;\n }\n if (target.kind === 'entity-list') {\n return `${item.kind}-entity-list-${target.entityId}`;\n }\n if (target.kind === 'entity-detail') {\n return `${item.kind}-entity-detail-${target.entityId}-${target.id}`;\n }\n if (target.kind === 'entity-detail-page') {\n return `${item.kind}-entity-detail-page-${target.entityId}-${target.id}-${target.pageId}`;\n }\n if (target.kind === 'tool') {\n return `${item.kind}-tool-${target.toolId}`;\n }\n if (target.kind === 'hub') {\n return `${item.kind}-hub-${target.hubId}`;\n }\n return `${item.kind}-href-${target.href}`;\n};\n\nexport const BackofficeTopbarBreadcrumb = ({\n items,\n}: BackofficeTopbarBreadcrumbProps): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n const { dashboardHref, dashboardLabel } = useBackofficeTopbarPortalContext();\n let isDashboardCurrent = false;\n const [firstItem] = items;\n if (items.length === 1 && firstItem != null) {\n isDashboardCurrent =\n firstItem.target.kind === 'dashboard' && firstItem.kind === 'current';\n }\n let visibleItems: readonly BackofficeTopbarBreadcrumbItem[] = items;\n if (isDashboardCurrent) {\n visibleItems = [];\n }\n\n const homeContent = (\n <>\n <SidebarHomeSvg width={16} height={16} aria-hidden=\"true\" />\n <span className={styles.homeLabel}>{dashboardLabel}</span>\n </>\n );\n\n return (\n <nav className={styles.nav} aria-label={t('common.breadcrumb')}>\n <ol className={styles.list}>\n <li className={styles.item}>\n {isDashboardCurrent && (\n <span\n className={styles.homeCurrent}\n aria-current=\"page\"\n title={dashboardLabel}\n >\n {homeContent}\n </span>\n )}\n {!isDashboardCurrent && (\n <Link\n to={dashboardHref}\n className={styles.homeLink}\n aria-label={dashboardLabel}\n title={dashboardLabel}\n >\n {homeContent}\n </Link>\n )}\n </li>\n {visibleItems.map((item, index) => {\n const isCurrent = item.kind === 'current';\n const key = getBreadcrumbItemKey(item);\n let icon: 'auto' | 'none' = 'none';\n if (index === 0) {\n icon = 'auto';\n }\n let content: JSX.Element;\n\n if (!isCurrent) {\n content = (\n <BackofficeLink\n target={item.target}\n label={item.label}\n className={styles.link}\n icon={icon}\n />\n );\n } else {\n content = (\n <BackofficeLinkLabel\n target={item.target}\n label={item.label}\n className={styles.current}\n icon={icon}\n />\n );\n }\n\n return (\n <li key={key} className={styles.item}>\n <span className={styles.separator} aria-hidden=\"true\">\n /\n </span>\n {content}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nexport default BackofficeTopbarBreadcrumb;\n"],"mappings":";;;;;;;;;AAeA,IAAM,KAAwB,MAAiD;CAC7E,IAAM,EAAE,cAAW;CAmBnB,OAlBI,EAAO,SAAS,cACX,GAAG,EAAK,KAAK,cAElB,EAAO,SAAS,gBACX,GAAG,EAAK,KAAK,eAAe,EAAO,aAExC,EAAO,SAAS,kBACX,GAAG,EAAK,KAAK,iBAAiB,EAAO,SAAS,GAAG,EAAO,OAE7D,EAAO,SAAS,uBACX,GAAG,EAAK,KAAK,sBAAsB,EAAO,SAAS,GAAG,EAAO,GAAG,GAAG,EAAO,WAE/E,EAAO,SAAS,SACX,GAAG,EAAK,KAAK,QAAQ,EAAO,WAEjC,EAAO,SAAS,QACX,GAAG,EAAK,KAAK,OAAO,EAAO,UAE7B,GAAG,EAAK,KAAK,QAAQ,EAAO;GAGxB,KAA8B,EACzC,eACkD;CAClD,IAAM,EAAE,SAAM,GAA+B,EACvC,EAAE,kBAAe,sBAAmB,GAAkC,EACxE,IAAqB,IACnB,CAAC,KAAa;CACpB,AAAI,EAAM,WAAW,KAAK,KAAa,SACrC,IACE,EAAU,OAAO,SAAS,eAAe,EAAU,SAAS;CAEhE,IAAI,IAA0D;CAC9D,AAAI,MACF,IAAe,EAAE;CAGnB,IAAM,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;EAAgB,OAAO;EAAI,QAAQ;EAAI,eAAY;EAAS,CAAA,EAC5D,kBAAC,QAAD;EAAM,WAAW;YAAmB;EAAsB,CAAA,CACzD,EAAA,CAAA;CAGL,OACE,kBAAC,OAAD;EAAK,WAAW;EAAY,cAAY,EAAE,oBAAoB;YAC5D,kBAAC,MAAD;GAAI,WAAW;aAAf,CACE,kBAAC,MAAD;IAAI,WAAW;cAAf,CACG,KACC,kBAAC,QAAD;KACE,WAAW;KACX,gBAAa;KACb,OAAO;eAEN;KACI,CAAA,EAER,CAAC,KACA,kBAAC,GAAD;KACE,IAAI;KACJ,WAAW;KACX,cAAY;KACZ,OAAO;eAEN;KACI,CAAA,CAEN;OACJ,EAAa,KAAK,GAAM,MAAU;IACjC,IAAM,IAAY,EAAK,SAAS,WAC1B,IAAM,EAAqB,EAAK,EAClC,IAAwB;IAC5B,AAAI,MAAU,MACZ,IAAO;IAET,IAAI;IAsBJ,OApBA,AACE,IADG,IAWD,kBAAC,GAAD;KACE,QAAQ,EAAK;KACb,OAAO,EAAK;KACZ,WAAW;KACL;KACN,CAAA,GAdF,kBAAC,GAAD;KACE,QAAQ,EAAK;KACb,OAAO,EAAK;KACZ,WAAW;KACL;KACN,CAAA,EAcJ,kBAAC,MAAD;KAAc,WAAW;eAAzB,CACE,kBAAC,QAAD;MAAM,WAAW;MAAkB,eAAY;gBAAO;MAE/C,CAAA,EACN,EACE;OALI,EAKJ;KAEP,CACC;;EACD,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createContext as e, useContext as t } from "react";
|
|
2
2
|
//#region src/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.tsx
|
|
3
|
-
var n = e(null), r = n.Provider, i = () => {
|
|
3
|
+
var n = e(null), r = n.Provider, i = () => t(n), a = () => {
|
|
4
4
|
let e = t(n);
|
|
5
5
|
if (e == null) throw Error("BackofficeTopbarPortalContext is missing. Ensure pages are rendered under BackofficeLayoutPage.");
|
|
6
6
|
return e;
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
|
-
export { r as BackofficeTopbarPortalContextProvider,
|
|
9
|
+
export { r as BackofficeTopbarPortalContextProvider, a as useBackofficeTopbarPortalContext, i as useOptionalBackofficeTopbarPortalContext };
|
|
10
10
|
|
|
11
11
|
//# sourceMappingURL=BackofficeTopbarPortalContext.js.map
|
package/lib/esm/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackofficeTopbarPortalContext.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type BackofficeTopbarPortalContextValue = {\n target: HTMLDivElement | null;\n dashboardHref: string;\n dashboardLabel: string;\n};\n\nconst BackofficeTopbarPortalContext =\n createContext<BackofficeTopbarPortalContextValue | null>(null);\n\nexport const BackofficeTopbarPortalContextProvider =\n BackofficeTopbarPortalContext.Provider;\n\nexport const useBackofficeTopbarPortalContext =\n (): BackofficeTopbarPortalContextValue => {\n const context = useContext(BackofficeTopbarPortalContext);\n if (context == null) {\n throw new Error(\n 'BackofficeTopbarPortalContext is missing. Ensure pages are rendered under BackofficeLayoutPage.',\n );\n }\n return context;\n };\n"],"mappings":";;AAQA,IAAM,IACJ,EAAyD,KAAK,EAEnD,IACX,EAA8B,UAEnB,UAC+B;CACxC,IAAM,IAAU,EAAW,EAA8B;CACzD,IAAI,KAAW,MACb,MAAU,MACR,kGACD;CAEH,OAAO"}
|
|
1
|
+
{"version":3,"file":"BackofficeTopbarPortalContext.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type BackofficeTopbarPortalContextValue = {\n target: HTMLDivElement | null;\n dashboardHref: string;\n dashboardLabel: string;\n};\n\nconst BackofficeTopbarPortalContext =\n createContext<BackofficeTopbarPortalContextValue | null>(null);\n\nexport const BackofficeTopbarPortalContextProvider =\n BackofficeTopbarPortalContext.Provider;\n\nexport const useOptionalBackofficeTopbarPortalContext =\n (): BackofficeTopbarPortalContextValue | null => {\n return useContext(BackofficeTopbarPortalContext);\n };\n\nexport const useBackofficeTopbarPortalContext =\n (): BackofficeTopbarPortalContextValue => {\n const context = useContext(BackofficeTopbarPortalContext);\n if (context == null) {\n throw new Error(\n 'BackofficeTopbarPortalContext is missing. Ensure pages are rendered under BackofficeLayoutPage.',\n );\n }\n return context;\n };\n"],"mappings":";;AAQA,IAAM,IACJ,EAAyD,KAAK,EAEnD,IACX,EAA8B,UAEnB,UAEF,EAAW,EAA8B,EAGvC,UAC+B;CACxC,IAAM,IAAU,EAAW,EAA8B;CACzD,IAAI,KAAW,MACb,MAAU,MACR,kGACD;CAEH,OAAO"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
//#region src/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.ts
|
|
2
|
-
var e = (e, t) => Error(t == null ? `Invalid breadcrumb contract: ${e}` : `Invalid breadcrumb contract: ${e} (${t})`), t = (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var e = (e, t) => Error(t == null ? `Invalid breadcrumb contract: ${e}` : `Invalid breadcrumb contract: ${e} (${t})`), t = (e) => {
|
|
3
|
+
let { target: t } = e;
|
|
4
|
+
return t == null ? "" : t.kind === "dashboard" ? "dashboard" : t.kind === "entity-list" ? `${t.entityId}-list` : t.kind === "entity-detail" ? `${t.entityId}-entity-${t.id}` : t.kind === "entity-detail-page" ? `${t.entityId}-page-${t.id}-${t.pageId}` : t.kind === "tool" ? `tool-${t.toolId}` : t.kind === "hub" ? `hub-${t.hubId}` : `href-${t.href}`;
|
|
5
|
+
}, n = (n) => {
|
|
6
|
+
if (n == null) throw e("MISSING_BREADCRUMB");
|
|
7
|
+
if (n.length === 0) throw e("EMPTY_BREADCRUMB");
|
|
8
|
+
let r = /* @__PURE__ */ new Set();
|
|
9
|
+
if (n.forEach((n, i) => {
|
|
10
|
+
let a = t(n);
|
|
11
|
+
if (a.trim() === "") throw e("INVALID_SEGMENT_ID", `index=${i}`);
|
|
12
|
+
if (r.has(a)) throw e("INVALID_SEGMENT_ID", `duplicate id="${a}"`);
|
|
13
|
+
r.add(a);
|
|
14
|
+
}), n[n.length - 1]?.kind !== "current") throw e("MISSING_CURRENT_SEGMENT");
|
|
15
|
+
return n;
|
|
12
16
|
};
|
|
13
17
|
//#endregion
|
|
14
|
-
export {
|
|
18
|
+
export { n as assertValidBreadcrumb };
|
|
15
19
|
|
|
16
20
|
//# sourceMappingURL=assertValidBreadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertValidBreadcrumb.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.ts"],"sourcesContent":["import type {\n BackofficeTopbarBreadcrumbItem,\n BreadcrumbContractErrorCode,\n} from './types.js';\n\nconst formatContractError = (\n code: BreadcrumbContractErrorCode,\n details?: string,\n): Error => {\n if (details == null) {\n return new Error(`Invalid breadcrumb contract: ${code}`);\n }\n return new Error(`Invalid breadcrumb contract: ${code} (${details})`);\n};\n\nexport const assertValidBreadcrumb = (\n items: readonly BackofficeTopbarBreadcrumbItem[] | null | undefined,\n): readonly BackofficeTopbarBreadcrumbItem[] => {\n if (items == null) {\n throw formatContractError('MISSING_BREADCRUMB');\n }\n if (items.length === 0) {\n throw formatContractError('EMPTY_BREADCRUMB');\n }\n\n const seen = new Set<string>();\n items.forEach((item, index) => {\n
|
|
1
|
+
{"version":3,"file":"assertValidBreadcrumb.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/assertValidBreadcrumb.ts"],"sourcesContent":["import type {\n BackofficeTopbarBreadcrumbItem,\n BreadcrumbContractErrorCode,\n} from './types.js';\n\nconst formatContractError = (\n code: BreadcrumbContractErrorCode,\n details?: string,\n): Error => {\n if (details == null) {\n return new Error(`Invalid breadcrumb contract: ${code}`);\n }\n return new Error(`Invalid breadcrumb contract: ${code} (${details})`);\n};\n\nconst getBreadcrumbItemId = (item: BackofficeTopbarBreadcrumbItem): string => {\n const { target } = item as {\n readonly target?: BackofficeTopbarBreadcrumbItem['target'];\n };\n if (target == null) {\n return '';\n }\n if (target.kind === 'dashboard') {\n return 'dashboard';\n }\n if (target.kind === 'entity-list') {\n return `${target.entityId}-list`;\n }\n if (target.kind === 'entity-detail') {\n return `${target.entityId}-entity-${target.id}`;\n }\n if (target.kind === 'entity-detail-page') {\n return `${target.entityId}-page-${target.id}-${target.pageId}`;\n }\n if (target.kind === 'tool') {\n return `tool-${target.toolId}`;\n }\n if (target.kind === 'hub') {\n return `hub-${target.hubId}`;\n }\n return `href-${target.href}`;\n};\n\nexport const assertValidBreadcrumb = (\n items: readonly BackofficeTopbarBreadcrumbItem[] | null | undefined,\n): readonly BackofficeTopbarBreadcrumbItem[] => {\n if (items == null) {\n throw formatContractError('MISSING_BREADCRUMB');\n }\n if (items.length === 0) {\n throw formatContractError('EMPTY_BREADCRUMB');\n }\n\n const seen = new Set<string>();\n items.forEach((item, index) => {\n const id = getBreadcrumbItemId(item);\n if (id.trim() === '') {\n throw formatContractError('INVALID_SEGMENT_ID', `index=${index}`);\n }\n\n if (seen.has(id)) {\n throw formatContractError('INVALID_SEGMENT_ID', `duplicate id=\"${id}\"`);\n }\n seen.add(id);\n });\n\n const last = items[items.length - 1];\n if (last?.kind !== 'current') {\n throw formatContractError('MISSING_CURRENT_SEGMENT');\n }\n\n return items;\n};\n"],"mappings":";AAKA,IAAM,KACJ,GACA,MAGa,MADT,KAAW,OACI,gCAAgC,MAElC,gCAAgC,EAAK,IAAI,EAAQ,GAFR,EAKtD,KAAuB,MAAiD;CAC5E,IAAM,EAAE,cAAW;CAwBnB,OArBI,KAAU,OACL,KAEL,EAAO,SAAS,cACX,cAEL,EAAO,SAAS,gBACX,GAAG,EAAO,SAAS,SAExB,EAAO,SAAS,kBACX,GAAG,EAAO,SAAS,UAAU,EAAO,OAEzC,EAAO,SAAS,uBACX,GAAG,EAAO,SAAS,QAAQ,EAAO,GAAG,GAAG,EAAO,WAEpD,EAAO,SAAS,SACX,QAAQ,EAAO,WAEpB,EAAO,SAAS,QACX,OAAO,EAAO,UAEhB,QAAQ,EAAO;GAGX,KACX,MAC8C;CAC9C,IAAI,KAAS,MACX,MAAM,EAAoB,qBAAqB;CAEjD,IAAI,EAAM,WAAW,GACnB,MAAM,EAAoB,mBAAmB;CAG/C,IAAM,oBAAO,IAAI,KAAa;CAc9B,IAbA,EAAM,SAAS,GAAM,MAAU;EAC7B,IAAM,IAAK,EAAoB,EAAK;EACpC,IAAI,EAAG,MAAM,KAAK,IAChB,MAAM,EAAoB,sBAAsB,SAAS,IAAQ;EAGnE,IAAI,EAAK,IAAI,EAAG,EACd,MAAM,EAAoB,sBAAsB,iBAAiB,EAAG,GAAG;EAEzE,EAAK,IAAI,EAAG;GACZ,EAEW,EAAM,EAAM,SAAS,IACxB,SAAS,WACjB,MAAM,EAAoB,0BAA0B;CAGtD,OAAO"}
|
|
@@ -7,17 +7,23 @@ var e = (e, t) => e(t), t = (t) => {
|
|
|
7
7
|
let i = t.layoutView.id;
|
|
8
8
|
return typeof i == "string" && i.trim() !== "" ? i : "";
|
|
9
9
|
}, n = (e) => [{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
kind: "current",
|
|
11
|
+
target: { kind: "dashboard" },
|
|
12
|
+
label: e("sidebar.items.dashboard")
|
|
13
13
|
}], r = (e) => [{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
kind: "current",
|
|
15
|
+
target: {
|
|
16
|
+
kind: "hub",
|
|
17
|
+
hubId: e.id
|
|
18
|
+
},
|
|
19
|
+
label: e.title
|
|
17
20
|
}], i = (t, n) => [{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
kind: "current",
|
|
22
|
+
target: {
|
|
23
|
+
kind: "entity-list",
|
|
24
|
+
entityId: t.id
|
|
25
|
+
},
|
|
26
|
+
label: e(t.label, n)
|
|
21
27
|
}], a = (n) => {
|
|
22
28
|
let r = e(n.config.label, n.tApp), i = t({
|
|
23
29
|
layoutView: n.layoutView,
|
|
@@ -26,26 +32,47 @@ var e = (e, t) => e(t), t = (t) => {
|
|
|
26
32
|
});
|
|
27
33
|
return [
|
|
28
34
|
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
kind: "link",
|
|
36
|
+
target: {
|
|
37
|
+
kind: "entity-list",
|
|
38
|
+
entityId: n.config.id
|
|
39
|
+
},
|
|
40
|
+
label: r
|
|
32
41
|
},
|
|
33
42
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
kind: "link",
|
|
44
|
+
target: {
|
|
45
|
+
kind: "entity-detail",
|
|
46
|
+
entityId: n.config.id,
|
|
47
|
+
id: n.entityId
|
|
48
|
+
},
|
|
49
|
+
label: i
|
|
37
50
|
},
|
|
38
51
|
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
kind: "current",
|
|
53
|
+
target: {
|
|
54
|
+
kind: "entity-detail-page",
|
|
55
|
+
entityId: n.config.id,
|
|
56
|
+
id: n.entityId,
|
|
57
|
+
pageId: n.pageId ?? n.pageLabel
|
|
58
|
+
},
|
|
59
|
+
label: n.pageLabel
|
|
42
60
|
}
|
|
43
61
|
];
|
|
44
|
-
}, o = (e) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
62
|
+
}, o = (e) => {
|
|
63
|
+
let t = {
|
|
64
|
+
kind: "href",
|
|
65
|
+
href: `/tools/${e.title}`
|
|
66
|
+
};
|
|
67
|
+
return e.id != null && (t = {
|
|
68
|
+
kind: "tool",
|
|
69
|
+
toolId: e.id
|
|
70
|
+
}), [{
|
|
71
|
+
kind: "current",
|
|
72
|
+
target: t,
|
|
73
|
+
label: e.title
|
|
74
|
+
}];
|
|
75
|
+
};
|
|
49
76
|
//#endregion
|
|
50
77
|
export { n as buildDashboardBreadcrumb, a as buildEntityDetailBreadcrumb, i as buildEntityListBreadcrumb, r as buildHubBreadcrumb, o as buildToolBreadcrumb, t as resolveEntityTitleFromDetailHeader };
|
|
51
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBreadcrumbs.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/buildBreadcrumbs.ts"],"sourcesContent":["import type { TFunction } from 'i18next';\n\nimport type {\n BackofficeResolvedDetailLayoutFacetConfig,\n BackofficeResolvedDetailPageFacetConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\n\nimport type { BackofficeTopbarBreadcrumbItem } from './types.js';\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const resolveEntityTitleFromDetailHeader = <\n LayoutView extends object,\n>(input: {\n layoutView: LayoutView;\n detailHeader: BackofficeResolvedDetailLayoutFacetConfig['header'];\n tApp: TFunction;\n}): string => {\n const titleValue = input.detailHeader.titleValue?.(\n input.layoutView,\n input.tApp,\n );\n if (typeof titleValue === 'string' && titleValue.trim() !== '') {\n return titleValue;\n }\n\n const title = resolveLabel(input.detailHeader.title, input.tApp);\n if (title.trim() !== '') {\n return title;\n }\n\n const maybeId = (input.layoutView as { id?: unknown }).id;\n if (typeof maybeId === 'string' && maybeId.trim() !== '') {\n return maybeId;\n }\n\n return '';\n};\n\nexport const buildDashboardBreadcrumb = (\n t: TFunction,\n): readonly BackofficeTopbarBreadcrumbItem[] => {\n return [\n {\n
|
|
1
|
+
{"version":3,"file":"buildBreadcrumbs.js","names":[],"sources":["../../../../../../src/components/backoffice/layout/breadcrumb/buildBreadcrumbs.ts"],"sourcesContent":["import type { TFunction } from 'i18next';\n\nimport type {\n BackofficeEntityManifestMap,\n BackofficeManifestDetailEntityId,\n BackofficeManifestListEntityId,\n BackofficeManifestToolId,\n BackofficeResolvedDetailLayoutFacetConfig,\n BackofficeResolvedDetailPageFacetConfig,\n BackofficeRuntimeResolvedListFacetConfig,\n I18nLabel,\n} from '@plumile/backoffice-core/types.js';\n\nimport type { BackofficeTopbarBreadcrumbItem } from './types.js';\n\nconst resolveLabel = (label: I18nLabel, tApp: TFunction): string => {\n return label(tApp);\n};\n\nexport const resolveEntityTitleFromDetailHeader = <\n LayoutView extends object,\n>(input: {\n layoutView: LayoutView;\n detailHeader: BackofficeResolvedDetailLayoutFacetConfig['header'];\n tApp: TFunction;\n}): string => {\n const titleValue = input.detailHeader.titleValue?.(\n input.layoutView,\n input.tApp,\n );\n if (typeof titleValue === 'string' && titleValue.trim() !== '') {\n return titleValue;\n }\n\n const title = resolveLabel(input.detailHeader.title, input.tApp);\n if (title.trim() !== '') {\n return title;\n }\n\n const maybeId = (input.layoutView as { id?: unknown }).id;\n if (typeof maybeId === 'string' && maybeId.trim() !== '') {\n return maybeId;\n }\n\n return '';\n};\n\nexport const buildDashboardBreadcrumb = (\n t: TFunction,\n): readonly BackofficeTopbarBreadcrumbItem[] => {\n return [\n {\n kind: 'current',\n target: { kind: 'dashboard' },\n label: t('sidebar.items.dashboard'),\n },\n ];\n};\n\nexport const buildHubBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(input: {\n id: string;\n title: string;\n}): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n return [\n {\n kind: 'current',\n target: { kind: 'hub', hubId: input.id },\n label: input.title,\n },\n ];\n};\n\nexport const buildEntityListBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(\n config: BackofficeRuntimeResolvedListFacetConfig,\n tApp: TFunction,\n): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n return [\n {\n kind: 'current',\n target: {\n kind: 'entity-list',\n entityId: config.id as BackofficeManifestListEntityId<TManifest>,\n },\n label: resolveLabel(config.label, tApp),\n },\n ];\n};\n\nexport const buildEntityDetailBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(input: {\n config:\n | BackofficeResolvedDetailLayoutFacetConfig\n | BackofficeResolvedDetailPageFacetConfig;\n tApp: TFunction;\n entityId: string;\n layoutView: unknown;\n pageLabel: string;\n pageId?: string;\n}): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n const listLabel = resolveLabel(input.config.label, input.tApp);\n const entityTitle = resolveEntityTitleFromDetailHeader({\n layoutView: input.layoutView as object,\n detailHeader: input.config.header,\n tApp: input.tApp,\n });\n\n return [\n {\n kind: 'link',\n target: {\n kind: 'entity-list',\n entityId: input.config.id as BackofficeManifestListEntityId<TManifest>,\n },\n label: listLabel,\n },\n {\n kind: 'link',\n target: {\n kind: 'entity-detail',\n entityId: input.config\n .id as BackofficeManifestDetailEntityId<TManifest>,\n id: input.entityId,\n },\n label: entityTitle,\n },\n {\n kind: 'current',\n target: {\n kind: 'entity-detail-page',\n entityId: input.config\n .id as BackofficeManifestDetailEntityId<TManifest>,\n id: input.entityId,\n pageId: input.pageId ?? input.pageLabel,\n } as never,\n label: input.pageLabel,\n },\n ];\n};\n\nexport const buildToolBreadcrumb = <\n TManifest extends BackofficeEntityManifestMap = BackofficeEntityManifestMap,\n>(input: {\n id?: BackofficeManifestToolId<TManifest> | string;\n title: string;\n}): readonly BackofficeTopbarBreadcrumbItem<TManifest>[] => {\n let target: BackofficeTopbarBreadcrumbItem<TManifest>['target'] = {\n kind: 'href',\n href: `/tools/${input.title}`,\n };\n if (input.id != null) {\n target = {\n kind: 'tool',\n toolId: input.id as BackofficeManifestToolId<TManifest>,\n };\n }\n return [\n {\n kind: 'current',\n target,\n label: input.title,\n },\n ];\n};\n"],"mappings":";AAeA,IAAM,KAAgB,GAAkB,MAC/B,EAAM,EAAK,EAGP,KAEX,MAIY;CACZ,IAAM,IAAa,EAAM,aAAa,aACpC,EAAM,YACN,EAAM,KACP;CACD,IAAI,OAAO,KAAe,YAAY,EAAW,MAAM,KAAK,IAC1D,OAAO;CAGT,IAAM,IAAQ,EAAa,EAAM,aAAa,OAAO,EAAM,KAAK;CAChE,IAAI,EAAM,MAAM,KAAK,IACnB,OAAO;CAGT,IAAM,IAAW,EAAM,WAAgC;CAKvD,OAJI,OAAO,KAAY,YAAY,EAAQ,MAAM,KAAK,KAC7C,IAGF;GAGI,KACX,MAEO,CACL;CACE,MAAM;CACN,QAAQ,EAAE,MAAM,aAAa;CAC7B,OAAO,EAAE,0BAA0B;CACpC,CACF,EAGU,KAEX,MAIO,CACL;CACE,MAAM;CACN,QAAQ;EAAE,MAAM;EAAO,OAAO,EAAM;EAAI;CACxC,OAAO,EAAM;CACd,CACF,EAGU,KAGX,GACA,MAEO,CACL;CACE,MAAM;CACN,QAAQ;EACN,MAAM;EACN,UAAU,EAAO;EAClB;CACD,OAAO,EAAa,EAAO,OAAO,EAAK;CACxC,CACF,EAGU,KAEX,MAS0D;CAC1D,IAAM,IAAY,EAAa,EAAM,OAAO,OAAO,EAAM,KAAK,EACxD,IAAc,EAAmC;EACrD,YAAY,EAAM;EAClB,cAAc,EAAM,OAAO;EAC3B,MAAM,EAAM;EACb,CAAC;CAEF,OAAO;EACL;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAM,OAAO;IACxB;GACD,OAAO;GACR;EACD;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAM,OACb;IACH,IAAI,EAAM;IACX;GACD,OAAO;GACR;EACD;GACE,MAAM;GACN,QAAQ;IACN,MAAM;IACN,UAAU,EAAM,OACb;IACH,IAAI,EAAM;IACV,QAAQ,EAAM,UAAU,EAAM;IAC/B;GACD,OAAO,EAAM;GACd;EACF;GAGU,KAEX,MAG0D;CAC1D,IAAI,IAA8D;EAChE,MAAM;EACN,MAAM,UAAU,EAAM;EACvB;CAOD,OANI,EAAM,MAAM,SACd,IAAS;EACP,MAAM;EACN,QAAQ,EAAM;EACf,GAEI,CACL;EACE,MAAM;EACN;EACA,OAAO,EAAM;EACd,CACF"}
|