@burdenoff/microfe-movethewheels 2026.921.1 → 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/generated/wspace-types.d.ts +1676 -3
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useFleet.js +4 -2
- package/dist/hooks/useOrders.js +89 -84
- package/dist/hooks/useRoutes.js +1 -1
- package/dist/index.js +6 -6
- package/dist/movethewheels/hooks/useOrders.d.ts +15 -0
- package/dist/movethewheels/hooks/useRoutes.d.ts +16 -0
- package/dist/movethewheels/types/index.d.ts +5 -0
- package/dist/pages/CreateOrderPage.js +266 -210
- package/dist/pages/OrderDetailsPage.js +305 -237
- package/dist/pages/RouteDetailsPage.js +247 -238
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1948 -3
- package/src/movethewheels/hooks/useFleet.ts +9 -2
- package/src/movethewheels/hooks/useOrders.ts +35 -0
- package/src/movethewheels/hooks/useRoutes.ts +1 -1
- package/src/movethewheels/pages/CreateOrderPage.tsx +84 -1
- package/src/movethewheels/pages/OrderDetailsPage.tsx +79 -10
- package/src/movethewheels/pages/RouteDetailsPage.tsx +14 -4
- package/src/movethewheels/types/index.ts +5 -0
|
@@ -3,139 +3,167 @@ 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 {
|
|
17
|
-
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";
|
|
18
20
|
import { useEffect as b, useState as x } from "react";
|
|
19
|
-
import { useParams as
|
|
20
|
-
import { jsx as
|
|
21
|
-
import { EmphasisPanel as
|
|
21
|
+
import { useParams as ge, useSearchParams as S } from "react-router";
|
|
22
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
23
|
+
import { EmphasisPanel as _e, NextSteps as ve, PagePurpose as ye } from "@burdenoff/fe-libs/ui";
|
|
22
24
|
//#region src/movethewheels/pages/CreateOrderPage.tsx
|
|
23
|
-
function
|
|
25
|
+
function T(e) {
|
|
24
26
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
25
27
|
let t = (e) => String(e).padStart(2, "0");
|
|
26
28
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
27
29
|
}
|
|
28
|
-
function
|
|
29
|
-
let { orderId:
|
|
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({
|
|
30
32
|
limit: 20,
|
|
31
|
-
filters: { search:
|
|
32
|
-
}), { customer: L } =
|
|
33
|
-
|
|
34
|
-
|
|
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 || "",
|
|
35
41
|
pickupAddress: {
|
|
36
|
-
street:
|
|
37
|
-
city:
|
|
38
|
-
state:
|
|
39
|
-
postalCode:
|
|
40
|
-
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"
|
|
41
47
|
},
|
|
42
48
|
deliveryAddress: {
|
|
43
|
-
street:
|
|
44
|
-
city:
|
|
45
|
-
state:
|
|
46
|
-
postalCode:
|
|
47
|
-
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"
|
|
48
54
|
},
|
|
49
|
-
items:
|
|
50
|
-
scheduledDelivery:
|
|
51
|
-
specialInstructions:
|
|
52
|
-
}), [
|
|
55
|
+
items: A?.items || [],
|
|
56
|
+
scheduledDelivery: T(A?.scheduledDelivery),
|
|
57
|
+
specialInstructions: A?.specialInstructions || ""
|
|
58
|
+
}), [W, G] = x(!1), [Ee, K] = x(null);
|
|
53
59
|
b(() => {
|
|
54
|
-
L && (
|
|
60
|
+
L && (V((e) => e?.id === L.id ? e : L), U((e) => e.customerId ? e : {
|
|
55
61
|
...e,
|
|
56
62
|
customerId: L.id
|
|
57
63
|
}));
|
|
58
64
|
}, [L]), b(() => {
|
|
59
|
-
|
|
60
|
-
customerId:
|
|
61
|
-
priority:
|
|
65
|
+
A && U({
|
|
66
|
+
customerId: A.customerId || "",
|
|
67
|
+
priority: A.priority || "normal",
|
|
68
|
+
routeId: A.routeId || "",
|
|
62
69
|
pickupAddress: {
|
|
63
|
-
street:
|
|
64
|
-
city:
|
|
65
|
-
state:
|
|
66
|
-
postalCode:
|
|
67
|
-
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"
|
|
68
75
|
},
|
|
69
76
|
deliveryAddress: {
|
|
70
|
-
street:
|
|
71
|
-
city:
|
|
72
|
-
state:
|
|
73
|
-
postalCode:
|
|
74
|
-
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"
|
|
75
82
|
},
|
|
76
|
-
items:
|
|
77
|
-
scheduledDelivery:
|
|
78
|
-
specialInstructions:
|
|
83
|
+
items: A.items || [],
|
|
84
|
+
scheduledDelivery: T(A.scheduledDelivery),
|
|
85
|
+
specialInstructions: A.specialInstructions || ""
|
|
79
86
|
});
|
|
80
|
-
}, [
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
83
|
-
if (!
|
|
84
|
-
|
|
87
|
+
}, [A]);
|
|
88
|
+
let q = () => {
|
|
89
|
+
if (k) {
|
|
90
|
+
if (!z && D) {
|
|
91
|
+
k(o(O, `customers/${D}`));
|
|
85
92
|
return;
|
|
86
93
|
}
|
|
87
|
-
|
|
94
|
+
k(o(O, "orders"));
|
|
88
95
|
}
|
|
89
|
-
},
|
|
90
|
-
e.preventDefault(),
|
|
91
|
-
let t =
|
|
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) => {
|
|
97
|
+
e.preventDefault(), K(null);
|
|
98
|
+
let t = De();
|
|
92
99
|
if (t) {
|
|
93
|
-
|
|
100
|
+
K(t);
|
|
94
101
|
return;
|
|
95
102
|
}
|
|
96
|
-
let n =
|
|
103
|
+
let n = J();
|
|
97
104
|
if (!n) {
|
|
98
|
-
|
|
105
|
+
K(I ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
|
|
99
106
|
return;
|
|
100
107
|
}
|
|
101
|
-
|
|
108
|
+
G(!0);
|
|
102
109
|
try {
|
|
103
110
|
let e = {
|
|
104
|
-
customerId:
|
|
111
|
+
customerId: H.customerId,
|
|
105
112
|
customerInfo: {
|
|
106
113
|
name: n.name,
|
|
107
114
|
email: n.email,
|
|
108
115
|
phone: n.phone,
|
|
109
116
|
company: n.company
|
|
110
117
|
},
|
|
111
|
-
priority:
|
|
112
|
-
pickupAddress:
|
|
113
|
-
deliveryAddress:
|
|
114
|
-
items:
|
|
115
|
-
scheduledDelivery:
|
|
116
|
-
|
|
118
|
+
priority: H.priority,
|
|
119
|
+
pickupAddress: H.pickupAddress,
|
|
120
|
+
deliveryAddress: H.deliveryAddress,
|
|
121
|
+
items: H.items,
|
|
122
|
+
scheduledDelivery: H.scheduledDelivery ? new Date(H.scheduledDelivery) : null,
|
|
123
|
+
routeId: H.routeId || void 0,
|
|
124
|
+
specialInstructions: H.specialInstructions
|
|
117
125
|
};
|
|
118
|
-
|
|
126
|
+
z && E ? (await M(E, e), k && k(o(O, `orders/${E}`))) : (await j(e), q());
|
|
119
127
|
} catch (e) {
|
|
120
|
-
|
|
128
|
+
K(e instanceof Error ? e.message : z ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
|
|
121
129
|
} finally {
|
|
122
|
-
|
|
130
|
+
G(!1);
|
|
123
131
|
}
|
|
124
132
|
}, X = (e, t) => {
|
|
125
|
-
|
|
133
|
+
U((n) => ({
|
|
126
134
|
...n,
|
|
127
135
|
[e]: t
|
|
128
136
|
}));
|
|
129
137
|
}, Z = (e, t, n) => {
|
|
130
|
-
|
|
138
|
+
U((r) => ({
|
|
131
139
|
...r,
|
|
132
140
|
[e]: {
|
|
133
141
|
...r[e],
|
|
134
142
|
[t]: n
|
|
135
143
|
}
|
|
136
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
|
+
}));
|
|
137
165
|
}, Q = () => {
|
|
138
|
-
|
|
166
|
+
U((e) => ({
|
|
139
167
|
...e,
|
|
140
168
|
items: [...e.items, {
|
|
141
169
|
id: `item-${Date.now()}`,
|
|
@@ -153,13 +181,13 @@ function T() {
|
|
|
153
181
|
sku: ""
|
|
154
182
|
}]
|
|
155
183
|
}));
|
|
156
|
-
},
|
|
157
|
-
|
|
184
|
+
}, ke = (e) => {
|
|
185
|
+
U((t) => ({
|
|
158
186
|
...t,
|
|
159
187
|
items: t.items.filter((t, n) => n !== e)
|
|
160
188
|
}));
|
|
161
189
|
}, $ = (e, t, n) => {
|
|
162
|
-
|
|
190
|
+
U((r) => ({
|
|
163
191
|
...r,
|
|
164
192
|
items: r.items.map((r, i) => i === e ? {
|
|
165
193
|
...r,
|
|
@@ -167,112 +195,112 @@ function T() {
|
|
|
167
195
|
} : r)
|
|
168
196
|
}));
|
|
169
197
|
};
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
title:
|
|
172
|
-
subtitle:
|
|
173
|
-
icon: /* @__PURE__ */
|
|
174
|
-
headerActions: /* @__PURE__ */
|
|
198
|
+
return /* @__PURE__ */ w(y, {
|
|
199
|
+
title: z ? "Edit Order" : "Create Order",
|
|
200
|
+
subtitle: z ? `Editing ${A?.orderNumber}` : "Create a new delivery order",
|
|
201
|
+
icon: /* @__PURE__ */ C(r, { size: 24 }),
|
|
202
|
+
headerActions: /* @__PURE__ */ w("div", {
|
|
175
203
|
className: "flex gap-2",
|
|
176
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ w(s, {
|
|
177
205
|
variant: "outline",
|
|
178
|
-
onClick:
|
|
179
|
-
children: [/* @__PURE__ */
|
|
180
|
-
}), /* @__PURE__ */
|
|
206
|
+
onClick: q,
|
|
207
|
+
children: [/* @__PURE__ */ C(e, { size: 16 }), "Cancel"]
|
|
208
|
+
}), /* @__PURE__ */ w(s, {
|
|
181
209
|
onClick: Y,
|
|
182
|
-
disabled:
|
|
183
|
-
children: [/* @__PURE__ */
|
|
210
|
+
disabled: W || F,
|
|
211
|
+
children: [/* @__PURE__ */ C(ee, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
|
|
184
212
|
})]
|
|
185
213
|
}),
|
|
186
214
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
icon: /* @__PURE__ */
|
|
189
|
-
children:
|
|
215
|
+
/* @__PURE__ */ C(ye, {
|
|
216
|
+
icon: /* @__PURE__ */ C(r, { size: 18 }),
|
|
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."
|
|
190
218
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
219
|
+
/* @__PURE__ */ C(ve, {
|
|
192
220
|
storageKey: "movethewheels-create-order",
|
|
193
221
|
steps: [
|
|
194
222
|
{
|
|
195
223
|
id: "customer",
|
|
196
224
|
label: "Pick the customer first",
|
|
197
225
|
description: "Their saved contact details auto-fill the order.",
|
|
198
|
-
icon: /* @__PURE__ */
|
|
199
|
-
done: !!
|
|
226
|
+
icon: /* @__PURE__ */ C(ne, { size: 16 }),
|
|
227
|
+
done: !!H.customerId,
|
|
200
228
|
onClick: () => document.getElementById("customer")?.focus()
|
|
201
229
|
},
|
|
202
230
|
{
|
|
203
231
|
id: "addresses",
|
|
204
232
|
label: "Set pickup & delivery addresses",
|
|
205
233
|
description: "Where the shipment is collected and dropped off.",
|
|
206
|
-
icon: /* @__PURE__ */
|
|
207
|
-
done: !!
|
|
234
|
+
icon: /* @__PURE__ */ C(n, { size: 16 }),
|
|
235
|
+
done: !!H.pickupAddress.street && !!H.deliveryAddress.street,
|
|
208
236
|
onClick: () => document.getElementById("pickupStreet")?.focus()
|
|
209
237
|
},
|
|
210
238
|
{
|
|
211
239
|
id: "items",
|
|
212
240
|
label: "Add the items to ship",
|
|
213
241
|
description: "List each product with its quantity and value.",
|
|
214
|
-
icon: /* @__PURE__ */
|
|
215
|
-
done:
|
|
242
|
+
icon: /* @__PURE__ */ C(r, { size: 16 }),
|
|
243
|
+
done: H.items.length > 0,
|
|
216
244
|
onClick: Q
|
|
217
245
|
}
|
|
218
246
|
]
|
|
219
247
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ w("form", {
|
|
221
249
|
onSubmit: Y,
|
|
222
250
|
className: "space-y-6",
|
|
223
251
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ C(pe, { message: Ee }),
|
|
253
|
+
/* @__PURE__ */ w(_e, { children: [/* @__PURE__ */ C("h2", {
|
|
226
254
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
227
255
|
children: "Order Details"
|
|
228
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ C("div", {
|
|
229
257
|
className: "space-y-4",
|
|
230
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ w("div", {
|
|
231
259
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
260
|
+
children: [/* @__PURE__ */ C(he, {
|
|
233
261
|
customers: P,
|
|
234
|
-
value:
|
|
262
|
+
value: H.customerId,
|
|
235
263
|
onValueChange: (e) => {
|
|
236
|
-
e && (X("customerId", e),
|
|
264
|
+
e && (X("customerId", e), V(P.find((t) => t.id === e) ?? (B?.id === e ? B : null)), K(null));
|
|
237
265
|
},
|
|
238
266
|
onCreated: (e) => {
|
|
239
|
-
|
|
267
|
+
V(e), X("customerId", e.id), K(null);
|
|
240
268
|
},
|
|
241
|
-
createCustomer:
|
|
269
|
+
createCustomer: Se,
|
|
242
270
|
isLoading: F,
|
|
243
271
|
error: I,
|
|
244
|
-
onRetry:
|
|
272
|
+
onRetry: Ce,
|
|
245
273
|
onOpenCustomers: () => {
|
|
246
|
-
|
|
274
|
+
k && k(o(O, re(z && E ? `orders/${E}/edit` : "orders/new")));
|
|
247
275
|
},
|
|
248
|
-
selectedCustomer:
|
|
249
|
-
searchQuery:
|
|
250
|
-
onSearchQueryChange:
|
|
251
|
-
}), /* @__PURE__ */
|
|
276
|
+
selectedCustomer: B,
|
|
277
|
+
searchQuery: N,
|
|
278
|
+
onSearchQueryChange: xe
|
|
279
|
+
}), /* @__PURE__ */ w("div", {
|
|
252
280
|
className: "space-y-2",
|
|
253
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ C(p, {
|
|
254
282
|
htmlFor: "priority",
|
|
255
283
|
children: "Priority"
|
|
256
|
-
}), /* @__PURE__ */
|
|
257
|
-
value:
|
|
284
|
+
}), /* @__PURE__ */ w(m, {
|
|
285
|
+
value: H.priority,
|
|
258
286
|
onValueChange: (e) => X("priority", e),
|
|
259
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ C(_, {
|
|
260
288
|
id: "priority",
|
|
261
|
-
children: /* @__PURE__ */
|
|
262
|
-
}), /* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
289
|
+
children: /* @__PURE__ */ C(v, {})
|
|
290
|
+
}), /* @__PURE__ */ w(h, { children: [
|
|
291
|
+
/* @__PURE__ */ C(g, {
|
|
264
292
|
value: "low",
|
|
265
293
|
children: "Low"
|
|
266
294
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
295
|
+
/* @__PURE__ */ C(g, {
|
|
268
296
|
value: "normal",
|
|
269
297
|
children: "Normal"
|
|
270
298
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ C(g, {
|
|
272
300
|
value: "high",
|
|
273
301
|
children: "High"
|
|
274
302
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ C(g, {
|
|
276
304
|
value: "urgent",
|
|
277
305
|
children: "Urgent"
|
|
278
306
|
})
|
|
@@ -281,138 +309,166 @@ function T() {
|
|
|
281
309
|
})]
|
|
282
310
|
})
|
|
283
311
|
})] }),
|
|
284
|
-
/* @__PURE__ */ C(
|
|
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
|
+
})] }),
|
|
340
|
+
/* @__PURE__ */ w("div", {
|
|
285
341
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
286
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Pickup Address" }) }), /* @__PURE__ */ w(l, {
|
|
287
343
|
className: "space-y-4",
|
|
288
344
|
children: [
|
|
289
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ w("div", {
|
|
290
346
|
className: "space-y-2",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ C(p, {
|
|
292
348
|
htmlFor: "pickupStreet",
|
|
293
349
|
children: "Street Address"
|
|
294
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ C(f, {
|
|
295
351
|
id: "pickupStreet",
|
|
296
|
-
value:
|
|
352
|
+
value: H.pickupAddress.street,
|
|
297
353
|
onChange: (e) => Z("pickupAddress", "street", e.target.value),
|
|
298
354
|
placeholder: "123 Main St"
|
|
299
355
|
})]
|
|
300
356
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ w("div", {
|
|
302
358
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ w("div", {
|
|
304
360
|
className: "space-y-2",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
361
|
+
children: [/* @__PURE__ */ C(p, {
|
|
306
362
|
htmlFor: "pickupCity",
|
|
307
363
|
children: "City"
|
|
308
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ C(f, {
|
|
309
365
|
id: "pickupCity",
|
|
310
|
-
value:
|
|
366
|
+
value: H.pickupAddress.city,
|
|
311
367
|
onChange: (e) => Z("pickupAddress", "city", e.target.value),
|
|
312
368
|
placeholder: "San Francisco"
|
|
313
369
|
})]
|
|
314
|
-
}), /* @__PURE__ */
|
|
370
|
+
}), /* @__PURE__ */ w("div", {
|
|
315
371
|
className: "space-y-2",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ C(p, {
|
|
317
373
|
htmlFor: "pickupState",
|
|
318
374
|
children: "State"
|
|
319
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ C(f, {
|
|
320
376
|
id: "pickupState",
|
|
321
|
-
value:
|
|
377
|
+
value: H.pickupAddress.state,
|
|
322
378
|
onChange: (e) => Z("pickupAddress", "state", e.target.value),
|
|
323
379
|
placeholder: "CA"
|
|
324
380
|
})]
|
|
325
381
|
})]
|
|
326
382
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ w("div", {
|
|
328
384
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
329
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ w("div", {
|
|
330
386
|
className: "space-y-2",
|
|
331
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ C(p, {
|
|
332
388
|
htmlFor: "pickupPostal",
|
|
333
389
|
children: "Postal Code"
|
|
334
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ C(f, {
|
|
335
391
|
id: "pickupPostal",
|
|
336
|
-
value:
|
|
392
|
+
value: H.pickupAddress.postalCode,
|
|
337
393
|
onChange: (e) => Z("pickupAddress", "postalCode", e.target.value),
|
|
338
394
|
placeholder: "94103"
|
|
339
395
|
})]
|
|
340
|
-
}), /* @__PURE__ */
|
|
396
|
+
}), /* @__PURE__ */ w("div", {
|
|
341
397
|
className: "space-y-2",
|
|
342
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ C(p, {
|
|
343
399
|
htmlFor: "pickupCountry",
|
|
344
400
|
children: "Country"
|
|
345
|
-
}), /* @__PURE__ */
|
|
401
|
+
}), /* @__PURE__ */ C(f, {
|
|
346
402
|
id: "pickupCountry",
|
|
347
|
-
value:
|
|
403
|
+
value: H.pickupAddress.country,
|
|
348
404
|
onChange: (e) => Z("pickupAddress", "country", e.target.value),
|
|
349
405
|
placeholder: "USA"
|
|
350
406
|
})]
|
|
351
407
|
})]
|
|
352
408
|
})
|
|
353
409
|
]
|
|
354
|
-
})] }), /* @__PURE__ */
|
|
410
|
+
})] }), /* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Delivery Address" }) }), /* @__PURE__ */ w(l, {
|
|
355
411
|
className: "space-y-4",
|
|
356
412
|
children: [
|
|
357
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ w("div", {
|
|
358
414
|
className: "space-y-2",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
415
|
+
children: [/* @__PURE__ */ C(p, {
|
|
360
416
|
htmlFor: "deliveryStreet",
|
|
361
417
|
children: "Street Address"
|
|
362
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ C(f, {
|
|
363
419
|
id: "deliveryStreet",
|
|
364
|
-
value:
|
|
420
|
+
value: H.deliveryAddress.street,
|
|
365
421
|
onChange: (e) => Z("deliveryAddress", "street", e.target.value),
|
|
366
422
|
placeholder: "456 Oak Ave"
|
|
367
423
|
})]
|
|
368
424
|
}),
|
|
369
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ w("div", {
|
|
370
426
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
371
|
-
children: [/* @__PURE__ */
|
|
427
|
+
children: [/* @__PURE__ */ w("div", {
|
|
372
428
|
className: "space-y-2",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ C(p, {
|
|
374
430
|
htmlFor: "deliveryCity",
|
|
375
431
|
children: "City"
|
|
376
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ C(f, {
|
|
377
433
|
id: "deliveryCity",
|
|
378
|
-
value:
|
|
434
|
+
value: H.deliveryAddress.city,
|
|
379
435
|
onChange: (e) => Z("deliveryAddress", "city", e.target.value),
|
|
380
436
|
placeholder: "Los Angeles"
|
|
381
437
|
})]
|
|
382
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ w("div", {
|
|
383
439
|
className: "space-y-2",
|
|
384
|
-
children: [/* @__PURE__ */
|
|
440
|
+
children: [/* @__PURE__ */ C(p, {
|
|
385
441
|
htmlFor: "deliveryState",
|
|
386
442
|
children: "State"
|
|
387
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ C(f, {
|
|
388
444
|
id: "deliveryState",
|
|
389
|
-
value:
|
|
445
|
+
value: H.deliveryAddress.state,
|
|
390
446
|
onChange: (e) => Z("deliveryAddress", "state", e.target.value),
|
|
391
447
|
placeholder: "CA"
|
|
392
448
|
})]
|
|
393
449
|
})]
|
|
394
450
|
}),
|
|
395
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ w("div", {
|
|
396
452
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
453
|
+
children: [/* @__PURE__ */ w("div", {
|
|
398
454
|
className: "space-y-2",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
455
|
+
children: [/* @__PURE__ */ C(p, {
|
|
400
456
|
htmlFor: "deliveryPostal",
|
|
401
457
|
children: "Postal Code"
|
|
402
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ C(f, {
|
|
403
459
|
id: "deliveryPostal",
|
|
404
|
-
value:
|
|
460
|
+
value: H.deliveryAddress.postalCode,
|
|
405
461
|
onChange: (e) => Z("deliveryAddress", "postalCode", e.target.value),
|
|
406
462
|
placeholder: "90210"
|
|
407
463
|
})]
|
|
408
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ w("div", {
|
|
409
465
|
className: "space-y-2",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ C(p, {
|
|
411
467
|
htmlFor: "deliveryCountry",
|
|
412
468
|
children: "Country"
|
|
413
|
-
}), /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ C(f, {
|
|
414
470
|
id: "deliveryCountry",
|
|
415
|
-
value:
|
|
471
|
+
value: H.deliveryAddress.country,
|
|
416
472
|
onChange: (e) => Z("deliveryAddress", "country", e.target.value),
|
|
417
473
|
placeholder: "USA"
|
|
418
474
|
})]
|
|
@@ -421,61 +477,61 @@ function T() {
|
|
|
421
477
|
]
|
|
422
478
|
})] })]
|
|
423
479
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ w(u, {
|
|
425
481
|
className: "flex flex-row items-center justify-between",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
482
|
+
children: [/* @__PURE__ */ C(d, { children: "Order Items" }), /* @__PURE__ */ w(s, {
|
|
427
483
|
type: "button",
|
|
428
484
|
variant: "outline",
|
|
429
485
|
size: "sm",
|
|
430
486
|
onClick: Q,
|
|
431
|
-
children: [/* @__PURE__ */
|
|
487
|
+
children: [/* @__PURE__ */ C(i, { size: 16 }), "Add Item"]
|
|
432
488
|
})]
|
|
433
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ C(l, { children: H.items.length === 0 ? /* @__PURE__ */ C(fe, {
|
|
434
490
|
illustration: "empty-files",
|
|
435
491
|
title: "No items added yet",
|
|
436
492
|
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
437
|
-
action: /* @__PURE__ */
|
|
493
|
+
action: /* @__PURE__ */ w(s, {
|
|
438
494
|
type: "button",
|
|
439
495
|
variant: "outline",
|
|
440
496
|
onClick: Q,
|
|
441
|
-
children: [/* @__PURE__ */
|
|
497
|
+
children: [/* @__PURE__ */ C(i, {
|
|
442
498
|
size: 16,
|
|
443
499
|
className: "mr-1.5"
|
|
444
500
|
}), "Add your first item"]
|
|
445
501
|
})
|
|
446
|
-
}) : /* @__PURE__ */
|
|
502
|
+
}) : /* @__PURE__ */ C("div", {
|
|
447
503
|
className: "space-y-4",
|
|
448
|
-
children:
|
|
504
|
+
children: H.items.map((e, t) => /* @__PURE__ */ w("div", { children: [t > 0 && /* @__PURE__ */ C(ue, { className: "my-4" }), /* @__PURE__ */ w("div", {
|
|
449
505
|
className: "grid grid-cols-1 md:grid-cols-7 gap-4",
|
|
450
506
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ w("div", {
|
|
452
508
|
className: "md:col-span-2 space-y-2",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
509
|
+
children: [/* @__PURE__ */ C(p, { children: "Item Name" }), /* @__PURE__ */ C(f, {
|
|
454
510
|
value: e.name,
|
|
455
511
|
onChange: (e) => $(t, "name", e.target.value),
|
|
456
512
|
placeholder: "Product name"
|
|
457
513
|
})]
|
|
458
514
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
515
|
+
/* @__PURE__ */ w("div", {
|
|
460
516
|
className: "space-y-2",
|
|
461
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ C(p, { children: "SKU" }), /* @__PURE__ */ C(f, {
|
|
462
518
|
value: e.sku,
|
|
463
519
|
onChange: (e) => $(t, "sku", e.target.value),
|
|
464
520
|
placeholder: "SKU-001"
|
|
465
521
|
})]
|
|
466
522
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
523
|
+
/* @__PURE__ */ w("div", {
|
|
468
524
|
className: "space-y-2",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
525
|
+
children: [/* @__PURE__ */ C(p, { children: "Quantity" }), /* @__PURE__ */ C(f, {
|
|
470
526
|
type: "number",
|
|
471
527
|
min: "1",
|
|
472
528
|
value: e.quantity,
|
|
473
529
|
onChange: (e) => $(t, "quantity", parseInt(e.target.value) || 1)
|
|
474
530
|
})]
|
|
475
531
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ w("div", {
|
|
477
533
|
className: "space-y-2",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
534
|
+
children: [/* @__PURE__ */ C(p, { children: "Weight (kg)" }), /* @__PURE__ */ C(f, {
|
|
479
535
|
type: "number",
|
|
480
536
|
min: "0",
|
|
481
537
|
step: "0.1",
|
|
@@ -483,9 +539,9 @@ function T() {
|
|
|
483
539
|
onChange: (e) => $(t, "weight", parseFloat(e.target.value) || 0)
|
|
484
540
|
})]
|
|
485
541
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ w("div", {
|
|
487
543
|
className: "space-y-2",
|
|
488
|
-
children: [/* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ C(p, { children: "Value ($)" }), /* @__PURE__ */ C(f, {
|
|
489
545
|
type: "number",
|
|
490
546
|
min: "0",
|
|
491
547
|
step: "0.01",
|
|
@@ -493,52 +549,52 @@ function T() {
|
|
|
493
549
|
onChange: (e) => $(t, "value", parseFloat(e.target.value) || 0)
|
|
494
550
|
})]
|
|
495
551
|
}),
|
|
496
|
-
/* @__PURE__ */
|
|
552
|
+
/* @__PURE__ */ C("div", {
|
|
497
553
|
className: "flex items-end",
|
|
498
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ C(s, {
|
|
499
555
|
type: "button",
|
|
500
556
|
variant: "ghost",
|
|
501
557
|
size: "icon",
|
|
502
558
|
className: "text-status-error-text",
|
|
503
|
-
onClick: () =>
|
|
504
|
-
children: /* @__PURE__ */
|
|
559
|
+
onClick: () => ke(t),
|
|
560
|
+
children: /* @__PURE__ */ C(te, { size: 16 })
|
|
505
561
|
})
|
|
506
562
|
})
|
|
507
563
|
]
|
|
508
564
|
})] }, e.id))
|
|
509
565
|
}) })] }),
|
|
510
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ w(c, { children: [/* @__PURE__ */ C(u, { children: /* @__PURE__ */ C(d, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ C(l, { children: /* @__PURE__ */ w("div", {
|
|
511
567
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
568
|
+
children: [/* @__PURE__ */ w("div", {
|
|
513
569
|
className: "space-y-2",
|
|
514
570
|
children: [
|
|
515
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ w(p, {
|
|
516
572
|
htmlFor: "scheduledDelivery",
|
|
517
573
|
className: "flex items-center gap-1.5",
|
|
518
|
-
children: [/* @__PURE__ */
|
|
574
|
+
children: [/* @__PURE__ */ C(t, {
|
|
519
575
|
size: 14,
|
|
520
576
|
className: "text-text-secondary"
|
|
521
577
|
}), "Scheduled Delivery"]
|
|
522
578
|
}),
|
|
523
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ C(f, {
|
|
524
580
|
id: "scheduledDelivery",
|
|
525
581
|
type: "datetime-local",
|
|
526
|
-
value:
|
|
582
|
+
value: H.scheduledDelivery,
|
|
527
583
|
onChange: (e) => X("scheduledDelivery", e.target.value)
|
|
528
584
|
}),
|
|
529
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ C("p", {
|
|
530
586
|
className: "text-xs text-text-secondary",
|
|
531
587
|
children: "The delivery window promised to the customer. Leave blank to dispatch as soon as a driver is free."
|
|
532
588
|
})
|
|
533
589
|
]
|
|
534
|
-
}), /* @__PURE__ */
|
|
590
|
+
}), /* @__PURE__ */ w("div", {
|
|
535
591
|
className: "md:col-span-2 space-y-2",
|
|
536
|
-
children: [/* @__PURE__ */
|
|
592
|
+
children: [/* @__PURE__ */ C(p, {
|
|
537
593
|
htmlFor: "specialInstructions",
|
|
538
594
|
children: "Special Instructions"
|
|
539
|
-
}), /* @__PURE__ */
|
|
595
|
+
}), /* @__PURE__ */ C(de, {
|
|
540
596
|
id: "specialInstructions",
|
|
541
|
-
value:
|
|
597
|
+
value: H.specialInstructions,
|
|
542
598
|
onChange: (e) => X("specialInstructions", e.target.value),
|
|
543
599
|
placeholder: "Any special handling or delivery instructions...",
|
|
544
600
|
rows: 4
|
|
@@ -551,4 +607,4 @@ function T() {
|
|
|
551
607
|
});
|
|
552
608
|
}
|
|
553
609
|
//#endregion
|
|
554
|
-
export {
|
|
610
|
+
export { E as default };
|