@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,22 @@
|
|
|
1
1
|
import { useTheGlobalFuel as e } from "../../context/TheGlobalFuelContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
3
|
import { MetricsCard as n } from "../../components/MetricsCard.js";
|
|
4
|
-
import { formatDate as r, formatEnumLabel as i, formatNumber as a, formatRelativeTime as ee, formatVolume as o } from "../../utils/formatters.js";
|
|
5
|
-
import { DataTable as
|
|
6
|
-
import { ErrorView as
|
|
4
|
+
import { formatDate as r, formatEnumLabel as i, formatNumber as a, formatRelativeTime as ee, formatVolume as o, toBackendDate as s } from "../../utils/formatters.js";
|
|
5
|
+
import { DataTable as c } from "../../components/DataTable.js";
|
|
6
|
+
import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
|
|
7
7
|
import { EmptyState as te } from "../../components/EmptyState.js";
|
|
8
8
|
import "../../context/index.js";
|
|
9
|
-
import { useTheAssets as
|
|
10
|
-
import { useCursorPager as
|
|
9
|
+
import { useTheAssets as ne, useTheProductionRecords as re, useTheRecordProduction as ie } from "../../hooks/useTheGlobalFuelApi.js";
|
|
10
|
+
import { useCursorPager as ae } from "../../hooks/useCursorPager.js";
|
|
11
|
+
import { useNotify as oe } from "../../hooks/useNotify.js";
|
|
11
12
|
import "../../hooks/index.js";
|
|
12
|
-
import { Pagination as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { BarChart3 as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { Button as
|
|
13
|
+
import { Pagination as se } from "../../components/Pagination.js";
|
|
14
|
+
import { useMemo as d, useState as f } from "react";
|
|
15
|
+
import { BarChart3 as p, Clock as m, Droplets as h, Gauge as g, Plus as _ } from "lucide-react";
|
|
16
|
+
import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
17
|
+
import { Button as x, Input as S, Label as C, ResponsiveDialog as ce, ResponsiveDialogContent as le, ResponsiveDialogDescription as ue, ResponsiveDialogFooter as de, ResponsiveDialogHeader as fe, ResponsiveDialogTitle as pe, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/theglobalfuel/pages/production/ProductionPage.tsx
|
|
18
|
-
var
|
|
19
|
+
var A = [
|
|
19
20
|
"BARRELS",
|
|
20
21
|
"CUBIC_METERS",
|
|
21
22
|
"TONNES",
|
|
@@ -23,32 +24,32 @@ var P = [
|
|
|
23
24
|
"MWH",
|
|
24
25
|
"GJ",
|
|
25
26
|
"MCF"
|
|
26
|
-
],
|
|
27
|
+
], j = 25, M = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), N = () => ({
|
|
27
28
|
assetId: "",
|
|
28
|
-
periodStart:
|
|
29
|
-
periodEnd:
|
|
29
|
+
periodStart: M(),
|
|
30
|
+
periodEnd: M(),
|
|
30
31
|
volume: "",
|
|
31
32
|
unit: "BARRELS",
|
|
32
33
|
grade: "",
|
|
33
34
|
downtimeHours: "",
|
|
34
35
|
notes: ""
|
|
35
36
|
});
|
|
36
|
-
function
|
|
37
|
-
let { navigateTo:
|
|
37
|
+
function P() {
|
|
38
|
+
let { navigateTo: M } = e(), P = oe(), [F, I] = f("ALL"), L = ae(), [R, z] = f(!1), [B, V] = f(N), [H, U] = f(null), W = ne({ pagination: { limit: 100 } }), G = d(() => {
|
|
38
39
|
let e = {};
|
|
39
|
-
for (let t of
|
|
40
|
+
for (let t of W.data?.items ?? []) e[t.id] = t.name;
|
|
40
41
|
return e;
|
|
41
|
-
}, [
|
|
42
|
-
assetId:
|
|
42
|
+
}, [W.data]), { data: K, isLoading: me, isError: he, refetch: ge } = re({
|
|
43
|
+
assetId: F === "ALL" ? void 0 : F,
|
|
43
44
|
pagination: {
|
|
44
|
-
limit:
|
|
45
|
-
cursor:
|
|
45
|
+
limit: j,
|
|
46
|
+
cursor: L.cursor
|
|
46
47
|
}
|
|
47
|
-
}),
|
|
48
|
+
}), q = ie(), J = d(() => K?.items ?? [], [K]), { volumeValue: _e, volumeFooter: Y, downtimeTotal: X } = d(() => {
|
|
48
49
|
let e = /* @__PURE__ */ new Map(), t = 0;
|
|
49
|
-
for (let n of
|
|
50
|
+
for (let n of J) e.set(n.unit, (e.get(n.unit) ?? 0) + n.volume), t += n.downtimeHours;
|
|
50
51
|
let n = [...e.entries()], r, i;
|
|
51
|
-
return n.length === 0 ? r = "—" : n.length === 1 ? r = o(n[0][1], n[0][0]) : (r = "Mixed units", i = /* @__PURE__ */
|
|
52
|
+
return n.length === 0 ? r = "—" : n.length === 1 ? r = o(n[0][1], n[0][0]) : (r = "Mixed units", i = /* @__PURE__ */ y("p", {
|
|
52
53
|
className: "text-xs tabular-nums text-text-tertiary",
|
|
53
54
|
children: n.map(([e, t]) => o(t, e)).join(" · ")
|
|
54
55
|
})), {
|
|
@@ -56,15 +57,15 @@ function R() {
|
|
|
56
57
|
volumeFooter: i,
|
|
57
58
|
downtimeTotal: t
|
|
58
59
|
};
|
|
59
|
-
}, [
|
|
60
|
+
}, [J]), ve = [
|
|
60
61
|
{
|
|
61
62
|
key: "asset",
|
|
62
63
|
header: "Asset",
|
|
63
|
-
render: (e) => /* @__PURE__ */
|
|
64
|
+
render: (e) => /* @__PURE__ */ y("div", {
|
|
64
65
|
className: "min-w-0",
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ y("p", {
|
|
66
67
|
className: "truncate font-semibold text-text-primary",
|
|
67
|
-
children:
|
|
68
|
+
children: G[e.assetId] ?? `${e.assetId.slice(0, 8)}…`
|
|
68
69
|
})
|
|
69
70
|
})
|
|
70
71
|
},
|
|
@@ -73,7 +74,7 @@ function R() {
|
|
|
73
74
|
header: "Period",
|
|
74
75
|
hideOnMobile: !0,
|
|
75
76
|
sortValue: (e) => new Date(e.periodStart).getTime(),
|
|
76
|
-
render: (e) => /* @__PURE__ */
|
|
77
|
+
render: (e) => /* @__PURE__ */ b("span", {
|
|
77
78
|
className: "text-text-secondary",
|
|
78
79
|
children: [
|
|
79
80
|
r(e.periodStart),
|
|
@@ -87,7 +88,7 @@ function R() {
|
|
|
87
88
|
header: "Volume",
|
|
88
89
|
align: "right",
|
|
89
90
|
sortValue: (e) => e.volume,
|
|
90
|
-
render: (e) => /* @__PURE__ */
|
|
91
|
+
render: (e) => /* @__PURE__ */ y("span", {
|
|
91
92
|
className: "tabular-nums font-medium text-text-primary",
|
|
92
93
|
children: o(e.volume, e.unit)
|
|
93
94
|
})
|
|
@@ -98,10 +99,10 @@ function R() {
|
|
|
98
99
|
align: "right",
|
|
99
100
|
hideOnMobile: !0,
|
|
100
101
|
sortValue: (e) => e.grade ?? 0,
|
|
101
|
-
render: (e) => e.grade == null ? /* @__PURE__ */
|
|
102
|
+
render: (e) => e.grade == null ? /* @__PURE__ */ y("span", {
|
|
102
103
|
className: "text-text-tertiary",
|
|
103
104
|
children: "—"
|
|
104
|
-
}) : /* @__PURE__ */
|
|
105
|
+
}) : /* @__PURE__ */ y("span", {
|
|
105
106
|
className: "tabular-nums text-text-secondary",
|
|
106
107
|
children: a(e.grade)
|
|
107
108
|
})
|
|
@@ -112,7 +113,7 @@ function R() {
|
|
|
112
113
|
align: "right",
|
|
113
114
|
hideOnMobile: !0,
|
|
114
115
|
sortValue: (e) => e.downtimeHours,
|
|
115
|
-
render: (e) => /* @__PURE__ */
|
|
116
|
+
render: (e) => /* @__PURE__ */ b("span", {
|
|
116
117
|
className: "tabular-nums text-text-secondary",
|
|
117
118
|
children: [a(e.downtimeHours), "h"]
|
|
118
119
|
})
|
|
@@ -122,300 +123,307 @@ function R() {
|
|
|
122
123
|
header: "Logged",
|
|
123
124
|
align: "right",
|
|
124
125
|
hideOnMobile: !0,
|
|
125
|
-
render: (e) => /* @__PURE__ */
|
|
126
|
+
render: (e) => /* @__PURE__ */ y("span", {
|
|
126
127
|
className: "text-text-tertiary",
|
|
127
128
|
children: ee(e.createdAt)
|
|
128
129
|
})
|
|
129
130
|
}
|
|
130
|
-
],
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
], Z = () => {
|
|
132
|
+
V(N()), U(null), z(!0);
|
|
133
|
+
}, Q = () => {
|
|
134
|
+
z(!1), V(N()), U(null);
|
|
135
|
+
}, ye = async () => {
|
|
136
|
+
if (!B.assetId) {
|
|
137
|
+
U("Select an asset.");
|
|
135
138
|
return;
|
|
136
139
|
}
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
let e = s(B.periodStart), t = s(B.periodEnd);
|
|
141
|
+
if (!e || !t) {
|
|
142
|
+
U("Period start and end are required.");
|
|
139
143
|
return;
|
|
140
144
|
}
|
|
141
|
-
if (new Date(
|
|
142
|
-
|
|
145
|
+
if (new Date(t).getTime() < new Date(e).getTime()) {
|
|
146
|
+
U("Period end must be on or after the period start.");
|
|
143
147
|
return;
|
|
144
148
|
}
|
|
145
|
-
|
|
146
|
-
|
|
149
|
+
let n = Number(B.volume);
|
|
150
|
+
if (!B.volume || Number.isNaN(n) || n <= 0) {
|
|
151
|
+
let e = "Volume must be greater than zero.";
|
|
152
|
+
U(e), P.error(e);
|
|
147
153
|
return;
|
|
148
154
|
}
|
|
149
|
-
|
|
155
|
+
U(null);
|
|
150
156
|
try {
|
|
151
|
-
await
|
|
152
|
-
assetId:
|
|
153
|
-
periodStart:
|
|
154
|
-
periodEnd:
|
|
155
|
-
volume:
|
|
156
|
-
unit:
|
|
157
|
-
grade:
|
|
158
|
-
downtimeHours:
|
|
159
|
-
notes:
|
|
160
|
-
}),
|
|
157
|
+
await q.mutateAsync({
|
|
158
|
+
assetId: B.assetId,
|
|
159
|
+
periodStart: e,
|
|
160
|
+
periodEnd: t,
|
|
161
|
+
volume: n,
|
|
162
|
+
unit: B.unit,
|
|
163
|
+
grade: B.grade ? Number(B.grade) : null,
|
|
164
|
+
downtimeHours: B.downtimeHours ? Number(B.downtimeHours) : null,
|
|
165
|
+
notes: B.notes.trim() || null
|
|
166
|
+
}), P.success("Production recorded"), Q();
|
|
161
167
|
} catch (e) {
|
|
162
|
-
|
|
168
|
+
U(e instanceof Error ? e.message : "Failed to record production."), P.fromError(e);
|
|
163
169
|
}
|
|
164
|
-
}, $ =
|
|
165
|
-
return /* @__PURE__ */
|
|
170
|
+
}, $ = W.data?.items ?? [];
|
|
171
|
+
return /* @__PURE__ */ b(t, {
|
|
166
172
|
title: "Production",
|
|
167
173
|
description: "Captured production volumes across every field, well, mine & plant — with downtime and grade.",
|
|
168
|
-
actions: /* @__PURE__ */ x
|
|
169
|
-
onClick:
|
|
170
|
-
children: [/* @__PURE__ */
|
|
174
|
+
actions: /* @__PURE__ */ b(x, {
|
|
175
|
+
onClick: Z,
|
|
176
|
+
children: [/* @__PURE__ */ y(_, { className: "mr-1.5 h-4 w-4" }), " Record production"]
|
|
171
177
|
}),
|
|
172
178
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ b("div", {
|
|
174
180
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
175
181
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
icon: /* @__PURE__ */
|
|
178
|
-
value:
|
|
182
|
+
/* @__PURE__ */ y(n, {
|
|
183
|
+
icon: /* @__PURE__ */ y(h, { className: "h-5 w-5" }),
|
|
184
|
+
value: _e,
|
|
179
185
|
label: "Volume on this page",
|
|
180
186
|
featured: !0,
|
|
181
|
-
footer:
|
|
187
|
+
footer: Y
|
|
182
188
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
icon: /* @__PURE__ */
|
|
185
|
-
value: `${a(
|
|
189
|
+
/* @__PURE__ */ y(n, {
|
|
190
|
+
icon: /* @__PURE__ */ y(m, { className: "h-5 w-5" }),
|
|
191
|
+
value: `${a(X)}h`,
|
|
186
192
|
label: "Downtime on this page",
|
|
187
|
-
accent:
|
|
193
|
+
accent: X > 0 ? "warning" : void 0
|
|
188
194
|
}),
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
icon: /* @__PURE__ */
|
|
191
|
-
value:
|
|
195
|
+
/* @__PURE__ */ y(n, {
|
|
196
|
+
icon: /* @__PURE__ */ y(p, { className: "h-5 w-5" }),
|
|
197
|
+
value: J.length,
|
|
192
198
|
label: "Records on this page"
|
|
193
199
|
})
|
|
194
200
|
]
|
|
195
201
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ y("div", {
|
|
197
203
|
className: "mt-6 mb-5 flex flex-wrap items-center gap-3",
|
|
198
|
-
children: /* @__PURE__ */
|
|
199
|
-
value:
|
|
204
|
+
children: /* @__PURE__ */ b(w, {
|
|
205
|
+
value: F,
|
|
200
206
|
onValueChange: (e) => {
|
|
201
|
-
|
|
207
|
+
I(e), L.reset();
|
|
202
208
|
},
|
|
203
|
-
children: [/* @__PURE__ */
|
|
209
|
+
children: [/* @__PURE__ */ y(D, {
|
|
204
210
|
className: "w-56",
|
|
205
|
-
|
|
206
|
-
|
|
211
|
+
"aria-label": "Filter by asset",
|
|
212
|
+
children: /* @__PURE__ */ y(O, { placeholder: "All assets" })
|
|
213
|
+
}), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, {
|
|
207
214
|
value: "ALL",
|
|
208
215
|
children: "All assets"
|
|
209
|
-
}), $.map((e) => /* @__PURE__ */
|
|
216
|
+
}), $.map((e) => /* @__PURE__ */ y(E, {
|
|
210
217
|
value: e.id,
|
|
211
218
|
children: e.name
|
|
212
219
|
}, e.id))] })]
|
|
213
220
|
})
|
|
214
221
|
}),
|
|
215
|
-
|
|
222
|
+
me ? /* @__PURE__ */ y(u, { label: "Loading production records…" }) : he ? /* @__PURE__ */ y(l, {
|
|
216
223
|
message: "Couldn't load production records.",
|
|
217
|
-
onRetry: () =>
|
|
218
|
-
}) :
|
|
224
|
+
onRetry: () => ge()
|
|
225
|
+
}) : J.length === 0 ? /* @__PURE__ */ y(te, {
|
|
219
226
|
illustration: "empty-data",
|
|
220
|
-
icon: /* @__PURE__ */
|
|
227
|
+
icon: /* @__PURE__ */ y(g, { className: "h-10 w-10" }),
|
|
221
228
|
title: "No production recorded",
|
|
222
|
-
description:
|
|
223
|
-
action: /* @__PURE__ */ x
|
|
224
|
-
onClick:
|
|
225
|
-
children: [/* @__PURE__ */
|
|
229
|
+
description: F === "ALL" ? "Record a production period to start tracking output, grade and downtime." : "No production has been recorded for this asset yet.",
|
|
230
|
+
action: /* @__PURE__ */ b(x, {
|
|
231
|
+
onClick: Z,
|
|
232
|
+
children: [/* @__PURE__ */ y(_, { className: "mr-1.5 h-4 w-4" }), " Record production"]
|
|
226
233
|
})
|
|
227
|
-
}) : /* @__PURE__ */
|
|
228
|
-
columns:
|
|
229
|
-
rows:
|
|
234
|
+
}) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(c, {
|
|
235
|
+
columns: ve,
|
|
236
|
+
rows: J,
|
|
230
237
|
rowKey: (e) => e.id,
|
|
231
|
-
onRowClick: (e) =>
|
|
238
|
+
onRowClick: (e) => M(`assets/${e.assetId}`),
|
|
239
|
+
rowLabel: (e) => `Open ${G[e.assetId] ?? "asset"}`,
|
|
232
240
|
defaultSort: {
|
|
233
241
|
key: "period",
|
|
234
242
|
dir: "desc"
|
|
235
243
|
}
|
|
236
|
-
}), /* @__PURE__ */
|
|
237
|
-
page:
|
|
238
|
-
pageSize:
|
|
239
|
-
itemCount:
|
|
240
|
-
hasMore:
|
|
241
|
-
onPageChange: (e) =>
|
|
244
|
+
}), /* @__PURE__ */ y(se, {
|
|
245
|
+
page: L.page,
|
|
246
|
+
pageSize: j,
|
|
247
|
+
itemCount: J.length,
|
|
248
|
+
hasMore: K?.pageInfo?.hasMore ?? !1,
|
|
249
|
+
onPageChange: (e) => L.onPageChange(e, K?.pageInfo?.cursor)
|
|
242
250
|
})] }),
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
open:
|
|
245
|
-
onOpenChange: (e) =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ y(ce, {
|
|
252
|
+
open: R,
|
|
253
|
+
onOpenChange: (e) => e ? z(!0) : Q(),
|
|
254
|
+
children: /* @__PURE__ */ b(le, { children: [/* @__PURE__ */ b(fe, { children: [/* @__PURE__ */ y(pe, { children: "Record production" }), /* @__PURE__ */ y(ue, { children: "Log the volume produced by an asset over a reporting period." })] }), /* @__PURE__ */ b("form", {
|
|
255
|
+
onSubmit: (e) => {
|
|
256
|
+
e.preventDefault(), ye();
|
|
257
|
+
},
|
|
258
|
+
children: [/* @__PURE__ */ b("div", {
|
|
251
259
|
className: "grid gap-4 py-2",
|
|
252
260
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ b("div", {
|
|
254
262
|
className: "grid gap-1.5",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ y(C, {
|
|
256
264
|
htmlFor: "prAsset",
|
|
257
265
|
children: "Asset *"
|
|
258
|
-
}), /* @__PURE__ */
|
|
259
|
-
value:
|
|
260
|
-
onValueChange: (e) =>
|
|
261
|
-
...
|
|
266
|
+
}), /* @__PURE__ */ b(w, {
|
|
267
|
+
value: B.assetId,
|
|
268
|
+
onValueChange: (e) => V({
|
|
269
|
+
...B,
|
|
262
270
|
assetId: e
|
|
263
271
|
}),
|
|
264
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ y(D, {
|
|
265
273
|
id: "prAsset",
|
|
266
|
-
children: /* @__PURE__ */
|
|
267
|
-
}), /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ y(O, { placeholder: "Select an asset" })
|
|
275
|
+
}), /* @__PURE__ */ y(T, { children: $.map((e) => /* @__PURE__ */ y(E, {
|
|
268
276
|
value: e.id,
|
|
269
277
|
children: e.name
|
|
270
278
|
}, e.id)) })]
|
|
271
279
|
})]
|
|
272
280
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ b("div", {
|
|
274
282
|
className: "grid gap-2 sm:grid-cols-2",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ b("div", {
|
|
276
284
|
className: "grid gap-1.5",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ y(C, {
|
|
278
286
|
htmlFor: "prStart",
|
|
279
287
|
children: "Period start *"
|
|
280
|
-
}), /* @__PURE__ */
|
|
288
|
+
}), /* @__PURE__ */ y(S, {
|
|
281
289
|
id: "prStart",
|
|
282
290
|
type: "date",
|
|
283
|
-
value:
|
|
284
|
-
onChange: (e) =>
|
|
285
|
-
...
|
|
291
|
+
value: B.periodStart,
|
|
292
|
+
onChange: (e) => V({
|
|
293
|
+
...B,
|
|
286
294
|
periodStart: e.target.value
|
|
287
295
|
})
|
|
288
296
|
})]
|
|
289
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ b("div", {
|
|
290
298
|
className: "grid gap-1.5",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ y(C, {
|
|
292
300
|
htmlFor: "prEnd",
|
|
293
301
|
children: "Period end *"
|
|
294
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ y(S, {
|
|
295
303
|
id: "prEnd",
|
|
296
304
|
type: "date",
|
|
297
|
-
value:
|
|
298
|
-
onChange: (e) =>
|
|
299
|
-
...
|
|
305
|
+
value: B.periodEnd,
|
|
306
|
+
onChange: (e) => V({
|
|
307
|
+
...B,
|
|
300
308
|
periodEnd: e.target.value
|
|
301
309
|
})
|
|
302
310
|
})]
|
|
303
311
|
})]
|
|
304
312
|
}),
|
|
305
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ b("div", {
|
|
306
314
|
className: "grid gap-2 sm:grid-cols-2",
|
|
307
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ b("div", {
|
|
308
316
|
className: "grid gap-1.5",
|
|
309
|
-
children: [/* @__PURE__ */
|
|
317
|
+
children: [/* @__PURE__ */ y(C, {
|
|
310
318
|
htmlFor: "prVolume",
|
|
311
319
|
children: "Volume *"
|
|
312
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ y(S, {
|
|
313
321
|
id: "prVolume",
|
|
314
322
|
type: "number",
|
|
315
323
|
min: "0",
|
|
316
324
|
step: "any",
|
|
317
|
-
value:
|
|
318
|
-
onChange: (e) =>
|
|
319
|
-
...
|
|
325
|
+
value: B.volume,
|
|
326
|
+
onChange: (e) => V({
|
|
327
|
+
...B,
|
|
320
328
|
volume: e.target.value
|
|
321
329
|
}),
|
|
322
330
|
placeholder: "12500"
|
|
323
331
|
})]
|
|
324
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ b("div", {
|
|
325
333
|
className: "grid gap-1.5",
|
|
326
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ y(C, {
|
|
327
335
|
htmlFor: "prUnit",
|
|
328
336
|
children: "Unit"
|
|
329
|
-
}), /* @__PURE__ */
|
|
330
|
-
value:
|
|
331
|
-
onValueChange: (e) =>
|
|
332
|
-
...
|
|
337
|
+
}), /* @__PURE__ */ b(w, {
|
|
338
|
+
value: B.unit,
|
|
339
|
+
onValueChange: (e) => V({
|
|
340
|
+
...B,
|
|
333
341
|
unit: e
|
|
334
342
|
}),
|
|
335
|
-
children: [/* @__PURE__ */
|
|
343
|
+
children: [/* @__PURE__ */ y(D, {
|
|
336
344
|
id: "prUnit",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
-
}), /* @__PURE__ */
|
|
345
|
+
children: /* @__PURE__ */ y(O, {})
|
|
346
|
+
}), /* @__PURE__ */ y(T, { children: A.map((e) => /* @__PURE__ */ y(E, {
|
|
339
347
|
value: e,
|
|
340
348
|
children: i(e)
|
|
341
349
|
}, e)) })]
|
|
342
350
|
})]
|
|
343
351
|
})]
|
|
344
352
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ b("div", {
|
|
346
354
|
className: "grid gap-2 sm:grid-cols-2",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ b("div", {
|
|
348
356
|
className: "grid gap-1.5",
|
|
349
|
-
children: [/* @__PURE__ */
|
|
357
|
+
children: [/* @__PURE__ */ y(C, {
|
|
350
358
|
htmlFor: "prGrade",
|
|
351
359
|
children: "Grade"
|
|
352
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ y(S, {
|
|
353
361
|
id: "prGrade",
|
|
354
362
|
type: "number",
|
|
355
363
|
step: "any",
|
|
356
|
-
value:
|
|
357
|
-
onChange: (e) =>
|
|
358
|
-
...
|
|
364
|
+
value: B.grade,
|
|
365
|
+
onChange: (e) => V({
|
|
366
|
+
...B,
|
|
359
367
|
grade: e.target.value
|
|
360
368
|
}),
|
|
361
369
|
placeholder: "Quality / concentration"
|
|
362
370
|
})]
|
|
363
|
-
}), /* @__PURE__ */
|
|
371
|
+
}), /* @__PURE__ */ b("div", {
|
|
364
372
|
className: "grid gap-1.5",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ y(C, {
|
|
366
374
|
htmlFor: "prDowntime",
|
|
367
375
|
children: "Downtime (hours)"
|
|
368
|
-
}), /* @__PURE__ */
|
|
376
|
+
}), /* @__PURE__ */ y(S, {
|
|
369
377
|
id: "prDowntime",
|
|
370
378
|
type: "number",
|
|
371
379
|
min: "0",
|
|
372
380
|
step: "any",
|
|
373
|
-
value:
|
|
374
|
-
onChange: (e) =>
|
|
375
|
-
...
|
|
381
|
+
value: B.downtimeHours,
|
|
382
|
+
onChange: (e) => V({
|
|
383
|
+
...B,
|
|
376
384
|
downtimeHours: e.target.value
|
|
377
385
|
}),
|
|
378
386
|
placeholder: "0"
|
|
379
387
|
})]
|
|
380
388
|
})]
|
|
381
389
|
}),
|
|
382
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ b("div", {
|
|
383
391
|
className: "grid gap-1.5",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
392
|
+
children: [/* @__PURE__ */ y(C, {
|
|
385
393
|
htmlFor: "prNotes",
|
|
386
394
|
children: "Notes"
|
|
387
|
-
}), /* @__PURE__ */
|
|
395
|
+
}), /* @__PURE__ */ y(k, {
|
|
388
396
|
id: "prNotes",
|
|
389
397
|
rows: 2,
|
|
390
|
-
value:
|
|
391
|
-
onChange: (e) =>
|
|
392
|
-
...
|
|
398
|
+
value: B.notes,
|
|
399
|
+
onChange: (e) => V({
|
|
400
|
+
...B,
|
|
393
401
|
notes: e.target.value
|
|
394
402
|
}),
|
|
395
403
|
placeholder: "Optional context about this period."
|
|
396
404
|
})]
|
|
397
405
|
}),
|
|
398
|
-
|
|
406
|
+
H && /* @__PURE__ */ y("p", {
|
|
399
407
|
className: "text-sm text-status-error-text",
|
|
400
|
-
children:
|
|
408
|
+
children: H
|
|
401
409
|
})
|
|
402
410
|
]
|
|
403
|
-
}),
|
|
404
|
-
|
|
411
|
+
}), /* @__PURE__ */ b(de, { children: [/* @__PURE__ */ y(x, {
|
|
412
|
+
type: "button",
|
|
405
413
|
variant: "outline",
|
|
406
|
-
onClick:
|
|
414
|
+
onClick: Q,
|
|
407
415
|
children: "Cancel"
|
|
408
|
-
}), /* @__PURE__ */
|
|
409
|
-
|
|
410
|
-
disabled:
|
|
411
|
-
children:
|
|
412
|
-
})] })
|
|
413
|
-
] })
|
|
416
|
+
}), /* @__PURE__ */ y(x, {
|
|
417
|
+
type: "submit",
|
|
418
|
+
disabled: q.isPending,
|
|
419
|
+
children: q.isPending ? "Recording…" : "Record production"
|
|
420
|
+
})] })]
|
|
421
|
+
})] })
|
|
414
422
|
})
|
|
415
423
|
]
|
|
416
424
|
});
|
|
417
425
|
}
|
|
418
426
|
//#endregion
|
|
419
|
-
export {
|
|
427
|
+
export { P as ProductionPage };
|
|
420
428
|
|
|
421
429
|
//# sourceMappingURL=ProductionPage.js.map
|