@burdenoff/microfe-movethewheels 2026.925.2 → 2026.929.1
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 +34 -31
- package/dist/constants/index.js +12 -5
- package/dist/hooks/useCustomers.js +0 -3
- package/dist/hooks/useFleet.js +148 -135
- package/dist/hooks/useInventory.js +146 -146
- package/dist/hooks/useRoutes.js +5 -14
- package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
- package/dist/movethewheels/constants/index.d.ts +1 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +17 -4
- package/dist/movethewheels/hooks/useInventory.d.ts +11 -0
- package/dist/movethewheels/types/index.d.ts +19 -75
- package/dist/pages/CustomerDetailsPage.js +666 -344
- package/dist/pages/CustomersPage.js +71 -80
- package/dist/pages/DriverDetailsPage.js +2 -2
- package/dist/pages/DriversPage.js +2 -2
- package/dist/pages/FleetPage.js +1 -3
- package/dist/pages/InventoryPage.js +5 -5
- package/dist/pages/RouteDetailsPage.js +273 -248
- package/dist/pages/RoutesPage.js +130 -67
- package/dist/pages/VehicleDetailsPage.js +527 -389
- package/dist/pages/VehiclesPage.js +120 -71
- package/dist/pages/WarehouseDetailsPage.js +411 -368
- package/dist/pages/WarehousesPage.js +132 -83
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +15 -7
- package/src/movethewheels/constants/index.ts +9 -0
- package/src/movethewheels/hooks/useCustomers.ts +0 -3
- package/src/movethewheels/hooks/useFleet.ts +89 -25
- package/src/movethewheels/hooks/useInventory.ts +77 -33
- 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/DriverDetailsPage.tsx +3 -1
- package/src/movethewheels/pages/DriversPage.tsx +5 -1
- package/src/movethewheels/pages/FleetPage.tsx +2 -1
- package/src/movethewheels/pages/InventoryPage.tsx +18 -6
- package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
- package/src/movethewheels/pages/RoutesPage.tsx +66 -2
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +185 -23
- package/src/movethewheels/pages/VehiclesPage.tsx +72 -5
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +217 -138
- package/src/movethewheels/pages/WarehousesPage.tsx +81 -17
- package/src/movethewheels/types/index.ts +28 -75
package/dist/pages/RoutesPage.js
CHANGED
|
@@ -1,84 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import { Filter as e } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
|
|
2
|
+
import { Navigation as t } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
|
|
3
|
+
import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
4
|
+
import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
5
|
+
import { joinPath as i } from "../utils/navigation.js";
|
|
6
|
+
import { useMoveTheWheels as a } from "../providers/MoveTheWheelsProvider.js";
|
|
7
|
+
import { useRouteStats as o, useRoutes as s } from "../hooks/useRoutes.js";
|
|
8
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "../components/ui.js";
|
|
9
|
+
import { PageLayout as _ } from "../components/PageLayout.js";
|
|
10
|
+
import { ROUTE_STATUS_COLORS as v } from "../constants/index.js";
|
|
11
|
+
import { StatusBadge as y } from "../components/StatusBadge.js";
|
|
12
|
+
import { DataTable as b } from "../components/DataTable.js";
|
|
13
|
+
import { formatDate as x } from "../utils/formatters.js";
|
|
14
|
+
import { useDebouncedValue as S } from "../hooks/useDebouncedValue.js";
|
|
15
|
+
import { useState as C } from "react";
|
|
16
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
17
|
+
import { CTAOverflowMenu as E, EmphasisPanel as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/movethewheels/pages/RoutesPage.tsx
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
var k = [
|
|
20
|
+
{
|
|
21
|
+
value: "all",
|
|
22
|
+
label: "All statuses"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: "planned",
|
|
26
|
+
label: "Planned"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
value: "in_progress",
|
|
30
|
+
label: "In Progress"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "completed",
|
|
34
|
+
label: "Completed"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "cancelled",
|
|
38
|
+
label: "Cancelled"
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
function A() {
|
|
42
|
+
let { basePath: A, navigate: j } = a(), [M, N] = C(0), [P, F] = C(25), [I, L] = C(""), [R, z] = C("all"), B = S(I), { routes: V, totalRoutes: H, hasMore: U, isLoading: W, error: G, refetch: K } = s({
|
|
43
|
+
limit: P,
|
|
44
|
+
offset: M * P,
|
|
45
|
+
search: B || void 0,
|
|
46
|
+
status: R === "all" ? void 0 : R
|
|
47
|
+
}), q = R !== "all" || I.length > 0, { stats: J } = o(), Y = (e) => j?.(i(A, e));
|
|
48
|
+
return /* @__PURE__ */ T(_, {
|
|
25
49
|
title: "Routes",
|
|
26
|
-
subtitle: `${
|
|
27
|
-
icon: /* @__PURE__ */
|
|
28
|
-
headerActions: /* @__PURE__ */
|
|
50
|
+
subtitle: `${J.totalRoutes} routes`,
|
|
51
|
+
icon: /* @__PURE__ */ w(t, { size: 24 }),
|
|
52
|
+
headerActions: /* @__PURE__ */ w(E, {
|
|
29
53
|
primary: {
|
|
30
54
|
label: "Create Route",
|
|
31
|
-
icon: /* @__PURE__ */
|
|
32
|
-
onSelect: () =>
|
|
55
|
+
icon: /* @__PURE__ */ w(n, { size: 16 }),
|
|
56
|
+
onSelect: () => Y("routes/new")
|
|
33
57
|
},
|
|
34
58
|
actions: [{
|
|
35
59
|
label: "Refresh",
|
|
36
|
-
icon: /* @__PURE__ */
|
|
37
|
-
onSelect: () =>
|
|
60
|
+
icon: /* @__PURE__ */ w(r, { size: 16 }),
|
|
61
|
+
onSelect: () => K()
|
|
38
62
|
}]
|
|
39
63
|
}),
|
|
40
64
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
icon: /* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ w(O, {
|
|
66
|
+
icon: /* @__PURE__ */ w(t, { size: 18 }),
|
|
43
67
|
children: "Routes group multiple delivery stops into an optimized driving plan. Build a route to batch nearby drop-offs, cut distance and fuel, and give drivers a single ordered itinerary — then open one to review stops, distance and optimization status."
|
|
44
68
|
}),
|
|
45
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ T(D, { children: [/* @__PURE__ */ w("p", {
|
|
46
70
|
className: "text-sm font-medium text-text-secondary",
|
|
47
71
|
children: "Routes at a glance"
|
|
48
|
-
}), /* @__PURE__ */
|
|
72
|
+
}), /* @__PURE__ */ T("div", {
|
|
49
73
|
className: "mt-3 grid grid-cols-3 gap-4",
|
|
50
74
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
52
76
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
53
|
-
children:
|
|
54
|
-
}), /* @__PURE__ */
|
|
77
|
+
children: J.totalRoutes
|
|
78
|
+
}), /* @__PURE__ */ w("p", {
|
|
55
79
|
className: "text-xs text-text-secondary",
|
|
56
80
|
children: "Total routes"
|
|
57
81
|
})] }),
|
|
58
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
59
83
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
60
|
-
children:
|
|
61
|
-
}), /* @__PURE__ */
|
|
84
|
+
children: J.inProgressRoutes
|
|
85
|
+
}), /* @__PURE__ */ w("p", {
|
|
62
86
|
className: "text-xs text-text-secondary",
|
|
63
87
|
children: "In progress"
|
|
64
88
|
})] }),
|
|
65
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
|
|
66
90
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
67
|
-
children:
|
|
68
|
-
}), /* @__PURE__ */
|
|
91
|
+
children: J.optimizedRoutes
|
|
92
|
+
}), /* @__PURE__ */ w("p", {
|
|
69
93
|
className: "text-xs text-text-secondary",
|
|
70
94
|
children: "Optimized"
|
|
71
95
|
})] })
|
|
72
96
|
]
|
|
73
97
|
})] }),
|
|
74
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ w(u, { children: /* @__PURE__ */ w(d, {
|
|
99
|
+
className: "p-4",
|
|
100
|
+
children: /* @__PURE__ */ T("div", {
|
|
101
|
+
className: "flex flex-wrap items-center gap-4",
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ T("div", {
|
|
104
|
+
className: "flex items-center gap-2",
|
|
105
|
+
children: [/* @__PURE__ */ w(e, {
|
|
106
|
+
size: 16,
|
|
107
|
+
className: "text-text-secondary"
|
|
108
|
+
}), /* @__PURE__ */ w("span", {
|
|
109
|
+
className: "text-sm font-medium",
|
|
110
|
+
children: "Filters:"
|
|
111
|
+
})]
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ T(f, {
|
|
114
|
+
value: R,
|
|
115
|
+
onValueChange: (e) => {
|
|
116
|
+
z(e), N(0);
|
|
117
|
+
},
|
|
118
|
+
children: [/* @__PURE__ */ w(h, {
|
|
119
|
+
className: "w-[180px]",
|
|
120
|
+
children: /* @__PURE__ */ w(g, { placeholder: "Status" })
|
|
121
|
+
}), /* @__PURE__ */ w(p, { children: k.map((e) => /* @__PURE__ */ w(m, {
|
|
122
|
+
value: e.value,
|
|
123
|
+
children: e.label
|
|
124
|
+
}, e.value)) })]
|
|
125
|
+
}),
|
|
126
|
+
q && /* @__PURE__ */ w(l, {
|
|
127
|
+
variant: "ghost",
|
|
128
|
+
size: "sm",
|
|
129
|
+
onClick: () => {
|
|
130
|
+
z("all"), L(""), N(0);
|
|
131
|
+
},
|
|
132
|
+
children: "Clear filters"
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
}) }),
|
|
137
|
+
/* @__PURE__ */ w(b, {
|
|
75
138
|
columns: [
|
|
76
139
|
{
|
|
77
140
|
id: "name",
|
|
78
141
|
header: "Route Name",
|
|
79
142
|
accessorKey: "name",
|
|
80
143
|
sortable: !0,
|
|
81
|
-
cell: (e) => /* @__PURE__ */
|
|
144
|
+
cell: (e) => /* @__PURE__ */ w("span", {
|
|
82
145
|
className: "font-medium",
|
|
83
146
|
children: e.name
|
|
84
147
|
})
|
|
@@ -88,15 +151,15 @@ function x() {
|
|
|
88
151
|
header: "Status",
|
|
89
152
|
accessorKey: "status",
|
|
90
153
|
sortable: !0,
|
|
91
|
-
cell: (e) => /* @__PURE__ */
|
|
154
|
+
cell: (e) => /* @__PURE__ */ w(y, {
|
|
92
155
|
status: e.status,
|
|
93
|
-
customColors:
|
|
156
|
+
customColors: v[e.status]
|
|
94
157
|
})
|
|
95
158
|
},
|
|
96
159
|
{
|
|
97
160
|
id: "stops",
|
|
98
161
|
header: "Stops",
|
|
99
|
-
cell: (e) => /* @__PURE__ */
|
|
162
|
+
cell: (e) => /* @__PURE__ */ T(c, {
|
|
100
163
|
variant: "secondary",
|
|
101
164
|
children: [e.stops.length, " stops"]
|
|
102
165
|
})
|
|
@@ -116,7 +179,7 @@ function x() {
|
|
|
116
179
|
{
|
|
117
180
|
id: "optimized",
|
|
118
181
|
header: "Optimized",
|
|
119
|
-
cell: (e) => /* @__PURE__ */
|
|
182
|
+
cell: (e) => /* @__PURE__ */ w(c, {
|
|
120
183
|
variant: e.optimized ? "default" : "outline",
|
|
121
184
|
children: e.optimized ? "Yes" : "No"
|
|
122
185
|
})
|
|
@@ -126,36 +189,36 @@ function x() {
|
|
|
126
189
|
header: "Created",
|
|
127
190
|
accessorKey: "createdAt",
|
|
128
191
|
sortable: !0,
|
|
129
|
-
cell: (e) =>
|
|
192
|
+
cell: (e) => x(e.createdAt, "short")
|
|
130
193
|
}
|
|
131
194
|
],
|
|
132
|
-
data:
|
|
133
|
-
isLoading:
|
|
134
|
-
error:
|
|
135
|
-
onRetry:
|
|
195
|
+
data: V,
|
|
196
|
+
isLoading: W,
|
|
197
|
+
error: G,
|
|
198
|
+
onRetry: K,
|
|
136
199
|
searchable: !0,
|
|
137
200
|
searchPlaceholder: "Search routes...",
|
|
138
201
|
searchFields: ["name"],
|
|
139
|
-
searchQuery:
|
|
202
|
+
searchQuery: I,
|
|
140
203
|
onSearchQueryChange: (e) => {
|
|
141
|
-
|
|
204
|
+
L(e), N(0);
|
|
142
205
|
},
|
|
143
|
-
onRowClick: (e) =>
|
|
206
|
+
onRowClick: (e) => Y(`routes/${e.id}`),
|
|
144
207
|
getRowId: (e) => e.id,
|
|
145
|
-
pageIndex:
|
|
146
|
-
pageSize:
|
|
147
|
-
onPageChange:
|
|
208
|
+
pageIndex: M,
|
|
209
|
+
pageSize: P,
|
|
210
|
+
onPageChange: N,
|
|
148
211
|
onPageSizeChange: (e) => {
|
|
149
|
-
|
|
212
|
+
F(e), N(0);
|
|
150
213
|
},
|
|
151
|
-
totalItems:
|
|
152
|
-
hasNextPage:
|
|
214
|
+
totalItems: H,
|
|
215
|
+
hasNextPage: U,
|
|
153
216
|
emptyIllustration: "empty-data",
|
|
154
217
|
emptyTitle: "No routes yet",
|
|
155
218
|
emptyDescription: "Create a route to batch deliveries into an optimized driving plan.",
|
|
156
|
-
emptyAction: /* @__PURE__ */
|
|
157
|
-
onClick: () =>
|
|
158
|
-
children: [/* @__PURE__ */
|
|
219
|
+
emptyAction: /* @__PURE__ */ T(l, {
|
|
220
|
+
onClick: () => Y("routes/new"),
|
|
221
|
+
children: [/* @__PURE__ */ w(n, {
|
|
159
222
|
size: 16,
|
|
160
223
|
className: "mr-1.5"
|
|
161
224
|
}), "Create Route"]
|
|
@@ -165,4 +228,4 @@ function x() {
|
|
|
165
228
|
});
|
|
166
229
|
}
|
|
167
230
|
//#endregion
|
|
168
|
-
export {
|
|
231
|
+
export { A as default };
|