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