@burdenoff/microfe-movethewheels 2026.925.2 → 2026.925.3
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/components/StatusBadge.js +30 -30
- package/dist/constants/index.js +12 -5
- package/dist/hooks/useCustomers.js +0 -3
- package/dist/hooks/useFleet.js +144 -131
- package/dist/hooks/useInventory.js +144 -145
- package/dist/hooks/useRoutes.js +5 -14
- package/dist/movethewheels/constants/index.d.ts +1 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +13 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
- package/dist/movethewheels/types/index.d.ts +13 -70
- package/dist/pages/CustomerDetailsPage.js +666 -344
- package/dist/pages/CustomersPage.js +71 -80
- package/dist/pages/FleetPage.js +1 -3
- package/dist/pages/InventoryPage.js +4 -4
- package/dist/pages/RouteDetailsPage.js +273 -248
- package/dist/pages/RoutesPage.js +130 -67
- package/dist/pages/VehicleDetailsPage.js +506 -391
- package/dist/pages/VehiclesPage.js +119 -70
- package/dist/pages/WarehouseDetailsPage.js +410 -370
- package/dist/pages/WarehousesPage.js +131 -82
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +8 -3
- package/src/movethewheels/constants/index.ts +9 -0
- package/src/movethewheels/hooks/useCustomers.ts +0 -3
- package/src/movethewheels/hooks/useFleet.ts +74 -19
- package/src/movethewheels/hooks/useInventory.ts +76 -32
- package/src/movethewheels/hooks/useRoutes.ts +17 -12
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
- package/src/movethewheels/pages/CustomersPage.tsx +6 -15
- package/src/movethewheels/pages/FleetPage.tsx +2 -1
- package/src/movethewheels/pages/InventoryPage.tsx +14 -5
- package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
- package/src/movethewheels/pages/RoutesPage.tsx +66 -2
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +151 -11
- package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
- package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
- package/src/movethewheels/types/index.ts +14 -70
|
@@ -1,97 +1,146 @@
|
|
|
1
1
|
import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
2
2
|
import { Download as t } from "../node_modules/lucide-react/dist/esm/icons/download.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Filter as n } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
|
|
4
|
+
import { Plus as r } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
5
|
+
import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
5
6
|
import { Route as i } from "../node_modules/lucide-react/dist/esm/icons/route.js";
|
|
6
7
|
import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
7
8
|
import { Wrench as o } from "../node_modules/lucide-react/dist/esm/icons/wrench.js";
|
|
8
9
|
import { joinPath as s } from "../utils/navigation.js";
|
|
9
10
|
import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
|
|
10
11
|
import { useFleetStats as l, useVehicles as u } from "../hooks/useFleet.js";
|
|
11
|
-
import {
|
|
12
|
-
import { PageLayout as
|
|
13
|
-
import { MetricCard as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
12
|
+
import { Button as d, Card as f, CardContent as p, Progress as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "../components/ui.js";
|
|
13
|
+
import { PageLayout as b } from "../components/PageLayout.js";
|
|
14
|
+
import { MetricCard as x, MetricGrid as S } from "../components/MetricCard.js";
|
|
15
|
+
import { VEHICLE_STATUS_LABELS as C } from "../constants/index.js";
|
|
16
|
+
import { StatusBadge as w, VehicleTypeBadge as T } from "../components/StatusBadge.js";
|
|
17
|
+
import { DataTable as E } from "../components/DataTable.js";
|
|
18
|
+
import { useDebouncedValue as D } from "../hooks/useDebouncedValue.js";
|
|
19
|
+
import { useState as O } from "react";
|
|
20
|
+
import { jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
21
|
+
import { CTAOverflowMenu as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
|
|
20
22
|
//#region src/movethewheels/pages/VehiclesPage.tsx
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
var N = [{
|
|
24
|
+
value: "all",
|
|
25
|
+
label: "All statuses"
|
|
26
|
+
}, ...Object.entries(C).map(([e, t]) => ({
|
|
27
|
+
value: e,
|
|
28
|
+
label: t
|
|
29
|
+
}))];
|
|
30
|
+
function P() {
|
|
31
|
+
let { basePath: C, navigate: P } = c(), [F, I] = O(0), [L, R] = O(25), [z, B] = O(""), [V, H] = O("all"), U = D(z), { vehicles: W, totalVehicles: G, hasMore: K, isLoading: q, error: J, refetch: Y } = u({
|
|
32
|
+
limit: L,
|
|
33
|
+
offset: F * L,
|
|
34
|
+
search: U || void 0,
|
|
35
|
+
status: V === "all" ? void 0 : V
|
|
36
|
+
}), X = V !== "all" || z.length > 0, { stats: Z } = l(), Q = Z.totalVehicles, $ = (e) => {
|
|
37
|
+
P && P(s(C, e));
|
|
28
38
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ A(b, {
|
|
30
40
|
title: "Vehicles",
|
|
31
|
-
subtitle: `${
|
|
32
|
-
icon: /* @__PURE__ */
|
|
33
|
-
headerActions: /* @__PURE__ */
|
|
41
|
+
subtitle: `${Q} vehicles in fleet`,
|
|
42
|
+
icon: /* @__PURE__ */ k(a, { size: 24 }),
|
|
43
|
+
headerActions: /* @__PURE__ */ k(j, {
|
|
34
44
|
primary: {
|
|
35
45
|
label: "Add Vehicle",
|
|
36
|
-
icon: /* @__PURE__ */
|
|
37
|
-
onSelect: () =>
|
|
46
|
+
icon: /* @__PURE__ */ k(r, { size: 16 }),
|
|
47
|
+
onSelect: () => $("fleet/vehicles/new")
|
|
38
48
|
},
|
|
39
49
|
actions: [{
|
|
40
50
|
label: "Refresh",
|
|
41
|
-
icon: /* @__PURE__ */
|
|
42
|
-
onSelect: () =>
|
|
51
|
+
icon: /* @__PURE__ */ k(ee, { size: 16 }),
|
|
52
|
+
onSelect: () => Y()
|
|
43
53
|
}, {
|
|
44
54
|
label: "Export",
|
|
45
|
-
icon: /* @__PURE__ */
|
|
46
|
-
onSelect: () =>
|
|
55
|
+
icon: /* @__PURE__ */ k(t, { size: 16 }),
|
|
56
|
+
onSelect: () => $("import-export")
|
|
47
57
|
}]
|
|
48
58
|
}),
|
|
49
59
|
children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
icon: /* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ k(M, {
|
|
61
|
+
icon: /* @__PURE__ */ k(a, { size: 18 }),
|
|
52
62
|
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."
|
|
53
63
|
}),
|
|
54
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
55
65
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
56
66
|
children: "Fleet at a glance"
|
|
57
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ A(S, {
|
|
58
68
|
columns: 4,
|
|
59
69
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ k(x, {
|
|
61
71
|
label: "Total vehicles",
|
|
62
|
-
value:
|
|
63
|
-
icon: /* @__PURE__ */
|
|
72
|
+
value: Q,
|
|
73
|
+
icon: /* @__PURE__ */ k(a, { size: 20 }),
|
|
64
74
|
accent: "brand"
|
|
65
75
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ k(x, {
|
|
67
77
|
label: "Available now",
|
|
68
|
-
value:
|
|
69
|
-
icon: /* @__PURE__ */
|
|
78
|
+
value: Z.vehiclesByStatus.available,
|
|
79
|
+
icon: /* @__PURE__ */ k(e, { size: 20 }),
|
|
70
80
|
accent: "success",
|
|
71
81
|
subtitle: "Ready to dispatch"
|
|
72
82
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ k(x, {
|
|
74
84
|
label: "On assignment",
|
|
75
|
-
value:
|
|
76
|
-
icon: /* @__PURE__ */
|
|
85
|
+
value: Z.vehiclesByStatus.assigned,
|
|
86
|
+
icon: /* @__PURE__ */ k(i, { size: 20 }),
|
|
77
87
|
accent: "blue"
|
|
78
88
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ k(x, {
|
|
80
90
|
label: "In maintenance",
|
|
81
|
-
value:
|
|
82
|
-
icon: /* @__PURE__ */
|
|
91
|
+
value: Z.vehiclesByStatus.maintenance,
|
|
92
|
+
icon: /* @__PURE__ */ k(o, { size: 20 }),
|
|
83
93
|
accent: "warning"
|
|
84
94
|
})
|
|
85
95
|
]
|
|
86
96
|
})] }),
|
|
87
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ k(f, { children: /* @__PURE__ */ k(p, {
|
|
98
|
+
className: "p-4",
|
|
99
|
+
children: /* @__PURE__ */ A("div", {
|
|
100
|
+
className: "flex flex-wrap items-center gap-4",
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ A("div", {
|
|
103
|
+
className: "flex items-center gap-2",
|
|
104
|
+
children: [/* @__PURE__ */ k(n, {
|
|
105
|
+
size: 16,
|
|
106
|
+
className: "text-text-secondary"
|
|
107
|
+
}), /* @__PURE__ */ k("span", {
|
|
108
|
+
className: "text-sm font-medium",
|
|
109
|
+
children: "Filters:"
|
|
110
|
+
})]
|
|
111
|
+
}),
|
|
112
|
+
/* @__PURE__ */ A(h, {
|
|
113
|
+
value: V,
|
|
114
|
+
onValueChange: (e) => {
|
|
115
|
+
H(e), I(0);
|
|
116
|
+
},
|
|
117
|
+
children: [/* @__PURE__ */ k(v, {
|
|
118
|
+
className: "w-[180px]",
|
|
119
|
+
children: /* @__PURE__ */ k(y, { placeholder: "Status" })
|
|
120
|
+
}), /* @__PURE__ */ k(g, { children: N.map((e) => /* @__PURE__ */ k(_, {
|
|
121
|
+
value: e.value,
|
|
122
|
+
children: e.label
|
|
123
|
+
}, e.value)) })]
|
|
124
|
+
}),
|
|
125
|
+
X && /* @__PURE__ */ k(d, {
|
|
126
|
+
variant: "ghost",
|
|
127
|
+
size: "sm",
|
|
128
|
+
onClick: () => {
|
|
129
|
+
H("all"), B(""), I(0);
|
|
130
|
+
},
|
|
131
|
+
children: "Clear filters"
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
})
|
|
135
|
+
}) }),
|
|
136
|
+
/* @__PURE__ */ k(E, {
|
|
88
137
|
columns: [
|
|
89
138
|
{
|
|
90
139
|
id: "vehicleNumber",
|
|
91
140
|
header: "Vehicle #",
|
|
92
141
|
accessorKey: "vehicleNumber",
|
|
93
142
|
sortable: !0,
|
|
94
|
-
cell: (e) => /* @__PURE__ */
|
|
143
|
+
cell: (e) => /* @__PURE__ */ k("span", {
|
|
95
144
|
className: "font-medium",
|
|
96
145
|
children: e.vehicleNumber
|
|
97
146
|
})
|
|
@@ -100,21 +149,21 @@ function w() {
|
|
|
100
149
|
id: "type",
|
|
101
150
|
header: "Type",
|
|
102
151
|
accessorKey: "type",
|
|
103
|
-
cell: (e) => /* @__PURE__ */
|
|
152
|
+
cell: (e) => /* @__PURE__ */ k(T, { type: e.type })
|
|
104
153
|
},
|
|
105
154
|
{
|
|
106
155
|
id: "details",
|
|
107
156
|
header: "Vehicle",
|
|
108
|
-
cell: (e) => /* @__PURE__ */
|
|
157
|
+
cell: (e) => /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("p", {
|
|
109
158
|
className: "font-medium",
|
|
110
159
|
children: [
|
|
111
160
|
e.make,
|
|
112
161
|
" ",
|
|
113
162
|
e.model
|
|
114
163
|
]
|
|
115
|
-
}), /* @__PURE__ */
|
|
164
|
+
}), /* @__PURE__ */ k("p", {
|
|
116
165
|
className: "text-sm text-text-secondary",
|
|
117
|
-
children: e.year
|
|
166
|
+
children: e.year ?? "—"
|
|
118
167
|
})] })
|
|
119
168
|
},
|
|
120
169
|
{
|
|
@@ -122,7 +171,7 @@ function w() {
|
|
|
122
171
|
header: "Status",
|
|
123
172
|
accessorKey: "status",
|
|
124
173
|
sortable: !0,
|
|
125
|
-
cell: (e) => /* @__PURE__ */
|
|
174
|
+
cell: (e) => /* @__PURE__ */ k(w, {
|
|
126
175
|
status: e.status,
|
|
127
176
|
type: "vehicle"
|
|
128
177
|
})
|
|
@@ -130,9 +179,9 @@ function w() {
|
|
|
130
179
|
{
|
|
131
180
|
id: "capacity",
|
|
132
181
|
header: "Capacity",
|
|
133
|
-
cell: (e) => /* @__PURE__ */
|
|
182
|
+
cell: (e) => /* @__PURE__ */ A("div", {
|
|
134
183
|
className: "text-sm",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ A("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ A("p", {
|
|
136
185
|
className: "text-text-secondary",
|
|
137
186
|
children: [e.capacity.volume, " m³"]
|
|
138
187
|
})]
|
|
@@ -141,12 +190,12 @@ function w() {
|
|
|
141
190
|
{
|
|
142
191
|
id: "fuel",
|
|
143
192
|
header: "Fuel Level",
|
|
144
|
-
cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */
|
|
193
|
+
cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */ A("div", {
|
|
145
194
|
className: "flex items-center gap-2",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
195
|
+
children: [/* @__PURE__ */ k(m, {
|
|
147
196
|
value: e.fuelLevel,
|
|
148
197
|
className: "w-16 h-2"
|
|
149
|
-
}), /* @__PURE__ */
|
|
198
|
+
}), /* @__PURE__ */ A("span", {
|
|
150
199
|
className: "text-sm",
|
|
151
200
|
children: [e.fuelLevel, "%"]
|
|
152
201
|
})]
|
|
@@ -160,10 +209,10 @@ function w() {
|
|
|
160
209
|
cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
|
|
161
210
|
}
|
|
162
211
|
],
|
|
163
|
-
data:
|
|
164
|
-
isLoading:
|
|
165
|
-
error:
|
|
166
|
-
onRetry:
|
|
212
|
+
data: W,
|
|
213
|
+
isLoading: q,
|
|
214
|
+
error: J,
|
|
215
|
+
onRetry: Y,
|
|
167
216
|
searchable: !0,
|
|
168
217
|
searchPlaceholder: "Search vehicles...",
|
|
169
218
|
searchFields: [
|
|
@@ -171,20 +220,20 @@ function w() {
|
|
|
171
220
|
"make",
|
|
172
221
|
"model"
|
|
173
222
|
],
|
|
174
|
-
searchQuery:
|
|
223
|
+
searchQuery: z,
|
|
175
224
|
onSearchQueryChange: (e) => {
|
|
176
|
-
|
|
225
|
+
B(e), I(0);
|
|
177
226
|
},
|
|
178
|
-
onRowClick: (e) =>
|
|
227
|
+
onRowClick: (e) => $(`fleet/vehicles/${e.id}`),
|
|
179
228
|
getRowId: (e) => e.id,
|
|
180
|
-
pageIndex:
|
|
181
|
-
pageSize:
|
|
182
|
-
onPageChange:
|
|
229
|
+
pageIndex: F,
|
|
230
|
+
pageSize: L,
|
|
231
|
+
onPageChange: I,
|
|
183
232
|
onPageSizeChange: (e) => {
|
|
184
|
-
|
|
233
|
+
R(e), I(0);
|
|
185
234
|
},
|
|
186
|
-
totalItems:
|
|
187
|
-
hasNextPage:
|
|
235
|
+
totalItems: G,
|
|
236
|
+
hasNextPage: K,
|
|
188
237
|
emptyIllustration: "empty-data",
|
|
189
238
|
emptyTitle: "No vehicles yet",
|
|
190
239
|
emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
|
|
@@ -193,4 +242,4 @@ function w() {
|
|
|
193
242
|
});
|
|
194
243
|
}
|
|
195
244
|
//#endregion
|
|
196
|
-
export {
|
|
245
|
+
export { P as default };
|