@burdenoff/microfe-movethewheels 2026.924.2 → 2026.925.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/OrderItemRow.js +195 -109
- package/dist/constants/index.js +1 -0
- package/dist/generated/wspace-operations.d.ts +7 -0
- package/dist/hooks/useOrders.js +8 -4
- package/dist/hooks/useTracking.js +127 -66
- package/dist/movethewheels/components/OrderItemRow.d.ts +1 -2
- package/dist/movethewheels/hooks/useOrders.d.ts +1 -0
- package/dist/movethewheels/hooks/useTracking.d.ts +2 -2
- package/dist/movethewheels/types/index.d.ts +1 -1
- package/dist/pages/CreateOrderPage.js +597 -420
- package/dist/pages/OrderDetailsPage.js +289 -266
- package/dist/pages/OrdersListPage.js +4 -0
- package/dist/pages/TrackingPage.js +205 -195
- package/dist/utils/mapMarkers.js +2 -1
- package/package.json +1 -1
- package/src/generated/wspace-operations.ts +10 -3
- package/src/movethewheels/components/OrderItemRow.tsx +162 -99
- package/src/movethewheels/constants/index.ts +1 -0
- package/src/movethewheels/hooks/useOrders.ts +17 -3
- package/src/movethewheels/hooks/useTracking.ts +208 -27
- package/src/movethewheels/pages/CreateOrderPage.tsx +372 -263
- package/src/movethewheels/pages/OrderDetailsPage.tsx +55 -23
- package/src/movethewheels/pages/OrdersListPage.tsx +1 -0
- package/src/movethewheels/pages/TrackingPage.tsx +44 -14
- package/src/movethewheels/types/index.ts +1 -0
- package/src/movethewheels/utils/mapMarkers.ts +1 -0
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +5 -0
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +2 -2
|
@@ -1,106 +1,107 @@
|
|
|
1
1
|
import { ArrowLeft as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { ArrowRight as t } from "../node_modules/lucide-react/dist/esm/icons/arrow-right.js";
|
|
3
|
+
import { CalendarClock as n } from "../node_modules/lucide-react/dist/esm/icons/calendar-clock.js";
|
|
4
|
+
import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
5
|
+
import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
6
|
+
import { Plus as a } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
7
7
|
import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
8
8
|
import { Users as te } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
9
9
|
import { buildCustomerCreatePath as ne, joinPath as o } from "../utils/navigation.js";
|
|
10
10
|
import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
|
|
11
|
-
import { useRoute as
|
|
12
|
-
import { useOrder as
|
|
13
|
-
import { useProducts as
|
|
14
|
-
import { useCustomer as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { EmptyState as
|
|
17
|
-
import { FormError as
|
|
18
|
-
import { EntityCombobox as
|
|
19
|
-
import { CustomerPicker as
|
|
20
|
-
import { OrderItemRow as
|
|
21
|
-
import { useEffect as
|
|
22
|
-
import { useParams as
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { EmphasisPanel as
|
|
11
|
+
import { useRoute as re, useRoutes as ie } from "../hooks/useRoutes.js";
|
|
12
|
+
import { useOrder as ae, useOrders as oe } from "../hooks/useOrders.js";
|
|
13
|
+
import { useProducts as se } from "../hooks/useInventory.js";
|
|
14
|
+
import { useCustomer as ce, useCustomers as le } from "../hooks/useCustomers.js";
|
|
15
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardDescription as f, CardHeader as p, CardTitle as m, Input as h, Label as g, Select as ue, SelectContent as de, SelectItem as _, SelectTrigger as fe, SelectValue as pe, Separator as me, Textarea as he } from "../components/ui.js";
|
|
16
|
+
import { EmptyState as ge, PageLayout as _e } from "../components/PageLayout.js";
|
|
17
|
+
import { FormError as ve } from "../components/FormError.js";
|
|
18
|
+
import { EntityCombobox as ye } from "../components/EntityCombobox.js";
|
|
19
|
+
import { CustomerPicker as v } from "../components/CustomerPicker.js";
|
|
20
|
+
import { OrderItemRow as y } from "../components/OrderItemRow.js";
|
|
21
|
+
import { useEffect as b, useState as x } from "react";
|
|
22
|
+
import { useParams as be, useSearchParams as xe } from "react-router";
|
|
23
|
+
import { Fragment as Se, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
24
|
+
import { EmphasisPanel as Ce, PagePurpose as we, Stepper as Te } from "@burdenoff/fe-libs/ui";
|
|
25
|
+
import { FormSection as w } from "@burdenoff/fe-libs/form";
|
|
25
26
|
//#region src/movethewheels/pages/CreateOrderPage.tsx
|
|
26
|
-
function
|
|
27
|
+
function T(e) {
|
|
27
28
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
28
29
|
let t = (e) => String(e).padStart(2, "0");
|
|
29
30
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
let { orderId:
|
|
32
|
+
function E() {
|
|
33
|
+
let { orderId: E } = be(), [D] = xe(), O = D.get("customerId")?.trim() || void 0, { basePath: k, navigate: A } = s(), { order: j } = ae(E), { createOrder: Ee, updateOrder: De } = oe(), [Oe, ke] = x(""), { customers: M, createCustomer: Ae, isLoading: N, error: P, refetch: je } = le({
|
|
33
34
|
limit: 20,
|
|
34
|
-
filters: { search:
|
|
35
|
-
}), { customer: F } =
|
|
35
|
+
filters: { search: Oe || void 0 }
|
|
36
|
+
}), { customer: F } = ce(O ?? j?.customerId), [Me, Ne] = x(""), { routes: I, isLoading: L, error: R, hasMore: Pe, totalRoutes: Fe } = ie({
|
|
36
37
|
status: "planned",
|
|
37
|
-
search:
|
|
38
|
+
search: Me || void 0,
|
|
38
39
|
limit: 20
|
|
39
|
-
}), [z,
|
|
40
|
+
}), [z, Ie] = x(""), { products: Le, isLoading: Re } = se({
|
|
40
41
|
search: z || void 0,
|
|
41
42
|
limit: 20
|
|
42
|
-
}), B = !!
|
|
43
|
-
customerId:
|
|
44
|
-
priority:
|
|
45
|
-
routeId:
|
|
43
|
+
}), B = !!E && !!j, [V, H] = x(null), [U, W] = x({
|
|
44
|
+
customerId: O || j?.customerId || "",
|
|
45
|
+
priority: j?.priority || "normal",
|
|
46
|
+
routeId: j?.routeId || "",
|
|
46
47
|
pickupAddress: {
|
|
47
|
-
street:
|
|
48
|
-
city:
|
|
49
|
-
state:
|
|
50
|
-
postalCode:
|
|
51
|
-
country:
|
|
48
|
+
street: j?.pickupAddress.street || "",
|
|
49
|
+
city: j?.pickupAddress.city || "",
|
|
50
|
+
state: j?.pickupAddress.state || "",
|
|
51
|
+
postalCode: j?.pickupAddress.postalCode || "",
|
|
52
|
+
country: j?.pickupAddress.country || "USA"
|
|
52
53
|
},
|
|
53
54
|
deliveryAddress: {
|
|
54
|
-
street:
|
|
55
|
-
city:
|
|
56
|
-
state:
|
|
57
|
-
postalCode:
|
|
58
|
-
country:
|
|
55
|
+
street: j?.deliveryAddress.street || "",
|
|
56
|
+
city: j?.deliveryAddress.city || "",
|
|
57
|
+
state: j?.deliveryAddress.state || "",
|
|
58
|
+
postalCode: j?.deliveryAddress.postalCode || "",
|
|
59
|
+
country: j?.deliveryAddress.country || "USA"
|
|
59
60
|
},
|
|
60
|
-
items:
|
|
61
|
-
scheduledDelivery:
|
|
62
|
-
specialInstructions:
|
|
63
|
-
}), { route:
|
|
64
|
-
|
|
61
|
+
items: j?.items || [],
|
|
62
|
+
scheduledDelivery: T(j?.scheduledDelivery),
|
|
63
|
+
specialInstructions: j?.specialInstructions || ""
|
|
64
|
+
}), { route: ze, isLoading: Be } = re(U.routeId || void 0), [G, K] = x(!1), [Ve, q] = x(null);
|
|
65
|
+
b(() => {
|
|
65
66
|
F && (H((e) => e?.id === F.id ? e : F), W((e) => e.customerId ? e : {
|
|
66
67
|
...e,
|
|
67
68
|
customerId: F.id
|
|
68
69
|
}));
|
|
69
|
-
}, [F]),
|
|
70
|
-
|
|
71
|
-
customerId:
|
|
72
|
-
priority:
|
|
73
|
-
routeId:
|
|
70
|
+
}, [F]), b(() => {
|
|
71
|
+
j && W({
|
|
72
|
+
customerId: j.customerId || "",
|
|
73
|
+
priority: j.priority || "normal",
|
|
74
|
+
routeId: j.routeId || "",
|
|
74
75
|
pickupAddress: {
|
|
75
|
-
street:
|
|
76
|
-
city:
|
|
77
|
-
state:
|
|
78
|
-
postalCode:
|
|
79
|
-
country:
|
|
76
|
+
street: j.pickupAddress.street || "",
|
|
77
|
+
city: j.pickupAddress.city || "",
|
|
78
|
+
state: j.pickupAddress.state || "",
|
|
79
|
+
postalCode: j.pickupAddress.postalCode || "",
|
|
80
|
+
country: j.pickupAddress.country || "USA"
|
|
80
81
|
},
|
|
81
82
|
deliveryAddress: {
|
|
82
|
-
street:
|
|
83
|
-
city:
|
|
84
|
-
state:
|
|
85
|
-
postalCode:
|
|
86
|
-
country:
|
|
83
|
+
street: j.deliveryAddress.street || "",
|
|
84
|
+
city: j.deliveryAddress.city || "",
|
|
85
|
+
state: j.deliveryAddress.state || "",
|
|
86
|
+
postalCode: j.deliveryAddress.postalCode || "",
|
|
87
|
+
country: j.deliveryAddress.country || "USA"
|
|
87
88
|
},
|
|
88
|
-
items:
|
|
89
|
-
scheduledDelivery:
|
|
90
|
-
specialInstructions:
|
|
89
|
+
items: j.items || [],
|
|
90
|
+
scheduledDelivery: T(j.scheduledDelivery),
|
|
91
|
+
specialInstructions: j.specialInstructions || ""
|
|
91
92
|
});
|
|
92
|
-
}, [
|
|
93
|
+
}, [j]);
|
|
93
94
|
let J = () => {
|
|
94
|
-
if (
|
|
95
|
-
if (!B &&
|
|
96
|
-
|
|
95
|
+
if (A) {
|
|
96
|
+
if (!B && O) {
|
|
97
|
+
A(o(k, `customers/${O}`));
|
|
97
98
|
return;
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
+
A(o(k, "orders"));
|
|
100
101
|
}
|
|
101
|
-
}, Y = () => V ??
|
|
102
|
+
}, Y = () => V ?? M.find((e) => e.id === U.customerId), He = () => !U.customerId || !Y() ? P ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : U.pickupAddress.street.trim() ? U.deliveryAddress.street.trim() ? U.items.length === 0 ? "Add at least one item to the order." : U.scheduledDelivery && Number.isNaN(Date.parse(U.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", X = async (e) => {
|
|
102
103
|
e.preventDefault(), q(null);
|
|
103
|
-
let t =
|
|
104
|
+
let t = He();
|
|
104
105
|
if (t) {
|
|
105
106
|
q(t);
|
|
106
107
|
return;
|
|
@@ -128,7 +129,11 @@ function w() {
|
|
|
128
129
|
routeId: U.routeId || void 0,
|
|
129
130
|
specialInstructions: U.specialInstructions
|
|
130
131
|
};
|
|
131
|
-
B &&
|
|
132
|
+
if (B && E) await De(E, e), A && A(o(k, `orders/${E}`));
|
|
133
|
+
else {
|
|
134
|
+
let t = await Ee(e);
|
|
135
|
+
A ? A(o(k, `orders/${t.id}`)) : J();
|
|
136
|
+
}
|
|
132
137
|
} catch (e) {
|
|
133
138
|
q(e instanceof Error ? e.message : B ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
|
|
134
139
|
} finally {
|
|
@@ -147,7 +152,7 @@ function w() {
|
|
|
147
152
|
[t]: n
|
|
148
153
|
}
|
|
149
154
|
}));
|
|
150
|
-
},
|
|
155
|
+
}, Ue = (e) => {
|
|
151
156
|
if (!e) {
|
|
152
157
|
Z("routeId", "");
|
|
153
158
|
return;
|
|
@@ -186,12 +191,12 @@ function w() {
|
|
|
186
191
|
sku: ""
|
|
187
192
|
}]
|
|
188
193
|
}));
|
|
189
|
-
},
|
|
194
|
+
}, We = (e) => {
|
|
190
195
|
W((t) => ({
|
|
191
196
|
...t,
|
|
192
197
|
items: t.items.filter((t, n) => n !== e)
|
|
193
198
|
}));
|
|
194
|
-
},
|
|
199
|
+
}, Ge = (e, t, n) => {
|
|
195
200
|
W((r) => ({
|
|
196
201
|
...r,
|
|
197
202
|
items: r.items.map((r, i) => i === e ? {
|
|
@@ -199,388 +204,560 @@ function w() {
|
|
|
199
204
|
[t]: n
|
|
200
205
|
} : r)
|
|
201
206
|
}));
|
|
202
|
-
}
|
|
203
|
-
|
|
207
|
+
}, Ke = () => {
|
|
208
|
+
A && A(o(k, ne(B && E ? `orders/${E}/edit` : "orders/new")));
|
|
209
|
+
}, qe = U.customerId ? !U.pickupAddress.street || !U.deliveryAddress.street ? 1 : U.items.length === 0 ? 2 : 3 : 0;
|
|
210
|
+
return /* @__PURE__ */ C(_e, {
|
|
204
211
|
title: B ? "Edit Order" : "Create Order",
|
|
205
|
-
subtitle: B ? `Editing ${
|
|
206
|
-
icon: /* @__PURE__ */
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
212
|
+
subtitle: B ? `Editing ${j?.orderNumber}` : "Create a new delivery order",
|
|
213
|
+
icon: /* @__PURE__ */ S(i, { size: 24 }),
|
|
214
|
+
maxWidth: "2xl",
|
|
215
|
+
headerActions: /* @__PURE__ */ C("div", {
|
|
216
|
+
className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row",
|
|
217
|
+
children: [/* @__PURE__ */ C(l, {
|
|
218
|
+
type: "button",
|
|
210
219
|
variant: "outline",
|
|
211
220
|
onClick: J,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
221
|
+
disabled: G,
|
|
222
|
+
children: [/* @__PURE__ */ S(e, { size: 16 }), "Cancel"]
|
|
223
|
+
}), /* @__PURE__ */ C(l, {
|
|
224
|
+
type: "submit",
|
|
225
|
+
form: "order-form",
|
|
215
226
|
disabled: G || N,
|
|
216
|
-
children: [/* @__PURE__ */
|
|
227
|
+
children: [/* @__PURE__ */ S(ee, { size: 16 }), G ? "Saving..." : B ? "Save Changes" : "Create Order"]
|
|
217
228
|
})]
|
|
218
229
|
}),
|
|
219
230
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
icon: /* @__PURE__ */
|
|
222
|
-
children: B ? "Update
|
|
231
|
+
/* @__PURE__ */ S(we, {
|
|
232
|
+
icon: /* @__PURE__ */ S(i, { size: 18 }),
|
|
233
|
+
children: B ? "Update the customer, delivery plan, shipment contents, or handling details before saving." : "Set the customer and delivery plan, add what is being shipped, then choose any timing or handling preferences."
|
|
223
234
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
storageKey: "movethewheels-create-order",
|
|
235
|
+
/* @__PURE__ */ S(Te, {
|
|
226
236
|
steps: [
|
|
227
237
|
{
|
|
228
|
-
|
|
229
|
-
label: "
|
|
230
|
-
description: "
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
238
|
+
key: "customer",
|
|
239
|
+
label: "Customer & priority",
|
|
240
|
+
description: "Who is receiving this delivery?"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
key: "locations",
|
|
244
|
+
label: "Route & addresses",
|
|
245
|
+
description: "Where should it be collected and delivered?"
|
|
234
246
|
},
|
|
235
247
|
{
|
|
236
|
-
|
|
237
|
-
label: "
|
|
238
|
-
description: "
|
|
239
|
-
icon: /* @__PURE__ */ x(n, { size: 16 }),
|
|
240
|
-
done: !!U.pickupAddress.street && !!U.deliveryAddress.street,
|
|
241
|
-
onClick: () => document.getElementById("pickupStreet")?.focus()
|
|
248
|
+
key: "items",
|
|
249
|
+
label: "Shipment contents",
|
|
250
|
+
description: "What is being shipped?"
|
|
242
251
|
},
|
|
243
252
|
{
|
|
244
|
-
|
|
245
|
-
label: "
|
|
246
|
-
description: "
|
|
247
|
-
icon: /* @__PURE__ */ x(r, { size: 16 }),
|
|
248
|
-
done: U.items.length > 0,
|
|
249
|
-
onClick: $
|
|
253
|
+
key: "preferences",
|
|
254
|
+
label: "Timing & handling",
|
|
255
|
+
description: "Add optional delivery instructions."
|
|
250
256
|
}
|
|
251
|
-
]
|
|
257
|
+
],
|
|
258
|
+
active: qe,
|
|
259
|
+
onStepClick: (e) => {
|
|
260
|
+
let t = document.getElementById([
|
|
261
|
+
"customer",
|
|
262
|
+
"pickupStreet",
|
|
263
|
+
"items-section",
|
|
264
|
+
"scheduledDelivery"
|
|
265
|
+
][e]);
|
|
266
|
+
if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {
|
|
267
|
+
t.focus();
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
t?.scrollIntoView({
|
|
271
|
+
behavior: "smooth",
|
|
272
|
+
block: "start"
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
allowSkipAhead: !0
|
|
252
276
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ C("form", {
|
|
278
|
+
id: "order-form",
|
|
254
279
|
onSubmit: X,
|
|
255
280
|
className: "space-y-6",
|
|
256
281
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */ S(
|
|
259
|
-
|
|
260
|
-
children:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
282
|
+
/* @__PURE__ */ S(ve, { message: Ve }),
|
|
283
|
+
/* @__PURE__ */ S("section", {
|
|
284
|
+
"aria-labelledby": "order-details-title",
|
|
285
|
+
children: /* @__PURE__ */ C(Ce, {
|
|
286
|
+
className: "space-y-5",
|
|
287
|
+
children: [/* @__PURE__ */ C("div", {
|
|
288
|
+
className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
|
|
289
|
+
children: [/* @__PURE__ */ C("div", {
|
|
290
|
+
className: "flex items-start gap-3",
|
|
291
|
+
children: [/* @__PURE__ */ S("div", {
|
|
292
|
+
className: "rounded-xl bg-action-primary-bg/10 p-2 text-action-primary-bg",
|
|
293
|
+
children: /* @__PURE__ */ S(te, {
|
|
294
|
+
size: 18,
|
|
295
|
+
"aria-hidden": "true"
|
|
296
|
+
})
|
|
297
|
+
}), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h2", {
|
|
298
|
+
id: "order-details-title",
|
|
299
|
+
className: "text-base font-semibold text-text-primary",
|
|
300
|
+
children: "Customer & priority"
|
|
301
|
+
}), /* @__PURE__ */ S("p", {
|
|
302
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
303
|
+
children: "Choose who this delivery is for and how urgently it should be handled."
|
|
304
|
+
})] })]
|
|
305
|
+
}), /* @__PURE__ */ S(c, {
|
|
306
|
+
variant: "outline",
|
|
307
|
+
children: "Required"
|
|
308
|
+
})]
|
|
309
|
+
}), /* @__PURE__ */ C("div", {
|
|
310
|
+
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
311
|
+
children: [/* @__PURE__ */ S(v, {
|
|
312
|
+
customers: M,
|
|
313
|
+
value: U.customerId,
|
|
314
|
+
onValueChange: (e) => {
|
|
315
|
+
e && (Z("customerId", e), H(M.find((t) => t.id === e) ?? (V?.id === e ? V : null)), q(null));
|
|
316
|
+
},
|
|
317
|
+
onCreated: (e) => {
|
|
318
|
+
H(e), Z("customerId", e.id), q(null);
|
|
319
|
+
},
|
|
320
|
+
createCustomer: Ae,
|
|
321
|
+
isLoading: N,
|
|
322
|
+
error: P,
|
|
323
|
+
onRetry: je,
|
|
324
|
+
onOpenCustomers: Ke,
|
|
325
|
+
selectedCustomer: V,
|
|
326
|
+
onSearchQueryChange: ke
|
|
327
|
+
}), /* @__PURE__ */ C("div", {
|
|
328
|
+
className: "space-y-2",
|
|
329
|
+
children: [
|
|
330
|
+
/* @__PURE__ */ S(g, {
|
|
331
|
+
htmlFor: "priority",
|
|
332
|
+
children: "Priority"
|
|
302
333
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
value:
|
|
305
|
-
|
|
334
|
+
/* @__PURE__ */ C(ue, {
|
|
335
|
+
value: U.priority,
|
|
336
|
+
onValueChange: (e) => Z("priority", e),
|
|
337
|
+
children: [/* @__PURE__ */ S(fe, {
|
|
338
|
+
id: "priority",
|
|
339
|
+
children: /* @__PURE__ */ S(pe, {})
|
|
340
|
+
}), /* @__PURE__ */ C(de, { children: [
|
|
341
|
+
/* @__PURE__ */ S(_, {
|
|
342
|
+
value: "low",
|
|
343
|
+
children: "Low"
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ S(_, {
|
|
346
|
+
value: "normal",
|
|
347
|
+
children: "Normal"
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ S(_, {
|
|
350
|
+
value: "high",
|
|
351
|
+
children: "High"
|
|
352
|
+
}),
|
|
353
|
+
/* @__PURE__ */ S(_, {
|
|
354
|
+
value: "urgent",
|
|
355
|
+
children: "Urgent"
|
|
356
|
+
})
|
|
357
|
+
] })]
|
|
306
358
|
}),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
|
|
309
|
-
children: "
|
|
359
|
+
/* @__PURE__ */ S("p", {
|
|
360
|
+
className: "text-xs text-text-secondary",
|
|
361
|
+
children: "Normal is selected by default."
|
|
310
362
|
})
|
|
311
|
-
]
|
|
363
|
+
]
|
|
312
364
|
})]
|
|
313
365
|
})]
|
|
314
366
|
})
|
|
315
|
-
})
|
|
316
|
-
/* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(p, { children: /* @__PURE__ */ S(m, {
|
|
317
|
-
className: "flex items-center gap-2",
|
|
318
|
-
children: [/* @__PURE__ */ x(a, { size: 18 }), "Saved Route (Optional)"]
|
|
319
|
-
}) }), /* @__PURE__ */ S(f, {
|
|
320
|
-
className: "space-y-2",
|
|
321
|
-
children: [/* @__PURE__ */ x(he, {
|
|
322
|
-
id: "saved-route",
|
|
323
|
-
value: U.routeId,
|
|
324
|
-
onChange: ze,
|
|
325
|
-
options: I,
|
|
326
|
-
loading: L,
|
|
327
|
-
getId: (e) => e.id,
|
|
328
|
-
getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
|
|
329
|
-
renderOption: (e) => /* @__PURE__ */ S(be, { children: [
|
|
330
|
-
e.name,
|
|
331
|
-
" · ",
|
|
332
|
-
e.stops.length,
|
|
333
|
-
" stops"
|
|
334
|
-
] }),
|
|
335
|
-
selectedOption: Fe,
|
|
336
|
-
selectedLoading: Ie,
|
|
337
|
-
placeholder: "Choose a saved route",
|
|
338
|
-
searchPlaceholder: "Search saved routes",
|
|
339
|
-
emptyText: "No saved routes found.",
|
|
340
|
-
noneLabel: "No saved route",
|
|
341
|
-
error: R ? "Saved routes are unavailable" : void 0,
|
|
342
|
-
onSearchChange: ke,
|
|
343
|
-
hasMore: Ae,
|
|
344
|
-
totalCount: je
|
|
345
|
-
}), /* @__PURE__ */ x("p", {
|
|
346
|
-
className: "text-xs text-text-secondary",
|
|
347
|
-
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."
|
|
348
|
-
})]
|
|
349
|
-
})] }),
|
|
367
|
+
}),
|
|
350
368
|
/* @__PURE__ */ S("div", {
|
|
351
|
-
|
|
352
|
-
children:
|
|
353
|
-
|
|
369
|
+
id: "locations-section",
|
|
370
|
+
children: /* @__PURE__ */ C(w, {
|
|
371
|
+
title: /* @__PURE__ */ C("span", {
|
|
372
|
+
className: "flex items-center gap-2",
|
|
373
|
+
children: [/* @__PURE__ */ S(r, {
|
|
374
|
+
size: 18,
|
|
375
|
+
"aria-hidden": "true"
|
|
376
|
+
}), "Route & addresses"]
|
|
377
|
+
}),
|
|
378
|
+
description: "Choose an optional saved route, then review or enter the collection and destination details.",
|
|
354
379
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
className: "
|
|
357
|
-
children: [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
children: "
|
|
400
|
-
})
|
|
401
|
-
|
|
402
|
-
value: U.pickupAddress.postalCode,
|
|
403
|
-
onChange: (e) => Q("pickupAddress", "postalCode", e.target.value),
|
|
404
|
-
placeholder: "94103"
|
|
405
|
-
})]
|
|
406
|
-
}), /* @__PURE__ */ S("div", {
|
|
407
|
-
className: "space-y-2",
|
|
408
|
-
children: [/* @__PURE__ */ x(g, {
|
|
409
|
-
htmlFor: "pickupCountry",
|
|
410
|
-
children: "Country"
|
|
411
|
-
}), /* @__PURE__ */ x(h, {
|
|
412
|
-
id: "pickupCountry",
|
|
413
|
-
value: U.pickupAddress.country,
|
|
414
|
-
onChange: (e) => Q("pickupAddress", "country", e.target.value),
|
|
415
|
-
placeholder: "USA"
|
|
416
|
-
})]
|
|
417
|
-
})]
|
|
418
|
-
})
|
|
419
|
-
]
|
|
420
|
-
})] }), /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(p, { children: /* @__PURE__ */ x(m, { children: "Delivery Address" }) }), /* @__PURE__ */ S(f, {
|
|
421
|
-
className: "space-y-4",
|
|
422
|
-
children: [
|
|
423
|
-
/* @__PURE__ */ S("div", {
|
|
424
|
-
className: "space-y-2",
|
|
425
|
-
children: [/* @__PURE__ */ x(g, {
|
|
426
|
-
htmlFor: "deliveryStreet",
|
|
427
|
-
children: "Street Address"
|
|
428
|
-
}), /* @__PURE__ */ x(h, {
|
|
429
|
-
id: "deliveryStreet",
|
|
430
|
-
value: U.deliveryAddress.street,
|
|
431
|
-
onChange: (e) => Q("deliveryAddress", "street", e.target.value),
|
|
432
|
-
placeholder: "456 Oak Ave"
|
|
433
|
-
})]
|
|
434
|
-
}),
|
|
435
|
-
/* @__PURE__ */ S("div", {
|
|
436
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
437
|
-
children: [/* @__PURE__ */ S("div", {
|
|
438
|
-
className: "space-y-2",
|
|
439
|
-
children: [/* @__PURE__ */ x(g, {
|
|
440
|
-
htmlFor: "deliveryCity",
|
|
441
|
-
children: "City"
|
|
442
|
-
}), /* @__PURE__ */ x(h, {
|
|
443
|
-
id: "deliveryCity",
|
|
444
|
-
value: U.deliveryAddress.city,
|
|
445
|
-
onChange: (e) => Q("deliveryAddress", "city", e.target.value),
|
|
446
|
-
placeholder: "Los Angeles"
|
|
447
|
-
})]
|
|
448
|
-
}), /* @__PURE__ */ S("div", {
|
|
449
|
-
className: "space-y-2",
|
|
450
|
-
children: [/* @__PURE__ */ x(g, {
|
|
451
|
-
htmlFor: "deliveryState",
|
|
452
|
-
children: "State"
|
|
453
|
-
}), /* @__PURE__ */ x(h, {
|
|
454
|
-
id: "deliveryState",
|
|
455
|
-
value: U.deliveryAddress.state,
|
|
456
|
-
onChange: (e) => Q("deliveryAddress", "state", e.target.value),
|
|
457
|
-
placeholder: "CA"
|
|
458
|
-
})]
|
|
459
|
-
})]
|
|
380
|
+
/* @__PURE__ */ C("div", {
|
|
381
|
+
className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
|
|
382
|
+
children: [
|
|
383
|
+
/* @__PURE__ */ C("div", {
|
|
384
|
+
className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",
|
|
385
|
+
children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
|
|
386
|
+
className: "text-sm font-semibold text-text-primary",
|
|
387
|
+
children: "Use a saved route"
|
|
388
|
+
}), /* @__PURE__ */ S("p", {
|
|
389
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
390
|
+
children: "Optional — fills only blank address fields; you can always edit them below."
|
|
391
|
+
})] }), /* @__PURE__ */ S(c, {
|
|
392
|
+
variant: "secondary",
|
|
393
|
+
children: "Optional"
|
|
394
|
+
})]
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ S(ye, {
|
|
397
|
+
id: "saved-route",
|
|
398
|
+
value: U.routeId,
|
|
399
|
+
onChange: Ue,
|
|
400
|
+
options: I,
|
|
401
|
+
loading: L,
|
|
402
|
+
getId: (e) => e.id,
|
|
403
|
+
getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
|
|
404
|
+
renderOption: (e) => /* @__PURE__ */ C(Se, { children: [
|
|
405
|
+
e.name,
|
|
406
|
+
" · ",
|
|
407
|
+
e.stops.length,
|
|
408
|
+
" stops"
|
|
409
|
+
] }),
|
|
410
|
+
selectedOption: ze,
|
|
411
|
+
selectedLoading: Be,
|
|
412
|
+
placeholder: "Choose a saved route",
|
|
413
|
+
searchPlaceholder: "Search saved routes",
|
|
414
|
+
emptyText: "No saved routes found.",
|
|
415
|
+
noneLabel: "No saved route",
|
|
416
|
+
error: R ? "Saved routes are unavailable" : void 0,
|
|
417
|
+
onSearchChange: Ne,
|
|
418
|
+
hasMore: Pe,
|
|
419
|
+
totalCount: Fe
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ S("p", {
|
|
422
|
+
className: "mt-2 text-xs text-text-secondary",
|
|
423
|
+
role: "status",
|
|
424
|
+
children: L ? "Loading planned routes…" : R ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "Manual values always remain authoritative when a route is selected."
|
|
425
|
+
})
|
|
426
|
+
]
|
|
460
427
|
}),
|
|
461
|
-
/* @__PURE__ */ S(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
children:
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
428
|
+
/* @__PURE__ */ S(me, {}),
|
|
429
|
+
/* @__PURE__ */ C("div", {
|
|
430
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] lg:items-stretch",
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ C(u, {
|
|
433
|
+
className: "border-border-seam shadow-none",
|
|
434
|
+
children: [/* @__PURE__ */ C(p, { children: [/* @__PURE__ */ C(m, {
|
|
435
|
+
className: "flex items-center gap-2 text-base",
|
|
436
|
+
children: [
|
|
437
|
+
/* @__PURE__ */ S(r, {
|
|
438
|
+
size: 17,
|
|
439
|
+
className: "text-text-secondary",
|
|
440
|
+
"aria-hidden": "true"
|
|
441
|
+
}),
|
|
442
|
+
"Pickup address ",
|
|
443
|
+
/* @__PURE__ */ S("span", {
|
|
444
|
+
className: "text-status-error-text",
|
|
445
|
+
children: "*"
|
|
446
|
+
})
|
|
447
|
+
]
|
|
448
|
+
}), /* @__PURE__ */ S(f, { children: "Where the shipment is collected." })] }), /* @__PURE__ */ S(d, {
|
|
449
|
+
className: "space-y-4",
|
|
450
|
+
children: /* @__PURE__ */ C("fieldset", {
|
|
451
|
+
className: "space-y-4",
|
|
452
|
+
children: [
|
|
453
|
+
/* @__PURE__ */ S("legend", {
|
|
454
|
+
className: "sr-only",
|
|
455
|
+
children: "Pickup address details"
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ C("div", {
|
|
458
|
+
className: "space-y-2",
|
|
459
|
+
children: [/* @__PURE__ */ C(g, {
|
|
460
|
+
htmlFor: "pickupStreet",
|
|
461
|
+
children: ["Street address ", /* @__PURE__ */ S("span", {
|
|
462
|
+
className: "text-status-error-text",
|
|
463
|
+
children: "*"
|
|
464
|
+
})]
|
|
465
|
+
}), /* @__PURE__ */ S(h, {
|
|
466
|
+
id: "pickupStreet",
|
|
467
|
+
value: U.pickupAddress.street,
|
|
468
|
+
onChange: (e) => Q("pickupAddress", "street", e.target.value),
|
|
469
|
+
placeholder: "123 Main St",
|
|
470
|
+
"aria-required": "true"
|
|
471
|
+
})]
|
|
472
|
+
}),
|
|
473
|
+
/* @__PURE__ */ C("div", {
|
|
474
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
475
|
+
children: [/* @__PURE__ */ C("div", {
|
|
476
|
+
className: "space-y-2",
|
|
477
|
+
children: [/* @__PURE__ */ S(g, {
|
|
478
|
+
htmlFor: "pickupCity",
|
|
479
|
+
children: "City"
|
|
480
|
+
}), /* @__PURE__ */ S(h, {
|
|
481
|
+
id: "pickupCity",
|
|
482
|
+
value: U.pickupAddress.city,
|
|
483
|
+
onChange: (e) => Q("pickupAddress", "city", e.target.value),
|
|
484
|
+
placeholder: "San Francisco"
|
|
485
|
+
})]
|
|
486
|
+
}), /* @__PURE__ */ C("div", {
|
|
487
|
+
className: "space-y-2",
|
|
488
|
+
children: [/* @__PURE__ */ S(g, {
|
|
489
|
+
htmlFor: "pickupState",
|
|
490
|
+
children: "State"
|
|
491
|
+
}), /* @__PURE__ */ S(h, {
|
|
492
|
+
id: "pickupState",
|
|
493
|
+
value: U.pickupAddress.state,
|
|
494
|
+
onChange: (e) => Q("pickupAddress", "state", e.target.value),
|
|
495
|
+
placeholder: "CA"
|
|
496
|
+
})]
|
|
497
|
+
})]
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ C("div", {
|
|
500
|
+
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
501
|
+
children: [/* @__PURE__ */ C("div", {
|
|
502
|
+
className: "space-y-2",
|
|
503
|
+
children: [/* @__PURE__ */ S(g, {
|
|
504
|
+
htmlFor: "pickupPostal",
|
|
505
|
+
children: "Postal Code"
|
|
506
|
+
}), /* @__PURE__ */ S(h, {
|
|
507
|
+
id: "pickupPostal",
|
|
508
|
+
value: U.pickupAddress.postalCode,
|
|
509
|
+
onChange: (e) => Q("pickupAddress", "postalCode", e.target.value),
|
|
510
|
+
placeholder: "94103"
|
|
511
|
+
})]
|
|
512
|
+
}), /* @__PURE__ */ C("div", {
|
|
513
|
+
className: "space-y-2",
|
|
514
|
+
children: [/* @__PURE__ */ S(g, {
|
|
515
|
+
htmlFor: "pickupCountry",
|
|
516
|
+
children: "Country"
|
|
517
|
+
}), /* @__PURE__ */ S(h, {
|
|
518
|
+
id: "pickupCountry",
|
|
519
|
+
value: U.pickupAddress.country,
|
|
520
|
+
onChange: (e) => Q("pickupAddress", "country", e.target.value),
|
|
521
|
+
placeholder: "USA"
|
|
522
|
+
})]
|
|
523
|
+
})]
|
|
524
|
+
})
|
|
525
|
+
]
|
|
526
|
+
})
|
|
527
|
+
})]
|
|
528
|
+
}),
|
|
529
|
+
/* @__PURE__ */ S("div", {
|
|
530
|
+
className: "hidden items-center justify-center lg:flex",
|
|
531
|
+
"aria-hidden": "true",
|
|
532
|
+
children: /* @__PURE__ */ S(t, {
|
|
533
|
+
size: 18,
|
|
534
|
+
className: "text-text-muted"
|
|
535
|
+
})
|
|
536
|
+
}),
|
|
537
|
+
/* @__PURE__ */ C(u, {
|
|
538
|
+
className: "border-border-seam shadow-none",
|
|
539
|
+
children: [/* @__PURE__ */ C(p, { children: [/* @__PURE__ */ C(m, {
|
|
540
|
+
className: "flex items-center gap-2 text-base",
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ S(r, {
|
|
543
|
+
size: 17,
|
|
544
|
+
className: "text-text-secondary",
|
|
545
|
+
"aria-hidden": "true"
|
|
546
|
+
}),
|
|
547
|
+
"Delivery address ",
|
|
548
|
+
/* @__PURE__ */ S("span", {
|
|
549
|
+
className: "text-status-error-text",
|
|
550
|
+
children: "*"
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
}), /* @__PURE__ */ S(f, { children: "Where the shipment is delivered." })] }), /* @__PURE__ */ S(d, {
|
|
554
|
+
className: "space-y-4",
|
|
555
|
+
children: /* @__PURE__ */ C("fieldset", {
|
|
556
|
+
className: "space-y-4",
|
|
557
|
+
children: [
|
|
558
|
+
/* @__PURE__ */ S("legend", {
|
|
559
|
+
className: "sr-only",
|
|
560
|
+
children: "Delivery address details"
|
|
561
|
+
}),
|
|
562
|
+
/* @__PURE__ */ C("div", {
|
|
563
|
+
className: "space-y-2",
|
|
564
|
+
children: [/* @__PURE__ */ C(g, {
|
|
565
|
+
htmlFor: "deliveryStreet",
|
|
566
|
+
children: ["Street address ", /* @__PURE__ */ S("span", {
|
|
567
|
+
className: "text-status-error-text",
|
|
568
|
+
children: "*"
|
|
569
|
+
})]
|
|
570
|
+
}), /* @__PURE__ */ S(h, {
|
|
571
|
+
id: "deliveryStreet",
|
|
572
|
+
value: U.deliveryAddress.street,
|
|
573
|
+
onChange: (e) => Q("deliveryAddress", "street", e.target.value),
|
|
574
|
+
placeholder: "456 Oak Ave",
|
|
575
|
+
"aria-required": "true"
|
|
576
|
+
})]
|
|
577
|
+
}),
|
|
578
|
+
/* @__PURE__ */ C("div", {
|
|
579
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
580
|
+
children: [/* @__PURE__ */ C("div", {
|
|
581
|
+
className: "space-y-2",
|
|
582
|
+
children: [/* @__PURE__ */ S(g, {
|
|
583
|
+
htmlFor: "deliveryCity",
|
|
584
|
+
children: "City"
|
|
585
|
+
}), /* @__PURE__ */ S(h, {
|
|
586
|
+
id: "deliveryCity",
|
|
587
|
+
value: U.deliveryAddress.city,
|
|
588
|
+
onChange: (e) => Q("deliveryAddress", "city", e.target.value),
|
|
589
|
+
placeholder: "Los Angeles"
|
|
590
|
+
})]
|
|
591
|
+
}), /* @__PURE__ */ C("div", {
|
|
592
|
+
className: "space-y-2",
|
|
593
|
+
children: [/* @__PURE__ */ S(g, {
|
|
594
|
+
htmlFor: "deliveryState",
|
|
595
|
+
children: "State"
|
|
596
|
+
}), /* @__PURE__ */ S(h, {
|
|
597
|
+
id: "deliveryState",
|
|
598
|
+
value: U.deliveryAddress.state,
|
|
599
|
+
onChange: (e) => Q("deliveryAddress", "state", e.target.value),
|
|
600
|
+
placeholder: "CA"
|
|
601
|
+
})]
|
|
602
|
+
})]
|
|
603
|
+
}),
|
|
604
|
+
/* @__PURE__ */ C("div", {
|
|
605
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
606
|
+
children: [/* @__PURE__ */ C("div", {
|
|
607
|
+
className: "space-y-2",
|
|
608
|
+
children: [/* @__PURE__ */ S(g, {
|
|
609
|
+
htmlFor: "deliveryPostal",
|
|
610
|
+
children: "Postal code"
|
|
611
|
+
}), /* @__PURE__ */ S(h, {
|
|
612
|
+
id: "deliveryPostal",
|
|
613
|
+
value: U.deliveryAddress.postalCode,
|
|
614
|
+
onChange: (e) => Q("deliveryAddress", "postalCode", e.target.value),
|
|
615
|
+
placeholder: "90210"
|
|
616
|
+
})]
|
|
617
|
+
}), /* @__PURE__ */ C("div", {
|
|
618
|
+
className: "space-y-2",
|
|
619
|
+
children: [/* @__PURE__ */ S(g, {
|
|
620
|
+
htmlFor: "deliveryCountry",
|
|
621
|
+
children: "Country"
|
|
622
|
+
}), /* @__PURE__ */ S(h, {
|
|
623
|
+
id: "deliveryCountry",
|
|
624
|
+
value: U.deliveryAddress.country,
|
|
625
|
+
onChange: (e) => Q("deliveryAddress", "country", e.target.value),
|
|
626
|
+
placeholder: "USA"
|
|
627
|
+
})]
|
|
628
|
+
})]
|
|
629
|
+
})
|
|
630
|
+
]
|
|
631
|
+
})
|
|
632
|
+
})]
|
|
633
|
+
})
|
|
634
|
+
]
|
|
486
635
|
})
|
|
487
636
|
]
|
|
488
|
-
})] })]
|
|
489
|
-
}),
|
|
490
|
-
/* @__PURE__ */ S(d, { children: [/* @__PURE__ */ S(p, {
|
|
491
|
-
className: "flex flex-row items-center justify-between",
|
|
492
|
-
children: [/* @__PURE__ */ x(m, { children: "Order Items" }), /* @__PURE__ */ S(u, {
|
|
493
|
-
type: "button",
|
|
494
|
-
variant: "outline",
|
|
495
|
-
size: "sm",
|
|
496
|
-
onClick: $,
|
|
497
|
-
children: [/* @__PURE__ */ x(i, { size: 16 }), "Add Item"]
|
|
498
|
-
})]
|
|
499
|
-
}), /* @__PURE__ */ x(f, { children: U.items.length === 0 ? /* @__PURE__ */ x(fe, {
|
|
500
|
-
illustration: "empty-files",
|
|
501
|
-
title: "No items added yet",
|
|
502
|
-
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
503
|
-
action: /* @__PURE__ */ S(u, {
|
|
504
|
-
type: "button",
|
|
505
|
-
variant: "outline",
|
|
506
|
-
onClick: $,
|
|
507
|
-
children: [/* @__PURE__ */ x(i, {
|
|
508
|
-
size: 16,
|
|
509
|
-
className: "mr-1.5"
|
|
510
|
-
}), "Add your first item"]
|
|
511
637
|
})
|
|
512
|
-
})
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
children: [/* @__PURE__ */ x(t, {
|
|
551
|
-
size: 14,
|
|
552
|
-
className: "text-text-secondary"
|
|
553
|
-
}), "Scheduled Delivery"]
|
|
554
|
-
}),
|
|
555
|
-
/* @__PURE__ */ x(h, {
|
|
556
|
-
id: "scheduledDelivery",
|
|
557
|
-
type: "datetime-local",
|
|
558
|
-
value: U.scheduledDelivery,
|
|
559
|
-
onChange: (e) => Z("scheduledDelivery", e.target.value)
|
|
560
|
-
}),
|
|
561
|
-
/* @__PURE__ */ x("p", {
|
|
562
|
-
className: "text-xs text-text-secondary",
|
|
563
|
-
children: "The delivery window promised to the customer. Leave blank to dispatch as soon as a driver is free."
|
|
638
|
+
}),
|
|
639
|
+
/* @__PURE__ */ S("div", {
|
|
640
|
+
id: "items-section",
|
|
641
|
+
children: /* @__PURE__ */ S(w, {
|
|
642
|
+
title: /* @__PURE__ */ C("span", {
|
|
643
|
+
className: "flex items-center gap-2",
|
|
644
|
+
children: [
|
|
645
|
+
/* @__PURE__ */ S(i, {
|
|
646
|
+
size: 18,
|
|
647
|
+
"aria-hidden": "true"
|
|
648
|
+
}),
|
|
649
|
+
"Shipment contents ",
|
|
650
|
+
/* @__PURE__ */ S(c, {
|
|
651
|
+
variant: "secondary",
|
|
652
|
+
children: U.items.length
|
|
653
|
+
})
|
|
654
|
+
]
|
|
655
|
+
}),
|
|
656
|
+
description: "Add each item being shipped. Use the catalog to prefill details or enter a one-off item manually.",
|
|
657
|
+
actions: /* @__PURE__ */ C(l, {
|
|
658
|
+
type: "button",
|
|
659
|
+
variant: "outline",
|
|
660
|
+
size: "sm",
|
|
661
|
+
onClick: $,
|
|
662
|
+
children: [/* @__PURE__ */ S(a, { size: 16 }), "Add item"]
|
|
663
|
+
}),
|
|
664
|
+
children: U.items.length === 0 ? /* @__PURE__ */ S(ge, {
|
|
665
|
+
illustration: "empty-files",
|
|
666
|
+
title: "No items added yet",
|
|
667
|
+
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
668
|
+
action: /* @__PURE__ */ C(l, {
|
|
669
|
+
type: "button",
|
|
670
|
+
variant: "outline",
|
|
671
|
+
onClick: $,
|
|
672
|
+
children: [/* @__PURE__ */ S(a, {
|
|
673
|
+
size: 16,
|
|
674
|
+
className: "mr-1.5"
|
|
675
|
+
}), "Add your first item"]
|
|
564
676
|
})
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
677
|
+
}) : /* @__PURE__ */ C("div", {
|
|
678
|
+
className: "space-y-4",
|
|
679
|
+
children: [/* @__PURE__ */ C("div", {
|
|
680
|
+
className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
|
|
681
|
+
children: [
|
|
682
|
+
/* @__PURE__ */ S(g, {
|
|
683
|
+
htmlFor: "item-product-search",
|
|
684
|
+
children: "Search product catalog"
|
|
685
|
+
}),
|
|
686
|
+
/* @__PURE__ */ S(h, {
|
|
687
|
+
id: "item-product-search",
|
|
688
|
+
value: z,
|
|
689
|
+
onChange: (e) => Ie(e.target.value),
|
|
690
|
+
placeholder: "Search by name or SKU",
|
|
691
|
+
className: "mt-2"
|
|
692
|
+
}),
|
|
693
|
+
/* @__PURE__ */ S("p", {
|
|
694
|
+
className: "mt-2 text-xs text-text-secondary",
|
|
695
|
+
children: "This filters the catalog picker for every item below. You can still edit any autofilled value or enter item details manually."
|
|
696
|
+
})
|
|
697
|
+
]
|
|
698
|
+
}), /* @__PURE__ */ S("ol", {
|
|
699
|
+
className: "space-y-4",
|
|
700
|
+
"aria-label": "Shipment items",
|
|
701
|
+
children: U.items.map((e, t) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ S(y, {
|
|
702
|
+
item: e,
|
|
703
|
+
index: t,
|
|
704
|
+
products: Le,
|
|
705
|
+
productsLoading: Re,
|
|
706
|
+
onUpdate: Ge,
|
|
707
|
+
onRemove: We
|
|
708
|
+
}) }, e.id))
|
|
709
|
+
})]
|
|
710
|
+
})
|
|
711
|
+
})
|
|
712
|
+
}),
|
|
713
|
+
/* @__PURE__ */ S(w, {
|
|
714
|
+
title: /* @__PURE__ */ C("span", {
|
|
715
|
+
className: "flex items-center gap-2",
|
|
716
|
+
children: [/* @__PURE__ */ S(n, {
|
|
717
|
+
size: 18,
|
|
718
|
+
"aria-hidden": "true"
|
|
719
|
+
}), "Timing & handling"]
|
|
720
|
+
}),
|
|
721
|
+
description: "Optional delivery timing and instructions for the carrier.",
|
|
722
|
+
children: /* @__PURE__ */ C("div", {
|
|
723
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
724
|
+
children: [/* @__PURE__ */ C("div", {
|
|
725
|
+
className: "space-y-2",
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ S(g, {
|
|
728
|
+
htmlFor: "scheduledDelivery",
|
|
729
|
+
children: "Scheduled delivery"
|
|
730
|
+
}),
|
|
731
|
+
/* @__PURE__ */ S(h, {
|
|
732
|
+
id: "scheduledDelivery",
|
|
733
|
+
type: "datetime-local",
|
|
734
|
+
value: U.scheduledDelivery,
|
|
735
|
+
onChange: (e) => Z("scheduledDelivery", e.target.value)
|
|
736
|
+
}),
|
|
737
|
+
/* @__PURE__ */ S("p", {
|
|
738
|
+
className: "text-xs text-text-secondary",
|
|
739
|
+
children: "Leave blank to dispatch as soon as a driver is available."
|
|
740
|
+
})
|
|
741
|
+
]
|
|
742
|
+
}), /* @__PURE__ */ C("div", {
|
|
743
|
+
className: "space-y-2 lg:col-span-2",
|
|
744
|
+
children: [/* @__PURE__ */ S(g, {
|
|
745
|
+
htmlFor: "specialInstructions",
|
|
746
|
+
children: "Special instructions"
|
|
747
|
+
}), /* @__PURE__ */ S(he, {
|
|
748
|
+
id: "specialInstructions",
|
|
749
|
+
value: U.specialInstructions,
|
|
750
|
+
onChange: (e) => Z("specialInstructions", e.target.value),
|
|
751
|
+
placeholder: "Any special handling or delivery instructions...",
|
|
752
|
+
rows: 4
|
|
753
|
+
})]
|
|
577
754
|
})]
|
|
578
|
-
})
|
|
579
|
-
})
|
|
755
|
+
})
|
|
756
|
+
})
|
|
580
757
|
]
|
|
581
758
|
})
|
|
582
759
|
]
|
|
583
760
|
});
|
|
584
761
|
}
|
|
585
762
|
//#endregion
|
|
586
|
-
export {
|
|
763
|
+
export { E as default };
|