@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,33 +7,33 @@ import { Ship as a } from "../node_modules/lucide-react/dist/esm/icons/ship.js";
|
|
|
7
7
|
import { TrainFront as o } from "../node_modules/lucide-react/dist/esm/icons/train-front.js";
|
|
8
8
|
import { Trash2 as ee } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
9
9
|
import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
10
|
-
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as m, Label as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b, Separator as
|
|
11
|
-
import { EmptyState as
|
|
12
|
-
import { FormError as
|
|
13
|
-
import { useMultiModalShipments as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { EmphasisPanel as
|
|
10
|
+
import { Badge as c, Button as l, Card as u, CardContent as d, CardHeader as f, CardTitle as p, Input as m, Label as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b, Separator as te } from "../components/ui.js";
|
|
11
|
+
import { EmptyState as ne, LoadingState as re, PageLayout as x, PageSection as S } from "../components/PageLayout.js";
|
|
12
|
+
import { FormError as C } from "../components/FormError.js";
|
|
13
|
+
import { useMultiModalShipments as ie } from "../hooks/useMultiModalShipments.js";
|
|
14
|
+
import { useState as w } from "react";
|
|
15
|
+
import { Fragment as ae, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
16
|
+
import { EmphasisPanel as oe, PagePurpose as D } from "@burdenoff/fe-libs/ui";
|
|
17
17
|
//#region src/movethewheels/pages/MultiModalShipmentPage.tsx
|
|
18
|
-
var
|
|
18
|
+
var O = {
|
|
19
19
|
ROAD: s,
|
|
20
20
|
AIR: r,
|
|
21
21
|
OCEAN: a,
|
|
22
22
|
RAIL: o
|
|
23
|
-
},
|
|
23
|
+
}, k = {
|
|
24
24
|
ROAD: "Road",
|
|
25
25
|
AIR: "Air",
|
|
26
26
|
OCEAN: "Ocean",
|
|
27
27
|
RAIL: "Rail"
|
|
28
28
|
};
|
|
29
|
-
function
|
|
29
|
+
function A(e = "ROAD") {
|
|
30
30
|
return {
|
|
31
31
|
mode: e,
|
|
32
32
|
origin: {},
|
|
33
33
|
destination: {}
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function j(e, t) {
|
|
37
37
|
if (e == null) return "—";
|
|
38
38
|
try {
|
|
39
39
|
return new Intl.NumberFormat("en-US", {
|
|
@@ -44,11 +44,12 @@ function M(e, t) {
|
|
|
44
44
|
return `${e.toFixed(2)} ${t ?? "USD"}`;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
let [r, o] =
|
|
47
|
+
function M() {
|
|
48
|
+
let [r, o] = w(0), [s, M] = w(""), [N, P] = w(""), { shipments: F, totalShipments: I, hasMore: se, isLoading: L, error: R, calculateFreightRate: ce, planMultiModalShipment: le } = ie({
|
|
49
49
|
limit: 10,
|
|
50
|
-
offset: r * 10
|
|
51
|
-
|
|
50
|
+
offset: r * 10,
|
|
51
|
+
search: N
|
|
52
|
+
}), [z, B] = w(""), [V, H] = w(""), [U, W] = w([A()]), [G, K] = w({}), [ue, q] = w({}), [J, Y] = w(!1), [de, X] = w(null), [Z, Q] = w(null), $ = (e, t) => {
|
|
52
53
|
W((n) => n.map((n, r) => r === e ? {
|
|
53
54
|
...n,
|
|
54
55
|
...t
|
|
@@ -56,12 +57,12 @@ function N() {
|
|
|
56
57
|
...t,
|
|
57
58
|
[e]: null
|
|
58
59
|
}));
|
|
59
|
-
},
|
|
60
|
+
}, fe = () => W((e) => [...e, A()]), pe = (e) => {
|
|
60
61
|
W((t) => t.filter((t, n) => n !== e)), K((t) => {
|
|
61
62
|
let n = { ...t };
|
|
62
63
|
return delete n[e], n;
|
|
63
64
|
});
|
|
64
|
-
},
|
|
65
|
+
}, me = async (e) => {
|
|
65
66
|
let t = U[e];
|
|
66
67
|
if (t) {
|
|
67
68
|
q((t) => ({
|
|
@@ -69,7 +70,7 @@ function N() {
|
|
|
69
70
|
[e]: null
|
|
70
71
|
}));
|
|
71
72
|
try {
|
|
72
|
-
let n = await
|
|
73
|
+
let n = await ce(t);
|
|
73
74
|
K((t) => ({
|
|
74
75
|
...t,
|
|
75
76
|
[e]: n
|
|
@@ -81,24 +82,24 @@ function N() {
|
|
|
81
82
|
}));
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
},
|
|
85
|
-
return /* @__PURE__ */
|
|
85
|
+
}, he = Object.values(G).reduce((e, t) => e + (t?.calculatedCost ?? 0), 0), ge = new Set(U.map((e) => e.mode));
|
|
86
|
+
return /* @__PURE__ */ E(x, {
|
|
86
87
|
hero: !0,
|
|
87
88
|
titleAccent: "Multi-Modal Freight",
|
|
88
89
|
title: "Multi-Modal Freight",
|
|
89
90
|
subtitle: "Plan a shipment across road, air, ocean and rail legs with real per-mode rate calculation",
|
|
90
|
-
icon: /* @__PURE__ */
|
|
91
|
+
icon: /* @__PURE__ */ T(a, { size: 24 }),
|
|
91
92
|
children: [
|
|
92
|
-
/* @__PURE__ */ D
|
|
93
|
-
icon: /* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ T(D, {
|
|
94
|
+
icon: /* @__PURE__ */ T(a, { size: 18 }),
|
|
94
95
|
children: "Compose a single shipment from multiple real transport legs — each leg picks its own mode (road/air/ocean/rail) and gets priced with that mode's real pricing driver (air: chargeable weight; ocean: revenue-ton or per-container; rail: tonne-km; road: distance + weight). Calculate a leg's rate before booking, then plan the full multi-leg shipment in one step."
|
|
95
96
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ T(oe, { children: "Live carrier booking/API integration is out of scope for this core (it needs named-carrier partnership agreements) — this plans the shipment and its legs with real calculated costs that your ops team can then execute against your chosen carriers." }),
|
|
98
|
+
/* @__PURE__ */ T(S, {
|
|
98
99
|
title: "Plan a New Multi-Modal Shipment",
|
|
99
|
-
children: /* @__PURE__ */
|
|
100
|
+
children: /* @__PURE__ */ T(u, { children: /* @__PURE__ */ T(d, { children: /* @__PURE__ */ E("form", {
|
|
100
101
|
onSubmit: async (e) => {
|
|
101
|
-
if (e.preventDefault(), X(null), Q(null), !
|
|
102
|
+
if (e.preventDefault(), X(null), Q(null), !s.trim()) {
|
|
102
103
|
X("Shipment number is required.");
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
@@ -108,13 +109,13 @@ function N() {
|
|
|
108
109
|
}
|
|
109
110
|
Y(!0);
|
|
110
111
|
try {
|
|
111
|
-
let e = await
|
|
112
|
-
shipmentNumber:
|
|
112
|
+
let e = await le({
|
|
113
|
+
shipmentNumber: s.trim(),
|
|
113
114
|
origin: { address: z },
|
|
114
115
|
destination: { address: V },
|
|
115
116
|
legs: U
|
|
116
117
|
});
|
|
117
|
-
Q(`Shipment ${e.shipmentNumber} planned with ${e.legs.length} leg(s).`),
|
|
118
|
+
Q(`Shipment ${e.shipmentNumber} planned with ${e.legs.length} leg(s).`), M(""), B(""), H(""), W([A()]), K({}), o(0);
|
|
118
119
|
} catch (e) {
|
|
119
120
|
X(e instanceof Error ? e.message : "Failed to plan shipment");
|
|
120
121
|
} finally {
|
|
@@ -123,37 +124,37 @@ function N() {
|
|
|
123
124
|
},
|
|
124
125
|
className: "space-y-6 pt-4",
|
|
125
126
|
children: [
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
Z && /* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ T(C, { message: de }),
|
|
128
|
+
Z && /* @__PURE__ */ T("div", {
|
|
128
129
|
className: "rounded-lg border border-status-success-border bg-status-success-bg-subtle px-4 py-3 text-sm text-status-success-text",
|
|
129
130
|
children: Z
|
|
130
131
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ E("div", {
|
|
132
133
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
133
134
|
children: [
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, {
|
|
135
136
|
htmlFor: "shipmentNumber",
|
|
136
137
|
children: "Shipment Number"
|
|
137
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ T(m, {
|
|
138
139
|
id: "shipmentNumber",
|
|
139
|
-
value:
|
|
140
|
-
onChange: (e) =>
|
|
140
|
+
value: s,
|
|
141
|
+
onChange: (e) => M(e.target.value),
|
|
141
142
|
placeholder: "SHP-MM-0001",
|
|
142
143
|
required: !0
|
|
143
144
|
})] }),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, {
|
|
145
146
|
htmlFor: "originAddress",
|
|
146
147
|
children: "Origin"
|
|
147
|
-
}), /* @__PURE__ */
|
|
148
|
+
}), /* @__PURE__ */ T(m, {
|
|
148
149
|
id: "originAddress",
|
|
149
150
|
value: z,
|
|
150
151
|
onChange: (e) => B(e.target.value),
|
|
151
152
|
placeholder: "Shanghai, CN"
|
|
152
153
|
})] }),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, {
|
|
154
155
|
htmlFor: "destinationAddress",
|
|
155
156
|
children: "Destination"
|
|
156
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ T(m, {
|
|
157
158
|
id: "destinationAddress",
|
|
158
159
|
value: V,
|
|
159
160
|
onChange: (e) => H(e.target.value),
|
|
@@ -161,97 +162,97 @@ function N() {
|
|
|
161
162
|
})] })
|
|
162
163
|
]
|
|
163
164
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ T(te, {}),
|
|
166
|
+
/* @__PURE__ */ T("div", {
|
|
166
167
|
className: "space-y-4",
|
|
167
168
|
children: U.map((t, n) => {
|
|
168
|
-
let r =
|
|
169
|
-
return /* @__PURE__ */
|
|
169
|
+
let r = O[t.mode], i = G[n], a = ue[n];
|
|
170
|
+
return /* @__PURE__ */ E(u, {
|
|
170
171
|
className: "border-border-subtle",
|
|
171
|
-
children: [/* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ E(f, {
|
|
172
173
|
className: "flex flex-row items-center justify-between",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ E(p, {
|
|
174
175
|
className: "flex items-center gap-2 text-base",
|
|
175
176
|
children: [
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ T(r, { size: 16 }),
|
|
177
178
|
" Leg ",
|
|
178
179
|
n + 1
|
|
179
180
|
]
|
|
180
|
-
}), U.length > 1 && /* @__PURE__ */
|
|
181
|
+
}), U.length > 1 && /* @__PURE__ */ T(l, {
|
|
181
182
|
type: "button",
|
|
182
183
|
variant: "ghost",
|
|
183
184
|
size: "sm",
|
|
184
|
-
onClick: () =>
|
|
185
|
+
onClick: () => pe(n),
|
|
185
186
|
"aria-label": `Remove leg ${n + 1}`,
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ T(ee, { size: 14 })
|
|
187
188
|
})]
|
|
188
|
-
}), /* @__PURE__ */
|
|
189
|
+
}), /* @__PURE__ */ E(d, {
|
|
189
190
|
className: "space-y-4",
|
|
190
191
|
children: [
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ E("div", {
|
|
192
193
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
193
194
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Mode" }), /* @__PURE__ */ E(g, {
|
|
195
196
|
value: t.mode,
|
|
196
197
|
onValueChange: (e) => $(n, { mode: e }),
|
|
197
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ T(y, { children: /* @__PURE__ */ T(b, {}) }), /* @__PURE__ */ T(_, { children: [
|
|
198
199
|
"ROAD",
|
|
199
200
|
"AIR",
|
|
200
201
|
"OCEAN",
|
|
201
202
|
"RAIL"
|
|
202
|
-
].map((e) => /* @__PURE__ */
|
|
203
|
+
].map((e) => /* @__PURE__ */ T(v, {
|
|
203
204
|
value: e,
|
|
204
|
-
children:
|
|
205
|
+
children: k[e]
|
|
205
206
|
}, e)) })]
|
|
206
207
|
})] }),
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Leg Origin" }), /* @__PURE__ */ T(m, {
|
|
208
209
|
value: t.origin.address ?? "",
|
|
209
210
|
onChange: (e) => $(n, { origin: { address: e.target.value } }),
|
|
210
211
|
placeholder: "Origin port/airport/terminal"
|
|
211
212
|
})] }),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Leg Destination" }), /* @__PURE__ */ T(m, {
|
|
213
214
|
value: t.destination.address ?? "",
|
|
214
215
|
onChange: (e) => $(n, { destination: { address: e.target.value } }),
|
|
215
216
|
placeholder: "Destination port/airport/terminal"
|
|
216
217
|
})] })
|
|
217
218
|
]
|
|
218
219
|
}),
|
|
219
|
-
(t.mode === "ROAD" || t.mode === "RAIL") && /* @__PURE__ */
|
|
220
|
+
(t.mode === "ROAD" || t.mode === "RAIL") && /* @__PURE__ */ E("div", {
|
|
220
221
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Distance (km)" }), /* @__PURE__ */ T(m, {
|
|
222
223
|
type: "number",
|
|
223
224
|
min: 0,
|
|
224
225
|
value: t.distanceKm ?? "",
|
|
225
226
|
onChange: (e) => $(n, { distanceKm: Number(e.target.value) || void 0 })
|
|
226
|
-
})] }), /* @__PURE__ */
|
|
227
|
+
})] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Weight (kg)" }), /* @__PURE__ */ T(m, {
|
|
227
228
|
type: "number",
|
|
228
229
|
min: 0,
|
|
229
230
|
value: t.weightKg ?? "",
|
|
230
231
|
onChange: (e) => $(n, { weightKg: Number(e.target.value) || void 0 })
|
|
231
232
|
})] })]
|
|
232
233
|
}),
|
|
233
|
-
t.mode === "AIR" && /* @__PURE__ */
|
|
234
|
+
t.mode === "AIR" && /* @__PURE__ */ E("div", {
|
|
234
235
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-4",
|
|
235
236
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Weight (kg)" }), /* @__PURE__ */ T(m, {
|
|
237
238
|
type: "number",
|
|
238
239
|
min: 0,
|
|
239
240
|
value: t.weightKg ?? "",
|
|
240
241
|
onChange: (e) => $(n, { weightKg: Number(e.target.value) || void 0 })
|
|
241
242
|
})] }),
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Length (cm)" }), /* @__PURE__ */ T(m, {
|
|
243
244
|
type: "number",
|
|
244
245
|
min: 0,
|
|
245
246
|
value: t.lengthCm ?? "",
|
|
246
247
|
onChange: (e) => $(n, { lengthCm: Number(e.target.value) || void 0 })
|
|
247
248
|
})] }),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Width (cm)" }), /* @__PURE__ */ T(m, {
|
|
249
250
|
type: "number",
|
|
250
251
|
min: 0,
|
|
251
252
|
value: t.widthCm ?? "",
|
|
252
253
|
onChange: (e) => $(n, { widthCm: Number(e.target.value) || void 0 })
|
|
253
254
|
})] }),
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Height (cm)" }), /* @__PURE__ */ T(m, {
|
|
255
256
|
type: "number",
|
|
256
257
|
min: 0,
|
|
257
258
|
value: t.heightCm ?? "",
|
|
@@ -259,62 +260,62 @@ function N() {
|
|
|
259
260
|
})] })
|
|
260
261
|
]
|
|
261
262
|
}),
|
|
262
|
-
t.mode === "OCEAN" && /* @__PURE__ */
|
|
263
|
+
t.mode === "OCEAN" && /* @__PURE__ */ E("div", {
|
|
263
264
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-4",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Container Type" }), /* @__PURE__ */ E(g, {
|
|
265
266
|
value: t.containerType ?? "LCL",
|
|
266
267
|
onValueChange: (e) => $(n, { containerType: e }),
|
|
267
|
-
children: [/* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ T(y, { children: /* @__PURE__ */ T(b, {}) }), /* @__PURE__ */ E(_, { children: [
|
|
269
|
+
/* @__PURE__ */ T(v, {
|
|
269
270
|
value: "LCL",
|
|
270
271
|
children: "LCL (shared container)"
|
|
271
272
|
}),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ T(v, {
|
|
273
274
|
value: "FCL_20FT",
|
|
274
275
|
children: "FCL 20ft"
|
|
275
276
|
}),
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ T(v, {
|
|
277
278
|
value: "FCL_40FT",
|
|
278
279
|
children: "FCL 40ft"
|
|
279
280
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ T(v, {
|
|
281
282
|
value: "FCL_40FT_HC",
|
|
282
283
|
children: "FCL 40ft High-Cube"
|
|
283
284
|
})
|
|
284
285
|
] })]
|
|
285
|
-
})] }), (t.containerType ?? "LCL") === "LCL" ? /* @__PURE__ */
|
|
286
|
+
})] }), (t.containerType ?? "LCL") === "LCL" ? /* @__PURE__ */ E(ae, { children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Weight (kg)" }), /* @__PURE__ */ T(m, {
|
|
286
287
|
type: "number",
|
|
287
288
|
min: 0,
|
|
288
289
|
value: t.weightKg ?? "",
|
|
289
290
|
onChange: (e) => $(n, { weightKg: Number(e.target.value) || void 0 })
|
|
290
|
-
})] }), /* @__PURE__ */
|
|
291
|
+
})] }), /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Volume (CBM)" }), /* @__PURE__ */ T(m, {
|
|
291
292
|
type: "number",
|
|
292
293
|
min: 0,
|
|
293
294
|
value: t.volumeCbm ?? "",
|
|
294
295
|
onChange: (e) => $(n, { volumeCbm: Number(e.target.value) || void 0 })
|
|
295
|
-
})] })] }) : /* @__PURE__ */
|
|
296
|
+
})] })] }) : /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T(h, { children: "Container Count" }), /* @__PURE__ */ T(m, {
|
|
296
297
|
type: "number",
|
|
297
298
|
min: 1,
|
|
298
299
|
value: t.containerCount ?? 1,
|
|
299
300
|
onChange: (e) => $(n, { containerCount: Number(e.target.value) || 1 })
|
|
300
301
|
})] })]
|
|
301
302
|
}),
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ E("div", {
|
|
303
304
|
className: "flex items-center gap-3",
|
|
304
305
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ E(l, {
|
|
306
307
|
type: "button",
|
|
307
308
|
variant: "secondary",
|
|
308
309
|
size: "sm",
|
|
309
|
-
onClick: () => void
|
|
310
|
-
children: [/* @__PURE__ */
|
|
310
|
+
onClick: () => void me(n),
|
|
311
|
+
children: [/* @__PURE__ */ T(e, {
|
|
311
312
|
size: 14,
|
|
312
313
|
className: "mr-1.5"
|
|
313
314
|
}), " Calculate Rate"]
|
|
314
315
|
}),
|
|
315
|
-
i && /* @__PURE__ */
|
|
316
|
+
i && /* @__PURE__ */ E("span", {
|
|
316
317
|
className: "text-sm font-medium text-text-primary",
|
|
317
|
-
children: [
|
|
318
|
+
children: [j(i.calculatedCost, i.currency), i.chargeableWeightKg != null && /* @__PURE__ */ E("span", {
|
|
318
319
|
className: "ml-2 text-xs text-text-secondary",
|
|
319
320
|
children: [
|
|
320
321
|
"(",
|
|
@@ -323,17 +324,17 @@ function N() {
|
|
|
323
324
|
]
|
|
324
325
|
})]
|
|
325
326
|
}),
|
|
326
|
-
a && /* @__PURE__ */
|
|
327
|
+
a && /* @__PURE__ */ T("span", {
|
|
327
328
|
className: "text-sm text-status-error-text",
|
|
328
329
|
children: a
|
|
329
330
|
})
|
|
330
331
|
]
|
|
331
332
|
}),
|
|
332
|
-
i && i.breakdown.length > 0 && /* @__PURE__ */
|
|
333
|
+
i && i.breakdown.length > 0 && /* @__PURE__ */ T("ul", {
|
|
333
334
|
className: "space-y-1 rounded-md bg-surface-subtle px-3 py-2 text-xs text-text-secondary",
|
|
334
|
-
children: i.breakdown.map((e) => /* @__PURE__ */
|
|
335
|
+
children: i.breakdown.map((e) => /* @__PURE__ */ E("li", {
|
|
335
336
|
className: "flex justify-between",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
337
|
+
children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ T("span", { children: j(e.amount, i.currency) })]
|
|
337
338
|
}, e.label))
|
|
338
339
|
})
|
|
339
340
|
]
|
|
@@ -341,33 +342,33 @@ function N() {
|
|
|
341
342
|
}, n);
|
|
342
343
|
})
|
|
343
344
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ E("div", {
|
|
345
346
|
className: "flex items-center justify-between",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ E(l, {
|
|
347
348
|
type: "button",
|
|
348
349
|
variant: "outline",
|
|
349
350
|
size: "sm",
|
|
350
|
-
onClick:
|
|
351
|
-
children: [/* @__PURE__ */
|
|
351
|
+
onClick: fe,
|
|
352
|
+
children: [/* @__PURE__ */ T(i, {
|
|
352
353
|
size: 14,
|
|
353
354
|
className: "mr-1.5"
|
|
354
355
|
}), " Add Leg"]
|
|
355
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ E("div", {
|
|
356
357
|
className: "flex items-center gap-3",
|
|
357
|
-
children: [
|
|
358
|
+
children: [ge.size > 1 && /* @__PURE__ */ T(c, {
|
|
358
359
|
variant: "secondary",
|
|
359
360
|
children: "Multi-modal"
|
|
360
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ E("span", {
|
|
361
362
|
className: "text-sm text-text-secondary",
|
|
362
363
|
children: [
|
|
363
364
|
"Estimated total:",
|
|
364
365
|
" ",
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ T("strong", { children: j(he, G[0]?.currency ?? "USD") })
|
|
366
367
|
]
|
|
367
368
|
})]
|
|
368
369
|
})]
|
|
369
370
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ T(l, {
|
|
371
372
|
type: "submit",
|
|
372
373
|
disabled: J,
|
|
373
374
|
children: J ? "Planning shipment..." : "Plan Shipment"
|
|
@@ -375,79 +376,92 @@ function N() {
|
|
|
375
376
|
]
|
|
376
377
|
}) }) })
|
|
377
378
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ E(S, {
|
|
379
380
|
title: "Planned Multi-Modal Shipments",
|
|
380
|
-
children:
|
|
381
|
-
|
|
381
|
+
children: [/* @__PURE__ */ E("div", {
|
|
382
|
+
className: "mb-4 max-w-xl space-y-2",
|
|
383
|
+
children: [/* @__PURE__ */ T(h, {
|
|
384
|
+
htmlFor: "planned-shipment-search",
|
|
385
|
+
children: "Search planned shipments"
|
|
386
|
+
}), /* @__PURE__ */ T(m, {
|
|
387
|
+
id: "planned-shipment-search",
|
|
388
|
+
value: N,
|
|
389
|
+
onChange: (e) => {
|
|
390
|
+
P(e.target.value), o(0);
|
|
391
|
+
},
|
|
392
|
+
placeholder: "Search by shipment or tracking number"
|
|
393
|
+
})]
|
|
394
|
+
}), L ? /* @__PURE__ */ T(re, { message: "Loading multi-modal shipments..." }) : R ? /* @__PURE__ */ T(C, { message: R.message }) : F.length === 0 ? /* @__PURE__ */ T(ne, {
|
|
395
|
+
icon: /* @__PURE__ */ T(a, { size: 32 }),
|
|
382
396
|
title: "No multi-modal shipments yet",
|
|
383
397
|
description: "Plan a shipment above to see it here once it spans more than one transport mode."
|
|
384
|
-
}) : /* @__PURE__ */
|
|
398
|
+
}) : /* @__PURE__ */ E("div", {
|
|
385
399
|
className: "space-y-4",
|
|
386
|
-
children: [
|
|
400
|
+
children: [F.map((e) => /* @__PURE__ */ E(u, { children: [/* @__PURE__ */ E(f, {
|
|
387
401
|
className: "flex flex-row items-center justify-between",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ T(p, {
|
|
389
403
|
className: "text-base",
|
|
390
404
|
children: e.shipmentNumber
|
|
391
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ E("div", {
|
|
392
406
|
className: "flex items-center gap-2",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ T(c, {
|
|
394
408
|
variant: "outline",
|
|
395
409
|
children: e.status
|
|
396
|
-
}), /* @__PURE__ */
|
|
410
|
+
}), /* @__PURE__ */ T("span", {
|
|
397
411
|
className: "text-sm font-medium",
|
|
398
|
-
children:
|
|
412
|
+
children: j(e.totalFreightCost, e.freightCurrency)
|
|
399
413
|
})]
|
|
400
414
|
})]
|
|
401
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ T(d, { children: /* @__PURE__ */ T("div", {
|
|
402
416
|
className: "flex flex-wrap gap-2",
|
|
403
417
|
children: e.legs.map((e) => {
|
|
404
|
-
let t =
|
|
405
|
-
return /* @__PURE__ */
|
|
418
|
+
let t = O[e.mode];
|
|
419
|
+
return /* @__PURE__ */ E(c, {
|
|
406
420
|
variant: "secondary",
|
|
407
421
|
className: "flex items-center gap-1",
|
|
408
422
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ T(t, { size: 12 }),
|
|
410
424
|
" ",
|
|
411
|
-
|
|
425
|
+
k[e.mode],
|
|
412
426
|
":",
|
|
413
427
|
" ",
|
|
414
|
-
|
|
428
|
+
j(e.calculatedCost, e.currency)
|
|
415
429
|
]
|
|
416
430
|
}, e.id);
|
|
417
431
|
})
|
|
418
|
-
}) })] }, e.id)),
|
|
432
|
+
}) })] }, e.id)), I > 10 && /* @__PURE__ */ E("div", {
|
|
419
433
|
className: "flex items-center justify-between border-t border-border-seam pt-4",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
434
|
+
children: [/* @__PURE__ */ E("span", {
|
|
421
435
|
className: "text-sm text-text-secondary",
|
|
422
436
|
children: [
|
|
423
437
|
"Showing ",
|
|
424
438
|
r * 10 + 1,
|
|
425
439
|
"–",
|
|
426
|
-
Math.min((r + 1) * 10,
|
|
440
|
+
Math.min((r + 1) * 10, I),
|
|
427
441
|
" of ",
|
|
428
|
-
|
|
442
|
+
I
|
|
429
443
|
]
|
|
430
|
-
}), /* @__PURE__ */
|
|
444
|
+
}), /* @__PURE__ */ E("div", {
|
|
431
445
|
className: "flex gap-2",
|
|
432
|
-
children: [/* @__PURE__ */
|
|
446
|
+
children: [/* @__PURE__ */ E(l, {
|
|
433
447
|
variant: "outline",
|
|
434
448
|
size: "sm",
|
|
435
|
-
disabled: r === 0 ||
|
|
449
|
+
disabled: r === 0 || L,
|
|
436
450
|
onClick: () => o((e) => Math.max(0, e - 1)),
|
|
437
|
-
children: [/* @__PURE__ */
|
|
438
|
-
}), /* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ T(t, { size: 16 }), " Previous"]
|
|
452
|
+
}), /* @__PURE__ */ E(l, {
|
|
439
453
|
variant: "outline",
|
|
440
454
|
size: "sm",
|
|
441
|
-
disabled: !
|
|
455
|
+
disabled: !se || L,
|
|
442
456
|
onClick: () => o((e) => e + 1),
|
|
443
|
-
children: ["Next ", /* @__PURE__ */
|
|
457
|
+
children: ["Next ", /* @__PURE__ */ T(n, { size: 16 })]
|
|
444
458
|
})]
|
|
445
459
|
})]
|
|
446
460
|
})]
|
|
447
|
-
})
|
|
461
|
+
})]
|
|
448
462
|
})
|
|
449
463
|
]
|
|
450
464
|
});
|
|
451
465
|
}
|
|
452
466
|
//#endregion
|
|
453
|
-
export {
|
|
467
|
+
export { M as default };
|