@burdenoff/microfe-assethandler 2026.714.2 → 2026.719.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/AssetHandlerRoutes.d.ts.map +1 -1
- package/dist/assethandler/AssetHandlerRoutes.js +9 -17
- package/dist/assethandler/AssetHandlerRoutes.js.map +1 -1
- package/dist/assethandler/ops/NewWorkOrderDialog.d.ts.map +1 -1
- package/dist/assethandler/ops/NewWorkOrderDialog.js +110 -74
- package/dist/assethandler/ops/NewWorkOrderDialog.js.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
- package/dist/assethandler/pages/AssetsAssetCreatePage.js +189 -126
- 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 +312 -251
- package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
- package/dist/assethandler/pages/OperationsWorkOrderDetailPage.d.ts.map +1 -1
- package/dist/assethandler/pages/OperationsWorkOrderDetailPage.js +286 -222
- package/dist/assethandler/pages/OperationsWorkOrderDetailPage.js.map +1 -1
- package/dist/stories/ListEmptyState.stories.d.ts +10 -0
- package/dist/stories/ListEmptyState.stories.d.ts.map +1 -0
- package/dist/stories/SectionHeader.stories.d.ts +10 -0
- package/dist/stories/SectionHeader.stories.d.ts.map +1 -0
- package/dist/stories/StatTile.stories.d.ts +10 -0
- package/dist/stories/StatTile.stories.d.ts.map +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +26 -18
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +16 -3
- package/dist/assethandler/pages/EsgDashboardPage.js +0 -423
- package/dist/assethandler/pages/EsgDashboardPage.js.map +0 -1
- package/dist/assethandler/pages/KnowledgeBasePage.js +0 -521
- package/dist/assethandler/pages/KnowledgeBasePage.js.map +0 -1
|
@@ -6,14 +6,14 @@ import { formatCurrencyCompact as i } from "../components/charts/chartTheme.js";
|
|
|
6
6
|
import { TrendChart as a } from "../components/charts/TrendChart.js";
|
|
7
7
|
import { ChartCard as o } from "../components/ChartCard.js";
|
|
8
8
|
import "../components/index.js";
|
|
9
|
-
import { useMemo as s, useRef as
|
|
10
|
-
import { ArrowLeft as
|
|
11
|
-
import { gql as
|
|
12
|
-
import { useMutation as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { Badge as
|
|
9
|
+
import { useMemo as s, useRef as ee, useState as c } from "react";
|
|
10
|
+
import { ArrowLeft as l, Info as u, Loader2 as d, Save as f, TrendingDown as p, X as m } from "lucide-react";
|
|
11
|
+
import { gql as h } from "@apollo/client";
|
|
12
|
+
import { useMutation as te } from "@apollo/client/react";
|
|
13
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
14
|
+
import { Badge as v, Button as y, GlassCard as b, GradientText as x, Input as S, Label as C, PagePurpose as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
|
|
15
15
|
//#region src/assethandler/pages/AssetsAssetCreatePage.tsx
|
|
16
|
-
var
|
|
16
|
+
var j = h`
|
|
17
17
|
mutation AssetHandlerCreateAsset($input: CreateAssetInput!) {
|
|
18
18
|
createAsset(input: $input) {
|
|
19
19
|
id
|
|
@@ -21,7 +21,7 @@ var M = g`
|
|
|
21
21
|
name
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
`,
|
|
24
|
+
`, M = [
|
|
25
25
|
"electronics",
|
|
26
26
|
"it_hardware",
|
|
27
27
|
"furniture",
|
|
@@ -45,6 +45,8 @@ var M = g`
|
|
|
45
45
|
usefulLifeMonths: "",
|
|
46
46
|
salvageValue: "",
|
|
47
47
|
depreciationMethod: "STRAIGHT_LINE",
|
|
48
|
+
unitsOfProductionCapacity: "",
|
|
49
|
+
unitsProduced: "",
|
|
48
50
|
warrantyExpiry: "",
|
|
49
51
|
supplier: "",
|
|
50
52
|
department: ""
|
|
@@ -52,12 +54,31 @@ var M = g`
|
|
|
52
54
|
function P(e) {
|
|
53
55
|
let t = e.purchaseValue, n = e.usefulLifeMonths;
|
|
54
56
|
if (!t || t <= 0 || !n || n <= 0) return [];
|
|
55
|
-
let r = Math.max(0, Math.min(e.salvageValue ?? 0, t)), i = e.method.toLowerCase(), a = Math.max(1, Math.round(n / 12))
|
|
57
|
+
let r = Math.max(0, Math.min(e.salvageValue ?? 0, t)), i = e.method.toLowerCase(), a = Math.max(1, Math.round(n / 12));
|
|
58
|
+
if (i === "units_of_production") {
|
|
59
|
+
let n = e.unitsOfProductionCapacity, i = Math.max(0, e.unitsProduced ?? 0);
|
|
60
|
+
if (!n || n <= 0) return [];
|
|
61
|
+
let o = Math.max(t - (t - r) * (Math.min(i, n) / n), r);
|
|
62
|
+
return [{
|
|
63
|
+
year: 0,
|
|
64
|
+
bookValue: Math.round(t)
|
|
65
|
+
}, {
|
|
66
|
+
year: a,
|
|
67
|
+
bookValue: Math.round(o)
|
|
68
|
+
}];
|
|
69
|
+
}
|
|
70
|
+
let o = [];
|
|
56
71
|
for (let e = 0; e <= a; e += 1) {
|
|
57
72
|
let n;
|
|
58
73
|
if (i === "reducing_balance") {
|
|
59
74
|
let i = r > 0 ? 1 - (r / t) ** (1 / a) : Math.min(.9, 2 / a);
|
|
60
75
|
n = Math.max(t * (1 - i) ** e, r);
|
|
76
|
+
} else if (i === "declining_balance") {
|
|
77
|
+
let i = r > 0 ? 1 - (r / t) ** (1 / a) : Math.min(.75, 1.5 / a);
|
|
78
|
+
n = Math.max(t * (1 - i) ** e, r);
|
|
79
|
+
} else if (i === "sum_of_years_digits") {
|
|
80
|
+
let i = a * (a + 1) / 2, o = i > 0 ? (t - r) * ((e * a - e * (e - 1) / 2) / i) : 0;
|
|
81
|
+
n = Math.max(t - o, r);
|
|
61
82
|
} else n = i === "none" ? t : Math.max(t - (t - r) * (e / a), r);
|
|
62
83
|
o.push({
|
|
63
84
|
year: e,
|
|
@@ -66,33 +87,33 @@ function P(e) {
|
|
|
66
87
|
}
|
|
67
88
|
return o;
|
|
68
89
|
}
|
|
69
|
-
var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */
|
|
90
|
+
var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ g(b, {
|
|
70
91
|
treatment: "glass",
|
|
71
92
|
glow: r,
|
|
72
93
|
className: "border-border-seam",
|
|
73
|
-
children: /* @__PURE__ */
|
|
94
|
+
children: /* @__PURE__ */ _("div", {
|
|
74
95
|
className: "space-y-4 p-5 sm:p-6",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
|
|
76
97
|
className: "text-lg font-semibold",
|
|
77
98
|
children: e
|
|
78
|
-
}), t ? /* @__PURE__ */
|
|
99
|
+
}), t ? /* @__PURE__ */ g("p", {
|
|
79
100
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
80
101
|
children: t
|
|
81
102
|
}) : null] }), n]
|
|
82
103
|
})
|
|
83
104
|
});
|
|
84
105
|
function I() {
|
|
85
|
-
let
|
|
86
|
-
let e = new Set(
|
|
106
|
+
let h = n(), b = t(), { assets: I } = e(), [L, R] = c(N), [z, B] = c([]), [V, H] = c(""), [U, W] = c({}), [G, K] = c(null), q = ee(!1), J = s(() => {
|
|
107
|
+
let e = new Set(M);
|
|
87
108
|
for (let t of I) t.category && e.add(t.category);
|
|
88
|
-
return [...e].filter((e) => !
|
|
89
|
-
}, [I,
|
|
109
|
+
return [...e].filter((e) => !b.has(e)).sort();
|
|
110
|
+
}, [I, b]), [ne, { loading: Y }] = te(j, {
|
|
90
111
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
91
112
|
onCompleted: (e) => {
|
|
92
113
|
r.success("Asset created", `${e.createAsset.name} was registered in the inventory.`), K(null), q.current ? (q.current = !1, R(N), B([]), H(""), W({}), typeof window < "u" && window.scrollTo({
|
|
93
114
|
top: 0,
|
|
94
115
|
behavior: "smooth"
|
|
95
|
-
})) :
|
|
116
|
+
})) : h(`/assets/${e.createAsset.id}`);
|
|
96
117
|
},
|
|
97
118
|
onError: (e) => {
|
|
98
119
|
K(null), r.error("Could not create asset", e.message);
|
|
@@ -115,12 +136,16 @@ function I() {
|
|
|
115
136
|
purchaseValue: L.purchaseValue.trim() ? Number(L.purchaseValue) : null,
|
|
116
137
|
salvageValue: L.salvageValue.trim() ? Number(L.salvageValue) : null,
|
|
117
138
|
usefulLifeMonths: L.usefulLifeMonths.trim() ? Number(L.usefulLifeMonths) : null,
|
|
118
|
-
method: L.depreciationMethod
|
|
139
|
+
method: L.depreciationMethod,
|
|
140
|
+
unitsOfProductionCapacity: L.unitsOfProductionCapacity.trim() ? Number(L.unitsOfProductionCapacity) : null,
|
|
141
|
+
unitsProduced: L.unitsProduced.trim() ? Number(L.unitsProduced) : null
|
|
119
142
|
}), [
|
|
120
143
|
L.purchaseValue,
|
|
121
144
|
L.salvageValue,
|
|
122
145
|
L.usefulLifeMonths,
|
|
123
|
-
L.depreciationMethod
|
|
146
|
+
L.depreciationMethod,
|
|
147
|
+
L.unitsOfProductionCapacity,
|
|
148
|
+
L.unitsProduced
|
|
124
149
|
]), $ = (e) => {
|
|
125
150
|
let t = {};
|
|
126
151
|
L.name.trim() || (t.name = "Asset name is required"), L.assetNumber.trim() || (t.assetNumber = "Asset tag is required"), L.category.trim() || (t.category = "Category is required");
|
|
@@ -155,32 +180,34 @@ function I() {
|
|
|
155
180
|
usefulLifeMonths: i(L.usefulLifeMonths),
|
|
156
181
|
salvageValue: i(L.salvageValue),
|
|
157
182
|
depreciationMethod: L.depreciationMethod,
|
|
183
|
+
unitsOfProductionCapacity: i(L.unitsOfProductionCapacity),
|
|
184
|
+
unitsProduced: i(L.unitsProduced),
|
|
158
185
|
warrantyExpiry: a(L.warrantyExpiry),
|
|
159
186
|
supplier: L.supplier.trim() || null,
|
|
160
187
|
department: L.department.trim() || null
|
|
161
188
|
} } });
|
|
162
189
|
};
|
|
163
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ _("div", {
|
|
164
191
|
className: "mx-auto max-w-4xl space-y-6 p-4 pb-28 sm:p-6 sm:pb-28",
|
|
165
192
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ _("div", {
|
|
167
194
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ g(y, {
|
|
169
196
|
variant: "ghost",
|
|
170
197
|
size: "icon",
|
|
171
198
|
"aria-label": "Go back",
|
|
172
199
|
className: "w-fit",
|
|
173
|
-
onClick: () =>
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
-
}), /* @__PURE__ */
|
|
200
|
+
onClick: () => h("/assets/asset-list"),
|
|
201
|
+
children: /* @__PURE__ */ g(l, { className: "h-4 w-4" })
|
|
202
|
+
}), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
|
|
176
203
|
className: "text-2xl font-bold",
|
|
177
|
-
children: /* @__PURE__ */
|
|
178
|
-
}), /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ g(x, { children: "Create New Asset" })
|
|
205
|
+
}), /* @__PURE__ */ _("p", {
|
|
179
206
|
className: "text-sm text-text-secondary",
|
|
180
207
|
children: [
|
|
181
208
|
"Register a new asset in the inventory ·",
|
|
182
209
|
" ",
|
|
183
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ g("span", {
|
|
184
211
|
className: "text-status-error-text",
|
|
185
212
|
children: "*"
|
|
186
213
|
}),
|
|
@@ -188,127 +215,127 @@ function I() {
|
|
|
188
215
|
]
|
|
189
216
|
})] })]
|
|
190
217
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ g(w, { children: "Register a new asset so it can be tracked, maintained and assigned from day one. Capture its identity, category and condition, then its financials and location — the more you fill in now, the better your reports and audits later." }),
|
|
219
|
+
/* @__PURE__ */ _(F, {
|
|
193
220
|
title: "General Information",
|
|
194
221
|
description: "Basic asset details and identification",
|
|
195
222
|
glow: !0,
|
|
196
223
|
children: [
|
|
197
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ _("div", {
|
|
198
225
|
className: "grid gap-4 md:grid-cols-2",
|
|
199
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ _("div", {
|
|
200
227
|
className: "space-y-2",
|
|
201
228
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ _(C, { children: ["Asset Name ", /* @__PURE__ */ g("span", {
|
|
203
230
|
className: "text-status-error-text",
|
|
204
231
|
children: "*"
|
|
205
232
|
})] }),
|
|
206
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ g(S, {
|
|
207
234
|
placeholder: "e.g., Dell OptiPlex 7090",
|
|
208
235
|
value: L.name,
|
|
209
236
|
onChange: (e) => X("name", e.target.value),
|
|
210
237
|
"aria-invalid": !!U.name
|
|
211
238
|
}),
|
|
212
|
-
U.name ? /* @__PURE__ */
|
|
239
|
+
U.name ? /* @__PURE__ */ g("p", {
|
|
213
240
|
className: "text-xs text-status-error-text",
|
|
214
241
|
children: U.name
|
|
215
242
|
}) : null
|
|
216
243
|
]
|
|
217
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ _("div", {
|
|
218
245
|
className: "space-y-2",
|
|
219
246
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ _(C, { children: ["Asset Tag ", /* @__PURE__ */ g("span", {
|
|
221
248
|
className: "text-status-error-text",
|
|
222
249
|
children: "*"
|
|
223
250
|
})] }),
|
|
224
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ g(S, {
|
|
225
252
|
placeholder: "e.g., IT-HW-001",
|
|
226
253
|
value: L.assetNumber,
|
|
227
254
|
onChange: (e) => X("assetNumber", e.target.value),
|
|
228
255
|
"aria-invalid": !!U.assetNumber
|
|
229
256
|
}),
|
|
230
|
-
U.assetNumber ? /* @__PURE__ */
|
|
257
|
+
U.assetNumber ? /* @__PURE__ */ g("p", {
|
|
231
258
|
className: "text-xs text-status-error-text",
|
|
232
259
|
children: U.assetNumber
|
|
233
260
|
}) : null
|
|
234
261
|
]
|
|
235
262
|
})]
|
|
236
263
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ _("div", {
|
|
238
265
|
className: "space-y-2",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
266
|
+
children: [/* @__PURE__ */ g(C, { children: "Description" }), /* @__PURE__ */ g(A, {
|
|
240
267
|
placeholder: "Brief description of the asset...",
|
|
241
268
|
value: L.description,
|
|
242
269
|
onChange: (e) => X("description", e.target.value),
|
|
243
270
|
rows: 3
|
|
244
271
|
})]
|
|
245
272
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ _("div", {
|
|
247
274
|
className: "grid gap-4 md:grid-cols-3",
|
|
248
275
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ _("div", {
|
|
250
277
|
className: "space-y-2",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ _(C, { children: ["Category ", /* @__PURE__ */ g("span", {
|
|
252
279
|
className: "text-status-error-text",
|
|
253
280
|
children: "*"
|
|
254
|
-
})] }), /* @__PURE__ */
|
|
281
|
+
})] }), /* @__PURE__ */ _(T, {
|
|
255
282
|
value: L.category,
|
|
256
283
|
onValueChange: (e) => X("category", e),
|
|
257
|
-
children: [/* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ g(E, { children: J.map((e) => /* @__PURE__ */ g(D, {
|
|
258
285
|
value: e,
|
|
259
286
|
className: "capitalize",
|
|
260
287
|
children: e.replace(/_/g, " ")
|
|
261
288
|
}, e)) })]
|
|
262
289
|
})]
|
|
263
290
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ _("div", {
|
|
265
292
|
className: "space-y-2",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ g(C, { children: "Status" }), /* @__PURE__ */ _(T, {
|
|
267
294
|
value: L.status,
|
|
268
295
|
onValueChange: (e) => X("status", e),
|
|
269
|
-
children: [/* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
|
|
297
|
+
/* @__PURE__ */ g(D, {
|
|
271
298
|
value: "ACTIVE",
|
|
272
299
|
children: "Active"
|
|
273
300
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ g(D, {
|
|
275
302
|
value: "INACTIVE",
|
|
276
303
|
children: "Inactive"
|
|
277
304
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ g(D, {
|
|
279
306
|
value: "MAINTENANCE",
|
|
280
307
|
children: "Maintenance"
|
|
281
308
|
}),
|
|
282
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ g(D, {
|
|
283
310
|
value: "RETIRED",
|
|
284
311
|
children: "Retired"
|
|
285
312
|
})
|
|
286
313
|
] })]
|
|
287
314
|
})]
|
|
288
315
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
316
|
+
/* @__PURE__ */ _("div", {
|
|
290
317
|
className: "space-y-2",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ g(C, { children: "Condition" }), /* @__PURE__ */ _(T, {
|
|
292
319
|
value: L.condition,
|
|
293
320
|
onValueChange: (e) => X("condition", e),
|
|
294
|
-
children: [/* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
|
|
322
|
+
/* @__PURE__ */ g(D, {
|
|
296
323
|
value: "EXCELLENT",
|
|
297
324
|
children: "Excellent"
|
|
298
325
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ g(D, {
|
|
300
327
|
value: "GOOD",
|
|
301
328
|
children: "Good"
|
|
302
329
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ g(D, {
|
|
304
331
|
value: "FAIR",
|
|
305
332
|
children: "Fair"
|
|
306
333
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ g(D, {
|
|
308
335
|
value: "POOR",
|
|
309
336
|
children: "Poor"
|
|
310
337
|
}),
|
|
311
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ g(D, {
|
|
312
339
|
value: "DAMAGED",
|
|
313
340
|
children: "Damaged"
|
|
314
341
|
})
|
|
@@ -317,9 +344,9 @@ function I() {
|
|
|
317
344
|
})
|
|
318
345
|
]
|
|
319
346
|
}),
|
|
320
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ _("div", {
|
|
321
348
|
className: "space-y-2",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ g(C, { children: "Serial Number" }), /* @__PURE__ */ g(S, {
|
|
323
350
|
placeholder: "e.g., DELL-7090-X1A2B3",
|
|
324
351
|
value: L.serialNumber,
|
|
325
352
|
onChange: (e) => X("serialNumber", e.target.value)
|
|
@@ -327,23 +354,23 @@ function I() {
|
|
|
327
354
|
})
|
|
328
355
|
]
|
|
329
356
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ _(F, {
|
|
331
358
|
title: "Financial Details",
|
|
332
359
|
description: "Purchase and depreciation data powers book value, TCO and finance reports",
|
|
333
360
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ _("div", {
|
|
335
362
|
className: "grid gap-4 md:grid-cols-3",
|
|
336
363
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ _("div", {
|
|
338
365
|
className: "space-y-2",
|
|
339
366
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ g(C, { children: "Purchase Value" }),
|
|
368
|
+
/* @__PURE__ */ _("div", {
|
|
342
369
|
className: "relative",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ g("span", {
|
|
344
371
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
|
|
345
372
|
children: "$"
|
|
346
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ g(S, {
|
|
347
374
|
type: "number",
|
|
348
375
|
min: "0",
|
|
349
376
|
step: "0.01",
|
|
@@ -354,23 +381,23 @@ function I() {
|
|
|
354
381
|
"aria-invalid": !!U.purchaseValue
|
|
355
382
|
})]
|
|
356
383
|
}),
|
|
357
|
-
U.purchaseValue ? /* @__PURE__ */
|
|
384
|
+
U.purchaseValue ? /* @__PURE__ */ g("p", {
|
|
358
385
|
className: "text-xs text-status-error-text",
|
|
359
386
|
children: U.purchaseValue
|
|
360
387
|
}) : null
|
|
361
388
|
]
|
|
362
389
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ _("div", {
|
|
364
391
|
className: "space-y-2",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ g(C, { children: "Purchase Date" }), /* @__PURE__ */ g(S, {
|
|
366
393
|
type: "date",
|
|
367
394
|
value: L.purchaseDate,
|
|
368
395
|
onChange: (e) => X("purchaseDate", e.target.value)
|
|
369
396
|
})]
|
|
370
397
|
}),
|
|
371
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ _("div", {
|
|
372
399
|
className: "space-y-2",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ g(C, { children: "Supplier" }), /* @__PURE__ */ g(S, {
|
|
374
401
|
placeholder: "e.g., Dell Technologies",
|
|
375
402
|
value: L.supplier,
|
|
376
403
|
onChange: (e) => X("supplier", e.target.value)
|
|
@@ -378,16 +405,16 @@ function I() {
|
|
|
378
405
|
})
|
|
379
406
|
]
|
|
380
407
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ _("div", {
|
|
382
409
|
className: "grid gap-4 md:grid-cols-3",
|
|
383
410
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ _("div", {
|
|
385
412
|
className: "space-y-2",
|
|
386
413
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ g(C, { children: "Useful Life" }),
|
|
415
|
+
/* @__PURE__ */ _("div", {
|
|
389
416
|
className: "relative",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
417
|
+
children: [/* @__PURE__ */ g(S, {
|
|
391
418
|
type: "number",
|
|
392
419
|
min: "0",
|
|
393
420
|
step: "1",
|
|
@@ -396,27 +423,27 @@ function I() {
|
|
|
396
423
|
value: L.usefulLifeMonths,
|
|
397
424
|
onChange: (e) => X("usefulLifeMonths", e.target.value),
|
|
398
425
|
"aria-invalid": !!U.usefulLifeMonths
|
|
399
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ g("span", {
|
|
400
427
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
|
|
401
428
|
children: "months"
|
|
402
429
|
})]
|
|
403
430
|
}),
|
|
404
|
-
U.usefulLifeMonths ? /* @__PURE__ */
|
|
431
|
+
U.usefulLifeMonths ? /* @__PURE__ */ g("p", {
|
|
405
432
|
className: "text-xs text-status-error-text",
|
|
406
433
|
children: U.usefulLifeMonths
|
|
407
434
|
}) : null
|
|
408
435
|
]
|
|
409
436
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
437
|
+
/* @__PURE__ */ _("div", {
|
|
411
438
|
className: "space-y-2",
|
|
412
439
|
children: [
|
|
413
|
-
/* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ g(C, { children: "Salvage Value" }),
|
|
441
|
+
/* @__PURE__ */ _("div", {
|
|
415
442
|
className: "relative",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ g("span", {
|
|
417
444
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
|
|
418
445
|
children: "$"
|
|
419
|
-
}), /* @__PURE__ */
|
|
446
|
+
}), /* @__PURE__ */ g(S, {
|
|
420
447
|
type: "number",
|
|
421
448
|
min: "0",
|
|
422
449
|
step: "0.01",
|
|
@@ -427,27 +454,39 @@ function I() {
|
|
|
427
454
|
"aria-invalid": !!U.salvageValue
|
|
428
455
|
})]
|
|
429
456
|
}),
|
|
430
|
-
U.salvageValue ? /* @__PURE__ */
|
|
457
|
+
U.salvageValue ? /* @__PURE__ */ g("p", {
|
|
431
458
|
className: "text-xs text-status-error-text",
|
|
432
459
|
children: U.salvageValue
|
|
433
460
|
}) : null
|
|
434
461
|
]
|
|
435
462
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
463
|
+
/* @__PURE__ */ _("div", {
|
|
437
464
|
className: "space-y-2",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
465
|
+
children: [/* @__PURE__ */ g(C, { children: "Depreciation Method" }), /* @__PURE__ */ _(T, {
|
|
439
466
|
value: L.depreciationMethod,
|
|
440
467
|
onValueChange: (e) => X("depreciationMethod", e),
|
|
441
|
-
children: [/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
468
|
+
children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
|
|
469
|
+
/* @__PURE__ */ g(D, {
|
|
443
470
|
value: "STRAIGHT_LINE",
|
|
444
471
|
children: "Straight line"
|
|
445
472
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ g(D, {
|
|
447
474
|
value: "REDUCING_BALANCE",
|
|
448
|
-
children: "Reducing balance"
|
|
475
|
+
children: "Reducing balance (200%)"
|
|
476
|
+
}),
|
|
477
|
+
/* @__PURE__ */ g(D, {
|
|
478
|
+
value: "DECLINING_BALANCE",
|
|
479
|
+
children: "Declining balance (150%)"
|
|
480
|
+
}),
|
|
481
|
+
/* @__PURE__ */ g(D, {
|
|
482
|
+
value: "SUM_OF_YEARS_DIGITS",
|
|
483
|
+
children: "Sum of years' digits"
|
|
484
|
+
}),
|
|
485
|
+
/* @__PURE__ */ g(D, {
|
|
486
|
+
value: "UNITS_OF_PRODUCTION",
|
|
487
|
+
children: "Units of production"
|
|
449
488
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ g(D, {
|
|
451
490
|
value: "NONE",
|
|
452
491
|
children: "None"
|
|
453
492
|
})
|
|
@@ -456,19 +495,43 @@ function I() {
|
|
|
456
495
|
})
|
|
457
496
|
]
|
|
458
497
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
498
|
+
L.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ _("div", {
|
|
499
|
+
className: "grid gap-4 md:grid-cols-2",
|
|
500
|
+
children: [/* @__PURE__ */ _("div", {
|
|
501
|
+
className: "space-y-2",
|
|
502
|
+
children: [/* @__PURE__ */ g(C, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ g(S, {
|
|
503
|
+
type: "number",
|
|
504
|
+
min: "0",
|
|
505
|
+
step: "1",
|
|
506
|
+
placeholder: "e.g., 100000 (miles, hours, cycles…)",
|
|
507
|
+
value: L.unitsOfProductionCapacity,
|
|
508
|
+
onChange: (e) => X("unitsOfProductionCapacity", e.target.value)
|
|
509
|
+
})]
|
|
510
|
+
}), /* @__PURE__ */ _("div", {
|
|
511
|
+
className: "space-y-2",
|
|
512
|
+
children: [/* @__PURE__ */ g(C, { children: "Units Produced To Date" }), /* @__PURE__ */ g(S, {
|
|
513
|
+
type: "number",
|
|
514
|
+
min: "0",
|
|
515
|
+
step: "1",
|
|
516
|
+
placeholder: "0",
|
|
517
|
+
value: L.unitsProduced,
|
|
518
|
+
onChange: (e) => X("unitsProduced", e.target.value)
|
|
519
|
+
})]
|
|
520
|
+
})]
|
|
521
|
+
}) : null,
|
|
522
|
+
/* @__PURE__ */ _("div", {
|
|
460
523
|
className: "space-y-2",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
524
|
+
children: [/* @__PURE__ */ g(C, { children: "Warranty Expiry" }), /* @__PURE__ */ g(S, {
|
|
462
525
|
type: "date",
|
|
463
526
|
value: L.warrantyExpiry,
|
|
464
527
|
onChange: (e) => X("warrantyExpiry", e.target.value)
|
|
465
528
|
})]
|
|
466
529
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ g(o, {
|
|
468
531
|
title: "Depreciation preview",
|
|
469
532
|
subtitle: "Projected book value over the asset's useful life",
|
|
470
|
-
icon:
|
|
471
|
-
children: Q.length > 0 ? /* @__PURE__ */
|
|
533
|
+
icon: p,
|
|
534
|
+
children: Q.length > 0 ? /* @__PURE__ */ g(a, {
|
|
472
535
|
data: Q,
|
|
473
536
|
xKey: "year",
|
|
474
537
|
height: 240,
|
|
@@ -478,58 +541,58 @@ function I() {
|
|
|
478
541
|
key: "bookValue",
|
|
479
542
|
label: "Book value"
|
|
480
543
|
}]
|
|
481
|
-
}) : /* @__PURE__ */
|
|
544
|
+
}) : /* @__PURE__ */ _("div", {
|
|
482
545
|
className: "flex flex-col items-center gap-2 py-10 text-center text-sm text-text-secondary",
|
|
483
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ g(u, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
|
|
484
547
|
})
|
|
485
548
|
})
|
|
486
549
|
]
|
|
487
550
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ g(F, {
|
|
489
552
|
title: "Assignment & Location",
|
|
490
553
|
description: "Who holds it and where it lives",
|
|
491
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ _("div", {
|
|
492
555
|
className: "grid gap-4 md:grid-cols-2",
|
|
493
556
|
children: [
|
|
494
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ _("div", {
|
|
495
558
|
className: "space-y-2",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: [/* @__PURE__ */ g(C, { children: "Assigned To" }), /* @__PURE__ */ g(S, {
|
|
497
560
|
placeholder: "e.g., john.smith@company.com",
|
|
498
561
|
value: L.assignedTo,
|
|
499
562
|
onChange: (e) => X("assignedTo", e.target.value)
|
|
500
563
|
})]
|
|
501
564
|
}),
|
|
502
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ _("div", {
|
|
503
566
|
className: "space-y-2",
|
|
504
|
-
children: [/* @__PURE__ */
|
|
567
|
+
children: [/* @__PURE__ */ g(C, { children: "Location" }), /* @__PURE__ */ g(S, {
|
|
505
568
|
placeholder: "e.g., Building A, Floor 3, Desk 15",
|
|
506
569
|
value: L.locationName,
|
|
507
570
|
onChange: (e) => X("locationName", e.target.value)
|
|
508
571
|
})]
|
|
509
572
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ _("div", {
|
|
511
574
|
className: "space-y-2",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ g(C, { children: "Department" }), /* @__PURE__ */ g(S, {
|
|
513
576
|
placeholder: "e.g., Engineering",
|
|
514
577
|
value: L.department,
|
|
515
578
|
onChange: (e) => X("department", e.target.value)
|
|
516
579
|
})]
|
|
517
580
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ _("div", {
|
|
519
582
|
className: "space-y-2",
|
|
520
|
-
children: [/* @__PURE__ */
|
|
583
|
+
children: [/* @__PURE__ */ g(C, { children: "Tags" }), /* @__PURE__ */ _("div", {
|
|
521
584
|
className: "flex flex-wrap items-center gap-1.5 rounded-md border border-border-strong bg-bg-surface px-2 py-1.5 focus-within:border-action-primary-bg",
|
|
522
|
-
children: [z.map((e) => /* @__PURE__ */ v
|
|
585
|
+
children: [z.map((e) => /* @__PURE__ */ _(v, {
|
|
523
586
|
variant: "secondary",
|
|
524
587
|
className: "gap-1",
|
|
525
|
-
children: [e, /* @__PURE__ */
|
|
588
|
+
children: [e, /* @__PURE__ */ g("button", {
|
|
526
589
|
type: "button",
|
|
527
590
|
"aria-label": `Remove ${e}`,
|
|
528
591
|
onClick: () => B((t) => t.filter((t) => t !== e)),
|
|
529
592
|
className: "text-text-secondary hover:text-text-primary",
|
|
530
|
-
children: /* @__PURE__ */
|
|
593
|
+
children: /* @__PURE__ */ g(m, { className: "h-3 w-3" })
|
|
531
594
|
})]
|
|
532
|
-
}, e)), /* @__PURE__ */
|
|
595
|
+
}, e)), /* @__PURE__ */ g("input", {
|
|
533
596
|
value: V,
|
|
534
597
|
onChange: (e) => H(e.target.value),
|
|
535
598
|
onKeyDown: re,
|
|
@@ -542,30 +605,30 @@ function I() {
|
|
|
542
605
|
]
|
|
543
606
|
})
|
|
544
607
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ g("div", {
|
|
546
609
|
className: "sticky bottom-0 -mx-4 mt-6 border-t border-border-seam bg-bg-surface/95 px-4 py-3 backdrop-blur sm:-mx-6 sm:px-6",
|
|
547
|
-
children: /* @__PURE__ */
|
|
610
|
+
children: /* @__PURE__ */ _("div", {
|
|
548
611
|
className: "mx-auto flex max-w-4xl flex-col gap-2 sm:flex-row sm:justify-end",
|
|
549
612
|
children: [
|
|
550
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ _(y, {
|
|
551
614
|
variant: "outline",
|
|
552
615
|
className: "w-full sm:w-auto",
|
|
553
|
-
onClick: () =>
|
|
616
|
+
onClick: () => h("/assets/asset-list"),
|
|
554
617
|
disabled: Y,
|
|
555
|
-
children: [/* @__PURE__ */
|
|
618
|
+
children: [/* @__PURE__ */ g(m, { className: "mr-2 h-4 w-4" }), "Cancel"]
|
|
556
619
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ _(y, {
|
|
558
621
|
variant: "outline",
|
|
559
622
|
className: "w-full sm:w-auto",
|
|
560
623
|
onClick: () => $(!0),
|
|
561
624
|
disabled: Y,
|
|
562
|
-
children: [Y && G === "add" ? /* @__PURE__ */
|
|
625
|
+
children: [Y && G === "add" ? /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(f, { className: "mr-2 h-4 w-4" }), "Save & add another"]
|
|
563
626
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ _(y, {
|
|
565
628
|
className: "w-full sm:w-auto",
|
|
566
629
|
onClick: () => $(!1),
|
|
567
630
|
disabled: Y,
|
|
568
|
-
children: [Y && G === "create" ? /* @__PURE__ */
|
|
631
|
+
children: [Y && G === "create" ? /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(f, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
|
|
569
632
|
})
|
|
570
633
|
]
|
|
571
634
|
})
|