@burdenoff/microfe-movethewheels 2026.703.3 → 2026.703.4
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-C3cPsWt-.js → AIAssistantPage-3YOnHO9Y.js} +3 -3
- package/dist/{AnalyticsPage-Dz6g2MvK.js → AnalyticsPage-CMpI1070.js} +11 -11
- package/dist/CreateOrderPage-DRAgGo9i.js +490 -0
- package/dist/CustomerDetailsPage-BCeMmOFe.js +615 -0
- package/dist/{CustomersPage-BKxMS1AV.js → CustomersPage-CaNBMXmM.js} +64 -53
- package/dist/{DashboardPage-BVjQi0EB.js → DashboardPage-DIKlXde3.js} +16 -16
- package/dist/DataTable-XvUcTjwi.js +340 -0
- package/dist/DocumentsCard-U2lSe-cn.js +169 -0
- package/dist/{DriverDetailsPage-CN3WQ0B9.js → DriverDetailsPage-BQrYd_Lp.js} +178 -195
- package/dist/{DriversPage-CH9rjQC-.js → DriversPage-PYmdFiby.js} +65 -54
- package/dist/FinancePage-Cwh9Bw4M.js +136 -0
- package/dist/{FleetPage-DqkFi3s3.js → FleetPage-3ZHsB-TN.js} +23 -22
- package/dist/{FormError-BlOjnXOq.js → FormError-cuLV2jVD.js} +1 -1
- package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-C6f7DqhM.js} +50 -70
- package/dist/{InventoryPage-e0ze63iX.js → InventoryPage-DpiqVu1v.js} +8 -8
- package/dist/{LiveTrackingPage-DCX-K-LR.js → LiveTrackingPage-FAzzlVnX.js} +9 -9
- package/dist/MarketplacePage-Bh_2ns4v.js +426 -0
- package/dist/Notice-CSoDYKw9.js +46 -0
- package/dist/OrderDetailsPage-zCj0lW0j.js +584 -0
- package/dist/{OrdersListPage-Cn90P1Xx.js → OrdersListPage-CAMsuUck.js} +166 -89
- package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-wsxAQkA0.js} +12 -12
- package/dist/{ProductsPage-QJfHHpqB.js → ProductsPage-DC5qDLfz.js} +60 -49
- package/dist/ReportsPage-BwUJ37eO.js +356 -0
- package/dist/RouteDetailsPage-DyMJE9AS.js +583 -0
- package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-Dtc669yc.js} +57 -46
- package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-CpH9xhQg.js} +5 -27
- package/dist/{TrackingPage-W-jtdM3Y.js → TrackingPage-DaNEFG_h.js} +10 -10
- package/dist/{VehicleDetailsPage-Bceo5oz3.js → VehicleDetailsPage-DldYNsYV.js} +125 -142
- package/dist/{VehiclesPage-ApKThYeG.js → VehiclesPage-BFw13iMt.js} +61 -50
- package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-CMG7or6G.js} +17 -17
- package/dist/{WarehousesPage-DCbXXXWE.js → WarehousesPage-Wkytnt86.js} +58 -47
- package/dist/arrow-right-Q3XQpTPR.js +11 -0
- package/dist/arrow-up-xNF1zJUG.js +17 -0
- package/dist/chevron-left-B2_r0Elx.js +8 -0
- package/dist/{wrench-CANXWxF-.js → fuel-B6_lnKDs.js} +2 -5
- package/dist/index.js +163 -174
- package/dist/upload-CHZofOqb.js +21 -0
- package/dist/{useAnalytics-DS8n0xgg.js → useAnalytics-D7HW2XRb.js} +52 -2
- package/dist/{useCustomers-BmTNGxiI.js → useCustomers-BPW4__PR.js} +29 -26
- package/dist/{useFleet-DKqXZ16m.js → useFleet-ChBkxAd6.js} +81 -69
- package/dist/{useInventory-DkyiVY_A.js → useInventory-CAAVMRp6.js} +83 -38
- package/dist/{useOrders-Cfk1GLiq.js → useOrders-B465S2nt.js} +58 -47
- package/dist/{useReports-CTqZr-AB.js → useReports-jQ3GpNOm.js} +40 -34
- package/dist/{useRoutes-BQWO607N.js → useRoutes-hS3d5-xr.js} +49 -41
- package/dist/{useTracking-B-va1kO3.js → useTracking-RjGz9PZG.js} +2 -2
- package/dist/user-check-BEKRCi7v.js +20 -0
- package/dist/wrench-q_rgJfaP.js +8 -0
- package/dist/x-tMeDMcCw.js +11 -0
- package/package.json +1 -1
- package/src/movethewheels/components/DataTable.tsx +252 -84
- package/src/movethewheels/components/DocumentsCard.tsx +102 -0
- package/src/movethewheels/components/Notice.tsx +61 -0
- package/src/movethewheels/components/index.ts +7 -0
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useAnalytics.ts +95 -0
- package/src/movethewheels/hooks/useCustomers.ts +11 -4
- package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
- package/src/movethewheels/hooks/useFleet.ts +26 -7
- package/src/movethewheels/hooks/useInventory.ts +70 -7
- package/src/movethewheels/hooks/useOrders.ts +32 -2
- package/src/movethewheels/hooks/useReports.ts +14 -4
- package/src/movethewheels/hooks/useRoutes.ts +20 -3
- package/src/movethewheels/pages/AnalyticsPage.tsx +2 -2
- package/src/movethewheels/pages/CreateOrderPage.tsx +44 -16
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
- package/src/movethewheels/pages/CustomersPage.tsx +27 -11
- package/src/movethewheels/pages/DriverDetailsPage.tsx +16 -30
- package/src/movethewheels/pages/DriversPage.tsx +26 -9
- package/src/movethewheels/pages/FinancePage.tsx +67 -84
- package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
- package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
- package/src/movethewheels/pages/OrdersListPage.tsx +76 -13
- package/src/movethewheels/pages/ProductsPage.tsx +27 -7
- package/src/movethewheels/pages/ReportsPage.tsx +65 -4
- package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -13
- package/src/movethewheels/pages/RoutesPage.tsx +22 -6
- package/src/movethewheels/pages/SettingsPage.tsx +3 -19
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +3 -33
- package/src/movethewheels/pages/VehiclesPage.tsx +26 -5
- package/src/movethewheels/pages/WarehousesPage.tsx +22 -17
- package/src/movethewheels/types/index.ts +8 -0
- package/src/movethewheels/utils/download.ts +62 -0
- package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
- package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
- package/dist/DataTable-DmciIKKM.js +0 -249
- package/dist/FinancePage-DEDykSOP.js +0 -158
- package/dist/MarketplacePage-CIQ97_zp.js +0 -247
- package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
- package/dist/ReportsPage-Zp53q3_8.js +0 -284
- package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
- /package/dist/{MetricCard-BY0QrMD4.js → MetricCard-CVBVpu7o.js} +0 -0
- /package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-C87mDpDP.js} +0 -0
- /package/dist/{box-D9Pal4HM.js → box-Eu05PXDh.js} +0 -0
- /package/dist/{chart-column-BFIJysDR.js → chart-column-ouzgxIv_.js} +0 -0
- /package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-eV4LjaSi.js} +0 -0
- /package/dist/{circle-alert-iY24lSlp.js → circle-alert-Bzh2DBSF.js} +0 -0
- /package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-CGMSpQmD.js} +0 -0
- /package/dist/{clock-DJZtdl8u.js → clock-Bl3ptexL.js} +0 -0
- /package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-CAVU95SO.js} +0 -0
- /package/dist/{download-DRXxoiQR.js → download-C5NbvVDc.js} +0 -0
- /package/dist/{file-text-DWWY6_f5.js → file-text-D-1uvLZG.js} +0 -0
- /package/dist/{filter-DloLC2eE.js → filter-DUfUg6BO.js} +0 -0
- /package/dist/{formatters-CF2S2l1m.js → formatters-BQr-aR5W.js} +0 -0
- /package/dist/{map-CkJaULb2.js → map-C-M-FQLR.js} +0 -0
- /package/dist/{map-pin-BGiCvyCs.js → map-pin-Dznl5l40.js} +0 -0
- /package/dist/{navigation-D36prnAn.js → navigation-BJSJl-VG.js} +0 -0
- /package/dist/{package-BChUzpJS.js → package-CcRttV2N.js} +0 -0
- /package/dist/{phone-Ac9s3mo_.js → phone-DVSZHt_j.js} +0 -0
- /package/dist/{plus-Z76q-FZm.js → plus-C_XZDwBz.js} +0 -0
- /package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-CfgN67l3.js} +0 -0
- /package/dist/{save-CojywNhG.js → save-DJE8Fpdv.js} +0 -0
- /package/dist/{search-CDGefqb3.js → search-D_VyGcZT.js} +0 -0
- /package/dist/{square-pen-CopE9GmB.js → square-pen-D-6JYrVQ.js} +0 -0
- /package/dist/{star-nHlLjDKR.js → star-BpRlUZuU.js} +0 -0
- /package/dist/{store-BR9Voi5E.js → store-B-8HMuyZ.js} +0 -0
- /package/dist/{trash-2-BKhar6Hs.js → trash-2-8vmv-XV_.js} +0 -0
- /package/dist/{trending-up-Dohgd4t_.js → trending-up-Dz6PqPRj.js} +0 -0
- /package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-D7Y3J_4z.js} +0 -0
- /package/dist/{truck-C0v_hbLR.js → truck-D-y2IDzv.js} +0 -0
- /package/dist/{useAssistant-D4v3oxD3.js → useAssistant-DVW4QgQb.js} +0 -0
- /package/dist/{useImportExport-DHr-SWSw.js → useImportExport-DrPDHEDK.js} +0 -0
- /package/dist/{useSettings-CkDH_-gM.js → useSettings-BB8X2RLh.js} +0 -0
- /package/dist/{user-jyFU3lXk.js → user-DzfTn4dE.js} +0 -0
- /package/dist/{users-DZ-ilS6B.js → users-CCrq-w0C.js} +0 -0
- /package/dist/{warehouse-6m5kXMLu.js → warehouse-CaqfmMKh.js} +0 -0
|
@@ -1,531 +0,0 @@
|
|
|
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 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|