@burdenoff/microfe-movethewheels 2026.920.3 → 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.
Files changed (77) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +1043 -5
  6. package/dist/hooks/useAnalytics.js +21 -1
  7. package/dist/hooks/useCustomers.js +94 -78
  8. package/dist/hooks/useDebouncedValue.js +11 -0
  9. package/dist/hooks/useEntityDocuments.js +28 -18
  10. package/dist/hooks/useEpod.js +24 -17
  11. package/dist/hooks/useFleet.js +146 -125
  12. package/dist/hooks/useInventory.js +255 -186
  13. package/dist/hooks/useMultiModalShipments.js +35 -27
  14. package/dist/hooks/useOrders.js +73 -73
  15. package/dist/hooks/useRoutes.js +97 -75
  16. package/dist/hooks/useTracking.js +100 -88
  17. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  18. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  19. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  20. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  21. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  22. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  23. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  24. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  25. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  26. package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
  27. package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
  28. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  29. package/dist/movethewheels/types/index.d.ts +7 -5
  30. package/dist/pages/CreateOrderPage.js +207 -201
  31. package/dist/pages/CustomersPage.js +61 -54
  32. package/dist/pages/DeliveryCapturePage.js +131 -109
  33. package/dist/pages/DriversPage.js +100 -92
  34. package/dist/pages/InventoryPage.js +239 -236
  35. package/dist/pages/MultiModalShipmentPage.js +163 -130
  36. package/dist/pages/OrderDetailsPage.js +224 -208
  37. package/dist/pages/OrdersListPage.js +66 -60
  38. package/dist/pages/ProductDetailsPage.js +241 -200
  39. package/dist/pages/ProductsPage.js +59 -52
  40. package/dist/pages/RouteDetailsPage.js +343 -321
  41. package/dist/pages/RoutesPage.js +55 -48
  42. package/dist/pages/VehiclesPage.js +63 -56
  43. package/dist/pages/WarehousesPage.js +60 -53
  44. package/package.json +1 -1
  45. package/src/generated/wspace-types.ts +1188 -5
  46. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  47. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  48. package/src/movethewheels/components/DataTable.tsx +34 -18
  49. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  50. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  51. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  52. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  53. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  54. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  55. package/src/movethewheels/hooks/useEpod.ts +14 -7
  56. package/src/movethewheels/hooks/useFleet.ts +58 -37
  57. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  58. package/src/movethewheels/hooks/useInventory.ts +211 -90
  59. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  60. package/src/movethewheels/hooks/useOrders.ts +13 -14
  61. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  62. package/src/movethewheels/hooks/useTracking.ts +130 -98
  63. package/src/movethewheels/pages/CreateOrderPage.tsx +9 -1
  64. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  65. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  66. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  67. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  68. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  69. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  70. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  71. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  72. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  73. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  74. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  75. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  76. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  77. package/src/movethewheels/types/index.ts +7 -5
@@ -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 { useState as m } from "react";
14
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
15
- import { CTAOverflowMenu as _, EmphasisPanel as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
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 b() {
18
- let { basePath: b, navigate: x } = i(), [S, C] = m(0), [w, T] = m(25), { routes: E, hasMore: D, isLoading: O, error: k, refetch: A } = o({
19
- limit: w,
20
- offset: S * w
21
- }), { stats: j } = a(), M = (e) => x?.(r(b, e));
22
- return /* @__PURE__ */ g(l, {
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: `${j.totalRoutes} routes`,
25
- icon: /* @__PURE__ */ h(e, { size: 24 }),
26
- headerActions: /* @__PURE__ */ h(_, {
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__ */ h(t, { size: 16 }),
30
- onSelect: () => M("routes/new")
31
+ icon: /* @__PURE__ */ g(t, { size: 16 }),
32
+ onSelect: () => L("routes/new")
31
33
  },
32
34
  actions: [{
33
35
  label: "Refresh",
34
- icon: /* @__PURE__ */ h(n, { size: 16 }),
35
- onSelect: () => A()
36
+ icon: /* @__PURE__ */ g(n, { size: 16 }),
37
+ onSelect: () => F()
36
38
  }]
37
39
  }),
38
40
  children: [
39
- /* @__PURE__ */ h(y, {
40
- icon: /* @__PURE__ */ h(e, { size: 18 }),
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__ */ g(v, { children: [/* @__PURE__ */ h("p", {
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__ */ g("div", {
48
+ }), /* @__PURE__ */ _("div", {
47
49
  className: "mt-3 grid grid-cols-3 gap-4",
48
50
  children: [
49
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
51
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
50
52
  className: "text-2xl font-bold text-text-primary tabular-nums",
51
- children: j.totalRoutes
52
- }), /* @__PURE__ */ h("p", {
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__ */ g("div", { children: [/* @__PURE__ */ h("p", {
58
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
57
59
  className: "text-2xl font-bold text-text-primary tabular-nums",
58
- children: j.inProgressRoutes
59
- }), /* @__PURE__ */ h("p", {
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__ */ g("div", { children: [/* @__PURE__ */ h("p", {
65
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
64
66
  className: "text-2xl font-bold text-text-primary tabular-nums",
65
- children: j.optimizedRoutes
66
- }), /* @__PURE__ */ h("p", {
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__ */ h(f, {
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__ */ h("span", {
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__ */ h(d, {
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__ */ g(s, {
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__ */ h(s, {
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: E,
131
- isLoading: O,
132
- error: k,
133
- onRetry: A,
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
- onRowClick: (e) => M(`routes/${e.id}`),
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: S,
140
- pageSize: w,
141
- onPageChange: C,
145
+ pageIndex: C,
146
+ pageSize: T,
147
+ onPageChange: w,
142
148
  onPageSizeChange: (e) => {
143
- T(e), C(0);
149
+ E(e), w(0);
144
150
  },
145
- hasNextPage: D,
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__ */ g(c, {
150
- onClick: () => M("routes/new"),
151
- children: [/* @__PURE__ */ h(t, {
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 { b as default };
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 { useState as v } from "react";
17
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
18
- import { CTAOverflowMenu as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
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 C() {
21
- let { basePath: C, navigate: w } = c(), [T, E] = v(0), [D, O] = v(25), { vehicles: k, isLoading: A, error: j, refetch: M } = u({
22
- limit: D,
23
- offset: T * D
24
- }), { stats: N } = l(), P = N.totalVehicles, F = (e) => {
25
- w && w(s(C, e));
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__ */ b(f, {
29
+ return /* @__PURE__ */ x(f, {
28
30
  title: "Vehicles",
29
- subtitle: `${P} vehicles in fleet`,
30
- icon: /* @__PURE__ */ y(a, { size: 24 }),
31
- headerActions: /* @__PURE__ */ y(x, {
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__ */ y(n, { size: 16 }),
35
- onSelect: () => F("fleet/vehicles/new")
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__ */ y(r, { size: 16 }),
40
- onSelect: () => M()
41
+ icon: /* @__PURE__ */ b(r, { size: 16 }),
42
+ onSelect: () => R()
41
43
  }, {
42
44
  label: "Export",
43
- icon: /* @__PURE__ */ y(t, { size: 16 }),
44
- onSelect: () => F("import-export")
45
+ icon: /* @__PURE__ */ b(t, { size: 16 }),
46
+ onSelect: () => V("import-export")
45
47
  }]
46
48
  }),
47
49
  children: [
48
- /* @__PURE__ */ y(S, {
49
- icon: /* @__PURE__ */ y(a, { size: 18 }),
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__ */ b("div", { children: [/* @__PURE__ */ y("p", {
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__ */ b(m, {
57
+ }), /* @__PURE__ */ x(m, {
56
58
  columns: 4,
57
59
  children: [
58
- /* @__PURE__ */ y(p, {
60
+ /* @__PURE__ */ b(p, {
59
61
  label: "Total vehicles",
60
- value: P,
61
- icon: /* @__PURE__ */ y(a, { size: 20 }),
62
+ value: B,
63
+ icon: /* @__PURE__ */ b(a, { size: 20 }),
62
64
  accent: "brand"
63
65
  }),
64
- /* @__PURE__ */ y(p, {
66
+ /* @__PURE__ */ b(p, {
65
67
  label: "Available now",
66
- value: N.vehiclesByStatus.available,
67
- icon: /* @__PURE__ */ y(e, { size: 20 }),
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__ */ y(p, {
73
+ /* @__PURE__ */ b(p, {
72
74
  label: "On assignment",
73
- value: N.vehiclesByStatus.assigned,
74
- icon: /* @__PURE__ */ y(i, { size: 20 }),
75
+ value: z.vehiclesByStatus.assigned,
76
+ icon: /* @__PURE__ */ b(i, { size: 20 }),
75
77
  accent: "blue"
76
78
  }),
77
- /* @__PURE__ */ y(p, {
79
+ /* @__PURE__ */ b(p, {
78
80
  label: "In maintenance",
79
- value: N.vehiclesByStatus.maintenance,
80
- icon: /* @__PURE__ */ y(o, { size: 20 }),
81
+ value: z.vehiclesByStatus.maintenance,
82
+ icon: /* @__PURE__ */ b(o, { size: 20 }),
81
83
  accent: "warning"
82
84
  })
83
85
  ]
84
86
  })] }),
85
- /* @__PURE__ */ y(_, {
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__ */ y("span", {
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__ */ y(g, { type: e.type })
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__ */ b("div", { children: [/* @__PURE__ */ b("p", {
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__ */ y("p", {
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__ */ y(h, {
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__ */ b("div", {
133
+ cell: (e) => /* @__PURE__ */ x("div", {
132
134
  className: "text-sm",
133
- children: [/* @__PURE__ */ b("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ b("p", {
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__ */ b("div", {
144
+ cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */ x("div", {
143
145
  className: "flex items-center gap-2",
144
- children: [/* @__PURE__ */ y(d, {
146
+ children: [/* @__PURE__ */ b(d, {
145
147
  value: e.fuelLevel,
146
148
  className: "w-16 h-2"
147
- }), /* @__PURE__ */ b("span", {
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: k,
162
- isLoading: A,
163
- error: j,
164
- onRetry: M,
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
- onRowClick: (e) => F(`fleet/vehicles/${e.id}`),
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: T,
175
- pageSize: D,
176
- onPageChange: E,
180
+ pageIndex: E,
181
+ pageSize: O,
182
+ onPageChange: D,
177
183
  onPageSizeChange: (e) => {
178
- O(e), E(0);
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 { C as default };
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 { useState as h } from "react";
14
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
15
- import { CTAOverflowMenu as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
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 b() {
18
- let { basePath: b, navigate: x } = o(), [S, C] = h(0), [w, T] = h(25), { warehouses: E, hasMore: D, isLoading: O, error: k, refetch: A } = c({
19
- limit: w,
20
- offset: S * w
21
- }), { stats: j } = s(), M = (e) => x?.(a(b, e));
22
- return /* @__PURE__ */ _(d, {
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: `${j.total} warehouses`,
25
- icon: /* @__PURE__ */ g(i, { size: 24 }),
26
- headerActions: /* @__PURE__ */ g(v, {
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__ */ g(n, { size: 16 }),
30
- onSelect: () => M("inventory/warehouses/new")
31
+ icon: /* @__PURE__ */ _(n, { size: 16 }),
32
+ onSelect: () => L("inventory/warehouses/new")
31
33
  },
32
34
  actions: [{
33
35
  label: "Refresh",
34
- icon: /* @__PURE__ */ g(r, { size: 16 }),
35
- onSelect: () => A()
36
+ icon: /* @__PURE__ */ _(r, { size: 16 }),
37
+ onSelect: () => F()
36
38
  }]
37
39
  }),
38
40
  children: [
39
- /* @__PURE__ */ g(y, {
40
- icon: /* @__PURE__ */ g(i, { size: 18 }),
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__ */ _("div", { children: [/* @__PURE__ */ g("p", {
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__ */ _(p, {
48
+ }), /* @__PURE__ */ v(p, {
47
49
  columns: 3,
48
50
  children: [
49
- /* @__PURE__ */ g(f, {
51
+ /* @__PURE__ */ _(f, {
50
52
  label: "Total sites",
51
- value: j.total,
52
- icon: /* @__PURE__ */ g(i, { size: 20 }),
53
+ value: I.total,
54
+ icon: /* @__PURE__ */ _(i, { size: 20 }),
53
55
  accent: "brand"
54
56
  }),
55
- /* @__PURE__ */ g(f, {
57
+ /* @__PURE__ */ _(f, {
56
58
  label: "Active",
57
- value: j.active,
58
- icon: /* @__PURE__ */ g(e, { size: 20 }),
59
+ value: I.active,
60
+ icon: /* @__PURE__ */ _(e, { size: 20 }),
59
61
  accent: "success",
60
62
  subtitle: "Fulfilling orders"
61
63
  }),
62
- /* @__PURE__ */ g(f, {
64
+ /* @__PURE__ */ _(f, {
63
65
  label: "Avg utilization",
64
- value: j.total > 0 ? `${Math.round(j.avgUtilization * 100)}%` : "—",
65
- icon: /* @__PURE__ */ g(t, { size: 20 }),
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__ */ g(m, {
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__ */ _("div", { children: [/* @__PURE__ */ g("p", {
79
+ cell: (e) => /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
78
80
  className: "font-medium",
79
81
  children: e.name
80
- }), /* @__PURE__ */ g("p", {
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__ */ _("div", { children: [/* @__PURE__ */ _("p", { children: [
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__ */ g("p", {
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__ */ g(l, {
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__ */ _("div", {
114
+ return /* @__PURE__ */ v("div", {
113
115
  className: "flex items-center gap-2",
114
- children: [/* @__PURE__ */ g(u, {
116
+ children: [/* @__PURE__ */ _(u, {
115
117
  value: t,
116
118
  className: "w-16 h-2"
117
- }), /* @__PURE__ */ _("span", {
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__ */ _("div", {
129
+ cell: (e) => /* @__PURE__ */ v("div", {
128
130
  className: "text-sm",
129
- children: [/* @__PURE__ */ _("p", { children: [
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__ */ _("p", {
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__ */ g(l, {
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: E,
156
- isLoading: O,
157
- error: k,
158
- onRetry: A,
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
- onRowClick: (e) => M(`inventory/warehouses/${e.id}`),
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: S,
165
- pageSize: w,
166
- onPageChange: C,
170
+ pageIndex: C,
171
+ pageSize: T,
172
+ onPageChange: w,
167
173
  onPageSizeChange: (e) => {
168
- T(e), C(0);
174
+ E(e), w(0);
169
175
  },
170
- hasNextPage: D,
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 { b as default };
186
+ export { x as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-movethewheels",
3
- "version": "2026.920.3",
3
+ "version": "2026.921.1",
4
4
  "description": "Burdenoff MoveTheWheels Microfrontend - Logistics & Supply Chain Management Platform",
5
5
  "type": "module",
6
6
  "files": [