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