@burdenoff/microfe-movethewheels 2026.703.4 → 2026.703.6
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/{AIAssistantPage-3YOnHO9Y.js → AIAssistantPage-BmILdHgO.js} +16 -15
- package/dist/AnalyticsPage-BSlsiSDE.js +194 -0
- package/dist/{CreateOrderPage-DRAgGo9i.js → CreateOrderPage-DaCgVaO3.js} +40 -40
- package/dist/{CustomerDetailsPage-BCeMmOFe.js → CustomerDetailsPage-DErpbafW.js} +71 -71
- package/dist/CustomersPage-C1lRU6xs.js +205 -0
- package/dist/DashboardPage-Q5-5EKAU.js +542 -0
- package/dist/{DataTable-XvUcTjwi.js → DataTable-KjzbwnRL.js} +31 -31
- package/dist/{DocumentsCard-U2lSe-cn.js → DocumentsCard-T9y6cv4-.js} +25 -25
- package/dist/{DriverDetailsPage-BQrYd_Lp.js → DriverDetailsPage-DnHGkDC7.js} +64 -64
- package/dist/DriversPage-C0ujWVOn.js +221 -0
- package/dist/FinancePage-CA2XEgsQ.js +175 -0
- package/dist/{FleetPage-3ZHsB-TN.js → FleetPage-DrvXW7wK.js} +22 -22
- package/dist/{FormError-cuLV2jVD.js → FormError-CRsMP7TQ.js} +1 -1
- package/dist/{ImportExportPage-C6f7DqhM.js → ImportExportPage-Cac9HjFx.js} +12 -12
- package/dist/InventoryPage-Ezf4gqKI.js +259 -0
- package/dist/LiveTrackingPage-CzbVwDqK.js +429 -0
- package/dist/{MarketplacePage-Bh_2ns4v.js → MarketplacePage-BHDmSQmo.js} +116 -116
- package/dist/MetricCard-DQlDNqmK.js +191 -0
- package/dist/{Notice-CSoDYKw9.js → Notice-GmA7JDR3.js} +2 -2
- package/dist/{OrderDetailsPage-zCj0lW0j.js → OrderDetailsPage-CR0Wc1aN.js} +58 -58
- package/dist/OrdersListPage-C8Bu6wXM.js +386 -0
- package/dist/{PageLayout-D4LDHJJq.js → PageLayout-DX1Ou6V6.js} +164 -134
- package/dist/{ProductDetailsPage-wsxAQkA0.js → ProductDetailsPage-B_ns2MOe.js} +55 -55
- package/dist/ProductsPage-c92BsEoA.js +186 -0
- package/dist/ReportsPage-CPLXtLT2.js +377 -0
- package/dist/{RouteDetailsPage-DyMJE9AS.js → RouteDetailsPage-DOfcRiFv.js} +208 -181
- package/dist/{RoutesPage-Dtc669yc.js → RoutesPage-BZGublby.js} +12 -12
- package/dist/{SettingsPage-CpH9xhQg.js → SettingsPage-5cweX_xh.js} +15 -15
- package/dist/Sparkline-zSXvG6vA.js +16729 -0
- package/dist/{StatusBadge-C87mDpDP.js → StatusBadge-oZjownr1.js} +7 -7
- package/dist/TrackingPage-Ln9qVflK.js +368 -0
- package/dist/{VehicleDetailsPage-DldYNsYV.js → VehicleDetailsPage-CrkzE0dN.js} +53 -53
- package/dist/VehiclesPage-CTQWH7af.js +184 -0
- package/dist/{WarehouseDetailsPage-CMG7or6G.js → WarehouseDetailsPage-CwDLaG65.js} +64 -64
- package/dist/WarehousesPage-KW02DvZg.js +182 -0
- package/dist/{arrow-left-n48Y-Wis.js → arrow-left-DJDw_Yqv.js} +1 -1
- package/dist/{arrow-right-Q3XQpTPR.js → arrow-right-Cb2fLTPJ.js} +1 -1
- package/dist/{arrow-up-xNF1zJUG.js → arrow-up-PxaOIyiT.js} +1 -1
- package/dist/{box-Eu05PXDh.js → box-hSJVtvGf.js} +1 -1
- package/dist/boxes-DDnxEkT5.js +54 -0
- package/dist/{chart-column-ouzgxIv_.js → chart-column-xXgAZvRl.js} +1 -1
- package/dist/charts-CfCwQg6o.js +2018 -0
- package/dist/{chevron-left-B2_r0Elx.js → chevron-left-dhEGJYdh.js} +1 -1
- package/dist/{chevron-right-eV4LjaSi.js → chevron-right-Cud2NDvm.js} +1 -1
- package/dist/chunk-BdsCSvBP.js +20 -0
- package/dist/{circle-alert-Bzh2DBSF.js → circle-alert-Rx0p3D5w.js} +1 -1
- package/dist/circle-check-BCxRFdFo.js +13 -0
- package/dist/{circle-check-big-CGMSpQmD.js → circle-check-big-BcIJ8xjx.js} +1 -1
- package/dist/{clock-Bl3ptexL.js → clock-B2_YxJgB.js} +1 -1
- package/dist/{dollar-sign-CAVU95SO.js → dollar-sign-CQmAICv4.js} +1 -1
- package/dist/{download-C5NbvVDc.js → download-CG4Tponq.js} +1 -1
- package/dist/{file-text-D-1uvLZG.js → file-text-CzH-zMub.js} +1 -1
- package/dist/{filter-DUfUg6BO.js → filter-C0u2Lwfn.js} +1 -1
- package/dist/{fuel-B6_lnKDs.js → fuel-C2KELcM-.js} +1 -1
- package/dist/index.css +2 -0
- package/dist/index.js +214 -225
- package/dist/{map-C-M-FQLR.js → map-FuPu5aTw.js} +1 -1
- package/dist/{map-pin-Dznl5l40.js → map-pin-czpLv9uy.js} +1 -1
- package/dist/mapMarkers-NCV9MRKR.js +28 -0
- package/dist/maps-D9m7PKrs.js +5070 -0
- package/dist/{navigation-BJSJl-VG.js → navigation-D5_pdCSS.js} +1 -1
- package/dist/{package-CcRttV2N.js → package-B0sdi6lU.js} +1 -1
- package/dist/{phone-DVSZHt_j.js → phone-V2nuzPu9.js} +1 -1
- package/dist/{plus-C_XZDwBz.js → plus-BqQxkfoU.js} +1 -1
- package/dist/{refresh-cw-CfgN67l3.js → refresh-cw-CEOAPEcV.js} +1 -1
- package/dist/route-CZWcW-Dw.js +22 -0
- package/dist/{save-DJE8Fpdv.js → save-DDFvrxWl.js} +1 -1
- package/dist/{search-D_VyGcZT.js → search-D7Ya6jxj.js} +1 -1
- package/dist/{square-pen-D-6JYrVQ.js → square-pen-DoZZS4Lw.js} +1 -1
- package/dist/{star-BpRlUZuU.js → star-B7PgVu5j.js} +1 -1
- package/dist/{store-B-8HMuyZ.js → store-YVzcIG4A.js} +1 -1
- package/dist/{trash-2-8vmv-XV_.js → trash-2-BegnBzwI.js} +1 -1
- package/dist/{trending-up-Dz6PqPRj.js → trending-up-DBd3XNdb.js} +1 -1
- package/dist/{triangle-alert-D7Y3J_4z.js → triangle-alert-Bxk3Kgs6.js} +1 -1
- package/dist/{truck-D-y2IDzv.js → truck-Clrn0oHp.js} +1 -1
- package/dist/{upload-CHZofOqb.js → upload-Df5JmMwH.js} +1 -1
- package/dist/{useAssistant-DVW4QgQb.js → useAssistant-Cb8nnIVC.js} +11 -28
- package/dist/{useCustomers-BPW4__PR.js → useCustomers-Dq2IR2HQ.js} +1 -1
- package/dist/{useFleet-ChBkxAd6.js → useFleet-CapnWBcA.js} +1 -1
- package/dist/{useImportExport-DrPDHEDK.js → useImportExport-BoGzrlJy.js} +1 -1
- package/dist/{useInventory-CAAVMRp6.js → useInventory-Ci6M2d9f.js} +1 -1
- package/dist/{useOrders-B465S2nt.js → useOrders-BuQU1OHX.js} +1 -1
- package/dist/{useReports-jQ3GpNOm.js → useReports-DIx8W7CO.js} +1 -1
- package/dist/{useRoutes-hS3d5-xr.js → useRoutes-D7EvI_pm.js} +1 -1
- package/dist/{useSettings-BB8X2RLh.js → useSettings-BhX251UQ.js} +6 -6
- package/dist/{useTracking-RjGz9PZG.js → useTracking-C40jmZ6W.js} +3 -3
- package/dist/{user-DzfTn4dE.js → user-BlcJrbtE.js} +1 -1
- package/dist/{user-check-BEKRCi7v.js → user-check-DtnQmimP.js} +1 -1
- package/dist/{users-CCrq-w0C.js → users-Cvwko-Dx.js} +1 -1
- package/dist/{warehouse-CaqfmMKh.js → warehouse-LWLVTk6G.js} +1 -1
- package/dist/{wrench-q_rgJfaP.js → wrench-Cme0RbyR.js} +1 -1
- package/dist/{x-tMeDMcCw.js → x-D8C9Pg5V.js} +1 -1
- package/package.json +5 -1
- package/src/movethewheels/components/GlassPanel.tsx +71 -0
- package/src/movethewheels/components/MetricCard.tsx +171 -73
- package/src/movethewheels/components/StatusBadge.tsx +7 -6
- package/src/movethewheels/components/charts/ChartShell.tsx +78 -0
- package/src/movethewheels/components/charts/Sparkline.tsx +85 -0
- package/src/movethewheels/components/charts/StatusDonut.tsx +115 -0
- package/src/movethewheels/components/charts/TrendChart.tsx +179 -0
- package/src/movethewheels/components/charts/VolumeBar.tsx +97 -0
- package/src/movethewheels/components/charts/chartTokens.ts +43 -0
- package/src/movethewheels/components/charts/index.ts +9 -0
- package/src/movethewheels/components/index.ts +44 -1
- package/src/movethewheels/components/maps/LogisticsMap.tsx +94 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +118 -0
- package/src/movethewheels/components/maps/RouteMap.tsx +71 -0
- package/src/movethewheels/components/maps/TrackingMap.tsx +102 -0
- package/src/movethewheels/components/maps/index.ts +16 -0
- package/src/movethewheels/components/maps/leaflet-setup.ts +124 -0
- package/src/movethewheels/components/maps/map-markers.css +121 -0
- package/src/movethewheels/hooks/useAnalytics.ts +14 -4
- package/src/movethewheels/pages/AnalyticsPage.tsx +93 -73
- package/src/movethewheels/pages/CreateOrderPage.tsx +4 -4
- package/src/movethewheels/pages/CustomersPage.tsx +29 -20
- package/src/movethewheels/pages/DashboardPage.tsx +238 -12
- package/src/movethewheels/pages/DriverDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/DriversPage.tsx +35 -24
- package/src/movethewheels/pages/FinancePage.tsx +68 -30
- package/src/movethewheels/pages/InventoryPage.tsx +15 -3
- package/src/movethewheels/pages/LiveTrackingPage.tsx +124 -16
- package/src/movethewheels/pages/OrdersListPage.tsx +46 -38
- package/src/movethewheels/pages/ProductsPage.tsx +28 -24
- package/src/movethewheels/pages/ReportsPage.tsx +23 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +46 -7
- package/src/movethewheels/pages/SettingsPage.tsx +2 -2
- package/src/movethewheels/pages/TrackingPage.tsx +76 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +34 -24
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/WarehousesPage.tsx +28 -22
- package/src/movethewheels/types/index.ts +1 -1
- package/src/movethewheels/utils/graphqlClient.ts +81 -31
- package/src/movethewheels/utils/mapMarkers.ts +58 -0
- package/dist/AnalyticsPage-CMpI1070.js +0 -215
- package/dist/CustomersPage-CaNBMXmM.js +0 -172
- package/dist/DashboardPage-DIKlXde3.js +0 -387
- package/dist/DriversPage-PYmdFiby.js +0 -176
- package/dist/FinancePage-Cwh9Bw4M.js +0 -136
- package/dist/InventoryPage-DpiqVu1v.js +0 -253
- package/dist/LiveTrackingPage-FAzzlVnX.js +0 -379
- package/dist/MetricCard-CVBVpu7o.js +0 -146
- package/dist/OrdersListPage-CAMsuUck.js +0 -384
- package/dist/ProductsPage-DC5qDLfz.js +0 -180
- package/dist/ReportsPage-BwUJ37eO.js +0 -356
- package/dist/TrackingPage-DaNEFG_h.js +0 -325
- package/dist/VehiclesPage-BFw13iMt.js +0 -176
- package/dist/WarehousesPage-Wkytnt86.js +0 -173
- package/dist/useAnalytics-D7HW2XRb.js +0 -347
- /package/dist/{formatters-BQr-aR5W.js → formatters-FWJDwTFv.js} +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { M as e, i as t, lt as n, st as r } from "./PageLayout-DX1Ou6V6.js";
|
|
2
|
+
import { t as i } from "./DataTable-KjzbwnRL.js";
|
|
3
|
+
import { t as a } from "./circle-check-BCxRFdFo.js";
|
|
4
|
+
import { t as o } from "./download-CG4Tponq.js";
|
|
5
|
+
import { t as s } from "./plus-BqQxkfoU.js";
|
|
6
|
+
import { t as c } from "./refresh-cw-CEOAPEcV.js";
|
|
7
|
+
import { t as l } from "./route-CZWcW-Dw.js";
|
|
8
|
+
import { t as u } from "./truck-Clrn0oHp.js";
|
|
9
|
+
import { t as d } from "./wrench-Cme0RbyR.js";
|
|
10
|
+
import { i as f, o as p } from "./useFleet-CapnWBcA.js";
|
|
11
|
+
import { r as m, t as h } from "./MetricCard-DQlDNqmK.js";
|
|
12
|
+
import { a as g, r as _ } from "./StatusBadge-oZjownr1.js";
|
|
13
|
+
import { useState as v } from "react";
|
|
14
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
|
+
import { CTAOverflowMenu as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
//#region src/movethewheels/pages/VehiclesPage.tsx
|
|
17
|
+
function C() {
|
|
18
|
+
let { basePath: C, navigate: w } = r(), [T, E] = v(0), [D, O] = v(25), { vehicles: k, isLoading: A, refetch: j } = p({
|
|
19
|
+
limit: D,
|
|
20
|
+
offset: T * D
|
|
21
|
+
}), { stats: M } = f(), N = M.totalVehicles, P = (e) => {
|
|
22
|
+
w && w(n(C, e));
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ b(t, {
|
|
25
|
+
title: "Vehicles",
|
|
26
|
+
subtitle: `${N} vehicles in fleet`,
|
|
27
|
+
icon: /* @__PURE__ */ y(u, { size: 24 }),
|
|
28
|
+
headerActions: /* @__PURE__ */ y(x, {
|
|
29
|
+
primary: {
|
|
30
|
+
label: "Add Vehicle",
|
|
31
|
+
icon: /* @__PURE__ */ y(s, { size: 16 }),
|
|
32
|
+
onSelect: () => P("fleet/vehicles/new")
|
|
33
|
+
},
|
|
34
|
+
actions: [{
|
|
35
|
+
label: "Refresh",
|
|
36
|
+
icon: /* @__PURE__ */ y(c, { size: 16 }),
|
|
37
|
+
onSelect: () => j()
|
|
38
|
+
}, {
|
|
39
|
+
label: "Export",
|
|
40
|
+
icon: /* @__PURE__ */ y(o, { size: 16 }),
|
|
41
|
+
onSelect: () => P("import-export")
|
|
42
|
+
}]
|
|
43
|
+
}),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ y(S, {
|
|
46
|
+
icon: /* @__PURE__ */ y(u, { size: 18 }),
|
|
47
|
+
children: "Every truck, van and bike in your fleet. Monitor capacity, fuel level, mileage and maintenance status here so you always know which vehicles are road-ready before dispatching an order."
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
50
|
+
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
51
|
+
children: "Fleet at a glance"
|
|
52
|
+
}), /* @__PURE__ */ b(m, {
|
|
53
|
+
columns: 4,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ y(h, {
|
|
56
|
+
label: "Total vehicles",
|
|
57
|
+
value: N,
|
|
58
|
+
icon: /* @__PURE__ */ y(u, { size: 20 }),
|
|
59
|
+
accent: "brand"
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ y(h, {
|
|
62
|
+
label: "Available now",
|
|
63
|
+
value: M.vehiclesByStatus.available,
|
|
64
|
+
icon: /* @__PURE__ */ y(a, { size: 20 }),
|
|
65
|
+
accent: "success",
|
|
66
|
+
subtitle: "Ready to dispatch"
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ y(h, {
|
|
69
|
+
label: "On assignment",
|
|
70
|
+
value: M.vehiclesByStatus.assigned,
|
|
71
|
+
icon: /* @__PURE__ */ y(l, { size: 20 }),
|
|
72
|
+
accent: "blue"
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ y(h, {
|
|
75
|
+
label: "In maintenance",
|
|
76
|
+
value: M.vehiclesByStatus.maintenance,
|
|
77
|
+
icon: /* @__PURE__ */ y(d, { size: 20 }),
|
|
78
|
+
accent: "warning"
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})] }),
|
|
82
|
+
/* @__PURE__ */ y(i, {
|
|
83
|
+
columns: [
|
|
84
|
+
{
|
|
85
|
+
id: "vehicleNumber",
|
|
86
|
+
header: "Vehicle #",
|
|
87
|
+
accessorKey: "vehicleNumber",
|
|
88
|
+
sortable: !0,
|
|
89
|
+
cell: (e) => /* @__PURE__ */ y("span", {
|
|
90
|
+
className: "font-medium",
|
|
91
|
+
children: e.vehicleNumber
|
|
92
|
+
})
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "type",
|
|
96
|
+
header: "Type",
|
|
97
|
+
accessorKey: "type",
|
|
98
|
+
cell: (e) => /* @__PURE__ */ y(g, { type: e.type })
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "details",
|
|
102
|
+
header: "Vehicle",
|
|
103
|
+
cell: (e) => /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("p", {
|
|
104
|
+
className: "font-medium",
|
|
105
|
+
children: [
|
|
106
|
+
e.make,
|
|
107
|
+
" ",
|
|
108
|
+
e.model
|
|
109
|
+
]
|
|
110
|
+
}), /* @__PURE__ */ y("p", {
|
|
111
|
+
className: "text-sm text-text-secondary",
|
|
112
|
+
children: e.year
|
|
113
|
+
})] })
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "status",
|
|
117
|
+
header: "Status",
|
|
118
|
+
accessorKey: "status",
|
|
119
|
+
sortable: !0,
|
|
120
|
+
cell: (e) => /* @__PURE__ */ y(_, {
|
|
121
|
+
status: e.status,
|
|
122
|
+
type: "vehicle"
|
|
123
|
+
})
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "capacity",
|
|
127
|
+
header: "Capacity",
|
|
128
|
+
cell: (e) => /* @__PURE__ */ b("div", {
|
|
129
|
+
className: "text-sm",
|
|
130
|
+
children: [/* @__PURE__ */ b("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ b("p", {
|
|
131
|
+
className: "text-text-secondary",
|
|
132
|
+
children: [e.capacity.volume, " m³"]
|
|
133
|
+
})]
|
|
134
|
+
})
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "fuel",
|
|
138
|
+
header: "Fuel Level",
|
|
139
|
+
cell: (t) => t.fuelLevel === void 0 ? "-" : /* @__PURE__ */ b("div", {
|
|
140
|
+
className: "flex items-center gap-2",
|
|
141
|
+
children: [/* @__PURE__ */ y(e, {
|
|
142
|
+
value: t.fuelLevel,
|
|
143
|
+
className: "w-16 h-2"
|
|
144
|
+
}), /* @__PURE__ */ b("span", {
|
|
145
|
+
className: "text-sm",
|
|
146
|
+
children: [t.fuelLevel, "%"]
|
|
147
|
+
})]
|
|
148
|
+
})
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "mileage",
|
|
152
|
+
header: "Mileage",
|
|
153
|
+
accessorKey: "mileage",
|
|
154
|
+
sortable: !0,
|
|
155
|
+
cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
data: k,
|
|
159
|
+
isLoading: A,
|
|
160
|
+
searchable: !0,
|
|
161
|
+
searchPlaceholder: "Search vehicles...",
|
|
162
|
+
searchFields: [
|
|
163
|
+
"vehicleNumber",
|
|
164
|
+
"make",
|
|
165
|
+
"model"
|
|
166
|
+
],
|
|
167
|
+
onRowClick: (e) => P(`fleet/vehicles/${e.id}`),
|
|
168
|
+
getRowId: (e) => e.id,
|
|
169
|
+
pageIndex: T,
|
|
170
|
+
pageSize: D,
|
|
171
|
+
onPageChange: E,
|
|
172
|
+
onPageSizeChange: (e) => {
|
|
173
|
+
O(e), E(0);
|
|
174
|
+
},
|
|
175
|
+
totalItems: N,
|
|
176
|
+
emptyIllustration: "empty-data",
|
|
177
|
+
emptyTitle: "No vehicles yet",
|
|
178
|
+
emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
export { C as default };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { A as e, F as t, I as n, L as r, M as i, P as a, R as o,
|
|
2
|
-
import { t as y } from "./arrow-left-
|
|
3
|
-
import { t as b } from "./box-
|
|
4
|
-
import { t as x } from "./clock-
|
|
5
|
-
import { t as S } from "./map-pin-
|
|
6
|
-
import { t as C } from "./save-
|
|
7
|
-
import { t as w } from "./square-pen-
|
|
8
|
-
import { t as T } from "./users-
|
|
9
|
-
import { t as E } from "./warehouse-
|
|
10
|
-
import { o as D, t as O } from "./useInventory-
|
|
11
|
-
import { t as k } from "./FormError-
|
|
12
|
-
import { t as A } from "./formatters-
|
|
1
|
+
import { A as e, F as t, I as n, L as r, M as i, P as a, R as o, d as s, f as c, g as l, h as u, i as d, j as f, l as p, lt as m, n as h, r as g, st as _, u as v } from "./PageLayout-DX1Ou6V6.js";
|
|
2
|
+
import { t as y } from "./arrow-left-DJDw_Yqv.js";
|
|
3
|
+
import { t as b } from "./box-hSJVtvGf.js";
|
|
4
|
+
import { t as x } from "./clock-B2_YxJgB.js";
|
|
5
|
+
import { t as S } from "./map-pin-czpLv9uy.js";
|
|
6
|
+
import { t as C } from "./save-DDFvrxWl.js";
|
|
7
|
+
import { t as w } from "./square-pen-DoZZS4Lw.js";
|
|
8
|
+
import { t as T } from "./users-Cvwko-Dx.js";
|
|
9
|
+
import { t as E } from "./warehouse-LWLVTk6G.js";
|
|
10
|
+
import { o as D, t as O } from "./useInventory-Ci6M2d9f.js";
|
|
11
|
+
import { t as k } from "./FormError-CRsMP7TQ.js";
|
|
12
|
+
import { t as A } from "./formatters-FWJDwTFv.js";
|
|
13
13
|
import { useState as j } from "react";
|
|
14
14
|
import { useParams as M } from "react-router-dom";
|
|
15
15
|
import { jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
@@ -38,7 +38,7 @@ var R = [
|
|
|
38
38
|
}
|
|
39
39
|
];
|
|
40
40
|
function z() {
|
|
41
|
-
let { basePath: i, navigate:
|
|
41
|
+
let { basePath: i, navigate: p } = _(), { createWarehouse: h } = O(), [g, b] = j({
|
|
42
42
|
code: "",
|
|
43
43
|
name: "",
|
|
44
44
|
type: "DISTRIBUTION",
|
|
@@ -48,39 +48,39 @@ function z() {
|
|
|
48
48
|
postalCode: "",
|
|
49
49
|
country: "USA",
|
|
50
50
|
totalCapacity: ""
|
|
51
|
-
}), [x, w] = j(!1), [T, D] = j(null), A = () =>
|
|
51
|
+
}), [x, w] = j(!1), [T, D] = j(null), A = () => p?.(m(i, "inventory/warehouses")), M = (e, t) => b((n) => ({
|
|
52
52
|
...n,
|
|
53
53
|
[e]: t
|
|
54
54
|
})), I = async (e) => {
|
|
55
|
-
if (e.preventDefault(), !
|
|
55
|
+
if (e.preventDefault(), !g.code.trim() || !g.name.trim()) {
|
|
56
56
|
D("Warehouse code and name are required.");
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
if (!
|
|
59
|
+
if (!g.street.trim() || !g.city.trim()) {
|
|
60
60
|
D("A street and city are required for the warehouse address.");
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
w(!0), D(null);
|
|
64
64
|
try {
|
|
65
|
-
let e =
|
|
66
|
-
code:
|
|
67
|
-
name:
|
|
68
|
-
type:
|
|
65
|
+
let e = g.totalCapacity.trim() ? Number(g.totalCapacity) : void 0, t = await h({
|
|
66
|
+
code: g.code.trim(),
|
|
67
|
+
name: g.name.trim(),
|
|
68
|
+
type: g.type,
|
|
69
69
|
address: {
|
|
70
|
-
street:
|
|
71
|
-
city:
|
|
72
|
-
state:
|
|
73
|
-
postalCode:
|
|
74
|
-
country:
|
|
70
|
+
street: g.street.trim(),
|
|
71
|
+
city: g.city.trim(),
|
|
72
|
+
state: g.state.trim(),
|
|
73
|
+
postalCode: g.postalCode.trim(),
|
|
74
|
+
country: g.country.trim()
|
|
75
75
|
},
|
|
76
76
|
totalCapacity: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
p?.(m(i, `inventory/warehouses/${t.id}`));
|
|
79
79
|
} catch (e) {
|
|
80
80
|
console.error("Failed to create warehouse:", e), D(e instanceof Error ? e.message : "Failed to create warehouse. Please try again."), w(!1);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
return /* @__PURE__ */ P(
|
|
83
|
+
return /* @__PURE__ */ P(d, {
|
|
84
84
|
title: "Add Warehouse",
|
|
85
85
|
subtitle: "Register a storage and fulfilment site",
|
|
86
86
|
icon: /* @__PURE__ */ N(E, { size: 24 }),
|
|
@@ -119,7 +119,7 @@ function z() {
|
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ P("div", {
|
|
121
121
|
className: "space-y-2",
|
|
122
|
-
children: [/* @__PURE__ */ P(
|
|
122
|
+
children: [/* @__PURE__ */ P(f, {
|
|
123
123
|
htmlFor: "code",
|
|
124
124
|
children: ["Code ", /* @__PURE__ */ N("span", {
|
|
125
125
|
className: "text-status-error-text",
|
|
@@ -127,7 +127,7 @@ function z() {
|
|
|
127
127
|
})]
|
|
128
128
|
}), /* @__PURE__ */ N(e, {
|
|
129
129
|
id: "code",
|
|
130
|
-
value:
|
|
130
|
+
value: g.code,
|
|
131
131
|
onChange: (e) => M("code", e.target.value),
|
|
132
132
|
placeholder: "WH-SF-01",
|
|
133
133
|
required: !0
|
|
@@ -135,7 +135,7 @@ function z() {
|
|
|
135
135
|
}),
|
|
136
136
|
/* @__PURE__ */ P("div", {
|
|
137
137
|
className: "space-y-2",
|
|
138
|
-
children: [/* @__PURE__ */ P(
|
|
138
|
+
children: [/* @__PURE__ */ P(f, {
|
|
139
139
|
htmlFor: "name",
|
|
140
140
|
children: ["Name ", /* @__PURE__ */ N("span", {
|
|
141
141
|
className: "text-status-error-text",
|
|
@@ -143,7 +143,7 @@ function z() {
|
|
|
143
143
|
})]
|
|
144
144
|
}), /* @__PURE__ */ N(e, {
|
|
145
145
|
id: "name",
|
|
146
|
-
value:
|
|
146
|
+
value: g.name,
|
|
147
147
|
onChange: (e) => M("name", e.target.value),
|
|
148
148
|
placeholder: "San Francisco DC",
|
|
149
149
|
required: !0
|
|
@@ -151,14 +151,14 @@ function z() {
|
|
|
151
151
|
}),
|
|
152
152
|
/* @__PURE__ */ P("div", {
|
|
153
153
|
className: "space-y-2",
|
|
154
|
-
children: [/* @__PURE__ */ P(
|
|
154
|
+
children: [/* @__PURE__ */ P(f, {
|
|
155
155
|
htmlFor: "type",
|
|
156
156
|
children: ["Type ", /* @__PURE__ */ N("span", {
|
|
157
157
|
className: "text-status-error-text",
|
|
158
158
|
children: "*"
|
|
159
159
|
})]
|
|
160
160
|
}), /* @__PURE__ */ P(a, {
|
|
161
|
-
value:
|
|
161
|
+
value: g.type,
|
|
162
162
|
onValueChange: (e) => M("type", e),
|
|
163
163
|
children: [/* @__PURE__ */ N(r, {
|
|
164
164
|
id: "type",
|
|
@@ -172,20 +172,20 @@ function z() {
|
|
|
172
172
|
]
|
|
173
173
|
}), /* @__PURE__ */ P("div", {
|
|
174
174
|
className: "space-y-2",
|
|
175
|
-
children: [/* @__PURE__ */ N(
|
|
175
|
+
children: [/* @__PURE__ */ N(f, {
|
|
176
176
|
htmlFor: "totalCapacity",
|
|
177
177
|
children: "Total Capacity (sq ft)"
|
|
178
178
|
}), /* @__PURE__ */ N(e, {
|
|
179
179
|
id: "totalCapacity",
|
|
180
180
|
type: "number",
|
|
181
181
|
min: "0",
|
|
182
|
-
value:
|
|
182
|
+
value: g.totalCapacity,
|
|
183
183
|
onChange: (e) => M("totalCapacity", e.target.value),
|
|
184
184
|
placeholder: "50000"
|
|
185
185
|
})]
|
|
186
186
|
})]
|
|
187
187
|
})] }),
|
|
188
|
-
/* @__PURE__ */ P(
|
|
188
|
+
/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, {
|
|
189
189
|
className: "flex items-center gap-2",
|
|
190
190
|
children: [
|
|
191
191
|
/* @__PURE__ */ N(S, { size: 18 }),
|
|
@@ -195,17 +195,17 @@ function z() {
|
|
|
195
195
|
children: "*"
|
|
196
196
|
})
|
|
197
197
|
]
|
|
198
|
-
}) }), /* @__PURE__ */ P(
|
|
198
|
+
}) }), /* @__PURE__ */ P(c, {
|
|
199
199
|
className: "space-y-4",
|
|
200
200
|
children: [
|
|
201
201
|
/* @__PURE__ */ P("div", {
|
|
202
202
|
className: "space-y-2",
|
|
203
|
-
children: [/* @__PURE__ */ N(
|
|
203
|
+
children: [/* @__PURE__ */ N(f, {
|
|
204
204
|
htmlFor: "street",
|
|
205
205
|
children: "Street"
|
|
206
206
|
}), /* @__PURE__ */ N(e, {
|
|
207
207
|
id: "street",
|
|
208
|
-
value:
|
|
208
|
+
value: g.street,
|
|
209
209
|
onChange: (e) => M("street", e.target.value),
|
|
210
210
|
placeholder: "500 Industrial Way"
|
|
211
211
|
})]
|
|
@@ -214,23 +214,23 @@ function z() {
|
|
|
214
214
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
215
215
|
children: [/* @__PURE__ */ P("div", {
|
|
216
216
|
className: "space-y-2",
|
|
217
|
-
children: [/* @__PURE__ */ N(
|
|
217
|
+
children: [/* @__PURE__ */ N(f, {
|
|
218
218
|
htmlFor: "city",
|
|
219
219
|
children: "City"
|
|
220
220
|
}), /* @__PURE__ */ N(e, {
|
|
221
221
|
id: "city",
|
|
222
|
-
value:
|
|
222
|
+
value: g.city,
|
|
223
223
|
onChange: (e) => M("city", e.target.value),
|
|
224
224
|
placeholder: "San Francisco"
|
|
225
225
|
})]
|
|
226
226
|
}), /* @__PURE__ */ P("div", {
|
|
227
227
|
className: "space-y-2",
|
|
228
|
-
children: [/* @__PURE__ */ N(
|
|
228
|
+
children: [/* @__PURE__ */ N(f, {
|
|
229
229
|
htmlFor: "state",
|
|
230
230
|
children: "State"
|
|
231
231
|
}), /* @__PURE__ */ N(e, {
|
|
232
232
|
id: "state",
|
|
233
|
-
value:
|
|
233
|
+
value: g.state,
|
|
234
234
|
onChange: (e) => M("state", e.target.value),
|
|
235
235
|
placeholder: "CA"
|
|
236
236
|
})]
|
|
@@ -240,23 +240,23 @@ function z() {
|
|
|
240
240
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
241
241
|
children: [/* @__PURE__ */ P("div", {
|
|
242
242
|
className: "space-y-2",
|
|
243
|
-
children: [/* @__PURE__ */ N(
|
|
243
|
+
children: [/* @__PURE__ */ N(f, {
|
|
244
244
|
htmlFor: "postalCode",
|
|
245
245
|
children: "ZIP / Postal Code"
|
|
246
246
|
}), /* @__PURE__ */ N(e, {
|
|
247
247
|
id: "postalCode",
|
|
248
|
-
value:
|
|
248
|
+
value: g.postalCode,
|
|
249
249
|
onChange: (e) => M("postalCode", e.target.value),
|
|
250
250
|
placeholder: "94103"
|
|
251
251
|
})]
|
|
252
252
|
}), /* @__PURE__ */ P("div", {
|
|
253
253
|
className: "space-y-2",
|
|
254
|
-
children: [/* @__PURE__ */ N(
|
|
254
|
+
children: [/* @__PURE__ */ N(f, {
|
|
255
255
|
htmlFor: "country",
|
|
256
256
|
children: "Country"
|
|
257
257
|
}), /* @__PURE__ */ N(e, {
|
|
258
258
|
id: "country",
|
|
259
|
-
value:
|
|
259
|
+
value: g.country,
|
|
260
260
|
onChange: (e) => M("country", e.target.value),
|
|
261
261
|
placeholder: "USA"
|
|
262
262
|
})]
|
|
@@ -269,15 +269,15 @@ function z() {
|
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
271
|
function B() {
|
|
272
|
-
let { warehouseId: e } = M(), { basePath: t, navigate: n } =
|
|
272
|
+
let { warehouseId: e } = M(), { basePath: t, navigate: n } = _(), { warehouse: r, isLoading: a, error: o, refetch: f } = D(e), C = () => n?.(m(t, "inventory/warehouses")), O = (e) => n?.(m(t, e));
|
|
273
273
|
if (!e) return /* @__PURE__ */ N(z, {});
|
|
274
|
-
if (a) return /* @__PURE__ */ N(
|
|
274
|
+
if (a) return /* @__PURE__ */ N(g, { message: "Loading warehouse details..." });
|
|
275
275
|
if (o || !r) return /* @__PURE__ */ N(h, {
|
|
276
276
|
title: "Warehouse not found",
|
|
277
|
-
onRetry:
|
|
277
|
+
onRetry: f
|
|
278
278
|
});
|
|
279
279
|
let k = r.capacity.usedSpace / r.capacity.totalSpace * 100;
|
|
280
|
-
return /* @__PURE__ */ P(
|
|
280
|
+
return /* @__PURE__ */ P(d, {
|
|
281
281
|
title: r.name,
|
|
282
282
|
subtitle: `Code: ${r.code}`,
|
|
283
283
|
icon: /* @__PURE__ */ N(E, { size: 24 }),
|
|
@@ -291,10 +291,10 @@ function B() {
|
|
|
291
291
|
}),
|
|
292
292
|
headerContent: /* @__PURE__ */ P("div", {
|
|
293
293
|
className: "flex gap-2",
|
|
294
|
-
children: [/* @__PURE__ */ N(
|
|
294
|
+
children: [/* @__PURE__ */ N(p, {
|
|
295
295
|
variant: r.isActive ? "default" : "secondary",
|
|
296
296
|
children: r.isActive ? "Active" : "Inactive"
|
|
297
|
-
}), /* @__PURE__ */ N(
|
|
297
|
+
}), /* @__PURE__ */ N(p, {
|
|
298
298
|
variant: "outline",
|
|
299
299
|
className: "capitalize",
|
|
300
300
|
children: r.type.replace("_", " ")
|
|
@@ -348,7 +348,7 @@ function B() {
|
|
|
348
348
|
]
|
|
349
349
|
})
|
|
350
350
|
] }), /* @__PURE__ */ N("div", {
|
|
351
|
-
className: "grid grid-cols-2 gap-4",
|
|
351
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
352
352
|
children: /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
353
353
|
className: "text-sm text-text-secondary",
|
|
354
354
|
children: "Pallets Used"
|
|
@@ -365,11 +365,11 @@ function B() {
|
|
|
365
365
|
})] })
|
|
366
366
|
})]
|
|
367
367
|
})] }),
|
|
368
|
-
/* @__PURE__ */ P(
|
|
368
|
+
/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, { children: [
|
|
369
369
|
"Zones (",
|
|
370
370
|
r.zones.length,
|
|
371
371
|
")"
|
|
372
|
-
] }) }), /* @__PURE__ */ N(
|
|
372
|
+
] }) }), /* @__PURE__ */ N(c, { children: /* @__PURE__ */ N("div", {
|
|
373
373
|
className: "space-y-3",
|
|
374
374
|
children: r.zones.map((e) => /* @__PURE__ */ P("div", {
|
|
375
375
|
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
@@ -399,10 +399,10 @@ function B() {
|
|
|
399
399
|
})]
|
|
400
400
|
}, e.id))
|
|
401
401
|
}) })] }),
|
|
402
|
-
/* @__PURE__ */ P(
|
|
402
|
+
/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, {
|
|
403
403
|
className: "flex items-center gap-2",
|
|
404
404
|
children: [/* @__PURE__ */ N(x, { size: 18 }), " Operating Hours"]
|
|
405
|
-
}) }), /* @__PURE__ */ N(
|
|
405
|
+
}) }), /* @__PURE__ */ N(c, { children: /* @__PURE__ */ N("div", {
|
|
406
406
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
407
407
|
children: Object.entries(r.operatingHours).map(([e, t]) => /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
408
408
|
className: "text-sm font-medium",
|
|
@@ -416,14 +416,14 @@ function B() {
|
|
|
416
416
|
}), /* @__PURE__ */ P("div", {
|
|
417
417
|
className: "space-y-6",
|
|
418
418
|
children: [
|
|
419
|
-
/* @__PURE__ */ P(
|
|
419
|
+
/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, {
|
|
420
420
|
className: "flex items-center gap-2",
|
|
421
421
|
children: [/* @__PURE__ */ N(S, { size: 18 }), " Location"]
|
|
422
|
-
}) }), /* @__PURE__ */ N(
|
|
422
|
+
}) }), /* @__PURE__ */ N(c, { children: /* @__PURE__ */ N("p", {
|
|
423
423
|
className: "text-sm",
|
|
424
424
|
children: A(r.address)
|
|
425
425
|
}) })] }),
|
|
426
|
-
/* @__PURE__ */ P(
|
|
426
|
+
/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ N(l, { children: "Metrics" }) }), /* @__PURE__ */ P(c, {
|
|
427
427
|
className: "space-y-3",
|
|
428
428
|
children: [
|
|
429
429
|
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
@@ -459,7 +459,7 @@ function B() {
|
|
|
459
459
|
})] })
|
|
460
460
|
]
|
|
461
461
|
})] }),
|
|
462
|
-
/* @__PURE__ */ P(
|
|
462
|
+
/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, {
|
|
463
463
|
className: "flex items-center gap-2",
|
|
464
464
|
children: [
|
|
465
465
|
/* @__PURE__ */ N(T, { size: 18 }),
|
|
@@ -467,14 +467,14 @@ function B() {
|
|
|
467
467
|
r.staff.length,
|
|
468
468
|
")"
|
|
469
469
|
]
|
|
470
|
-
}) }), /* @__PURE__ */ N(
|
|
470
|
+
}) }), /* @__PURE__ */ N(c, { children: r.staff.length > 0 ? /* @__PURE__ */ N("div", {
|
|
471
471
|
className: "space-y-2",
|
|
472
472
|
children: r.staff.map((e, t) => /* @__PURE__ */ P("div", {
|
|
473
473
|
className: "flex items-center justify-between p-2 border rounded",
|
|
474
474
|
children: [/* @__PURE__ */ N("span", {
|
|
475
475
|
className: "text-sm capitalize",
|
|
476
476
|
children: e.role
|
|
477
|
-
}), /* @__PURE__ */ N(
|
|
477
|
+
}), /* @__PURE__ */ N(p, {
|
|
478
478
|
variant: "outline",
|
|
479
479
|
children: e.shift
|
|
480
480
|
})]
|