@burdenoff/microfe-movethewheels 2026.703.1 → 2026.703.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/{AIAssistantPage-C3ovZ0Fh.js → AIAssistantPage-C3cPsWt-.js} +1 -1
- package/dist/{AnalyticsPage-O8SpY-V4.js → AnalyticsPage-Dz6g2MvK.js} +6 -6
- package/dist/{CreateOrderPage-CB1_-_mN.js → CreateOrderPage-C5iwnjp4.js} +29 -58
- package/dist/CustomerDetailsPage-B6nwFyLO.js +406 -0
- package/dist/{CustomersPage-DRaLuHMC.js → CustomersPage-BKxMS1AV.js} +5 -5
- package/dist/{DashboardPage-DPjhNfKB.js → DashboardPage-BVjQi0EB.js} +11 -11
- package/dist/DriverDetailsPage-CN3WQ0B9.js +507 -0
- package/dist/{DriversPage-C2Bk0w4Q.js → DriversPage-CH9rjQC-.js} +6 -6
- package/dist/{FinancePage-lmp0Sdsw.js → FinancePage-DEDykSOP.js} +5 -5
- package/dist/{FleetPage-DZn5pIqd.js → FleetPage-DqkFi3s3.js} +5 -5
- package/dist/FormError-BlOjnXOq.js +15 -0
- package/dist/{ImportExportPage-BIUJZc7O.js → ImportExportPage-DKJRCezl.js} +1 -1
- package/dist/{InventoryPage-Cxh1zYJd.js → InventoryPage-e0ze63iX.js} +6 -6
- package/dist/{LiveTrackingPage-BY1yAkIt.js → LiveTrackingPage-DCX-K-LR.js} +5 -5
- package/dist/{MarketplacePage-RMuL17EA.js → MarketplacePage-CIQ97_zp.js} +1 -1
- package/dist/{OrderDetailsPage-C2Mf4KSy.js → OrderDetailsPage-DYiZ-9UK.js} +5 -5
- package/dist/{OrdersListPage-BrPBtnhp.js → OrdersListPage-Cn90P1Xx.js} +4 -4
- package/dist/ProductDetailsPage-C9uOiYLp.js +350 -0
- package/dist/{ProductsPage-I5DilIoY.js → ProductsPage-QJfHHpqB.js} +4 -4
- package/dist/{ReportsPage-BDXNmUng.js → ReportsPage-Zp53q3_8.js} +2 -2
- package/dist/RouteDetailsPage-DUStXSf9.js +531 -0
- package/dist/{RoutesPage-lqX9ylHP.js → RoutesPage-DMfoicM1.js} +3 -3
- package/dist/{SettingsPage-CQVIOaNs.js → SettingsPage-Bn-v0mbQ.js} +1 -1
- package/dist/{TrackingPage-BXrjz7V8.js → TrackingPage-W-jtdM3Y.js} +4 -4
- package/dist/VehicleDetailsPage-Bceo5oz3.js +410 -0
- package/dist/{VehiclesPage-6W39XT5W.js → VehiclesPage-ApKThYeG.js} +5 -5
- package/dist/WarehouseDetailsPage-L_6sWigM.js +493 -0
- package/dist/{WarehousesPage-CHvBqNaQ.js → WarehousesPage-DCbXXXWE.js} +3 -3
- package/dist/index.js +154 -138
- package/dist/trash-2-BKhar6Hs.js +32 -0
- package/dist/{useFleet-DiAC-IiH.js → useFleet-DKqXZ16m.js} +77 -56
- package/dist/{useInventory-DKoks37x.js → useInventory-DkyiVY_A.js} +73 -53
- package/dist/{useTracking-GJify4HN.js → useTracking-B-va1kO3.js} +2 -2
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
- package/src/movethewheels/components/FormError.tsx +25 -0
- package/src/movethewheels/hooks/useFleet.ts +107 -0
- package/src/movethewheels/hooks/useInventory.ts +107 -0
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +153 -20
- package/src/movethewheels/pages/CustomersPage.tsx +1 -1
- package/src/movethewheels/pages/DriverDetailsPage.tsx +159 -2
- package/src/movethewheels/pages/DriversPage.tsx +6 -2
- package/src/movethewheels/pages/InventoryPage.tsx +1 -1
- package/src/movethewheels/pages/OrdersListPage.tsx +1 -1
- package/src/movethewheels/pages/ProductDetailsPage.tsx +146 -3
- package/src/movethewheels/pages/ProductsPage.tsx +6 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +285 -25
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +158 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +6 -2
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +224 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +5 -1
- package/dist/CustomerDetailsPage-BaeKEI1D.js +0 -263
- package/dist/DriverDetailsPage-CSSQTOzn.js +0 -328
- package/dist/ProductDetailsPage-CezzzZcj.js +0 -193
- package/dist/RouteDetailsPage-BcomL20M.js +0 -263
- package/dist/VehicleDetailsPage-DZjLcJgr.js +0 -218
- package/dist/WarehouseDetailsPage-C10pgRGW.js +0 -236
- /package/dist/{MetricCard-7aYgzZHK.js → MetricCard-BY0QrMD4.js} +0 -0
- /package/dist/{StatusBadge-NpTeHVlw.js → StatusBadge-BZurYHMy.js} +0 -0
- /package/dist/{formatters-DhKZ-eA1.js → formatters-CF2S2l1m.js} +0 -0
- /package/dist/{trending-up-B7W-GL6P.js → trending-up-Dohgd4t_.js} +0 -0
- /package/dist/{triangle-alert-BonHFFNz.js → triangle-alert-i-XQL9Rd.js} +0 -0
- /package/dist/{truck-DrlfSpRC.js → truck-C0v_hbLR.js} +0 -0
- /package/dist/{useAnalytics-CgdzUfY_.js → useAnalytics-DS8n0xgg.js} +0 -0
- /package/dist/{useCustomers-QrlozybF.js → useCustomers-BmTNGxiI.js} +0 -0
- /package/dist/{useImportExport-BLMnAKCC.js → useImportExport-DHr-SWSw.js} +0 -0
- /package/dist/{useOrders-D3UZVy8Y.js → useOrders-Cfk1GLiq.js} +0 -0
- /package/dist/{useReports-Puq4DCH9.js → useReports-CTqZr-AB.js} +0 -0
- /package/dist/{useRoutes-Do57LvRb.js → useRoutes-BQWO607N.js} +0 -0
- /package/dist/{user-CjSoudeu.js → user-jyFU3lXk.js} +0 -0
- /package/dist/{users-BAM4gHTn.js → users-DZ-ilS6B.js} +0 -0
- /package/dist/{warehouse-C7MSr47B.js → warehouse-6m5kXMLu.js} +0 -0
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import { A as e, F as t, I as n, L as r, P as i, R as a, ct 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, ot as g, r as _, u as v } from "./PageLayout-D4LDHJJq.js";
|
|
2
|
+
import { t as y } from "./arrow-left-n48Y-Wis.js";
|
|
3
|
+
import { t as b } from "./circle-check-big-w0TrLKMF.js";
|
|
4
|
+
import { t as x } from "./clock-DJZtdl8u.js";
|
|
5
|
+
import { t as S } from "./map-pin-BGiCvyCs.js";
|
|
6
|
+
import { t as C } from "./navigation-D36prnAn.js";
|
|
7
|
+
import { t as w } from "./plus-Z76q-FZm.js";
|
|
8
|
+
import { t as T } from "./save-CojywNhG.js";
|
|
9
|
+
import { t as E } from "./square-pen-CopE9GmB.js";
|
|
10
|
+
import { t as D } from "./trash-2-BKhar6Hs.js";
|
|
11
|
+
import { r as O } from "./useFleet-DKqXZ16m.js";
|
|
12
|
+
import { r as k, t as A } from "./useRoutes-BQWO607N.js";
|
|
13
|
+
import { o as j, r as M } from "./StatusBadge-BZurYHMy.js";
|
|
14
|
+
import { r as N, t as P } from "./formatters-CF2S2l1m.js";
|
|
15
|
+
import { t as F } from "./FormError-BlOjnXOq.js";
|
|
16
|
+
import { useState as I } from "react";
|
|
17
|
+
import { useParams as L } from "react-router-dom";
|
|
18
|
+
import { jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
19
|
+
import { EmphasisPanel as B, NextSteps as V, PagePurpose as H } from "@burdenoff/fe-libs/ui";
|
|
20
|
+
//#region node_modules/lucide-react/dist/esm/icons/zap.js
|
|
21
|
+
var U = m("Zap", [["path", {
|
|
22
|
+
d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",
|
|
23
|
+
key: "1xq2db"
|
|
24
|
+
}]]), W = [
|
|
25
|
+
{
|
|
26
|
+
value: "planned",
|
|
27
|
+
label: "Planned"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "in_progress",
|
|
31
|
+
label: "In Progress"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
value: "completed",
|
|
35
|
+
label: "Completed"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: "cancelled",
|
|
39
|
+
label: "Cancelled"
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
function G() {
|
|
43
|
+
let { basePath: p, navigate: m } = g(), { createRoute: h } = k(), { vehicles: _, drivers: b } = O(), [x, S] = I({
|
|
44
|
+
name: "",
|
|
45
|
+
status: "planned",
|
|
46
|
+
vehicleId: "",
|
|
47
|
+
driverId: "",
|
|
48
|
+
stops: [{
|
|
49
|
+
address: "",
|
|
50
|
+
type: "delivery"
|
|
51
|
+
}]
|
|
52
|
+
}), [E, A] = I(!1), [j, M] = I(null), N = () => m?.(o(p, "routes")), P = () => S((e) => ({
|
|
53
|
+
...e,
|
|
54
|
+
stops: [...e.stops, {
|
|
55
|
+
address: "",
|
|
56
|
+
type: "delivery"
|
|
57
|
+
}]
|
|
58
|
+
})), L = (e) => S((t) => ({
|
|
59
|
+
...t,
|
|
60
|
+
stops: t.stops.filter((t, n) => n !== e)
|
|
61
|
+
})), V = (e, t, n) => S((r) => ({
|
|
62
|
+
...r,
|
|
63
|
+
stops: r.stops.map((r, i) => i === e ? {
|
|
64
|
+
...r,
|
|
65
|
+
[t]: n
|
|
66
|
+
} : r)
|
|
67
|
+
})), U = async (e) => {
|
|
68
|
+
if (e.preventDefault(), !x.name.trim()) {
|
|
69
|
+
M("Route name is required.");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let t = x.stops.filter((e) => e.address.trim());
|
|
73
|
+
if (t.length === 0) {
|
|
74
|
+
M("Add at least one stop with an address.");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
A(!0), M(null);
|
|
78
|
+
try {
|
|
79
|
+
let e = t.map((e, t) => ({
|
|
80
|
+
id: `stop-${t + 1}`,
|
|
81
|
+
orderId: "",
|
|
82
|
+
sequence: t + 1,
|
|
83
|
+
address: {
|
|
84
|
+
street: e.address.trim(),
|
|
85
|
+
city: "",
|
|
86
|
+
state: "",
|
|
87
|
+
postalCode: "",
|
|
88
|
+
country: ""
|
|
89
|
+
},
|
|
90
|
+
type: e.type,
|
|
91
|
+
scheduledTime: /* @__PURE__ */ new Date(),
|
|
92
|
+
duration: 0,
|
|
93
|
+
status: "pending"
|
|
94
|
+
})), n = await h({
|
|
95
|
+
name: x.name.trim(),
|
|
96
|
+
status: x.status,
|
|
97
|
+
vehicleId: x.vehicleId || void 0,
|
|
98
|
+
driverId: x.driverId || void 0,
|
|
99
|
+
stops: e
|
|
100
|
+
});
|
|
101
|
+
m?.(o(p, `routes/${n.id}`));
|
|
102
|
+
} catch (e) {
|
|
103
|
+
console.error("Failed to create route:", e), M(e instanceof Error ? e.message : "Failed to create route. Please try again."), A(!1);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return /* @__PURE__ */ z(d, {
|
|
107
|
+
title: "Create Route",
|
|
108
|
+
subtitle: "Plan a new delivery route",
|
|
109
|
+
icon: /* @__PURE__ */ R(C, { size: 24 }),
|
|
110
|
+
headerActions: /* @__PURE__ */ z("div", {
|
|
111
|
+
className: "flex gap-2",
|
|
112
|
+
children: [/* @__PURE__ */ z(v, {
|
|
113
|
+
variant: "outline",
|
|
114
|
+
onClick: N,
|
|
115
|
+
disabled: E,
|
|
116
|
+
children: [/* @__PURE__ */ R(y, { size: 16 }), " Cancel"]
|
|
117
|
+
}), /* @__PURE__ */ z(v, {
|
|
118
|
+
onClick: U,
|
|
119
|
+
disabled: E,
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ R(T, { size: 16 }),
|
|
122
|
+
" ",
|
|
123
|
+
E ? "Saving..." : "Create Route"
|
|
124
|
+
]
|
|
125
|
+
})]
|
|
126
|
+
}),
|
|
127
|
+
children: [/* @__PURE__ */ R(H, {
|
|
128
|
+
icon: /* @__PURE__ */ R(C, { size: 18 }),
|
|
129
|
+
children: "Plan a new delivery route — name it, list the stops to visit, and optionally assign a vehicle and driver. Once created you can optimize it to sequence the stops into the shortest run."
|
|
130
|
+
}), /* @__PURE__ */ z("form", {
|
|
131
|
+
onSubmit: U,
|
|
132
|
+
className: "max-w-3xl space-y-6",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ R(F, { message: j }),
|
|
135
|
+
/* @__PURE__ */ z(B, { children: [/* @__PURE__ */ R("h2", {
|
|
136
|
+
className: "text-base font-semibold text-text-primary mb-4",
|
|
137
|
+
children: "Route Details"
|
|
138
|
+
}), /* @__PURE__ */ z("div", {
|
|
139
|
+
className: "space-y-4",
|
|
140
|
+
children: [/* @__PURE__ */ z("div", {
|
|
141
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
142
|
+
children: [/* @__PURE__ */ z("div", {
|
|
143
|
+
className: "space-y-2",
|
|
144
|
+
children: [/* @__PURE__ */ z(f, {
|
|
145
|
+
htmlFor: "name",
|
|
146
|
+
children: ["Route Name ", /* @__PURE__ */ R("span", {
|
|
147
|
+
className: "text-status-error-text",
|
|
148
|
+
children: "*"
|
|
149
|
+
})]
|
|
150
|
+
}), /* @__PURE__ */ R(e, {
|
|
151
|
+
id: "name",
|
|
152
|
+
value: x.name,
|
|
153
|
+
onChange: (e) => S((t) => ({
|
|
154
|
+
...t,
|
|
155
|
+
name: e.target.value
|
|
156
|
+
})),
|
|
157
|
+
placeholder: "Downtown morning run",
|
|
158
|
+
required: !0
|
|
159
|
+
})]
|
|
160
|
+
}), /* @__PURE__ */ z("div", {
|
|
161
|
+
className: "space-y-2",
|
|
162
|
+
children: [/* @__PURE__ */ R(f, {
|
|
163
|
+
htmlFor: "status",
|
|
164
|
+
children: "Status"
|
|
165
|
+
}), /* @__PURE__ */ z(i, {
|
|
166
|
+
value: x.status,
|
|
167
|
+
onValueChange: (e) => S((t) => ({
|
|
168
|
+
...t,
|
|
169
|
+
status: e
|
|
170
|
+
})),
|
|
171
|
+
children: [/* @__PURE__ */ R(r, {
|
|
172
|
+
id: "status",
|
|
173
|
+
children: /* @__PURE__ */ R(a, {})
|
|
174
|
+
}), /* @__PURE__ */ R(t, { children: W.map((e) => /* @__PURE__ */ R(n, {
|
|
175
|
+
value: e.value,
|
|
176
|
+
children: e.label
|
|
177
|
+
}, e.value)) })]
|
|
178
|
+
})]
|
|
179
|
+
})]
|
|
180
|
+
}), /* @__PURE__ */ z("div", {
|
|
181
|
+
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
182
|
+
children: [/* @__PURE__ */ z("div", {
|
|
183
|
+
className: "space-y-2",
|
|
184
|
+
children: [/* @__PURE__ */ R(f, {
|
|
185
|
+
htmlFor: "vehicle",
|
|
186
|
+
children: "Vehicle (optional)"
|
|
187
|
+
}), /* @__PURE__ */ z(i, {
|
|
188
|
+
value: x.vehicleId,
|
|
189
|
+
onValueChange: (e) => S((t) => ({
|
|
190
|
+
...t,
|
|
191
|
+
vehicleId: e
|
|
192
|
+
})),
|
|
193
|
+
children: [/* @__PURE__ */ R(r, {
|
|
194
|
+
id: "vehicle",
|
|
195
|
+
children: /* @__PURE__ */ R(a, { placeholder: "Assign later" })
|
|
196
|
+
}), /* @__PURE__ */ R(t, { children: _.map((e) => /* @__PURE__ */ z(n, {
|
|
197
|
+
value: e.id,
|
|
198
|
+
children: [
|
|
199
|
+
e.vehicleNumber,
|
|
200
|
+
" (",
|
|
201
|
+
e.type,
|
|
202
|
+
")"
|
|
203
|
+
]
|
|
204
|
+
}, e.id)) })]
|
|
205
|
+
})]
|
|
206
|
+
}), /* @__PURE__ */ z("div", {
|
|
207
|
+
className: "space-y-2",
|
|
208
|
+
children: [/* @__PURE__ */ R(f, {
|
|
209
|
+
htmlFor: "driver",
|
|
210
|
+
children: "Driver (optional)"
|
|
211
|
+
}), /* @__PURE__ */ z(i, {
|
|
212
|
+
value: x.driverId,
|
|
213
|
+
onValueChange: (e) => S((t) => ({
|
|
214
|
+
...t,
|
|
215
|
+
driverId: e
|
|
216
|
+
})),
|
|
217
|
+
children: [/* @__PURE__ */ R(r, {
|
|
218
|
+
id: "driver",
|
|
219
|
+
children: /* @__PURE__ */ R(a, { placeholder: "Assign later" })
|
|
220
|
+
}), /* @__PURE__ */ R(t, { children: b.map((e) => /* @__PURE__ */ z(n, {
|
|
221
|
+
value: e.id,
|
|
222
|
+
children: [
|
|
223
|
+
e.fullName,
|
|
224
|
+
" (",
|
|
225
|
+
e.employeeId,
|
|
226
|
+
")"
|
|
227
|
+
]
|
|
228
|
+
}, e.id)) })]
|
|
229
|
+
})]
|
|
230
|
+
})]
|
|
231
|
+
})]
|
|
232
|
+
})] }),
|
|
233
|
+
/* @__PURE__ */ z(s, { children: [/* @__PURE__ */ z(u, {
|
|
234
|
+
className: "flex flex-row items-center justify-between",
|
|
235
|
+
children: [/* @__PURE__ */ z(l, { children: ["Stops ", /* @__PURE__ */ R("span", {
|
|
236
|
+
className: "text-status-error-text",
|
|
237
|
+
children: "*"
|
|
238
|
+
})] }), /* @__PURE__ */ z(v, {
|
|
239
|
+
type: "button",
|
|
240
|
+
variant: "outline",
|
|
241
|
+
size: "sm",
|
|
242
|
+
onClick: P,
|
|
243
|
+
children: [/* @__PURE__ */ R(w, { size: 16 }), " Add Stop"]
|
|
244
|
+
})]
|
|
245
|
+
}), /* @__PURE__ */ R(c, {
|
|
246
|
+
className: "space-y-4",
|
|
247
|
+
children: x.stops.map((o, s) => /* @__PURE__ */ z("div", {
|
|
248
|
+
className: "grid grid-cols-1 md:grid-cols-12 gap-3 items-end",
|
|
249
|
+
children: [
|
|
250
|
+
/* @__PURE__ */ z("div", {
|
|
251
|
+
className: "md:col-span-7 space-y-2",
|
|
252
|
+
children: [/* @__PURE__ */ z(f, {
|
|
253
|
+
htmlFor: `stop-address-${s}`,
|
|
254
|
+
children: [
|
|
255
|
+
"Stop ",
|
|
256
|
+
s + 1,
|
|
257
|
+
" address"
|
|
258
|
+
]
|
|
259
|
+
}), /* @__PURE__ */ R(e, {
|
|
260
|
+
id: `stop-address-${s}`,
|
|
261
|
+
value: o.address,
|
|
262
|
+
onChange: (e) => V(s, "address", e.target.value),
|
|
263
|
+
placeholder: "123 Main St, San Francisco, CA"
|
|
264
|
+
})]
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ z("div", {
|
|
267
|
+
className: "md:col-span-4 space-y-2",
|
|
268
|
+
children: [/* @__PURE__ */ R(f, {
|
|
269
|
+
htmlFor: `stop-type-${s}`,
|
|
270
|
+
children: "Type"
|
|
271
|
+
}), /* @__PURE__ */ z(i, {
|
|
272
|
+
value: o.type,
|
|
273
|
+
onValueChange: (e) => V(s, "type", e),
|
|
274
|
+
children: [/* @__PURE__ */ R(r, {
|
|
275
|
+
id: `stop-type-${s}`,
|
|
276
|
+
children: /* @__PURE__ */ R(a, {})
|
|
277
|
+
}), /* @__PURE__ */ z(t, { children: [/* @__PURE__ */ R(n, {
|
|
278
|
+
value: "pickup",
|
|
279
|
+
children: "Pickup"
|
|
280
|
+
}), /* @__PURE__ */ R(n, {
|
|
281
|
+
value: "delivery",
|
|
282
|
+
children: "Delivery"
|
|
283
|
+
})] })]
|
|
284
|
+
})]
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ R("div", {
|
|
287
|
+
className: "md:col-span-1 flex justify-end",
|
|
288
|
+
children: /* @__PURE__ */ R(v, {
|
|
289
|
+
type: "button",
|
|
290
|
+
variant: "ghost",
|
|
291
|
+
size: "icon",
|
|
292
|
+
className: "text-status-error-text",
|
|
293
|
+
onClick: () => L(s),
|
|
294
|
+
disabled: x.stops.length === 1,
|
|
295
|
+
"aria-label": `Remove stop ${s + 1}`,
|
|
296
|
+
children: /* @__PURE__ */ R(D, { size: 16 })
|
|
297
|
+
})
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
}, s))
|
|
301
|
+
})] })
|
|
302
|
+
]
|
|
303
|
+
})]
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function K() {
|
|
307
|
+
let { routeId: e } = L(), { basePath: t, navigate: n } = g(), { route: r, isLoading: i, error: a, refetch: f } = A(e), { optimizeRoute: m } = k(), w = () => n?.(o(t, "routes")), T = (e) => n?.(o(t, e));
|
|
308
|
+
if (!e) return /* @__PURE__ */ R(G, {});
|
|
309
|
+
if (i) return /* @__PURE__ */ R(_, { message: "Loading route details..." });
|
|
310
|
+
if (a || !r) return /* @__PURE__ */ R(h, {
|
|
311
|
+
title: "Route not found",
|
|
312
|
+
onRetry: f
|
|
313
|
+
});
|
|
314
|
+
let D = async () => {
|
|
315
|
+
try {
|
|
316
|
+
await m(r.id), f();
|
|
317
|
+
} catch (e) {
|
|
318
|
+
console.error(e);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
return /* @__PURE__ */ z(d, {
|
|
322
|
+
title: r.name,
|
|
323
|
+
subtitle: `${r.stops.length} stops - ${r.distance.toFixed(1)} km`,
|
|
324
|
+
icon: /* @__PURE__ */ R(C, { size: 24 }),
|
|
325
|
+
headerActions: /* @__PURE__ */ z("div", {
|
|
326
|
+
className: "flex gap-2",
|
|
327
|
+
children: [
|
|
328
|
+
/* @__PURE__ */ z(v, {
|
|
329
|
+
variant: "outline",
|
|
330
|
+
onClick: w,
|
|
331
|
+
children: [/* @__PURE__ */ R(y, { size: 16 }), " Back"]
|
|
332
|
+
}),
|
|
333
|
+
!r.optimized && /* @__PURE__ */ z(v, {
|
|
334
|
+
variant: "outline",
|
|
335
|
+
onClick: D,
|
|
336
|
+
children: [/* @__PURE__ */ R(U, { size: 16 }), " Optimize"]
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ z(v, { children: [/* @__PURE__ */ R(E, { size: 16 }), " Edit"] })
|
|
339
|
+
]
|
|
340
|
+
}),
|
|
341
|
+
headerContent: /* @__PURE__ */ z("div", {
|
|
342
|
+
className: "flex gap-2",
|
|
343
|
+
children: [/* @__PURE__ */ R(M, {
|
|
344
|
+
status: r.status,
|
|
345
|
+
customColors: j[r.status]
|
|
346
|
+
}), /* @__PURE__ */ R(p, {
|
|
347
|
+
variant: r.optimized ? "default" : "secondary",
|
|
348
|
+
children: r.optimized ? "Optimized" : "Not Optimized"
|
|
349
|
+
})]
|
|
350
|
+
}),
|
|
351
|
+
children: [
|
|
352
|
+
/* @__PURE__ */ R(H, {
|
|
353
|
+
icon: /* @__PURE__ */ R(C, { size: 18 }),
|
|
354
|
+
children: "A single optimized driving plan that chains together this route's stops. Review the sequence, distance and timing here, re-optimize if traffic or stops change, then hand the itinerary to a driver."
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ R(V, {
|
|
357
|
+
storageKey: "movethewheels-route-details",
|
|
358
|
+
steps: [
|
|
359
|
+
...r.optimized ? [] : [{
|
|
360
|
+
id: "optimize",
|
|
361
|
+
label: "Optimize this route",
|
|
362
|
+
description: "Reorder stops to cut distance and driving time.",
|
|
363
|
+
icon: /* @__PURE__ */ R(U, { size: 16 }),
|
|
364
|
+
onClick: D
|
|
365
|
+
}],
|
|
366
|
+
{
|
|
367
|
+
id: "edit",
|
|
368
|
+
label: "Adjust stops",
|
|
369
|
+
description: "Add, remove or reorder the delivery stops.",
|
|
370
|
+
icon: /* @__PURE__ */ R(E, { size: 16 }),
|
|
371
|
+
onClick: () => {}
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
id: "orders",
|
|
375
|
+
label: "Review the orders on this route",
|
|
376
|
+
description: "Check the deliveries bundled into this run.",
|
|
377
|
+
icon: /* @__PURE__ */ R(S, { size: 16 }),
|
|
378
|
+
onClick: () => T("orders")
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
}),
|
|
382
|
+
/* @__PURE__ */ z("div", {
|
|
383
|
+
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
384
|
+
children: [/* @__PURE__ */ z("div", {
|
|
385
|
+
className: "lg:col-span-2 space-y-6",
|
|
386
|
+
children: [/* @__PURE__ */ z(s, { children: [/* @__PURE__ */ R(u, { children: /* @__PURE__ */ R(l, { children: "Route Map" }) }), /* @__PURE__ */ R(c, { children: /* @__PURE__ */ R("div", {
|
|
387
|
+
className: "aspect-video bg-bg-sunken rounded-lg flex items-center justify-center",
|
|
388
|
+
children: /* @__PURE__ */ z("div", {
|
|
389
|
+
className: "text-center text-text-secondary",
|
|
390
|
+
children: [/* @__PURE__ */ R(S, {
|
|
391
|
+
size: 48,
|
|
392
|
+
className: "mx-auto mb-2 opacity-50"
|
|
393
|
+
}), /* @__PURE__ */ R("p", { children: "Route map visualization" })]
|
|
394
|
+
})
|
|
395
|
+
}) })] }), /* @__PURE__ */ z(s, { children: [/* @__PURE__ */ R(u, { children: /* @__PURE__ */ z(l, { children: [
|
|
396
|
+
"Stops (",
|
|
397
|
+
r.stops.length,
|
|
398
|
+
")"
|
|
399
|
+
] }) }), /* @__PURE__ */ R(c, { children: /* @__PURE__ */ R("div", {
|
|
400
|
+
className: "space-y-4",
|
|
401
|
+
children: r.stops.map((e, t) => /* @__PURE__ */ z("div", {
|
|
402
|
+
className: "flex gap-4",
|
|
403
|
+
children: [/* @__PURE__ */ z("div", {
|
|
404
|
+
className: "relative",
|
|
405
|
+
children: [/* @__PURE__ */ R("div", {
|
|
406
|
+
className: `w-8 h-8 rounded-full flex items-center justify-center ${e.status === "completed" ? "bg-status-success-text text-text-inverse" : "bg-bg-sunken"}`,
|
|
407
|
+
children: e.status === "completed" ? /* @__PURE__ */ R(b, { size: 16 }) : e.sequence
|
|
408
|
+
}), t < r.stops.length - 1 && /* @__PURE__ */ R("div", { className: "absolute top-8 left-4 w-px h-12 bg-border" })]
|
|
409
|
+
}), /* @__PURE__ */ R("div", {
|
|
410
|
+
className: "flex-1 pb-4",
|
|
411
|
+
children: /* @__PURE__ */ z("div", {
|
|
412
|
+
className: "flex items-center justify-between",
|
|
413
|
+
children: [/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ z("div", {
|
|
414
|
+
className: "flex items-center gap-2",
|
|
415
|
+
children: [/* @__PURE__ */ R(p, {
|
|
416
|
+
variant: e.type === "pickup" ? "secondary" : "default",
|
|
417
|
+
className: "capitalize",
|
|
418
|
+
children: e.type
|
|
419
|
+
}), /* @__PURE__ */ z("span", {
|
|
420
|
+
className: "font-medium",
|
|
421
|
+
children: ["Order #", e.orderId]
|
|
422
|
+
})]
|
|
423
|
+
}), /* @__PURE__ */ R("p", {
|
|
424
|
+
className: "text-sm text-text-secondary mt-1",
|
|
425
|
+
children: P(e.address)
|
|
426
|
+
})] }), /* @__PURE__ */ z("div", {
|
|
427
|
+
className: "text-right",
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ z("p", {
|
|
430
|
+
className: "text-sm",
|
|
431
|
+
children: ["Scheduled: ", N(e.scheduledTime, "time")]
|
|
432
|
+
}),
|
|
433
|
+
e.actualTime && /* @__PURE__ */ z("p", {
|
|
434
|
+
className: "text-sm text-status-success-text",
|
|
435
|
+
children: ["Actual: ", N(e.actualTime, "time")]
|
|
436
|
+
}),
|
|
437
|
+
/* @__PURE__ */ z("p", {
|
|
438
|
+
className: "text-xs text-text-secondary",
|
|
439
|
+
children: [e.duration, " min stop"]
|
|
440
|
+
})
|
|
441
|
+
]
|
|
442
|
+
})]
|
|
443
|
+
})
|
|
444
|
+
})]
|
|
445
|
+
}, e.id))
|
|
446
|
+
}) })] })]
|
|
447
|
+
}), /* @__PURE__ */ z("div", {
|
|
448
|
+
className: "space-y-6",
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ z(B, {
|
|
451
|
+
className: "space-y-4",
|
|
452
|
+
children: [
|
|
453
|
+
/* @__PURE__ */ R("h2", {
|
|
454
|
+
className: "text-base font-semibold text-text-primary",
|
|
455
|
+
children: "Route Info"
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
458
|
+
className: "text-sm text-text-secondary",
|
|
459
|
+
children: "Total Distance"
|
|
460
|
+
}), /* @__PURE__ */ z("p", {
|
|
461
|
+
className: "text-2xl font-bold",
|
|
462
|
+
children: [r.distance.toFixed(1), /* @__PURE__ */ R("span", {
|
|
463
|
+
className: "text-sm font-normal",
|
|
464
|
+
children: " km"
|
|
465
|
+
})]
|
|
466
|
+
})] }),
|
|
467
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
468
|
+
className: "text-sm text-text-secondary",
|
|
469
|
+
children: "Est. Duration"
|
|
470
|
+
}), /* @__PURE__ */ z("p", {
|
|
471
|
+
className: "text-2xl font-bold",
|
|
472
|
+
children: [r.estimatedDuration, /* @__PURE__ */ R("span", {
|
|
473
|
+
className: "text-sm font-normal",
|
|
474
|
+
children: " min"
|
|
475
|
+
})]
|
|
476
|
+
})] }),
|
|
477
|
+
r.actualDuration && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
478
|
+
className: "text-sm text-text-secondary",
|
|
479
|
+
children: "Actual Duration"
|
|
480
|
+
}), /* @__PURE__ */ z("p", {
|
|
481
|
+
className: "text-2xl font-bold",
|
|
482
|
+
children: [r.actualDuration, /* @__PURE__ */ R("span", {
|
|
483
|
+
className: "text-sm font-normal",
|
|
484
|
+
children: " min"
|
|
485
|
+
})]
|
|
486
|
+
})] })
|
|
487
|
+
]
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ z(s, { children: [/* @__PURE__ */ R(u, { children: /* @__PURE__ */ z(l, {
|
|
490
|
+
className: "flex items-center gap-2",
|
|
491
|
+
children: [/* @__PURE__ */ R(x, { size: 18 }), " Timeline"]
|
|
492
|
+
}) }), /* @__PURE__ */ z(c, {
|
|
493
|
+
className: "space-y-3",
|
|
494
|
+
children: [
|
|
495
|
+
r.startTime && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
496
|
+
className: "text-sm text-text-secondary",
|
|
497
|
+
children: "Started"
|
|
498
|
+
}), /* @__PURE__ */ R("p", { children: N(r.startTime, "full") })] }),
|
|
499
|
+
r.endTime && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
500
|
+
className: "text-sm text-text-secondary",
|
|
501
|
+
children: "Completed"
|
|
502
|
+
}), /* @__PURE__ */ R("p", { children: N(r.endTime, "full") })] }),
|
|
503
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
504
|
+
className: "text-sm text-text-secondary",
|
|
505
|
+
children: "Created"
|
|
506
|
+
}), /* @__PURE__ */ R("p", { children: N(r.createdAt, "full") })] })
|
|
507
|
+
]
|
|
508
|
+
})] }),
|
|
509
|
+
r.trafficConditions.length > 0 && /* @__PURE__ */ z(s, { children: [/* @__PURE__ */ R(u, { children: /* @__PURE__ */ R(l, { children: "Traffic Conditions" }) }), /* @__PURE__ */ R(c, { children: r.trafficConditions.map((e, t) => /* @__PURE__ */ z("div", {
|
|
510
|
+
className: `p-2 rounded mb-2 ${e.condition === "severe" ? "bg-status-error-bg-subtle" : (e.condition, "bg-status-warning-bg-subtle")}`,
|
|
511
|
+
children: [/* @__PURE__ */ z("p", {
|
|
512
|
+
className: "text-sm font-medium capitalize",
|
|
513
|
+
children: [e.condition, " traffic"]
|
|
514
|
+
}), /* @__PURE__ */ z("p", {
|
|
515
|
+
className: "text-xs text-text-secondary",
|
|
516
|
+
children: [
|
|
517
|
+
e.location,
|
|
518
|
+
" - +",
|
|
519
|
+
e.delay,
|
|
520
|
+
" min delay"
|
|
521
|
+
]
|
|
522
|
+
})]
|
|
523
|
+
}, t)) })] })
|
|
524
|
+
]
|
|
525
|
+
})]
|
|
526
|
+
})
|
|
527
|
+
]
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
//#endregion
|
|
531
|
+
export { K as default };
|
|
@@ -3,9 +3,9 @@ import { t as a } from "./DataTable-DmciIKKM.js";
|
|
|
3
3
|
import { t as o } from "./navigation-D36prnAn.js";
|
|
4
4
|
import { t as s } from "./plus-Z76q-FZm.js";
|
|
5
5
|
import { t as c } from "./refresh-cw-DKt6f5T6.js";
|
|
6
|
-
import { r as l } from "./useRoutes-
|
|
7
|
-
import { o as u, r as d } from "./StatusBadge-
|
|
8
|
-
import { r as f } from "./formatters-
|
|
6
|
+
import { r as l } from "./useRoutes-BQWO607N.js";
|
|
7
|
+
import { o as u, r as d } from "./StatusBadge-BZurYHMy.js";
|
|
8
|
+
import { r as f } from "./formatters-CF2S2l1m.js";
|
|
9
9
|
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
10
10
|
import { CTAOverflowMenu as h, EmphasisPanel as g, PagePurpose as _ } from "@burdenoff/fe-libs/ui";
|
|
11
11
|
//#region src/movethewheels/pages/RoutesPage.tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { A as e, F as t, I as n, J as r, L as i, P as a, R as o, V as s, X as c, Y as l, Z as u, d, f, g as p, h as m, i as h, j as g, lt as _, p as v, u as y } from "./PageLayout-D4LDHJJq.js";
|
|
2
2
|
import { n as b, r as x, t as S } from "./useSettings-CkDH_-gM.js";
|
|
3
3
|
import { t as C } from "./save-CojywNhG.js";
|
|
4
|
-
import { t as w } from "./user-
|
|
4
|
+
import { t as w } from "./user-jyFU3lXk.js";
|
|
5
5
|
import { useEffect as T, useMemo as E, useState as D } from "react";
|
|
6
6
|
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
7
7
|
import { EmphasisPanel as A, NextSteps as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
|
|
@@ -5,10 +5,10 @@ import { t as f } from "./clock-DJZtdl8u.js";
|
|
|
5
5
|
import { t as p } from "./map-pin-BGiCvyCs.js";
|
|
6
6
|
import { t as m } from "./package-BChUzpJS.js";
|
|
7
7
|
import { t as h } from "./search-CDGefqb3.js";
|
|
8
|
-
import { t as g } from "./truck-
|
|
9
|
-
import { i as _ } from "./useTracking-
|
|
10
|
-
import { r as v } from "./StatusBadge-
|
|
11
|
-
import { r as y, t as b } from "./formatters-
|
|
8
|
+
import { t as g } from "./truck-C0v_hbLR.js";
|
|
9
|
+
import { i as _ } from "./useTracking-B-va1kO3.js";
|
|
10
|
+
import { r as v } from "./StatusBadge-BZurYHMy.js";
|
|
11
|
+
import { r as y, t as b } from "./formatters-CF2S2l1m.js";
|
|
12
12
|
import { useState as x } from "react";
|
|
13
13
|
import { useSearchParams as S } from "react-router-dom";
|
|
14
14
|
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|