@burdenoff/microfe-movethewheels 2026.924.1 → 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 +210 -0
- 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 +12 -0
- 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 +624 -477
- 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 +235 -0
- 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 +379 -308
- 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,151 +1,160 @@
|
|
|
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 {
|
|
7
|
-
import { Save as
|
|
8
|
-
import { Trash2 as ee } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
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
|
+
import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
9
8
|
import { Users as te } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
10
|
-
import { buildCustomerCreatePath as ne, joinPath as
|
|
11
|
-
import { useMoveTheWheels as
|
|
12
|
-
import { useRoute as
|
|
13
|
-
import { useOrder as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
9
|
+
import { buildCustomerCreatePath as ne, joinPath as o } from "../utils/navigation.js";
|
|
10
|
+
import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
|
|
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";
|
|
20
21
|
import { useEffect as b, useState as x } from "react";
|
|
21
|
-
import { useParams as
|
|
22
|
-
import { Fragment as
|
|
23
|
-
import { EmphasisPanel as
|
|
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";
|
|
24
26
|
//#region src/movethewheels/pages/CreateOrderPage.tsx
|
|
25
|
-
function
|
|
27
|
+
function T(e) {
|
|
26
28
|
if (!e || Number.isNaN(e.getTime())) return "";
|
|
27
29
|
let t = (e) => String(e).padStart(2, "0");
|
|
28
30
|
return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
|
|
29
31
|
}
|
|
30
|
-
function
|
|
31
|
-
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({
|
|
32
34
|
limit: 20,
|
|
33
|
-
filters: { search:
|
|
34
|
-
}), { 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({
|
|
35
37
|
status: "planned",
|
|
36
|
-
search:
|
|
38
|
+
search: Me || void 0,
|
|
37
39
|
limit: 20
|
|
38
|
-
}), z
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
}), [z, Ie] = x(""), { products: Le, isLoading: Re } = se({
|
|
41
|
+
search: z || void 0,
|
|
42
|
+
limit: 20
|
|
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 || "",
|
|
42
47
|
pickupAddress: {
|
|
43
|
-
street:
|
|
44
|
-
city:
|
|
45
|
-
state:
|
|
46
|
-
postalCode:
|
|
47
|
-
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"
|
|
48
53
|
},
|
|
49
54
|
deliveryAddress: {
|
|
50
|
-
street:
|
|
51
|
-
city:
|
|
52
|
-
state:
|
|
53
|
-
postalCode:
|
|
54
|
-
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"
|
|
55
60
|
},
|
|
56
|
-
items:
|
|
57
|
-
scheduledDelivery:
|
|
58
|
-
specialInstructions:
|
|
59
|
-
}), { route:
|
|
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);
|
|
60
65
|
b(() => {
|
|
61
|
-
F && (
|
|
66
|
+
F && (H((e) => e?.id === F.id ? e : F), W((e) => e.customerId ? e : {
|
|
62
67
|
...e,
|
|
63
68
|
customerId: F.id
|
|
64
69
|
}));
|
|
65
70
|
}, [F]), b(() => {
|
|
66
|
-
|
|
67
|
-
customerId:
|
|
68
|
-
priority:
|
|
69
|
-
routeId:
|
|
71
|
+
j && W({
|
|
72
|
+
customerId: j.customerId || "",
|
|
73
|
+
priority: j.priority || "normal",
|
|
74
|
+
routeId: j.routeId || "",
|
|
70
75
|
pickupAddress: {
|
|
71
|
-
street:
|
|
72
|
-
city:
|
|
73
|
-
state:
|
|
74
|
-
postalCode:
|
|
75
|
-
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"
|
|
76
81
|
},
|
|
77
82
|
deliveryAddress: {
|
|
78
|
-
street:
|
|
79
|
-
city:
|
|
80
|
-
state:
|
|
81
|
-
postalCode:
|
|
82
|
-
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"
|
|
83
88
|
},
|
|
84
|
-
items:
|
|
85
|
-
scheduledDelivery:
|
|
86
|
-
specialInstructions:
|
|
89
|
+
items: j.items || [],
|
|
90
|
+
scheduledDelivery: T(j.scheduledDelivery),
|
|
91
|
+
specialInstructions: j.specialInstructions || ""
|
|
87
92
|
});
|
|
88
|
-
}, [
|
|
89
|
-
let
|
|
90
|
-
if (
|
|
91
|
-
if (!
|
|
92
|
-
|
|
93
|
+
}, [j]);
|
|
94
|
+
let J = () => {
|
|
95
|
+
if (A) {
|
|
96
|
+
if (!B && O) {
|
|
97
|
+
A(o(k, `customers/${O}`));
|
|
93
98
|
return;
|
|
94
99
|
}
|
|
95
|
-
|
|
100
|
+
A(o(k, "orders"));
|
|
96
101
|
}
|
|
97
|
-
},
|
|
98
|
-
e.preventDefault(),
|
|
99
|
-
let t =
|
|
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) => {
|
|
103
|
+
e.preventDefault(), q(null);
|
|
104
|
+
let t = He();
|
|
100
105
|
if (t) {
|
|
101
|
-
|
|
106
|
+
q(t);
|
|
102
107
|
return;
|
|
103
108
|
}
|
|
104
|
-
let n =
|
|
109
|
+
let n = Y();
|
|
105
110
|
if (!n) {
|
|
106
|
-
|
|
111
|
+
q(P ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order.");
|
|
107
112
|
return;
|
|
108
113
|
}
|
|
109
|
-
|
|
114
|
+
K(!0);
|
|
110
115
|
try {
|
|
111
116
|
let e = {
|
|
112
|
-
customerId:
|
|
117
|
+
customerId: U.customerId,
|
|
113
118
|
customerInfo: {
|
|
114
119
|
name: n.name,
|
|
115
120
|
email: n.email,
|
|
116
121
|
phone: n.phone,
|
|
117
122
|
company: n.company
|
|
118
123
|
},
|
|
119
|
-
priority:
|
|
120
|
-
pickupAddress:
|
|
121
|
-
deliveryAddress:
|
|
122
|
-
items:
|
|
123
|
-
scheduledDelivery:
|
|
124
|
-
routeId:
|
|
125
|
-
specialInstructions:
|
|
124
|
+
priority: U.priority,
|
|
125
|
+
pickupAddress: U.pickupAddress,
|
|
126
|
+
deliveryAddress: U.deliveryAddress,
|
|
127
|
+
items: U.items,
|
|
128
|
+
scheduledDelivery: U.scheduledDelivery ? new Date(U.scheduledDelivery) : null,
|
|
129
|
+
routeId: U.routeId || void 0,
|
|
130
|
+
specialInstructions: U.specialInstructions
|
|
126
131
|
};
|
|
127
|
-
|
|
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
|
+
}
|
|
128
137
|
} catch (e) {
|
|
129
|
-
|
|
138
|
+
q(e instanceof Error ? e.message : B ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
|
|
130
139
|
} finally {
|
|
131
|
-
|
|
140
|
+
K(!1);
|
|
132
141
|
}
|
|
133
|
-
},
|
|
134
|
-
|
|
142
|
+
}, Z = (e, t) => {
|
|
143
|
+
W((n) => ({
|
|
135
144
|
...n,
|
|
136
145
|
[e]: t
|
|
137
146
|
}));
|
|
138
|
-
},
|
|
139
|
-
|
|
147
|
+
}, Q = (e, t, n) => {
|
|
148
|
+
W((r) => ({
|
|
140
149
|
...r,
|
|
141
150
|
[e]: {
|
|
142
151
|
...r[e],
|
|
143
152
|
[t]: n
|
|
144
153
|
}
|
|
145
154
|
}));
|
|
146
|
-
},
|
|
155
|
+
}, Ue = (e) => {
|
|
147
156
|
if (!e) {
|
|
148
|
-
|
|
157
|
+
Z("routeId", "");
|
|
149
158
|
return;
|
|
150
159
|
}
|
|
151
160
|
let t = I.find((t) => t.id === e);
|
|
@@ -157,14 +166,14 @@ function T() {
|
|
|
157
166
|
postalCode: e.postalCode.trim() ? e.postalCode : t.postalCode,
|
|
158
167
|
country: e.country.trim() ? e.country : t.country
|
|
159
168
|
} : e;
|
|
160
|
-
|
|
169
|
+
W((e) => ({
|
|
161
170
|
...e,
|
|
162
171
|
routeId: t.id,
|
|
163
172
|
pickupAddress: i(e.pickupAddress, n),
|
|
164
173
|
deliveryAddress: i(e.deliveryAddress, r)
|
|
165
174
|
}));
|
|
166
|
-
},
|
|
167
|
-
|
|
175
|
+
}, $ = () => {
|
|
176
|
+
W((e) => ({
|
|
168
177
|
...e,
|
|
169
178
|
items: [...e.items, {
|
|
170
179
|
id: `item-${Date.now()}`,
|
|
@@ -182,435 +191,573 @@ function T() {
|
|
|
182
191
|
sku: ""
|
|
183
192
|
}]
|
|
184
193
|
}));
|
|
185
|
-
},
|
|
186
|
-
|
|
194
|
+
}, We = (e) => {
|
|
195
|
+
W((t) => ({
|
|
187
196
|
...t,
|
|
188
197
|
items: t.items.filter((t, n) => n !== e)
|
|
189
198
|
}));
|
|
190
|
-
},
|
|
191
|
-
|
|
199
|
+
}, Ge = (e, t, n) => {
|
|
200
|
+
W((r) => ({
|
|
192
201
|
...r,
|
|
193
202
|
items: r.items.map((r, i) => i === e ? {
|
|
194
203
|
...r,
|
|
195
204
|
[t]: n
|
|
196
205
|
} : r)
|
|
197
206
|
}));
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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, {
|
|
211
|
+
title: B ? "Edit Order" : "Create Order",
|
|
212
|
+
subtitle: B ? `Editing ${j?.orderNumber}` : "Create a new delivery order",
|
|
213
|
+
icon: /* @__PURE__ */ S(i, { size: 24 }),
|
|
214
|
+
maxWidth: "2xl",
|
|
203
215
|
headerActions: /* @__PURE__ */ C("div", {
|
|
204
|
-
className: "flex gap-2",
|
|
205
|
-
children: [/* @__PURE__ */ C(
|
|
216
|
+
className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row",
|
|
217
|
+
children: [/* @__PURE__ */ C(l, {
|
|
218
|
+
type: "button",
|
|
206
219
|
variant: "outline",
|
|
207
|
-
onClick:
|
|
220
|
+
onClick: J,
|
|
221
|
+
disabled: G,
|
|
208
222
|
children: [/* @__PURE__ */ S(e, { size: 16 }), "Cancel"]
|
|
209
|
-
}), /* @__PURE__ */ C(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
223
|
+
}), /* @__PURE__ */ C(l, {
|
|
224
|
+
type: "submit",
|
|
225
|
+
form: "order-form",
|
|
226
|
+
disabled: G || N,
|
|
227
|
+
children: [/* @__PURE__ */ S(ee, { size: 16 }), G ? "Saving..." : B ? "Save Changes" : "Create Order"]
|
|
213
228
|
})]
|
|
214
229
|
}),
|
|
215
230
|
children: [
|
|
216
|
-
/* @__PURE__ */ S(
|
|
217
|
-
icon: /* @__PURE__ */ S(
|
|
218
|
-
children:
|
|
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."
|
|
219
234
|
}),
|
|
220
|
-
/* @__PURE__ */ S(
|
|
221
|
-
storageKey: "movethewheels-create-order",
|
|
235
|
+
/* @__PURE__ */ S(Te, {
|
|
222
236
|
steps: [
|
|
223
237
|
{
|
|
224
|
-
|
|
225
|
-
label: "
|
|
226
|
-
description: "
|
|
227
|
-
icon: /* @__PURE__ */ S(te, { size: 16 }),
|
|
228
|
-
done: !!H.customerId,
|
|
229
|
-
onClick: () => document.getElementById("customer")?.focus()
|
|
238
|
+
key: "customer",
|
|
239
|
+
label: "Customer & priority",
|
|
240
|
+
description: "Who is receiving this delivery?"
|
|
230
241
|
},
|
|
231
242
|
{
|
|
232
|
-
|
|
233
|
-
label: "
|
|
234
|
-
description: "Where
|
|
235
|
-
icon: /* @__PURE__ */ S(n, { size: 16 }),
|
|
236
|
-
done: !!H.pickupAddress.street && !!H.deliveryAddress.street,
|
|
237
|
-
onClick: () => document.getElementById("pickupStreet")?.focus()
|
|
243
|
+
key: "locations",
|
|
244
|
+
label: "Route & addresses",
|
|
245
|
+
description: "Where should it be collected and delivered?"
|
|
238
246
|
},
|
|
239
247
|
{
|
|
240
|
-
|
|
241
|
-
label: "
|
|
242
|
-
description: "
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
248
|
+
key: "items",
|
|
249
|
+
label: "Shipment contents",
|
|
250
|
+
description: "What is being shipped?"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
key: "preferences",
|
|
254
|
+
label: "Timing & handling",
|
|
255
|
+
description: "Add optional delivery instructions."
|
|
246
256
|
}
|
|
247
|
-
]
|
|
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
|
|
248
276
|
}),
|
|
249
277
|
/* @__PURE__ */ C("form", {
|
|
250
|
-
|
|
278
|
+
id: "order-form",
|
|
279
|
+
onSubmit: X,
|
|
251
280
|
className: "space-y-6",
|
|
252
281
|
children: [
|
|
253
|
-
/* @__PURE__ */ S(
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
|
|
256
|
-
children:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
|
|
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
|
+
})]
|
|
279
309
|
}), /* @__PURE__ */ C("div", {
|
|
280
|
-
className: "
|
|
281
|
-
children: [/* @__PURE__ */ S(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
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"
|
|
298
333
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
value:
|
|
301
|
-
|
|
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
|
+
] })]
|
|
302
358
|
}),
|
|
303
|
-
/* @__PURE__ */ S(
|
|
304
|
-
|
|
305
|
-
children: "
|
|
359
|
+
/* @__PURE__ */ S("p", {
|
|
360
|
+
className: "text-xs text-text-secondary",
|
|
361
|
+
children: "Normal is selected by default."
|
|
306
362
|
})
|
|
307
|
-
]
|
|
363
|
+
]
|
|
308
364
|
})]
|
|
309
365
|
})]
|
|
310
366
|
})
|
|
311
|
-
})
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
|
|
314
|
-
children:
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
})] }),
|
|
346
|
-
/* @__PURE__ */ C("div", {
|
|
347
|
-
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
348
|
-
children: [/* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ S(h, { children: "Pickup Address" }) }), /* @__PURE__ */ C(p, {
|
|
349
|
-
className: "space-y-4",
|
|
350
|
-
children: [
|
|
351
|
-
/* @__PURE__ */ C("div", {
|
|
352
|
-
className: "space-y-2",
|
|
353
|
-
children: [/* @__PURE__ */ S(_, {
|
|
354
|
-
htmlFor: "pickupStreet",
|
|
355
|
-
children: "Street Address"
|
|
356
|
-
}), /* @__PURE__ */ S(g, {
|
|
357
|
-
id: "pickupStreet",
|
|
358
|
-
value: H.pickupAddress.street,
|
|
359
|
-
onChange: (e) => Z("pickupAddress", "street", e.target.value),
|
|
360
|
-
placeholder: "123 Main St"
|
|
361
|
-
})]
|
|
362
|
-
}),
|
|
363
|
-
/* @__PURE__ */ C("div", {
|
|
364
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
365
|
-
children: [/* @__PURE__ */ C("div", {
|
|
366
|
-
className: "space-y-2",
|
|
367
|
-
children: [/* @__PURE__ */ S(_, {
|
|
368
|
-
htmlFor: "pickupCity",
|
|
369
|
-
children: "City"
|
|
370
|
-
}), /* @__PURE__ */ S(g, {
|
|
371
|
-
id: "pickupCity",
|
|
372
|
-
value: H.pickupAddress.city,
|
|
373
|
-
onChange: (e) => Z("pickupAddress", "city", e.target.value),
|
|
374
|
-
placeholder: "San Francisco"
|
|
375
|
-
})]
|
|
376
|
-
}), /* @__PURE__ */ C("div", {
|
|
377
|
-
className: "space-y-2",
|
|
378
|
-
children: [/* @__PURE__ */ S(_, {
|
|
379
|
-
htmlFor: "pickupState",
|
|
380
|
-
children: "State"
|
|
381
|
-
}), /* @__PURE__ */ S(g, {
|
|
382
|
-
id: "pickupState",
|
|
383
|
-
value: H.pickupAddress.state,
|
|
384
|
-
onChange: (e) => Z("pickupAddress", "state", e.target.value),
|
|
385
|
-
placeholder: "CA"
|
|
386
|
-
})]
|
|
387
|
-
})]
|
|
388
|
-
}),
|
|
389
|
-
/* @__PURE__ */ C("div", {
|
|
390
|
-
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
391
|
-
children: [/* @__PURE__ */ C("div", {
|
|
392
|
-
className: "space-y-2",
|
|
393
|
-
children: [/* @__PURE__ */ S(_, {
|
|
394
|
-
htmlFor: "pickupPostal",
|
|
395
|
-
children: "Postal Code"
|
|
396
|
-
}), /* @__PURE__ */ S(g, {
|
|
397
|
-
id: "pickupPostal",
|
|
398
|
-
value: H.pickupAddress.postalCode,
|
|
399
|
-
onChange: (e) => Z("pickupAddress", "postalCode", e.target.value),
|
|
400
|
-
placeholder: "94103"
|
|
401
|
-
})]
|
|
402
|
-
}), /* @__PURE__ */ C("div", {
|
|
403
|
-
className: "space-y-2",
|
|
404
|
-
children: [/* @__PURE__ */ S(_, {
|
|
405
|
-
htmlFor: "pickupCountry",
|
|
406
|
-
children: "Country"
|
|
407
|
-
}), /* @__PURE__ */ S(g, {
|
|
408
|
-
id: "pickupCountry",
|
|
409
|
-
value: H.pickupAddress.country,
|
|
410
|
-
onChange: (e) => Z("pickupAddress", "country", e.target.value),
|
|
411
|
-
placeholder: "USA"
|
|
412
|
-
})]
|
|
413
|
-
})]
|
|
414
|
-
})
|
|
415
|
-
]
|
|
416
|
-
})] }), /* @__PURE__ */ C(f, { children: [/* @__PURE__ */ S(m, { children: /* @__PURE__ */ S(h, { children: "Delivery Address" }) }), /* @__PURE__ */ C(p, {
|
|
417
|
-
className: "space-y-4",
|
|
367
|
+
}),
|
|
368
|
+
/* @__PURE__ */ S("div", {
|
|
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.",
|
|
418
379
|
children: [
|
|
419
380
|
/* @__PURE__ */ C("div", {
|
|
420
|
-
className: "
|
|
421
|
-
children: [
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
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
|
+
]
|
|
456
427
|
}),
|
|
428
|
+
/* @__PURE__ */ S(me, {}),
|
|
457
429
|
/* @__PURE__ */ C("div", {
|
|
458
|
-
className: "grid grid-cols-1
|
|
459
|
-
children: [
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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
|
+
]
|
|
482
635
|
})
|
|
483
636
|
]
|
|
484
|
-
})] })]
|
|
485
|
-
}),
|
|
486
|
-
/* @__PURE__ */ C(f, { children: [/* @__PURE__ */ C(m, {
|
|
487
|
-
className: "flex flex-row items-center justify-between",
|
|
488
|
-
children: [/* @__PURE__ */ S(h, { children: "Order Items" }), /* @__PURE__ */ C(d, {
|
|
489
|
-
type: "button",
|
|
490
|
-
variant: "outline",
|
|
491
|
-
size: "sm",
|
|
492
|
-
onClick: Q,
|
|
493
|
-
children: [/* @__PURE__ */ S(i, { size: 16 }), "Add Item"]
|
|
494
|
-
})]
|
|
495
|
-
}), /* @__PURE__ */ S(p, { children: H.items.length === 0 ? /* @__PURE__ */ S(fe, {
|
|
496
|
-
illustration: "empty-files",
|
|
497
|
-
title: "No items added yet",
|
|
498
|
-
description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
|
|
499
|
-
action: /* @__PURE__ */ C(d, {
|
|
500
|
-
type: "button",
|
|
501
|
-
variant: "outline",
|
|
502
|
-
onClick: Q,
|
|
503
|
-
children: [/* @__PURE__ */ S(i, {
|
|
504
|
-
size: 16,
|
|
505
|
-
className: "mr-1.5"
|
|
506
|
-
}), "Add your first item"]
|
|
507
637
|
})
|
|
508
|
-
})
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
children: [/* @__PURE__ */ S(_, { children: "SKU" }), /* @__PURE__ */ S(g, {
|
|
524
|
-
value: e.sku,
|
|
525
|
-
onChange: (e) => $(t, "sku", e.target.value),
|
|
526
|
-
placeholder: "SKU-001"
|
|
527
|
-
})]
|
|
528
|
-
}),
|
|
529
|
-
/* @__PURE__ */ C("div", {
|
|
530
|
-
className: "space-y-2",
|
|
531
|
-
children: [/* @__PURE__ */ S(_, { children: "Quantity" }), /* @__PURE__ */ S(g, {
|
|
532
|
-
type: "number",
|
|
533
|
-
min: "1",
|
|
534
|
-
value: e.quantity,
|
|
535
|
-
onChange: (e) => $(t, "quantity", parseInt(e.target.value) || 1)
|
|
536
|
-
})]
|
|
537
|
-
}),
|
|
538
|
-
/* @__PURE__ */ C("div", {
|
|
539
|
-
className: "space-y-2",
|
|
540
|
-
children: [/* @__PURE__ */ S(_, { children: "Weight (kg)" }), /* @__PURE__ */ S(g, {
|
|
541
|
-
type: "number",
|
|
542
|
-
min: "0",
|
|
543
|
-
step: "0.1",
|
|
544
|
-
value: e.weight,
|
|
545
|
-
onChange: (e) => $(t, "weight", parseFloat(e.target.value) || 0)
|
|
546
|
-
})]
|
|
547
|
-
}),
|
|
548
|
-
/* @__PURE__ */ C("div", {
|
|
549
|
-
className: "space-y-2",
|
|
550
|
-
children: [/* @__PURE__ */ S(_, { children: "Value ($)" }), /* @__PURE__ */ S(g, {
|
|
551
|
-
type: "number",
|
|
552
|
-
min: "0",
|
|
553
|
-
step: "0.01",
|
|
554
|
-
value: e.value,
|
|
555
|
-
onChange: (e) => $(t, "value", parseFloat(e.target.value) || 0)
|
|
556
|
-
})]
|
|
557
|
-
}),
|
|
558
|
-
/* @__PURE__ */ S("div", {
|
|
559
|
-
className: "flex items-end",
|
|
560
|
-
children: /* @__PURE__ */ S(d, {
|
|
561
|
-
type: "button",
|
|
562
|
-
variant: "ghost",
|
|
563
|
-
size: "icon",
|
|
564
|
-
className: "text-status-error-text",
|
|
565
|
-
onClick: () => Le(t),
|
|
566
|
-
children: /* @__PURE__ */ S(ee, { size: 16 })
|
|
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
|
|
567
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"]
|
|
568
676
|
})
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}),
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
children:
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
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
|
+
})]
|
|
607
754
|
})]
|
|
608
|
-
})
|
|
609
|
-
})
|
|
755
|
+
})
|
|
756
|
+
})
|
|
610
757
|
]
|
|
611
758
|
})
|
|
612
759
|
]
|
|
613
760
|
});
|
|
614
761
|
}
|
|
615
762
|
//#endregion
|
|
616
|
-
export {
|
|
763
|
+
export { E as default };
|