@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.
- package/dist/components/CarbonFootprintPanel.js +1 -1
- package/dist/components/CustomerPicker.js +76 -65
- package/dist/components/DataTable.js +140 -139
- package/dist/components/DocumentsCard.js +14 -8
- package/dist/generated/wspace-types.d.ts +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 +3 -1
- package/dist/movethewheels/components/DataTable.d.ts +5 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
- package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
- package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +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/pages/CreateOrderPage.js +207 -201
- 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/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 +14 -0
- package/src/movethewheels/components/DataTable.tsx +34 -18
- package/src/movethewheels/components/DocumentsCard.tsx +6 -1
- package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
- package/src/movethewheels/hooks/useAnalytics.ts +27 -0
- package/src/movethewheels/hooks/useCustomers.ts +64 -24
- package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
- package/src/movethewheels/hooks/useEpod.ts +14 -7
- package/src/movethewheels/hooks/useFleet.ts +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 +9 -1
- 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
|
@@ -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).
|
|
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,
|
|
20
|
-
let [
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
|
|
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:
|
|
38
|
-
disabled:
|
|
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: [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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 &&
|
|
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:
|
|
106
|
-
disabled:
|
|
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:
|
|
115
|
-
onOpenChange: (e) => e ?
|
|
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 =
|
|
130
|
+
let t = R.name.trim();
|
|
120
131
|
if (!t) {
|
|
121
|
-
|
|
132
|
+
U("Customer name is required.");
|
|
122
133
|
return;
|
|
123
134
|
}
|
|
124
|
-
|
|
135
|
+
V(!0), U(null);
|
|
125
136
|
try {
|
|
126
137
|
E(await D({
|
|
127
138
|
name: t,
|
|
128
|
-
type:
|
|
129
|
-
email:
|
|
130
|
-
phone:
|
|
131
|
-
company:
|
|
132
|
-
})),
|
|
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
|
-
|
|
145
|
+
U(e instanceof Error ? e.message : "Could not create the customer. Please try again.");
|
|
135
146
|
} finally {
|
|
136
|
-
|
|
147
|
+
V(!1);
|
|
137
148
|
}
|
|
138
149
|
},
|
|
139
150
|
className: "space-y-4",
|
|
140
151
|
children: [
|
|
141
|
-
/* @__PURE__ */ y(_, { message:
|
|
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:
|
|
150
|
-
onChange: (e) =>
|
|
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:
|
|
166
|
-
onValueChange: (e) =>
|
|
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:
|
|
193
|
-
onChange: (e) =>
|
|
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:
|
|
207
|
-
onChange: (e) =>
|
|
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:
|
|
223
|
-
onChange: (e) =>
|
|
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
|
-
|
|
246
|
+
K(), j();
|
|
236
247
|
},
|
|
237
|
-
disabled:
|
|
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:
|
|
244
|
-
disabled:
|
|
254
|
+
onClick: K,
|
|
255
|
+
disabled: B,
|
|
245
256
|
children: "Cancel"
|
|
246
257
|
}),
|
|
247
258
|
/* @__PURE__ */ b(r, {
|
|
248
259
|
type: "submit",
|
|
249
|
-
disabled:
|
|
250
|
-
children: [/* @__PURE__ */ y(e, { size: 16 }),
|
|
260
|
+
disabled: B,
|
|
261
|
+
children: [/* @__PURE__ */ y(e, { size: 16 }), B ? "Creating..." : "Create and select"]
|
|
251
262
|
})
|
|
252
263
|
] })
|
|
253
264
|
]
|