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