@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.
Files changed (79) 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 +2719 -8
  6. package/dist/hooks/index.js +1 -1
  7. package/dist/hooks/useAnalytics.js +21 -1
  8. package/dist/hooks/useCustomers.js +94 -78
  9. package/dist/hooks/useDebouncedValue.js +11 -0
  10. package/dist/hooks/useEntityDocuments.js +28 -18
  11. package/dist/hooks/useEpod.js +24 -17
  12. package/dist/hooks/useFleet.js +148 -125
  13. package/dist/hooks/useInventory.js +255 -186
  14. package/dist/hooks/useMultiModalShipments.js +35 -27
  15. package/dist/hooks/useOrders.js +139 -134
  16. package/dist/hooks/useRoutes.js +97 -75
  17. package/dist/hooks/useTracking.js +100 -88
  18. package/dist/index.js +6 -6
  19. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  20. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  21. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  22. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  23. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  24. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  25. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  26. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  27. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  28. package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
  29. package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
  30. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  31. package/dist/movethewheels/types/index.d.ts +12 -5
  32. package/dist/pages/CreateOrderPage.js +191 -129
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +190 -106
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +324 -293
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/package.json +1 -1
  47. package/src/generated/wspace-types.ts +3136 -8
  48. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  49. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  50. package/src/movethewheels/components/DataTable.tsx +34 -18
  51. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  52. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  53. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  54. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  55. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  56. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  57. package/src/movethewheels/hooks/useEpod.ts +14 -7
  58. package/src/movethewheels/hooks/useFleet.ts +66 -38
  59. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  60. package/src/movethewheels/hooks/useInventory.ts +211 -90
  61. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  62. package/src/movethewheels/hooks/useOrders.ts +48 -14
  63. package/src/movethewheels/hooks/useRoutes.ts +81 -24
  64. package/src/movethewheels/hooks/useTracking.ts +130 -98
  65. package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
  66. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  67. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  68. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  69. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  70. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
  72. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  73. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  74. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
  76. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  77. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  78. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  79. package/src/movethewheels/types/index.ts +12 -5
@@ -73,7 +73,7 @@ function p() {
73
73
  children: "By vehicle"
74
74
  }), /* @__PURE__ */ l("div", {
75
75
  className: "space-y-2",
76
- children: p.byVehicle.filter((e) => e.totalDistanceKm > 0 || e.co2eKg > 0).slice(0, 5).map((e) => /* @__PURE__ */ u("div", {
76
+ children: p.byVehicle.filter((e) => e.totalDistanceKm > 0 || e.co2eKg > 0).map((e) => /* @__PURE__ */ u("div", {
77
77
  className: "flex items-center justify-between rounded-lg bg-bg-sunken px-3 py-2",
78
78
  children: [/* @__PURE__ */ u("div", {
79
79
  className: "flex items-center gap-2",
@@ -16,11 +16,11 @@ var x = {
16
16
  function S(e, t) {
17
17
  return !t || e.some((e) => e.id === t.id) ? e : [t, ...e];
18
18
  }
19
- function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCustomer: D, isLoading: O, error: k, onRetry: A, onOpenCustomers: j, selectedCustomer: M, disabled: N = !1 }) {
20
- let [P, F] = v(!1), [I, L] = v(x), [R, z] = v(!1), [B, V] = v(null), H = S(C, M), U = () => {
21
- V(null), L(x), F(!0);
22
- }, W = () => {
23
- R || F(!1);
19
+ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCustomer: D, isLoading: O, error: k, onRetry: A, onOpenCustomers: j, selectedCustomer: M, searchQuery: N = "", onSearchQueryChange: P, disabled: F = !1 }) {
20
+ let [I, L] = v(!1), [R, z] = v(x), [B, V] = v(!1), [H, U] = v(null), W = S(C, M), G = () => {
21
+ U(null), z(x), L(!0);
22
+ }, K = () => {
23
+ B || L(!1);
24
24
  };
25
25
  return /* @__PURE__ */ b("div", {
26
26
  className: "space-y-2",
@@ -34,8 +34,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
34
34
  type: "button",
35
35
  variant: "ghost",
36
36
  size: "sm",
37
- onClick: U,
38
- disabled: N || O,
37
+ onClick: G,
38
+ disabled: F || O,
39
39
  children: [/* @__PURE__ */ y(e, {
40
40
  size: 14,
41
41
  className: "mr-1"
@@ -44,32 +44,43 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
44
44
  }),
45
45
  /* @__PURE__ */ b("div", {
46
46
  className: "flex flex-col gap-2 sm:flex-row sm:items-start",
47
- children: [/* @__PURE__ */ b(f, {
48
- value: w,
49
- onValueChange: T,
50
- disabled: N || O || !!k,
51
- children: [/* @__PURE__ */ y(h, {
52
- id: "customer",
53
- className: "flex-1",
54
- children: /* @__PURE__ */ y(g, { placeholder: O ? "Loading customers..." : "Select customer" })
55
- }), /* @__PURE__ */ y(p, { children: H.map((e) => /* @__PURE__ */ b(m, {
56
- value: e.id,
57
- children: [
58
- e.name,
59
- " ",
60
- e.email ? `(${e.email})` : ""
61
- ]
62
- }, e.id)) })]
63
- }), k && /* @__PURE__ */ b(r, {
64
- type: "button",
65
- variant: "outline",
66
- size: "sm",
67
- onClick: A,
68
- children: [/* @__PURE__ */ y(t, {
69
- size: 14,
70
- className: "mr-1"
71
- }), "Retry"]
72
- })]
47
+ children: [
48
+ P && /* @__PURE__ */ y(u, {
49
+ value: N,
50
+ onChange: (e) => P(e.target.value),
51
+ placeholder: "Search customers",
52
+ "aria-label": "Search customers",
53
+ disabled: F,
54
+ className: "sm:max-w-56"
55
+ }),
56
+ /* @__PURE__ */ b(f, {
57
+ value: w,
58
+ onValueChange: T,
59
+ disabled: F || O || !!k,
60
+ children: [/* @__PURE__ */ y(h, {
61
+ id: "customer",
62
+ className: "flex-1",
63
+ children: /* @__PURE__ */ y(g, { placeholder: O ? "Loading customers..." : "Select customer" })
64
+ }), /* @__PURE__ */ y(p, { children: W.map((e) => /* @__PURE__ */ b(m, {
65
+ value: e.id,
66
+ children: [
67
+ e.name,
68
+ " ",
69
+ e.email ? `(${e.email})` : ""
70
+ ]
71
+ }, e.id)) })]
72
+ }),
73
+ k && /* @__PURE__ */ b(r, {
74
+ type: "button",
75
+ variant: "outline",
76
+ size: "sm",
77
+ onClick: A,
78
+ children: [/* @__PURE__ */ y(t, {
79
+ size: 14,
80
+ className: "mr-1"
81
+ }), "Retry"]
82
+ })
83
+ ]
73
84
  }),
74
85
  k ? /* @__PURE__ */ b("div", {
75
86
  className: "flex flex-wrap items-center gap-2",
@@ -84,7 +95,7 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
84
95
  onClick: j,
85
96
  children: "Open customer page"
86
97
  })]
87
- }) : !O && H.length === 0 ? /* @__PURE__ */ b("div", {
98
+ }) : !O && W.length === 0 ? /* @__PURE__ */ b("div", {
88
99
  className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-3",
89
100
  children: [/* @__PURE__ */ b("div", {
90
101
  className: "flex items-start gap-2",
@@ -102,8 +113,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
102
113
  type: "button",
103
114
  size: "sm",
104
115
  className: "mt-3",
105
- onClick: U,
106
- disabled: N,
116
+ onClick: G,
117
+ disabled: F,
107
118
  children: [/* @__PURE__ */ y(e, {
108
119
  size: 14,
109
120
  className: "mr-1.5"
@@ -111,34 +122,34 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
111
122
  })]
112
123
  }) : null,
113
124
  /* @__PURE__ */ y(i, {
114
- open: P,
115
- onOpenChange: (e) => e ? F(!0) : W(),
125
+ open: I,
126
+ onOpenChange: (e) => e ? L(!0) : K(),
116
127
  children: /* @__PURE__ */ b(a, { children: [/* @__PURE__ */ b(c, { children: [/* @__PURE__ */ y(l, { children: "Create customer" }), /* @__PURE__ */ y(o, { children: "Add the customer without leaving this order. They will be selected automatically." })] }), /* @__PURE__ */ b("form", {
117
128
  onSubmit: async (e) => {
118
129
  e.preventDefault(), e.stopPropagation();
119
- let t = I.name.trim();
130
+ let t = R.name.trim();
120
131
  if (!t) {
121
- V("Customer name is required.");
132
+ U("Customer name is required.");
122
133
  return;
123
134
  }
124
- z(!0), V(null);
135
+ V(!0), U(null);
125
136
  try {
126
137
  E(await D({
127
138
  name: t,
128
- type: I.type,
129
- email: I.email.trim() || void 0,
130
- phone: I.phone.trim() || void 0,
131
- company: I.company.trim() || void 0
132
- })), F(!1), L(x);
139
+ type: R.type,
140
+ email: R.email.trim() || void 0,
141
+ phone: R.phone.trim() || void 0,
142
+ company: R.company.trim() || void 0
143
+ })), L(!1), z(x);
133
144
  } catch (e) {
134
- V(e instanceof Error ? e.message : "Could not create the customer. Please try again.");
145
+ U(e instanceof Error ? e.message : "Could not create the customer. Please try again.");
135
146
  } finally {
136
- z(!1);
147
+ V(!1);
137
148
  }
138
149
  },
139
150
  className: "space-y-4",
140
151
  children: [
141
- /* @__PURE__ */ y(_, { message: B }),
152
+ /* @__PURE__ */ y(_, { message: H }),
142
153
  /* @__PURE__ */ b("div", {
143
154
  className: "space-y-2",
144
155
  children: [/* @__PURE__ */ y(d, {
@@ -146,8 +157,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
146
157
  children: "Name"
147
158
  }), /* @__PURE__ */ y(u, {
148
159
  id: "quick-customer-name",
149
- value: I.name,
150
- onChange: (e) => L((t) => ({
160
+ value: R.name,
161
+ onChange: (e) => z((t) => ({
151
162
  ...t,
152
163
  name: e.target.value
153
164
  })),
@@ -162,8 +173,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
162
173
  htmlFor: "quick-customer-type",
163
174
  children: "Customer type"
164
175
  }), /* @__PURE__ */ b(f, {
165
- value: I.type,
166
- onValueChange: (e) => L((t) => ({
176
+ value: R.type,
177
+ onValueChange: (e) => z((t) => ({
167
178
  ...t,
168
179
  type: e
169
180
  })),
@@ -189,8 +200,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
189
200
  }), /* @__PURE__ */ y(u, {
190
201
  id: "quick-customer-email",
191
202
  type: "email",
192
- value: I.email,
193
- onChange: (e) => L((t) => ({
203
+ value: R.email,
204
+ onChange: (e) => z((t) => ({
194
205
  ...t,
195
206
  email: e.target.value
196
207
  })),
@@ -203,8 +214,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
203
214
  children: "Phone"
204
215
  }), /* @__PURE__ */ y(u, {
205
216
  id: "quick-customer-phone",
206
- value: I.phone,
207
- onChange: (e) => L((t) => ({
217
+ value: R.phone,
218
+ onChange: (e) => z((t) => ({
208
219
  ...t,
209
220
  phone: e.target.value
210
221
  })),
@@ -219,8 +230,8 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
219
230
  children: "Company"
220
231
  }), /* @__PURE__ */ y(u, {
221
232
  id: "quick-customer-company",
222
- value: I.company,
223
- onChange: (e) => L((t) => ({
233
+ value: R.company,
234
+ onChange: (e) => z((t) => ({
224
235
  ...t,
225
236
  company: e.target.value
226
237
  })),
@@ -232,22 +243,22 @@ function C({ customers: C, value: w, onValueChange: T, onCreated: E, createCusto
232
243
  type: "button",
233
244
  variant: "outline",
234
245
  onClick: () => {
235
- W(), j();
246
+ K(), j();
236
247
  },
237
- disabled: R,
248
+ disabled: B,
238
249
  children: "Use customer page"
239
250
  }),
240
251
  /* @__PURE__ */ y(r, {
241
252
  type: "button",
242
253
  variant: "outline",
243
- onClick: W,
244
- disabled: R,
254
+ onClick: K,
255
+ disabled: B,
245
256
  children: "Cancel"
246
257
  }),
247
258
  /* @__PURE__ */ b(r, {
248
259
  type: "submit",
249
- disabled: R,
250
- children: [/* @__PURE__ */ y(e, { size: 16 }), R ? "Creating..." : "Create and select"]
260
+ disabled: B,
261
+ children: [/* @__PURE__ */ y(e, { size: 16 }), B ? "Creating..." : "Create and select"]
251
262
  })
252
263
  ] })
253
264
  ]