@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.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 +2719 -8
- package/dist/hooks/index.js +1 -1
- 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 +148 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +139 -134
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/index.js +6 -6
- 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 +48 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +12 -5
- package/dist/pages/CreateOrderPage.js +191 -129
- 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 +190 -106
- 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 +324 -293
- 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 +3136 -8
- 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 +66 -38
- 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 +48 -14
- package/src/movethewheels/hooks/useRoutes.ts +81 -24
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
- 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 +91 -6
- 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 +45 -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 +12 -5
|
@@ -1,135 +1,137 @@
|
|
|
1
1
|
import { ArrowLeft as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
2
2
|
import { Box as t } from "../node_modules/lucide-react/dist/esm/icons/box.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
3
|
+
import { ChevronLeft as n } from "../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
4
|
+
import { ChevronRight as r } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
5
|
+
import { DollarSign as i } from "../node_modules/lucide-react/dist/esm/icons/dollar-sign.js";
|
|
6
|
+
import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
7
|
+
import { Save as o } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
8
|
+
import { SquarePen as s } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
9
|
+
import { Tag as c } from "../node_modules/lucide-react/dist/esm/icons/tag.js";
|
|
10
|
+
import { Warehouse as l } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
11
|
+
import { joinPath as u } from "../utils/navigation.js";
|
|
12
|
+
import { useMoveTheWheels as d } from "../providers/MoveTheWheelsProvider.js";
|
|
13
|
+
import { useInventory as f, useProduct as p, useProductStockLevels as m } from "../hooks/useInventory.js";
|
|
14
|
+
import { Badge as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S } from "../components/ui.js";
|
|
15
|
+
import { ErrorState as C, LoadingState as w, PageLayout as T } from "../components/PageLayout.js";
|
|
16
|
+
import { FormError as E } from "../components/FormError.js";
|
|
17
|
+
import { formatCurrency as D } from "../utils/formatters.js";
|
|
18
|
+
import { useEffect as O, useState as k } from "react";
|
|
19
|
+
import { useLocation as A, useParams as j } from "react-router";
|
|
20
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
21
|
+
import { EmphasisPanel as F, NextSteps as I, PagePurpose as L } from "@burdenoff/fe-libs/ui";
|
|
20
22
|
//#region src/movethewheels/pages/ProductDetailsPage.tsx
|
|
21
|
-
function
|
|
22
|
-
let { basePath: n, navigate:
|
|
23
|
+
function R({ editId: t }) {
|
|
24
|
+
let { basePath: n, navigate: r } = d(), { createProduct: i, updateProduct: s } = f(), { product: c } = p(t), l = !!t, [m, h] = k({
|
|
23
25
|
name: "",
|
|
24
26
|
sku: "",
|
|
25
27
|
category: "",
|
|
26
28
|
brand: "",
|
|
27
29
|
weight: ""
|
|
28
|
-
}), [_, v] =
|
|
29
|
-
|
|
30
|
-
t &&
|
|
31
|
-
name:
|
|
32
|
-
sku:
|
|
33
|
-
category:
|
|
34
|
-
brand:
|
|
35
|
-
weight:
|
|
30
|
+
}), [_, v] = k(!1), [y, b] = k(null);
|
|
31
|
+
O(() => {
|
|
32
|
+
t && c && h({
|
|
33
|
+
name: c.name ?? "",
|
|
34
|
+
sku: c.sku ?? "",
|
|
35
|
+
category: c.category ?? "",
|
|
36
|
+
brand: c.brand ?? "",
|
|
37
|
+
weight: c.weight == null ? "" : String(c.weight)
|
|
36
38
|
});
|
|
37
|
-
}, [t,
|
|
38
|
-
let
|
|
39
|
-
if (e.preventDefault(), !
|
|
40
|
-
|
|
39
|
+
}, [t, c]);
|
|
40
|
+
let C = () => r?.(u(n, "inventory/products")), w = async (e) => {
|
|
41
|
+
if (e.preventDefault(), !m.name.trim() || !m.sku.trim()) {
|
|
42
|
+
b("Product name and SKU are required.");
|
|
41
43
|
return;
|
|
42
44
|
}
|
|
43
|
-
v(!0),
|
|
45
|
+
v(!0), b(null);
|
|
44
46
|
try {
|
|
45
|
-
let e =
|
|
46
|
-
if (
|
|
47
|
-
let
|
|
48
|
-
name:
|
|
49
|
-
sku:
|
|
50
|
-
category:
|
|
51
|
-
brand:
|
|
47
|
+
let e = m.weight.trim() ? Number(m.weight) : void 0;
|
|
48
|
+
if (l && t) {
|
|
49
|
+
let i = await s(t, {
|
|
50
|
+
name: m.name.trim(),
|
|
51
|
+
sku: m.sku.trim(),
|
|
52
|
+
category: m.category.trim() || void 0,
|
|
53
|
+
brand: m.brand.trim() || void 0,
|
|
52
54
|
weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
53
55
|
});
|
|
54
|
-
|
|
56
|
+
r?.(u(n, `inventory/products/${i.id}`));
|
|
55
57
|
} else {
|
|
56
|
-
let t = await
|
|
57
|
-
name:
|
|
58
|
-
sku:
|
|
59
|
-
category:
|
|
60
|
-
brand:
|
|
58
|
+
let t = await i({
|
|
59
|
+
name: m.name.trim(),
|
|
60
|
+
sku: m.sku.trim(),
|
|
61
|
+
category: m.category.trim() || void 0,
|
|
62
|
+
brand: m.brand.trim() || void 0,
|
|
61
63
|
weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
r?.(u(n, `inventory/products/${t.id}`));
|
|
64
66
|
}
|
|
65
67
|
} catch (e) {
|
|
66
|
-
console.error("Failed to create product:", e),
|
|
68
|
+
console.error("Failed to create product:", e), b(e instanceof Error ? e.message : "Failed to create product. Please try again."), v(!1);
|
|
67
69
|
}
|
|
68
70
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
title:
|
|
71
|
+
return /* @__PURE__ */ P(T, {
|
|
72
|
+
title: l ? "Edit Product" : "Add Product",
|
|
71
73
|
subtitle: "Add an item to your catalog",
|
|
72
|
-
icon: /* @__PURE__ */
|
|
73
|
-
headerActions: /* @__PURE__ */
|
|
74
|
+
icon: /* @__PURE__ */ N(a, { size: 24 }),
|
|
75
|
+
headerActions: /* @__PURE__ */ P("div", {
|
|
74
76
|
className: "flex gap-2",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
77
|
+
children: [/* @__PURE__ */ P(g, {
|
|
76
78
|
variant: "outline",
|
|
77
|
-
onClick:
|
|
79
|
+
onClick: C,
|
|
78
80
|
disabled: _,
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
-
}), /* @__PURE__ */
|
|
81
|
-
onClick:
|
|
81
|
+
children: [/* @__PURE__ */ N(e, { size: 16 }), " Cancel"]
|
|
82
|
+
}), /* @__PURE__ */ P(g, {
|
|
83
|
+
onClick: w,
|
|
82
84
|
disabled: _,
|
|
83
85
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ N(o, { size: 16 }),
|
|
85
87
|
" ",
|
|
86
|
-
|
|
88
|
+
l ? _ ? "Saving..." : "Save Changes" : _ ? "Saving..." : "Add Product"
|
|
87
89
|
]
|
|
88
90
|
})]
|
|
89
91
|
}),
|
|
90
|
-
children: [/* @__PURE__ */
|
|
91
|
-
icon: /* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ N(L, {
|
|
93
|
+
icon: /* @__PURE__ */ N(a, { size: 18 }),
|
|
92
94
|
children: "Add a product so it can be added to orders and stocked in warehouses. A name and SKU are all it takes to start — category, brand and weight help with picking, pricing and routing."
|
|
93
|
-
}), /* @__PURE__ */
|
|
94
|
-
onSubmit:
|
|
95
|
+
}), /* @__PURE__ */ P("form", {
|
|
96
|
+
onSubmit: w,
|
|
95
97
|
className: "max-w-2xl space-y-6",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ N(E, { message: y }), /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("h2", {
|
|
97
99
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
98
100
|
children: "Product Details"
|
|
99
|
-
}), /* @__PURE__ */
|
|
101
|
+
}), /* @__PURE__ */ P("div", {
|
|
100
102
|
className: "space-y-4",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ P("div", {
|
|
102
104
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
105
|
+
children: [/* @__PURE__ */ P("div", {
|
|
104
106
|
className: "space-y-2",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ P(S, {
|
|
106
108
|
htmlFor: "name",
|
|
107
|
-
children: ["Name ", /* @__PURE__ */
|
|
109
|
+
children: ["Name ", /* @__PURE__ */ N("span", {
|
|
108
110
|
className: "text-status-error-text",
|
|
109
111
|
children: "*"
|
|
110
112
|
})]
|
|
111
|
-
}), /* @__PURE__ */
|
|
113
|
+
}), /* @__PURE__ */ N(x, {
|
|
112
114
|
id: "name",
|
|
113
|
-
value:
|
|
114
|
-
onChange: (e) =>
|
|
115
|
+
value: m.name,
|
|
116
|
+
onChange: (e) => h((t) => ({
|
|
115
117
|
...t,
|
|
116
118
|
name: e.target.value
|
|
117
119
|
})),
|
|
118
120
|
placeholder: "Wireless Headphones",
|
|
119
121
|
required: !0
|
|
120
122
|
})]
|
|
121
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ P("div", {
|
|
122
124
|
className: "space-y-2",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ P(S, {
|
|
124
126
|
htmlFor: "sku",
|
|
125
|
-
children: ["SKU ", /* @__PURE__ */
|
|
127
|
+
children: ["SKU ", /* @__PURE__ */ N("span", {
|
|
126
128
|
className: "text-status-error-text",
|
|
127
129
|
children: "*"
|
|
128
130
|
})]
|
|
129
|
-
}), /* @__PURE__ */
|
|
131
|
+
}), /* @__PURE__ */ N(x, {
|
|
130
132
|
id: "sku",
|
|
131
|
-
value:
|
|
132
|
-
onChange: (e) =>
|
|
133
|
+
value: m.sku,
|
|
134
|
+
onChange: (e) => h((t) => ({
|
|
133
135
|
...t,
|
|
134
136
|
sku: e.target.value
|
|
135
137
|
})),
|
|
@@ -137,51 +139,51 @@ function I({ editId: t }) {
|
|
|
137
139
|
required: !0
|
|
138
140
|
})]
|
|
139
141
|
})]
|
|
140
|
-
}), /* @__PURE__ */
|
|
142
|
+
}), /* @__PURE__ */ P("div", {
|
|
141
143
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
142
144
|
children: [
|
|
143
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ P("div", {
|
|
144
146
|
className: "space-y-2",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ N(S, {
|
|
146
148
|
htmlFor: "category",
|
|
147
149
|
children: "Category"
|
|
148
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ N(x, {
|
|
149
151
|
id: "category",
|
|
150
|
-
value:
|
|
151
|
-
onChange: (e) =>
|
|
152
|
+
value: m.category,
|
|
153
|
+
onChange: (e) => h((t) => ({
|
|
152
154
|
...t,
|
|
153
155
|
category: e.target.value
|
|
154
156
|
})),
|
|
155
157
|
placeholder: "Electronics"
|
|
156
158
|
})]
|
|
157
159
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ P("div", {
|
|
159
161
|
className: "space-y-2",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ N(S, {
|
|
161
163
|
htmlFor: "brand",
|
|
162
164
|
children: "Brand"
|
|
163
|
-
}), /* @__PURE__ */
|
|
165
|
+
}), /* @__PURE__ */ N(x, {
|
|
164
166
|
id: "brand",
|
|
165
|
-
value:
|
|
166
|
-
onChange: (e) =>
|
|
167
|
+
value: m.brand,
|
|
168
|
+
onChange: (e) => h((t) => ({
|
|
167
169
|
...t,
|
|
168
170
|
brand: e.target.value
|
|
169
171
|
})),
|
|
170
172
|
placeholder: "Acme"
|
|
171
173
|
})]
|
|
172
174
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ P("div", {
|
|
174
176
|
className: "space-y-2",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ N(S, {
|
|
176
178
|
htmlFor: "weight",
|
|
177
179
|
children: "Weight (kg)"
|
|
178
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ N(x, {
|
|
179
181
|
id: "weight",
|
|
180
182
|
type: "number",
|
|
181
183
|
min: "0",
|
|
182
184
|
step: "0.01",
|
|
183
|
-
value:
|
|
184
|
-
onChange: (e) =>
|
|
185
|
+
value: m.weight,
|
|
186
|
+
onChange: (e) => h((t) => ({
|
|
185
187
|
...t,
|
|
186
188
|
weight: e.target.value
|
|
187
189
|
})),
|
|
@@ -194,230 +196,269 @@ function I({ editId: t }) {
|
|
|
194
196
|
})]
|
|
195
197
|
});
|
|
196
198
|
}
|
|
197
|
-
function
|
|
198
|
-
let { productId:
|
|
199
|
-
|
|
199
|
+
function z() {
|
|
200
|
+
let { productId: o } = j(), { basePath: f, navigate: x } = d(), { product: S, isLoading: E, error: z, refetch: B } = p(o), V = A().pathname.endsWith("/edit"), [H, U] = k(0), { levels: W, totalLevels: G, totalAvailable: K, hasMore: q, isLoading: J, error: Y } = m(V ? void 0 : o, {
|
|
201
|
+
limit: 20,
|
|
202
|
+
offset: H * 20
|
|
203
|
+
});
|
|
204
|
+
O(() => {
|
|
205
|
+
U(0);
|
|
206
|
+
}, [o]);
|
|
207
|
+
let X = () => x?.(u(f, "inventory/products")), Z = (e) => x?.(u(f, e));
|
|
208
|
+
return o ? V ? /* @__PURE__ */ N(R, { editId: o }) : E ? /* @__PURE__ */ N(w, { message: "Loading product details..." }) : z || !S ? /* @__PURE__ */ N(C, {
|
|
200
209
|
title: "Product not found",
|
|
201
|
-
onRetry:
|
|
202
|
-
}) : /* @__PURE__ */
|
|
203
|
-
title:
|
|
204
|
-
subtitle: `SKU: ${
|
|
205
|
-
icon: /* @__PURE__ */
|
|
206
|
-
headerActions: /* @__PURE__ */
|
|
210
|
+
onRetry: B
|
|
211
|
+
}) : /* @__PURE__ */ P(T, {
|
|
212
|
+
title: S.name,
|
|
213
|
+
subtitle: `SKU: ${S.sku}`,
|
|
214
|
+
icon: /* @__PURE__ */ N(a, { size: 24 }),
|
|
215
|
+
headerActions: /* @__PURE__ */ P("div", {
|
|
207
216
|
className: "flex gap-2",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ P(g, {
|
|
209
218
|
variant: "outline",
|
|
210
|
-
onClick:
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
-
}), /* @__PURE__ */
|
|
213
|
-
onClick: () =>
|
|
214
|
-
children: [/* @__PURE__ */
|
|
219
|
+
onClick: X,
|
|
220
|
+
children: [/* @__PURE__ */ N(e, { size: 16 }), " Back"]
|
|
221
|
+
}), /* @__PURE__ */ P(g, {
|
|
222
|
+
onClick: () => x?.(u(f, `inventory/products/${o}/edit`)),
|
|
223
|
+
children: [/* @__PURE__ */ N(s, { size: 16 }), " Edit"]
|
|
215
224
|
})]
|
|
216
225
|
}),
|
|
217
|
-
headerContent: /* @__PURE__ */
|
|
226
|
+
headerContent: /* @__PURE__ */ P("div", {
|
|
218
227
|
className: "flex gap-2",
|
|
219
228
|
children: [
|
|
220
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ N(h, {
|
|
221
230
|
variant: "outline",
|
|
222
|
-
children:
|
|
231
|
+
children: S.category
|
|
223
232
|
}),
|
|
224
|
-
|
|
233
|
+
S.brand && /* @__PURE__ */ N(h, {
|
|
225
234
|
variant: "secondary",
|
|
226
|
-
children:
|
|
235
|
+
children: S.brand
|
|
227
236
|
}),
|
|
228
|
-
|
|
237
|
+
S.fragile && /* @__PURE__ */ N(h, {
|
|
229
238
|
variant: "destructive",
|
|
230
239
|
children: "Fragile"
|
|
231
240
|
}),
|
|
232
|
-
|
|
241
|
+
S.hazardous && /* @__PURE__ */ N(h, {
|
|
233
242
|
variant: "destructive",
|
|
234
243
|
children: "Hazardous"
|
|
235
244
|
}),
|
|
236
|
-
|
|
245
|
+
S.temperatureControlled && /* @__PURE__ */ N(h, {
|
|
237
246
|
variant: "secondary",
|
|
238
247
|
children: "Temp Controlled"
|
|
239
248
|
})
|
|
240
249
|
]
|
|
241
250
|
}),
|
|
242
251
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
icon: /* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ N(L, {
|
|
253
|
+
icon: /* @__PURE__ */ N(a, { size: 18 }),
|
|
245
254
|
children: "The catalog record for this item — its dimensions, weight, value and handling flags. These drive how it's packed, priced and routed, so keep them accurate before adding the product to an order or stocking it in a warehouse."
|
|
246
255
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ N(I, {
|
|
248
257
|
storageKey: "movethewheels-product-details",
|
|
249
258
|
steps: [{
|
|
250
259
|
id: "order",
|
|
251
260
|
label: "Add this product to an order",
|
|
252
261
|
description: "Include it on a new delivery.",
|
|
253
|
-
icon: /* @__PURE__ */
|
|
254
|
-
onClick: () =>
|
|
262
|
+
icon: /* @__PURE__ */ N(a, { size: 16 }),
|
|
263
|
+
onClick: () => Z("orders/new")
|
|
255
264
|
}, {
|
|
256
265
|
id: "edit",
|
|
257
266
|
label: "Edit product details",
|
|
258
267
|
description: "Update dimensions, value or handling flags.",
|
|
259
|
-
icon: /* @__PURE__ */
|
|
260
|
-
onClick: () =>
|
|
268
|
+
icon: /* @__PURE__ */ N(c, { size: 16 }),
|
|
269
|
+
onClick: () => Z(`inventory/products/${o}/edit`)
|
|
261
270
|
}]
|
|
262
271
|
}),
|
|
263
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ P("div", {
|
|
264
273
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
265
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ P("div", {
|
|
266
275
|
className: "lg:col-span-2 space-y-6",
|
|
267
276
|
children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
277
|
+
/* @__PURE__ */ P(_, { children: [/* @__PURE__ */ N(y, { children: /* @__PURE__ */ N(b, { children: "Description" }) }), /* @__PURE__ */ N(v, { children: /* @__PURE__ */ N("p", { children: S.description }) })] }),
|
|
278
|
+
/* @__PURE__ */ P(_, { children: [/* @__PURE__ */ N(y, { children: /* @__PURE__ */ P(b, {
|
|
270
279
|
className: "flex items-center gap-2",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
-
}) }), /* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ N(t, { size: 18 }), " Dimensions & Weight"]
|
|
281
|
+
}) }), /* @__PURE__ */ N(v, { children: /* @__PURE__ */ P("div", {
|
|
273
282
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
274
283
|
children: [
|
|
275
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
276
285
|
className: "text-sm text-text-secondary",
|
|
277
286
|
children: "Length"
|
|
278
|
-
}), /* @__PURE__ */
|
|
287
|
+
}), /* @__PURE__ */ P("p", {
|
|
279
288
|
className: "text-2xl font-bold",
|
|
280
|
-
children: [
|
|
289
|
+
children: [S.dimensions.length, /* @__PURE__ */ P("span", {
|
|
281
290
|
className: "text-sm font-normal",
|
|
282
|
-
children: [" ",
|
|
291
|
+
children: [" ", S.dimensions.unit]
|
|
283
292
|
})]
|
|
284
293
|
})] }),
|
|
285
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
286
295
|
className: "text-sm text-text-secondary",
|
|
287
296
|
children: "Width"
|
|
288
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ P("p", {
|
|
289
298
|
className: "text-2xl font-bold",
|
|
290
|
-
children: [
|
|
299
|
+
children: [S.dimensions.width, /* @__PURE__ */ P("span", {
|
|
291
300
|
className: "text-sm font-normal",
|
|
292
|
-
children: [" ",
|
|
301
|
+
children: [" ", S.dimensions.unit]
|
|
293
302
|
})]
|
|
294
303
|
})] }),
|
|
295
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
296
305
|
className: "text-sm text-text-secondary",
|
|
297
306
|
children: "Height"
|
|
298
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ P("p", {
|
|
299
308
|
className: "text-2xl font-bold",
|
|
300
|
-
children: [
|
|
309
|
+
children: [S.dimensions.height, /* @__PURE__ */ P("span", {
|
|
301
310
|
className: "text-sm font-normal",
|
|
302
|
-
children: [" ",
|
|
311
|
+
children: [" ", S.dimensions.unit]
|
|
303
312
|
})]
|
|
304
313
|
})] }),
|
|
305
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
306
315
|
className: "text-sm text-text-secondary",
|
|
307
316
|
children: "Weight"
|
|
308
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ P("p", {
|
|
309
318
|
className: "text-2xl font-bold",
|
|
310
|
-
children: [
|
|
319
|
+
children: [S.weight, /* @__PURE__ */ N("span", {
|
|
311
320
|
className: "text-sm font-normal",
|
|
312
321
|
children: " kg"
|
|
313
322
|
})]
|
|
314
323
|
})] })
|
|
315
324
|
]
|
|
316
325
|
}) })] }),
|
|
317
|
-
|
|
326
|
+
S.attributes.length > 0 && /* @__PURE__ */ P(_, { children: [/* @__PURE__ */ N(y, { children: /* @__PURE__ */ P(b, {
|
|
318
327
|
className: "flex items-center gap-2",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
320
|
-
}) }), /* @__PURE__ */
|
|
328
|
+
children: [/* @__PURE__ */ N(c, { size: 18 }), " Attributes"]
|
|
329
|
+
}) }), /* @__PURE__ */ N(v, { children: /* @__PURE__ */ N("div", {
|
|
321
330
|
className: "grid grid-cols-2 md:grid-cols-3 gap-4",
|
|
322
|
-
children:
|
|
331
|
+
children: S.attributes.map((e, t) => /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
323
332
|
className: "text-sm text-text-secondary",
|
|
324
333
|
children: e.name
|
|
325
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ N("p", {
|
|
326
335
|
className: "font-medium",
|
|
327
336
|
children: e.value
|
|
328
337
|
})] }, t))
|
|
329
338
|
}) })] })
|
|
330
339
|
]
|
|
331
|
-
}), /* @__PURE__ */
|
|
340
|
+
}), /* @__PURE__ */ P("div", {
|
|
332
341
|
className: "space-y-6",
|
|
333
342
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ P(F, { children: [
|
|
344
|
+
/* @__PURE__ */ P("h2", {
|
|
336
345
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-3",
|
|
337
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ N(i, { size: 18 }), " Pricing"]
|
|
338
347
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ N("p", {
|
|
340
349
|
className: "text-3xl font-bold",
|
|
341
|
-
children:
|
|
350
|
+
children: D(S.value)
|
|
342
351
|
}),
|
|
343
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ N("p", {
|
|
344
353
|
className: "text-sm text-text-secondary",
|
|
345
354
|
children: "Unit price"
|
|
346
355
|
})
|
|
347
356
|
] }),
|
|
348
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ P(_, { children: [/* @__PURE__ */ N(y, { children: /* @__PURE__ */ P(b, {
|
|
349
358
|
className: "flex items-center gap-2",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
351
|
-
}) }), /* @__PURE__ */
|
|
359
|
+
children: [/* @__PURE__ */ N(l, { size: 18 }), " Stock Levels"]
|
|
360
|
+
}) }), /* @__PURE__ */ N(v, {
|
|
352
361
|
className: "space-y-3",
|
|
353
|
-
children:
|
|
362
|
+
children: Y ? /* @__PURE__ */ N("p", {
|
|
354
363
|
className: "text-sm text-status-error-text",
|
|
355
|
-
children:
|
|
356
|
-
}) :
|
|
364
|
+
children: Y.message
|
|
365
|
+
}) : J ? /* @__PURE__ */ N("p", {
|
|
357
366
|
className: "text-sm text-text-secondary",
|
|
358
367
|
children: "Loading stock levels…"
|
|
359
|
-
}) :
|
|
368
|
+
}) : W.length === 0 ? /* @__PURE__ */ P("div", {
|
|
360
369
|
className: "space-y-3",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ N("p", {
|
|
362
371
|
className: "text-sm text-text-secondary",
|
|
363
372
|
children: "This item isn't stocked in any warehouse yet, so nothing can be promised on an order."
|
|
364
|
-
}), /* @__PURE__ */
|
|
373
|
+
}), /* @__PURE__ */ N(g, {
|
|
365
374
|
variant: "outline",
|
|
366
375
|
size: "sm",
|
|
367
|
-
onClick: () =>
|
|
376
|
+
onClick: () => Z("inventory/warehouses"),
|
|
368
377
|
children: "View warehouses"
|
|
369
378
|
})]
|
|
370
|
-
}) : /* @__PURE__ */ M
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
379
|
+
}) : /* @__PURE__ */ P(M, { children: [
|
|
380
|
+
W.map((e) => /* @__PURE__ */ P("div", {
|
|
381
|
+
className: "flex items-baseline justify-between gap-3",
|
|
382
|
+
children: [/* @__PURE__ */ P("div", {
|
|
383
|
+
className: "min-w-0",
|
|
384
|
+
children: [/* @__PURE__ */ N("p", {
|
|
385
|
+
className: "truncate text-sm font-medium",
|
|
386
|
+
children: e.warehouseName
|
|
387
|
+
}), /* @__PURE__ */ P("p", {
|
|
388
|
+
className: "text-xs text-text-secondary",
|
|
389
|
+
children: [
|
|
390
|
+
e.allocated.toLocaleString(),
|
|
391
|
+
" allocated",
|
|
392
|
+
e.reorderPoint === void 0 ? "" : ` · reorder at ${e.reorderPoint.toLocaleString()}`
|
|
393
|
+
]
|
|
394
|
+
})]
|
|
395
|
+
}), /* @__PURE__ */ N("span", {
|
|
396
|
+
className: e.reorderPoint !== void 0 && e.available <= e.reorderPoint ? "font-semibold text-status-warning-text" : "font-semibold",
|
|
397
|
+
children: e.available.toLocaleString()
|
|
398
|
+
})]
|
|
399
|
+
}, e.inventoryItemId)),
|
|
400
|
+
H > 0 || q ? /* @__PURE__ */ P("div", {
|
|
401
|
+
className: "flex items-center justify-between gap-2 border-t border-border-seam pt-3",
|
|
402
|
+
children: [/* @__PURE__ */ P("span", {
|
|
378
403
|
className: "text-xs text-text-secondary",
|
|
379
404
|
children: [
|
|
380
|
-
|
|
381
|
-
"
|
|
382
|
-
|
|
405
|
+
H * 20 + 1,
|
|
406
|
+
"–",
|
|
407
|
+
Math.min(H * 20 + W.length, G),
|
|
408
|
+
" ",
|
|
409
|
+
"of ",
|
|
410
|
+
G
|
|
383
411
|
]
|
|
412
|
+
}), /* @__PURE__ */ P("div", {
|
|
413
|
+
className: "flex gap-2",
|
|
414
|
+
children: [/* @__PURE__ */ P(g, {
|
|
415
|
+
variant: "outline",
|
|
416
|
+
size: "sm",
|
|
417
|
+
disabled: H === 0 || J,
|
|
418
|
+
onClick: () => U((e) => Math.max(0, e - 1)),
|
|
419
|
+
children: [/* @__PURE__ */ N(n, { size: 14 }), " Previous"]
|
|
420
|
+
}), /* @__PURE__ */ P(g, {
|
|
421
|
+
variant: "outline",
|
|
422
|
+
size: "sm",
|
|
423
|
+
disabled: !q || J,
|
|
424
|
+
onClick: () => U((e) => e + 1),
|
|
425
|
+
children: ["Next ", /* @__PURE__ */ N(r, { size: 14 })]
|
|
426
|
+
})]
|
|
384
427
|
})]
|
|
385
|
-
})
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
})]
|
|
398
|
-
})] })
|
|
428
|
+
}) : null,
|
|
429
|
+
/* @__PURE__ */ P("div", {
|
|
430
|
+
className: "flex items-baseline justify-between gap-3 border-t border-border-seam pt-3",
|
|
431
|
+
children: [/* @__PURE__ */ N("p", {
|
|
432
|
+
className: "text-sm text-text-secondary",
|
|
433
|
+
children: "Available across the network"
|
|
434
|
+
}), /* @__PURE__ */ N("span", {
|
|
435
|
+
className: "font-bold",
|
|
436
|
+
children: K.toLocaleString()
|
|
437
|
+
})]
|
|
438
|
+
})
|
|
439
|
+
] })
|
|
399
440
|
})] }),
|
|
400
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ P(_, { children: [/* @__PURE__ */ N(y, { children: /* @__PURE__ */ N(b, { children: "Identifiers" }) }), /* @__PURE__ */ P(v, {
|
|
401
442
|
className: "space-y-3",
|
|
402
|
-
children: [/* @__PURE__ */
|
|
443
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
403
444
|
className: "text-sm text-text-secondary",
|
|
404
445
|
children: "SKU"
|
|
405
|
-
}), /* @__PURE__ */
|
|
446
|
+
}), /* @__PURE__ */ N("p", {
|
|
406
447
|
className: "font-mono",
|
|
407
|
-
children:
|
|
408
|
-
})] }),
|
|
448
|
+
children: S.sku
|
|
449
|
+
})] }), S.barcode && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
|
|
409
450
|
className: "text-sm text-text-secondary",
|
|
410
451
|
children: "Barcode"
|
|
411
|
-
}), /* @__PURE__ */
|
|
452
|
+
}), /* @__PURE__ */ N("p", {
|
|
412
453
|
className: "font-mono",
|
|
413
|
-
children:
|
|
454
|
+
children: S.barcode
|
|
414
455
|
})] })]
|
|
415
456
|
})] })
|
|
416
457
|
]
|
|
417
458
|
})]
|
|
418
459
|
})
|
|
419
460
|
]
|
|
420
|
-
}) : /* @__PURE__ */
|
|
461
|
+
}) : /* @__PURE__ */ N(R, {});
|
|
421
462
|
}
|
|
422
463
|
//#endregion
|
|
423
|
-
export {
|
|
464
|
+
export { z as default };
|