@plumile/backoffice-react 0.1.115 → 0.1.117
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/authRefreshNotice.css.js +1 -0
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js +60 -0
- package/lib/esm/components/backoffice/billing/BackofficeBillingUsageChart.js.map +1 -0
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js +7 -0
- package/lib/esm/components/backoffice/billing/backofficeBillingUsageChart.css.js.map +1 -0
- package/lib/esm/components/backoffice/columns/buildDataTableColumns.js +6 -6
- package/lib/esm/components/backoffice/detail/BackofficeDetailFlagTag.css.js +0 -1
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js +154 -135
- package/lib/esm/components/backoffice/layout/buildSidebarSections.js.map +1 -1
- package/lib/esm/components/backoffice/layout/sidebarUtils.js +24 -21
- package/lib/esm/components/backoffice/layout/sidebarUtils.js.map +1 -1
- package/lib/esm/components/backoffice/links/resolveBackofficeLink.js +62 -54
- package/lib/esm/components/backoffice/links/resolveBackofficeLink.js.map +1 -1
- package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js +1 -1
- package/lib/esm/components/backoffice/links/resolveBackofficeTargetIcon.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js +271 -263
- package/lib/esm/components/backoffice/scaffolds/BackofficeEntityListScaffold.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js +2 -2
- package/lib/esm/components/backoffice/scaffolds/backofficeEntityListScaffold.css.js.map +1 -1
- package/lib/esm/components/backoffice/scaffolds/backofficeListScrollMode.js +6 -0
- package/lib/esm/components/backoffice/scaffolds/backofficeListScrollMode.js.map +1 -0
- package/lib/esm/index.js +75 -74
- package/lib/esm/pages/BackofficeDashboardPage.helpers.js +1 -0
- package/lib/esm/pages/BackofficeDashboardPage.helpers.js.map +1 -1
- package/lib/esm/pages/BackofficeDashboardPage.js +181 -154
- package/lib/esm/pages/BackofficeDashboardPage.js.map +1 -1
- package/lib/esm/pages/BackofficeEntityDetailPage.js +12 -12
- package/lib/esm/pages/BackofficeLayoutPage.js +134 -129
- package/lib/esm/pages/BackofficeLayoutPage.js.map +1 -1
- package/lib/esm/provider/BackofficeConfigContext.js.map +1 -1
- package/lib/esm/provider/BackofficeProvider.js +126 -121
- package/lib/esm/provider/BackofficeProvider.js.map +1 -1
- package/lib/esm/provider/dashboardRegistrations.js +17 -0
- package/lib/esm/provider/dashboardRegistrations.js.map +1 -0
- package/lib/esm/router/createBackofficeRoutes.js +148 -131
- package/lib/esm/router/createBackofficeRoutes.js.map +1 -1
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts +25 -0
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.d.ts.map +1 -0
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.stories.d.ts +41 -0
- package/lib/types/components/backoffice/billing/BackofficeBillingUsageChart.stories.d.ts.map +1 -0
- package/lib/types/components/backoffice/billing/backofficeBillingUsageChart.css.d.ts +4 -0
- package/lib/types/components/backoffice/billing/backofficeBillingUsageChart.css.d.ts.map +1 -0
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +2 -1
- package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
- package/lib/types/components/backoffice/layout/sidebarUtils.d.ts +1 -0
- package/lib/types/components/backoffice/layout/sidebarUtils.d.ts.map +1 -1
- package/lib/types/components/backoffice/links/resolveBackofficeLink.d.ts.map +1 -1
- package/lib/types/components/backoffice/links/types.d.ts +1 -0
- package/lib/types/components/backoffice/links/types.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts +1 -0
- package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts.map +1 -1
- package/lib/types/components/backoffice/scaffolds/backofficeListScrollMode.d.ts +2 -0
- package/lib/types/components/backoffice/scaffolds/backofficeListScrollMode.d.ts.map +1 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts +5 -1
- package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.helpers.d.ts.map +1 -1
- package/lib/types/pages/BackofficeDashboardPage.stories.d.ts +9 -0
- package/lib/types/pages/BackofficeDashboardPage.stories.d.ts.map +1 -0
- package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
- package/lib/types/provider/BackofficeConfigContext.d.ts +2 -1
- package/lib/types/provider/BackofficeConfigContext.d.ts.map +1 -1
- package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
- package/lib/types/provider/dashboardRegistrations.d.ts +4 -0
- package/lib/types/provider/dashboardRegistrations.d.ts.map +1 -0
- package/lib/types/provider/types.d.ts +8 -1
- package/lib/types/provider/types.d.ts.map +1 -1
- package/lib/types/router/createBackofficeRoutes.d.ts +8 -2
- package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { rangeText as e, root as t, totalValue as n } from "./backofficeBillingUsageChart.css.js";
|
|
2
|
+
import { useMemo as r } from "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
import { FormattedDate as o } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
|
|
5
|
+
import { TimeSeriesLineChart as s } from "@plumile/ui/components/charts/TimeSeriesLineChart.js";
|
|
6
|
+
import { formatCurrencyAmount as c } from "@plumile/ui/shared/currencyAmount.js";
|
|
7
|
+
import { toUtcDailyCategorySeries as l } from "@plumile/ui/shared/timeSeries.js";
|
|
8
|
+
//#region src/components/backoffice/billing/BackofficeBillingUsageChart.tsx
|
|
9
|
+
var u = "->", d = ({ ariaLabel: d, buckets: f, categories: p, currency: m, emptyLabel: h, from: g, rangePrefix: _, to: v, totalAmount: y }) => {
|
|
10
|
+
let b = r(() => p.map((e) => e.id), [p]), x = r(() => Object.fromEntries(p.map((e) => [e.id, e.color])), [p]), S = r(() => Object.fromEntries(p.map((e) => [e.id, e.label])), [p]), C = r(() => g == null || v == null ? [] : l({
|
|
11
|
+
fromIsoDateTime: g,
|
|
12
|
+
toIsoDateTime: v,
|
|
13
|
+
buckets: f,
|
|
14
|
+
categories: b
|
|
15
|
+
}), [
|
|
16
|
+
f,
|
|
17
|
+
b,
|
|
18
|
+
g,
|
|
19
|
+
v
|
|
20
|
+
]), w = (e) => c({
|
|
21
|
+
amount: e,
|
|
22
|
+
currency: m
|
|
23
|
+
});
|
|
24
|
+
return f.length === 0 ? /* @__PURE__ */ i("p", {
|
|
25
|
+
className: e,
|
|
26
|
+
children: h
|
|
27
|
+
}) : /* @__PURE__ */ a("div", {
|
|
28
|
+
className: t,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ i("p", {
|
|
31
|
+
className: n,
|
|
32
|
+
children: w(y)
|
|
33
|
+
}),
|
|
34
|
+
g != null && v != null && /* @__PURE__ */ a("p", {
|
|
35
|
+
className: "txvbqb8p txvbqbva3 txvbqbfcp",
|
|
36
|
+
children: [
|
|
37
|
+
_,
|
|
38
|
+
" ",
|
|
39
|
+
/* @__PURE__ */ i(o, { value: g }),
|
|
40
|
+
" ",
|
|
41
|
+
u,
|
|
42
|
+
" ",
|
|
43
|
+
/* @__PURE__ */ i(o, { value: v })
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ i(s, {
|
|
47
|
+
ariaLabel: d,
|
|
48
|
+
categoryColorById: x,
|
|
49
|
+
categoryLabel: (e) => S[e] ?? e,
|
|
50
|
+
categoryOrder: b,
|
|
51
|
+
formatValue: w,
|
|
52
|
+
series: C
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { d as BackofficeBillingUsageChart, d as default };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=BackofficeBillingUsageChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackofficeBillingUsageChart.js","names":[],"sources":["../../../../../src/components/backoffice/billing/BackofficeBillingUsageChart.tsx"],"sourcesContent":["import { useMemo, type JSX } from 'react';\nimport { FormattedDate } from '@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js';\nimport { TimeSeriesLineChart } from '@plumile/ui/components/charts/TimeSeriesLineChart.js';\nimport { formatCurrencyAmount } from '@plumile/ui/shared/currencyAmount.js';\nimport { toUtcDailyCategorySeries } from '@plumile/ui/shared/timeSeries.js';\n\nimport * as styles from './backofficeBillingUsageChart.css.js';\n\nexport type BackofficeBillingUsageChartBucket = {\n readonly day: string;\n readonly category: string;\n readonly value: number;\n};\n\nexport type BackofficeBillingUsageChartCategory = {\n readonly id: string;\n readonly label: string;\n readonly color: string;\n};\n\nexport type BackofficeBillingUsageChartProps = {\n readonly currency: string;\n readonly totalAmount: number;\n readonly from: string | null;\n readonly to: string | null;\n readonly buckets: readonly BackofficeBillingUsageChartBucket[];\n readonly categories: readonly BackofficeBillingUsageChartCategory[];\n readonly emptyLabel: string;\n readonly rangePrefix: string;\n readonly ariaLabel: string;\n};\n\nconst dateSeparator = '->';\n\nexport const BackofficeBillingUsageChart = ({\n ariaLabel,\n buckets,\n categories,\n currency,\n emptyLabel,\n from,\n rangePrefix,\n to,\n totalAmount,\n}: BackofficeBillingUsageChartProps): JSX.Element => {\n const categoryOrder = useMemo(() => {\n return categories.map((category) => {\n return category.id;\n });\n }, [categories]);\n\n const categoryColorById = useMemo(() => {\n return Object.fromEntries(\n categories.map((category) => {\n return [category.id, category.color];\n }),\n );\n }, [categories]);\n\n const categoryLabelById = useMemo(() => {\n return Object.fromEntries(\n categories.map((category) => {\n return [category.id, category.label];\n }),\n );\n }, [categories]);\n\n const series = useMemo(() => {\n if (from == null || to == null) {\n return [];\n }\n\n return toUtcDailyCategorySeries({\n fromIsoDateTime: from,\n toIsoDateTime: to,\n buckets,\n categories: categoryOrder,\n });\n }, [buckets, categoryOrder, from, to]);\n\n const formatChartValue = (value: number): string => {\n return formatCurrencyAmount({\n amount: value,\n currency,\n });\n };\n\n if (buckets.length === 0) {\n return <p className={styles.rangeText}>{emptyLabel}</p>;\n }\n\n return (\n <div className={styles.root}>\n <p className={styles.totalValue}>{formatChartValue(totalAmount)}</p>\n {from != null && to != null && (\n <p className={styles.rangeText}>\n {rangePrefix} <FormattedDate value={from} /> {dateSeparator}{' '}\n <FormattedDate value={to} />\n </p>\n )}\n <TimeSeriesLineChart\n ariaLabel={ariaLabel}\n categoryColorById={categoryColorById}\n categoryLabel={(category) => {\n return categoryLabelById[category] ?? category;\n }}\n categoryOrder={categoryOrder}\n formatValue={formatChartValue}\n series={series}\n />\n </div>\n );\n};\n\nexport default BackofficeBillingUsageChart;\n"],"mappings":";;;;;;;;AAgCA,IAAM,IAAgB,MAET,KAA+B,EAC1C,cACA,YACA,eACA,aACA,eACA,SACA,gBACA,OACA,qBACmD;CACnD,IAAM,IAAgB,QACb,EAAW,KAAK,MACd,EAAS,GAChB,EACD,CAAC,EAAW,CAAC,EAEV,IAAoB,QACjB,OAAO,YACZ,EAAW,KAAK,MACP,CAAC,EAAS,IAAI,EAAS,MAAM,CACpC,CACH,EACA,CAAC,EAAW,CAAC,EAEV,IAAoB,QACjB,OAAO,YACZ,EAAW,KAAK,MACP,CAAC,EAAS,IAAI,EAAS,MAAM,CACpC,CACH,EACA,CAAC,EAAW,CAAC,EAEV,IAAS,QACT,KAAQ,QAAQ,KAAM,OACjB,EAAE,GAGJ,EAAyB;EAC9B,iBAAiB;EACjB,eAAe;EACf;EACA,YAAY;EACb,CAAC,EACD;EAAC;EAAS;EAAe;EAAM;EAAG,CAAC,EAEhC,KAAoB,MACjB,EAAqB;EAC1B,QAAQ;EACR;EACD,CAAC;CAOJ,OAJI,EAAQ,WAAW,IACd,kBAAC,KAAD;EAAG,WAAW;YAAmB;EAAe,CAAA,GAIvD,kBAAC,OAAD;EAAK,WAAW;YAAhB;GACE,kBAAC,KAAD;IAAG,WAAW;cAAoB,EAAiB,EAAY;IAAK,CAAA;GACnE,KAAQ,QAAQ,KAAM,QACrB,kBAAC,KAAD;IAAG,WAAW;cAAd;KACG;KAAY;KAAC,kBAAC,GAAD,EAAe,OAAO,GAAQ,CAAA;;KAAE;KAAe;KAC7D,kBAAC,GAAD,EAAe,OAAO,GAAM,CAAA;KAC1B;;GAEN,kBAAC,GAAD;IACa;IACQ;IACnB,gBAAgB,MACP,EAAkB,MAAa;IAEzB;IACf,aAAa;IACL;IACR,CAAA;GACE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
//#region src/components/backoffice/billing/backofficeBillingUsageChart.css.ts
|
|
3
|
+
var e = "txvbqb9ip txvbqbai7 txvbqbaog", t = "txvbqb9y txvbqba9 txvbqbamp txvbqbv9z txvbqbfcp", n = "txvbqb8p txvbqbva3 txvbqbfcp";
|
|
4
|
+
//#endregion
|
|
5
|
+
export { n as rangeText, e as root, t as totalValue };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=backofficeBillingUsageChart.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backofficeBillingUsageChart.css.js","names":[],"sources":["../../../../../src/components/backoffice/billing/backofficeBillingUsageChart.css.ts"],"sourcesContent":["import { sprinkles } from '@plumile/ui/theme/sprinkles.css.js';\n\nexport const root = sprinkles({\n display: 'flex',\n flexDirection: 'column',\n gap: 3,\n});\n\nexport const totalValue = sprinkles({\n fontSize: {\n base: '2xl',\n md: '3xl',\n },\n fontWeight: 'semibold',\n color: 'text',\n margin: 0,\n});\n\nexport const rangeText = sprinkles({\n fontSize: 'xs',\n color: 'textMuted',\n margin: 0,\n});\n"],"mappings":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BackofficeInlineLink as e } from "../links/BackofficeInlineLink.js";
|
|
2
2
|
import { Fragment as t, jsx as n } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import i from "@plumile/
|
|
5
|
-
import
|
|
3
|
+
import { FormattedDate as r } from "@plumile/ui/atomic/atoms/formatted-date/FormattedDate.js";
|
|
4
|
+
import { BACKOFFICE_DATE_TIME_OPTIONS as i } from "@plumile/backoffice-core/constants.js";
|
|
5
|
+
import a from "@plumile/router/routing/Link.js";
|
|
6
6
|
import { Tag as o } from "@plumile/ui/backoffice/atoms/tag/Tag.js";
|
|
7
7
|
//#region src/components/backoffice/columns/buildDataTableColumns.tsx
|
|
8
8
|
var s = (e, t) => e(t), c = (e, t) => e == null || typeof e == "string" && e.trim() === "" ? t : String(e), l = (e) => {
|
|
@@ -25,7 +25,7 @@ function u(u, d) {
|
|
|
25
25
|
case "text": return c(l.value(s), m);
|
|
26
26
|
case "link": {
|
|
27
27
|
let e = l.value(s);
|
|
28
|
-
return e == null || typeof e == "string" && e.trim() === "" ? m : /* @__PURE__ */ n(
|
|
28
|
+
return e == null || typeof e == "string" && e.trim() === "" ? m : /* @__PURE__ */ n(a, {
|
|
29
29
|
to: l.to(s),
|
|
30
30
|
children: e
|
|
31
31
|
});
|
|
@@ -39,10 +39,10 @@ function u(u, d) {
|
|
|
39
39
|
children: e
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
case "dateTime": return /* @__PURE__ */ n(
|
|
42
|
+
case "dateTime": return /* @__PURE__ */ n(r, {
|
|
43
43
|
value: l.value(s),
|
|
44
44
|
fallback: m,
|
|
45
|
-
options:
|
|
45
|
+
options: i
|
|
46
46
|
});
|
|
47
47
|
case "entityRef": {
|
|
48
48
|
let t = l.value(s);
|
|
@@ -1,74 +1,80 @@
|
|
|
1
|
-
import { buildEntityGroupLookup as e, isActivePath as t,
|
|
2
|
-
import { actionButton as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { buildEntityGroupLookup as e, isActivePath as t, joinBackofficePath as n, resolveGroupItems as r, resolveHubEntityIds as i, resolveLabel as a, resolveSidebarGroups as o, resolveSidebarHub as s } from "./sidebarUtils.js";
|
|
2
|
+
import { actionButton as c } from "./backofficeSidebarActions.css.js";
|
|
3
|
+
import { findBackofficeDashboardRegistration as l } from "../../../provider/dashboardRegistrations.js";
|
|
4
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
5
|
+
import { SidebarTasksSvg as d } from "@plumile/ui/icons/SidebarTasksSvg.js";
|
|
6
|
+
import { SidebarHomeSvg as f } from "@plumile/ui/icons/SidebarHomeSvg.js";
|
|
7
|
+
import { BackofficeSidebarHistorySvg as p } from "@plumile/ui/icons/backoffice/BackofficeSidebarHistorySvg.js";
|
|
8
|
+
import { GripDotsSvg as m } from "@plumile/ui/icons/GripDotsSvg.js";
|
|
9
|
+
import { PinFilledSvg as h } from "@plumile/ui/icons/PinFilledSvg.js";
|
|
10
|
+
import { PinSvg as g } from "@plumile/ui/icons/PinSvg.js";
|
|
10
11
|
//#region src/components/backoffice/layout/buildSidebarSections.tsx
|
|
11
|
-
var
|
|
12
|
+
var _ = (e, t, n = 18) => e == null ? t ?? null : /* @__PURE__ */ u(e, {
|
|
12
13
|
width: n,
|
|
13
14
|
height: n,
|
|
14
15
|
"aria-hidden": "true"
|
|
15
16
|
});
|
|
16
|
-
function
|
|
17
|
-
let { basePath:
|
|
18
|
-
if (
|
|
19
|
-
let t =
|
|
20
|
-
return t && (n =
|
|
17
|
+
function v(v) {
|
|
18
|
+
let { basePath: y, pathname: b, entities: x, dashboards: S = [], sidebar: C, permissions: w, searchQuery: T, tApp: E, t: D, pinnedEntityIds: O = [], recentItems: k = [], onTogglePin: A, onReorderPin: j, collapsedByGroupId: M, onGroupCollapsedChange: N, sidebarCollapsed: P = !1 } = v, F = o(x, C), I = Object.entries(F), L = new Set(O), R = D("sidebar.actions.pin"), z = D("sidebar.actions.unpin"), B = D("sidebar.actions.reorder"), V = e(F, C), H = T?.trim().toLowerCase() ?? "", U = (e) => H === "" || e.toLowerCase().includes(H), W = (e) => {
|
|
19
|
+
if (A == null) return null;
|
|
20
|
+
let t = L.has(e), n = R, r = g;
|
|
21
|
+
return t && (n = z, r = h), /* @__PURE__ */ u("button", {
|
|
21
22
|
type: "button",
|
|
22
|
-
className:
|
|
23
|
+
className: c,
|
|
23
24
|
"aria-pressed": t,
|
|
24
25
|
"aria-label": n,
|
|
25
26
|
title: n,
|
|
26
27
|
onClick: (t) => {
|
|
27
|
-
t.preventDefault(), t.stopPropagation(),
|
|
28
|
+
t.preventDefault(), t.stopPropagation(), A(e);
|
|
28
29
|
},
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ u(r, {
|
|
30
31
|
width: 14,
|
|
31
32
|
height: 14,
|
|
32
33
|
"aria-hidden": "true"
|
|
33
34
|
})
|
|
34
35
|
});
|
|
35
|
-
},
|
|
36
|
-
|
|
36
|
+
}, G = (e, r) => {
|
|
37
|
+
let i = e?.id ?? "dashboard", o = {
|
|
37
38
|
kind: "dashboard",
|
|
38
|
-
id:
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
id: i
|
|
40
|
+
};
|
|
41
|
+
if (C?.isItemVisible?.(o, w) === !1) return null;
|
|
42
|
+
let s = l(S, i), c = e?.label;
|
|
43
|
+
if (c == null && s != null && (c = a(s.label, E)), c ??= D("sidebar.items.dashboard"), !U(c)) return null;
|
|
44
|
+
let d = y, p = "dashboard";
|
|
45
|
+
i !== "dashboard" && (d = n(y, `dashboard/${i}`), p = `dashboard-${i}`);
|
|
46
|
+
let m = t(b, d);
|
|
47
|
+
return i === "dashboard" && (m = b === y || b === `${y}/dashboard`), {
|
|
48
|
+
id: p,
|
|
43
49
|
data: {
|
|
44
50
|
kind: "dashboard",
|
|
45
|
-
id:
|
|
46
|
-
groupId:
|
|
51
|
+
id: i,
|
|
52
|
+
groupId: r
|
|
47
53
|
},
|
|
48
|
-
label:
|
|
49
|
-
href:
|
|
50
|
-
icon:
|
|
54
|
+
label: c,
|
|
55
|
+
href: d,
|
|
56
|
+
icon: _(e?.icon ?? s?.icon, /* @__PURE__ */ u(f, {
|
|
51
57
|
width: 18,
|
|
52
58
|
height: 18,
|
|
53
59
|
"aria-hidden": "true"
|
|
54
60
|
})),
|
|
55
|
-
isActive:
|
|
56
|
-
ariaLabel:
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
let { entityId: n, groupId: r, groupIcon:
|
|
60
|
-
if (
|
|
61
|
-
let
|
|
61
|
+
isActive: m,
|
|
62
|
+
ariaLabel: c
|
|
63
|
+
};
|
|
64
|
+
}, K = (e) => {
|
|
65
|
+
let { entityId: n, groupId: r, groupIcon: i, itemIcon: o, itemLabel: s, enableReorder: c } = e, l = x[n];
|
|
66
|
+
if (l == null) return null;
|
|
67
|
+
let f = {
|
|
62
68
|
kind: "entity",
|
|
63
69
|
id: n
|
|
64
70
|
};
|
|
65
|
-
if (
|
|
71
|
+
if (l.kind === "tool" && (f = {
|
|
66
72
|
kind: "tool",
|
|
67
73
|
id: n
|
|
68
|
-
}),
|
|
69
|
-
if (
|
|
70
|
-
let e = s ??
|
|
71
|
-
return
|
|
74
|
+
}), C?.isItemVisible?.(f, w) === !1) return null;
|
|
75
|
+
if (l.kind === "tool") {
|
|
76
|
+
let e = s ?? a(l.label, E);
|
|
77
|
+
return H !== "" && !e.toLowerCase().includes(H) ? null : {
|
|
72
78
|
id: `tool-${n}`,
|
|
73
79
|
data: {
|
|
74
80
|
kind: "tool",
|
|
@@ -76,69 +82,69 @@ function g(g) {
|
|
|
76
82
|
groupId: r
|
|
77
83
|
},
|
|
78
84
|
label: e,
|
|
79
|
-
href:
|
|
80
|
-
icon:
|
|
85
|
+
href: l.routes.list,
|
|
86
|
+
icon: _(o ?? i, /* @__PURE__ */ u(d, {
|
|
81
87
|
width: 18,
|
|
82
88
|
height: 18,
|
|
83
89
|
"aria-hidden": "true"
|
|
84
90
|
})),
|
|
85
|
-
isActive: t(
|
|
91
|
+
isActive: t(b, l.routes.list),
|
|
86
92
|
ariaLabel: e,
|
|
87
|
-
actionSlot:
|
|
93
|
+
actionSlot: W(n)
|
|
88
94
|
};
|
|
89
95
|
}
|
|
90
|
-
if (!
|
|
91
|
-
let
|
|
92
|
-
if (
|
|
93
|
-
let
|
|
94
|
-
|
|
96
|
+
if (!l.hasList) return null;
|
|
97
|
+
let p = s ?? a(l.label, E);
|
|
98
|
+
if (H !== "" && !p.toLowerCase().includes(H)) return null;
|
|
99
|
+
let h, g, v, y, S = !1;
|
|
100
|
+
c === !0 && j != null && (S = !0, h = /* @__PURE__ */ u(m, {
|
|
95
101
|
width: 14,
|
|
96
102
|
height: 14,
|
|
97
103
|
"aria-hidden": "true"
|
|
98
|
-
}),
|
|
104
|
+
}), g = (e) => {
|
|
99
105
|
let { dataTransfer: t } = e;
|
|
100
106
|
t.effectAllowed = "move", t.setData("text/plain", n);
|
|
101
|
-
},
|
|
107
|
+
}, v = (e) => {
|
|
102
108
|
e.preventDefault();
|
|
103
109
|
let { dataTransfer: t } = e;
|
|
104
110
|
t.dropEffect = "move";
|
|
105
|
-
},
|
|
111
|
+
}, y = (e) => {
|
|
106
112
|
e.preventDefault();
|
|
107
113
|
let t = e.dataTransfer.getData("text/plain");
|
|
108
|
-
t === "" || t === n ||
|
|
114
|
+
t === "" || t === n || j(t, n);
|
|
109
115
|
});
|
|
110
|
-
let
|
|
111
|
-
return
|
|
116
|
+
let T;
|
|
117
|
+
return h != null && (T = B), {
|
|
112
118
|
id: n,
|
|
113
119
|
data: {
|
|
114
120
|
kind: "entity",
|
|
115
121
|
id: n,
|
|
116
122
|
groupId: r
|
|
117
123
|
},
|
|
118
|
-
label:
|
|
119
|
-
href:
|
|
120
|
-
icon:
|
|
124
|
+
label: p,
|
|
125
|
+
href: l.routes.list,
|
|
126
|
+
icon: _(o ?? i, /* @__PURE__ */ u(d, {
|
|
121
127
|
width: 18,
|
|
122
128
|
height: 18,
|
|
123
129
|
"aria-hidden": "true"
|
|
124
130
|
})),
|
|
125
|
-
isActive: t(
|
|
126
|
-
ariaLabel:
|
|
127
|
-
actionSlot:
|
|
128
|
-
dragHandleSlot:
|
|
129
|
-
dragHandleLabel:
|
|
130
|
-
draggable:
|
|
131
|
-
onDragStart:
|
|
132
|
-
onDragOver:
|
|
133
|
-
onDrop:
|
|
131
|
+
isActive: t(b, l.routes.list),
|
|
132
|
+
ariaLabel: p,
|
|
133
|
+
actionSlot: W(n),
|
|
134
|
+
dragHandleSlot: h,
|
|
135
|
+
dragHandleLabel: T,
|
|
136
|
+
draggable: S,
|
|
137
|
+
onDragStart: g,
|
|
138
|
+
onDragOver: v,
|
|
139
|
+
onDrop: y
|
|
134
140
|
};
|
|
135
|
-
},
|
|
136
|
-
let { hub: n, groupId:
|
|
141
|
+
}, q = (e) => {
|
|
142
|
+
let { hub: n, groupId: r, icon: o } = e, s = {
|
|
137
143
|
kind: "hub",
|
|
138
144
|
id: n.id
|
|
139
145
|
};
|
|
140
|
-
if (
|
|
141
|
-
let
|
|
146
|
+
if (C?.isItemVisible?.(s, w) === !1) return null;
|
|
147
|
+
let c = i(n), l = c.map((e) => x[e] ?? null).filter((e) => {
|
|
142
148
|
if (e == null) return !1;
|
|
143
149
|
let t = "entity";
|
|
144
150
|
e.kind === "tool" && (t = "tool");
|
|
@@ -146,54 +152,61 @@ function g(g) {
|
|
|
146
152
|
kind: t,
|
|
147
153
|
id: e.id
|
|
148
154
|
};
|
|
149
|
-
return !(
|
|
155
|
+
return !(C?.isItemVisible?.(n, w) === !1 || e.kind !== "tool" && !e.hasList);
|
|
150
156
|
});
|
|
151
|
-
if (
|
|
152
|
-
let f =
|
|
157
|
+
if (c.length > 0 && l.length === 0) return null;
|
|
158
|
+
let f = a(n.title, E), p = U(f), m = l.some((e) => U(a(e.label, E)));
|
|
153
159
|
if (!p && !m) return null;
|
|
154
|
-
let
|
|
160
|
+
let h = t(b, n.href) || l.some((e) => t(b, e.routes.list));
|
|
155
161
|
return {
|
|
156
162
|
id: `hub-${n.id}`,
|
|
157
163
|
data: {
|
|
158
164
|
kind: "hub",
|
|
159
165
|
id: n.id,
|
|
160
|
-
groupId:
|
|
166
|
+
groupId: r
|
|
161
167
|
},
|
|
162
168
|
label: f,
|
|
163
169
|
href: n.href,
|
|
164
|
-
icon:
|
|
170
|
+
icon: _(o, /* @__PURE__ */ u(d, {
|
|
165
171
|
width: 18,
|
|
166
172
|
height: 18,
|
|
167
173
|
"aria-hidden": "true"
|
|
168
174
|
})),
|
|
169
|
-
isActive:
|
|
175
|
+
isActive: h,
|
|
170
176
|
ariaLabel: f
|
|
171
177
|
};
|
|
172
|
-
},
|
|
173
|
-
if (
|
|
174
|
-
let e =
|
|
175
|
-
if (e.kind === "dashboard")
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
}, J = [], Y = C?.primaryItems ?? [];
|
|
179
|
+
if (Y.length > 0) {
|
|
180
|
+
let e = Y.map((e) => {
|
|
181
|
+
if (e.kind === "dashboard") {
|
|
182
|
+
let t;
|
|
183
|
+
return e.label != null && (t = a(e.label, E)), G({
|
|
184
|
+
id: e.id,
|
|
185
|
+
icon: e.icon,
|
|
186
|
+
label: t
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (e.kind === "hub") return q({
|
|
190
|
+
hub: s(e, C),
|
|
178
191
|
icon: e.icon
|
|
179
192
|
});
|
|
180
193
|
let t;
|
|
181
|
-
return e.label != null && (t =
|
|
194
|
+
return e.label != null && (t = a(e.label, E)), K({
|
|
182
195
|
entityId: e.id,
|
|
183
196
|
itemIcon: e.icon,
|
|
184
197
|
itemLabel: t
|
|
185
198
|
});
|
|
186
199
|
}).filter((e) => e != null);
|
|
187
|
-
e.length > 0 &&
|
|
200
|
+
e.length > 0 && J.push({
|
|
188
201
|
id: "primary",
|
|
189
202
|
items: e,
|
|
190
203
|
collapsible: !1
|
|
191
204
|
});
|
|
192
205
|
}
|
|
193
|
-
if (
|
|
194
|
-
let e =
|
|
195
|
-
let t =
|
|
196
|
-
return
|
|
206
|
+
if (O.length > 0) {
|
|
207
|
+
let e = O.map((e) => {
|
|
208
|
+
let t = V.get(e);
|
|
209
|
+
return K({
|
|
197
210
|
entityId: e,
|
|
198
211
|
groupId: t?.groupId,
|
|
199
212
|
groupIcon: t?.groupIcon,
|
|
@@ -201,10 +214,10 @@ function g(g) {
|
|
|
201
214
|
enableReorder: !0
|
|
202
215
|
});
|
|
203
216
|
}).filter((e) => e != null);
|
|
204
|
-
e.length > 0 &&
|
|
217
|
+
e.length > 0 && J.push({
|
|
205
218
|
id: "pinned",
|
|
206
|
-
title:
|
|
207
|
-
icon:
|
|
219
|
+
title: D("sidebar.sections.pinned"),
|
|
220
|
+
icon: _(void 0, /* @__PURE__ */ u(g, {
|
|
208
221
|
width: 16,
|
|
209
222
|
height: 16,
|
|
210
223
|
"aria-hidden": "true"
|
|
@@ -213,15 +226,15 @@ function g(g) {
|
|
|
213
226
|
collapsible: !1
|
|
214
227
|
});
|
|
215
228
|
}
|
|
216
|
-
if (
|
|
217
|
-
let e =
|
|
218
|
-
if (
|
|
229
|
+
if (k.length > 0) {
|
|
230
|
+
let e = k.map((e) => {
|
|
231
|
+
if (x[e.id] == null) return null;
|
|
219
232
|
let n = {
|
|
220
233
|
kind: e.kind,
|
|
221
234
|
id: e.id
|
|
222
235
|
};
|
|
223
|
-
if (
|
|
224
|
-
let r =
|
|
236
|
+
if (C?.isItemVisible?.(n, w) === !1 || H !== "" && !e.label.toLowerCase().includes(H)) return null;
|
|
237
|
+
let r = V.get(e.id);
|
|
225
238
|
return {
|
|
226
239
|
id: `recent-${e.kind}-${e.id}`,
|
|
227
240
|
data: {
|
|
@@ -231,19 +244,19 @@ function g(g) {
|
|
|
231
244
|
},
|
|
232
245
|
label: e.label,
|
|
233
246
|
href: e.href,
|
|
234
|
-
icon:
|
|
247
|
+
icon: _(r?.itemIcon ?? r?.groupIcon, /* @__PURE__ */ u(d, {
|
|
235
248
|
width: 18,
|
|
236
249
|
height: 18,
|
|
237
250
|
"aria-hidden": "true"
|
|
238
251
|
})),
|
|
239
|
-
isActive: t(
|
|
252
|
+
isActive: t(b, e.href),
|
|
240
253
|
ariaLabel: e.label
|
|
241
254
|
};
|
|
242
255
|
}).filter((e) => e != null);
|
|
243
|
-
e.length > 0 &&
|
|
256
|
+
e.length > 0 && J.push({
|
|
244
257
|
id: "recent",
|
|
245
|
-
title:
|
|
246
|
-
icon:
|
|
258
|
+
title: D("sidebar.sections.recent"),
|
|
259
|
+
icon: _(void 0, /* @__PURE__ */ u(p, {
|
|
247
260
|
width: 16,
|
|
248
261
|
height: 16,
|
|
249
262
|
"aria-hidden": "true"
|
|
@@ -252,55 +265,61 @@ function g(g) {
|
|
|
252
265
|
collapsible: !1
|
|
253
266
|
});
|
|
254
267
|
}
|
|
255
|
-
return
|
|
256
|
-
if (t.isVisible != null && !t.isVisible(
|
|
257
|
-
let
|
|
258
|
-
|
|
259
|
-
if (
|
|
260
|
-
let
|
|
261
|
-
|
|
268
|
+
return I.forEach(([e, t]) => {
|
|
269
|
+
if (t.isVisible != null && !t.isVisible(w)) return;
|
|
270
|
+
let n = [], i = r(t);
|
|
271
|
+
i.length > 0 && i.forEach((r) => {
|
|
272
|
+
if (r.kind === "dashboard") {
|
|
273
|
+
let i;
|
|
274
|
+
r.label != null && (i = a(r.label, E));
|
|
275
|
+
let o = G({
|
|
276
|
+
id: r.id,
|
|
277
|
+
icon: r.icon ?? t.icon,
|
|
278
|
+
label: i
|
|
279
|
+
}, e);
|
|
280
|
+
o != null && n.push(o);
|
|
262
281
|
return;
|
|
263
282
|
}
|
|
264
|
-
if (
|
|
265
|
-
let i =
|
|
266
|
-
hub:
|
|
283
|
+
if (r.kind === "hub") {
|
|
284
|
+
let i = q({
|
|
285
|
+
hub: s(r, C),
|
|
267
286
|
groupId: e,
|
|
268
|
-
icon:
|
|
287
|
+
icon: r.icon ?? t.icon
|
|
269
288
|
});
|
|
270
|
-
i != null &&
|
|
289
|
+
i != null && n.push(i);
|
|
271
290
|
return;
|
|
272
291
|
}
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
let
|
|
276
|
-
entityId:
|
|
292
|
+
let i;
|
|
293
|
+
r.label != null && (i = a(r.label, E));
|
|
294
|
+
let o = K({
|
|
295
|
+
entityId: r.id,
|
|
277
296
|
groupId: e,
|
|
278
297
|
groupIcon: t.icon,
|
|
279
|
-
itemIcon:
|
|
280
|
-
itemLabel:
|
|
298
|
+
itemIcon: r.icon,
|
|
299
|
+
itemLabel: i
|
|
281
300
|
});
|
|
282
|
-
|
|
301
|
+
o != null && n.push(o);
|
|
283
302
|
});
|
|
284
|
-
let
|
|
285
|
-
if (
|
|
303
|
+
let o = n;
|
|
304
|
+
if (P && t.behavior?.showInCollapsedRail !== !0 && (o = n.filter((e) => e.data?.kind === "dashboard" || e.isActive === !0)), o.length === 0) return;
|
|
286
305
|
let c;
|
|
287
|
-
t.title != null && (c =
|
|
288
|
-
let l =
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}),
|
|
306
|
+
t.title != null && (c = a(t.title, E));
|
|
307
|
+
let l = M?.[e], u;
|
|
308
|
+
N != null && (u = (t) => {
|
|
309
|
+
N(e, t);
|
|
310
|
+
}), J.push({
|
|
292
311
|
id: e,
|
|
293
312
|
title: c,
|
|
294
|
-
icon:
|
|
295
|
-
items:
|
|
313
|
+
icon: _(t.icon, void 0, 16),
|
|
314
|
+
items: o,
|
|
296
315
|
collapsible: t.behavior?.collapsible ?? !0,
|
|
297
316
|
defaultCollapsed: t.behavior?.defaultCollapsed ?? !0,
|
|
298
317
|
isCollapsed: l,
|
|
299
318
|
onCollapsedChange: u
|
|
300
319
|
});
|
|
301
|
-
}),
|
|
320
|
+
}), J;
|
|
302
321
|
}
|
|
303
322
|
//#endregion
|
|
304
|
-
export {
|
|
323
|
+
export { v as buildSidebarSections };
|
|
305
324
|
|
|
306
325
|
//# sourceMappingURL=buildSidebarSections.js.map
|