@burdenoff/microfe-assethandler 2026.710.1 → 2026.713.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/AssetHandlerRoot.d.ts.map +1 -1
- package/dist/assethandler/AssetHandlerRoot.js +16 -8
- package/dist/assethandler/AssetHandlerRoot.js.map +1 -1
- package/dist/assethandler/components/AttachmentsPanel.d.ts.map +1 -1
- package/dist/assethandler/components/AttachmentsPanel.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/store/assethandlerStore.d.ts.map +1 -1
- package/dist/assethandler/store/assethandlerStore.js.map +1 -1
- package/dist/assethandler/types/index.d.ts +32 -0
- package/dist/assethandler/types/index.d.ts.map +1 -1
- package/dist/services/createSandboxAssistantTransport.d.ts +8 -26
- package/dist/services/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/services/createSandboxAssistantTransport.js +8 -114
- package/dist/services/createSandboxAssistantTransport.js.map +1 -1
- package/dist/types/assistant.d.ts.map +1 -1
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +2 -2
- package/dist/generated/wspace-operations.js +0 -255
- package/dist/generated/wspace-operations.js.map +0 -1
- package/dist/services/assistantApi.d.ts +0 -71
- package/dist/services/assistantApi.d.ts.map +0 -1
- package/dist/services/assistantApi.js +0 -215
- package/dist/services/assistantApi.js.map +0 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { useHiddenCategoryIds as t } from "../providers/AssetHandlerProvider.js";
|
|
3
|
+
import { useAssetHandlerNavigate as n } from "../hooks/useAssetHandlerNavigate.js";
|
|
4
|
+
import { notify as r } from "../utils/toast.js";
|
|
5
|
+
import { formatCurrencyCompact as i } from "../components/charts/chartTheme.js";
|
|
6
|
+
import { TrendChart as a } from "../components/charts/TrendChart.js";
|
|
7
|
+
import { ChartCard as o } from "../components/ChartCard.js";
|
|
7
8
|
import "../components/index.js";
|
|
8
|
-
import { useMemo as
|
|
9
|
-
import { ArrowLeft as
|
|
10
|
-
import { gql as
|
|
11
|
-
import { useMutation as
|
|
12
|
-
import { jsx as
|
|
13
|
-
import { Badge as
|
|
9
|
+
import { useMemo as s, useRef as c, useState as l } from "react";
|
|
10
|
+
import { ArrowLeft as u, Info as d, Loader2 as f, Save as p, TrendingDown as m, X as h } from "lucide-react";
|
|
11
|
+
import { gql as g } from "@apollo/client";
|
|
12
|
+
import { useMutation as ee } from "@apollo/client/react";
|
|
13
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
import { Badge as y, Button as b, GlassCard as x, GradientText as S, Input as C, Label as w, PagePurpose as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
|
|
14
15
|
//#region src/assethandler/pages/AssetsAssetCreatePage.tsx
|
|
15
|
-
var
|
|
16
|
+
var M = g`
|
|
16
17
|
mutation AssetHandlerCreateAsset($input: CreateAssetInput!) {
|
|
17
18
|
createAsset(input: $input) {
|
|
18
19
|
id
|
|
@@ -20,7 +21,7 @@ var j = m`
|
|
|
20
21
|
name
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
`,
|
|
24
|
+
`, te = [
|
|
24
25
|
"electronics",
|
|
25
26
|
"it_hardware",
|
|
26
27
|
"furniture",
|
|
@@ -65,71 +66,71 @@ function P(e) {
|
|
|
65
66
|
}
|
|
66
67
|
return o;
|
|
67
68
|
}
|
|
68
|
-
var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */
|
|
69
|
+
var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ _(x, {
|
|
69
70
|
treatment: "glass",
|
|
70
71
|
glow: r,
|
|
71
72
|
className: "border-border-seam",
|
|
72
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ v("div", {
|
|
73
74
|
className: "space-y-4 p-5 sm:p-6",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
75
|
+
children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h2", {
|
|
75
76
|
className: "text-lg font-semibold",
|
|
76
77
|
children: e
|
|
77
|
-
}), t ? /* @__PURE__ */
|
|
78
|
+
}), t ? /* @__PURE__ */ _("p", {
|
|
78
79
|
className: "mt-0.5 text-sm text-text-secondary",
|
|
79
80
|
children: t
|
|
80
81
|
}) : null] }), n]
|
|
81
82
|
})
|
|
82
83
|
});
|
|
83
84
|
function I() {
|
|
84
|
-
let
|
|
85
|
-
let e = new Set(
|
|
86
|
-
for (let t of
|
|
87
|
-
return [...e].sort();
|
|
88
|
-
}, [
|
|
85
|
+
let g = n(), x = t(), { assets: I } = e(), [L, R] = l(N), [z, B] = l([]), [V, H] = l(""), [U, W] = l({}), [G, K] = l(null), q = c(!1), J = s(() => {
|
|
86
|
+
let e = new Set(te);
|
|
87
|
+
for (let t of I) t.category && e.add(t.category);
|
|
88
|
+
return [...e].filter((e) => !x.has(e)).sort();
|
|
89
|
+
}, [I, x]), [ne, { loading: Y }] = ee(M, {
|
|
89
90
|
refetchQueries: ["AssetHandlerBootstrap"],
|
|
90
91
|
onCompleted: (e) => {
|
|
91
|
-
|
|
92
|
+
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({
|
|
92
93
|
top: 0,
|
|
93
94
|
behavior: "smooth"
|
|
94
|
-
})) :
|
|
95
|
+
})) : g(`/assets/${e.createAsset.id}`);
|
|
95
96
|
},
|
|
96
97
|
onError: (e) => {
|
|
97
|
-
|
|
98
|
+
K(null), r.error("Could not create asset", e.message);
|
|
98
99
|
}
|
|
99
100
|
}), X = (e, t) => {
|
|
100
|
-
|
|
101
|
+
R((n) => ({
|
|
101
102
|
...n,
|
|
102
103
|
[e]: t
|
|
103
|
-
})),
|
|
104
|
+
})), W((t) => {
|
|
104
105
|
if (!t[e]) return t;
|
|
105
106
|
let n = { ...t };
|
|
106
107
|
return delete n[e], n;
|
|
107
108
|
});
|
|
108
109
|
}, Z = () => {
|
|
109
|
-
let e =
|
|
110
|
-
e && !
|
|
111
|
-
},
|
|
112
|
-
e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" &&
|
|
113
|
-
}, Q =
|
|
114
|
-
purchaseValue:
|
|
115
|
-
salvageValue:
|
|
116
|
-
usefulLifeMonths:
|
|
117
|
-
method:
|
|
110
|
+
let e = V.trim().replace(/,$/, "").trim();
|
|
111
|
+
e && !z.includes(e) && B((t) => [...t, e]), H("");
|
|
112
|
+
}, re = (e) => {
|
|
113
|
+
e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" && V === "" && z.length > 0 && B((e) => e.slice(0, -1));
|
|
114
|
+
}, Q = s(() => P({
|
|
115
|
+
purchaseValue: L.purchaseValue.trim() ? Number(L.purchaseValue) : null,
|
|
116
|
+
salvageValue: L.salvageValue.trim() ? Number(L.salvageValue) : null,
|
|
117
|
+
usefulLifeMonths: L.usefulLifeMonths.trim() ? Number(L.usefulLifeMonths) : null,
|
|
118
|
+
method: L.depreciationMethod
|
|
118
119
|
}), [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
L.purchaseValue,
|
|
121
|
+
L.salvageValue,
|
|
122
|
+
L.usefulLifeMonths,
|
|
123
|
+
L.depreciationMethod
|
|
123
124
|
]), $ = (e) => {
|
|
124
125
|
let t = {};
|
|
125
|
-
|
|
126
|
-
let
|
|
126
|
+
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");
|
|
127
|
+
let n = (e, n, r) => {
|
|
127
128
|
if (e.trim() === "") return;
|
|
128
129
|
let i = Number(e);
|
|
129
130
|
(Number.isNaN(i) || i < 0) && (t[r] = `${n} must be a positive number`);
|
|
130
131
|
};
|
|
131
|
-
if (
|
|
132
|
-
|
|
132
|
+
if (n(L.purchaseValue, "Purchase value", "purchaseValue"), n(L.salvageValue, "Salvage value", "salvageValue"), n(L.usefulLifeMonths, "Useful life", "usefulLifeMonths"), W(t), Object.keys(t).length > 0) {
|
|
133
|
+
r.warning("Missing required fields", "Fill in the highlighted fields and try again.");
|
|
133
134
|
return;
|
|
134
135
|
}
|
|
135
136
|
let i = (e) => {
|
|
@@ -138,48 +139,48 @@ function I() {
|
|
|
138
139
|
let n = Number(t);
|
|
139
140
|
return Number.isNaN(n) ? null : n;
|
|
140
141
|
}, a = (e) => e.trim() === "" ? null : new Date(e).toISOString();
|
|
141
|
-
|
|
142
|
-
name:
|
|
143
|
-
assetNumber:
|
|
144
|
-
category:
|
|
145
|
-
status:
|
|
146
|
-
condition:
|
|
147
|
-
description:
|
|
148
|
-
serialNumber:
|
|
149
|
-
locationName:
|
|
150
|
-
assignedTo:
|
|
151
|
-
tags:
|
|
152
|
-
purchaseValue: i(
|
|
153
|
-
purchaseDate: a(
|
|
154
|
-
usefulLifeMonths: i(
|
|
155
|
-
salvageValue: i(
|
|
156
|
-
depreciationMethod:
|
|
157
|
-
warrantyExpiry: a(
|
|
158
|
-
supplier:
|
|
159
|
-
department:
|
|
142
|
+
q.current = e, K(e ? "add" : "create"), ne({ variables: { input: {
|
|
143
|
+
name: L.name.trim(),
|
|
144
|
+
assetNumber: L.assetNumber.trim(),
|
|
145
|
+
category: L.category,
|
|
146
|
+
status: L.status,
|
|
147
|
+
condition: L.condition,
|
|
148
|
+
description: L.description.trim() || null,
|
|
149
|
+
serialNumber: L.serialNumber.trim() || null,
|
|
150
|
+
locationName: L.locationName.trim() || null,
|
|
151
|
+
assignedTo: L.assignedTo.trim() || null,
|
|
152
|
+
tags: z,
|
|
153
|
+
purchaseValue: i(L.purchaseValue),
|
|
154
|
+
purchaseDate: a(L.purchaseDate),
|
|
155
|
+
usefulLifeMonths: i(L.usefulLifeMonths),
|
|
156
|
+
salvageValue: i(L.salvageValue),
|
|
157
|
+
depreciationMethod: L.depreciationMethod,
|
|
158
|
+
warrantyExpiry: a(L.warrantyExpiry),
|
|
159
|
+
supplier: L.supplier.trim() || null,
|
|
160
|
+
department: L.department.trim() || null
|
|
160
161
|
} } });
|
|
161
162
|
};
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ v("div", {
|
|
163
164
|
className: "mx-auto max-w-4xl space-y-6 p-4 pb-28 sm:p-6 sm:pb-28",
|
|
164
165
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ v("div", {
|
|
166
167
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
|
|
167
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ _(b, {
|
|
168
169
|
variant: "ghost",
|
|
169
170
|
size: "icon",
|
|
170
171
|
"aria-label": "Go back",
|
|
171
172
|
className: "w-fit",
|
|
172
|
-
onClick: () =>
|
|
173
|
-
children: /* @__PURE__ */
|
|
174
|
-
}), /* @__PURE__ */
|
|
173
|
+
onClick: () => g("/assets/asset-list"),
|
|
174
|
+
children: /* @__PURE__ */ _(u, { className: "h-4 w-4" })
|
|
175
|
+
}), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
|
|
175
176
|
className: "text-2xl font-bold",
|
|
176
|
-
children: /* @__PURE__ */
|
|
177
|
-
}), /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ _(S, { children: "Create New Asset" })
|
|
178
|
+
}), /* @__PURE__ */ v("p", {
|
|
178
179
|
className: "text-sm text-text-secondary",
|
|
179
180
|
children: [
|
|
180
181
|
"Register a new asset in the inventory ·",
|
|
181
182
|
" ",
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ _("span", {
|
|
183
184
|
className: "text-status-error-text",
|
|
184
185
|
children: "*"
|
|
185
186
|
}),
|
|
@@ -187,127 +188,127 @@ function I() {
|
|
|
187
188
|
]
|
|
188
189
|
})] })]
|
|
189
190
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ _(T, { 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." }),
|
|
192
|
+
/* @__PURE__ */ v(F, {
|
|
192
193
|
title: "General Information",
|
|
193
194
|
description: "Basic asset details and identification",
|
|
194
195
|
glow: !0,
|
|
195
196
|
children: [
|
|
196
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ v("div", {
|
|
197
198
|
className: "grid gap-4 md:grid-cols-2",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ v("div", {
|
|
199
200
|
className: "space-y-2",
|
|
200
201
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ v(w, { children: ["Asset Name ", /* @__PURE__ */ _("span", {
|
|
202
203
|
className: "text-status-error-text",
|
|
203
204
|
children: "*"
|
|
204
205
|
})] }),
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ _(C, {
|
|
206
207
|
placeholder: "e.g., Dell OptiPlex 7090",
|
|
207
|
-
value:
|
|
208
|
+
value: L.name,
|
|
208
209
|
onChange: (e) => X("name", e.target.value),
|
|
209
|
-
"aria-invalid": !!
|
|
210
|
+
"aria-invalid": !!U.name
|
|
210
211
|
}),
|
|
211
|
-
|
|
212
|
+
U.name ? /* @__PURE__ */ _("p", {
|
|
212
213
|
className: "text-xs text-status-error-text",
|
|
213
|
-
children:
|
|
214
|
+
children: U.name
|
|
214
215
|
}) : null
|
|
215
216
|
]
|
|
216
|
-
}), /* @__PURE__ */
|
|
217
|
+
}), /* @__PURE__ */ v("div", {
|
|
217
218
|
className: "space-y-2",
|
|
218
219
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ v(w, { children: ["Asset Tag ", /* @__PURE__ */ _("span", {
|
|
220
221
|
className: "text-status-error-text",
|
|
221
222
|
children: "*"
|
|
222
223
|
})] }),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ _(C, {
|
|
224
225
|
placeholder: "e.g., IT-HW-001",
|
|
225
|
-
value:
|
|
226
|
+
value: L.assetNumber,
|
|
226
227
|
onChange: (e) => X("assetNumber", e.target.value),
|
|
227
|
-
"aria-invalid": !!
|
|
228
|
+
"aria-invalid": !!U.assetNumber
|
|
228
229
|
}),
|
|
229
|
-
|
|
230
|
+
U.assetNumber ? /* @__PURE__ */ _("p", {
|
|
230
231
|
className: "text-xs text-status-error-text",
|
|
231
|
-
children:
|
|
232
|
+
children: U.assetNumber
|
|
232
233
|
}) : null
|
|
233
234
|
]
|
|
234
235
|
})]
|
|
235
236
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ v("div", {
|
|
237
238
|
className: "space-y-2",
|
|
238
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ _(w, { children: "Description" }), /* @__PURE__ */ _(j, {
|
|
239
240
|
placeholder: "Brief description of the asset...",
|
|
240
|
-
value:
|
|
241
|
+
value: L.description,
|
|
241
242
|
onChange: (e) => X("description", e.target.value),
|
|
242
243
|
rows: 3
|
|
243
244
|
})]
|
|
244
245
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ v("div", {
|
|
246
247
|
className: "grid gap-4 md:grid-cols-3",
|
|
247
248
|
children: [
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ v("div", {
|
|
249
250
|
className: "space-y-2",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
251
|
+
children: [/* @__PURE__ */ v(w, { children: ["Category ", /* @__PURE__ */ _("span", {
|
|
251
252
|
className: "text-status-error-text",
|
|
252
253
|
children: "*"
|
|
253
|
-
})] }), /* @__PURE__ */
|
|
254
|
-
value:
|
|
254
|
+
})] }), /* @__PURE__ */ v(E, {
|
|
255
|
+
value: L.category,
|
|
255
256
|
onValueChange: (e) => X("category", e),
|
|
256
|
-
children: [/* @__PURE__ */
|
|
257
|
+
children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ _(D, { children: J.map((e) => /* @__PURE__ */ _(O, {
|
|
257
258
|
value: e,
|
|
258
259
|
className: "capitalize",
|
|
259
260
|
children: e.replace(/_/g, " ")
|
|
260
261
|
}, e)) })]
|
|
261
262
|
})]
|
|
262
263
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ v("div", {
|
|
264
265
|
className: "space-y-2",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
266
|
-
value:
|
|
266
|
+
children: [/* @__PURE__ */ _(w, { children: "Status" }), /* @__PURE__ */ v(E, {
|
|
267
|
+
value: L.status,
|
|
267
268
|
onValueChange: (e) => X("status", e),
|
|
268
|
-
children: [/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ v(D, { children: [
|
|
270
|
+
/* @__PURE__ */ _(O, {
|
|
270
271
|
value: "ACTIVE",
|
|
271
272
|
children: "Active"
|
|
272
273
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ _(O, {
|
|
274
275
|
value: "INACTIVE",
|
|
275
276
|
children: "Inactive"
|
|
276
277
|
}),
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ _(O, {
|
|
278
279
|
value: "MAINTENANCE",
|
|
279
280
|
children: "Maintenance"
|
|
280
281
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ _(O, {
|
|
282
283
|
value: "RETIRED",
|
|
283
284
|
children: "Retired"
|
|
284
285
|
})
|
|
285
286
|
] })]
|
|
286
287
|
})]
|
|
287
288
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ v("div", {
|
|
289
290
|
className: "space-y-2",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
291
|
-
value:
|
|
291
|
+
children: [/* @__PURE__ */ _(w, { children: "Condition" }), /* @__PURE__ */ v(E, {
|
|
292
|
+
value: L.condition,
|
|
292
293
|
onValueChange: (e) => X("condition", e),
|
|
293
|
-
children: [/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ v(D, { children: [
|
|
295
|
+
/* @__PURE__ */ _(O, {
|
|
295
296
|
value: "EXCELLENT",
|
|
296
297
|
children: "Excellent"
|
|
297
298
|
}),
|
|
298
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ _(O, {
|
|
299
300
|
value: "GOOD",
|
|
300
301
|
children: "Good"
|
|
301
302
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ _(O, {
|
|
303
304
|
value: "FAIR",
|
|
304
305
|
children: "Fair"
|
|
305
306
|
}),
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ _(O, {
|
|
307
308
|
value: "POOR",
|
|
308
309
|
children: "Poor"
|
|
309
310
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ _(O, {
|
|
311
312
|
value: "DAMAGED",
|
|
312
313
|
children: "Damaged"
|
|
313
314
|
})
|
|
@@ -316,137 +317,137 @@ function I() {
|
|
|
316
317
|
})
|
|
317
318
|
]
|
|
318
319
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ v("div", {
|
|
320
321
|
className: "space-y-2",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ _(w, { children: "Serial Number" }), /* @__PURE__ */ _(C, {
|
|
322
323
|
placeholder: "e.g., DELL-7090-X1A2B3",
|
|
323
|
-
value:
|
|
324
|
+
value: L.serialNumber,
|
|
324
325
|
onChange: (e) => X("serialNumber", e.target.value)
|
|
325
326
|
})]
|
|
326
327
|
})
|
|
327
328
|
]
|
|
328
329
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ v(F, {
|
|
330
331
|
title: "Financial Details",
|
|
331
332
|
description: "Purchase and depreciation data powers book value, TCO and finance reports",
|
|
332
333
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ v("div", {
|
|
334
335
|
className: "grid gap-4 md:grid-cols-3",
|
|
335
336
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
337
|
+
/* @__PURE__ */ v("div", {
|
|
337
338
|
className: "space-y-2",
|
|
338
339
|
children: [
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ _(w, { children: "Purchase Value" }),
|
|
341
|
+
/* @__PURE__ */ v("div", {
|
|
341
342
|
className: "relative",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ _("span", {
|
|
343
344
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
|
|
344
345
|
children: "$"
|
|
345
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ _(C, {
|
|
346
347
|
type: "number",
|
|
347
348
|
min: "0",
|
|
348
349
|
step: "0.01",
|
|
349
350
|
placeholder: "1200",
|
|
350
351
|
className: "pl-7",
|
|
351
|
-
value:
|
|
352
|
+
value: L.purchaseValue,
|
|
352
353
|
onChange: (e) => X("purchaseValue", e.target.value),
|
|
353
|
-
"aria-invalid": !!
|
|
354
|
+
"aria-invalid": !!U.purchaseValue
|
|
354
355
|
})]
|
|
355
356
|
}),
|
|
356
|
-
|
|
357
|
+
U.purchaseValue ? /* @__PURE__ */ _("p", {
|
|
357
358
|
className: "text-xs text-status-error-text",
|
|
358
|
-
children:
|
|
359
|
+
children: U.purchaseValue
|
|
359
360
|
}) : null
|
|
360
361
|
]
|
|
361
362
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ v("div", {
|
|
363
364
|
className: "space-y-2",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
365
|
+
children: [/* @__PURE__ */ _(w, { children: "Purchase Date" }), /* @__PURE__ */ _(C, {
|
|
365
366
|
type: "date",
|
|
366
|
-
value:
|
|
367
|
+
value: L.purchaseDate,
|
|
367
368
|
onChange: (e) => X("purchaseDate", e.target.value)
|
|
368
369
|
})]
|
|
369
370
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ v("div", {
|
|
371
372
|
className: "space-y-2",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ _(w, { children: "Supplier" }), /* @__PURE__ */ _(C, {
|
|
373
374
|
placeholder: "e.g., Dell Technologies",
|
|
374
|
-
value:
|
|
375
|
+
value: L.supplier,
|
|
375
376
|
onChange: (e) => X("supplier", e.target.value)
|
|
376
377
|
})]
|
|
377
378
|
})
|
|
378
379
|
]
|
|
379
380
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ v("div", {
|
|
381
382
|
className: "grid gap-4 md:grid-cols-3",
|
|
382
383
|
children: [
|
|
383
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ v("div", {
|
|
384
385
|
className: "space-y-2",
|
|
385
386
|
children: [
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ _(w, { children: "Useful Life" }),
|
|
388
|
+
/* @__PURE__ */ v("div", {
|
|
388
389
|
className: "relative",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ _(C, {
|
|
390
391
|
type: "number",
|
|
391
392
|
min: "0",
|
|
392
393
|
step: "1",
|
|
393
394
|
placeholder: "60",
|
|
394
395
|
className: "pr-16",
|
|
395
|
-
value:
|
|
396
|
+
value: L.usefulLifeMonths,
|
|
396
397
|
onChange: (e) => X("usefulLifeMonths", e.target.value),
|
|
397
|
-
"aria-invalid": !!
|
|
398
|
-
}), /* @__PURE__ */
|
|
398
|
+
"aria-invalid": !!U.usefulLifeMonths
|
|
399
|
+
}), /* @__PURE__ */ _("span", {
|
|
399
400
|
className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
|
|
400
401
|
children: "months"
|
|
401
402
|
})]
|
|
402
403
|
}),
|
|
403
|
-
|
|
404
|
+
U.usefulLifeMonths ? /* @__PURE__ */ _("p", {
|
|
404
405
|
className: "text-xs text-status-error-text",
|
|
405
|
-
children:
|
|
406
|
+
children: U.usefulLifeMonths
|
|
406
407
|
}) : null
|
|
407
408
|
]
|
|
408
409
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ v("div", {
|
|
410
411
|
className: "space-y-2",
|
|
411
412
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ _(w, { children: "Salvage Value" }),
|
|
414
|
+
/* @__PURE__ */ v("div", {
|
|
414
415
|
className: "relative",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ _("span", {
|
|
416
417
|
className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
|
|
417
418
|
children: "$"
|
|
418
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ _(C, {
|
|
419
420
|
type: "number",
|
|
420
421
|
min: "0",
|
|
421
422
|
step: "0.01",
|
|
422
423
|
placeholder: "100",
|
|
423
424
|
className: "pl-7",
|
|
424
|
-
value:
|
|
425
|
+
value: L.salvageValue,
|
|
425
426
|
onChange: (e) => X("salvageValue", e.target.value),
|
|
426
|
-
"aria-invalid": !!
|
|
427
|
+
"aria-invalid": !!U.salvageValue
|
|
427
428
|
})]
|
|
428
429
|
}),
|
|
429
|
-
|
|
430
|
+
U.salvageValue ? /* @__PURE__ */ _("p", {
|
|
430
431
|
className: "text-xs text-status-error-text",
|
|
431
|
-
children:
|
|
432
|
+
children: U.salvageValue
|
|
432
433
|
}) : null
|
|
433
434
|
]
|
|
434
435
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ v("div", {
|
|
436
437
|
className: "space-y-2",
|
|
437
|
-
children: [/* @__PURE__ */
|
|
438
|
-
value:
|
|
438
|
+
children: [/* @__PURE__ */ _(w, { children: "Depreciation Method" }), /* @__PURE__ */ v(E, {
|
|
439
|
+
value: L.depreciationMethod,
|
|
439
440
|
onValueChange: (e) => X("depreciationMethod", e),
|
|
440
|
-
children: [/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
441
|
+
children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ v(D, { children: [
|
|
442
|
+
/* @__PURE__ */ _(O, {
|
|
442
443
|
value: "STRAIGHT_LINE",
|
|
443
444
|
children: "Straight line"
|
|
444
445
|
}),
|
|
445
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ _(O, {
|
|
446
447
|
value: "REDUCING_BALANCE",
|
|
447
448
|
children: "Reducing balance"
|
|
448
449
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ _(O, {
|
|
450
451
|
value: "NONE",
|
|
451
452
|
children: "None"
|
|
452
453
|
})
|
|
@@ -455,85 +456,85 @@ function I() {
|
|
|
455
456
|
})
|
|
456
457
|
]
|
|
457
458
|
}),
|
|
458
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ v("div", {
|
|
459
460
|
className: "space-y-2",
|
|
460
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ _(w, { children: "Warranty Expiry" }), /* @__PURE__ */ _(C, {
|
|
461
462
|
type: "date",
|
|
462
|
-
value:
|
|
463
|
+
value: L.warrantyExpiry,
|
|
463
464
|
onChange: (e) => X("warrantyExpiry", e.target.value)
|
|
464
465
|
})]
|
|
465
466
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ _(o, {
|
|
467
468
|
title: "Depreciation preview",
|
|
468
469
|
subtitle: "Projected book value over the asset's useful life",
|
|
469
|
-
icon:
|
|
470
|
-
children: Q.length > 0 ? /* @__PURE__ */
|
|
470
|
+
icon: m,
|
|
471
|
+
children: Q.length > 0 ? /* @__PURE__ */ _(a, {
|
|
471
472
|
data: Q,
|
|
472
473
|
xKey: "year",
|
|
473
474
|
height: 240,
|
|
474
|
-
valueFormat:
|
|
475
|
+
valueFormat: i("USD"),
|
|
475
476
|
xTickFormat: (e) => `${e}y`,
|
|
476
477
|
series: [{
|
|
477
478
|
key: "bookValue",
|
|
478
479
|
label: "Book value"
|
|
479
480
|
}]
|
|
480
|
-
}) : /* @__PURE__ */
|
|
481
|
+
}) : /* @__PURE__ */ v("div", {
|
|
481
482
|
className: "flex flex-col items-center gap-2 py-10 text-center text-sm text-text-secondary",
|
|
482
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ _(d, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
|
|
483
484
|
})
|
|
484
485
|
})
|
|
485
486
|
]
|
|
486
487
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ _(F, {
|
|
488
489
|
title: "Assignment & Location",
|
|
489
490
|
description: "Who holds it and where it lives",
|
|
490
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ v("div", {
|
|
491
492
|
className: "grid gap-4 md:grid-cols-2",
|
|
492
493
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ v("div", {
|
|
494
495
|
className: "space-y-2",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ _(w, { children: "Assigned To" }), /* @__PURE__ */ _(C, {
|
|
496
497
|
placeholder: "e.g., john.smith@company.com",
|
|
497
|
-
value:
|
|
498
|
+
value: L.assignedTo,
|
|
498
499
|
onChange: (e) => X("assignedTo", e.target.value)
|
|
499
500
|
})]
|
|
500
501
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ v("div", {
|
|
502
503
|
className: "space-y-2",
|
|
503
|
-
children: [/* @__PURE__ */
|
|
504
|
+
children: [/* @__PURE__ */ _(w, { children: "Location" }), /* @__PURE__ */ _(C, {
|
|
504
505
|
placeholder: "e.g., Building A, Floor 3, Desk 15",
|
|
505
|
-
value:
|
|
506
|
+
value: L.locationName,
|
|
506
507
|
onChange: (e) => X("locationName", e.target.value)
|
|
507
508
|
})]
|
|
508
509
|
}),
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ v("div", {
|
|
510
511
|
className: "space-y-2",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
512
|
+
children: [/* @__PURE__ */ _(w, { children: "Department" }), /* @__PURE__ */ _(C, {
|
|
512
513
|
placeholder: "e.g., Engineering",
|
|
513
|
-
value:
|
|
514
|
+
value: L.department,
|
|
514
515
|
onChange: (e) => X("department", e.target.value)
|
|
515
516
|
})]
|
|
516
517
|
}),
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ v("div", {
|
|
518
519
|
className: "space-y-2",
|
|
519
|
-
children: [/* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ _(w, { children: "Tags" }), /* @__PURE__ */ v("div", {
|
|
520
521
|
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",
|
|
521
|
-
children: [
|
|
522
|
+
children: [z.map((e) => /* @__PURE__ */ v(y, {
|
|
522
523
|
variant: "secondary",
|
|
523
524
|
className: "gap-1",
|
|
524
|
-
children: [e, /* @__PURE__ */
|
|
525
|
+
children: [e, /* @__PURE__ */ _("button", {
|
|
525
526
|
type: "button",
|
|
526
527
|
"aria-label": `Remove ${e}`,
|
|
527
|
-
onClick: () =>
|
|
528
|
+
onClick: () => B((t) => t.filter((t) => t !== e)),
|
|
528
529
|
className: "text-text-secondary hover:text-text-primary",
|
|
529
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ _(h, { className: "h-3 w-3" })
|
|
530
531
|
})]
|
|
531
|
-
}, e)), /* @__PURE__ */
|
|
532
|
-
value:
|
|
533
|
-
onChange: (e) =>
|
|
534
|
-
onKeyDown:
|
|
532
|
+
}, e)), /* @__PURE__ */ _("input", {
|
|
533
|
+
value: V,
|
|
534
|
+
onChange: (e) => H(e.target.value),
|
|
535
|
+
onKeyDown: re,
|
|
535
536
|
onBlur: Z,
|
|
536
|
-
placeholder:
|
|
537
|
+
placeholder: z.length === 0 ? "Type a tag and press Enter" : "",
|
|
537
538
|
className: "min-w-[8rem] flex-1 border-0 bg-transparent text-sm outline-none placeholder:text-text-secondary"
|
|
538
539
|
})]
|
|
539
540
|
})]
|
|
@@ -541,30 +542,30 @@ function I() {
|
|
|
541
542
|
]
|
|
542
543
|
})
|
|
543
544
|
}),
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ _("div", {
|
|
545
546
|
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",
|
|
546
|
-
children: /* @__PURE__ */
|
|
547
|
+
children: /* @__PURE__ */ v("div", {
|
|
547
548
|
className: "mx-auto flex max-w-4xl flex-col gap-2 sm:flex-row sm:justify-end",
|
|
548
549
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ v(b, {
|
|
550
551
|
variant: "outline",
|
|
551
552
|
className: "w-full sm:w-auto",
|
|
552
|
-
onClick: () =>
|
|
553
|
+
onClick: () => g("/assets/asset-list"),
|
|
553
554
|
disabled: Y,
|
|
554
|
-
children: [/* @__PURE__ */
|
|
555
|
+
children: [/* @__PURE__ */ _(h, { className: "mr-2 h-4 w-4" }), "Cancel"]
|
|
555
556
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ v(b, {
|
|
557
558
|
variant: "outline",
|
|
558
559
|
className: "w-full sm:w-auto",
|
|
559
560
|
onClick: () => $(!0),
|
|
560
561
|
disabled: Y,
|
|
561
|
-
children: [Y &&
|
|
562
|
+
children: [Y && G === "add" ? /* @__PURE__ */ _(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ _(p, { className: "mr-2 h-4 w-4" }), "Save & add another"]
|
|
562
563
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ v(b, {
|
|
564
565
|
className: "w-full sm:w-auto",
|
|
565
566
|
onClick: () => $(!1),
|
|
566
567
|
disabled: Y,
|
|
567
|
-
children: [Y &&
|
|
568
|
+
children: [Y && G === "create" ? /* @__PURE__ */ _(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ _(p, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
|
|
568
569
|
})
|
|
569
570
|
]
|
|
570
571
|
})
|