@burdenoff/microfe-assethandler 2026.710.1 → 2026.713.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assethandler/AssetHandlerRoot.d.ts.map +1 -1
- package/dist/assethandler/AssetHandlerRoot.js +16 -8
- package/dist/assethandler/AssetHandlerRoot.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCategoriesPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCategoriesPage.js +144 -137
- package/dist/assethandler/pages/AssetsAssetCategoriesPage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCreatePage.js +202 -201
- package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetListPage.js +135 -132
- package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
- package/dist/assethandler/providers/AssetHandlerProvider.d.ts +14 -0
- package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
- package/dist/assethandler/providers/AssetHandlerProvider.js +14 -2
- package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
- package/dist/assethandler/types/index.d.ts +32 -0
- package/dist/assethandler/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetHandlerRoot.d.ts","sourceRoot":"","sources":["../../src/assethandler/AssetHandlerRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAgBhC,OAAO,KAAK,EAAE,qBAAqB,EAAW,MAAM,SAAS,CAAC;AAG9D,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"AssetHandlerRoot.d.ts","sourceRoot":"","sources":["../../src/assethandler/AssetHandlerRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAgBhC,OAAO,KAAK,EAAE,qBAAqB,EAAW,MAAM,SAAS,CAAC;AAG9D,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0JtD,CAAC"}
|
|
@@ -7,11 +7,12 @@ import { jsx as f } from "react/jsx-runtime";
|
|
|
7
7
|
import { FeatureFlagProvider as p } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
8
8
|
//#region src/assethandler/AssetHandlerRoot.tsx
|
|
9
9
|
var m = (m) => {
|
|
10
|
-
let { registerNavItems: h, registerFooterItems: g, basePath: _ = "/" } = m;
|
|
10
|
+
let { registerNavItems: h, registerFooterItems: g, basePath: _ = "/", brandLabel: v = "AssetHandler", terminology: y, hiddenCategoryIds: b } = m, x = y?.assets || "Assets";
|
|
11
11
|
return r(() => {
|
|
12
|
-
if (h) return
|
|
12
|
+
if (!h) return;
|
|
13
|
+
let e = new Set(b ?? []), n = (t) => e.has(t.replace(/^assethandler-/, "")), r = {
|
|
13
14
|
id: "assethandler",
|
|
14
|
-
label:
|
|
15
|
+
label: v,
|
|
15
16
|
path: _,
|
|
16
17
|
icon: /* @__PURE__ */ f(i, { size: 20 }),
|
|
17
18
|
order: 82,
|
|
@@ -25,7 +26,7 @@ var m = (m) => {
|
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
id: "assethandler-assets",
|
|
28
|
-
label:
|
|
29
|
+
label: x,
|
|
29
30
|
path: t(_, "assets/asset-list"),
|
|
30
31
|
order: 1
|
|
31
32
|
},
|
|
@@ -110,16 +111,23 @@ var m = (m) => {
|
|
|
110
111
|
order: 17
|
|
111
112
|
}
|
|
112
113
|
]
|
|
113
|
-
}
|
|
114
|
-
|
|
114
|
+
};
|
|
115
|
+
return r.children &&= r.children.filter((e) => !n(e.id)), h(r);
|
|
116
|
+
}, [
|
|
117
|
+
_,
|
|
118
|
+
h,
|
|
119
|
+
v,
|
|
120
|
+
x,
|
|
121
|
+
b
|
|
122
|
+
]), r(() => {
|
|
115
123
|
if (g) return g([{
|
|
116
124
|
id: "assethandler-status",
|
|
117
|
-
label:
|
|
125
|
+
label: `${v} Live`,
|
|
118
126
|
type: "status",
|
|
119
127
|
section: "left",
|
|
120
128
|
order: 10
|
|
121
129
|
}]);
|
|
122
|
-
}, [g]), /* @__PURE__ */ f(p, {
|
|
130
|
+
}, [g, v]), /* @__PURE__ */ f(p, {
|
|
123
131
|
workspaceId: null,
|
|
124
132
|
gateway: "global",
|
|
125
133
|
defaultEnabled: !0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetHandlerRoot.js","names":[],"sources":["../../src/assethandler/AssetHandlerRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n BrainCircuit,\n Boxes,\n Cpu,\n KeyRound,\n Leaf,\n Network,\n Radar,\n ShieldCheck,\n} from 'lucide-react';\n\nimport { AssetHandlerRoutes } from './AssetHandlerRoutes';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { AssetHandlerProvider } from './providers/AssetHandlerProvider';\nimport type { AssetHandlerRootProps, NavItem } from './types';\nimport { joinPath } from './utils/navigation';\n\nexport const AssetHandlerRoot: FC<AssetHandlerRootProps> = (props) => {\n const {
|
|
1
|
+
{"version":3,"file":"AssetHandlerRoot.js","names":[],"sources":["../../src/assethandler/AssetHandlerRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n BrainCircuit,\n Boxes,\n Cpu,\n KeyRound,\n Leaf,\n Network,\n Radar,\n ShieldCheck,\n} from 'lucide-react';\n\nimport { AssetHandlerRoutes } from './AssetHandlerRoutes';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { AssetHandlerProvider } from './providers/AssetHandlerProvider';\nimport type { AssetHandlerRootProps, NavItem } from './types';\nimport { joinPath } from './utils/navigation';\n\nexport const AssetHandlerRoot: FC<AssetHandlerRootProps> = (props) => {\n const {\n registerNavItems,\n registerFooterItems,\n basePath = '/',\n brandLabel = 'AssetHandler',\n terminology,\n hiddenCategoryIds,\n } = props;\n const assetsLabel = terminology?.assets || 'Assets';\n\n useEffect(() => {\n if (!registerNavItems) {\n return;\n }\n\n // Consumers can hide advanced (IT-specific) nav children by passing their\n // id with the \"assethandler-\" prefix stripped, e.g. \"digital-twin\".\n const hidden = new Set(hiddenCategoryIds ?? []);\n const isHidden = (id: string) => hidden.has(id.replace(/^assethandler-/, ''));\n\n const navItem: NavItem = {\n id: 'assethandler',\n label: brandLabel,\n path: basePath,\n icon: <Boxes size={20} />,\n order: 82,\n group: 'products',\n children: [\n {\n id: 'assethandler-dashboard',\n label: 'Dashboard',\n path: basePath,\n order: 0,\n },\n {\n id: 'assethandler-assets',\n label: assetsLabel,\n path: joinPath(basePath, 'assets/asset-list'),\n order: 1,\n },\n {\n id: 'assethandler-operations',\n label: 'Operations',\n path: joinPath(basePath, 'operations/operations-hub'),\n order: 2,\n },\n {\n id: 'assethandler-itil',\n label: 'ITIL',\n path: joinPath(basePath, 'itil/itilhub'),\n order: 3,\n },\n {\n id: 'assethandler-finance',\n label: 'Finance',\n path: joinPath(basePath, 'finance/finance-hub'),\n order: 4,\n },\n {\n id: 'assethandler-security',\n label: 'Security',\n path: joinPath(basePath, 'security/security-hub'),\n order: 7,\n },\n {\n id: 'assethandler-iot',\n label: 'IoT Devices',\n path: joinPath(basePath, 'advanced/iot-devices'),\n icon: <Cpu size={16} />,\n order: 10,\n },\n {\n id: 'assethandler-digital-twin',\n label: 'Digital Twin',\n path: joinPath(basePath, 'advanced/digital-twin'),\n icon: <Boxes size={16} />,\n order: 11,\n },\n {\n id: 'assethandler-sam',\n label: 'SAM',\n path: joinPath(basePath, 'advanced/sam-licenses'),\n icon: <KeyRound size={16} />,\n order: 12,\n },\n {\n id: 'assethandler-cmdb',\n label: 'CMDB',\n path: joinPath(basePath, 'advanced/cmdb-browser'),\n icon: <Network size={16} />,\n order: 13,\n },\n {\n id: 'assethandler-discovery',\n label: 'Discovery',\n path: joinPath(basePath, 'advanced/discovery-jobs'),\n icon: <Radar size={16} />,\n order: 14,\n },\n {\n id: 'assethandler-provenance',\n label: 'Provenance',\n path: joinPath(basePath, 'advanced/provenance'),\n icon: <ShieldCheck size={16} />,\n order: 15,\n },\n {\n id: 'assethandler-esg',\n label: 'ESG',\n path: joinPath(basePath, 'advanced/esg-dashboard'),\n icon: <Leaf size={16} />,\n order: 16,\n },\n {\n id: 'assethandler-ai',\n label: 'AI Predictions',\n path: joinPath(basePath, 'advanced/ai-predictions'),\n icon: <BrainCircuit size={16} />,\n order: 17,\n },\n ],\n };\n\n if (navItem.children) {\n navItem.children = navItem.children.filter((child) => !isHidden(child.id));\n }\n\n return registerNavItems(navItem);\n }, [basePath, registerNavItems, brandLabel, assetsLabel, hiddenCategoryIds]);\n\n useEffect(() => {\n if (!registerFooterItems) {\n return;\n }\n\n return registerFooterItems([\n {\n id: 'assethandler-status',\n label: `${brandLabel} Live`,\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, brandLabel]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <AssetHandlerProvider {...props}>\n <AssetHandlerRoutes />\n </AssetHandlerProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssetsAssetCategoriesPage.d.ts","sourceRoot":"","sources":["../../../src/assethandler/pages/AssetsAssetCategoriesPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AssetsAssetCategoriesPage.d.ts","sourceRoot":"","sources":["../../../src/assethandler/pages/AssetsAssetCategoriesPage.tsx"],"names":[],"mappings":"AAyGA,wBAAgB,yBAAyB,gCAyVxC"}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { useAssetTerminology as t, useHiddenCategoryIds as n } from "../providers/AssetHandlerProvider.js";
|
|
3
|
+
import { useAssetHandlerNavigate as r } from "../hooks/useAssetHandlerNavigate.js";
|
|
4
|
+
import { notify as i } from "../utils/toast.js";
|
|
5
|
+
import { formatCompact as a, formatCurrencyCompact as o } from "../components/charts/chartTheme.js";
|
|
6
|
+
import { BarsChart as s } from "../components/charts/BarsChart.js";
|
|
7
|
+
import { StatTile as c } from "../components/StatTile.js";
|
|
8
|
+
import { ChartCard as l } from "../components/ChartCard.js";
|
|
8
9
|
import "../components/index.js";
|
|
9
|
-
import { useMemo as
|
|
10
|
-
import { ArrowUpDown as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { Badge as
|
|
10
|
+
import { useMemo as u, useState as d } from "react";
|
|
11
|
+
import { ArrowUpDown as f, Box as p, Code as m, Copy as h, ExternalLink as g, Layers as _, Monitor as v, MoreHorizontal as y, Server as b, Truck as x, Wifi as S, Wrench as C } from "lucide-react";
|
|
12
|
+
import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
13
|
+
import { Badge as D, Button as O, DropdownMenu as k, DropdownMenuContent as A, DropdownMenuItem as j, DropdownMenuTrigger as M, GlassCard as N, GradientText as P, IllustratedEmptyState as F, PagePurpose as I } from "@burdenoff/fe-libs/ui";
|
|
13
14
|
//#region src/assethandler/pages/AssetsAssetCategoriesPage.tsx
|
|
14
|
-
var
|
|
15
|
-
electronics: /* @__PURE__ */
|
|
16
|
-
it_hardware: /* @__PURE__ */
|
|
17
|
-
furniture: /* @__PURE__ */
|
|
18
|
-
vehicles: /* @__PURE__ */
|
|
19
|
-
equipment: /* @__PURE__ */ C
|
|
20
|
-
software: /* @__PURE__ */
|
|
21
|
-
networking: /* @__PURE__ */
|
|
22
|
-
servers: /* @__PURE__ */
|
|
23
|
-
},
|
|
15
|
+
var L = {
|
|
16
|
+
electronics: /* @__PURE__ */ T(v, { className: "h-5 w-5" }),
|
|
17
|
+
it_hardware: /* @__PURE__ */ T(v, { className: "h-5 w-5" }),
|
|
18
|
+
furniture: /* @__PURE__ */ T(p, { className: "h-5 w-5" }),
|
|
19
|
+
vehicles: /* @__PURE__ */ T(x, { className: "h-5 w-5" }),
|
|
20
|
+
equipment: /* @__PURE__ */ T(C, { className: "h-5 w-5" }),
|
|
21
|
+
software: /* @__PURE__ */ T(m, { className: "h-5 w-5" }),
|
|
22
|
+
networking: /* @__PURE__ */ T(S, { className: "h-5 w-5" }),
|
|
23
|
+
servers: /* @__PURE__ */ T(b, { className: "h-5 w-5" })
|
|
24
|
+
}, R = {
|
|
24
25
|
electronics: "bg-status-info-bg-subtle text-status-info-text",
|
|
25
26
|
it_hardware: "bg-status-info-bg-subtle text-status-info-text",
|
|
26
27
|
furniture: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
@@ -29,20 +30,20 @@ var F = {
|
|
|
29
30
|
software: "bg-action-primary-bg/10 text-action-primary-bg",
|
|
30
31
|
networking: "bg-status-info-bg-subtle text-status-info-text",
|
|
31
32
|
servers: "bg-status-error-bg-subtle text-status-error-text"
|
|
32
|
-
},
|
|
33
|
+
}, z = [
|
|
33
34
|
"bg-status-info-bg-subtle text-status-info-text",
|
|
34
35
|
"bg-status-success-bg-subtle text-status-success-text",
|
|
35
36
|
"bg-status-warning-bg-subtle text-status-warning-text",
|
|
36
37
|
"bg-status-error-bg-subtle text-status-error-text",
|
|
37
38
|
"bg-action-primary-bg/10 text-action-primary-bg"
|
|
38
39
|
];
|
|
39
|
-
function
|
|
40
|
-
if (
|
|
40
|
+
function B(e) {
|
|
41
|
+
if (R[e]) return R[e];
|
|
41
42
|
let t = 0;
|
|
42
43
|
for (let n = 0; n < e.length; n += 1) t = t * 31 + e.charCodeAt(n) >>> 0;
|
|
43
|
-
return
|
|
44
|
+
return z[t % z.length];
|
|
44
45
|
}
|
|
45
|
-
var
|
|
46
|
+
var V = [
|
|
46
47
|
{
|
|
47
48
|
key: "active",
|
|
48
49
|
label: "Active",
|
|
@@ -68,17 +69,17 @@ var z = [
|
|
|
68
69
|
label: "Disposed",
|
|
69
70
|
varName: "var(--color-text-muted)"
|
|
70
71
|
}
|
|
71
|
-
],
|
|
72
|
+
], H = {
|
|
72
73
|
excellent: 5,
|
|
73
74
|
good: 4,
|
|
74
75
|
fair: 3,
|
|
75
76
|
poor: 2,
|
|
76
77
|
damaged: 1
|
|
77
|
-
},
|
|
78
|
-
function
|
|
79
|
-
let
|
|
78
|
+
}, U = (e) => `$${e.toLocaleString()}`;
|
|
79
|
+
function W() {
|
|
80
|
+
let m = r(), v = t(), b = n(), { assets: x } = e(), S = u(() => x.filter((e) => !b.has(e.category)), [x, b]), [C, R] = d("count"), [z, W] = d("count"), G = u(() => {
|
|
80
81
|
let e = {};
|
|
81
|
-
for (let t of
|
|
82
|
+
for (let t of S) {
|
|
82
83
|
e[t.category] || (e[t.category] = {
|
|
83
84
|
key: t.category,
|
|
84
85
|
count: 0,
|
|
@@ -93,165 +94,171 @@ function H() {
|
|
|
93
94
|
for (let t of Object.values(e)) {
|
|
94
95
|
let e = 0, n = 0;
|
|
95
96
|
for (let [r, i] of Object.entries(t.conditions)) {
|
|
96
|
-
let t =
|
|
97
|
+
let t = H[r];
|
|
97
98
|
t && (e += t * i, n += i);
|
|
98
99
|
}
|
|
99
100
|
t.avgCondition = n > 0 ? e / n : 0;
|
|
100
101
|
}
|
|
101
102
|
return Object.values(e).sort((e, t) => t.count - e.count);
|
|
102
|
-
}, [
|
|
103
|
+
}, [S]), K = S.length, q = u(() => S.reduce((e, t) => e + (t.currentValue ?? t.purchaseValue ?? 0), 0), [S]), J = u(() => G.map((e) => ({
|
|
103
104
|
category: e.key.replace(/_/g, " "),
|
|
104
105
|
count: e.count,
|
|
105
106
|
value: e.totalValue
|
|
106
|
-
})), [
|
|
107
|
-
navigator.clipboard?.writeText(e),
|
|
107
|
+
})), [G]), Y = u(() => [...G].sort((e, t) => z === "count" ? t.count - e.count : t.totalValue - e.totalValue), [G, z]), X = (e) => {
|
|
108
|
+
navigator.clipboard?.writeText(e), i.success("Category copied", `"${e.replace(/_/g, " ")}" copied to clipboard.`);
|
|
108
109
|
};
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
+
return /* @__PURE__ */ E("div", {
|
|
110
111
|
className: "space-y-6 p-4 sm:p-6",
|
|
111
112
|
children: [
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h1", {
|
|
113
114
|
className: "text-2xl font-bold",
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
}), /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ E(P, { children: [v.asset, " Categories"] })
|
|
116
|
+
}), /* @__PURE__ */ E("p", {
|
|
116
117
|
className: "text-sm text-text-secondary",
|
|
117
118
|
children: [
|
|
118
|
-
|
|
119
|
+
G.length,
|
|
119
120
|
" categories · ",
|
|
120
|
-
|
|
121
|
-
" total
|
|
121
|
+
K,
|
|
122
|
+
" total",
|
|
123
|
+
" ",
|
|
124
|
+
v.assets.toLowerCase()
|
|
122
125
|
]
|
|
123
126
|
})] }),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
127
|
+
/* @__PURE__ */ T(I, { children: "Group and compare your assets by category to see where value and volume are concentrated. Each card rolls up how many assets you hold, their total book value and a proportional status mix — so you can plan procurement and replacements by category, not one asset at a time." }),
|
|
128
|
+
G.length === 0 ? /* @__PURE__ */ T(F, {
|
|
126
129
|
illustration: "empty-data",
|
|
127
130
|
title: "No categories yet",
|
|
128
|
-
description:
|
|
129
|
-
}) : /* @__PURE__ */ w
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
description: `Add ${v.assets.toLowerCase()} and they will be grouped into categories here automatically.`
|
|
132
|
+
}) : /* @__PURE__ */ E(w, { children: [
|
|
133
|
+
/* @__PURE__ */ E("div", {
|
|
131
134
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
132
135
|
children: [
|
|
133
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ T(c, {
|
|
134
137
|
label: "Categories",
|
|
135
|
-
value:
|
|
136
|
-
format:
|
|
137
|
-
icon:
|
|
138
|
+
value: G.length,
|
|
139
|
+
format: a,
|
|
140
|
+
icon: _,
|
|
138
141
|
hero: !0
|
|
139
142
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
label:
|
|
142
|
-
value:
|
|
143
|
-
format:
|
|
144
|
-
icon:
|
|
143
|
+
/* @__PURE__ */ T(c, {
|
|
144
|
+
label: `${v.assets} tracked`,
|
|
145
|
+
value: K,
|
|
146
|
+
format: a,
|
|
147
|
+
icon: p
|
|
145
148
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ T(c, {
|
|
147
150
|
label: "Total book value",
|
|
148
|
-
value:
|
|
149
|
-
format:
|
|
150
|
-
icon:
|
|
151
|
+
value: q,
|
|
152
|
+
format: o("USD"),
|
|
153
|
+
icon: p
|
|
151
154
|
})
|
|
152
155
|
]
|
|
153
156
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ T("div", {
|
|
155
158
|
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-3",
|
|
156
|
-
children:
|
|
157
|
-
let n =
|
|
158
|
-
return /* @__PURE__ */
|
|
159
|
+
children: G.map((e, t) => {
|
|
160
|
+
let n = K > 0 ? Math.round(e.count / K * 100) : 0, r = V.filter((t) => (e.statuses[t.key] || 0) > 0);
|
|
161
|
+
return /* @__PURE__ */ T(N, {
|
|
159
162
|
treatment: t === 0 ? "glass" : "plain",
|
|
160
163
|
glow: t === 0,
|
|
161
164
|
className: "border-border-seam",
|
|
162
|
-
children: /* @__PURE__ */
|
|
165
|
+
children: /* @__PURE__ */ E("div", {
|
|
163
166
|
className: "space-y-4 p-5",
|
|
164
167
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ E("div", {
|
|
166
169
|
className: "flex items-start justify-between gap-2",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
170
|
+
children: [/* @__PURE__ */ E("div", {
|
|
168
171
|
className: "flex min-w-0 items-center gap-3",
|
|
169
|
-
children: [/* @__PURE__ */
|
|
170
|
-
className: `shrink-0 rounded-lg p-2 ${
|
|
171
|
-
children:
|
|
172
|
-
}), /* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ T("div", {
|
|
173
|
+
className: `shrink-0 rounded-lg p-2 ${B(e.key)}`,
|
|
174
|
+
children: L[e.key] || /* @__PURE__ */ T(p, { className: "h-5 w-5" })
|
|
175
|
+
}), /* @__PURE__ */ E("div", {
|
|
173
176
|
className: "min-w-0",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ T("p", {
|
|
175
178
|
className: "truncate text-base font-semibold capitalize",
|
|
176
179
|
children: e.key.replace(/_/g, " ")
|
|
177
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ E(D, {
|
|
178
181
|
variant: "outline",
|
|
179
182
|
className: "mt-0.5 text-xs",
|
|
180
183
|
children: [n, "% of estate"]
|
|
181
184
|
})]
|
|
182
185
|
})]
|
|
183
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ E(k, { children: [/* @__PURE__ */ T(M, {
|
|
184
187
|
asChild: !0,
|
|
185
|
-
children: /* @__PURE__ */
|
|
188
|
+
children: /* @__PURE__ */ T(O, {
|
|
186
189
|
variant: "ghost",
|
|
187
190
|
size: "icon",
|
|
188
191
|
className: "h-8 w-8 shrink-0",
|
|
189
192
|
"aria-label": `Actions for ${e.key.replace(/_/g, " ")}`,
|
|
190
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ T(y, { className: "h-4 w-4" })
|
|
191
194
|
})
|
|
192
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ E(A, {
|
|
193
196
|
align: "end",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
195
|
-
onClick: () =>
|
|
196
|
-
children: [
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
children: [/* @__PURE__ */ E(j, {
|
|
198
|
+
onClick: () => m("/assets/asset-list"),
|
|
199
|
+
children: [
|
|
200
|
+
/* @__PURE__ */ T(g, { className: "mr-2 h-4 w-4" }),
|
|
201
|
+
"View ",
|
|
202
|
+
v.assets.toLowerCase()
|
|
203
|
+
]
|
|
204
|
+
}), /* @__PURE__ */ E(j, {
|
|
205
|
+
onClick: () => X(e.key),
|
|
206
|
+
children: [/* @__PURE__ */ T(h, { className: "mr-2 h-4 w-4" }), "Copy category ID"]
|
|
200
207
|
})]
|
|
201
208
|
})] })]
|
|
202
209
|
}),
|
|
203
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ E("div", {
|
|
204
211
|
className: "flex flex-wrap items-end justify-between gap-3",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ E("p", {
|
|
206
213
|
className: "text-xs text-text-secondary",
|
|
207
|
-
children: "
|
|
208
|
-
}), /* @__PURE__ */
|
|
214
|
+
children: [v.asset, " count"]
|
|
215
|
+
}), /* @__PURE__ */ T("p", {
|
|
209
216
|
className: "text-2xl font-bold tabular-nums",
|
|
210
217
|
children: e.count
|
|
211
|
-
})] }), /* @__PURE__ */
|
|
218
|
+
})] }), /* @__PURE__ */ E("div", {
|
|
212
219
|
className: "text-right",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ T("p", {
|
|
214
221
|
className: "text-xs text-text-secondary",
|
|
215
222
|
children: "Total value"
|
|
216
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ T("p", {
|
|
217
224
|
className: "text-2xl font-bold tabular-nums",
|
|
218
|
-
children:
|
|
225
|
+
children: o("USD")(e.totalValue)
|
|
219
226
|
})]
|
|
220
227
|
})]
|
|
221
228
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("div", {
|
|
223
230
|
className: "flex h-2.5 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
224
231
|
role: "img",
|
|
225
232
|
"aria-label": r.map((t) => `${t.label}: ${e.statuses[t.key]}`).join(", "),
|
|
226
|
-
children: r.map((t) => /* @__PURE__ */
|
|
233
|
+
children: r.map((t) => /* @__PURE__ */ T("div", { style: {
|
|
227
234
|
width: `${(e.statuses[t.key] || 0) / e.count * 100}%`,
|
|
228
235
|
backgroundColor: t.varName
|
|
229
236
|
} }, t.key))
|
|
230
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ T("div", {
|
|
231
238
|
className: "mt-2 flex flex-wrap gap-x-3 gap-y-1",
|
|
232
|
-
children: r.map((t) => /* @__PURE__ */
|
|
239
|
+
children: r.map((t) => /* @__PURE__ */ E("span", {
|
|
233
240
|
className: "inline-flex items-center gap-1.5 text-xs text-text-secondary",
|
|
234
241
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ T("span", {
|
|
236
243
|
className: "h-2.5 w-2.5 rounded-[3px]",
|
|
237
244
|
style: { backgroundColor: t.varName }
|
|
238
245
|
}),
|
|
239
246
|
t.label,
|
|
240
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ T("span", {
|
|
241
248
|
className: "tabular-nums text-text-muted",
|
|
242
249
|
children: e.statuses[t.key]
|
|
243
250
|
})
|
|
244
251
|
]
|
|
245
252
|
}, t.key))
|
|
246
253
|
})] }),
|
|
247
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ E("div", {
|
|
248
255
|
className: "flex items-center justify-between border-t border-border-seam pt-3 text-sm",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ T("span", {
|
|
250
257
|
className: "text-text-secondary",
|
|
251
258
|
children: "Avg. condition"
|
|
252
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ E("span", {
|
|
253
260
|
className: "font-semibold tabular-nums",
|
|
254
|
-
children: [e.avgCondition > 0 ? e.avgCondition.toFixed(1) : "—", /* @__PURE__ */
|
|
261
|
+
children: [e.avgCondition > 0 ? e.avgCondition.toFixed(1) : "—", /* @__PURE__ */ T("span", {
|
|
255
262
|
className: "text-xs font-normal text-text-muted",
|
|
256
263
|
children: " / 5"
|
|
257
264
|
})]
|
|
@@ -262,92 +269,92 @@ function H() {
|
|
|
262
269
|
}, e.key);
|
|
263
270
|
})
|
|
264
271
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ T(l, {
|
|
266
273
|
title: "Category comparison",
|
|
267
|
-
subtitle:
|
|
268
|
-
actions: /* @__PURE__ */
|
|
274
|
+
subtitle: C === "count" ? `${v.assets} per category` : "Book value per category",
|
|
275
|
+
actions: /* @__PURE__ */ E("div", {
|
|
269
276
|
className: "flex gap-1 rounded-md border border-border-seam p-0.5",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
-
variant:
|
|
277
|
+
children: [/* @__PURE__ */ T(O, {
|
|
278
|
+
variant: C === "count" ? "default" : "ghost",
|
|
272
279
|
size: "sm",
|
|
273
280
|
className: "h-7 px-2 text-xs",
|
|
274
|
-
onClick: () =>
|
|
281
|
+
onClick: () => R("count"),
|
|
275
282
|
children: "Count"
|
|
276
|
-
}), /* @__PURE__ */
|
|
277
|
-
variant:
|
|
283
|
+
}), /* @__PURE__ */ T(O, {
|
|
284
|
+
variant: C === "value" ? "default" : "ghost",
|
|
278
285
|
size: "sm",
|
|
279
286
|
className: "h-7 px-2 text-xs",
|
|
280
|
-
onClick: () =>
|
|
287
|
+
onClick: () => R("value"),
|
|
281
288
|
children: "Value"
|
|
282
289
|
})]
|
|
283
290
|
}),
|
|
284
|
-
children: /* @__PURE__ */
|
|
285
|
-
data:
|
|
291
|
+
children: /* @__PURE__ */ T(s, {
|
|
292
|
+
data: J,
|
|
286
293
|
xKey: "category",
|
|
287
294
|
orientation: "horizontal",
|
|
288
|
-
height: Math.max(200,
|
|
295
|
+
height: Math.max(200, J.length * 44),
|
|
289
296
|
categoryWidth: 120,
|
|
290
|
-
valueFormat:
|
|
297
|
+
valueFormat: C === "value" ? o("USD") : a,
|
|
291
298
|
series: [{
|
|
292
|
-
key:
|
|
293
|
-
label:
|
|
299
|
+
key: C,
|
|
300
|
+
label: C === "count" ? v.assets : "Book value"
|
|
294
301
|
}]
|
|
295
302
|
})
|
|
296
303
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ T(l, {
|
|
298
305
|
title: "Category summary",
|
|
299
306
|
subtitle: "Sortable roll-up across every category",
|
|
300
|
-
icon:
|
|
301
|
-
children: /* @__PURE__ */
|
|
307
|
+
icon: _,
|
|
308
|
+
children: /* @__PURE__ */ T("div", {
|
|
302
309
|
className: "overflow-x-auto",
|
|
303
|
-
children: /* @__PURE__ */
|
|
310
|
+
children: /* @__PURE__ */ E("table", {
|
|
304
311
|
className: "w-full min-w-[520px] text-sm",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
312
|
+
children: [/* @__PURE__ */ T("thead", { children: /* @__PURE__ */ E("tr", {
|
|
306
313
|
className: "border-b border-border-seam text-left text-text-secondary",
|
|
307
314
|
children: [
|
|
308
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ T("th", {
|
|
309
316
|
className: "py-2 pr-4 font-medium",
|
|
310
317
|
children: "Category"
|
|
311
318
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ T("th", {
|
|
313
320
|
className: "py-2 pr-4 font-medium",
|
|
314
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ E("button", {
|
|
315
322
|
type: "button",
|
|
316
323
|
className: "inline-flex items-center gap-1 hover:text-text-primary",
|
|
317
|
-
onClick: () =>
|
|
318
|
-
children: ["Count", /* @__PURE__ */
|
|
324
|
+
onClick: () => W("count"),
|
|
325
|
+
children: ["Count", /* @__PURE__ */ T(f, { className: `h-3 w-3 ${z === "count" ? "text-action-primary-bg" : ""}` })]
|
|
319
326
|
})
|
|
320
327
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ T("th", {
|
|
322
329
|
className: "py-2 pr-4 font-medium",
|
|
323
|
-
children: /* @__PURE__ */
|
|
330
|
+
children: /* @__PURE__ */ E("button", {
|
|
324
331
|
type: "button",
|
|
325
332
|
className: "inline-flex items-center gap-1 hover:text-text-primary",
|
|
326
|
-
onClick: () =>
|
|
327
|
-
children: ["Value", /* @__PURE__ */
|
|
333
|
+
onClick: () => W("value"),
|
|
334
|
+
children: ["Value", /* @__PURE__ */ T(f, { className: `h-3 w-3 ${z === "value" ? "text-action-primary-bg" : ""}` })]
|
|
328
335
|
})
|
|
329
336
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ T("th", {
|
|
331
338
|
className: "py-2 font-medium",
|
|
332
339
|
children: "Avg. condition"
|
|
333
340
|
})
|
|
334
341
|
]
|
|
335
|
-
}) }), /* @__PURE__ */
|
|
342
|
+
}) }), /* @__PURE__ */ T("tbody", { children: Y.map((e) => /* @__PURE__ */ E("tr", {
|
|
336
343
|
className: "border-b border-border-seam/60 last:border-0",
|
|
337
344
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ T("td", {
|
|
339
346
|
className: "py-2.5 pr-4 font-medium capitalize",
|
|
340
347
|
children: e.key.replace(/_/g, " ")
|
|
341
348
|
}),
|
|
342
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ T("td", {
|
|
343
350
|
className: "py-2.5 pr-4 tabular-nums",
|
|
344
351
|
children: e.count
|
|
345
352
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ T("td", {
|
|
347
354
|
className: "py-2.5 pr-4 tabular-nums",
|
|
348
|
-
children:
|
|
355
|
+
children: U(e.totalValue)
|
|
349
356
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ T("td", {
|
|
351
358
|
className: "py-2.5 tabular-nums",
|
|
352
359
|
children: e.avgCondition > 0 ? e.avgCondition.toFixed(1) : "—"
|
|
353
360
|
})
|
|
@@ -361,6 +368,6 @@ function H() {
|
|
|
361
368
|
});
|
|
362
369
|
}
|
|
363
370
|
//#endregion
|
|
364
|
-
export {
|
|
371
|
+
export { W as AssetsAssetCategoriesPage };
|
|
365
372
|
|
|
366
373
|
//# sourceMappingURL=AssetsAssetCategoriesPage.js.map
|