@burdenoff/microfe-assethandler 2026.813.1 → 2026.813.2
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/components/charts/BarsChart.js +25 -25
- package/dist/assethandler/components/charts/ChartParts.js +27 -27
- package/dist/assethandler/components/charts/DonutChart.js +17 -17
- package/dist/assethandler/components/charts/ProgressMeter.js +5 -5
- package/dist/assethandler/components/charts/RadialGauge.js +13 -13
- package/dist/assethandler/components/charts/Sparkline.js +27 -27
- package/dist/assethandler/components/charts/TrendChart.js +47 -47
- package/dist/assethandler/components/index.js +1 -1
- package/dist/assethandler/pages/AiPredictionsPage.js +20 -20
- package/dist/assethandler/pages/AnalyticsPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AnalyticsPage.js +133 -133
- package/dist/assethandler/pages/AnalyticsPage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCategoriesPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCategoriesPage.js +55 -55
- 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 +77 -78
- package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetDetailPage.js +140 -141
- package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetListPage.js +249 -249
- package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetTrackingPage.js +8 -8
- package/dist/assethandler/pages/CmdbBrowserPage.js +34 -34
- package/dist/assethandler/pages/DashboardPage.d.ts.map +1 -1
- package/dist/assethandler/pages/DashboardPage.js +256 -255
- package/dist/assethandler/pages/DashboardPage.js.map +1 -1
- package/dist/assethandler/pages/DiscoveryJobsPage.js +27 -27
- package/dist/assethandler/pages/EsgDashboardPage.js +53 -53
- package/dist/assethandler/pages/FinanceBudgetDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/FinanceBudgetDetailPage.js +156 -155
- package/dist/assethandler/pages/FinanceBudgetDetailPage.js.map +1 -1
- package/dist/assethandler/pages/FinanceFinanceHubPage.d.ts.map +1 -1
- package/dist/assethandler/pages/FinanceFinanceHubPage.js +475 -475
- package/dist/assethandler/pages/FinanceFinanceHubPage.js.map +1 -1
- package/dist/assethandler/pages/FinanceInvoiceDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/FinanceInvoiceDetailPage.js +141 -140
- package/dist/assethandler/pages/FinanceInvoiceDetailPage.js.map +1 -1
- package/dist/assethandler/pages/ItilChangeManagementPage.js +21 -21
- package/dist/assethandler/pages/ItilIncidentManagementPage.js +34 -34
- package/dist/assethandler/pages/ItilProblemManagementPage.js +17 -17
- package/dist/assethandler/pages/KnowledgeBasePage.js +39 -39
- package/dist/assethandler/pages/MaintenanceMaintenanceSchedulerPage.d.ts.map +1 -1
- package/dist/assethandler/pages/MaintenanceMaintenanceSchedulerPage.js +114 -114
- package/dist/assethandler/pages/MaintenanceMaintenanceSchedulerPage.js.map +1 -1
- package/dist/assethandler/pages/OperationsMaintenanceDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/OperationsMaintenanceDetailPage.js +158 -157
- package/dist/assethandler/pages/OperationsMaintenanceDetailPage.js.map +1 -1
- package/dist/assethandler/pages/OperationsOperationsHubPage.d.ts.map +1 -1
- package/dist/assethandler/pages/OperationsOperationsHubPage.js +253 -252
- package/dist/assethandler/pages/OperationsOperationsHubPage.js.map +1 -1
- package/dist/assethandler/pages/PortfolioPortfolioOverviewPage.d.ts.map +1 -1
- package/dist/assethandler/pages/PortfolioPortfolioOverviewPage.js +96 -95
- package/dist/assethandler/pages/PortfolioPortfolioOverviewPage.js.map +1 -1
- package/dist/assethandler/pages/ProvenancePage.js +21 -21
- package/dist/assethandler/pages/ReportsDashboardPage.d.ts.map +1 -1
- package/dist/assethandler/pages/ReportsDashboardPage.js +301 -301
- package/dist/assethandler/pages/ReportsDashboardPage.js.map +1 -1
- package/dist/assethandler/pages/SecuritySecurityHubPage.js +126 -126
- package/dist/assethandler/pages/SecuritySecurityHubPage.js.map +1 -1
- package/dist/assethandler/pages/TransactionsTransactionDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/TransactionsTransactionDetailPage.js +112 -113
- package/dist/assethandler/pages/TransactionsTransactionDetailPage.js.map +1 -1
- package/dist/assethandler/pages/TransactionsTransactionListPage.d.ts.map +1 -1
- package/dist/assethandler/pages/TransactionsTransactionListPage.js +136 -137
- package/dist/assethandler/pages/TransactionsTransactionListPage.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 +44 -34
- package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
- package/dist/assethandler/types/index.d.ts +10 -0
- package/dist/assethandler/types/index.d.ts.map +1 -1
- package/dist/assethandler/utils/money.d.ts +34 -0
- package/dist/assethandler/utils/money.d.ts.map +1 -0
- package/dist/assethandler/utils/money.js +27 -0
- package/dist/assethandler/utils/money.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
|
|
2
2
|
import { formatAssetCategory as t } from "../utils/categoryPresentation.js";
|
|
3
|
-
import { useAssetCategoryPresentation as n } from "../providers/AssetHandlerProvider.js";
|
|
4
|
-
import { useAssetHandlerNavigate as
|
|
5
|
-
import { useCopy as
|
|
6
|
-
import { notify as
|
|
7
|
-
import { AttachmentsPanel as
|
|
8
|
-
import { CommentsPanel as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { ChartCard as l } from "../components/ChartCard.js";
|
|
3
|
+
import { useAssetCategoryPresentation as n, useAssetMoney as r } from "../providers/AssetHandlerProvider.js";
|
|
4
|
+
import { useAssetHandlerNavigate as i } from "../hooks/useAssetHandlerNavigate.js";
|
|
5
|
+
import { useCopy as a } from "../hooks/useCopy.js";
|
|
6
|
+
import { notify as o } from "../utils/toast.js";
|
|
7
|
+
import { AttachmentsPanel as ee } from "../components/AttachmentsPanel.js";
|
|
8
|
+
import { CommentsPanel as te } from "../components/CommentsPanel.js";
|
|
9
|
+
import { TrendChart as ne } from "../components/charts/TrendChart.js";
|
|
10
|
+
import { BarsChart as re } from "../components/charts/BarsChart.js";
|
|
11
|
+
import { DonutChart as ie } from "../components/charts/DonutChart.js";
|
|
12
|
+
import { ActivityTimeline as ae } from "../components/ActivityTimeline.js";
|
|
13
|
+
import { NotFoundState as oe } from "../components/NotFoundState.js";
|
|
14
|
+
import { StatTile as s } from "../components/StatTile.js";
|
|
15
|
+
import { ChartCard as c } from "../components/ChartCard.js";
|
|
17
16
|
import "../components/index.js";
|
|
18
|
-
import { useState as
|
|
19
|
-
import { Archive as
|
|
20
|
-
import { useParams as
|
|
21
|
-
import { gql as
|
|
22
|
-
import { useMutation as
|
|
23
|
-
import { Fragment as
|
|
17
|
+
import { useState as l } from "react";
|
|
18
|
+
import { Archive as se, ArrowLeft as ce, Building2 as le, Calendar as ue, DollarSign as u, Hash as de, Layers as fe, MapPin as pe, Pencil as me, ShieldCheck as he, Tag as ge, Trash2 as _e, TrendingDown as ve, Truck as ye, User as be, Wrench as d } from "lucide-react";
|
|
19
|
+
import { useParams as xe } from "react-router";
|
|
20
|
+
import { gql as f } from "@apollo/client";
|
|
21
|
+
import { useMutation as p, useQuery as Se } from "@apollo/client/react";
|
|
22
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
24
23
|
import { Badge as Ce, Button as _, Card as we, CardContent as Te, CardDescription as Ee, CardHeader as De, CardTitle as Oe, EmphasisPanel as ke, GlassCard as Ae, GradientText as je, Input as v, Label as y, PagePurpose as Me, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Tabs as Ne, TabsContent as j, TabsList as Pe, TabsTrigger as M, Textarea as Fe } from "@burdenoff/fe-libs/ui";
|
|
25
24
|
//#region src/assethandler/pages/AssetsAssetDetailPage.tsx
|
|
26
|
-
var Ie =
|
|
25
|
+
var Ie = f`
|
|
27
26
|
query AssetHandlerAsset($id: ID!) {
|
|
28
27
|
asset(id: $id) {
|
|
29
28
|
id
|
|
@@ -57,20 +56,20 @@ var Ie = p`
|
|
|
57
56
|
totalCostOfOwnership
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
`, Le =
|
|
59
|
+
`, Le = f`
|
|
61
60
|
mutation AssetHandlerUpdateAsset($id: ID!, $input: UpdateAssetInput!) {
|
|
62
61
|
updateAsset(id: $id, input: $input) {
|
|
63
62
|
id
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
|
-
`, Re =
|
|
65
|
+
`, Re = f`
|
|
67
66
|
mutation AssetHandlerDisposeAsset($id: ID!, $input: DisposeAssetInput!) {
|
|
68
67
|
disposeAsset(id: $id, input: $input) {
|
|
69
68
|
id
|
|
70
69
|
status
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
|
-
`, ze =
|
|
72
|
+
`, ze = f`
|
|
74
73
|
mutation AssetHandlerDeleteAsset($id: ID!) {
|
|
75
74
|
deleteAsset(id: $id)
|
|
76
75
|
}
|
|
@@ -80,7 +79,7 @@ var Ie = p`
|
|
|
80
79
|
fair: "text-status-warning-text bg-status-warning-bg-subtle",
|
|
81
80
|
poor: "text-status-warning-text bg-status-warning-bg-subtle",
|
|
82
81
|
damaged: "text-status-error-text bg-status-error-bg-subtle"
|
|
83
|
-
}
|
|
82
|
+
};
|
|
84
83
|
function Ve(e) {
|
|
85
84
|
let t = Date.now();
|
|
86
85
|
return e.map((e) => e.scheduledDate).filter((e) => e != null && new Date(e).getTime() >= t).sort((e, t) => new Date(e).getTime() - new Date(t).getTime())[0];
|
|
@@ -156,76 +155,76 @@ function Ge(e) {
|
|
|
156
155
|
};
|
|
157
156
|
}
|
|
158
157
|
function Ke() {
|
|
159
|
-
let
|
|
160
|
-
variables: { id:
|
|
161
|
-
skip: !
|
|
158
|
+
let f = i(), { labels: Ke } = n(), { format: F, compact: I } = r(), { assetId: qe } = xe(), { maintenanceRecords: Je } = e(), L = a(), { data: Ye, loading: Xe, refetch: Ze } = Se(Ie, {
|
|
159
|
+
variables: { id: qe ?? "" },
|
|
160
|
+
skip: !qe,
|
|
162
161
|
fetchPolicy: "cache-and-network"
|
|
163
|
-
}), [
|
|
162
|
+
}), [Qe, R] = l(!1), [$e, z] = l(!1), [et, B] = l(!1), [V, tt] = l(null), [H, U] = l({
|
|
164
163
|
disposalDate: "",
|
|
165
164
|
method: "",
|
|
166
165
|
notes: ""
|
|
167
|
-
}), [
|
|
166
|
+
}), [nt, { loading: W }] = p(Le, {
|
|
168
167
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
169
168
|
onCompleted: () => {
|
|
170
|
-
|
|
169
|
+
o.success("Asset updated", "Your changes have been saved."), R(!1), Ze();
|
|
171
170
|
},
|
|
172
|
-
onError: (e) =>
|
|
173
|
-
}), [
|
|
171
|
+
onError: (e) => o.error("Could not update asset", e.message)
|
|
172
|
+
}), [rt, { loading: G }] = p(Re, {
|
|
174
173
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
175
174
|
onCompleted: () => {
|
|
176
|
-
|
|
175
|
+
o.success("Asset disposed", "The asset has been marked as disposed."), z(!1), Ze();
|
|
177
176
|
},
|
|
178
|
-
onError: (e) =>
|
|
179
|
-
}), [
|
|
177
|
+
onError: (e) => o.error("Could not dispose asset", e.message)
|
|
178
|
+
}), [it, { loading: K }] = p(ze, {
|
|
180
179
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
181
180
|
onCompleted: () => {
|
|
182
|
-
|
|
181
|
+
o.success("Asset deleted", "The asset has been removed from the inventory."), f("/assets/asset-list");
|
|
183
182
|
},
|
|
184
|
-
onError: (e) =>
|
|
183
|
+
onError: (e) => o.error("Could not delete asset", e.message)
|
|
185
184
|
});
|
|
186
|
-
if (
|
|
185
|
+
if (Xe && !Ye) return /* @__PURE__ */ h("div", {
|
|
187
186
|
className: "space-y-3 p-6",
|
|
188
187
|
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ h("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
|
|
189
188
|
});
|
|
190
|
-
let q =
|
|
191
|
-
if (!q) return /* @__PURE__ */ h(
|
|
189
|
+
let q = Ye?.asset;
|
|
190
|
+
if (!q) return /* @__PURE__ */ h(oe, {
|
|
192
191
|
entityLabel: L("assethandler.asset.detail.notFound.entity", "{{asset}}"),
|
|
193
192
|
description: L("assethandler.asset.detail.notFound.description", "This {{assetLower}} may have been disposed or removed. Return to the inventory to find it."),
|
|
194
193
|
backLabel: L("assethandler.asset.detail.notFound.back", "Back to inventory"),
|
|
195
|
-
onBack: () =>
|
|
194
|
+
onBack: () => f("/assets/asset-list")
|
|
196
195
|
});
|
|
197
196
|
let J = {
|
|
198
197
|
...q,
|
|
199
198
|
status: q.status.toLowerCase(),
|
|
200
199
|
condition: q.condition.toLowerCase(),
|
|
201
200
|
category: q.category.toLowerCase()
|
|
202
|
-
}, Y =
|
|
201
|
+
}, Y = Je.filter((e) => e.assetId === J.id), X = Y.filter((e) => e.status !== "completed" && e.status !== "cancelled"), at = Ve(X), ot = J.status === "disposed", Z = We({
|
|
203
202
|
purchaseValue: J.purchaseValue,
|
|
204
203
|
salvageValue: J.salvageValue,
|
|
205
204
|
usefulLifeMonths: J.usefulLifeMonths,
|
|
206
205
|
method: J.depreciationMethod,
|
|
207
206
|
unitsOfProductionCapacity: J.unitsOfProductionCapacity,
|
|
208
207
|
unitsProduced: J.unitsProduced
|
|
209
|
-
}),
|
|
208
|
+
}), st = Z.map((e) => e.bookValue), ct = Y.filter((e) => (e.actualCost ?? e.estimatedCost) != null).map((e) => ({
|
|
210
209
|
label: e.scheduledDate ? new Date(e.scheduledDate).toLocaleDateString(void 0, {
|
|
211
210
|
month: "short",
|
|
212
211
|
year: "2-digit"
|
|
213
212
|
}) : e.title.slice(0, 12),
|
|
214
213
|
cost: e.actualCost ?? e.estimatedCost ?? 0
|
|
215
|
-
})),
|
|
214
|
+
})), lt = Y.reduce((e, t) => e + (t.actualCost ?? t.estimatedCost ?? 0), 0), Q = J.purchaseValue != null && lt > 0 ? [{
|
|
216
215
|
name: "Purchase",
|
|
217
216
|
value: J.purchaseValue,
|
|
218
217
|
color: "var(--color-accent-primary)"
|
|
219
218
|
}, {
|
|
220
219
|
name: "Maintenance",
|
|
221
|
-
value:
|
|
220
|
+
value: lt,
|
|
222
221
|
color: "var(--color-status-info-bg)"
|
|
223
|
-
}] : [],
|
|
224
|
-
|
|
225
|
-
},
|
|
222
|
+
}] : [], ut = () => {
|
|
223
|
+
tt(Ge(q)), R(!0);
|
|
224
|
+
}, dt = (e) => {
|
|
226
225
|
if (e.preventDefault(), !V) return;
|
|
227
226
|
if (!V.name.trim()) {
|
|
228
|
-
|
|
227
|
+
o.warning("Name required", "An asset must have a name.");
|
|
229
228
|
return;
|
|
230
229
|
}
|
|
231
230
|
let t = (e) => {
|
|
@@ -234,7 +233,7 @@ function Ke() {
|
|
|
234
233
|
let n = Number(t);
|
|
235
234
|
return Number.isNaN(n) ? null : n;
|
|
236
235
|
};
|
|
237
|
-
|
|
236
|
+
nt({ variables: {
|
|
238
237
|
id: J.id,
|
|
239
238
|
input: {
|
|
240
239
|
name: V.name.trim(),
|
|
@@ -255,8 +254,8 @@ function Ke() {
|
|
|
255
254
|
unitsProduced: t(V.unitsProduced)
|
|
256
255
|
}
|
|
257
256
|
} });
|
|
258
|
-
},
|
|
259
|
-
e.preventDefault(),
|
|
257
|
+
}, ft = (e) => {
|
|
258
|
+
e.preventDefault(), rt({ variables: {
|
|
260
259
|
id: J.id,
|
|
261
260
|
input: {
|
|
262
261
|
disposalDate: H.disposalDate ? new Date(H.disposalDate).toISOString() : (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -264,7 +263,7 @@ function Ke() {
|
|
|
264
263
|
notes: H.notes.trim() || null
|
|
265
264
|
}
|
|
266
265
|
} });
|
|
267
|
-
}, $ = (e, t) =>
|
|
266
|
+
}, $ = (e, t) => tt((n) => n && {
|
|
268
267
|
...n,
|
|
269
268
|
[e]: t
|
|
270
269
|
});
|
|
@@ -279,8 +278,8 @@ function Ke() {
|
|
|
279
278
|
variant: "ghost",
|
|
280
279
|
size: "icon",
|
|
281
280
|
"aria-label": "Go back",
|
|
282
|
-
onClick: () =>
|
|
283
|
-
children: /* @__PURE__ */ h(
|
|
281
|
+
onClick: () => f("/assets/asset-list"),
|
|
282
|
+
children: /* @__PURE__ */ h(ce, { className: "h-4 w-4" })
|
|
284
283
|
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("div", {
|
|
285
284
|
className: "flex items-center gap-3",
|
|
286
285
|
children: [
|
|
@@ -299,7 +298,7 @@ function Ke() {
|
|
|
299
298
|
]
|
|
300
299
|
}), /* @__PURE__ */ g("p", {
|
|
301
300
|
className: "text-sm text-text-secondary mt-1",
|
|
302
|
-
children: [J.assetNumber, J.serialNumber ? /* @__PURE__ */ g(
|
|
301
|
+
children: [J.assetNumber, J.serialNumber ? /* @__PURE__ */ g(m, { children: [" · SN: ", J.serialNumber] }) : null]
|
|
303
302
|
})] })]
|
|
304
303
|
}), /* @__PURE__ */ g("div", {
|
|
305
304
|
className: "flex items-center gap-2",
|
|
@@ -307,31 +306,31 @@ function Ke() {
|
|
|
307
306
|
/* @__PURE__ */ g(_, {
|
|
308
307
|
size: "sm",
|
|
309
308
|
variant: "outline",
|
|
310
|
-
onClick:
|
|
311
|
-
children: [/* @__PURE__ */ h(
|
|
309
|
+
onClick: ut,
|
|
310
|
+
children: [/* @__PURE__ */ h(me, { className: "mr-2 h-4 w-4" }), "Edit"]
|
|
312
311
|
}),
|
|
313
|
-
|
|
312
|
+
ot ? null : /* @__PURE__ */ g(_, {
|
|
314
313
|
size: "sm",
|
|
315
314
|
variant: "outline",
|
|
316
315
|
onClick: () => z(!0),
|
|
317
|
-
children: [/* @__PURE__ */ h(
|
|
316
|
+
children: [/* @__PURE__ */ h(se, { className: "mr-2 h-4 w-4" }), "Dispose"]
|
|
318
317
|
}),
|
|
319
318
|
/* @__PURE__ */ g(_, {
|
|
320
319
|
size: "sm",
|
|
321
320
|
variant: "outline",
|
|
322
321
|
className: "text-status-error-text",
|
|
323
322
|
onClick: () => B(!0),
|
|
324
|
-
children: [/* @__PURE__ */ h(
|
|
323
|
+
children: [/* @__PURE__ */ h(_e, { className: "mr-2 h-4 w-4" }), "Delete"]
|
|
325
324
|
})
|
|
326
325
|
]
|
|
327
326
|
})]
|
|
328
327
|
}),
|
|
329
328
|
/* @__PURE__ */ h(Me, { children: L("assethandler.asset.detail.purpose", "The complete profile of a single {{assetLower}} — its identity, condition, location, assignment, financials and maintenance history. Use this page as the {{assetLower}}'s home base: edit its details, track its book value, and dispose of it when it reaches end of life.") }),
|
|
330
|
-
|
|
329
|
+
ot ? /* @__PURE__ */ g(ke, { children: [
|
|
331
330
|
/* @__PURE__ */ g("div", {
|
|
332
331
|
className: "flex items-center gap-2 text-sm font-medium",
|
|
333
332
|
children: [
|
|
334
|
-
/* @__PURE__ */ h(
|
|
333
|
+
/* @__PURE__ */ h(se, { className: "h-4 w-4" }),
|
|
335
334
|
"This asset was disposed",
|
|
336
335
|
J.disposalDate ? ` on ${new Date(J.disposalDate).toLocaleDateString()}` : ""
|
|
337
336
|
]
|
|
@@ -348,32 +347,32 @@ function Ke() {
|
|
|
348
347
|
/* @__PURE__ */ g("div", {
|
|
349
348
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
350
349
|
children: [
|
|
351
|
-
/* @__PURE__ */ h(
|
|
350
|
+
/* @__PURE__ */ h(s, {
|
|
352
351
|
hero: !0,
|
|
353
352
|
label: "Current value",
|
|
354
|
-
value:
|
|
355
|
-
delta: J.purchaseValue == null ? void 0 : `of ${
|
|
353
|
+
value: F(J.currentValue),
|
|
354
|
+
delta: J.purchaseValue == null ? void 0 : `of ${F(J.purchaseValue)}`,
|
|
356
355
|
deltaDirection: "neutral",
|
|
357
|
-
spark:
|
|
358
|
-
icon:
|
|
356
|
+
spark: st.length > 1 ? st : void 0,
|
|
357
|
+
icon: u
|
|
359
358
|
}),
|
|
360
|
-
/* @__PURE__ */ h(
|
|
359
|
+
/* @__PURE__ */ h(s, {
|
|
361
360
|
label: "Maintenance records",
|
|
362
361
|
value: Y.length,
|
|
363
362
|
delta: X.length > 0 ? `${X.length} open` : void 0,
|
|
364
363
|
deltaTone: "neutral",
|
|
365
364
|
deltaDirection: "neutral",
|
|
366
|
-
icon:
|
|
365
|
+
icon: d
|
|
367
366
|
}),
|
|
368
|
-
/* @__PURE__ */ h(
|
|
367
|
+
/* @__PURE__ */ h(s, {
|
|
369
368
|
label: "Registered",
|
|
370
369
|
value: J.createdAt ? new Date(J.createdAt).toLocaleDateString() : "—",
|
|
371
|
-
icon:
|
|
370
|
+
icon: ue
|
|
372
371
|
}),
|
|
373
|
-
/* @__PURE__ */ h(
|
|
372
|
+
/* @__PURE__ */ h(s, {
|
|
374
373
|
label: "Location",
|
|
375
374
|
value: J.locationName || "—",
|
|
376
|
-
icon:
|
|
375
|
+
icon: pe
|
|
377
376
|
})
|
|
378
377
|
]
|
|
379
378
|
}),
|
|
@@ -409,7 +408,7 @@ function Ke() {
|
|
|
409
408
|
value: "details",
|
|
410
409
|
className: "mt-4 space-y-4",
|
|
411
410
|
children: [
|
|
412
|
-
J.description ? /* @__PURE__ */ h(
|
|
411
|
+
J.description ? /* @__PURE__ */ h(N, {
|
|
413
412
|
label: "Description",
|
|
414
413
|
value: J.description,
|
|
415
414
|
full: !0
|
|
@@ -417,65 +416,65 @@ function Ke() {
|
|
|
417
416
|
/* @__PURE__ */ g("div", {
|
|
418
417
|
className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
|
|
419
418
|
children: [
|
|
420
|
-
/* @__PURE__ */ h(
|
|
419
|
+
/* @__PURE__ */ h(N, {
|
|
421
420
|
label: L("assethandler.asset.detail.field.tag", "{{asset}} Tag"),
|
|
422
421
|
value: J.assetNumber,
|
|
423
|
-
icon:
|
|
422
|
+
icon: de,
|
|
424
423
|
mono: !0
|
|
425
424
|
}),
|
|
426
|
-
/* @__PURE__ */ h(
|
|
425
|
+
/* @__PURE__ */ h(N, {
|
|
427
426
|
label: "Serial Number",
|
|
428
427
|
value: J.serialNumber || "—",
|
|
429
|
-
icon:
|
|
428
|
+
icon: de,
|
|
430
429
|
mono: !0
|
|
431
430
|
}),
|
|
432
|
-
/* @__PURE__ */ h(
|
|
431
|
+
/* @__PURE__ */ h(N, {
|
|
433
432
|
label: "Category",
|
|
434
433
|
value: t(J.category, Ke),
|
|
435
|
-
icon:
|
|
434
|
+
icon: fe,
|
|
436
435
|
capitalize: !0
|
|
437
436
|
}),
|
|
438
|
-
/* @__PURE__ */ h(
|
|
437
|
+
/* @__PURE__ */ h(N, {
|
|
439
438
|
label: "Condition",
|
|
440
|
-
icon:
|
|
439
|
+
icon: he,
|
|
441
440
|
children: /* @__PURE__ */ h("span", {
|
|
442
441
|
className: `inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Be[J.condition] ?? ""}`,
|
|
443
442
|
children: J.condition
|
|
444
443
|
})
|
|
445
444
|
}),
|
|
446
|
-
/* @__PURE__ */ h(
|
|
445
|
+
/* @__PURE__ */ h(N, {
|
|
447
446
|
label: "Assigned To",
|
|
448
447
|
value: J.assignedTo || "—",
|
|
449
|
-
icon:
|
|
448
|
+
icon: be
|
|
450
449
|
}),
|
|
451
|
-
/* @__PURE__ */ h(
|
|
450
|
+
/* @__PURE__ */ h(N, {
|
|
452
451
|
label: L("assethandler.asset.detail.nextService", "Next Service"),
|
|
453
|
-
value:
|
|
454
|
-
icon:
|
|
452
|
+
value: at ? new Date(at).toLocaleDateString() : "—",
|
|
453
|
+
icon: d
|
|
455
454
|
}),
|
|
456
|
-
/* @__PURE__ */ h(
|
|
455
|
+
/* @__PURE__ */ h(N, {
|
|
457
456
|
label: "Department",
|
|
458
457
|
value: J.department || "—",
|
|
459
|
-
icon:
|
|
458
|
+
icon: le
|
|
460
459
|
}),
|
|
461
|
-
/* @__PURE__ */ h(
|
|
460
|
+
/* @__PURE__ */ h(N, {
|
|
462
461
|
label: "Location",
|
|
463
462
|
value: J.locationName || "—",
|
|
464
|
-
icon:
|
|
463
|
+
icon: pe
|
|
465
464
|
}),
|
|
466
|
-
/* @__PURE__ */ h(
|
|
465
|
+
/* @__PURE__ */ h(N, {
|
|
467
466
|
label: "Supplier",
|
|
468
467
|
value: J.supplier || "—",
|
|
469
|
-
icon:
|
|
468
|
+
icon: ye
|
|
470
469
|
}),
|
|
471
|
-
/* @__PURE__ */ h(
|
|
470
|
+
/* @__PURE__ */ h(N, {
|
|
472
471
|
label: "Warranty Expiry",
|
|
473
472
|
value: J.warrantyExpiry ? new Date(J.warrantyExpiry).toLocaleDateString() : "—",
|
|
474
|
-
icon:
|
|
473
|
+
icon: ue
|
|
475
474
|
})
|
|
476
475
|
]
|
|
477
476
|
}),
|
|
478
|
-
/* @__PURE__ */ h(
|
|
477
|
+
/* @__PURE__ */ h(ee, {
|
|
479
478
|
entityType: "assethandler-asset",
|
|
480
479
|
entityId: J.id
|
|
481
480
|
})
|
|
@@ -488,36 +487,36 @@ function Ke() {
|
|
|
488
487
|
/* @__PURE__ */ g("div", {
|
|
489
488
|
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
490
489
|
children: [
|
|
491
|
-
/* @__PURE__ */ h(
|
|
490
|
+
/* @__PURE__ */ h(s, {
|
|
492
491
|
label: "Purchase Value",
|
|
493
|
-
value:
|
|
492
|
+
value: F(J.purchaseValue)
|
|
494
493
|
}),
|
|
495
|
-
/* @__PURE__ */ h(
|
|
494
|
+
/* @__PURE__ */ h(s, {
|
|
496
495
|
hero: !0,
|
|
497
496
|
label: "Current Book Value",
|
|
498
|
-
value:
|
|
497
|
+
value: F(J.currentValue)
|
|
499
498
|
}),
|
|
500
|
-
/* @__PURE__ */ h(
|
|
499
|
+
/* @__PURE__ */ h(s, {
|
|
501
500
|
label: "Accum. Depreciation",
|
|
502
|
-
value:
|
|
501
|
+
value: F(J.accumulatedDepreciation)
|
|
503
502
|
}),
|
|
504
|
-
/* @__PURE__ */ h(
|
|
503
|
+
/* @__PURE__ */ h(s, {
|
|
505
504
|
label: "Total Cost of Ownership",
|
|
506
|
-
value:
|
|
505
|
+
value: F(J.totalCostOfOwnership)
|
|
507
506
|
})
|
|
508
507
|
]
|
|
509
508
|
}),
|
|
510
509
|
/* @__PURE__ */ g("div", {
|
|
511
510
|
className: "grid gap-4 lg:grid-cols-2",
|
|
512
|
-
children: [/* @__PURE__ */ h(
|
|
511
|
+
children: [/* @__PURE__ */ h(c, {
|
|
513
512
|
title: "Depreciation & book value",
|
|
514
513
|
subtitle: "Projected book value over the useful life",
|
|
515
|
-
icon:
|
|
516
|
-
children: Z.length > 0 ? /* @__PURE__ */ h(
|
|
514
|
+
icon: ve,
|
|
515
|
+
children: Z.length > 0 ? /* @__PURE__ */ h(ne, {
|
|
517
516
|
data: Z,
|
|
518
517
|
xKey: "year",
|
|
519
518
|
height: 260,
|
|
520
|
-
valueFormat:
|
|
519
|
+
valueFormat: I,
|
|
521
520
|
xTickFormat: (e) => `${e}y`,
|
|
522
521
|
series: [{
|
|
523
522
|
key: "bookValue",
|
|
@@ -527,36 +526,36 @@ function Ke() {
|
|
|
527
526
|
className: "py-12 text-center text-sm text-text-secondary",
|
|
528
527
|
children: "Add purchase value, useful life and salvage value to see the depreciation schedule."
|
|
529
528
|
})
|
|
530
|
-
}), /* @__PURE__ */ h(
|
|
529
|
+
}), /* @__PURE__ */ h(c, {
|
|
531
530
|
title: "Key facts",
|
|
532
531
|
subtitle: "Purchase & depreciation terms",
|
|
533
532
|
children: /* @__PURE__ */ g("dl", {
|
|
534
533
|
className: "overflow-hidden rounded-lg border border-border-seam text-sm",
|
|
535
534
|
children: [
|
|
536
|
-
/* @__PURE__ */ h(
|
|
535
|
+
/* @__PURE__ */ h(P, {
|
|
537
536
|
label: "Purchase Date",
|
|
538
537
|
value: J.purchaseDate ? new Date(J.purchaseDate).toLocaleDateString() : "—",
|
|
539
538
|
striped: !0
|
|
540
539
|
}),
|
|
541
|
-
/* @__PURE__ */ h(
|
|
540
|
+
/* @__PURE__ */ h(P, {
|
|
542
541
|
label: "Useful Life",
|
|
543
542
|
value: J.usefulLifeMonths ? `${J.usefulLifeMonths} months` : "—"
|
|
544
543
|
}),
|
|
545
|
-
/* @__PURE__ */ h(
|
|
544
|
+
/* @__PURE__ */ h(P, {
|
|
546
545
|
label: "Salvage Value",
|
|
547
|
-
value:
|
|
546
|
+
value: F(J.salvageValue),
|
|
548
547
|
striped: !0
|
|
549
548
|
}),
|
|
550
|
-
/* @__PURE__ */ h(
|
|
549
|
+
/* @__PURE__ */ h(P, {
|
|
551
550
|
label: "Depreciation Method",
|
|
552
551
|
value: J.depreciationMethod ? He[J.depreciationMethod.toUpperCase()] ?? J.depreciationMethod : "—"
|
|
553
552
|
}),
|
|
554
|
-
/* @__PURE__ */ h(
|
|
553
|
+
/* @__PURE__ */ h(P, {
|
|
555
554
|
label: "Supplier",
|
|
556
555
|
value: J.supplier || "—",
|
|
557
556
|
striped: !0
|
|
558
557
|
}),
|
|
559
|
-
/* @__PURE__ */ h(
|
|
558
|
+
/* @__PURE__ */ h(P, {
|
|
560
559
|
label: "Warranty Expiry",
|
|
561
560
|
value: J.warrantyExpiry ? new Date(J.warrantyExpiry).toLocaleDateString() : "—"
|
|
562
561
|
})
|
|
@@ -564,15 +563,15 @@ function Ke() {
|
|
|
564
563
|
})
|
|
565
564
|
})]
|
|
566
565
|
}),
|
|
567
|
-
Q.length > 0 ? /* @__PURE__ */ h(
|
|
566
|
+
Q.length > 0 ? /* @__PURE__ */ h(c, {
|
|
568
567
|
title: "Total cost of ownership",
|
|
569
568
|
subtitle: "What drives lifetime cost",
|
|
570
|
-
icon:
|
|
571
|
-
children: /* @__PURE__ */ h(
|
|
569
|
+
icon: u,
|
|
570
|
+
children: /* @__PURE__ */ h(ie, {
|
|
572
571
|
data: Q,
|
|
573
572
|
centerLabel: "TCO",
|
|
574
573
|
centerValue: Q.reduce((e, t) => e + t.value, 0),
|
|
575
|
-
valueFormat:
|
|
574
|
+
valueFormat: I,
|
|
576
575
|
height: 220
|
|
577
576
|
})
|
|
578
577
|
}) : null
|
|
@@ -581,15 +580,15 @@ function Ke() {
|
|
|
581
580
|
/* @__PURE__ */ g(j, {
|
|
582
581
|
value: "maintenance",
|
|
583
582
|
className: "mt-4 space-y-4",
|
|
584
|
-
children: [
|
|
583
|
+
children: [ct.length > 0 ? /* @__PURE__ */ h(c, {
|
|
585
584
|
title: "Maintenance cost history",
|
|
586
585
|
subtitle: "Recorded cost per maintenance event",
|
|
587
|
-
icon:
|
|
588
|
-
children: /* @__PURE__ */ h(
|
|
589
|
-
data:
|
|
586
|
+
icon: d,
|
|
587
|
+
children: /* @__PURE__ */ h(re, {
|
|
588
|
+
data: ct,
|
|
590
589
|
xKey: "label",
|
|
591
590
|
height: 220,
|
|
592
|
-
valueFormat:
|
|
591
|
+
valueFormat: I,
|
|
593
592
|
series: [{
|
|
594
593
|
key: "cost",
|
|
595
594
|
label: "Cost"
|
|
@@ -597,7 +596,7 @@ function Ke() {
|
|
|
597
596
|
})
|
|
598
597
|
}) : null, /* @__PURE__ */ g(we, { children: [/* @__PURE__ */ g(De, { children: [/* @__PURE__ */ g(Oe, {
|
|
599
598
|
className: "flex items-center gap-2",
|
|
600
|
-
children: [/* @__PURE__ */ h(
|
|
599
|
+
children: [/* @__PURE__ */ h(d, { className: "h-4 w-4" }), "Maintenance History"]
|
|
601
600
|
}), /* @__PURE__ */ g(Ee, { children: [Y.length, " records found"] })] }), /* @__PURE__ */ h(Te, { children: Y.length === 0 ? /* @__PURE__ */ h("p", {
|
|
602
601
|
className: "py-8 text-center text-text-secondary",
|
|
603
602
|
children: "No maintenance records for this asset."
|
|
@@ -633,7 +632,7 @@ function Ke() {
|
|
|
633
632
|
"Scheduled:",
|
|
634
633
|
" ",
|
|
635
634
|
e.scheduledDate ? new Date(e.scheduledDate).toLocaleDateString() : "—"
|
|
636
|
-
] }), e.actualCost != null || e.estimatedCost != null ? /* @__PURE__ */ g("span", { children: ["Cost: ",
|
|
635
|
+
] }), e.actualCost != null || e.estimatedCost != null ? /* @__PURE__ */ g("span", { children: ["Cost: ", F(e.actualCost ?? e.estimatedCost)] }) : null]
|
|
637
636
|
})
|
|
638
637
|
]
|
|
639
638
|
})
|
|
@@ -643,7 +642,7 @@ function Ke() {
|
|
|
643
642
|
/* @__PURE__ */ h(j, {
|
|
644
643
|
value: "discussion",
|
|
645
644
|
className: "mt-4",
|
|
646
|
-
children: /* @__PURE__ */ h(
|
|
645
|
+
children: /* @__PURE__ */ h(te, {
|
|
647
646
|
entityType: "assethandler-asset",
|
|
648
647
|
entityId: J.id
|
|
649
648
|
})
|
|
@@ -659,7 +658,7 @@ function Ke() {
|
|
|
659
658
|
className: "space-y-3 p-5",
|
|
660
659
|
children: [/* @__PURE__ */ g("h3", {
|
|
661
660
|
className: "flex items-center gap-2 text-sm font-semibold",
|
|
662
|
-
children: [/* @__PURE__ */ h(
|
|
661
|
+
children: [/* @__PURE__ */ h(ge, { className: "h-4 w-4 text-text-secondary" }), "Tags"]
|
|
663
662
|
}), J.tags.length === 0 ? /* @__PURE__ */ h("p", {
|
|
664
663
|
className: "text-xs text-text-secondary",
|
|
665
664
|
children: "No tags yet"
|
|
@@ -671,17 +670,17 @@ function Ke() {
|
|
|
671
670
|
}, e))
|
|
672
671
|
})]
|
|
673
672
|
})
|
|
674
|
-
}), /* @__PURE__ */ h(
|
|
673
|
+
}), /* @__PURE__ */ h(ae, { resourceId: J.id })]
|
|
675
674
|
})]
|
|
676
675
|
}),
|
|
677
676
|
/* @__PURE__ */ h(b, {
|
|
678
|
-
open:
|
|
677
|
+
open: Qe,
|
|
679
678
|
onOpenChange: R,
|
|
680
679
|
children: /* @__PURE__ */ g(x, {
|
|
681
680
|
className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
|
|
682
681
|
children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Edit asset" }), /* @__PURE__ */ h(S, { children: "Update this asset's details and financials." })] }), V ? /* @__PURE__ */ g("form", {
|
|
683
682
|
className: "space-y-4",
|
|
684
|
-
onSubmit:
|
|
683
|
+
onSubmit: dt,
|
|
685
684
|
children: [
|
|
686
685
|
/* @__PURE__ */ g("div", {
|
|
687
686
|
className: "grid gap-4 md:grid-cols-2",
|
|
@@ -872,7 +871,7 @@ function Ke() {
|
|
|
872
871
|
] })]
|
|
873
872
|
})]
|
|
874
873
|
}),
|
|
875
|
-
V.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ g(
|
|
874
|
+
V.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
|
|
876
875
|
className: "space-y-2",
|
|
877
876
|
children: [/* @__PURE__ */ h(y, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ h(v, {
|
|
878
877
|
type: "number",
|
|
@@ -909,11 +908,11 @@ function Ke() {
|
|
|
909
908
|
})
|
|
910
909
|
}),
|
|
911
910
|
/* @__PURE__ */ h(b, {
|
|
912
|
-
open:
|
|
911
|
+
open: $e,
|
|
913
912
|
onOpenChange: z,
|
|
914
913
|
children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Dispose asset" }), /* @__PURE__ */ h(S, { children: "Record the disposal of this asset. It will be marked as disposed and removed from active inventory." })] }), /* @__PURE__ */ g("form", {
|
|
915
914
|
className: "space-y-4",
|
|
916
|
-
onSubmit:
|
|
915
|
+
onSubmit: ft,
|
|
917
916
|
children: [
|
|
918
917
|
/* @__PURE__ */ g("div", {
|
|
919
918
|
className: "space-y-2",
|
|
@@ -964,7 +963,7 @@ function Ke() {
|
|
|
964
963
|
})] })
|
|
965
964
|
}),
|
|
966
965
|
/* @__PURE__ */ h(b, {
|
|
967
|
-
open:
|
|
966
|
+
open: et,
|
|
968
967
|
onOpenChange: B,
|
|
969
968
|
children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Delete asset" }), /* @__PURE__ */ g(S, { children: [
|
|
970
969
|
"This removes ",
|
|
@@ -980,7 +979,7 @@ function Ke() {
|
|
|
980
979
|
children: "Cancel"
|
|
981
980
|
}), /* @__PURE__ */ h(_, {
|
|
982
981
|
variant: "destructive",
|
|
983
|
-
onClick: () => void
|
|
982
|
+
onClick: () => void it({ variables: { id: J.id } }),
|
|
984
983
|
disabled: K,
|
|
985
984
|
children: K ? "Deleting…" : "Delete asset"
|
|
986
985
|
})] })] })
|
|
@@ -988,7 +987,7 @@ function Ke() {
|
|
|
988
987
|
]
|
|
989
988
|
});
|
|
990
989
|
}
|
|
991
|
-
function
|
|
990
|
+
function N({ label: e, value: t, icon: n, mono: r, capitalize: i, full: a, children: o }) {
|
|
992
991
|
return /* @__PURE__ */ g("div", {
|
|
993
992
|
className: `rounded-lg border border-border-seam bg-bg-surface p-3.5 ${a ? "sm:col-span-2 xl:col-span-3" : ""}`,
|
|
994
993
|
children: [/* @__PURE__ */ g("p", {
|
|
@@ -1003,7 +1002,7 @@ function P({ label: e, value: t, icon: n, mono: r, capitalize: i, full: a, child
|
|
|
1003
1002
|
})]
|
|
1004
1003
|
});
|
|
1005
1004
|
}
|
|
1006
|
-
function
|
|
1005
|
+
function P({ label: e, value: t, striped: n }) {
|
|
1007
1006
|
return /* @__PURE__ */ g("div", {
|
|
1008
1007
|
className: `flex items-center justify-between gap-4 px-3.5 py-2.5 ${n ? "bg-bg-sunken/40" : ""}`,
|
|
1009
1008
|
children: [/* @__PURE__ */ h("dt", {
|