@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CarbonFootprintPanel.js +1 -1
- package/dist/components/CustomerPicker.js +271 -0
- package/dist/components/DataTable.js +140 -139
- package/dist/components/DocumentsCard.js +14 -8
- package/dist/generated/wspace-types.d.ts +1043 -5
- package/dist/hooks/useAnalytics.js +21 -1
- package/dist/hooks/useCustomers.js +94 -78
- package/dist/hooks/useDebouncedValue.js +11 -0
- package/dist/hooks/useEntityDocuments.js +28 -18
- package/dist/hooks/useEpod.js +24 -17
- package/dist/hooks/useFleet.js +146 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +73 -73
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
- package/dist/movethewheels/components/DataTable.d.ts +5 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
- package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
- package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +7 -5
- package/dist/movethewheels/utils/navigation.d.ts +14 -0
- package/dist/pages/CreateOrderPage.js +228 -217
- package/dist/pages/CustomerDetailsPage.js +220 -220
- package/dist/pages/CustomersPage.js +61 -54
- package/dist/pages/DeliveryCapturePage.js +131 -109
- package/dist/pages/DriversPage.js +100 -92
- package/dist/pages/InventoryPage.js +239 -236
- package/dist/pages/MultiModalShipmentPage.js +163 -130
- package/dist/pages/OrderDetailsPage.js +224 -208
- package/dist/pages/OrdersListPage.js +66 -60
- package/dist/pages/ProductDetailsPage.js +241 -200
- package/dist/pages/ProductsPage.js +59 -52
- package/dist/pages/RouteDetailsPage.js +343 -321
- package/dist/pages/RoutesPage.js +55 -48
- package/dist/pages/VehiclesPage.js +63 -56
- package/dist/pages/WarehousesPage.js +60 -53
- package/dist/utils/navigation.js +22 -1
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1188 -5
- package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
- package/src/movethewheels/components/CustomerPicker.tsx +321 -0
- package/src/movethewheels/components/DataTable.tsx +34 -18
- package/src/movethewheels/components/DocumentsCard.tsx +6 -1
- package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
- package/src/movethewheels/hooks/useAnalytics.ts +27 -0
- package/src/movethewheels/hooks/useCustomers.ts +64 -24
- package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
- package/src/movethewheels/hooks/useEpod.ts +14 -7
- package/src/movethewheels/hooks/useFleet.ts +58 -37
- package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
- package/src/movethewheels/hooks/useInventory.ts +211 -90
- package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
- package/src/movethewheels/hooks/useOrders.ts +13 -14
- package/src/movethewheels/hooks/useRoutes.ts +80 -23
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
- package/src/movethewheels/pages/CustomersPage.tsx +11 -1
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
- package/src/movethewheels/pages/DriversPage.tsx +24 -12
- package/src/movethewheels/pages/InventoryPage.tsx +57 -32
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
- package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
- package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
- package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
- package/src/movethewheels/pages/ProductsPage.tsx +11 -1
- package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
- package/src/movethewheels/pages/RoutesPage.tsx +11 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
- package/src/movethewheels/types/index.ts +7 -5
- package/src/movethewheels/utils/navigation.ts +32 -0
package/dist/pages/RoutesPage.js
CHANGED
|
@@ -10,73 +10,75 @@ import { ROUTE_STATUS_COLORS as u } from "../constants/index.js";
|
|
|
10
10
|
import { StatusBadge as d } from "../components/StatusBadge.js";
|
|
11
11
|
import { DataTable as f } from "../components/DataTable.js";
|
|
12
12
|
import { formatDate as p } from "../utils/formatters.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { useDebouncedValue as m } from "../hooks/useDebouncedValue.js";
|
|
14
|
+
import { useState as h } from "react";
|
|
15
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
import { CTAOverflowMenu as v, EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/movethewheels/pages/RoutesPage.tsx
|
|
17
|
-
function
|
|
18
|
-
let { basePath:
|
|
19
|
-
limit:
|
|
20
|
-
offset:
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
function x() {
|
|
19
|
+
let { basePath: x, navigate: S } = i(), [C, w] = h(0), [T, E] = h(25), [D, O] = h(""), k = m(D), { routes: A, totalRoutes: j, hasMore: M, isLoading: N, error: P, refetch: F } = o({
|
|
20
|
+
limit: T,
|
|
21
|
+
offset: C * T,
|
|
22
|
+
search: k || void 0
|
|
23
|
+
}), { stats: I } = a(), L = (e) => S?.(r(x, e));
|
|
24
|
+
return /* @__PURE__ */ _(l, {
|
|
23
25
|
title: "Routes",
|
|
24
|
-
subtitle: `${
|
|
25
|
-
icon: /* @__PURE__ */
|
|
26
|
-
headerActions: /* @__PURE__ */
|
|
26
|
+
subtitle: `${I.totalRoutes} routes`,
|
|
27
|
+
icon: /* @__PURE__ */ g(e, { size: 24 }),
|
|
28
|
+
headerActions: /* @__PURE__ */ g(v, {
|
|
27
29
|
primary: {
|
|
28
30
|
label: "Create Route",
|
|
29
|
-
icon: /* @__PURE__ */
|
|
30
|
-
onSelect: () =>
|
|
31
|
+
icon: /* @__PURE__ */ g(t, { size: 16 }),
|
|
32
|
+
onSelect: () => L("routes/new")
|
|
31
33
|
},
|
|
32
34
|
actions: [{
|
|
33
35
|
label: "Refresh",
|
|
34
|
-
icon: /* @__PURE__ */
|
|
35
|
-
onSelect: () =>
|
|
36
|
+
icon: /* @__PURE__ */ g(n, { size: 16 }),
|
|
37
|
+
onSelect: () => F()
|
|
36
38
|
}]
|
|
37
39
|
}),
|
|
38
40
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
icon: /* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ g(b, {
|
|
42
|
+
icon: /* @__PURE__ */ g(e, { size: 18 }),
|
|
41
43
|
children: "Routes group multiple delivery stops into an optimized driving plan. Build a route to batch nearby drop-offs, cut distance and fuel, and give drivers a single ordered itinerary — then open one to review stops, distance and optimization status."
|
|
42
44
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ _(y, { children: [/* @__PURE__ */ g("p", {
|
|
44
46
|
className: "text-sm font-medium text-text-secondary",
|
|
45
47
|
children: "Routes at a glance"
|
|
46
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ _("div", {
|
|
47
49
|
className: "mt-3 grid grid-cols-3 gap-4",
|
|
48
50
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
50
52
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
51
|
-
children:
|
|
52
|
-
}), /* @__PURE__ */
|
|
53
|
+
children: I.totalRoutes
|
|
54
|
+
}), /* @__PURE__ */ g("p", {
|
|
53
55
|
className: "text-xs text-text-secondary",
|
|
54
56
|
children: "Total routes"
|
|
55
57
|
})] }),
|
|
56
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
57
59
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
58
|
-
children:
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
+
children: I.inProgressRoutes
|
|
61
|
+
}), /* @__PURE__ */ g("p", {
|
|
60
62
|
className: "text-xs text-text-secondary",
|
|
61
63
|
children: "In progress"
|
|
62
64
|
})] }),
|
|
63
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
|
|
64
66
|
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
65
|
-
children:
|
|
66
|
-
}), /* @__PURE__ */
|
|
67
|
+
children: I.optimizedRoutes
|
|
68
|
+
}), /* @__PURE__ */ g("p", {
|
|
67
69
|
className: "text-xs text-text-secondary",
|
|
68
70
|
children: "Optimized"
|
|
69
71
|
})] })
|
|
70
72
|
]
|
|
71
73
|
})] }),
|
|
72
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ g(f, {
|
|
73
75
|
columns: [
|
|
74
76
|
{
|
|
75
77
|
id: "name",
|
|
76
78
|
header: "Route Name",
|
|
77
79
|
accessorKey: "name",
|
|
78
80
|
sortable: !0,
|
|
79
|
-
cell: (e) => /* @__PURE__ */
|
|
81
|
+
cell: (e) => /* @__PURE__ */ g("span", {
|
|
80
82
|
className: "font-medium",
|
|
81
83
|
children: e.name
|
|
82
84
|
})
|
|
@@ -86,7 +88,7 @@ function b() {
|
|
|
86
88
|
header: "Status",
|
|
87
89
|
accessorKey: "status",
|
|
88
90
|
sortable: !0,
|
|
89
|
-
cell: (e) => /* @__PURE__ */
|
|
91
|
+
cell: (e) => /* @__PURE__ */ g(d, {
|
|
90
92
|
status: e.status,
|
|
91
93
|
customColors: u[e.status]
|
|
92
94
|
})
|
|
@@ -94,7 +96,7 @@ function b() {
|
|
|
94
96
|
{
|
|
95
97
|
id: "stops",
|
|
96
98
|
header: "Stops",
|
|
97
|
-
cell: (e) => /* @__PURE__ */
|
|
99
|
+
cell: (e) => /* @__PURE__ */ _(s, {
|
|
98
100
|
variant: "secondary",
|
|
99
101
|
children: [e.stops.length, " stops"]
|
|
100
102
|
})
|
|
@@ -114,7 +116,7 @@ function b() {
|
|
|
114
116
|
{
|
|
115
117
|
id: "optimized",
|
|
116
118
|
header: "Optimized",
|
|
117
|
-
cell: (e) => /* @__PURE__ */
|
|
119
|
+
cell: (e) => /* @__PURE__ */ g(s, {
|
|
118
120
|
variant: e.optimized ? "default" : "outline",
|
|
119
121
|
children: e.optimized ? "Yes" : "No"
|
|
120
122
|
})
|
|
@@ -127,28 +129,33 @@ function b() {
|
|
|
127
129
|
cell: (e) => p(e.createdAt, "short")
|
|
128
130
|
}
|
|
129
131
|
],
|
|
130
|
-
data:
|
|
131
|
-
isLoading:
|
|
132
|
-
error:
|
|
133
|
-
onRetry:
|
|
132
|
+
data: A,
|
|
133
|
+
isLoading: N,
|
|
134
|
+
error: P,
|
|
135
|
+
onRetry: F,
|
|
134
136
|
searchable: !0,
|
|
135
137
|
searchPlaceholder: "Search routes...",
|
|
136
138
|
searchFields: ["name"],
|
|
137
|
-
|
|
139
|
+
searchQuery: D,
|
|
140
|
+
onSearchQueryChange: (e) => {
|
|
141
|
+
O(e), w(0);
|
|
142
|
+
},
|
|
143
|
+
onRowClick: (e) => L(`routes/${e.id}`),
|
|
138
144
|
getRowId: (e) => e.id,
|
|
139
|
-
pageIndex:
|
|
140
|
-
pageSize:
|
|
141
|
-
onPageChange:
|
|
145
|
+
pageIndex: C,
|
|
146
|
+
pageSize: T,
|
|
147
|
+
onPageChange: w,
|
|
142
148
|
onPageSizeChange: (e) => {
|
|
143
|
-
|
|
149
|
+
E(e), w(0);
|
|
144
150
|
},
|
|
145
|
-
|
|
151
|
+
totalItems: j,
|
|
152
|
+
hasNextPage: M,
|
|
146
153
|
emptyIllustration: "empty-data",
|
|
147
154
|
emptyTitle: "No routes yet",
|
|
148
155
|
emptyDescription: "Create a route to batch deliveries into an optimized driving plan.",
|
|
149
|
-
emptyAction: /* @__PURE__ */
|
|
150
|
-
onClick: () =>
|
|
151
|
-
children: [/* @__PURE__ */
|
|
156
|
+
emptyAction: /* @__PURE__ */ _(c, {
|
|
157
|
+
onClick: () => L("routes/new"),
|
|
158
|
+
children: [/* @__PURE__ */ g(t, {
|
|
152
159
|
size: 16,
|
|
153
160
|
className: "mr-1.5"
|
|
154
161
|
}), "Create Route"]
|
|
@@ -158,4 +165,4 @@ function b() {
|
|
|
158
165
|
});
|
|
159
166
|
}
|
|
160
167
|
//#endregion
|
|
161
|
-
export {
|
|
168
|
+
export { x as default };
|
|
@@ -13,83 +13,85 @@ import { PageLayout as f } from "../components/PageLayout.js";
|
|
|
13
13
|
import { MetricCard as p, MetricGrid as m } from "../components/MetricCard.js";
|
|
14
14
|
import { StatusBadge as h, VehicleTypeBadge as g } from "../components/StatusBadge.js";
|
|
15
15
|
import { DataTable as _ } from "../components/DataTable.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { useDebouncedValue as v } from "../hooks/useDebouncedValue.js";
|
|
17
|
+
import { useState as y } from "react";
|
|
18
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
19
|
+
import { CTAOverflowMenu as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
19
20
|
//#region src/movethewheels/pages/VehiclesPage.tsx
|
|
20
|
-
function
|
|
21
|
-
let { basePath:
|
|
22
|
-
limit:
|
|
23
|
-
offset:
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
function w() {
|
|
22
|
+
let { basePath: w, navigate: T } = c(), [E, D] = y(0), [O, k] = y(25), [A, j] = y(""), M = v(A), { vehicles: N, totalVehicles: P, hasMore: F, isLoading: I, error: L, refetch: R } = u({
|
|
23
|
+
limit: O,
|
|
24
|
+
offset: E * O,
|
|
25
|
+
search: M || void 0
|
|
26
|
+
}), { stats: z } = l(), B = z.totalVehicles, V = (e) => {
|
|
27
|
+
T && T(s(w, e));
|
|
26
28
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ x(f, {
|
|
28
30
|
title: "Vehicles",
|
|
29
|
-
subtitle: `${
|
|
30
|
-
icon: /* @__PURE__ */
|
|
31
|
-
headerActions: /* @__PURE__ */
|
|
31
|
+
subtitle: `${B} vehicles in fleet`,
|
|
32
|
+
icon: /* @__PURE__ */ b(a, { size: 24 }),
|
|
33
|
+
headerActions: /* @__PURE__ */ b(S, {
|
|
32
34
|
primary: {
|
|
33
35
|
label: "Add Vehicle",
|
|
34
|
-
icon: /* @__PURE__ */
|
|
35
|
-
onSelect: () =>
|
|
36
|
+
icon: /* @__PURE__ */ b(n, { size: 16 }),
|
|
37
|
+
onSelect: () => V("fleet/vehicles/new")
|
|
36
38
|
},
|
|
37
39
|
actions: [{
|
|
38
40
|
label: "Refresh",
|
|
39
|
-
icon: /* @__PURE__ */
|
|
40
|
-
onSelect: () =>
|
|
41
|
+
icon: /* @__PURE__ */ b(r, { size: 16 }),
|
|
42
|
+
onSelect: () => R()
|
|
41
43
|
}, {
|
|
42
44
|
label: "Export",
|
|
43
|
-
icon: /* @__PURE__ */
|
|
44
|
-
onSelect: () =>
|
|
45
|
+
icon: /* @__PURE__ */ b(t, { size: 16 }),
|
|
46
|
+
onSelect: () => V("import-export")
|
|
45
47
|
}]
|
|
46
48
|
}),
|
|
47
49
|
children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
icon: /* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ b(C, {
|
|
51
|
+
icon: /* @__PURE__ */ b(a, { size: 18 }),
|
|
50
52
|
children: "Every truck, van and bike in your fleet. Monitor capacity, fuel level, mileage and maintenance status here so you always know which vehicles are road-ready before dispatching an order."
|
|
51
53
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
53
55
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
54
56
|
children: "Fleet at a glance"
|
|
55
|
-
}), /* @__PURE__ */
|
|
57
|
+
}), /* @__PURE__ */ x(m, {
|
|
56
58
|
columns: 4,
|
|
57
59
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ b(p, {
|
|
59
61
|
label: "Total vehicles",
|
|
60
|
-
value:
|
|
61
|
-
icon: /* @__PURE__ */
|
|
62
|
+
value: B,
|
|
63
|
+
icon: /* @__PURE__ */ b(a, { size: 20 }),
|
|
62
64
|
accent: "brand"
|
|
63
65
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ b(p, {
|
|
65
67
|
label: "Available now",
|
|
66
|
-
value:
|
|
67
|
-
icon: /* @__PURE__ */
|
|
68
|
+
value: z.vehiclesByStatus.available,
|
|
69
|
+
icon: /* @__PURE__ */ b(e, { size: 20 }),
|
|
68
70
|
accent: "success",
|
|
69
71
|
subtitle: "Ready to dispatch"
|
|
70
72
|
}),
|
|
71
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ b(p, {
|
|
72
74
|
label: "On assignment",
|
|
73
|
-
value:
|
|
74
|
-
icon: /* @__PURE__ */
|
|
75
|
+
value: z.vehiclesByStatus.assigned,
|
|
76
|
+
icon: /* @__PURE__ */ b(i, { size: 20 }),
|
|
75
77
|
accent: "blue"
|
|
76
78
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ b(p, {
|
|
78
80
|
label: "In maintenance",
|
|
79
|
-
value:
|
|
80
|
-
icon: /* @__PURE__ */
|
|
81
|
+
value: z.vehiclesByStatus.maintenance,
|
|
82
|
+
icon: /* @__PURE__ */ b(o, { size: 20 }),
|
|
81
83
|
accent: "warning"
|
|
82
84
|
})
|
|
83
85
|
]
|
|
84
86
|
})] }),
|
|
85
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ b(_, {
|
|
86
88
|
columns: [
|
|
87
89
|
{
|
|
88
90
|
id: "vehicleNumber",
|
|
89
91
|
header: "Vehicle #",
|
|
90
92
|
accessorKey: "vehicleNumber",
|
|
91
93
|
sortable: !0,
|
|
92
|
-
cell: (e) => /* @__PURE__ */
|
|
94
|
+
cell: (e) => /* @__PURE__ */ b("span", {
|
|
93
95
|
className: "font-medium",
|
|
94
96
|
children: e.vehicleNumber
|
|
95
97
|
})
|
|
@@ -98,19 +100,19 @@ function C() {
|
|
|
98
100
|
id: "type",
|
|
99
101
|
header: "Type",
|
|
100
102
|
accessorKey: "type",
|
|
101
|
-
cell: (e) => /* @__PURE__ */
|
|
103
|
+
cell: (e) => /* @__PURE__ */ b(g, { type: e.type })
|
|
102
104
|
},
|
|
103
105
|
{
|
|
104
106
|
id: "details",
|
|
105
107
|
header: "Vehicle",
|
|
106
|
-
cell: (e) => /* @__PURE__ */
|
|
108
|
+
cell: (e) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
|
|
107
109
|
className: "font-medium",
|
|
108
110
|
children: [
|
|
109
111
|
e.make,
|
|
110
112
|
" ",
|
|
111
113
|
e.model
|
|
112
114
|
]
|
|
113
|
-
}), /* @__PURE__ */
|
|
115
|
+
}), /* @__PURE__ */ b("p", {
|
|
114
116
|
className: "text-sm text-text-secondary",
|
|
115
117
|
children: e.year
|
|
116
118
|
})] })
|
|
@@ -120,7 +122,7 @@ function C() {
|
|
|
120
122
|
header: "Status",
|
|
121
123
|
accessorKey: "status",
|
|
122
124
|
sortable: !0,
|
|
123
|
-
cell: (e) => /* @__PURE__ */
|
|
125
|
+
cell: (e) => /* @__PURE__ */ b(h, {
|
|
124
126
|
status: e.status,
|
|
125
127
|
type: "vehicle"
|
|
126
128
|
})
|
|
@@ -128,9 +130,9 @@ function C() {
|
|
|
128
130
|
{
|
|
129
131
|
id: "capacity",
|
|
130
132
|
header: "Capacity",
|
|
131
|
-
cell: (e) => /* @__PURE__ */
|
|
133
|
+
cell: (e) => /* @__PURE__ */ x("div", {
|
|
132
134
|
className: "text-sm",
|
|
133
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ x("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ x("p", {
|
|
134
136
|
className: "text-text-secondary",
|
|
135
137
|
children: [e.capacity.volume, " m³"]
|
|
136
138
|
})]
|
|
@@ -139,12 +141,12 @@ function C() {
|
|
|
139
141
|
{
|
|
140
142
|
id: "fuel",
|
|
141
143
|
header: "Fuel Level",
|
|
142
|
-
cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */
|
|
144
|
+
cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */ x("div", {
|
|
143
145
|
className: "flex items-center gap-2",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ b(d, {
|
|
145
147
|
value: e.fuelLevel,
|
|
146
148
|
className: "w-16 h-2"
|
|
147
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ x("span", {
|
|
148
150
|
className: "text-sm",
|
|
149
151
|
children: [e.fuelLevel, "%"]
|
|
150
152
|
})]
|
|
@@ -158,10 +160,10 @@ function C() {
|
|
|
158
160
|
cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
|
|
159
161
|
}
|
|
160
162
|
],
|
|
161
|
-
data:
|
|
162
|
-
isLoading:
|
|
163
|
-
error:
|
|
164
|
-
onRetry:
|
|
163
|
+
data: N,
|
|
164
|
+
isLoading: I,
|
|
165
|
+
error: L,
|
|
166
|
+
onRetry: R,
|
|
165
167
|
searchable: !0,
|
|
166
168
|
searchPlaceholder: "Search vehicles...",
|
|
167
169
|
searchFields: [
|
|
@@ -169,15 +171,20 @@ function C() {
|
|
|
169
171
|
"make",
|
|
170
172
|
"model"
|
|
171
173
|
],
|
|
172
|
-
|
|
174
|
+
searchQuery: A,
|
|
175
|
+
onSearchQueryChange: (e) => {
|
|
176
|
+
j(e), D(0);
|
|
177
|
+
},
|
|
178
|
+
onRowClick: (e) => V(`fleet/vehicles/${e.id}`),
|
|
173
179
|
getRowId: (e) => e.id,
|
|
174
|
-
pageIndex:
|
|
175
|
-
pageSize:
|
|
176
|
-
onPageChange:
|
|
180
|
+
pageIndex: E,
|
|
181
|
+
pageSize: O,
|
|
182
|
+
onPageChange: D,
|
|
177
183
|
onPageSizeChange: (e) => {
|
|
178
|
-
|
|
184
|
+
k(e), D(0);
|
|
179
185
|
},
|
|
180
186
|
totalItems: P,
|
|
187
|
+
hasNextPage: F,
|
|
181
188
|
emptyIllustration: "empty-data",
|
|
182
189
|
emptyTitle: "No vehicles yet",
|
|
183
190
|
emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
|
|
@@ -186,4 +193,4 @@ function C() {
|
|
|
186
193
|
});
|
|
187
194
|
}
|
|
188
195
|
//#endregion
|
|
189
|
-
export {
|
|
196
|
+
export { w as default };
|
|
@@ -10,74 +10,76 @@ import { Badge as l, Progress as u } from "../components/ui.js";
|
|
|
10
10
|
import { PageLayout as d } from "../components/PageLayout.js";
|
|
11
11
|
import { MetricCard as f, MetricGrid as p } from "../components/MetricCard.js";
|
|
12
12
|
import { DataTable as m } from "../components/DataTable.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { useDebouncedValue as h } from "../hooks/useDebouncedValue.js";
|
|
14
|
+
import { useState as g } from "react";
|
|
15
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
16
|
+
import { CTAOverflowMenu as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/movethewheels/pages/WarehousesPage.tsx
|
|
17
|
-
function
|
|
18
|
-
let { basePath:
|
|
19
|
-
limit:
|
|
20
|
-
offset:
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
function x() {
|
|
19
|
+
let { basePath: x, navigate: S } = o(), [C, w] = g(0), [T, E] = g(25), [D, O] = g(""), k = h(D), { warehouses: A, totalWarehouses: j, hasMore: M, isLoading: N, error: P, refetch: F } = c({
|
|
20
|
+
limit: T,
|
|
21
|
+
offset: C * T,
|
|
22
|
+
search: k
|
|
23
|
+
}), { stats: I } = s(), L = (e) => S?.(a(x, e));
|
|
24
|
+
return /* @__PURE__ */ v(d, {
|
|
23
25
|
title: "Warehouses",
|
|
24
|
-
subtitle: `${
|
|
25
|
-
icon: /* @__PURE__ */
|
|
26
|
-
headerActions: /* @__PURE__ */
|
|
26
|
+
subtitle: `${I.total} warehouses`,
|
|
27
|
+
icon: /* @__PURE__ */ _(i, { size: 24 }),
|
|
28
|
+
headerActions: /* @__PURE__ */ _(y, {
|
|
27
29
|
primary: {
|
|
28
30
|
label: "Add Warehouse",
|
|
29
|
-
icon: /* @__PURE__ */
|
|
30
|
-
onSelect: () =>
|
|
31
|
+
icon: /* @__PURE__ */ _(n, { size: 16 }),
|
|
32
|
+
onSelect: () => L("inventory/warehouses/new")
|
|
31
33
|
},
|
|
32
34
|
actions: [{
|
|
33
35
|
label: "Refresh",
|
|
34
|
-
icon: /* @__PURE__ */
|
|
35
|
-
onSelect: () =>
|
|
36
|
+
icon: /* @__PURE__ */ _(r, { size: 16 }),
|
|
37
|
+
onSelect: () => F()
|
|
36
38
|
}]
|
|
37
39
|
}),
|
|
38
40
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
icon: /* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ _(b, {
|
|
42
|
+
icon: /* @__PURE__ */ _(i, { size: 18 }),
|
|
41
43
|
children: "Your storage and fulfilment sites. Watch space and pallet utilization across each warehouse to balance stock, spot capacity crunches, and decide where to fulfil an order from."
|
|
42
44
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
44
46
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
45
47
|
children: "Network at a glance"
|
|
46
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ v(p, {
|
|
47
49
|
columns: 3,
|
|
48
50
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
51
|
+
/* @__PURE__ */ _(f, {
|
|
50
52
|
label: "Total sites",
|
|
51
|
-
value:
|
|
52
|
-
icon: /* @__PURE__ */
|
|
53
|
+
value: I.total,
|
|
54
|
+
icon: /* @__PURE__ */ _(i, { size: 20 }),
|
|
53
55
|
accent: "brand"
|
|
54
56
|
}),
|
|
55
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ _(f, {
|
|
56
58
|
label: "Active",
|
|
57
|
-
value:
|
|
58
|
-
icon: /* @__PURE__ */
|
|
59
|
+
value: I.active,
|
|
60
|
+
icon: /* @__PURE__ */ _(e, { size: 20 }),
|
|
59
61
|
accent: "success",
|
|
60
62
|
subtitle: "Fulfilling orders"
|
|
61
63
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ _(f, {
|
|
63
65
|
label: "Avg utilization",
|
|
64
|
-
value:
|
|
65
|
-
icon: /* @__PURE__ */
|
|
66
|
+
value: I.total > 0 ? `${Math.round(I.avgUtilization * 100)}%` : "—",
|
|
67
|
+
icon: /* @__PURE__ */ _(t, { size: 20 }),
|
|
66
68
|
accent: "blue"
|
|
67
69
|
})
|
|
68
70
|
]
|
|
69
71
|
})] }),
|
|
70
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ _(m, {
|
|
71
73
|
columns: [
|
|
72
74
|
{
|
|
73
75
|
id: "name",
|
|
74
76
|
header: "Warehouse",
|
|
75
77
|
accessorKey: "name",
|
|
76
78
|
sortable: !0,
|
|
77
|
-
cell: (e) => /* @__PURE__ */
|
|
79
|
+
cell: (e) => /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
78
80
|
className: "font-medium",
|
|
79
81
|
children: e.name
|
|
80
|
-
}), /* @__PURE__ */
|
|
82
|
+
}), /* @__PURE__ */ _("p", {
|
|
81
83
|
className: "text-sm text-text-secondary",
|
|
82
84
|
children: e.code
|
|
83
85
|
})] })
|
|
@@ -85,11 +87,11 @@ function b() {
|
|
|
85
87
|
{
|
|
86
88
|
id: "location",
|
|
87
89
|
header: "Location",
|
|
88
|
-
cell: (e) => /* @__PURE__ */
|
|
90
|
+
cell: (e) => /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("p", { children: [
|
|
89
91
|
e.address.city,
|
|
90
92
|
", ",
|
|
91
93
|
e.address.state
|
|
92
|
-
] }), /* @__PURE__ */
|
|
94
|
+
] }), /* @__PURE__ */ _("p", {
|
|
93
95
|
className: "text-sm text-text-secondary",
|
|
94
96
|
children: e.address.country
|
|
95
97
|
})] })
|
|
@@ -98,7 +100,7 @@ function b() {
|
|
|
98
100
|
id: "type",
|
|
99
101
|
header: "Type",
|
|
100
102
|
accessorKey: "type",
|
|
101
|
-
cell: (e) => /* @__PURE__ */
|
|
103
|
+
cell: (e) => /* @__PURE__ */ _(l, {
|
|
102
104
|
variant: "outline",
|
|
103
105
|
className: "capitalize",
|
|
104
106
|
children: e.type.replace("_", " ")
|
|
@@ -109,12 +111,12 @@ function b() {
|
|
|
109
111
|
header: "Utilization",
|
|
110
112
|
cell: (e) => {
|
|
111
113
|
let t = e.capacity.usedSpace / e.capacity.totalSpace * 100;
|
|
112
|
-
return /* @__PURE__ */
|
|
114
|
+
return /* @__PURE__ */ v("div", {
|
|
113
115
|
className: "flex items-center gap-2",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
116
|
+
children: [/* @__PURE__ */ _(u, {
|
|
115
117
|
value: t,
|
|
116
118
|
className: "w-16 h-2"
|
|
117
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ v("span", {
|
|
118
120
|
className: "text-sm",
|
|
119
121
|
children: [t.toFixed(0), "%"]
|
|
120
122
|
})]
|
|
@@ -124,15 +126,15 @@ function b() {
|
|
|
124
126
|
{
|
|
125
127
|
id: "capacity",
|
|
126
128
|
header: "Capacity",
|
|
127
|
-
cell: (e) => /* @__PURE__ */
|
|
129
|
+
cell: (e) => /* @__PURE__ */ v("div", {
|
|
128
130
|
className: "text-sm",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
131
|
+
children: [/* @__PURE__ */ v("p", { children: [
|
|
130
132
|
e.capacity.usedSpace.toLocaleString(),
|
|
131
133
|
" / ",
|
|
132
134
|
e.capacity.totalSpace.toLocaleString(),
|
|
133
135
|
" ",
|
|
134
136
|
"sq ft"
|
|
135
|
-
] }), /* @__PURE__ */
|
|
137
|
+
] }), /* @__PURE__ */ v("p", {
|
|
136
138
|
className: "text-text-secondary",
|
|
137
139
|
children: [
|
|
138
140
|
e.capacity.usedPallets,
|
|
@@ -146,28 +148,33 @@ function b() {
|
|
|
146
148
|
{
|
|
147
149
|
id: "status",
|
|
148
150
|
header: "Status",
|
|
149
|
-
cell: (e) => /* @__PURE__ */
|
|
151
|
+
cell: (e) => /* @__PURE__ */ _(l, {
|
|
150
152
|
variant: e.isActive ? "default" : "secondary",
|
|
151
153
|
children: e.isActive ? "Active" : "Inactive"
|
|
152
154
|
})
|
|
153
155
|
}
|
|
154
156
|
],
|
|
155
|
-
data:
|
|
156
|
-
isLoading:
|
|
157
|
-
error:
|
|
158
|
-
onRetry:
|
|
157
|
+
data: A,
|
|
158
|
+
isLoading: N,
|
|
159
|
+
error: P,
|
|
160
|
+
onRetry: F,
|
|
159
161
|
searchable: !0,
|
|
160
162
|
searchPlaceholder: "Search warehouses...",
|
|
161
163
|
searchFields: ["name", "code"],
|
|
162
|
-
|
|
164
|
+
searchQuery: D,
|
|
165
|
+
onSearchQueryChange: (e) => {
|
|
166
|
+
O(e), w(0);
|
|
167
|
+
},
|
|
168
|
+
onRowClick: (e) => L(`inventory/warehouses/${e.id}`),
|
|
163
169
|
getRowId: (e) => e.id,
|
|
164
|
-
pageIndex:
|
|
165
|
-
pageSize:
|
|
166
|
-
onPageChange:
|
|
170
|
+
pageIndex: C,
|
|
171
|
+
pageSize: T,
|
|
172
|
+
onPageChange: w,
|
|
167
173
|
onPageSizeChange: (e) => {
|
|
168
|
-
|
|
174
|
+
E(e), w(0);
|
|
169
175
|
},
|
|
170
|
-
|
|
176
|
+
totalItems: j,
|
|
177
|
+
hasNextPage: M,
|
|
171
178
|
emptyIllustration: "empty-data",
|
|
172
179
|
emptyTitle: "No warehouses yet",
|
|
173
180
|
emptyDescription: "Add a warehouse to store inventory and fulfil orders from it."
|
|
@@ -176,4 +183,4 @@ function b() {
|
|
|
176
183
|
});
|
|
177
184
|
}
|
|
178
185
|
//#endregion
|
|
179
|
-
export {
|
|
186
|
+
export { x as default };
|
package/dist/utils/navigation.js
CHANGED
|
@@ -2,5 +2,26 @@
|
|
|
2
2
|
function e(e, t) {
|
|
3
3
|
return (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
|
|
4
4
|
}
|
|
5
|
+
function t(e, t) {
|
|
6
|
+
if (!t || Object.keys(t).length === 0) return e;
|
|
7
|
+
let n = new URLSearchParams();
|
|
8
|
+
for (let [e, r] of Object.entries(t)) r != null && r !== "" && n.set(e, String(r));
|
|
9
|
+
let r = n.toString();
|
|
10
|
+
return r ? `${e}?${r}` : e;
|
|
11
|
+
}
|
|
12
|
+
var n = [/^orders\/new$/, /^orders\/[^/?#]+\/edit$/];
|
|
13
|
+
function r(e) {
|
|
14
|
+
if (!e || e.length > 200 || e.includes("://") || e.startsWith("/")) return null;
|
|
15
|
+
let [t] = e.split(/[?#]/, 1);
|
|
16
|
+
return n.some((e) => e.test(t)) ? t : null;
|
|
17
|
+
}
|
|
18
|
+
function i(e, n) {
|
|
19
|
+
let i = r(e);
|
|
20
|
+
return i ? t(i, { customerId: n }) : e;
|
|
21
|
+
}
|
|
22
|
+
function a(e) {
|
|
23
|
+
let n = r(e);
|
|
24
|
+
return n ? t("customers/new", { returnTo: n }) : "customers/new";
|
|
25
|
+
}
|
|
5
26
|
//#endregion
|
|
6
|
-
export { e as joinPath };
|
|
27
|
+
export { a as buildCustomerCreatePath, i as buildOrderCustomerPath, r as getSafeCustomerReturnPath, e as joinPath };
|