@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.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/CarbonFootprintPanel.js +1 -1
- package/dist/components/CustomerPicker.js +76 -65
- package/dist/components/DataTable.js +140 -139
- package/dist/components/DocumentsCard.js +14 -8
- package/dist/generated/wspace-types.d.ts +2719 -8
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAnalytics.js +21 -1
- package/dist/hooks/useCustomers.js +94 -78
- package/dist/hooks/useDebouncedValue.js +11 -0
- package/dist/hooks/useEntityDocuments.js +28 -18
- package/dist/hooks/useEpod.js +24 -17
- package/dist/hooks/useFleet.js +148 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +139 -134
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/index.js +6 -6
- package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
- package/dist/movethewheels/components/DataTable.d.ts +5 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
- package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
- package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +12 -5
- package/dist/pages/CreateOrderPage.js +191 -129
- package/dist/pages/CustomersPage.js +61 -54
- package/dist/pages/DeliveryCapturePage.js +131 -109
- package/dist/pages/DriversPage.js +100 -92
- package/dist/pages/InventoryPage.js +239 -236
- package/dist/pages/MultiModalShipmentPage.js +163 -130
- package/dist/pages/OrderDetailsPage.js +190 -106
- package/dist/pages/OrdersListPage.js +66 -60
- package/dist/pages/ProductDetailsPage.js +241 -200
- package/dist/pages/ProductsPage.js +59 -52
- package/dist/pages/RouteDetailsPage.js +324 -293
- package/dist/pages/RoutesPage.js +55 -48
- package/dist/pages/VehiclesPage.js +63 -56
- package/dist/pages/WarehousesPage.js +60 -53
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +3136 -8
- package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
- package/src/movethewheels/components/CustomerPicker.tsx +14 -0
- package/src/movethewheels/components/DataTable.tsx +34 -18
- package/src/movethewheels/components/DocumentsCard.tsx +6 -1
- package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
- package/src/movethewheels/hooks/useAnalytics.ts +27 -0
- package/src/movethewheels/hooks/useCustomers.ts +64 -24
- package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
- package/src/movethewheels/hooks/useEpod.ts +14 -7
- package/src/movethewheels/hooks/useFleet.ts +66 -38
- package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
- package/src/movethewheels/hooks/useInventory.ts +211 -90
- package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
- package/src/movethewheels/hooks/useOrders.ts +48 -14
- package/src/movethewheels/hooks/useRoutes.ts +81 -24
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
- package/src/movethewheels/pages/CustomersPage.tsx +11 -1
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
- package/src/movethewheels/pages/DriversPage.tsx +24 -12
- package/src/movethewheels/pages/InventoryPage.tsx +57 -32
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
- package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
- package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
- package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
- package/src/movethewheels/pages/ProductsPage.tsx +11 -1
- package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
- package/src/movethewheels/pages/RoutesPage.tsx +11 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
- package/src/movethewheels/types/index.ts +12 -5
|
@@ -3,95 +3,106 @@ import { CalendarClock as t } from "../node_modules/lucide-react/dist/esm/icons/
|
|
|
3
3
|
import { MapPin as n } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
4
4
|
import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
5
5
|
import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
6
|
+
import { Route as a } from "../node_modules/lucide-react/dist/esm/icons/route.js";
|
|
7
|
+
import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
8
|
+
import { Trash2 as te } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
9
|
+
import { Users as ne } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
10
|
+
import { buildCustomerCreatePath as re, joinPath as o } from "../utils/navigation.js";
|
|
11
|
+
import { useMoveTheWheels as ie } from "../providers/MoveTheWheelsProvider.js";
|
|
12
|
+
import { useRoutes as ae } from "../hooks/useRoutes.js";
|
|
13
|
+
import { useOrder as oe, useOrders as se } from "../hooks/useOrders.js";
|
|
14
|
+
import { useCustomer as ce, useCustomers as le } from "../hooks/useCustomers.js";
|
|
15
|
+
import { Button as s, Card as c, CardContent as l, CardHeader as u, CardTitle as d, Input as f, Label as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v, Separator as ue, Textarea as de } from "../components/ui.js";
|
|
16
|
+
import { EmptyState as fe, PageLayout as y } from "../components/PageLayout.js";
|
|
17
|
+
import { FormError as pe } from "../components/FormError.js";
|
|
18
|
+
import { useDebouncedValue as me } from "../hooks/useDebouncedValue.js";
|
|
19
|
+
import { CustomerPicker as he } from "../components/CustomerPicker.js";
|
|
17
20
|
import { useEffect as b, useState as x } from "react";
|
|
18
|
-
import { useParams as
|
|
21
|
+
import { useParams as ge, useSearchParams as S } from "react-router";
|
|
19
22
|
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
20
|
-
import { EmphasisPanel as
|
|
23
|
+
import { EmphasisPanel as _e, NextSteps as ve, PagePurpose as ye } from "@burdenoff/fe-libs/ui";
|
|
21
24
|
//#region src/movethewheels/pages/CreateOrderPage.tsx
|
|
22
|
-
function
|
|
25
|
+
function T(e) {
|
|
23
26
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
24
27
|
let t = (e) => String(e).padStart(2, "0");
|
|
25
28
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
26
29
|
}
|
|
27
|
-
function
|
|
28
|
-
let { orderId:
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
function E() {
|
|
31
|
+
let { orderId: E } = ge(), [be] = S(), D = be.get("customerId")?.trim() || void 0, { basePath: O, navigate: k } = ie(), { order: A } = oe(E), { createOrder: j, updateOrder: M } = se(), [N, xe] = x(""), { customers: P, createCustomer: Se, isLoading: F, error: I, refetch: Ce } = le({
|
|
32
|
+
limit: 20,
|
|
33
|
+
filters: { search: me(N) || void 0 }
|
|
34
|
+
}), { customer: L } = ce(D ?? A?.customerId), { routes: R, isLoading: we, error: Te } = ae({
|
|
35
|
+
status: "planned",
|
|
36
|
+
limit: 20
|
|
37
|
+
}), z = !!E && !!A, [B, V] = x(null), [H, U] = x({
|
|
38
|
+
customerId: D || A?.customerId || "",
|
|
39
|
+
priority: A?.priority || "normal",
|
|
40
|
+
routeId: A?.routeId || "",
|
|
31
41
|
pickupAddress: {
|
|
32
|
-
street:
|
|
33
|
-
city:
|
|
34
|
-
state:
|
|
35
|
-
postalCode:
|
|
36
|
-
country:
|
|
42
|
+
street: A?.pickupAddress.street || "",
|
|
43
|
+
city: A?.pickupAddress.city || "",
|
|
44
|
+
state: A?.pickupAddress.state || "",
|
|
45
|
+
postalCode: A?.pickupAddress.postalCode || "",
|
|
46
|
+
country: A?.pickupAddress.country || "USA"
|
|
37
47
|
},
|
|
38
48
|
deliveryAddress: {
|
|
39
|
-
street:
|
|
40
|
-
city:
|
|
41
|
-
state:
|
|
42
|
-
postalCode:
|
|
43
|
-
country:
|
|
49
|
+
street: A?.deliveryAddress.street || "",
|
|
50
|
+
city: A?.deliveryAddress.city || "",
|
|
51
|
+
state: A?.deliveryAddress.state || "",
|
|
52
|
+
postalCode: A?.deliveryAddress.postalCode || "",
|
|
53
|
+
country: A?.deliveryAddress.country || "USA"
|
|
44
54
|
},
|
|
45
|
-
items:
|
|
46
|
-
scheduledDelivery:
|
|
47
|
-
specialInstructions:
|
|
48
|
-
}), [W, G] = x(!1), [
|
|
55
|
+
items: A?.items || [],
|
|
56
|
+
scheduledDelivery: T(A?.scheduledDelivery),
|
|
57
|
+
specialInstructions: A?.specialInstructions || ""
|
|
58
|
+
}), [W, G] = x(!1), [Ee, K] = x(null);
|
|
49
59
|
b(() => {
|
|
50
|
-
|
|
60
|
+
L && (V((e) => e?.id === L.id ? e : L), U((e) => e.customerId ? e : {
|
|
51
61
|
...e,
|
|
52
|
-
customerId:
|
|
62
|
+
customerId: L.id
|
|
53
63
|
}));
|
|
54
|
-
}, [
|
|
55
|
-
|
|
56
|
-
customerId:
|
|
57
|
-
priority:
|
|
64
|
+
}, [L]), b(() => {
|
|
65
|
+
A && U({
|
|
66
|
+
customerId: A.customerId || "",
|
|
67
|
+
priority: A.priority || "normal",
|
|
68
|
+
routeId: A.routeId || "",
|
|
58
69
|
pickupAddress: {
|
|
59
|
-
street:
|
|
60
|
-
city:
|
|
61
|
-
state:
|
|
62
|
-
postalCode:
|
|
63
|
-
country:
|
|
70
|
+
street: A.pickupAddress.street || "",
|
|
71
|
+
city: A.pickupAddress.city || "",
|
|
72
|
+
state: A.pickupAddress.state || "",
|
|
73
|
+
postalCode: A.pickupAddress.postalCode || "",
|
|
74
|
+
country: A.pickupAddress.country || "USA"
|
|
64
75
|
},
|
|
65
76
|
deliveryAddress: {
|
|
66
|
-
street:
|
|
67
|
-
city:
|
|
68
|
-
state:
|
|
69
|
-
postalCode:
|
|
70
|
-
country:
|
|
77
|
+
street: A.deliveryAddress.street || "",
|
|
78
|
+
city: A.deliveryAddress.city || "",
|
|
79
|
+
state: A.deliveryAddress.state || "",
|
|
80
|
+
postalCode: A.deliveryAddress.postalCode || "",
|
|
81
|
+
country: A.deliveryAddress.country || "USA"
|
|
71
82
|
},
|
|
72
|
-
items:
|
|
73
|
-
scheduledDelivery:
|
|
74
|
-
specialInstructions:
|
|
83
|
+
items: A.items || [],
|
|
84
|
+
scheduledDelivery: T(A.scheduledDelivery),
|
|
85
|
+
specialInstructions: A.specialInstructions || ""
|
|
75
86
|
});
|
|
76
|
-
}, [
|
|
87
|
+
}, [A]);
|
|
77
88
|
let q = () => {
|
|
78
|
-
if (
|
|
79
|
-
if (!z &&
|
|
80
|
-
|
|
89
|
+
if (k) {
|
|
90
|
+
if (!z && D) {
|
|
91
|
+
k(o(O, `customers/${D}`));
|
|
81
92
|
return;
|
|
82
93
|
}
|
|
83
|
-
|
|
94
|
+
k(o(O, "orders"));
|
|
84
95
|
}
|
|
85
|
-
}, J = () => B ?? P.find((e) => e.id === H.customerId),
|
|
96
|
+
}, J = () => B ?? P.find((e) => e.id === H.customerId), De = () => !H.customerId || !J() ? I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : H.pickupAddress.street.trim() ? H.deliveryAddress.street.trim() ? H.items.length === 0 ? "Add at least one item to the order." : H.scheduledDelivery && Number.isNaN(Date.parse(H.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", Y = async (e) => {
|
|
86
97
|
e.preventDefault(), K(null);
|
|
87
|
-
let t =
|
|
98
|
+
let t = De();
|
|
88
99
|
if (t) {
|
|
89
100
|
K(t);
|
|
90
101
|
return;
|
|
91
102
|
}
|
|
92
103
|
let n = J();
|
|
93
104
|
if (!n) {
|
|
94
|
-
K(
|
|
105
|
+
K(I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
|
|
95
106
|
return;
|
|
96
107
|
}
|
|
97
108
|
G(!0);
|
|
@@ -109,9 +120,10 @@ function D() {
|
|
|
109
120
|
deliveryAddress: H.deliveryAddress,
|
|
110
121
|
items: H.items,
|
|
111
122
|
scheduledDelivery: H.scheduledDelivery ? new Date(H.scheduledDelivery) : null,
|
|
123
|
+
routeId: H.routeId || void 0,
|
|
112
124
|
specialInstructions: H.specialInstructions
|
|
113
125
|
};
|
|
114
|
-
z &&
|
|
126
|
+
z && E ? (await M(E, e), k && k(o(O, `orders/${E}`))) : (await j(e), q());
|
|
115
127
|
} catch (e) {
|
|
116
128
|
K(e instanceof Error ? e.message : z ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
|
|
117
129
|
} finally {
|
|
@@ -130,6 +142,26 @@ function D() {
|
|
|
130
142
|
[t]: n
|
|
131
143
|
}
|
|
132
144
|
}));
|
|
145
|
+
}, Oe = (e) => {
|
|
146
|
+
if (e === "none") {
|
|
147
|
+
X("routeId", "");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
let t = R.find((t) => t.id === e);
|
|
151
|
+
if (!t) return;
|
|
152
|
+
let n = t.stops.find((e) => e.type === "pickup")?.address, r = [...t.stops].reverse().find((e) => e.type === "delivery")?.address, i = (e, t) => t ? {
|
|
153
|
+
street: e.street.trim() ? e.street : t.street,
|
|
154
|
+
city: e.city.trim() ? e.city : t.city,
|
|
155
|
+
state: e.state.trim() ? e.state : t.state,
|
|
156
|
+
postalCode: e.postalCode.trim() ? e.postalCode : t.postalCode,
|
|
157
|
+
country: e.country.trim() ? e.country : t.country
|
|
158
|
+
} : e;
|
|
159
|
+
U((e) => ({
|
|
160
|
+
...e,
|
|
161
|
+
routeId: t.id,
|
|
162
|
+
pickupAddress: i(e.pickupAddress, n),
|
|
163
|
+
deliveryAddress: i(e.deliveryAddress, r)
|
|
164
|
+
}));
|
|
133
165
|
}, Q = () => {
|
|
134
166
|
U((e) => ({
|
|
135
167
|
...e,
|
|
@@ -149,7 +181,7 @@ function D() {
|
|
|
149
181
|
sku: ""
|
|
150
182
|
}]
|
|
151
183
|
}));
|
|
152
|
-
},
|
|
184
|
+
}, ke = (e) => {
|
|
153
185
|
U((t) => ({
|
|
154
186
|
...t,
|
|
155
187
|
items: t.items.filter((t, n) => n !== e)
|
|
@@ -163,35 +195,35 @@ function D() {
|
|
|
163
195
|
} : r)
|
|
164
196
|
}));
|
|
165
197
|
};
|
|
166
|
-
return /* @__PURE__ */ w(
|
|
198
|
+
return /* @__PURE__ */ w(y, {
|
|
167
199
|
title: z ? "Edit Order" : "Create Order",
|
|
168
|
-
subtitle: z ? `Editing ${
|
|
200
|
+
subtitle: z ? `Editing ${A?.orderNumber}` : "Create a new delivery order",
|
|
169
201
|
icon: /* @__PURE__ */ C(r, { size: 24 }),
|
|
170
202
|
headerActions: /* @__PURE__ */ w("div", {
|
|
171
203
|
className: "flex gap-2",
|
|
172
|
-
children: [/* @__PURE__ */ w(
|
|
204
|
+
children: [/* @__PURE__ */ w(s, {
|
|
173
205
|
variant: "outline",
|
|
174
206
|
onClick: q,
|
|
175
207
|
children: [/* @__PURE__ */ C(e, { size: 16 }), "Cancel"]
|
|
176
|
-
}), /* @__PURE__ */ w(
|
|
208
|
+
}), /* @__PURE__ */ w(s, {
|
|
177
209
|
onClick: Y,
|
|
178
|
-
disabled: W ||
|
|
179
|
-
children: [/* @__PURE__ */ C(
|
|
210
|
+
disabled: W || F,
|
|
211
|
+
children: [/* @__PURE__ */ C(ee, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
|
|
180
212
|
})]
|
|
181
213
|
}),
|
|
182
214
|
children: [
|
|
183
|
-
/* @__PURE__ */ C(
|
|
215
|
+
/* @__PURE__ */ C(ye, {
|
|
184
216
|
icon: /* @__PURE__ */ C(r, { size: 18 }),
|
|
185
217
|
children: z ? "Update this delivery before it goes out — change the customer, addresses, items or handling notes, then save." : "Book a new delivery in a few steps: choose who it’s for, set pickup and drop-off addresses, list what’s being shipped, and add any handling notes. Once created it joins the orders pipeline ready to assign and track."
|
|
186
218
|
}),
|
|
187
|
-
/* @__PURE__ */ C(
|
|
219
|
+
/* @__PURE__ */ C(ve, {
|
|
188
220
|
storageKey: "movethewheels-create-order",
|
|
189
221
|
steps: [
|
|
190
222
|
{
|
|
191
223
|
id: "customer",
|
|
192
224
|
label: "Pick the customer first",
|
|
193
225
|
description: "Their saved contact details auto-fill the order.",
|
|
194
|
-
icon: /* @__PURE__ */ C(
|
|
226
|
+
icon: /* @__PURE__ */ C(ne, { size: 16 }),
|
|
195
227
|
done: !!H.customerId,
|
|
196
228
|
onClick: () => document.getElementById("customer")?.focus()
|
|
197
229
|
},
|
|
@@ -217,15 +249,15 @@ function D() {
|
|
|
217
249
|
onSubmit: Y,
|
|
218
250
|
className: "space-y-6",
|
|
219
251
|
children: [
|
|
220
|
-
/* @__PURE__ */ C(
|
|
221
|
-
/* @__PURE__ */ w(
|
|
252
|
+
/* @__PURE__ */ C(pe, { message: Ee }),
|
|
253
|
+
/* @__PURE__ */ w(_e, { children: [/* @__PURE__ */ C("h2", {
|
|
222
254
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
223
255
|
children: "Order Details"
|
|
224
256
|
}), /* @__PURE__ */ C("div", {
|
|
225
257
|
className: "space-y-4",
|
|
226
258
|
children: /* @__PURE__ */ w("div", {
|
|
227
259
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
228
|
-
children: [/* @__PURE__ */ C(
|
|
260
|
+
children: [/* @__PURE__ */ C(he, {
|
|
229
261
|
customers: P,
|
|
230
262
|
value: H.customerId,
|
|
231
263
|
onValueChange: (e) => {
|
|
@@ -234,39 +266,41 @@ function D() {
|
|
|
234
266
|
onCreated: (e) => {
|
|
235
267
|
V(e), X("customerId", e.id), K(null);
|
|
236
268
|
},
|
|
237
|
-
createCustomer:
|
|
238
|
-
isLoading:
|
|
239
|
-
error:
|
|
240
|
-
onRetry:
|
|
269
|
+
createCustomer: Se,
|
|
270
|
+
isLoading: F,
|
|
271
|
+
error: I,
|
|
272
|
+
onRetry: Ce,
|
|
241
273
|
onOpenCustomers: () => {
|
|
242
|
-
|
|
274
|
+
k && k(o(O, re(z && E ? `orders/${E}/edit` : "orders/new")));
|
|
243
275
|
},
|
|
244
|
-
selectedCustomer: B
|
|
276
|
+
selectedCustomer: B,
|
|
277
|
+
searchQuery: N,
|
|
278
|
+
onSearchQueryChange: xe
|
|
245
279
|
}), /* @__PURE__ */ w("div", {
|
|
246
280
|
className: "space-y-2",
|
|
247
|
-
children: [/* @__PURE__ */ C(
|
|
281
|
+
children: [/* @__PURE__ */ C(p, {
|
|
248
282
|
htmlFor: "priority",
|
|
249
283
|
children: "Priority"
|
|
250
|
-
}), /* @__PURE__ */ w(
|
|
284
|
+
}), /* @__PURE__ */ w(m, {
|
|
251
285
|
value: H.priority,
|
|
252
286
|
onValueChange: (e) => X("priority", e),
|
|
253
|
-
children: [/* @__PURE__ */ C(
|
|
287
|
+
children: [/* @__PURE__ */ C(_, {
|
|
254
288
|
id: "priority",
|
|
255
|
-
children: /* @__PURE__ */ C(
|
|
256
|
-
}), /* @__PURE__ */ w(
|
|
257
|
-
/* @__PURE__ */ C(
|
|
289
|
+
children: /* @__PURE__ */ C(v, {})
|
|
290
|
+
}), /* @__PURE__ */ w(h, { children: [
|
|
291
|
+
/* @__PURE__ */ C(g, {
|
|
258
292
|
value: "low",
|
|
259
293
|
children: "Low"
|
|
260
294
|
}),
|
|
261
|
-
/* @__PURE__ */ C(
|
|
295
|
+
/* @__PURE__ */ C(g, {
|
|
262
296
|
value: "normal",
|
|
263
297
|
children: "Normal"
|
|
264
298
|
}),
|
|
265
|
-
/* @__PURE__ */ C(
|
|
299
|
+
/* @__PURE__ */ C(g, {
|
|
266
300
|
value: "high",
|
|
267
301
|
children: "High"
|
|
268
302
|
}),
|
|
269
|
-
/* @__PURE__ */ C(
|
|
303
|
+
/* @__PURE__ */ C(g, {
|
|
270
304
|
value: "urgent",
|
|
271
305
|
children: "Urgent"
|
|
272
306
|
})
|
|
@@ -275,17 +309,45 @@ function D() {
|
|
|
275
309
|
})]
|
|
276
310
|
})
|
|
277
311
|
})] }),
|
|
312
|
+
/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ w(d, {
|
|
313
|
+
className: "flex items-center gap-2",
|
|
314
|
+
children: [/* @__PURE__ */ C(a, { size: 18 }), "Saved Route (Optional)"]
|
|
315
|
+
}) }), /* @__PURE__ */ w(l, {
|
|
316
|
+
className: "space-y-2",
|
|
317
|
+
children: [/* @__PURE__ */ w(m, {
|
|
318
|
+
value: H.routeId || "none",
|
|
319
|
+
onValueChange: Oe,
|
|
320
|
+
children: [/* @__PURE__ */ C(_, {
|
|
321
|
+
id: "saved-route",
|
|
322
|
+
children: /* @__PURE__ */ C(v, { placeholder: "Choose a saved route" })
|
|
323
|
+
}), /* @__PURE__ */ w(h, { children: [/* @__PURE__ */ C(g, {
|
|
324
|
+
value: "none",
|
|
325
|
+
children: "No saved route"
|
|
326
|
+
}), R.map((e) => /* @__PURE__ */ w(g, {
|
|
327
|
+
value: e.id,
|
|
328
|
+
children: [
|
|
329
|
+
e.name,
|
|
330
|
+
" · ",
|
|
331
|
+
e.stops.length,
|
|
332
|
+
" stops"
|
|
333
|
+
]
|
|
334
|
+
}, e.id))] })]
|
|
335
|
+
}), /* @__PURE__ */ C("p", {
|
|
336
|
+
className: "text-xs text-text-secondary",
|
|
337
|
+
children: we ? "Loading planned routes…" : Te ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "A saved route fills any blank address fields. You can always edit both addresses below."
|
|
338
|
+
})]
|
|
339
|
+
})] }),
|
|
278
340
|
/* @__PURE__ */ w("div", {
|
|
279
341
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
280
|
-
children: [/* @__PURE__ */ w(
|
|
342
|
+
children: [/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Pickup Address" }) }), /* @__PURE__ */ w(l, {
|
|
281
343
|
className: "space-y-4",
|
|
282
344
|
children: [
|
|
283
345
|
/* @__PURE__ */ w("div", {
|
|
284
346
|
className: "space-y-2",
|
|
285
|
-
children: [/* @__PURE__ */ C(
|
|
347
|
+
children: [/* @__PURE__ */ C(p, {
|
|
286
348
|
htmlFor: "pickupStreet",
|
|
287
349
|
children: "Street Address"
|
|
288
|
-
}), /* @__PURE__ */ C(
|
|
350
|
+
}), /* @__PURE__ */ C(f, {
|
|
289
351
|
id: "pickupStreet",
|
|
290
352
|
value: H.pickupAddress.street,
|
|
291
353
|
onChange: (e) => Z("pickupAddress", "street", e.target.value),
|
|
@@ -296,10 +358,10 @@ function D() {
|
|
|
296
358
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
297
359
|
children: [/* @__PURE__ */ w("div", {
|
|
298
360
|
className: "space-y-2",
|
|
299
|
-
children: [/* @__PURE__ */ C(
|
|
361
|
+
children: [/* @__PURE__ */ C(p, {
|
|
300
362
|
htmlFor: "pickupCity",
|
|
301
363
|
children: "City"
|
|
302
|
-
}), /* @__PURE__ */ C(
|
|
364
|
+
}), /* @__PURE__ */ C(f, {
|
|
303
365
|
id: "pickupCity",
|
|
304
366
|
value: H.pickupAddress.city,
|
|
305
367
|
onChange: (e) => Z("pickupAddress", "city", e.target.value),
|
|
@@ -307,10 +369,10 @@ function D() {
|
|
|
307
369
|
})]
|
|
308
370
|
}), /* @__PURE__ */ w("div", {
|
|
309
371
|
className: "space-y-2",
|
|
310
|
-
children: [/* @__PURE__ */ C(
|
|
372
|
+
children: [/* @__PURE__ */ C(p, {
|
|
311
373
|
htmlFor: "pickupState",
|
|
312
374
|
children: "State"
|
|
313
|
-
}), /* @__PURE__ */ C(
|
|
375
|
+
}), /* @__PURE__ */ C(f, {
|
|
314
376
|
id: "pickupState",
|
|
315
377
|
value: H.pickupAddress.state,
|
|
316
378
|
onChange: (e) => Z("pickupAddress", "state", e.target.value),
|
|
@@ -322,10 +384,10 @@ function D() {
|
|
|
322
384
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
323
385
|
children: [/* @__PURE__ */ w("div", {
|
|
324
386
|
className: "space-y-2",
|
|
325
|
-
children: [/* @__PURE__ */ C(
|
|
387
|
+
children: [/* @__PURE__ */ C(p, {
|
|
326
388
|
htmlFor: "pickupPostal",
|
|
327
389
|
children: "Postal Code"
|
|
328
|
-
}), /* @__PURE__ */ C(
|
|
390
|
+
}), /* @__PURE__ */ C(f, {
|
|
329
391
|
id: "pickupPostal",
|
|
330
392
|
value: H.pickupAddress.postalCode,
|
|
331
393
|
onChange: (e) => Z("pickupAddress", "postalCode", e.target.value),
|
|
@@ -333,10 +395,10 @@ function D() {
|
|
|
333
395
|
})]
|
|
334
396
|
}), /* @__PURE__ */ w("div", {
|
|
335
397
|
className: "space-y-2",
|
|
336
|
-
children: [/* @__PURE__ */ C(
|
|
398
|
+
children: [/* @__PURE__ */ C(p, {
|
|
337
399
|
htmlFor: "pickupCountry",
|
|
338
400
|
children: "Country"
|
|
339
|
-
}), /* @__PURE__ */ C(
|
|
401
|
+
}), /* @__PURE__ */ C(f, {
|
|
340
402
|
id: "pickupCountry",
|
|
341
403
|
value: H.pickupAddress.country,
|
|
342
404
|
onChange: (e) => Z("pickupAddress", "country", e.target.value),
|
|
@@ -345,15 +407,15 @@ function D() {
|
|
|
345
407
|
})]
|
|
346
408
|
})
|
|
347
409
|
]
|
|
348
|
-
})] }), /* @__PURE__ */ w(
|
|
410
|
+
})] }), /* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Delivery Address" }) }), /* @__PURE__ */ w(l, {
|
|
349
411
|
className: "space-y-4",
|
|
350
412
|
children: [
|
|
351
413
|
/* @__PURE__ */ w("div", {
|
|
352
414
|
className: "space-y-2",
|
|
353
|
-
children: [/* @__PURE__ */ C(
|
|
415
|
+
children: [/* @__PURE__ */ C(p, {
|
|
354
416
|
htmlFor: "deliveryStreet",
|
|
355
417
|
children: "Street Address"
|
|
356
|
-
}), /* @__PURE__ */ C(
|
|
418
|
+
}), /* @__PURE__ */ C(f, {
|
|
357
419
|
id: "deliveryStreet",
|
|
358
420
|
value: H.deliveryAddress.street,
|
|
359
421
|
onChange: (e) => Z("deliveryAddress", "street", e.target.value),
|
|
@@ -364,10 +426,10 @@ function D() {
|
|
|
364
426
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
365
427
|
children: [/* @__PURE__ */ w("div", {
|
|
366
428
|
className: "space-y-2",
|
|
367
|
-
children: [/* @__PURE__ */ C(
|
|
429
|
+
children: [/* @__PURE__ */ C(p, {
|
|
368
430
|
htmlFor: "deliveryCity",
|
|
369
431
|
children: "City"
|
|
370
|
-
}), /* @__PURE__ */ C(
|
|
432
|
+
}), /* @__PURE__ */ C(f, {
|
|
371
433
|
id: "deliveryCity",
|
|
372
434
|
value: H.deliveryAddress.city,
|
|
373
435
|
onChange: (e) => Z("deliveryAddress", "city", e.target.value),
|
|
@@ -375,10 +437,10 @@ function D() {
|
|
|
375
437
|
})]
|
|
376
438
|
}), /* @__PURE__ */ w("div", {
|
|
377
439
|
className: "space-y-2",
|
|
378
|
-
children: [/* @__PURE__ */ C(
|
|
440
|
+
children: [/* @__PURE__ */ C(p, {
|
|
379
441
|
htmlFor: "deliveryState",
|
|
380
442
|
children: "State"
|
|
381
|
-
}), /* @__PURE__ */ C(
|
|
443
|
+
}), /* @__PURE__ */ C(f, {
|
|
382
444
|
id: "deliveryState",
|
|
383
445
|
value: H.deliveryAddress.state,
|
|
384
446
|
onChange: (e) => Z("deliveryAddress", "state", e.target.value),
|
|
@@ -390,10 +452,10 @@ function D() {
|
|
|
390
452
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
391
453
|
children: [/* @__PURE__ */ w("div", {
|
|
392
454
|
className: "space-y-2",
|
|
393
|
-
children: [/* @__PURE__ */ C(
|
|
455
|
+
children: [/* @__PURE__ */ C(p, {
|
|
394
456
|
htmlFor: "deliveryPostal",
|
|
395
457
|
children: "Postal Code"
|
|
396
|
-
}), /* @__PURE__ */ C(
|
|
458
|
+
}), /* @__PURE__ */ C(f, {
|
|
397
459
|
id: "deliveryPostal",
|
|
398
460
|
value: H.deliveryAddress.postalCode,
|
|
399
461
|
onChange: (e) => Z("deliveryAddress", "postalCode", e.target.value),
|
|
@@ -401,10 +463,10 @@ function D() {
|
|
|
401
463
|
})]
|
|
402
464
|
}), /* @__PURE__ */ w("div", {
|
|
403
465
|
className: "space-y-2",
|
|
404
|
-
children: [/* @__PURE__ */ C(
|
|
466
|
+
children: [/* @__PURE__ */ C(p, {
|
|
405
467
|
htmlFor: "deliveryCountry",
|
|
406
468
|
children: "Country"
|
|
407
|
-
}), /* @__PURE__ */ C(
|
|
469
|
+
}), /* @__PURE__ */ C(f, {
|
|
408
470
|
id: "deliveryCountry",
|
|
409
471
|
value: H.deliveryAddress.country,
|
|
410
472
|
onChange: (e) => Z("deliveryAddress", "country", e.target.value),
|
|
@@ -415,20 +477,20 @@ function D() {
|
|
|
415
477
|
]
|
|
416
478
|
})] })]
|
|
417
479
|
}),
|
|
418
|
-
/* @__PURE__ */ w(
|
|
480
|
+
/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ w(u, {
|
|
419
481
|
className: "flex flex-row items-center justify-between",
|
|
420
|
-
children: [/* @__PURE__ */ C(
|
|
482
|
+
children: [/* @__PURE__ */ C(d, { children: "Order Items" }), /* @__PURE__ */ w(s, {
|
|
421
483
|
type: "button",
|
|
422
484
|
variant: "outline",
|
|
423
485
|
size: "sm",
|
|
424
486
|
onClick: Q,
|
|
425
487
|
children: [/* @__PURE__ */ C(i, { size: 16 }), "Add Item"]
|
|
426
488
|
})]
|
|
427
|
-
}), /* @__PURE__ */ C(
|
|
489
|
+
}), /* @__PURE__ */ C(l, { children: H.items.length === 0 ? /* @__PURE__ */ C(fe, {
|
|
428
490
|
illustration: "empty-files",
|
|
429
491
|
title: "No items added yet",
|
|
430
492
|
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
431
|
-
action: /* @__PURE__ */ w(
|
|
493
|
+
action: /* @__PURE__ */ w(s, {
|
|
432
494
|
type: "button",
|
|
433
495
|
variant: "outline",
|
|
434
496
|
onClick: Q,
|
|
@@ -439,12 +501,12 @@ function D() {
|
|
|
439
501
|
})
|
|
440
502
|
}) : /* @__PURE__ */ C("div", {
|
|
441
503
|
className: "space-y-4",
|
|
442
|
-
children: H.items.map((e, t) => /* @__PURE__ */ w("div", { children: [t > 0 && /* @__PURE__ */ C(
|
|
504
|
+
children: H.items.map((e, t) => /* @__PURE__ */ w("div", { children: [t > 0 && /* @__PURE__ */ C(ue, { className: "my-4" }), /* @__PURE__ */ w("div", {
|
|
443
505
|
className: "grid grid-cols-1 md:grid-cols-7 gap-4",
|
|
444
506
|
children: [
|
|
445
507
|
/* @__PURE__ */ w("div", {
|
|
446
508
|
className: "md:col-span-2 space-y-2",
|
|
447
|
-
children: [/* @__PURE__ */ C(
|
|
509
|
+
children: [/* @__PURE__ */ C(p, { children: "Item Name" }), /* @__PURE__ */ C(f, {
|
|
448
510
|
value: e.name,
|
|
449
511
|
onChange: (e) => $(t, "name", e.target.value),
|
|
450
512
|
placeholder: "Product name"
|
|
@@ -452,7 +514,7 @@ function D() {
|
|
|
452
514
|
}),
|
|
453
515
|
/* @__PURE__ */ w("div", {
|
|
454
516
|
className: "space-y-2",
|
|
455
|
-
children: [/* @__PURE__ */ C(
|
|
517
|
+
children: [/* @__PURE__ */ C(p, { children: "SKU" }), /* @__PURE__ */ C(f, {
|
|
456
518
|
value: e.sku,
|
|
457
519
|
onChange: (e) => $(t, "sku", e.target.value),
|
|
458
520
|
placeholder: "SKU-001"
|
|
@@ -460,7 +522,7 @@ function D() {
|
|
|
460
522
|
}),
|
|
461
523
|
/* @__PURE__ */ w("div", {
|
|
462
524
|
className: "space-y-2",
|
|
463
|
-
children: [/* @__PURE__ */ C(
|
|
525
|
+
children: [/* @__PURE__ */ C(p, { children: "Quantity" }), /* @__PURE__ */ C(f, {
|
|
464
526
|
type: "number",
|
|
465
527
|
min: "1",
|
|
466
528
|
value: e.quantity,
|
|
@@ -469,7 +531,7 @@ function D() {
|
|
|
469
531
|
}),
|
|
470
532
|
/* @__PURE__ */ w("div", {
|
|
471
533
|
className: "space-y-2",
|
|
472
|
-
children: [/* @__PURE__ */ C(
|
|
534
|
+
children: [/* @__PURE__ */ C(p, { children: "Weight (kg)" }), /* @__PURE__ */ C(f, {
|
|
473
535
|
type: "number",
|
|
474
536
|
min: "0",
|
|
475
537
|
step: "0.1",
|
|
@@ -479,7 +541,7 @@ function D() {
|
|
|
479
541
|
}),
|
|
480
542
|
/* @__PURE__ */ w("div", {
|
|
481
543
|
className: "space-y-2",
|
|
482
|
-
children: [/* @__PURE__ */ C(
|
|
544
|
+
children: [/* @__PURE__ */ C(p, { children: "Value ($)" }), /* @__PURE__ */ C(f, {
|
|
483
545
|
type: "number",
|
|
484
546
|
min: "0",
|
|
485
547
|
step: "0.01",
|
|
@@ -489,24 +551,24 @@ function D() {
|
|
|
489
551
|
}),
|
|
490
552
|
/* @__PURE__ */ C("div", {
|
|
491
553
|
className: "flex items-end",
|
|
492
|
-
children: /* @__PURE__ */ C(
|
|
554
|
+
children: /* @__PURE__ */ C(s, {
|
|
493
555
|
type: "button",
|
|
494
556
|
variant: "ghost",
|
|
495
557
|
size: "icon",
|
|
496
558
|
className: "text-status-error-text",
|
|
497
|
-
onClick: () =>
|
|
498
|
-
children: /* @__PURE__ */ C(
|
|
559
|
+
onClick: () => ke(t),
|
|
560
|
+
children: /* @__PURE__ */ C(te, { size: 16 })
|
|
499
561
|
})
|
|
500
562
|
})
|
|
501
563
|
]
|
|
502
564
|
})] }, e.id))
|
|
503
565
|
}) })] }),
|
|
504
|
-
/* @__PURE__ */ w(
|
|
566
|
+
/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w("div", {
|
|
505
567
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
506
568
|
children: [/* @__PURE__ */ w("div", {
|
|
507
569
|
className: "space-y-2",
|
|
508
570
|
children: [
|
|
509
|
-
/* @__PURE__ */ w(
|
|
571
|
+
/* @__PURE__ */ w(p, {
|
|
510
572
|
htmlFor: "scheduledDelivery",
|
|
511
573
|
className: "flex items-center gap-1.5",
|
|
512
574
|
children: [/* @__PURE__ */ C(t, {
|
|
@@ -514,7 +576,7 @@ function D() {
|
|
|
514
576
|
className: "text-text-secondary"
|
|
515
577
|
}), "Scheduled Delivery"]
|
|
516
578
|
}),
|
|
517
|
-
/* @__PURE__ */ C(
|
|
579
|
+
/* @__PURE__ */ C(f, {
|
|
518
580
|
id: "scheduledDelivery",
|
|
519
581
|
type: "datetime-local",
|
|
520
582
|
value: H.scheduledDelivery,
|
|
@@ -527,10 +589,10 @@ function D() {
|
|
|
527
589
|
]
|
|
528
590
|
}), /* @__PURE__ */ w("div", {
|
|
529
591
|
className: "md:col-span-2 space-y-2",
|
|
530
|
-
children: [/* @__PURE__ */ C(
|
|
592
|
+
children: [/* @__PURE__ */ C(p, {
|
|
531
593
|
htmlFor: "specialInstructions",
|
|
532
594
|
children: "Special Instructions"
|
|
533
|
-
}), /* @__PURE__ */ C(
|
|
595
|
+
}), /* @__PURE__ */ C(de, {
|
|
534
596
|
id: "specialInstructions",
|
|
535
597
|
value: H.specialInstructions,
|
|
536
598
|
onChange: (e) => X("specialInstructions", e.target.value),
|
|
@@ -545,4 +607,4 @@ function D() {
|
|
|
545
607
|
});
|
|
546
608
|
}
|
|
547
609
|
//#endregion
|
|
548
|
-
export {
|
|
610
|
+
export { E as default };
|