@burdenoff/microfe-movethewheels 2026.1031.3 → 2026.1031.4
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/MoveTheWheelsRoot.js +136 -127
- package/dist/MoveTheWheelsRoutes.js +140 -135
- package/dist/components/DocumentsCard.js +11 -11
- package/dist/components/ProofOfDeliveryCard.js +13 -13
- package/dist/components/ShipmentRiskDialog.js +24 -24
- package/dist/components/ShippingQuoteResults.js +46 -46
- package/dist/components/TrackingAlertList.js +17 -17
- package/dist/generated/tracking-quality-operations.d.ts +56 -0
- package/dist/hooks/useOrderDispatch.js +17 -17
- package/dist/movethewheels/pages/SettingsPage.d.ts +1 -0
- package/dist/movethewheels/providers/ModuleSettingsProvider.d.ts +17 -0
- package/dist/movethewheels/utils/formatters.d.ts +23 -3
- package/dist/movethewheels/utils/moduleSettings.d.ts +52 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/bell.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/key-round.js +14 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/plug.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/rotate-ccw.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/settings.js +13 -0
- package/dist/pages/AnalyticsPage.js +27 -27
- package/dist/pages/CreateOrderPage.js +340 -317
- package/dist/pages/CustomerDetailsPage.js +246 -246
- package/dist/pages/CustomersPage.js +19 -19
- package/dist/pages/DashboardPage.js +24 -24
- package/dist/pages/DeliveryCapturePage.js +74 -74
- package/dist/pages/DriverDetailsPage.js +337 -337
- package/dist/pages/DriversPage.js +26 -26
- package/dist/pages/FinancePage.js +26 -26
- package/dist/pages/InventoryPage.js +28 -28
- package/dist/pages/LiveTrackingPage.js +108 -108
- package/dist/pages/MarketplacePage.js +44 -44
- package/dist/pages/OrderDetailsPage.js +306 -306
- package/dist/pages/OrdersListPage.js +27 -27
- package/dist/pages/ProductDetailsPage.js +89 -89
- package/dist/pages/ProductsPage.js +73 -73
- package/dist/pages/RouteDetailsPage.js +282 -285
- package/dist/pages/RoutesPage.js +78 -78
- package/dist/pages/SettingsPage.js +459 -0
- package/dist/pages/TrackingPage.js +41 -41
- package/dist/pages/VehicleDetailsPage.js +207 -207
- package/dist/pages/VehiclesPage.js +17 -16
- package/dist/pages/WarehouseDetailsPage.js +132 -132
- package/dist/providers/ModuleSettingsProvider.js +74 -0
- package/dist/utils/formatters.js +53 -26
- package/dist/utils/moduleSettings.js +132 -0
- package/package.json +3 -2
- package/src/generated/tracking-quality-operations.ts +62 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +14 -3
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +9 -0
- package/src/movethewheels/pages/CreateOrderPage.tsx +38 -6
- package/src/movethewheels/pages/ProductsPage.tsx +2 -2
- package/src/movethewheels/pages/RouteDetailsPage.tsx +3 -6
- package/src/movethewheels/pages/RoutesPage.tsx +2 -2
- package/src/movethewheels/pages/SettingsPage.tsx +516 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +2 -1
- package/src/movethewheels/providers/ModuleSettingsProvider.tsx +133 -0
- package/src/movethewheels/utils/formatters.ts +69 -10
- package/src/movethewheels/utils/moduleSettings.ts +224 -0
|
@@ -8,17 +8,17 @@ import { Trash2 as o } from "../node_modules/lucide-react/dist/esm/icons/trash-2
|
|
|
8
8
|
import { Warehouse as s } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
9
9
|
import { joinPath as c } from "../utils/navigation.js";
|
|
10
10
|
import { useMoveTheWheels as l } from "../providers/MoveTheWheelsProvider.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
11
|
+
import { formatAddress as u } from "../utils/formatters.js";
|
|
12
|
+
import { useInventory as d, useWarehouse as f } from "../hooks/useInventory.js";
|
|
13
|
+
import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, Input as y, Label as b, Progress as x, Select as S, SelectContent as C, SelectItem as w, SelectTrigger as T, SelectValue as E } from "../components/ui.js";
|
|
14
|
+
import { ErrorState as D, LoadingState as O, PageLayout as k } from "../components/PageLayout.js";
|
|
15
|
+
import { FormError as A } from "../components/FormError.js";
|
|
16
16
|
import { useEffect as j, useState as M } from "react";
|
|
17
17
|
import { useLocation as N, useParams as P } from "react-router";
|
|
18
18
|
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
19
|
-
import { EmphasisPanel as R, NextSteps as z, PagePurpose as B, ResponsiveDialog as
|
|
19
|
+
import { EmphasisPanel as R, NextSteps as z, PagePurpose as B, ResponsiveDialog as ee, ResponsiveDialogContent as te, ResponsiveDialogDescription as ne, ResponsiveDialogFooter as V, ResponsiveDialogHeader as re, ResponsiveDialogTitle as ie } from "@burdenoff/fe-libs/ui";
|
|
20
20
|
//#region src/movethewheels/pages/WarehouseDetailsPage.tsx
|
|
21
|
-
var
|
|
21
|
+
var ae = [
|
|
22
22
|
{
|
|
23
23
|
value: "DISTRIBUTION",
|
|
24
24
|
label: "Distribution"
|
|
@@ -39,15 +39,15 @@ var re = [
|
|
|
39
39
|
value: "RETAIL",
|
|
40
40
|
label: "Retail"
|
|
41
41
|
}
|
|
42
|
-
],
|
|
42
|
+
], oe = [{
|
|
43
43
|
value: "ACTIVE",
|
|
44
44
|
label: "Active"
|
|
45
45
|
}, {
|
|
46
46
|
value: "INACTIVE",
|
|
47
47
|
label: "Inactive"
|
|
48
48
|
}];
|
|
49
|
-
function
|
|
50
|
-
let { basePath: a, navigate:
|
|
49
|
+
function H({ editId: t, onSaved: n }) {
|
|
50
|
+
let { basePath: a, navigate: u } = l(), { createWarehouse: p, updateWarehouse: x, deleteWarehouse: D } = d(), { warehouse: O } = f(t), N = !!t, [P, F] = M({
|
|
51
51
|
code: "",
|
|
52
52
|
name: "",
|
|
53
53
|
type: "DISTRIBUTION",
|
|
@@ -61,37 +61,37 @@ function W({ editId: t, onSaved: n }) {
|
|
|
61
61
|
usedCapacity: "",
|
|
62
62
|
contactEmail: "",
|
|
63
63
|
contactPhone: ""
|
|
64
|
-
}), [z,
|
|
64
|
+
}), [z, H] = M(!1), [U, W] = M(null), [G, K] = M(!1), [q, J] = M(!1), [Y, X] = M(null);
|
|
65
65
|
j(() => {
|
|
66
|
-
!t || !
|
|
67
|
-
code:
|
|
68
|
-
name:
|
|
69
|
-
type:
|
|
70
|
-
status:
|
|
71
|
-
street:
|
|
72
|
-
city:
|
|
73
|
-
state:
|
|
74
|
-
postalCode:
|
|
75
|
-
country:
|
|
76
|
-
totalCapacity:
|
|
77
|
-
usedCapacity:
|
|
78
|
-
contactEmail:
|
|
79
|
-
contactPhone:
|
|
66
|
+
!t || !O || F({
|
|
67
|
+
code: O.code || "",
|
|
68
|
+
name: O.name || "",
|
|
69
|
+
type: O.type ? O.type.toUpperCase() : "DISTRIBUTION",
|
|
70
|
+
status: O.status ?? "",
|
|
71
|
+
street: O.address.street ?? "",
|
|
72
|
+
city: O.address.city ?? "",
|
|
73
|
+
state: O.address.state ?? "",
|
|
74
|
+
postalCode: O.address.postalCode ?? "",
|
|
75
|
+
country: O.address.country ?? "",
|
|
76
|
+
totalCapacity: O.capacity.totalSpace === void 0 ? "" : String(O.capacity.totalSpace),
|
|
77
|
+
usedCapacity: O.capacity.usedSpace === void 0 ? "" : String(O.capacity.usedSpace),
|
|
78
|
+
contactEmail: O.contactInfo?.email || "",
|
|
79
|
+
contactPhone: O.contactInfo?.phone || ""
|
|
80
80
|
});
|
|
81
|
-
}, [t,
|
|
82
|
-
let Z = () =>
|
|
81
|
+
}, [t, O]);
|
|
82
|
+
let Z = () => u?.(c(a, "inventory/warehouses")), Q = (e, t) => F((n) => ({
|
|
83
83
|
...n,
|
|
84
84
|
[e]: t
|
|
85
85
|
})), $ = async (e) => {
|
|
86
86
|
if (e.preventDefault(), !P.code.trim() || !P.name.trim()) {
|
|
87
|
-
|
|
87
|
+
W("Warehouse code and name are required.");
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
if (!P.street.trim() || !P.city.trim()) {
|
|
91
|
-
|
|
91
|
+
W("A street and city are required for the warehouse address.");
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
H(!0), W(null);
|
|
95
95
|
try {
|
|
96
96
|
let e = P.totalCapacity.trim() ? Number(P.totalCapacity) : void 0, r = P.usedCapacity.trim() ? Number(P.usedCapacity) : void 0, i = Object.fromEntries(Object.entries({
|
|
97
97
|
street: P.street.trim(),
|
|
@@ -112,27 +112,27 @@ function W({ editId: t, onSaved: n }) {
|
|
|
112
112
|
totalCapacity: e !== void 0 && !Number.isNaN(e) ? e : void 0,
|
|
113
113
|
usedCapacity: r !== void 0 && !Number.isNaN(r) ? r : void 0
|
|
114
114
|
};
|
|
115
|
-
if (t) await
|
|
115
|
+
if (t) await x(t, o), await n?.(), u?.(c(a, `inventory/warehouses/${t}`));
|
|
116
116
|
else {
|
|
117
|
-
let e = await
|
|
118
|
-
|
|
117
|
+
let e = await p(o);
|
|
118
|
+
u?.(c(a, `inventory/warehouses/${e.id}`));
|
|
119
119
|
}
|
|
120
120
|
} catch (e) {
|
|
121
|
-
console.error("Failed to create warehouse:", e),
|
|
121
|
+
console.error("Failed to create warehouse:", e), W(e instanceof Error ? e.message : "Failed to create warehouse. Please try again."), H(!1);
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
return /* @__PURE__ */ L(
|
|
124
|
+
return /* @__PURE__ */ L(k, {
|
|
125
125
|
title: N ? "Edit Warehouse" : "Add Warehouse",
|
|
126
126
|
subtitle: "Register a storage and fulfilment site",
|
|
127
127
|
icon: /* @__PURE__ */ I(s, { size: 24 }),
|
|
128
128
|
headerActions: /* @__PURE__ */ L("div", {
|
|
129
129
|
className: "flex gap-2",
|
|
130
|
-
children: [/* @__PURE__ */ L(
|
|
130
|
+
children: [/* @__PURE__ */ L(m, {
|
|
131
131
|
variant: "outline",
|
|
132
132
|
onClick: Z,
|
|
133
133
|
disabled: z,
|
|
134
134
|
children: [/* @__PURE__ */ I(e, { size: 16 }), " Cancel"]
|
|
135
|
-
}), /* @__PURE__ */ L(
|
|
135
|
+
}), /* @__PURE__ */ L(m, {
|
|
136
136
|
onClick: $,
|
|
137
137
|
disabled: z,
|
|
138
138
|
children: [
|
|
@@ -151,7 +151,7 @@ function W({ editId: t, onSaved: n }) {
|
|
|
151
151
|
onSubmit: $,
|
|
152
152
|
className: "max-w-2xl space-y-6",
|
|
153
153
|
children: [
|
|
154
|
-
/* @__PURE__ */ I(
|
|
154
|
+
/* @__PURE__ */ I(A, { message: U }),
|
|
155
155
|
/* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
|
|
156
156
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
157
157
|
children: "Warehouse Details"
|
|
@@ -163,13 +163,13 @@ function W({ editId: t, onSaved: n }) {
|
|
|
163
163
|
children: [
|
|
164
164
|
/* @__PURE__ */ L("div", {
|
|
165
165
|
className: "space-y-2",
|
|
166
|
-
children: [/* @__PURE__ */ L(
|
|
166
|
+
children: [/* @__PURE__ */ L(b, {
|
|
167
167
|
htmlFor: "code",
|
|
168
168
|
children: ["Code ", /* @__PURE__ */ I("span", {
|
|
169
169
|
className: "text-status-error-text",
|
|
170
170
|
children: "*"
|
|
171
171
|
})]
|
|
172
|
-
}), /* @__PURE__ */ I(
|
|
172
|
+
}), /* @__PURE__ */ I(y, {
|
|
173
173
|
id: "code",
|
|
174
174
|
value: P.code,
|
|
175
175
|
onChange: (e) => Q("code", e.target.value),
|
|
@@ -179,13 +179,13 @@ function W({ editId: t, onSaved: n }) {
|
|
|
179
179
|
}),
|
|
180
180
|
/* @__PURE__ */ L("div", {
|
|
181
181
|
className: "space-y-2",
|
|
182
|
-
children: [/* @__PURE__ */ L(
|
|
182
|
+
children: [/* @__PURE__ */ L(b, {
|
|
183
183
|
htmlFor: "name",
|
|
184
184
|
children: ["Name ", /* @__PURE__ */ I("span", {
|
|
185
185
|
className: "text-status-error-text",
|
|
186
186
|
children: "*"
|
|
187
187
|
})]
|
|
188
|
-
}), /* @__PURE__ */ I(
|
|
188
|
+
}), /* @__PURE__ */ I(y, {
|
|
189
189
|
id: "name",
|
|
190
190
|
value: P.name,
|
|
191
191
|
onChange: (e) => Q("name", e.target.value),
|
|
@@ -195,19 +195,19 @@ function W({ editId: t, onSaved: n }) {
|
|
|
195
195
|
}),
|
|
196
196
|
/* @__PURE__ */ L("div", {
|
|
197
197
|
className: "space-y-2",
|
|
198
|
-
children: [/* @__PURE__ */ L(
|
|
198
|
+
children: [/* @__PURE__ */ L(b, {
|
|
199
199
|
htmlFor: "type",
|
|
200
200
|
children: ["Type ", /* @__PURE__ */ I("span", {
|
|
201
201
|
className: "text-status-error-text",
|
|
202
202
|
children: "*"
|
|
203
203
|
})]
|
|
204
|
-
}), /* @__PURE__ */ L(
|
|
204
|
+
}), /* @__PURE__ */ L(S, {
|
|
205
205
|
value: P.type,
|
|
206
206
|
onValueChange: (e) => Q("type", e),
|
|
207
|
-
children: [/* @__PURE__ */ I(
|
|
207
|
+
children: [/* @__PURE__ */ I(T, {
|
|
208
208
|
id: "type",
|
|
209
|
-
children: /* @__PURE__ */ I(
|
|
210
|
-
}), /* @__PURE__ */ I(
|
|
209
|
+
children: /* @__PURE__ */ I(E, {})
|
|
210
|
+
}), /* @__PURE__ */ I(C, { children: ae.map((e) => /* @__PURE__ */ I(w, {
|
|
211
211
|
value: e.value,
|
|
212
212
|
children: e.label
|
|
213
213
|
}, e.value)) })]
|
|
@@ -220,16 +220,16 @@ function W({ editId: t, onSaved: n }) {
|
|
|
220
220
|
children: [
|
|
221
221
|
/* @__PURE__ */ L("div", {
|
|
222
222
|
className: "space-y-2",
|
|
223
|
-
children: [/* @__PURE__ */ I(
|
|
223
|
+
children: [/* @__PURE__ */ I(b, {
|
|
224
224
|
htmlFor: "status",
|
|
225
225
|
children: "Status"
|
|
226
|
-
}), /* @__PURE__ */ L(
|
|
226
|
+
}), /* @__PURE__ */ L(S, {
|
|
227
227
|
value: P.status,
|
|
228
228
|
onValueChange: (e) => Q("status", e),
|
|
229
|
-
children: [/* @__PURE__ */ I(
|
|
229
|
+
children: [/* @__PURE__ */ I(T, {
|
|
230
230
|
id: "status",
|
|
231
|
-
children: /* @__PURE__ */ I(
|
|
232
|
-
}), /* @__PURE__ */ I(
|
|
231
|
+
children: /* @__PURE__ */ I(E, {})
|
|
232
|
+
}), /* @__PURE__ */ I(C, { children: oe.map((e) => /* @__PURE__ */ I(w, {
|
|
233
233
|
value: e.value,
|
|
234
234
|
children: e.label
|
|
235
235
|
}, e.value)) })]
|
|
@@ -237,10 +237,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
237
237
|
}),
|
|
238
238
|
/* @__PURE__ */ L("div", {
|
|
239
239
|
className: "space-y-2",
|
|
240
|
-
children: [/* @__PURE__ */ I(
|
|
240
|
+
children: [/* @__PURE__ */ I(b, {
|
|
241
241
|
htmlFor: "totalCapacity",
|
|
242
242
|
children: "Total Capacity (sq ft)"
|
|
243
|
-
}), /* @__PURE__ */ I(
|
|
243
|
+
}), /* @__PURE__ */ I(y, {
|
|
244
244
|
id: "totalCapacity",
|
|
245
245
|
type: "number",
|
|
246
246
|
min: "0",
|
|
@@ -251,10 +251,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
251
251
|
}),
|
|
252
252
|
/* @__PURE__ */ L("div", {
|
|
253
253
|
className: "space-y-2",
|
|
254
|
-
children: [/* @__PURE__ */ I(
|
|
254
|
+
children: [/* @__PURE__ */ I(b, {
|
|
255
255
|
htmlFor: "usedCapacity",
|
|
256
256
|
children: "Used Capacity (sq ft)"
|
|
257
|
-
}), /* @__PURE__ */ I(
|
|
257
|
+
}), /* @__PURE__ */ I(y, {
|
|
258
258
|
id: "usedCapacity",
|
|
259
259
|
type: "number",
|
|
260
260
|
min: "0",
|
|
@@ -269,10 +269,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
269
269
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
270
270
|
children: [/* @__PURE__ */ L("div", {
|
|
271
271
|
className: "space-y-2",
|
|
272
|
-
children: [/* @__PURE__ */ I(
|
|
272
|
+
children: [/* @__PURE__ */ I(b, {
|
|
273
273
|
htmlFor: "contactEmail",
|
|
274
274
|
children: "Contact Email"
|
|
275
|
-
}), /* @__PURE__ */ I(
|
|
275
|
+
}), /* @__PURE__ */ I(y, {
|
|
276
276
|
id: "contactEmail",
|
|
277
277
|
type: "email",
|
|
278
278
|
value: P.contactEmail,
|
|
@@ -281,10 +281,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
281
281
|
})]
|
|
282
282
|
}), /* @__PURE__ */ L("div", {
|
|
283
283
|
className: "space-y-2",
|
|
284
|
-
children: [/* @__PURE__ */ I(
|
|
284
|
+
children: [/* @__PURE__ */ I(b, {
|
|
285
285
|
htmlFor: "contactPhone",
|
|
286
286
|
children: "Contact Phone"
|
|
287
|
-
}), /* @__PURE__ */ I(
|
|
287
|
+
}), /* @__PURE__ */ I(y, {
|
|
288
288
|
id: "contactPhone",
|
|
289
289
|
value: P.contactPhone,
|
|
290
290
|
onChange: (e) => Q("contactPhone", e.target.value),
|
|
@@ -294,7 +294,7 @@ function W({ editId: t, onSaved: n }) {
|
|
|
294
294
|
})
|
|
295
295
|
]
|
|
296
296
|
})] }),
|
|
297
|
-
/* @__PURE__ */ L(
|
|
297
|
+
/* @__PURE__ */ L(h, { children: [/* @__PURE__ */ I(_, { children: /* @__PURE__ */ L(v, {
|
|
298
298
|
className: "flex items-center gap-2",
|
|
299
299
|
children: [
|
|
300
300
|
/* @__PURE__ */ I(r, { size: 18 }),
|
|
@@ -304,15 +304,15 @@ function W({ editId: t, onSaved: n }) {
|
|
|
304
304
|
children: "*"
|
|
305
305
|
})
|
|
306
306
|
]
|
|
307
|
-
}) }), /* @__PURE__ */ L(
|
|
307
|
+
}) }), /* @__PURE__ */ L(g, {
|
|
308
308
|
className: "space-y-4",
|
|
309
309
|
children: [
|
|
310
310
|
/* @__PURE__ */ L("div", {
|
|
311
311
|
className: "space-y-2",
|
|
312
|
-
children: [/* @__PURE__ */ I(
|
|
312
|
+
children: [/* @__PURE__ */ I(b, {
|
|
313
313
|
htmlFor: "street",
|
|
314
314
|
children: "Street"
|
|
315
|
-
}), /* @__PURE__ */ I(
|
|
315
|
+
}), /* @__PURE__ */ I(y, {
|
|
316
316
|
id: "street",
|
|
317
317
|
value: P.street,
|
|
318
318
|
onChange: (e) => Q("street", e.target.value),
|
|
@@ -323,10 +323,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
323
323
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
324
324
|
children: [/* @__PURE__ */ L("div", {
|
|
325
325
|
className: "space-y-2",
|
|
326
|
-
children: [/* @__PURE__ */ I(
|
|
326
|
+
children: [/* @__PURE__ */ I(b, {
|
|
327
327
|
htmlFor: "city",
|
|
328
328
|
children: "City"
|
|
329
|
-
}), /* @__PURE__ */ I(
|
|
329
|
+
}), /* @__PURE__ */ I(y, {
|
|
330
330
|
id: "city",
|
|
331
331
|
value: P.city,
|
|
332
332
|
onChange: (e) => Q("city", e.target.value),
|
|
@@ -334,10 +334,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
334
334
|
})]
|
|
335
335
|
}), /* @__PURE__ */ L("div", {
|
|
336
336
|
className: "space-y-2",
|
|
337
|
-
children: [/* @__PURE__ */ I(
|
|
337
|
+
children: [/* @__PURE__ */ I(b, {
|
|
338
338
|
htmlFor: "state",
|
|
339
339
|
children: "State"
|
|
340
|
-
}), /* @__PURE__ */ I(
|
|
340
|
+
}), /* @__PURE__ */ I(y, {
|
|
341
341
|
id: "state",
|
|
342
342
|
value: P.state,
|
|
343
343
|
onChange: (e) => Q("state", e.target.value),
|
|
@@ -349,10 +349,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
349
349
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
350
350
|
children: [/* @__PURE__ */ L("div", {
|
|
351
351
|
className: "space-y-2",
|
|
352
|
-
children: [/* @__PURE__ */ I(
|
|
352
|
+
children: [/* @__PURE__ */ I(b, {
|
|
353
353
|
htmlFor: "postalCode",
|
|
354
354
|
children: "ZIP / Postal Code"
|
|
355
|
-
}), /* @__PURE__ */ I(
|
|
355
|
+
}), /* @__PURE__ */ I(y, {
|
|
356
356
|
id: "postalCode",
|
|
357
357
|
value: P.postalCode,
|
|
358
358
|
onChange: (e) => Q("postalCode", e.target.value),
|
|
@@ -360,10 +360,10 @@ function W({ editId: t, onSaved: n }) {
|
|
|
360
360
|
})]
|
|
361
361
|
}), /* @__PURE__ */ L("div", {
|
|
362
362
|
className: "space-y-2",
|
|
363
|
-
children: [/* @__PURE__ */ I(
|
|
363
|
+
children: [/* @__PURE__ */ I(b, {
|
|
364
364
|
htmlFor: "country",
|
|
365
365
|
children: "Country"
|
|
366
|
-
}), /* @__PURE__ */ I(
|
|
366
|
+
}), /* @__PURE__ */ I(y, {
|
|
367
367
|
id: "country",
|
|
368
368
|
value: P.country,
|
|
369
369
|
onChange: (e) => Q("country", e.target.value),
|
|
@@ -373,99 +373,99 @@ function W({ editId: t, onSaved: n }) {
|
|
|
373
373
|
})
|
|
374
374
|
]
|
|
375
375
|
})] }),
|
|
376
|
-
N && /* @__PURE__ */ L(
|
|
376
|
+
N && /* @__PURE__ */ L(h, {
|
|
377
377
|
className: "border-status-error-border",
|
|
378
|
-
children: [/* @__PURE__ */ I(
|
|
378
|
+
children: [/* @__PURE__ */ I(_, { children: /* @__PURE__ */ L(v, {
|
|
379
379
|
className: "flex items-center gap-2 text-status-error-text",
|
|
380
380
|
children: [/* @__PURE__ */ I(o, { size: 18 }), " Delete Warehouse"]
|
|
381
|
-
}) }), /* @__PURE__ */ L(
|
|
381
|
+
}) }), /* @__PURE__ */ L(g, { children: [/* @__PURE__ */ I("p", {
|
|
382
382
|
className: "mb-3 text-sm text-text-secondary",
|
|
383
383
|
children: "Removes this warehouse from your network. This cannot be undone from here."
|
|
384
|
-
}), /* @__PURE__ */ L(
|
|
384
|
+
}), /* @__PURE__ */ L(m, {
|
|
385
385
|
type: "button",
|
|
386
386
|
variant: "outline",
|
|
387
387
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
388
|
-
onClick: () =>
|
|
388
|
+
onClick: () => K(!0),
|
|
389
389
|
children: [/* @__PURE__ */ I(o, { size: 16 }), " Delete this warehouse"]
|
|
390
390
|
})] })]
|
|
391
391
|
})
|
|
392
392
|
]
|
|
393
393
|
}),
|
|
394
|
-
/* @__PURE__ */ I(
|
|
395
|
-
open:
|
|
396
|
-
onOpenChange:
|
|
397
|
-
children: /* @__PURE__ */ L(
|
|
398
|
-
/* @__PURE__ */ L(
|
|
394
|
+
/* @__PURE__ */ I(ee, {
|
|
395
|
+
open: G,
|
|
396
|
+
onOpenChange: K,
|
|
397
|
+
children: /* @__PURE__ */ L(te, { children: [
|
|
398
|
+
/* @__PURE__ */ L(re, { children: [/* @__PURE__ */ I(ie, { children: "Delete this warehouse?" }), /* @__PURE__ */ L(ne, { children: [
|
|
399
399
|
"This removes ",
|
|
400
400
|
P.name || "this warehouse",
|
|
401
401
|
" and cannot be undone from here."
|
|
402
402
|
] })] }),
|
|
403
403
|
/* @__PURE__ */ I("div", {
|
|
404
404
|
className: "px-1",
|
|
405
|
-
children: /* @__PURE__ */ I(
|
|
405
|
+
children: /* @__PURE__ */ I(A, { message: Y })
|
|
406
406
|
}),
|
|
407
|
-
/* @__PURE__ */ L(
|
|
407
|
+
/* @__PURE__ */ L(V, { children: [/* @__PURE__ */ I(m, {
|
|
408
408
|
variant: "outline",
|
|
409
|
-
onClick: () =>
|
|
410
|
-
disabled:
|
|
409
|
+
onClick: () => K(!1),
|
|
410
|
+
disabled: q,
|
|
411
411
|
children: "Cancel"
|
|
412
|
-
}), /* @__PURE__ */ I(
|
|
412
|
+
}), /* @__PURE__ */ I(m, {
|
|
413
413
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
414
414
|
onClick: async () => {
|
|
415
415
|
if (t) {
|
|
416
|
-
|
|
416
|
+
J(!0), X(null);
|
|
417
417
|
try {
|
|
418
|
-
await D(t),
|
|
418
|
+
await D(t), K(!1), Z();
|
|
419
419
|
} catch (e) {
|
|
420
|
-
X(e instanceof Error ? e.message : "Failed to delete warehouse."),
|
|
420
|
+
X(e instanceof Error ? e.message : "Failed to delete warehouse."), J(!1);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
},
|
|
424
|
-
disabled:
|
|
425
|
-
children:
|
|
424
|
+
disabled: q,
|
|
425
|
+
children: q ? "Deleting..." : "Delete warehouse"
|
|
426
426
|
})] })
|
|
427
427
|
] })
|
|
428
428
|
})
|
|
429
429
|
]
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
let { warehouseId: i } = P(), { basePath: o, navigate:
|
|
434
|
-
if (!i) return /* @__PURE__ */ I(
|
|
435
|
-
if (
|
|
432
|
+
function U() {
|
|
433
|
+
let { warehouseId: i } = P(), { basePath: o, navigate: d } = l(), y = N().pathname.endsWith("/edit"), { warehouse: b, isLoading: S, error: C, refetch: w, reload: T } = f(i), E = () => d?.(c(o, "inventory/warehouses")), A = (e) => d?.(c(o, e));
|
|
434
|
+
if (!i) return /* @__PURE__ */ I(H, {});
|
|
435
|
+
if (y) return /* @__PURE__ */ I(H, {
|
|
436
436
|
editId: i,
|
|
437
|
-
onSaved:
|
|
437
|
+
onSaved: T
|
|
438
438
|
});
|
|
439
|
-
if (
|
|
440
|
-
if (
|
|
439
|
+
if (S) return /* @__PURE__ */ I(O, { message: "Loading warehouse details..." });
|
|
440
|
+
if (C || !b) return /* @__PURE__ */ I(D, {
|
|
441
441
|
title: "Warehouse not found",
|
|
442
|
-
onRetry:
|
|
442
|
+
onRetry: w
|
|
443
443
|
});
|
|
444
|
-
let j =
|
|
445
|
-
return /* @__PURE__ */ L(
|
|
446
|
-
title:
|
|
447
|
-
subtitle: `Code: ${
|
|
444
|
+
let j = b.status?.toUpperCase() === "ACTIVE";
|
|
445
|
+
return /* @__PURE__ */ L(k, {
|
|
446
|
+
title: b.name,
|
|
447
|
+
subtitle: `Code: ${b.code}`,
|
|
448
448
|
icon: /* @__PURE__ */ I(s, { size: 24 }),
|
|
449
449
|
headerActions: /* @__PURE__ */ L("div", {
|
|
450
450
|
className: "flex gap-2",
|
|
451
|
-
children: [/* @__PURE__ */ L(
|
|
451
|
+
children: [/* @__PURE__ */ L(m, {
|
|
452
452
|
variant: "outline",
|
|
453
|
-
onClick:
|
|
453
|
+
onClick: E,
|
|
454
454
|
children: [/* @__PURE__ */ I(e, { size: 16 }), " Back"]
|
|
455
|
-
}), /* @__PURE__ */ L(
|
|
456
|
-
onClick: () =>
|
|
455
|
+
}), /* @__PURE__ */ L(m, {
|
|
456
|
+
onClick: () => d?.(c(o, `inventory/warehouses/${i}/edit`)),
|
|
457
457
|
children: [/* @__PURE__ */ I(a, { size: 16 }), " Edit"]
|
|
458
458
|
})]
|
|
459
459
|
}),
|
|
460
460
|
headerContent: /* @__PURE__ */ L("div", {
|
|
461
461
|
className: "flex gap-2",
|
|
462
|
-
children: [/* @__PURE__ */ I(
|
|
463
|
-
variant:
|
|
464
|
-
children:
|
|
465
|
-
}), /* @__PURE__ */ I(
|
|
462
|
+
children: [/* @__PURE__ */ I(p, {
|
|
463
|
+
variant: b.status ? j ? "default" : "secondary" : "outline",
|
|
464
|
+
children: b.status ? j ? "Active" : "Inactive" : "Not provided"
|
|
465
|
+
}), /* @__PURE__ */ I(p, {
|
|
466
466
|
variant: "outline",
|
|
467
467
|
className: "capitalize",
|
|
468
|
-
children:
|
|
468
|
+
children: b.type.replace("_", " ")
|
|
469
469
|
})]
|
|
470
470
|
}),
|
|
471
471
|
children: [
|
|
@@ -480,13 +480,13 @@ function G() {
|
|
|
480
480
|
label: "Review stock here",
|
|
481
481
|
description: "See which products are stored at this site.",
|
|
482
482
|
icon: /* @__PURE__ */ I(t, { size: 16 }),
|
|
483
|
-
onClick: () =>
|
|
483
|
+
onClick: () => A("inventory/products")
|
|
484
484
|
}, {
|
|
485
485
|
id: "fulfil",
|
|
486
486
|
label: "Fulfil an order from this site",
|
|
487
487
|
description: "Pick a pending order to ship out of this warehouse.",
|
|
488
488
|
icon: /* @__PURE__ */ I(r, { size: 16 }),
|
|
489
|
-
onClick: () =>
|
|
489
|
+
onClick: () => A("orders")
|
|
490
490
|
}]
|
|
491
491
|
}),
|
|
492
492
|
/* @__PURE__ */ L("div", {
|
|
@@ -496,31 +496,31 @@ function G() {
|
|
|
496
496
|
children: [/* @__PURE__ */ L(R, { children: [/* @__PURE__ */ L("h2", {
|
|
497
497
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
498
498
|
children: [/* @__PURE__ */ I(t, { size: 18 }), " Capacity"]
|
|
499
|
-
}), /* @__PURE__ */ I("div", { children:
|
|
499
|
+
}), /* @__PURE__ */ I("div", { children: b.utilization !== void 0 && b.capacity.usedSpace !== void 0 && b.capacity.totalSpace !== void 0 ? /* @__PURE__ */ L(F, { children: [
|
|
500
500
|
/* @__PURE__ */ L("div", {
|
|
501
501
|
className: "flex justify-between text-sm mb-2",
|
|
502
|
-
children: [/* @__PURE__ */ I("span", { children: "Space Utilization" }), /* @__PURE__ */ L("span", { children: [
|
|
502
|
+
children: [/* @__PURE__ */ I("span", { children: "Space Utilization" }), /* @__PURE__ */ L("span", { children: [b.utilization.toFixed(0), "%"] })]
|
|
503
503
|
}),
|
|
504
|
-
/* @__PURE__ */ I(
|
|
504
|
+
/* @__PURE__ */ I(x, { value: b.utilization }),
|
|
505
505
|
/* @__PURE__ */ L("p", {
|
|
506
506
|
className: "text-sm text-text-secondary mt-1",
|
|
507
507
|
children: [
|
|
508
|
-
|
|
508
|
+
b.capacity.usedSpace.toLocaleString(),
|
|
509
509
|
" /",
|
|
510
510
|
" ",
|
|
511
|
-
|
|
511
|
+
b.capacity.totalSpace.toLocaleString(),
|
|
512
512
|
" sq ft"
|
|
513
513
|
]
|
|
514
514
|
})
|
|
515
515
|
] }) : /* @__PURE__ */ I("p", {
|
|
516
516
|
className: "text-sm text-text-secondary",
|
|
517
517
|
children: "Not provided"
|
|
518
|
-
}) })] }), /* @__PURE__ */ L(
|
|
518
|
+
}) })] }), /* @__PURE__ */ L(h, { children: [/* @__PURE__ */ I(_, { children: /* @__PURE__ */ L(v, {
|
|
519
519
|
className: "flex items-center gap-2",
|
|
520
520
|
children: [/* @__PURE__ */ I(n, { size: 18 }), " Operating Hours"]
|
|
521
|
-
}) }), /* @__PURE__ */ I(
|
|
521
|
+
}) }), /* @__PURE__ */ I(g, { children: Object.keys(b.operatingHours).length > 0 ? /* @__PURE__ */ I("div", {
|
|
522
522
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
523
|
-
children: Object.entries(
|
|
523
|
+
children: Object.entries(b.operatingHours).map(([e, t]) => /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
524
524
|
className: "text-sm font-medium",
|
|
525
525
|
children: e
|
|
526
526
|
}), /* @__PURE__ */ I("p", {
|
|
@@ -533,26 +533,26 @@ function G() {
|
|
|
533
533
|
}) })] })]
|
|
534
534
|
}), /* @__PURE__ */ L("div", {
|
|
535
535
|
className: "space-y-6",
|
|
536
|
-
children: [/* @__PURE__ */ L(
|
|
536
|
+
children: [/* @__PURE__ */ L(h, { children: [/* @__PURE__ */ I(_, { children: /* @__PURE__ */ L(v, {
|
|
537
537
|
className: "flex items-center gap-2",
|
|
538
538
|
children: [/* @__PURE__ */ I(r, { size: 18 }), " Location"]
|
|
539
|
-
}) }), /* @__PURE__ */ I(
|
|
539
|
+
}) }), /* @__PURE__ */ I(g, { children: /* @__PURE__ */ I("p", {
|
|
540
540
|
className: "text-sm",
|
|
541
|
-
children:
|
|
542
|
-
}) })] }), (
|
|
541
|
+
children: u(b.address) || "—"
|
|
542
|
+
}) })] }), (b.contactInfo?.email || b.contactInfo?.phone) && /* @__PURE__ */ L(h, { children: [/* @__PURE__ */ I(_, { children: /* @__PURE__ */ I(v, { children: "Contact" }) }), /* @__PURE__ */ L(g, {
|
|
543
543
|
className: "space-y-3",
|
|
544
|
-
children: [
|
|
544
|
+
children: [b.contactInfo?.email && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
545
545
|
className: "text-sm text-text-secondary",
|
|
546
546
|
children: "Email"
|
|
547
547
|
}), /* @__PURE__ */ I("p", {
|
|
548
548
|
className: "font-medium",
|
|
549
|
-
children:
|
|
550
|
-
})] }),
|
|
549
|
+
children: b.contactInfo.email
|
|
550
|
+
})] }), b.contactInfo?.phone && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
551
551
|
className: "text-sm text-text-secondary",
|
|
552
552
|
children: "Phone"
|
|
553
553
|
}), /* @__PURE__ */ I("p", {
|
|
554
554
|
className: "font-medium",
|
|
555
|
-
children:
|
|
555
|
+
children: b.contactInfo.phone
|
|
556
556
|
})] })]
|
|
557
557
|
})] })]
|
|
558
558
|
})]
|
|
@@ -561,4 +561,4 @@ function G() {
|
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
|
-
export {
|
|
564
|
+
export { U as default };
|