@burdenoff/microfe-movethewheels 2026.921.1 → 2026.924.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/CustomerPicker.js +94 -101
- package/dist/components/EntityCombobox.js +105 -0
- package/dist/components/ui.js +2 -2
- package/dist/generated/wspace-types.d.ts +1676 -3
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useFleet.js +57 -51
- package/dist/hooks/useOrders.js +89 -84
- package/dist/hooks/useRoutes.js +1 -1
- package/dist/index.js +27 -27
- package/dist/movethewheels/components/CustomerPicker.d.ts +3 -2
- package/dist/movethewheels/components/EntityCombobox.d.ts +40 -0
- package/dist/movethewheels/components/ui.d.ts +1 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +4 -0
- 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/node_modules/lucide-react/dist/esm/icons/chevrons-up-down.js +11 -0
- package/dist/pages/CreateOrderPage.js +196 -134
- package/dist/pages/OrderDetailsPage.js +328 -263
- package/dist/pages/RouteDetailsPage.js +277 -266
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1948 -3
- package/src/movethewheels/components/CustomerPicker.tsx +26 -36
- package/src/movethewheels/components/EntityCombobox.tsx +237 -0
- package/src/movethewheels/components/ui.tsx +9 -0
- package/src/movethewheels/hooks/useFleet.ts +19 -6
- package/src/movethewheels/hooks/useOrders.ts +35 -0
- package/src/movethewheels/hooks/useRoutes.ts +1 -1
- package/src/movethewheels/pages/CreateOrderPage.tsx +108 -5
- package/src/movethewheels/pages/OrderDetailsPage.tsx +130 -60
- package/src/movethewheels/pages/RouteDetailsPage.tsx +57 -47
- package/src/movethewheels/types/index.ts +5 -0
|
@@ -3,22 +3,24 @@ 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 {
|
|
6
|
+
import { Route as a } from "../node_modules/lucide-react/dist/esm/icons/route.js";
|
|
7
|
+
import { Save as o } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
7
8
|
import { Trash2 as ee } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
8
|
-
import { Users as
|
|
9
|
-
import { buildCustomerCreatePath as
|
|
10
|
-
import { useMoveTheWheels as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
9
|
+
import { Users as te } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
10
|
+
import { buildCustomerCreatePath as ne, joinPath as s } from "../utils/navigation.js";
|
|
11
|
+
import { useMoveTheWheels as re } from "../providers/MoveTheWheelsProvider.js";
|
|
12
|
+
import { useRoute as ie, useRoutes as ae } from "../hooks/useRoutes.js";
|
|
13
|
+
import { useOrder as oe, useOrders as c } from "../hooks/useOrders.js";
|
|
14
|
+
import { useCustomer as l, useCustomers as u } from "../hooks/useCustomers.js";
|
|
15
|
+
import { Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as g, Label as _, Select as se, SelectContent as ce, SelectItem as v, SelectTrigger as le, SelectValue as ue, Separator as de, Textarea as y } from "../components/ui.js";
|
|
16
|
+
import { EmptyState as fe, PageLayout as pe } from "../components/PageLayout.js";
|
|
17
|
+
import { FormError as me } from "../components/FormError.js";
|
|
18
|
+
import { EntityCombobox as he } from "../components/EntityCombobox.js";
|
|
19
|
+
import { CustomerPicker as ge } from "../components/CustomerPicker.js";
|
|
18
20
|
import { useEffect as b, useState as x } from "react";
|
|
19
|
-
import { useParams as
|
|
20
|
-
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
21
|
-
import { EmphasisPanel as
|
|
21
|
+
import { useParams as _e, useSearchParams as ve } from "react-router";
|
|
22
|
+
import { Fragment as ye, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
23
|
+
import { EmphasisPanel as be, NextSteps as xe, PagePurpose as Se } from "@burdenoff/fe-libs/ui";
|
|
22
24
|
//#region src/movethewheels/pages/CreateOrderPage.tsx
|
|
23
25
|
function w(e) {
|
|
24
26
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
@@ -26,116 +28,143 @@ function w(e) {
|
|
|
26
28
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
27
29
|
}
|
|
28
30
|
function T() {
|
|
29
|
-
let { orderId: T } =
|
|
31
|
+
let { orderId: T } = _e(), [E] = ve(), D = E.get("customerId")?.trim() || void 0, { basePath: O, navigate: k } = re(), { order: A } = oe(T), { createOrder: j, updateOrder: Ce } = c(), [we, Te] = x(""), { customers: M, createCustomer: Ee, isLoading: N, error: P, refetch: De } = u({
|
|
30
32
|
limit: 20,
|
|
31
|
-
filters: { search:
|
|
32
|
-
}), { customer:
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
filters: { search: we || void 0 }
|
|
34
|
+
}), { customer: F } = l(D ?? A?.customerId), [Oe, ke] = x(""), { routes: I, isLoading: L, error: R, hasMore: Ae, totalRoutes: je } = ae({
|
|
35
|
+
status: "planned",
|
|
36
|
+
search: Oe || void 0,
|
|
37
|
+
limit: 20
|
|
38
|
+
}), z = !!T && !!A, [B, V] = x(null), [H, U] = x({
|
|
39
|
+
customerId: D || A?.customerId || "",
|
|
40
|
+
priority: A?.priority || "normal",
|
|
41
|
+
routeId: A?.routeId || "",
|
|
35
42
|
pickupAddress: {
|
|
36
|
-
street:
|
|
37
|
-
city:
|
|
38
|
-
state:
|
|
39
|
-
postalCode:
|
|
40
|
-
country:
|
|
43
|
+
street: A?.pickupAddress.street || "",
|
|
44
|
+
city: A?.pickupAddress.city || "",
|
|
45
|
+
state: A?.pickupAddress.state || "",
|
|
46
|
+
postalCode: A?.pickupAddress.postalCode || "",
|
|
47
|
+
country: A?.pickupAddress.country || "USA"
|
|
41
48
|
},
|
|
42
49
|
deliveryAddress: {
|
|
43
|
-
street:
|
|
44
|
-
city:
|
|
45
|
-
state:
|
|
46
|
-
postalCode:
|
|
47
|
-
country:
|
|
50
|
+
street: A?.deliveryAddress.street || "",
|
|
51
|
+
city: A?.deliveryAddress.city || "",
|
|
52
|
+
state: A?.deliveryAddress.state || "",
|
|
53
|
+
postalCode: A?.deliveryAddress.postalCode || "",
|
|
54
|
+
country: A?.deliveryAddress.country || "USA"
|
|
48
55
|
},
|
|
49
|
-
items:
|
|
50
|
-
scheduledDelivery: w(
|
|
51
|
-
specialInstructions:
|
|
52
|
-
}), [
|
|
56
|
+
items: A?.items || [],
|
|
57
|
+
scheduledDelivery: w(A?.scheduledDelivery),
|
|
58
|
+
specialInstructions: A?.specialInstructions || ""
|
|
59
|
+
}), { route: Me, isLoading: Ne } = ie(H.routeId || void 0), [W, G] = x(!1), [Pe, K] = x(null);
|
|
53
60
|
b(() => {
|
|
54
|
-
|
|
61
|
+
F && (V((e) => e?.id === F.id ? e : F), U((e) => e.customerId ? e : {
|
|
55
62
|
...e,
|
|
56
|
-
customerId:
|
|
63
|
+
customerId: F.id
|
|
57
64
|
}));
|
|
58
|
-
}, [
|
|
59
|
-
|
|
60
|
-
customerId:
|
|
61
|
-
priority:
|
|
65
|
+
}, [F]), b(() => {
|
|
66
|
+
A && U({
|
|
67
|
+
customerId: A.customerId || "",
|
|
68
|
+
priority: A.priority || "normal",
|
|
69
|
+
routeId: A.routeId || "",
|
|
62
70
|
pickupAddress: {
|
|
63
|
-
street:
|
|
64
|
-
city:
|
|
65
|
-
state:
|
|
66
|
-
postalCode:
|
|
67
|
-
country:
|
|
71
|
+
street: A.pickupAddress.street || "",
|
|
72
|
+
city: A.pickupAddress.city || "",
|
|
73
|
+
state: A.pickupAddress.state || "",
|
|
74
|
+
postalCode: A.pickupAddress.postalCode || "",
|
|
75
|
+
country: A.pickupAddress.country || "USA"
|
|
68
76
|
},
|
|
69
77
|
deliveryAddress: {
|
|
70
|
-
street:
|
|
71
|
-
city:
|
|
72
|
-
state:
|
|
73
|
-
postalCode:
|
|
74
|
-
country:
|
|
78
|
+
street: A.deliveryAddress.street || "",
|
|
79
|
+
city: A.deliveryAddress.city || "",
|
|
80
|
+
state: A.deliveryAddress.state || "",
|
|
81
|
+
postalCode: A.deliveryAddress.postalCode || "",
|
|
82
|
+
country: A.deliveryAddress.country || "USA"
|
|
75
83
|
},
|
|
76
|
-
items:
|
|
77
|
-
scheduledDelivery: w(
|
|
78
|
-
specialInstructions:
|
|
84
|
+
items: A.items || [],
|
|
85
|
+
scheduledDelivery: w(A.scheduledDelivery),
|
|
86
|
+
specialInstructions: A.specialInstructions || ""
|
|
79
87
|
});
|
|
80
|
-
}, [
|
|
81
|
-
let
|
|
82
|
-
if (
|
|
83
|
-
if (!
|
|
84
|
-
|
|
88
|
+
}, [A]);
|
|
89
|
+
let q = () => {
|
|
90
|
+
if (k) {
|
|
91
|
+
if (!z && D) {
|
|
92
|
+
k(s(O, `customers/${D}`));
|
|
85
93
|
return;
|
|
86
94
|
}
|
|
87
|
-
|
|
95
|
+
k(s(O, "orders"));
|
|
88
96
|
}
|
|
89
|
-
},
|
|
90
|
-
e.preventDefault(),
|
|
91
|
-
let t =
|
|
97
|
+
}, J = () => B ?? M.find((e) => e.id === H.customerId), Fe = () => !H.customerId || !J() ? P ? "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) => {
|
|
98
|
+
e.preventDefault(), K(null);
|
|
99
|
+
let t = Fe();
|
|
92
100
|
if (t) {
|
|
93
|
-
|
|
101
|
+
K(t);
|
|
94
102
|
return;
|
|
95
103
|
}
|
|
96
|
-
let n =
|
|
104
|
+
let n = J();
|
|
97
105
|
if (!n) {
|
|
98
|
-
|
|
106
|
+
K(P ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
|
|
99
107
|
return;
|
|
100
108
|
}
|
|
101
|
-
|
|
109
|
+
G(!0);
|
|
102
110
|
try {
|
|
103
111
|
let e = {
|
|
104
|
-
customerId:
|
|
112
|
+
customerId: H.customerId,
|
|
105
113
|
customerInfo: {
|
|
106
114
|
name: n.name,
|
|
107
115
|
email: n.email,
|
|
108
116
|
phone: n.phone,
|
|
109
117
|
company: n.company
|
|
110
118
|
},
|
|
111
|
-
priority:
|
|
112
|
-
pickupAddress:
|
|
113
|
-
deliveryAddress:
|
|
114
|
-
items:
|
|
115
|
-
scheduledDelivery:
|
|
116
|
-
|
|
119
|
+
priority: H.priority,
|
|
120
|
+
pickupAddress: H.pickupAddress,
|
|
121
|
+
deliveryAddress: H.deliveryAddress,
|
|
122
|
+
items: H.items,
|
|
123
|
+
scheduledDelivery: H.scheduledDelivery ? new Date(H.scheduledDelivery) : null,
|
|
124
|
+
routeId: H.routeId || void 0,
|
|
125
|
+
specialInstructions: H.specialInstructions
|
|
117
126
|
};
|
|
118
|
-
|
|
127
|
+
z && T ? (await Ce(T, e), k && k(s(O, `orders/${T}`))) : (await j(e), q());
|
|
119
128
|
} catch (e) {
|
|
120
|
-
|
|
129
|
+
K(e instanceof Error ? e.message : z ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
|
|
121
130
|
} finally {
|
|
122
|
-
|
|
131
|
+
G(!1);
|
|
123
132
|
}
|
|
124
133
|
}, X = (e, t) => {
|
|
125
|
-
|
|
134
|
+
U((n) => ({
|
|
126
135
|
...n,
|
|
127
136
|
[e]: t
|
|
128
137
|
}));
|
|
129
138
|
}, Z = (e, t, n) => {
|
|
130
|
-
|
|
139
|
+
U((r) => ({
|
|
131
140
|
...r,
|
|
132
141
|
[e]: {
|
|
133
142
|
...r[e],
|
|
134
143
|
[t]: n
|
|
135
144
|
}
|
|
136
145
|
}));
|
|
146
|
+
}, Ie = (e) => {
|
|
147
|
+
if (!e) {
|
|
148
|
+
X("routeId", "");
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
let t = I.find((t) => t.id === e);
|
|
152
|
+
if (!t) return;
|
|
153
|
+
let n = t.stops.find((e) => e.type === "pickup")?.address, r = [...t.stops].reverse().find((e) => e.type === "delivery")?.address, i = (e, t) => t ? {
|
|
154
|
+
street: e.street.trim() ? e.street : t.street,
|
|
155
|
+
city: e.city.trim() ? e.city : t.city,
|
|
156
|
+
state: e.state.trim() ? e.state : t.state,
|
|
157
|
+
postalCode: e.postalCode.trim() ? e.postalCode : t.postalCode,
|
|
158
|
+
country: e.country.trim() ? e.country : t.country
|
|
159
|
+
} : e;
|
|
160
|
+
U((e) => ({
|
|
161
|
+
...e,
|
|
162
|
+
routeId: t.id,
|
|
163
|
+
pickupAddress: i(e.pickupAddress, n),
|
|
164
|
+
deliveryAddress: i(e.deliveryAddress, r)
|
|
165
|
+
}));
|
|
137
166
|
}, Q = () => {
|
|
138
|
-
|
|
167
|
+
U((e) => ({
|
|
139
168
|
...e,
|
|
140
169
|
items: [...e.items, {
|
|
141
170
|
id: `item-${Date.now()}`,
|
|
@@ -153,13 +182,13 @@ function T() {
|
|
|
153
182
|
sku: ""
|
|
154
183
|
}]
|
|
155
184
|
}));
|
|
156
|
-
},
|
|
157
|
-
|
|
185
|
+
}, Le = (e) => {
|
|
186
|
+
U((t) => ({
|
|
158
187
|
...t,
|
|
159
188
|
items: t.items.filter((t, n) => n !== e)
|
|
160
189
|
}));
|
|
161
190
|
}, $ = (e, t, n) => {
|
|
162
|
-
|
|
191
|
+
U((r) => ({
|
|
163
192
|
...r,
|
|
164
193
|
items: r.items.map((r, i) => i === e ? {
|
|
165
194
|
...r,
|
|
@@ -167,36 +196,36 @@ function T() {
|
|
|
167
196
|
} : r)
|
|
168
197
|
}));
|
|
169
198
|
};
|
|
170
|
-
return /* @__PURE__ */ C(
|
|
171
|
-
title:
|
|
172
|
-
subtitle:
|
|
199
|
+
return /* @__PURE__ */ C(pe, {
|
|
200
|
+
title: z ? "Edit Order" : "Create Order",
|
|
201
|
+
subtitle: z ? `Editing ${A?.orderNumber}` : "Create a new delivery order",
|
|
173
202
|
icon: /* @__PURE__ */ S(r, { size: 24 }),
|
|
174
203
|
headerActions: /* @__PURE__ */ C("div", {
|
|
175
204
|
className: "flex gap-2",
|
|
176
205
|
children: [/* @__PURE__ */ C(d, {
|
|
177
206
|
variant: "outline",
|
|
178
|
-
onClick:
|
|
207
|
+
onClick: q,
|
|
179
208
|
children: [/* @__PURE__ */ S(e, { size: 16 }), "Cancel"]
|
|
180
209
|
}), /* @__PURE__ */ C(d, {
|
|
181
210
|
onClick: Y,
|
|
182
|
-
disabled:
|
|
183
|
-
children: [/* @__PURE__ */ S(
|
|
211
|
+
disabled: W || N,
|
|
212
|
+
children: [/* @__PURE__ */ S(o, { size: 16 }), W ? "Saving..." : z ? "Save Changes" : "Create Order"]
|
|
184
213
|
})]
|
|
185
214
|
}),
|
|
186
215
|
children: [
|
|
187
|
-
/* @__PURE__ */ S(
|
|
216
|
+
/* @__PURE__ */ S(Se, {
|
|
188
217
|
icon: /* @__PURE__ */ S(r, { size: 18 }),
|
|
189
|
-
children:
|
|
218
|
+
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
219
|
}),
|
|
191
|
-
/* @__PURE__ */ S(
|
|
220
|
+
/* @__PURE__ */ S(xe, {
|
|
192
221
|
storageKey: "movethewheels-create-order",
|
|
193
222
|
steps: [
|
|
194
223
|
{
|
|
195
224
|
id: "customer",
|
|
196
225
|
label: "Pick the customer first",
|
|
197
226
|
description: "Their saved contact details auto-fill the order.",
|
|
198
|
-
icon: /* @__PURE__ */ S(
|
|
199
|
-
done: !!
|
|
227
|
+
icon: /* @__PURE__ */ S(te, { size: 16 }),
|
|
228
|
+
done: !!H.customerId,
|
|
200
229
|
onClick: () => document.getElementById("customer")?.focus()
|
|
201
230
|
},
|
|
202
231
|
{
|
|
@@ -204,7 +233,7 @@ function T() {
|
|
|
204
233
|
label: "Set pickup & delivery addresses",
|
|
205
234
|
description: "Where the shipment is collected and dropped off.",
|
|
206
235
|
icon: /* @__PURE__ */ S(n, { size: 16 }),
|
|
207
|
-
done: !!
|
|
236
|
+
done: !!H.pickupAddress.street && !!H.deliveryAddress.street,
|
|
208
237
|
onClick: () => document.getElementById("pickupStreet")?.focus()
|
|
209
238
|
},
|
|
210
239
|
{
|
|
@@ -212,7 +241,7 @@ function T() {
|
|
|
212
241
|
label: "Add the items to ship",
|
|
213
242
|
description: "List each product with its quantity and value.",
|
|
214
243
|
icon: /* @__PURE__ */ S(r, { size: 16 }),
|
|
215
|
-
done:
|
|
244
|
+
done: H.items.length > 0,
|
|
216
245
|
onClick: Q
|
|
217
246
|
}
|
|
218
247
|
]
|
|
@@ -221,58 +250,57 @@ function T() {
|
|
|
221
250
|
onSubmit: Y,
|
|
222
251
|
className: "space-y-6",
|
|
223
252
|
children: [
|
|
224
|
-
/* @__PURE__ */ S(
|
|
225
|
-
/* @__PURE__ */ C(
|
|
253
|
+
/* @__PURE__ */ S(me, { message: Pe }),
|
|
254
|
+
/* @__PURE__ */ C(be, { children: [/* @__PURE__ */ S("h2", {
|
|
226
255
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
227
256
|
children: "Order Details"
|
|
228
257
|
}), /* @__PURE__ */ S("div", {
|
|
229
258
|
className: "space-y-4",
|
|
230
259
|
children: /* @__PURE__ */ C("div", {
|
|
231
260
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
232
|
-
children: [/* @__PURE__ */ S(
|
|
233
|
-
customers:
|
|
234
|
-
value:
|
|
261
|
+
children: [/* @__PURE__ */ S(ge, {
|
|
262
|
+
customers: M,
|
|
263
|
+
value: H.customerId,
|
|
235
264
|
onValueChange: (e) => {
|
|
236
|
-
e && (X("customerId", e),
|
|
265
|
+
e && (X("customerId", e), V(M.find((t) => t.id === e) ?? (B?.id === e ? B : null)), K(null));
|
|
237
266
|
},
|
|
238
267
|
onCreated: (e) => {
|
|
239
|
-
|
|
268
|
+
V(e), X("customerId", e.id), K(null);
|
|
240
269
|
},
|
|
241
|
-
createCustomer:
|
|
242
|
-
isLoading:
|
|
243
|
-
error:
|
|
244
|
-
onRetry:
|
|
270
|
+
createCustomer: Ee,
|
|
271
|
+
isLoading: N,
|
|
272
|
+
error: P,
|
|
273
|
+
onRetry: De,
|
|
245
274
|
onOpenCustomers: () => {
|
|
246
|
-
|
|
275
|
+
k && k(s(O, ne(z && T ? `orders/${T}/edit` : "orders/new")));
|
|
247
276
|
},
|
|
248
|
-
selectedCustomer:
|
|
249
|
-
|
|
250
|
-
onSearchQueryChange: N
|
|
277
|
+
selectedCustomer: B,
|
|
278
|
+
onSearchQueryChange: Te
|
|
251
279
|
}), /* @__PURE__ */ C("div", {
|
|
252
280
|
className: "space-y-2",
|
|
253
281
|
children: [/* @__PURE__ */ S(_, {
|
|
254
282
|
htmlFor: "priority",
|
|
255
283
|
children: "Priority"
|
|
256
|
-
}), /* @__PURE__ */ C(
|
|
257
|
-
value:
|
|
284
|
+
}), /* @__PURE__ */ C(se, {
|
|
285
|
+
value: H.priority,
|
|
258
286
|
onValueChange: (e) => X("priority", e),
|
|
259
|
-
children: [/* @__PURE__ */ S(
|
|
287
|
+
children: [/* @__PURE__ */ S(le, {
|
|
260
288
|
id: "priority",
|
|
261
|
-
children: /* @__PURE__ */ S(
|
|
262
|
-
}), /* @__PURE__ */ C(
|
|
263
|
-
/* @__PURE__ */ S(
|
|
289
|
+
children: /* @__PURE__ */ S(ue, {})
|
|
290
|
+
}), /* @__PURE__ */ C(ce, { children: [
|
|
291
|
+
/* @__PURE__ */ S(v, {
|
|
264
292
|
value: "low",
|
|
265
293
|
children: "Low"
|
|
266
294
|
}),
|
|
267
|
-
/* @__PURE__ */ S(
|
|
295
|
+
/* @__PURE__ */ S(v, {
|
|
268
296
|
value: "normal",
|
|
269
297
|
children: "Normal"
|
|
270
298
|
}),
|
|
271
|
-
/* @__PURE__ */ S(
|
|
299
|
+
/* @__PURE__ */ S(v, {
|
|
272
300
|
value: "high",
|
|
273
301
|
children: "High"
|
|
274
302
|
}),
|
|
275
|
-
/* @__PURE__ */ S(
|
|
303
|
+
/* @__PURE__ */ S(v, {
|
|
276
304
|
value: "urgent",
|
|
277
305
|
children: "Urgent"
|
|
278
306
|
})
|
|
@@ -281,6 +309,40 @@ function T() {
|
|
|
281
309
|
})]
|
|
282
310
|
})
|
|
283
311
|
})] }),
|
|
312
|
+
/* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ C(h, {
|
|
313
|
+
className: "flex items-center gap-2",
|
|
314
|
+
children: [/* @__PURE__ */ S(a, { size: 18 }), "Saved Route (Optional)"]
|
|
315
|
+
}) }), /* @__PURE__ */ C(p, {
|
|
316
|
+
className: "space-y-2",
|
|
317
|
+
children: [/* @__PURE__ */ S(he, {
|
|
318
|
+
id: "saved-route",
|
|
319
|
+
value: H.routeId,
|
|
320
|
+
onChange: Ie,
|
|
321
|
+
options: I,
|
|
322
|
+
loading: L,
|
|
323
|
+
getId: (e) => e.id,
|
|
324
|
+
getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
|
|
325
|
+
renderOption: (e) => /* @__PURE__ */ C(ye, { children: [
|
|
326
|
+
e.name,
|
|
327
|
+
" · ",
|
|
328
|
+
e.stops.length,
|
|
329
|
+
" stops"
|
|
330
|
+
] }),
|
|
331
|
+
selectedOption: Me,
|
|
332
|
+
selectedLoading: Ne,
|
|
333
|
+
placeholder: "Choose a saved route",
|
|
334
|
+
searchPlaceholder: "Search saved routes",
|
|
335
|
+
emptyText: "No saved routes found.",
|
|
336
|
+
noneLabel: "No saved route",
|
|
337
|
+
error: R ? "Saved routes are unavailable" : void 0,
|
|
338
|
+
onSearchChange: ke,
|
|
339
|
+
hasMore: Ae,
|
|
340
|
+
totalCount: je
|
|
341
|
+
}), /* @__PURE__ */ S("p", {
|
|
342
|
+
className: "text-xs text-text-secondary",
|
|
343
|
+
children: L ? "Loading planned routes…" : R ? "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."
|
|
344
|
+
})]
|
|
345
|
+
})] }),
|
|
284
346
|
/* @__PURE__ */ C("div", {
|
|
285
347
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
286
348
|
children: [/* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ S(h, { children: "Pickup Address" }) }), /* @__PURE__ */ C(p, {
|
|
@@ -293,7 +355,7 @@ function T() {
|
|
|
293
355
|
children: "Street Address"
|
|
294
356
|
}), /* @__PURE__ */ S(g, {
|
|
295
357
|
id: "pickupStreet",
|
|
296
|
-
value:
|
|
358
|
+
value: H.pickupAddress.street,
|
|
297
359
|
onChange: (e) => Z("pickupAddress", "street", e.target.value),
|
|
298
360
|
placeholder: "123 Main St"
|
|
299
361
|
})]
|
|
@@ -307,7 +369,7 @@ function T() {
|
|
|
307
369
|
children: "City"
|
|
308
370
|
}), /* @__PURE__ */ S(g, {
|
|
309
371
|
id: "pickupCity",
|
|
310
|
-
value:
|
|
372
|
+
value: H.pickupAddress.city,
|
|
311
373
|
onChange: (e) => Z("pickupAddress", "city", e.target.value),
|
|
312
374
|
placeholder: "San Francisco"
|
|
313
375
|
})]
|
|
@@ -318,7 +380,7 @@ function T() {
|
|
|
318
380
|
children: "State"
|
|
319
381
|
}), /* @__PURE__ */ S(g, {
|
|
320
382
|
id: "pickupState",
|
|
321
|
-
value:
|
|
383
|
+
value: H.pickupAddress.state,
|
|
322
384
|
onChange: (e) => Z("pickupAddress", "state", e.target.value),
|
|
323
385
|
placeholder: "CA"
|
|
324
386
|
})]
|
|
@@ -333,7 +395,7 @@ function T() {
|
|
|
333
395
|
children: "Postal Code"
|
|
334
396
|
}), /* @__PURE__ */ S(g, {
|
|
335
397
|
id: "pickupPostal",
|
|
336
|
-
value:
|
|
398
|
+
value: H.pickupAddress.postalCode,
|
|
337
399
|
onChange: (e) => Z("pickupAddress", "postalCode", e.target.value),
|
|
338
400
|
placeholder: "94103"
|
|
339
401
|
})]
|
|
@@ -344,7 +406,7 @@ function T() {
|
|
|
344
406
|
children: "Country"
|
|
345
407
|
}), /* @__PURE__ */ S(g, {
|
|
346
408
|
id: "pickupCountry",
|
|
347
|
-
value:
|
|
409
|
+
value: H.pickupAddress.country,
|
|
348
410
|
onChange: (e) => Z("pickupAddress", "country", e.target.value),
|
|
349
411
|
placeholder: "USA"
|
|
350
412
|
})]
|
|
@@ -361,7 +423,7 @@ function T() {
|
|
|
361
423
|
children: "Street Address"
|
|
362
424
|
}), /* @__PURE__ */ S(g, {
|
|
363
425
|
id: "deliveryStreet",
|
|
364
|
-
value:
|
|
426
|
+
value: H.deliveryAddress.street,
|
|
365
427
|
onChange: (e) => Z("deliveryAddress", "street", e.target.value),
|
|
366
428
|
placeholder: "456 Oak Ave"
|
|
367
429
|
})]
|
|
@@ -375,7 +437,7 @@ function T() {
|
|
|
375
437
|
children: "City"
|
|
376
438
|
}), /* @__PURE__ */ S(g, {
|
|
377
439
|
id: "deliveryCity",
|
|
378
|
-
value:
|
|
440
|
+
value: H.deliveryAddress.city,
|
|
379
441
|
onChange: (e) => Z("deliveryAddress", "city", e.target.value),
|
|
380
442
|
placeholder: "Los Angeles"
|
|
381
443
|
})]
|
|
@@ -386,7 +448,7 @@ function T() {
|
|
|
386
448
|
children: "State"
|
|
387
449
|
}), /* @__PURE__ */ S(g, {
|
|
388
450
|
id: "deliveryState",
|
|
389
|
-
value:
|
|
451
|
+
value: H.deliveryAddress.state,
|
|
390
452
|
onChange: (e) => Z("deliveryAddress", "state", e.target.value),
|
|
391
453
|
placeholder: "CA"
|
|
392
454
|
})]
|
|
@@ -401,7 +463,7 @@ function T() {
|
|
|
401
463
|
children: "Postal Code"
|
|
402
464
|
}), /* @__PURE__ */ S(g, {
|
|
403
465
|
id: "deliveryPostal",
|
|
404
|
-
value:
|
|
466
|
+
value: H.deliveryAddress.postalCode,
|
|
405
467
|
onChange: (e) => Z("deliveryAddress", "postalCode", e.target.value),
|
|
406
468
|
placeholder: "90210"
|
|
407
469
|
})]
|
|
@@ -412,7 +474,7 @@ function T() {
|
|
|
412
474
|
children: "Country"
|
|
413
475
|
}), /* @__PURE__ */ S(g, {
|
|
414
476
|
id: "deliveryCountry",
|
|
415
|
-
value:
|
|
477
|
+
value: H.deliveryAddress.country,
|
|
416
478
|
onChange: (e) => Z("deliveryAddress", "country", e.target.value),
|
|
417
479
|
placeholder: "USA"
|
|
418
480
|
})]
|
|
@@ -430,7 +492,7 @@ function T() {
|
|
|
430
492
|
onClick: Q,
|
|
431
493
|
children: [/* @__PURE__ */ S(i, { size: 16 }), "Add Item"]
|
|
432
494
|
})]
|
|
433
|
-
}), /* @__PURE__ */ S(p, { children:
|
|
495
|
+
}), /* @__PURE__ */ S(p, { children: H.items.length === 0 ? /* @__PURE__ */ S(fe, {
|
|
434
496
|
illustration: "empty-files",
|
|
435
497
|
title: "No items added yet",
|
|
436
498
|
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
@@ -445,7 +507,7 @@ function T() {
|
|
|
445
507
|
})
|
|
446
508
|
}) : /* @__PURE__ */ S("div", {
|
|
447
509
|
className: "space-y-4",
|
|
448
|
-
children:
|
|
510
|
+
children: H.items.map((e, t) => /* @__PURE__ */ C("div", { children: [t > 0 && /* @__PURE__ */ S(de, { className: "my-4" }), /* @__PURE__ */ C("div", {
|
|
449
511
|
className: "grid grid-cols-1 md:grid-cols-7 gap-4",
|
|
450
512
|
children: [
|
|
451
513
|
/* @__PURE__ */ C("div", {
|
|
@@ -500,7 +562,7 @@ function T() {
|
|
|
500
562
|
variant: "ghost",
|
|
501
563
|
size: "icon",
|
|
502
564
|
className: "text-status-error-text",
|
|
503
|
-
onClick: () =>
|
|
565
|
+
onClick: () => Le(t),
|
|
504
566
|
children: /* @__PURE__ */ S(ee, { size: 16 })
|
|
505
567
|
})
|
|
506
568
|
})
|
|
@@ -523,7 +585,7 @@ function T() {
|
|
|
523
585
|
/* @__PURE__ */ S(g, {
|
|
524
586
|
id: "scheduledDelivery",
|
|
525
587
|
type: "datetime-local",
|
|
526
|
-
value:
|
|
588
|
+
value: H.scheduledDelivery,
|
|
527
589
|
onChange: (e) => X("scheduledDelivery", e.target.value)
|
|
528
590
|
}),
|
|
529
591
|
/* @__PURE__ */ S("p", {
|
|
@@ -536,9 +598,9 @@ function T() {
|
|
|
536
598
|
children: [/* @__PURE__ */ S(_, {
|
|
537
599
|
htmlFor: "specialInstructions",
|
|
538
600
|
children: "Special Instructions"
|
|
539
|
-
}), /* @__PURE__ */ S(
|
|
601
|
+
}), /* @__PURE__ */ S(y, {
|
|
540
602
|
id: "specialInstructions",
|
|
541
|
-
value:
|
|
603
|
+
value: H.specialInstructions,
|
|
542
604
|
onChange: (e) => X("specialInstructions", e.target.value),
|
|
543
605
|
placeholder: "Any special handling or delivery instructions...",
|
|
544
606
|
rows: 4
|