@burdenoff/microfe-movethewheels 2026.1030.1 → 2026.1031.2
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/ExportStatusBanner.js +53 -0
- package/dist/components/ShipmentRiskDialog.js +228 -0
- package/dist/components/TrackingAlertList.js +149 -0
- package/dist/generated/tracking-quality-operations.d.ts +1070 -2
- package/dist/generated/wspace-types.d.ts +2895 -50
- package/dist/hooks/useEntityExport.js +85 -0
- package/dist/hooks/useShipmentRisk.js +72 -0
- package/dist/hooks/useTracking.js +96 -82
- package/dist/movethewheels/components/ExportStatusBanner.d.ts +7 -0
- package/dist/movethewheels/components/ShipmentRiskDialog.d.ts +20 -0
- package/dist/movethewheels/components/TrackingAlertList.d.ts +14 -0
- package/dist/movethewheels/hooks/useEntityExport.d.ts +32 -0
- package/dist/movethewheels/hooks/useShipmentRisk.d.ts +41 -0
- package/dist/movethewheels/types/index.d.ts +15 -1
- package/dist/movethewheels/utils/entityExport.d.ts +64 -0
- package/dist/movethewheels/utils/trackingAlerts.d.ts +36 -0
- package/dist/pages/CustomersPage.js +64 -58
- package/dist/pages/DashboardPage.js +147 -151
- package/dist/pages/DriversPage.js +113 -107
- package/dist/pages/LiveTrackingPage.js +169 -169
- package/dist/pages/OrdersListPage.js +85 -79
- package/dist/pages/ProductsPage.js +63 -57
- package/dist/pages/VehiclesPage.js +91 -85
- package/dist/utils/entityExport.js +54 -0
- package/dist/utils/trackingAlerts.js +86 -0
- package/package.json +4 -2
- package/src/generated/tracking-quality-operations.ts +1409 -13
- package/src/generated/wspace-types.ts +3248 -51
- package/src/movethewheels/components/ExportStatusBanner.tsx +78 -0
- package/src/movethewheels/components/ShipmentRiskDialog.tsx +315 -0
- package/src/movethewheels/components/TrackingAlertList.tsx +188 -0
- package/src/movethewheels/hooks/useEntityExport.ts +130 -0
- package/src/movethewheels/hooks/useShipmentRisk.ts +195 -0
- package/src/movethewheels/hooks/useTracking.ts +66 -22
- package/src/movethewheels/pages/CustomersPage.tsx +11 -2
- package/src/movethewheels/pages/DashboardPage.tsx +10 -20
- package/src/movethewheels/pages/DriversPage.tsx +11 -2
- package/src/movethewheels/pages/LiveTrackingPage.tsx +20 -22
- package/src/movethewheels/pages/OrdersListPage.tsx +13 -2
- package/src/movethewheels/pages/ProductsPage.tsx +11 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +11 -2
- package/src/movethewheels/types/index.ts +16 -1
- package/src/movethewheels/utils/entityExport.ts +140 -0
- package/src/movethewheels/utils/trackingAlerts.ts +151 -0
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
2
2
|
import { Clock as t } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
|
|
3
3
|
import { Download as n } from "../node_modules/lucide-react/dist/esm/icons/download.js";
|
|
4
|
-
import { Filter as
|
|
5
|
-
import { Package as
|
|
6
|
-
import { Plus as
|
|
7
|
-
import { RefreshCw as
|
|
8
|
-
import { Truck as
|
|
9
|
-
import { UserCheck as
|
|
10
|
-
import { UserPlus as
|
|
11
|
-
import { joinPath as
|
|
12
|
-
import { useMoveTheWheels as
|
|
13
|
-
import { useOrderStats as
|
|
14
|
-
import { Badge as
|
|
15
|
-
import { PageLayout as
|
|
16
|
-
import { MetricCard as
|
|
17
|
-
import { PriorityBadge as
|
|
18
|
-
import { DataTable as
|
|
19
|
-
import { formatCurrency as
|
|
20
|
-
import { useDebouncedValue as
|
|
4
|
+
import { Filter as ee } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
|
|
5
|
+
import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
6
|
+
import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
7
|
+
import { RefreshCw as a } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
|
|
8
|
+
import { Truck as o } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
9
|
+
import { UserCheck as s } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
|
|
10
|
+
import { UserPlus as c } from "../node_modules/lucide-react/dist/esm/icons/user-plus.js";
|
|
11
|
+
import { joinPath as l } from "../utils/navigation.js";
|
|
12
|
+
import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
|
|
13
|
+
import { useOrderStats as te, useOrders as d } from "../hooks/useOrders.js";
|
|
14
|
+
import { Badge as f, Button as p, Card as ne, CardContent as re, Select as ie, SelectContent as m, SelectItem as h, SelectTrigger as g, SelectValue as ae } from "../components/ui.js";
|
|
15
|
+
import { PageLayout as _ } from "../components/PageLayout.js";
|
|
16
|
+
import { MetricCard as v, MetricGrid as y } from "../components/MetricCard.js";
|
|
17
|
+
import { PriorityBadge as b, StatusBadge as x } from "../components/StatusBadge.js";
|
|
18
|
+
import { DataTable as oe } from "../components/DataTable.js";
|
|
19
|
+
import { formatCurrency as se, formatDate as S } from "../utils/formatters.js";
|
|
20
|
+
import { useDebouncedValue as C } from "../hooks/useDebouncedValue.js";
|
|
21
|
+
import { useEntityExport as w } from "../hooks/useEntityExport.js";
|
|
22
|
+
import { ExportStatusBanner as T } from "../components/ExportStatusBanner.js";
|
|
21
23
|
import { useState as E } from "react";
|
|
22
24
|
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
23
25
|
import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
@@ -27,17 +29,17 @@ function M() {
|
|
|
27
29
|
let { t: M } = k(), N = (e, t) => {
|
|
28
30
|
let n = M(e);
|
|
29
31
|
return n === e ? t : n;
|
|
30
|
-
}, { basePath: P, navigate: F } =
|
|
32
|
+
}, { basePath: P, navigate: F } = u(), { state: I, isExporting: L, startExport: R, dismiss: z } = w("orders", "order"), [B, V] = E("all"), [H, U] = E(!1), [W, G] = E(0), [K, ce] = E(25), [q, J] = E(""), le = C(q), ue = B !== "all" || H || q.length > 0, { orders: de, totalOrders: fe, hasMore: pe, isLoading: me, error: he, refetch: Y } = d({
|
|
31
33
|
filters: {
|
|
32
|
-
status:
|
|
33
|
-
unassigned:
|
|
34
|
-
search:
|
|
34
|
+
status: B === "all" ? void 0 : B,
|
|
35
|
+
unassigned: H || void 0,
|
|
36
|
+
search: le || void 0
|
|
35
37
|
},
|
|
36
|
-
limit:
|
|
37
|
-
offset:
|
|
38
|
-
}), { stats: X } =
|
|
39
|
-
F && F(
|
|
40
|
-
}, $ = () =>
|
|
38
|
+
limit: K,
|
|
39
|
+
offset: W * K
|
|
40
|
+
}), { stats: X } = te(), Z = X.total, Q = (e) => {
|
|
41
|
+
F && F(l(P, e));
|
|
42
|
+
}, $ = () => G(0), ge = [
|
|
41
43
|
{
|
|
42
44
|
id: "orderNumber",
|
|
43
45
|
header: N("movethewheels.orders.table.orderNumber", "Order #"),
|
|
@@ -70,7 +72,7 @@ function M() {
|
|
|
70
72
|
accessorKey: "status",
|
|
71
73
|
sortable: !0,
|
|
72
74
|
className: "min-w-[130px] whitespace-nowrap",
|
|
73
|
-
cell: (e) => /* @__PURE__ */ D(
|
|
75
|
+
cell: (e) => /* @__PURE__ */ D(x, {
|
|
74
76
|
status: e.status,
|
|
75
77
|
type: "order"
|
|
76
78
|
})
|
|
@@ -81,13 +83,13 @@ function M() {
|
|
|
81
83
|
accessorKey: "priority",
|
|
82
84
|
sortable: !0,
|
|
83
85
|
className: "min-w-[90px] whitespace-nowrap",
|
|
84
|
-
cell: (e) => /* @__PURE__ */ D(
|
|
86
|
+
cell: (e) => /* @__PURE__ */ D(b, { priority: e.priority })
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
id: "items",
|
|
88
90
|
header: N("movethewheels.orders.table.items", "Items"),
|
|
89
91
|
className: "min-w-[80px] whitespace-nowrap",
|
|
90
|
-
cell: (e) => /* @__PURE__ */ O(
|
|
92
|
+
cell: (e) => /* @__PURE__ */ O(f, {
|
|
91
93
|
variant: "secondary",
|
|
92
94
|
children: [
|
|
93
95
|
e.items.length,
|
|
@@ -104,7 +106,7 @@ function M() {
|
|
|
104
106
|
className: "min-w-[100px] whitespace-nowrap text-right",
|
|
105
107
|
cell: (e) => /* @__PURE__ */ D("span", {
|
|
106
108
|
className: "font-medium",
|
|
107
|
-
children:
|
|
109
|
+
children: se(e.pricing.total)
|
|
108
110
|
})
|
|
109
111
|
},
|
|
110
112
|
{
|
|
@@ -113,7 +115,7 @@ function M() {
|
|
|
113
115
|
accessorKey: "scheduledDelivery",
|
|
114
116
|
sortable: !0,
|
|
115
117
|
className: "min-w-[110px] whitespace-nowrap",
|
|
116
|
-
cell: (e) => e.scheduledDelivery ?
|
|
118
|
+
cell: (e) => e.scheduledDelivery ? S(e.scheduledDelivery) : "-"
|
|
117
119
|
},
|
|
118
120
|
{
|
|
119
121
|
id: "createdAt",
|
|
@@ -121,7 +123,7 @@ function M() {
|
|
|
121
123
|
accessorKey: "createdAt",
|
|
122
124
|
sortable: !0,
|
|
123
125
|
className: "min-w-[100px] whitespace-nowrap",
|
|
124
|
-
cell: (e) =>
|
|
126
|
+
cell: (e) => S(e.createdAt, "relative")
|
|
125
127
|
},
|
|
126
128
|
{
|
|
127
129
|
id: "driver",
|
|
@@ -130,23 +132,23 @@ function M() {
|
|
|
130
132
|
cell: (e) => e.driverId ? /* @__PURE__ */ O("span", {
|
|
131
133
|
className: "inline-flex items-center gap-1 text-sm text-status-success-text",
|
|
132
134
|
children: [
|
|
133
|
-
/* @__PURE__ */ D(
|
|
135
|
+
/* @__PURE__ */ D(s, { size: 14 }),
|
|
134
136
|
" ",
|
|
135
137
|
N("movethewheels.orders.table.assigned", "Assigned")
|
|
136
138
|
]
|
|
137
|
-
}) : /* @__PURE__ */ O(
|
|
139
|
+
}) : /* @__PURE__ */ O(p, {
|
|
138
140
|
variant: "outline",
|
|
139
141
|
size: "sm",
|
|
140
142
|
onClick: (t) => {
|
|
141
143
|
t.stopPropagation(), Q(`orders/${e.id}`);
|
|
142
144
|
},
|
|
143
|
-
children: [/* @__PURE__ */ D(
|
|
145
|
+
children: [/* @__PURE__ */ D(c, {
|
|
144
146
|
size: 14,
|
|
145
147
|
className: "mr-1"
|
|
146
148
|
}), N("movethewheels.orders.table.assign", "Assign")]
|
|
147
149
|
})
|
|
148
150
|
}
|
|
149
|
-
],
|
|
151
|
+
], _e = [
|
|
150
152
|
{
|
|
151
153
|
value: "all",
|
|
152
154
|
label: N("movethewheels.orders.filters.allStatuses", "All Statuses")
|
|
@@ -192,58 +194,62 @@ function M() {
|
|
|
192
194
|
label: N("movethewheels.orders.status.failed", "Failed")
|
|
193
195
|
}
|
|
194
196
|
];
|
|
195
|
-
return /* @__PURE__ */ O(
|
|
197
|
+
return /* @__PURE__ */ O(_, {
|
|
196
198
|
title: N("movethewheels.orders.title", "Orders"),
|
|
197
199
|
subtitle: `${Z} ${N("movethewheels.orders.subtitle", "total orders")}`,
|
|
198
|
-
icon: /* @__PURE__ */ D(
|
|
200
|
+
icon: /* @__PURE__ */ D(r, { size: 24 }),
|
|
199
201
|
headerActions: /* @__PURE__ */ D(A, {
|
|
200
202
|
primary: {
|
|
201
203
|
label: N("movethewheels.orders.actions.newOrder", "New Order"),
|
|
202
|
-
icon: /* @__PURE__ */ D(
|
|
204
|
+
icon: /* @__PURE__ */ D(i, { size: 16 }),
|
|
203
205
|
onSelect: () => Q("orders/new")
|
|
204
206
|
},
|
|
205
207
|
actions: [{
|
|
206
208
|
label: N("movethewheels.orders.actions.refresh", "Refresh"),
|
|
207
|
-
icon: /* @__PURE__ */ D(
|
|
209
|
+
icon: /* @__PURE__ */ D(a, { size: 16 }),
|
|
208
210
|
onSelect: () => Y()
|
|
209
211
|
}, {
|
|
210
|
-
label: N("movethewheels.orders.actions.export", "Export"),
|
|
212
|
+
label: L ? N("movethewheels.orders.actions.exporting", "Exporting…") : N("movethewheels.orders.actions.export", "Export"),
|
|
211
213
|
icon: /* @__PURE__ */ D(n, { size: 16 }),
|
|
212
|
-
onSelect:
|
|
214
|
+
onSelect: R
|
|
213
215
|
}]
|
|
214
216
|
}),
|
|
215
217
|
children: [
|
|
216
218
|
/* @__PURE__ */ D(j, {
|
|
217
|
-
icon: /* @__PURE__ */ D(
|
|
219
|
+
icon: /* @__PURE__ */ D(r, { size: 18 }),
|
|
218
220
|
children: N("movethewheels.orders.purpose", "Every delivery job lives here — their status, priority and value. Use this list to find an order, filter by status, and open one to assign a driver, track it, or update fulfilment.")
|
|
219
221
|
}),
|
|
222
|
+
/* @__PURE__ */ D(T, {
|
|
223
|
+
state: I,
|
|
224
|
+
onDismiss: z
|
|
225
|
+
}),
|
|
220
226
|
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
221
227
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
222
228
|
children: N("movethewheels.orders.glance.title", "Pipeline at a glance")
|
|
223
|
-
}), /* @__PURE__ */ O(
|
|
229
|
+
}), /* @__PURE__ */ O(y, {
|
|
224
230
|
columns: 4,
|
|
225
231
|
children: [
|
|
226
|
-
/* @__PURE__ */ D(
|
|
232
|
+
/* @__PURE__ */ D(v, {
|
|
227
233
|
label: N("movethewheels.orders.glance.total", "Total orders"),
|
|
228
234
|
value: Z,
|
|
229
|
-
icon: /* @__PURE__ */ D(
|
|
235
|
+
icon: /* @__PURE__ */ D(r, { size: 20 }),
|
|
230
236
|
accent: "brand"
|
|
231
237
|
}),
|
|
232
|
-
/* @__PURE__ */ D(
|
|
238
|
+
/* @__PURE__ */ D(v, {
|
|
233
239
|
label: N("movethewheels.orders.glance.pending", "Pending"),
|
|
234
240
|
value: X.byStatus.pending,
|
|
235
241
|
icon: /* @__PURE__ */ D(t, { size: 20 }),
|
|
236
242
|
accent: "warning",
|
|
237
243
|
subtitle: N("movethewheels.orders.glance.pendingSub", "Awaiting fulfilment")
|
|
238
244
|
}),
|
|
239
|
-
/* @__PURE__ */ D(
|
|
245
|
+
/* @__PURE__ */ D(v, {
|
|
240
246
|
label: N("movethewheels.orders.glance.inTransit", "In transit"),
|
|
241
247
|
value: X.byStatus.in_transit + X.byStatus.out_for_delivery,
|
|
242
|
-
icon: /* @__PURE__ */ D(
|
|
248
|
+
icon: /* @__PURE__ */ D(o, { size: 20 }),
|
|
243
249
|
accent: "blue",
|
|
244
250
|
subtitle: N("movethewheels.orders.glance.inTransitSub", "On the road now")
|
|
245
251
|
}),
|
|
246
|
-
/* @__PURE__ */ D(
|
|
252
|
+
/* @__PURE__ */ D(v, {
|
|
247
253
|
label: N("movethewheels.orders.glance.delivered", "Delivered"),
|
|
248
254
|
value: X.byStatus.delivered,
|
|
249
255
|
icon: /* @__PURE__ */ D(e, { size: 20 }),
|
|
@@ -251,14 +257,14 @@ function M() {
|
|
|
251
257
|
})
|
|
252
258
|
]
|
|
253
259
|
})] }),
|
|
254
|
-
/* @__PURE__ */ D(
|
|
260
|
+
/* @__PURE__ */ D(ne, { children: /* @__PURE__ */ D(re, {
|
|
255
261
|
className: "p-4",
|
|
256
262
|
children: /* @__PURE__ */ O("div", {
|
|
257
263
|
className: "flex flex-wrap items-center gap-4",
|
|
258
264
|
children: [
|
|
259
265
|
/* @__PURE__ */ O("div", {
|
|
260
266
|
className: "flex items-center gap-2",
|
|
261
|
-
children: [/* @__PURE__ */ D(
|
|
267
|
+
children: [/* @__PURE__ */ D(ee, {
|
|
262
268
|
size: 16,
|
|
263
269
|
className: "text-text-secondary"
|
|
264
270
|
}), /* @__PURE__ */ D("span", {
|
|
@@ -266,71 +272,71 @@ function M() {
|
|
|
266
272
|
children: N("movethewheels.orders.filters.label", "Filters:")
|
|
267
273
|
})]
|
|
268
274
|
}),
|
|
269
|
-
/* @__PURE__ */ O(
|
|
270
|
-
value:
|
|
275
|
+
/* @__PURE__ */ O(ie, {
|
|
276
|
+
value: B,
|
|
271
277
|
onValueChange: (e) => {
|
|
272
|
-
|
|
278
|
+
V(e), $();
|
|
273
279
|
},
|
|
274
|
-
children: [/* @__PURE__ */ D(
|
|
280
|
+
children: [/* @__PURE__ */ D(g, {
|
|
275
281
|
className: "w-[180px]",
|
|
276
|
-
children: /* @__PURE__ */ D(
|
|
277
|
-
}), /* @__PURE__ */ D(
|
|
282
|
+
children: /* @__PURE__ */ D(ae, { placeholder: N("movethewheels.orders.filters.status", "Status") })
|
|
283
|
+
}), /* @__PURE__ */ D(m, { children: _e.map((e) => /* @__PURE__ */ D(h, {
|
|
278
284
|
value: e.value,
|
|
279
285
|
children: e.label
|
|
280
286
|
}, e.value)) })]
|
|
281
287
|
}),
|
|
282
|
-
/* @__PURE__ */ O(
|
|
283
|
-
variant:
|
|
288
|
+
/* @__PURE__ */ O(p, {
|
|
289
|
+
variant: H ? "default" : "outline",
|
|
284
290
|
size: "sm",
|
|
285
291
|
onClick: () => {
|
|
286
|
-
|
|
292
|
+
U((e) => !e), $();
|
|
287
293
|
},
|
|
288
|
-
children: [/* @__PURE__ */ D(
|
|
294
|
+
children: [/* @__PURE__ */ D(c, {
|
|
289
295
|
size: 14,
|
|
290
296
|
className: "mr-1"
|
|
291
297
|
}), N("movethewheels.orders.filters.unassigned", "Needs driver")]
|
|
292
298
|
}),
|
|
293
|
-
|
|
299
|
+
ue && /* @__PURE__ */ D(p, {
|
|
294
300
|
variant: "ghost",
|
|
295
301
|
size: "sm",
|
|
296
302
|
onClick: () => {
|
|
297
|
-
|
|
303
|
+
V("all"), U(!1), J(""), $();
|
|
298
304
|
},
|
|
299
305
|
children: N("movethewheels.orders.filters.clear", "Clear filters")
|
|
300
306
|
})
|
|
301
307
|
]
|
|
302
308
|
})
|
|
303
309
|
}) }),
|
|
304
|
-
/* @__PURE__ */ D(
|
|
305
|
-
columns:
|
|
306
|
-
data:
|
|
307
|
-
isLoading:
|
|
308
|
-
error:
|
|
310
|
+
/* @__PURE__ */ D(oe, {
|
|
311
|
+
columns: ge,
|
|
312
|
+
data: de,
|
|
313
|
+
isLoading: me,
|
|
314
|
+
error: he,
|
|
309
315
|
onRetry: Y,
|
|
310
316
|
searchable: !0,
|
|
311
317
|
searchPlaceholder: N("movethewheels.orders.searchPlaceholder", "Search orders..."),
|
|
312
318
|
searchFields: ["orderNumber", "customerInfo"],
|
|
313
|
-
searchQuery:
|
|
319
|
+
searchQuery: q,
|
|
314
320
|
onSearchQueryChange: (e) => {
|
|
315
|
-
|
|
321
|
+
J(e), G(0);
|
|
316
322
|
},
|
|
317
323
|
onRowClick: (e) => Q(`orders/${e.id}`),
|
|
318
324
|
getRowId: (e) => e.id,
|
|
319
|
-
pageIndex:
|
|
320
|
-
pageSize:
|
|
321
|
-
onPageChange:
|
|
325
|
+
pageIndex: W,
|
|
326
|
+
pageSize: K,
|
|
327
|
+
onPageChange: G,
|
|
322
328
|
onPageSizeChange: (e) => {
|
|
323
|
-
|
|
329
|
+
ce(e), G(0);
|
|
324
330
|
},
|
|
325
|
-
totalItems:
|
|
326
|
-
hasNextPage:
|
|
331
|
+
totalItems: fe,
|
|
332
|
+
hasNextPage: pe,
|
|
327
333
|
emptyMessage: N("movethewheels.orders.empty", "No orders found"),
|
|
328
334
|
emptyIllustration: "empty-data",
|
|
329
335
|
emptyTitle: N("movethewheels.orders.emptyTitle", "No orders yet"),
|
|
330
336
|
emptyDescription: N("movethewheels.orders.emptyDescription", "Create your first order to start moving shipments through the pipeline."),
|
|
331
|
-
emptyAction: /* @__PURE__ */ O(
|
|
337
|
+
emptyAction: /* @__PURE__ */ O(p, {
|
|
332
338
|
onClick: () => Q("orders/new"),
|
|
333
|
-
children: [/* @__PURE__ */ D(
|
|
339
|
+
children: [/* @__PURE__ */ D(i, {
|
|
334
340
|
size: 16,
|
|
335
341
|
className: "mr-1.5"
|
|
336
342
|
}), N("movethewheels.orders.actions.newOrder", "New Order")]
|
|
@@ -13,76 +13,82 @@ import { MetricCard as f, MetricGrid as p } from "../components/MetricCard.js";
|
|
|
13
13
|
import { DataTable as m } from "../components/DataTable.js";
|
|
14
14
|
import { formatCurrency as h } from "../utils/formatters.js";
|
|
15
15
|
import { useDebouncedValue as g } from "../hooks/useDebouncedValue.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { useEntityExport as _ } from "../hooks/useEntityExport.js";
|
|
17
|
+
import { ExportStatusBanner as v } from "../components/ExportStatusBanner.js";
|
|
18
|
+
import { useState as y } from "react";
|
|
19
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
20
|
+
import { CTAOverflowMenu as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
19
21
|
//#region src/movethewheels/pages/ProductsPage.tsx
|
|
20
|
-
function
|
|
21
|
-
let { basePath:
|
|
22
|
-
limit:
|
|
23
|
-
offset:
|
|
24
|
-
search:
|
|
25
|
-
}), { stats:
|
|
26
|
-
return /* @__PURE__ */
|
|
22
|
+
function w() {
|
|
23
|
+
let { basePath: w, navigate: T } = s(), { state: E, isExporting: D, startExport: O, dismiss: k } = _("products", "product"), [A, j] = y(0), [M, N] = y(25), [P, F] = y(""), I = g(P), { products: L, totalProducts: R, hasMore: z, isLoading: B, error: V, refetch: H } = l({
|
|
24
|
+
limit: M,
|
|
25
|
+
offset: A * M,
|
|
26
|
+
search: I
|
|
27
|
+
}), { stats: U } = c(), W = (e) => T?.(o(w, e));
|
|
28
|
+
return /* @__PURE__ */ x(d, {
|
|
27
29
|
title: "Products",
|
|
28
|
-
subtitle: `${
|
|
29
|
-
icon: /* @__PURE__ */
|
|
30
|
-
headerActions: /* @__PURE__ */
|
|
30
|
+
subtitle: `${U.total} products`,
|
|
31
|
+
icon: /* @__PURE__ */ b(t, { size: 24 }),
|
|
32
|
+
headerActions: /* @__PURE__ */ b(S, {
|
|
31
33
|
primary: {
|
|
32
34
|
label: "Add Product",
|
|
33
|
-
icon: /* @__PURE__ */
|
|
34
|
-
onSelect: () =>
|
|
35
|
+
icon: /* @__PURE__ */ b(n, { size: 16 }),
|
|
36
|
+
onSelect: () => W("inventory/products/new")
|
|
35
37
|
},
|
|
36
38
|
actions: [{
|
|
37
39
|
label: "Refresh",
|
|
38
|
-
icon: /* @__PURE__ */
|
|
39
|
-
onSelect: () =>
|
|
40
|
+
icon: /* @__PURE__ */ b(r, { size: 16 }),
|
|
41
|
+
onSelect: () => H()
|
|
40
42
|
}, {
|
|
41
|
-
label: "Export",
|
|
42
|
-
icon: /* @__PURE__ */
|
|
43
|
-
onSelect:
|
|
43
|
+
label: D ? "Exporting…" : "Export",
|
|
44
|
+
icon: /* @__PURE__ */ b(e, { size: 16 }),
|
|
45
|
+
onSelect: O
|
|
44
46
|
}]
|
|
45
47
|
}),
|
|
46
48
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
icon: /* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ b(C, {
|
|
50
|
+
icon: /* @__PURE__ */ b(t, { size: 18 }),
|
|
49
51
|
children: "The catalog of items you ship. Each product's dimensions, weight, value and handling flags (fragile, hazardous, temperature-controlled) drive how it's packed, priced and routed — keep them accurate so shipments are quoted and handled correctly."
|
|
50
52
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ b(v, {
|
|
54
|
+
state: E,
|
|
55
|
+
onDismiss: k
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
52
58
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
53
59
|
children: "Catalog at a glance"
|
|
54
|
-
}), /* @__PURE__ */
|
|
60
|
+
}), /* @__PURE__ */ x(p, {
|
|
55
61
|
columns: 3,
|
|
56
62
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ b(f, {
|
|
58
64
|
label: "Total products",
|
|
59
|
-
value:
|
|
60
|
-
icon: /* @__PURE__ */
|
|
65
|
+
value: U.total,
|
|
66
|
+
icon: /* @__PURE__ */ b(t, { size: 20 }),
|
|
61
67
|
accent: "brand"
|
|
62
68
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ b(f, {
|
|
64
70
|
label: "Special handling",
|
|
65
|
-
value:
|
|
66
|
-
icon: /* @__PURE__ */
|
|
71
|
+
value: U.specialHandling,
|
|
72
|
+
icon: /* @__PURE__ */ b(a, { size: 20 }),
|
|
67
73
|
accent: "warning",
|
|
68
74
|
subtitle: "Fragile or hazardous"
|
|
69
75
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ b(f, {
|
|
71
77
|
label: "Temp-controlled",
|
|
72
|
-
value:
|
|
73
|
-
icon: /* @__PURE__ */
|
|
78
|
+
value: U.temperatureControlled,
|
|
79
|
+
icon: /* @__PURE__ */ b(i, { size: 20 }),
|
|
74
80
|
accent: "blue"
|
|
75
81
|
})
|
|
76
82
|
]
|
|
77
83
|
})] }),
|
|
78
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ b(m, {
|
|
79
85
|
columns: [
|
|
80
86
|
{
|
|
81
87
|
id: "sku",
|
|
82
88
|
header: "SKU",
|
|
83
89
|
accessorKey: "sku",
|
|
84
90
|
sortable: !0,
|
|
85
|
-
cell: (e) => /* @__PURE__ */
|
|
91
|
+
cell: (e) => /* @__PURE__ */ b("span", {
|
|
86
92
|
className: "font-mono",
|
|
87
93
|
children: e.sku
|
|
88
94
|
})
|
|
@@ -92,10 +98,10 @@ function S() {
|
|
|
92
98
|
header: "Product Name",
|
|
93
99
|
accessorKey: "name",
|
|
94
100
|
sortable: !0,
|
|
95
|
-
cell: (e) => /* @__PURE__ */
|
|
101
|
+
cell: (e) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
96
102
|
className: "font-medium",
|
|
97
103
|
children: e.name
|
|
98
|
-
}), /* @__PURE__ */
|
|
104
|
+
}), /* @__PURE__ */ b("p", {
|
|
99
105
|
className: "text-sm text-text-secondary line-clamp-1",
|
|
100
106
|
children: e.description ?? "Not provided"
|
|
101
107
|
})] })
|
|
@@ -105,7 +111,7 @@ function S() {
|
|
|
105
111
|
header: "Category",
|
|
106
112
|
accessorKey: "category",
|
|
107
113
|
sortable: !0,
|
|
108
|
-
cell: (e) => /* @__PURE__ */
|
|
114
|
+
cell: (e) => /* @__PURE__ */ b(u, {
|
|
109
115
|
variant: "outline",
|
|
110
116
|
children: e.category ?? "Not provided"
|
|
111
117
|
})
|
|
@@ -127,7 +133,7 @@ function S() {
|
|
|
127
133
|
header: "Value",
|
|
128
134
|
accessorKey: "value",
|
|
129
135
|
sortable: !0,
|
|
130
|
-
cell: (e) => /* @__PURE__ */
|
|
136
|
+
cell: (e) => /* @__PURE__ */ b("span", {
|
|
131
137
|
className: "font-medium",
|
|
132
138
|
children: e.value === void 0 ? "Not provided" : h(e.value)
|
|
133
139
|
})
|
|
@@ -135,20 +141,20 @@ function S() {
|
|
|
135
141
|
{
|
|
136
142
|
id: "flags",
|
|
137
143
|
header: "Flags",
|
|
138
|
-
cell: (e) => /* @__PURE__ */
|
|
144
|
+
cell: (e) => /* @__PURE__ */ x("div", {
|
|
139
145
|
className: "flex gap-1",
|
|
140
146
|
children: [
|
|
141
|
-
e.fragile && /* @__PURE__ */
|
|
147
|
+
e.fragile && /* @__PURE__ */ b(u, {
|
|
142
148
|
variant: "destructive",
|
|
143
149
|
className: "text-xs",
|
|
144
150
|
children: "Fragile"
|
|
145
151
|
}),
|
|
146
|
-
e.hazardous && /* @__PURE__ */
|
|
152
|
+
e.hazardous && /* @__PURE__ */ b(u, {
|
|
147
153
|
variant: "destructive",
|
|
148
154
|
className: "text-xs",
|
|
149
155
|
children: "Hazardous"
|
|
150
156
|
}),
|
|
151
|
-
e.temperatureControlled && /* @__PURE__ */
|
|
157
|
+
e.temperatureControlled && /* @__PURE__ */ b(u, {
|
|
152
158
|
variant: "secondary",
|
|
153
159
|
className: "text-xs",
|
|
154
160
|
children: "Temp Control"
|
|
@@ -157,10 +163,10 @@ function S() {
|
|
|
157
163
|
})
|
|
158
164
|
}
|
|
159
165
|
],
|
|
160
|
-
data:
|
|
161
|
-
isLoading:
|
|
162
|
-
error:
|
|
163
|
-
onRetry:
|
|
166
|
+
data: L,
|
|
167
|
+
isLoading: B,
|
|
168
|
+
error: V,
|
|
169
|
+
onRetry: H,
|
|
164
170
|
searchable: !0,
|
|
165
171
|
searchPlaceholder: "Search products...",
|
|
166
172
|
searchFields: [
|
|
@@ -168,20 +174,20 @@ function S() {
|
|
|
168
174
|
"sku",
|
|
169
175
|
"category"
|
|
170
176
|
],
|
|
171
|
-
searchQuery:
|
|
177
|
+
searchQuery: P,
|
|
172
178
|
onSearchQueryChange: (e) => {
|
|
173
|
-
|
|
179
|
+
F(e), j(0);
|
|
174
180
|
},
|
|
175
|
-
onRowClick: (e) =>
|
|
181
|
+
onRowClick: (e) => W(`inventory/products/${e.id}`),
|
|
176
182
|
getRowId: (e) => e.id,
|
|
177
|
-
pageIndex:
|
|
178
|
-
pageSize:
|
|
179
|
-
onPageChange:
|
|
183
|
+
pageIndex: A,
|
|
184
|
+
pageSize: M,
|
|
185
|
+
onPageChange: j,
|
|
180
186
|
onPageSizeChange: (e) => {
|
|
181
|
-
|
|
187
|
+
N(e), j(0);
|
|
182
188
|
},
|
|
183
|
-
totalItems:
|
|
184
|
-
hasNextPage:
|
|
189
|
+
totalItems: R,
|
|
190
|
+
hasNextPage: z,
|
|
185
191
|
emptyIllustration: "empty-files",
|
|
186
192
|
emptyTitle: "No products yet",
|
|
187
193
|
emptyDescription: "Add products to your catalog so they can be added to orders and stocked in warehouses."
|
|
@@ -190,4 +196,4 @@ function S() {
|
|
|
190
196
|
});
|
|
191
197
|
}
|
|
192
198
|
//#endregion
|
|
193
|
-
export {
|
|
199
|
+
export { w as default };
|