@burdenoff/microfe-theglobalfuel 2026.704.1 → 2026.705.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/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/theglobalfuel/components/DataTable.js +37 -27
- package/dist/theglobalfuel/components/DataTable.js.map +1 -1
- package/dist/theglobalfuel/hooks/index.js +1 -0
- package/dist/theglobalfuel/hooks/useNotify.js +19 -0
- package/dist/theglobalfuel/hooks/useNotify.js.map +1 -0
- package/dist/theglobalfuel/hooks/useTheFiles.js +4 -1
- package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +59 -31
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +367 -321
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.js +66 -54
- package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js +346 -182
- package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +418 -390
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js +238 -230
- package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +5 -3
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +201 -177
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js +271 -238
- package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.js +185 -177
- package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js +160 -138
- package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +250 -198
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
- package/dist/theglobalfuel/utils/cn.js +2 -2
- package/dist/theglobalfuel/utils/formatters.js +6 -1
- package/dist/theglobalfuel/utils/formatters.js.map +1 -1
- package/dist/theglobalfuel/utils/transitions.js +70 -0
- package/dist/theglobalfuel/utils/transitions.js.map +1 -0
- package/package.json +1 -1
- package/dist/dev/main.d.ts +0 -2
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
- package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +0 -5
- package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +0 -1
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +0 -4
- package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +0 -1
- package/dist/theglobalfuel/components/DataTable.d.ts +0 -28
- package/dist/theglobalfuel/components/DataTable.d.ts.map +0 -1
- package/dist/theglobalfuel/components/EmptyState.d.ts +0 -18
- package/dist/theglobalfuel/components/EmptyState.d.ts.map +0 -1
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts +0 -14
- package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +0 -1
- package/dist/theglobalfuel/components/FileLink.d.ts +0 -15
- package/dist/theglobalfuel/components/FileLink.d.ts.map +0 -1
- package/dist/theglobalfuel/components/FilterTabs.d.ts +0 -18
- package/dist/theglobalfuel/components/FilterTabs.d.ts.map +0 -1
- package/dist/theglobalfuel/components/MetricsCard.d.ts +0 -23
- package/dist/theglobalfuel/components/MetricsCard.d.ts.map +0 -1
- package/dist/theglobalfuel/components/MiniBar.d.ts +0 -16
- package/dist/theglobalfuel/components/MiniBar.d.ts.map +0 -1
- package/dist/theglobalfuel/components/PageLayout.d.ts +0 -16
- package/dist/theglobalfuel/components/PageLayout.d.ts.map +0 -1
- package/dist/theglobalfuel/components/Pagination.d.ts +0 -22
- package/dist/theglobalfuel/components/Pagination.d.ts.map +0 -1
- package/dist/theglobalfuel/components/StateViews.d.ts +0 -24
- package/dist/theglobalfuel/components/StateViews.d.ts.map +0 -1
- package/dist/theglobalfuel/components/StatusBadge.d.ts +0 -9
- package/dist/theglobalfuel/components/StatusBadge.d.ts.map +0 -1
- package/dist/theglobalfuel/components/Tabs.d.ts +0 -17
- package/dist/theglobalfuel/components/Tabs.d.ts.map +0 -1
- package/dist/theglobalfuel/components/TheDiscussion.d.ts +0 -18
- package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +0 -1
- package/dist/theglobalfuel/components/TheTags.d.ts +0 -17
- package/dist/theglobalfuel/components/TheTags.d.ts.map +0 -1
- package/dist/theglobalfuel/components/index.d.ts +0 -19
- package/dist/theglobalfuel/components/index.d.ts.map +0 -1
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +0 -16
- package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +0 -1
- package/dist/theglobalfuel/context/index.d.ts +0 -6
- package/dist/theglobalfuel/context/index.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/index.d.ts +0 -10
- package/dist/theglobalfuel/hooks/index.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts +0 -33
- package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheComments.d.ts +0 -36
- package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts +0 -47
- package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +0 -75
- package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +0 -1
- package/dist/theglobalfuel/hooks/useTheTags.d.ts +0 -44
- package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +0 -1
- package/dist/theglobalfuel/index.d.ts +0 -9
- package/dist/theglobalfuel/index.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +0 -13
- package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +0 -11
- package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +0 -9
- package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +0 -8
- package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +0 -13
- package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +0 -12
- package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +0 -11
- package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +0 -1
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +0 -10
- package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +0 -1
- package/dist/theglobalfuel/types/index.d.ts +0 -376
- package/dist/theglobalfuel/types/index.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/cn.d.ts +0 -4
- package/dist/theglobalfuel/utils/cn.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/formatters.d.ts +0 -36
- package/dist/theglobalfuel/utils/formatters.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/i18n.d.ts +0 -6
- package/dist/theglobalfuel/utils/i18n.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/index.d.ts +0 -9
- package/dist/theglobalfuel/utils/index.d.ts.map +0 -1
- package/dist/theglobalfuel/utils/navigation.d.ts +0 -14
- package/dist/theglobalfuel/utils/navigation.d.ts.map +0 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
2
|
import { MetricsCard as t } from "../../components/MetricsCard.js";
|
|
3
|
-
import { formatDate as n, formatEnumLabel as r, formatMoney as i, formatNumber as a, formatUnit as
|
|
4
|
-
import { StatusBadge as
|
|
5
|
-
import { DataTable as
|
|
6
|
-
import { ErrorView as
|
|
7
|
-
import { EmptyState as
|
|
8
|
-
import { useTheAssets as
|
|
9
|
-
import { useCursorPager as
|
|
3
|
+
import { formatDate as n, formatEnumLabel as r, formatMoney as i, formatNumber as a, formatUnit as o, formatVolume as s, toBackendDate as ee } from "../../utils/formatters.js";
|
|
4
|
+
import { StatusBadge as te } from "../../components/StatusBadge.js";
|
|
5
|
+
import { DataTable as ne } from "../../components/DataTable.js";
|
|
6
|
+
import { ErrorView as re, LoadingView as ie } from "../../components/StateViews.js";
|
|
7
|
+
import { EmptyState as ae } from "../../components/EmptyState.js";
|
|
8
|
+
import { useTheAssets as oe, useTheCreateInventoryLot as se, useTheInventoryLots as c, useTheSetInventoryLotStatus as ce } from "../../hooks/useTheGlobalFuelApi.js";
|
|
9
|
+
import { useCursorPager as le } from "../../hooks/useCursorPager.js";
|
|
10
|
+
import { useNotify as ue } from "../../hooks/useNotify.js";
|
|
10
11
|
import "../../hooks/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
12
|
+
import { INVENTORY_TRANSITIONS as de, nextStatuses as fe } from "../../utils/transitions.js";
|
|
13
|
+
import { FilterTabs as pe } from "../../components/FilterTabs.js";
|
|
14
|
+
import { Pagination as me } from "../../components/Pagination.js";
|
|
13
15
|
import { useMemo as l, useState as u } from "react";
|
|
14
|
-
import { Boxes as d, Coins as f, Layers as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { Button as
|
|
16
|
+
import { Boxes as d, Coins as f, Layers as he, Plus as p, Warehouse as ge } from "lucide-react";
|
|
17
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
18
|
+
import { Button as _, Input as v, Label as y, ResponsiveDialog as _e, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as b, ResponsiveDialogHeader as x, ResponsiveDialogTitle as S, Select as C, SelectContent as w, SelectItem as T, SelectTrigger as E, SelectValue as D, Textarea as O } from "@burdenoff/fe-libs/ui";
|
|
17
19
|
//#region src/theglobalfuel/pages/inventory/InventoryPage.tsx
|
|
18
|
-
var
|
|
20
|
+
var k = [
|
|
19
21
|
{
|
|
20
22
|
value: "ALL",
|
|
21
23
|
label: "All"
|
|
@@ -40,13 +42,7 @@ var A = [
|
|
|
40
42
|
value: "WRITTEN_OFF",
|
|
41
43
|
label: "Written off"
|
|
42
44
|
}
|
|
43
|
-
], j = [
|
|
44
|
-
"AVAILABLE",
|
|
45
|
-
"RESERVED",
|
|
46
|
-
"IN_TRANSIT",
|
|
47
|
-
"CONSUMED",
|
|
48
|
-
"WRITTEN_OFF"
|
|
49
|
-
], M = [
|
|
45
|
+
], A = "__none__", j = [
|
|
50
46
|
"CRUDE_OIL",
|
|
51
47
|
"NATURAL_GAS",
|
|
52
48
|
"LNG",
|
|
@@ -60,7 +56,7 @@ var A = [
|
|
|
60
56
|
"GOLD",
|
|
61
57
|
"LITHIUM",
|
|
62
58
|
"RARE_EARTH"
|
|
63
|
-
],
|
|
59
|
+
], M = [
|
|
64
60
|
"BARRELS",
|
|
65
61
|
"CUBIC_METERS",
|
|
66
62
|
"TONNES",
|
|
@@ -68,7 +64,7 @@ var A = [
|
|
|
68
64
|
"MWH",
|
|
69
65
|
"GJ",
|
|
70
66
|
"MCF"
|
|
71
|
-
],
|
|
67
|
+
], N = 25, P = (e) => e.quantity * e.unitValue, F = {
|
|
72
68
|
lotCode: "",
|
|
73
69
|
commodity: "CRUDE_OIL",
|
|
74
70
|
assetId: "",
|
|
@@ -81,49 +77,55 @@ var A = [
|
|
|
81
77
|
producedAt: "",
|
|
82
78
|
notes: ""
|
|
83
79
|
};
|
|
84
|
-
function
|
|
85
|
-
let [
|
|
86
|
-
status:
|
|
87
|
-
commodity:
|
|
80
|
+
function I() {
|
|
81
|
+
let [I, be] = u("ALL"), [L, xe] = u("ALL"), R = le(), [Se, z] = u(!1), [B, V] = u(F), [H, U] = u(null), [Ce, W] = u(null), G = ue(), { data: K, isLoading: we, isError: Te, refetch: Ee } = c({
|
|
82
|
+
status: I === "ALL" ? void 0 : I,
|
|
83
|
+
commodity: L === "ALL" ? void 0 : L,
|
|
88
84
|
pagination: {
|
|
89
|
-
limit:
|
|
90
|
-
cursor:
|
|
85
|
+
limit: N,
|
|
86
|
+
cursor: R.cursor
|
|
91
87
|
}
|
|
92
|
-
}), q = c({ pagination: { limit: 200 } }), J =
|
|
88
|
+
}), q = c({ pagination: { limit: 200 } }), J = oe({ pagination: { limit: 200 } }), Y = se(), De = ce(), X = l(() => K?.items ?? [], [K]), Z = l(() => {
|
|
93
89
|
let e = {};
|
|
94
90
|
for (let t of J.data?.items ?? []) e[t.id] = t.code ? `${t.name} · ${t.code}` : t.name;
|
|
95
91
|
return e;
|
|
96
92
|
}, [J.data]), Q = l(() => {
|
|
97
|
-
let e = q.data?.items ?? [], t = e.filter((e) => e.status === "AVAILABLE"), n =
|
|
93
|
+
let e = q.data?.items ?? [], t = e.filter((e) => e.status === "AVAILABLE"), n = /* @__PURE__ */ new Map();
|
|
94
|
+
for (let e of t) n.set(e.unit, (n.get(e.unit) ?? 0) + (e.quantity ?? 0));
|
|
95
|
+
let r = null, i = 0;
|
|
96
|
+
for (let [e, t] of n) t > i && (i = t, r = e);
|
|
97
|
+
let a = /* @__PURE__ */ new Map();
|
|
98
98
|
for (let e of t) {
|
|
99
99
|
let t = e.currency || "USD";
|
|
100
|
-
|
|
100
|
+
a.set(t, (a.get(t) ?? 0) + P(e));
|
|
101
101
|
}
|
|
102
|
-
let
|
|
103
|
-
for (let [e, t] of
|
|
102
|
+
let o = "USD", s = 0;
|
|
103
|
+
for (let [e, t] of a) t > s && (s = t, o = e);
|
|
104
104
|
return {
|
|
105
105
|
totalLots: e.length,
|
|
106
106
|
availableCount: t.length,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
qtyByUnit: n,
|
|
108
|
+
topUnit: r,
|
|
109
|
+
topUnitQty: i,
|
|
110
|
+
topCurrency: o,
|
|
111
|
+
topValue: s,
|
|
112
|
+
otherCurrencies: Math.max(0, a.size - 1)
|
|
111
113
|
};
|
|
112
|
-
}, [q.data]),
|
|
114
|
+
}, [q.data]), Oe = [
|
|
113
115
|
{
|
|
114
116
|
key: "lotCode",
|
|
115
117
|
header: "Lot",
|
|
116
|
-
render: (e) => /* @__PURE__ */
|
|
118
|
+
render: (e) => /* @__PURE__ */ g("div", {
|
|
117
119
|
className: "flex items-center gap-3",
|
|
118
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ h("div", {
|
|
119
121
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent",
|
|
120
|
-
children: /* @__PURE__ */
|
|
121
|
-
}), /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ h(d, { className: "h-4 w-4" })
|
|
123
|
+
}), /* @__PURE__ */ g("div", {
|
|
122
124
|
className: "min-w-0",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ h("p", {
|
|
124
126
|
className: "truncate font-semibold text-text-primary",
|
|
125
127
|
children: e.lotCode
|
|
126
|
-
}), e.assetId && Z[e.assetId] && /* @__PURE__ */
|
|
128
|
+
}), e.assetId && Z[e.assetId] && /* @__PURE__ */ h("p", {
|
|
127
129
|
className: "truncate text-xs text-text-tertiary",
|
|
128
130
|
children: Z[e.assetId]
|
|
129
131
|
})]
|
|
@@ -134,7 +136,7 @@ function L() {
|
|
|
134
136
|
key: "commodity",
|
|
135
137
|
header: "Commodity",
|
|
136
138
|
hideOnMobile: !0,
|
|
137
|
-
render: (e) => /* @__PURE__ */
|
|
139
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
138
140
|
className: "text-text-secondary",
|
|
139
141
|
children: r(e.commodity)
|
|
140
142
|
})
|
|
@@ -144,9 +146,9 @@ function L() {
|
|
|
144
146
|
header: "Quantity",
|
|
145
147
|
align: "right",
|
|
146
148
|
sortValue: (e) => e.quantity,
|
|
147
|
-
render: (e) => /* @__PURE__ */
|
|
149
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
148
150
|
className: "tabular-nums text-text-primary",
|
|
149
|
-
children:
|
|
151
|
+
children: s(e.quantity, e.unit)
|
|
150
152
|
})
|
|
151
153
|
},
|
|
152
154
|
{
|
|
@@ -155,10 +157,10 @@ function L() {
|
|
|
155
157
|
align: "right",
|
|
156
158
|
hideOnMobile: !0,
|
|
157
159
|
sortValue: (e) => e.grade ?? -1,
|
|
158
|
-
render: (e) => e.grade == null ? /* @__PURE__ */
|
|
160
|
+
render: (e) => e.grade == null ? /* @__PURE__ */ h("span", {
|
|
159
161
|
className: "text-text-tertiary",
|
|
160
162
|
children: "—"
|
|
161
|
-
}) : /* @__PURE__ */
|
|
163
|
+
}) : /* @__PURE__ */ h("span", {
|
|
162
164
|
className: "tabular-nums text-text-secondary",
|
|
163
165
|
children: a(e.grade)
|
|
164
166
|
})
|
|
@@ -166,16 +168,16 @@ function L() {
|
|
|
166
168
|
{
|
|
167
169
|
key: "status",
|
|
168
170
|
header: "Status",
|
|
169
|
-
render: (e) => /* @__PURE__ */
|
|
171
|
+
render: (e) => /* @__PURE__ */ h(te, { status: e.status })
|
|
170
172
|
},
|
|
171
173
|
{
|
|
172
174
|
key: "location",
|
|
173
175
|
header: "Location",
|
|
174
176
|
hideOnMobile: !0,
|
|
175
|
-
render: (e) => e.location ? /* @__PURE__ */
|
|
177
|
+
render: (e) => e.location ? /* @__PURE__ */ h("span", {
|
|
176
178
|
className: "text-text-secondary",
|
|
177
179
|
children: e.location
|
|
178
|
-
}) : /* @__PURE__ */
|
|
180
|
+
}) : /* @__PURE__ */ h("span", {
|
|
179
181
|
className: "text-text-tertiary",
|
|
180
182
|
children: "—"
|
|
181
183
|
})
|
|
@@ -185,10 +187,10 @@ function L() {
|
|
|
185
187
|
header: "Value",
|
|
186
188
|
align: "right",
|
|
187
189
|
hideOnMobile: !0,
|
|
188
|
-
sortValue: (e) =>
|
|
189
|
-
render: (e) => /* @__PURE__ */
|
|
190
|
+
sortValue: (e) => P(e),
|
|
191
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
190
192
|
className: "tabular-nums text-text-secondary",
|
|
191
|
-
children: i(
|
|
193
|
+
children: i(P(e), e.currency)
|
|
192
194
|
})
|
|
193
195
|
},
|
|
194
196
|
{
|
|
@@ -197,7 +199,7 @@ function L() {
|
|
|
197
199
|
align: "right",
|
|
198
200
|
hideOnMobile: !0,
|
|
199
201
|
sortValue: (e) => e.producedAt ? new Date(e.producedAt).getTime() : 0,
|
|
200
|
-
render: (e) => /* @__PURE__ */
|
|
202
|
+
render: (e) => /* @__PURE__ */ h("span", {
|
|
201
203
|
className: "text-text-tertiary",
|
|
202
204
|
children: n(e.producedAt)
|
|
203
205
|
})
|
|
@@ -206,60 +208,83 @@ function L() {
|
|
|
206
208
|
key: "setStatus",
|
|
207
209
|
header: "",
|
|
208
210
|
align: "right",
|
|
209
|
-
render: (e) =>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
render: (e) => {
|
|
212
|
+
let t = fe(de, e.status), n = t.length === 0, i = Ce === e.id;
|
|
213
|
+
return /* @__PURE__ */ g(C, {
|
|
214
|
+
value: e.status,
|
|
215
|
+
disabled: n || i,
|
|
216
|
+
onValueChange: (t) => {
|
|
217
|
+
W(e.id), De.mutate({
|
|
218
|
+
id: e.id,
|
|
219
|
+
status: t
|
|
220
|
+
}, {
|
|
221
|
+
onSuccess: () => G.success("Lot status updated"),
|
|
222
|
+
onError: (e) => G.fromError(e),
|
|
223
|
+
onSettled: () => W(null)
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
children: [/* @__PURE__ */ h(E, {
|
|
227
|
+
className: "h-8 w-36",
|
|
228
|
+
"aria-label": `Change status for lot ${e.lotCode}`,
|
|
229
|
+
children: /* @__PURE__ */ h(D, {})
|
|
230
|
+
}), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, {
|
|
231
|
+
value: e.status,
|
|
232
|
+
disabled: !0,
|
|
233
|
+
children: r(e.status)
|
|
234
|
+
}), t.map((e) => /* @__PURE__ */ h(T, {
|
|
235
|
+
value: e,
|
|
236
|
+
children: r(e)
|
|
237
|
+
}, e))] })]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
224
240
|
}
|
|
225
241
|
], $ = () => {
|
|
226
|
-
|
|
227
|
-
},
|
|
228
|
-
if (!
|
|
229
|
-
|
|
242
|
+
V(F), U(null);
|
|
243
|
+
}, ke = async () => {
|
|
244
|
+
if (!B.lotCode.trim()) {
|
|
245
|
+
U("Lot code is required.");
|
|
230
246
|
return;
|
|
231
247
|
}
|
|
232
|
-
|
|
233
|
-
|
|
248
|
+
let e = Number(B.quantity);
|
|
249
|
+
if (!B.quantity || Number.isNaN(e) || e <= 0) {
|
|
250
|
+
U("Enter a quantity greater than zero."), G.error("Enter a quantity greater than zero.");
|
|
234
251
|
return;
|
|
235
252
|
}
|
|
236
|
-
|
|
253
|
+
U(null);
|
|
237
254
|
try {
|
|
238
255
|
await Y.mutateAsync({
|
|
239
|
-
lotCode:
|
|
240
|
-
commodity:
|
|
241
|
-
assetId:
|
|
242
|
-
quantity:
|
|
243
|
-
unit:
|
|
244
|
-
grade:
|
|
245
|
-
location:
|
|
246
|
-
unitValue:
|
|
247
|
-
currency:
|
|
248
|
-
producedAt:
|
|
249
|
-
notes:
|
|
250
|
-
}),
|
|
256
|
+
lotCode: B.lotCode.trim(),
|
|
257
|
+
commodity: B.commodity,
|
|
258
|
+
assetId: B.assetId || null,
|
|
259
|
+
quantity: e,
|
|
260
|
+
unit: B.unit,
|
|
261
|
+
grade: B.grade ? Number(B.grade) : null,
|
|
262
|
+
location: B.location.trim() || null,
|
|
263
|
+
unitValue: B.unitValue ? Number(B.unitValue) : null,
|
|
264
|
+
currency: B.currency.trim() || "USD",
|
|
265
|
+
producedAt: ee(B.producedAt) ?? null,
|
|
266
|
+
notes: B.notes.trim() || null
|
|
267
|
+
}), G.success("Inventory lot created"), z(!1), $();
|
|
251
268
|
} catch (e) {
|
|
252
|
-
|
|
269
|
+
U(e instanceof Error ? e.message : "Failed to create inventory lot."), G.fromError(e);
|
|
253
270
|
}
|
|
254
|
-
},
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
Q.availableCount
|
|
261
|
-
|
|
262
|
-
|
|
271
|
+
}, Ae = (() => {
|
|
272
|
+
if (q.data) {
|
|
273
|
+
if (Q.qtyByUnit.size > 1) return /* @__PURE__ */ h("p", {
|
|
274
|
+
className: "text-xs text-text-tertiary",
|
|
275
|
+
children: [...Q.qtyByUnit.entries()].sort((e, t) => t[1] - e[1]).map(([e, t]) => s(t, e)).join(" · ")
|
|
276
|
+
});
|
|
277
|
+
if (Q.availableCount > 0) return /* @__PURE__ */ g("p", {
|
|
278
|
+
className: "text-xs text-text-tertiary",
|
|
279
|
+
children: [
|
|
280
|
+
"across ",
|
|
281
|
+
Q.availableCount,
|
|
282
|
+
" available ",
|
|
283
|
+
Q.availableCount === 1 ? "lot" : "lots"
|
|
284
|
+
]
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
})(), je = q.data && Q.otherCurrencies > 0 ? /* @__PURE__ */ g("p", {
|
|
263
288
|
className: "text-xs text-text-tertiary",
|
|
264
289
|
children: [
|
|
265
290
|
"in ",
|
|
@@ -271,210 +296,216 @@ function L() {
|
|
|
271
296
|
Q.otherCurrencies === 1 ? "currency" : "currencies"
|
|
272
297
|
]
|
|
273
298
|
}) : void 0;
|
|
274
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ g(e, {
|
|
275
300
|
title: "Inventory",
|
|
276
301
|
description: "Commodity inventory lots — on-hand quantity, grade, location & book value across the portfolio.",
|
|
277
|
-
actions: /* @__PURE__ */
|
|
278
|
-
onClick: () =>
|
|
279
|
-
children: [/* @__PURE__ */
|
|
302
|
+
actions: /* @__PURE__ */ g(_, {
|
|
303
|
+
onClick: () => z(!0),
|
|
304
|
+
children: [/* @__PURE__ */ h(p, { className: "mr-1.5 h-4 w-4" }), " New lot"]
|
|
280
305
|
}),
|
|
281
306
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ g("div", {
|
|
283
308
|
className: "mb-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
284
309
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
icon: /* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ h(t, {
|
|
311
|
+
icon: /* @__PURE__ */ h(ge, { className: "h-5 w-5" }),
|
|
287
312
|
value: q.data ? a(Q.totalLots) : "—",
|
|
288
313
|
label: "Inventory lots",
|
|
289
314
|
featured: !0,
|
|
290
|
-
footer: q.data ? /* @__PURE__ */
|
|
315
|
+
footer: q.data ? /* @__PURE__ */ g("p", {
|
|
291
316
|
className: "text-xs text-text-tertiary",
|
|
292
317
|
children: [a(Q.availableCount), " available"]
|
|
293
318
|
}) : void 0
|
|
294
319
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
icon: /* @__PURE__ */
|
|
297
|
-
value: q.data ?
|
|
320
|
+
/* @__PURE__ */ h(t, {
|
|
321
|
+
icon: /* @__PURE__ */ h(he, { className: "h-5 w-5" }),
|
|
322
|
+
value: q.data ? s(Q.topUnitQty, Q.topUnit) : "—",
|
|
298
323
|
label: "On-hand quantity",
|
|
299
324
|
accent: "success",
|
|
300
|
-
footer:
|
|
325
|
+
footer: Ae
|
|
301
326
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
icon: /* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ h(t, {
|
|
328
|
+
icon: /* @__PURE__ */ h(f, { className: "h-5 w-5" }),
|
|
304
329
|
value: q.data ? i(Q.topValue, Q.topCurrency) : "—",
|
|
305
330
|
label: "Inventory value",
|
|
306
|
-
footer:
|
|
331
|
+
footer: je
|
|
307
332
|
})
|
|
308
333
|
]
|
|
309
334
|
}),
|
|
310
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ g("div", {
|
|
311
336
|
className: "mb-5 flex flex-wrap items-center gap-3",
|
|
312
|
-
children: [/* @__PURE__ */
|
|
313
|
-
options:
|
|
314
|
-
value:
|
|
337
|
+
children: [/* @__PURE__ */ h(pe, {
|
|
338
|
+
options: k,
|
|
339
|
+
value: I,
|
|
315
340
|
onChange: (e) => {
|
|
316
|
-
|
|
341
|
+
be(e), R.reset();
|
|
317
342
|
}
|
|
318
|
-
}), /* @__PURE__ */
|
|
319
|
-
value:
|
|
343
|
+
}), /* @__PURE__ */ g(C, {
|
|
344
|
+
value: L,
|
|
320
345
|
onValueChange: (e) => {
|
|
321
|
-
|
|
346
|
+
xe(e), R.reset();
|
|
322
347
|
},
|
|
323
|
-
children: [/* @__PURE__ */
|
|
348
|
+
children: [/* @__PURE__ */ h(E, {
|
|
324
349
|
className: "w-48",
|
|
325
|
-
|
|
326
|
-
|
|
350
|
+
"aria-label": "Filter by commodity",
|
|
351
|
+
children: /* @__PURE__ */ h(D, { placeholder: "All commodities" })
|
|
352
|
+
}), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, {
|
|
327
353
|
value: "ALL",
|
|
328
354
|
children: "All commodities"
|
|
329
|
-
}),
|
|
355
|
+
}), j.map((e) => /* @__PURE__ */ h(T, {
|
|
330
356
|
value: e,
|
|
331
357
|
children: r(e)
|
|
332
358
|
}, e))] })]
|
|
333
359
|
})]
|
|
334
360
|
}),
|
|
335
|
-
|
|
361
|
+
we ? /* @__PURE__ */ h(ie, { label: "Loading inventory…" }) : Te ? /* @__PURE__ */ h(re, {
|
|
336
362
|
message: "Couldn't load inventory lots.",
|
|
337
|
-
onRetry: () =>
|
|
338
|
-
}) : X.length === 0 ? /* @__PURE__ */
|
|
363
|
+
onRetry: () => Ee()
|
|
364
|
+
}) : X.length === 0 ? /* @__PURE__ */ h(ae, {
|
|
339
365
|
illustration: "empty-data",
|
|
340
|
-
icon: /* @__PURE__ */
|
|
366
|
+
icon: /* @__PURE__ */ h(d, { className: "h-10 w-10" }),
|
|
341
367
|
title: "No inventory lots yet",
|
|
342
|
-
description:
|
|
343
|
-
action: /* @__PURE__ */
|
|
344
|
-
onClick: () =>
|
|
345
|
-
children: [/* @__PURE__ */
|
|
368
|
+
description: I === "ALL" && L === "ALL" ? "Create your first inventory lot to track on-hand commodity quantity, grade and value." : "No lots match these filters.",
|
|
369
|
+
action: /* @__PURE__ */ g(_, {
|
|
370
|
+
onClick: () => z(!0),
|
|
371
|
+
children: [/* @__PURE__ */ h(p, { className: "mr-1.5 h-4 w-4" }), " New lot"]
|
|
346
372
|
})
|
|
347
|
-
}) : /* @__PURE__ */
|
|
348
|
-
columns:
|
|
373
|
+
}) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ne, {
|
|
374
|
+
columns: Oe,
|
|
349
375
|
rows: X,
|
|
350
376
|
rowKey: (e) => e.id
|
|
351
|
-
}), /* @__PURE__ */
|
|
352
|
-
page:
|
|
353
|
-
pageSize:
|
|
377
|
+
}), /* @__PURE__ */ h(me, {
|
|
378
|
+
page: R.page,
|
|
379
|
+
pageSize: N,
|
|
354
380
|
itemCount: X.length,
|
|
355
381
|
hasMore: K?.pageInfo?.hasMore ?? !1,
|
|
356
|
-
onPageChange: (e) =>
|
|
382
|
+
onPageChange: (e) => R.onPageChange(e, K?.pageInfo?.cursor)
|
|
357
383
|
})] }),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
open:
|
|
384
|
+
/* @__PURE__ */ h(_e, {
|
|
385
|
+
open: Se,
|
|
360
386
|
onOpenChange: (e) => {
|
|
361
|
-
|
|
387
|
+
z(e), e || $();
|
|
362
388
|
},
|
|
363
|
-
children: /* @__PURE__ */
|
|
364
|
-
|
|
365
|
-
|
|
389
|
+
children: /* @__PURE__ */ g(ve, { children: [/* @__PURE__ */ g(x, { children: [/* @__PURE__ */ h(S, { children: "New inventory lot" }), /* @__PURE__ */ h(ye, { children: "Register an on-hand quantity of a commodity — optionally attributed to a producing asset." })] }), /* @__PURE__ */ g("form", {
|
|
390
|
+
onSubmit: (e) => {
|
|
391
|
+
e.preventDefault(), ke();
|
|
392
|
+
},
|
|
393
|
+
children: [/* @__PURE__ */ g("div", {
|
|
366
394
|
className: "grid gap-4 py-2",
|
|
367
395
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ g("div", {
|
|
369
397
|
className: "grid gap-2 sm:grid-cols-2",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ g("div", {
|
|
371
399
|
className: "grid gap-1.5",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ h(y, {
|
|
373
401
|
htmlFor: "lotCode",
|
|
374
402
|
children: "Lot code *"
|
|
375
|
-
}), /* @__PURE__ */
|
|
403
|
+
}), /* @__PURE__ */ h(v, {
|
|
376
404
|
id: "lotCode",
|
|
377
|
-
value:
|
|
378
|
-
onChange: (e) =>
|
|
379
|
-
...
|
|
405
|
+
value: B.lotCode,
|
|
406
|
+
onChange: (e) => V({
|
|
407
|
+
...B,
|
|
380
408
|
lotCode: e.target.value
|
|
381
409
|
}),
|
|
382
410
|
placeholder: "LOT-2026-0042"
|
|
383
411
|
})]
|
|
384
|
-
}), /* @__PURE__ */
|
|
412
|
+
}), /* @__PURE__ */ g("div", {
|
|
385
413
|
className: "grid gap-1.5",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ h(y, {
|
|
387
415
|
htmlFor: "commodity",
|
|
388
416
|
children: "Commodity *"
|
|
389
|
-
}), /* @__PURE__ */
|
|
390
|
-
value:
|
|
391
|
-
onValueChange: (e) =>
|
|
392
|
-
...
|
|
417
|
+
}), /* @__PURE__ */ g(C, {
|
|
418
|
+
value: B.commodity,
|
|
419
|
+
onValueChange: (e) => V({
|
|
420
|
+
...B,
|
|
393
421
|
commodity: e
|
|
394
422
|
}),
|
|
395
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ h(E, {
|
|
396
424
|
id: "commodity",
|
|
397
|
-
children: /* @__PURE__ */
|
|
398
|
-
}), /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ h(D, {})
|
|
426
|
+
}), /* @__PURE__ */ h(w, { children: j.map((e) => /* @__PURE__ */ h(T, {
|
|
399
427
|
value: e,
|
|
400
428
|
children: r(e)
|
|
401
429
|
}, e)) })]
|
|
402
430
|
})]
|
|
403
431
|
})]
|
|
404
432
|
}),
|
|
405
|
-
/* @__PURE__ */
|
|
433
|
+
/* @__PURE__ */ g("div", {
|
|
406
434
|
className: "grid gap-1.5",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ h(y, {
|
|
408
436
|
htmlFor: "assetId",
|
|
409
437
|
children: "Produced by asset"
|
|
410
|
-
}), /* @__PURE__ */
|
|
411
|
-
value:
|
|
412
|
-
onValueChange: (e) =>
|
|
413
|
-
...
|
|
414
|
-
assetId: e
|
|
438
|
+
}), /* @__PURE__ */ g(C, {
|
|
439
|
+
value: B.assetId || A,
|
|
440
|
+
onValueChange: (e) => V({
|
|
441
|
+
...B,
|
|
442
|
+
assetId: e === A ? "" : e
|
|
415
443
|
}),
|
|
416
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ h(E, {
|
|
417
445
|
id: "assetId",
|
|
418
|
-
children: /* @__PURE__ */
|
|
419
|
-
}), /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ h(D, { placeholder: "Optional — link to a producing asset" })
|
|
447
|
+
}), /* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, {
|
|
448
|
+
value: A,
|
|
449
|
+
children: "None"
|
|
450
|
+
}), Object.entries(Z).map(([e, t]) => /* @__PURE__ */ h(T, {
|
|
420
451
|
value: e,
|
|
421
452
|
children: t
|
|
422
|
-
}, e)) })]
|
|
453
|
+
}, e))] })]
|
|
423
454
|
})]
|
|
424
455
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ g("div", {
|
|
426
457
|
className: "grid gap-2 sm:grid-cols-3",
|
|
427
458
|
children: [
|
|
428
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ g("div", {
|
|
429
460
|
className: "grid gap-1.5",
|
|
430
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ h(y, {
|
|
431
462
|
htmlFor: "quantity",
|
|
432
463
|
children: "Quantity *"
|
|
433
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ h(v, {
|
|
434
465
|
id: "quantity",
|
|
435
466
|
type: "number",
|
|
436
467
|
min: "0",
|
|
437
468
|
step: "any",
|
|
438
|
-
value:
|
|
439
|
-
onChange: (e) =>
|
|
440
|
-
...
|
|
469
|
+
value: B.quantity,
|
|
470
|
+
onChange: (e) => V({
|
|
471
|
+
...B,
|
|
441
472
|
quantity: e.target.value
|
|
442
473
|
}),
|
|
443
474
|
placeholder: "120000"
|
|
444
475
|
})]
|
|
445
476
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
477
|
+
/* @__PURE__ */ g("div", {
|
|
447
478
|
className: "grid gap-1.5",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
479
|
+
children: [/* @__PURE__ */ h(y, {
|
|
449
480
|
htmlFor: "unit",
|
|
450
481
|
children: "Unit"
|
|
451
|
-
}), /* @__PURE__ */
|
|
452
|
-
value:
|
|
453
|
-
onValueChange: (e) =>
|
|
454
|
-
...
|
|
482
|
+
}), /* @__PURE__ */ g(C, {
|
|
483
|
+
value: B.unit,
|
|
484
|
+
onValueChange: (e) => V({
|
|
485
|
+
...B,
|
|
455
486
|
unit: e
|
|
456
487
|
}),
|
|
457
|
-
children: [/* @__PURE__ */
|
|
488
|
+
children: [/* @__PURE__ */ h(E, {
|
|
458
489
|
id: "unit",
|
|
459
|
-
children: /* @__PURE__ */
|
|
460
|
-
}), /* @__PURE__ */
|
|
490
|
+
children: /* @__PURE__ */ h(D, {})
|
|
491
|
+
}), /* @__PURE__ */ h(w, { children: M.map((e) => /* @__PURE__ */ h(T, {
|
|
461
492
|
value: e,
|
|
462
|
-
children:
|
|
493
|
+
children: o(e)
|
|
463
494
|
}, e)) })]
|
|
464
495
|
})]
|
|
465
496
|
}),
|
|
466
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ g("div", {
|
|
467
498
|
className: "grid gap-1.5",
|
|
468
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: [/* @__PURE__ */ h(y, {
|
|
469
500
|
htmlFor: "grade",
|
|
470
501
|
children: "Grade"
|
|
471
|
-
}), /* @__PURE__ */
|
|
502
|
+
}), /* @__PURE__ */ h(v, {
|
|
472
503
|
id: "grade",
|
|
473
504
|
type: "number",
|
|
474
505
|
step: "any",
|
|
475
|
-
value:
|
|
476
|
-
onChange: (e) =>
|
|
477
|
-
...
|
|
506
|
+
value: B.grade,
|
|
507
|
+
onChange: (e) => V({
|
|
508
|
+
...B,
|
|
478
509
|
grade: e.target.value
|
|
479
510
|
}),
|
|
480
511
|
placeholder: "0.32"
|
|
@@ -482,111 +513,113 @@ function L() {
|
|
|
482
513
|
})
|
|
483
514
|
]
|
|
484
515
|
}),
|
|
485
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ g("div", {
|
|
486
517
|
className: "grid gap-2 sm:grid-cols-3",
|
|
487
518
|
children: [
|
|
488
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ g("div", {
|
|
489
520
|
className: "grid gap-1.5",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
521
|
+
children: [/* @__PURE__ */ h(y, {
|
|
491
522
|
htmlFor: "unitValue",
|
|
492
523
|
children: "Unit value"
|
|
493
|
-
}), /* @__PURE__ */
|
|
524
|
+
}), /* @__PURE__ */ h(v, {
|
|
494
525
|
id: "unitValue",
|
|
495
526
|
type: "number",
|
|
496
527
|
min: "0",
|
|
497
528
|
step: "any",
|
|
498
|
-
value:
|
|
499
|
-
onChange: (e) =>
|
|
500
|
-
...
|
|
529
|
+
value: B.unitValue,
|
|
530
|
+
onChange: (e) => V({
|
|
531
|
+
...B,
|
|
501
532
|
unitValue: e.target.value
|
|
502
533
|
}),
|
|
503
534
|
placeholder: "82.50"
|
|
504
535
|
})]
|
|
505
536
|
}),
|
|
506
|
-
/* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ g("div", {
|
|
507
538
|
className: "grid gap-1.5",
|
|
508
|
-
children: [/* @__PURE__ */
|
|
539
|
+
children: [/* @__PURE__ */ h(y, {
|
|
509
540
|
htmlFor: "currency",
|
|
510
541
|
children: "Currency"
|
|
511
|
-
}), /* @__PURE__ */
|
|
542
|
+
}), /* @__PURE__ */ h(v, {
|
|
512
543
|
id: "currency",
|
|
513
|
-
value:
|
|
514
|
-
onChange: (e) =>
|
|
515
|
-
...
|
|
544
|
+
value: B.currency,
|
|
545
|
+
onChange: (e) => V({
|
|
546
|
+
...B,
|
|
516
547
|
currency: e.target.value
|
|
517
548
|
}),
|
|
518
549
|
placeholder: "USD"
|
|
519
550
|
})]
|
|
520
551
|
}),
|
|
521
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ g("div", {
|
|
522
553
|
className: "grid gap-1.5",
|
|
523
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ h(y, {
|
|
524
555
|
htmlFor: "producedAt",
|
|
525
556
|
children: "Produced at"
|
|
526
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ h(v, {
|
|
527
558
|
id: "producedAt",
|
|
528
559
|
type: "date",
|
|
529
|
-
value:
|
|
530
|
-
onChange: (e) =>
|
|
531
|
-
...
|
|
560
|
+
value: B.producedAt,
|
|
561
|
+
onChange: (e) => V({
|
|
562
|
+
...B,
|
|
532
563
|
producedAt: e.target.value
|
|
533
564
|
})
|
|
534
565
|
})]
|
|
535
566
|
})
|
|
536
567
|
]
|
|
537
568
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ g("div", {
|
|
539
570
|
className: "grid gap-1.5",
|
|
540
|
-
children: [/* @__PURE__ */
|
|
571
|
+
children: [/* @__PURE__ */ h(y, {
|
|
541
572
|
htmlFor: "location",
|
|
542
573
|
children: "Location"
|
|
543
|
-
}), /* @__PURE__ */
|
|
574
|
+
}), /* @__PURE__ */ h(v, {
|
|
544
575
|
id: "location",
|
|
545
|
-
value:
|
|
546
|
-
onChange: (e) =>
|
|
547
|
-
...
|
|
576
|
+
value: B.location,
|
|
577
|
+
onChange: (e) => V({
|
|
578
|
+
...B,
|
|
548
579
|
location: e.target.value
|
|
549
580
|
}),
|
|
550
581
|
placeholder: "Rotterdam Tank Farm 3"
|
|
551
582
|
})]
|
|
552
583
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
584
|
+
/* @__PURE__ */ g("div", {
|
|
554
585
|
className: "grid gap-1.5",
|
|
555
|
-
children: [/* @__PURE__ */
|
|
586
|
+
children: [/* @__PURE__ */ h(y, {
|
|
556
587
|
htmlFor: "notes",
|
|
557
588
|
children: "Notes"
|
|
558
|
-
}), /* @__PURE__ */
|
|
589
|
+
}), /* @__PURE__ */ h(O, {
|
|
559
590
|
id: "notes",
|
|
560
591
|
rows: 2,
|
|
561
|
-
value:
|
|
562
|
-
onChange: (e) =>
|
|
563
|
-
...
|
|
592
|
+
value: B.notes,
|
|
593
|
+
onChange: (e) => V({
|
|
594
|
+
...B,
|
|
564
595
|
notes: e.target.value
|
|
565
596
|
}),
|
|
566
597
|
placeholder: "Optional context about this lot."
|
|
567
598
|
})]
|
|
568
599
|
}),
|
|
569
|
-
|
|
600
|
+
H && /* @__PURE__ */ h("p", {
|
|
570
601
|
className: "text-sm text-status-error-text",
|
|
571
|
-
children:
|
|
602
|
+
children: H
|
|
572
603
|
})
|
|
573
604
|
]
|
|
574
|
-
}),
|
|
575
|
-
|
|
605
|
+
}), /* @__PURE__ */ g(b, { children: [/* @__PURE__ */ h(_, {
|
|
606
|
+
type: "button",
|
|
576
607
|
variant: "outline",
|
|
577
|
-
onClick: () =>
|
|
608
|
+
onClick: () => {
|
|
609
|
+
z(!1), $();
|
|
610
|
+
},
|
|
578
611
|
children: "Cancel"
|
|
579
|
-
}), /* @__PURE__ */ _
|
|
580
|
-
|
|
612
|
+
}), /* @__PURE__ */ h(_, {
|
|
613
|
+
type: "submit",
|
|
581
614
|
disabled: Y.isPending,
|
|
582
615
|
children: Y.isPending ? "Creating…" : "Create lot"
|
|
583
|
-
})] })
|
|
584
|
-
] })
|
|
616
|
+
})] })]
|
|
617
|
+
})] })
|
|
585
618
|
})
|
|
586
619
|
]
|
|
587
620
|
});
|
|
588
621
|
}
|
|
589
622
|
//#endregion
|
|
590
|
-
export {
|
|
623
|
+
export { I as InventoryPage };
|
|
591
624
|
|
|
592
625
|
//# sourceMappingURL=InventoryPage.js.map
|