@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.
- 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 +2719 -8
- package/dist/hooks/index.js +1 -1
- 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 +148 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +139 -134
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/index.js +6 -6
- 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 +48 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +12 -5
- package/dist/pages/CreateOrderPage.js +191 -129
- 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 +190 -106
- 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 +324 -293
- 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 +3136 -8
- 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 +66 -38
- 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 +48 -14
- package/src/movethewheels/hooks/useRoutes.ts +81 -24
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
- 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 +91 -6
- 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 +45 -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 +12 -5
|
@@ -14,79 +14,81 @@ import { MetricCard as g, MetricGrid as _ } from "../components/MetricCard.js";
|
|
|
14
14
|
import { TypeBadge as v } from "../components/StatusBadge.js";
|
|
15
15
|
import { DataTable as y } from "../components/DataTable.js";
|
|
16
16
|
import { formatDate as b } from "../utils/formatters.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import { useDebouncedValue as x } from "../hooks/useDebouncedValue.js";
|
|
18
|
+
import { useState as S } from "react";
|
|
19
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
20
|
+
import { CTAOverflowMenu as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
|
|
20
21
|
//#region src/movethewheels/pages/CustomersPage.tsx
|
|
21
|
-
function
|
|
22
|
-
let { basePath:
|
|
23
|
-
limit:
|
|
24
|
-
offset:
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
function D() {
|
|
23
|
+
let { basePath: D, navigate: O } = c(), [k, A] = S(0), [j, M] = S(25), [N, P] = S(""), F = x(N), { customers: I, totalCustomers: L, hasMore: R, isLoading: z, error: B, refetch: V } = u({
|
|
24
|
+
limit: j,
|
|
25
|
+
offset: k * j,
|
|
26
|
+
filters: { search: F }
|
|
27
|
+
}), { stats: H } = l(), U = (e) => O?.(s(D, e));
|
|
28
|
+
return /* @__PURE__ */ w(h, {
|
|
27
29
|
title: "Customers",
|
|
28
|
-
subtitle: `${
|
|
29
|
-
icon: /* @__PURE__ */
|
|
30
|
-
headerActions: /* @__PURE__ */
|
|
30
|
+
subtitle: `${H.total} customers`,
|
|
31
|
+
icon: /* @__PURE__ */ C(o, { size: 24 }),
|
|
32
|
+
headerActions: /* @__PURE__ */ C(T, {
|
|
31
33
|
primary: {
|
|
32
34
|
label: "Add Customer",
|
|
33
|
-
icon: /* @__PURE__ */
|
|
34
|
-
onSelect: () =>
|
|
35
|
+
icon: /* @__PURE__ */ C(n, { size: 16 }),
|
|
36
|
+
onSelect: () => U("customers/new")
|
|
35
37
|
},
|
|
36
38
|
actions: [{
|
|
37
39
|
label: "Refresh",
|
|
38
|
-
icon: /* @__PURE__ */
|
|
39
|
-
onSelect: () =>
|
|
40
|
+
icon: /* @__PURE__ */ C(r, { size: 16 }),
|
|
41
|
+
onSelect: () => V()
|
|
40
42
|
}, {
|
|
41
43
|
label: "Export",
|
|
42
|
-
icon: /* @__PURE__ */
|
|
43
|
-
onSelect: () =>
|
|
44
|
+
icon: /* @__PURE__ */ C(t, { size: 16 }),
|
|
45
|
+
onSelect: () => U("import-export")
|
|
44
46
|
}]
|
|
45
47
|
}),
|
|
46
48
|
children: [
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
-
icon: /* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ C(E, {
|
|
50
|
+
icon: /* @__PURE__ */ C(o, { size: 18 }),
|
|
49
51
|
children: "The businesses and individuals you deliver for. Keep contact details, locations and satisfaction ratings here, and open a customer to see their order history before booking the next shipment."
|
|
50
52
|
}),
|
|
51
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
52
54
|
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
53
55
|
children: "Customer base at a glance"
|
|
54
|
-
}), /* @__PURE__ */
|
|
56
|
+
}), /* @__PURE__ */ w(_, {
|
|
55
57
|
columns: 3,
|
|
56
58
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ C(g, {
|
|
58
60
|
label: "Total customers",
|
|
59
|
-
value:
|
|
60
|
-
icon: /* @__PURE__ */
|
|
61
|
+
value: H.total,
|
|
62
|
+
icon: /* @__PURE__ */ C(o, { size: 20 }),
|
|
61
63
|
accent: "brand"
|
|
62
64
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ C(g, {
|
|
64
66
|
label: "Active",
|
|
65
|
-
value:
|
|
66
|
-
icon: /* @__PURE__ */
|
|
67
|
+
value: H.active,
|
|
68
|
+
icon: /* @__PURE__ */ C(a, { size: 20 }),
|
|
67
69
|
accent: "success",
|
|
68
70
|
subtitle: "Currently transacting"
|
|
69
71
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ C(g, {
|
|
71
73
|
label: "Business accounts",
|
|
72
|
-
value:
|
|
73
|
-
icon: /* @__PURE__ */
|
|
74
|
+
value: H.b2b,
|
|
75
|
+
icon: /* @__PURE__ */ C(e, { size: 20 }),
|
|
74
76
|
accent: "blue",
|
|
75
77
|
subtitle: "B2B relationships"
|
|
76
78
|
})
|
|
77
79
|
]
|
|
78
80
|
})] }),
|
|
79
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ C(y, {
|
|
80
82
|
columns: [
|
|
81
83
|
{
|
|
82
84
|
id: "customer",
|
|
83
85
|
header: "Customer",
|
|
84
|
-
cell: (e) => /* @__PURE__ */
|
|
86
|
+
cell: (e) => /* @__PURE__ */ w("div", {
|
|
85
87
|
className: "flex items-center gap-3",
|
|
86
|
-
children: [/* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
87
89
|
className: "font-medium",
|
|
88
90
|
children: e.name
|
|
89
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ C("p", {
|
|
90
92
|
className: "text-sm text-text-secondary",
|
|
91
93
|
children: e.email
|
|
92
94
|
})] })]
|
|
@@ -96,7 +98,7 @@ function E() {
|
|
|
96
98
|
id: "type",
|
|
97
99
|
header: "Type",
|
|
98
100
|
accessorKey: "type",
|
|
99
|
-
cell: (e) => /* @__PURE__ */
|
|
101
|
+
cell: (e) => /* @__PURE__ */ C(v, { type: e.type })
|
|
100
102
|
},
|
|
101
103
|
{
|
|
102
104
|
id: "company",
|
|
@@ -117,18 +119,18 @@ function E() {
|
|
|
117
119
|
{
|
|
118
120
|
id: "rating",
|
|
119
121
|
header: "Rating",
|
|
120
|
-
cell: (e) => /* @__PURE__ */
|
|
122
|
+
cell: (e) => /* @__PURE__ */ w("div", {
|
|
121
123
|
className: "flex items-center gap-1",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ C(i, {
|
|
123
125
|
size: 14,
|
|
124
126
|
className: "text-status-warning-text fill-current"
|
|
125
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ C("span", { children: e.rating.toFixed(1) })]
|
|
126
128
|
})
|
|
127
129
|
},
|
|
128
130
|
{
|
|
129
131
|
id: "status",
|
|
130
132
|
header: "Status",
|
|
131
|
-
cell: (e) => /* @__PURE__ */
|
|
133
|
+
cell: (e) => /* @__PURE__ */ C(p, {
|
|
132
134
|
variant: e.isActive ? "default" : "secondary",
|
|
133
135
|
children: e.isActive ? "Active" : "Inactive"
|
|
134
136
|
})
|
|
@@ -141,10 +143,10 @@ function E() {
|
|
|
141
143
|
cell: (e) => b(e.createdAt, "short")
|
|
142
144
|
}
|
|
143
145
|
],
|
|
144
|
-
data:
|
|
145
|
-
isLoading:
|
|
146
|
-
error:
|
|
147
|
-
onRetry:
|
|
146
|
+
data: I,
|
|
147
|
+
isLoading: z,
|
|
148
|
+
error: B,
|
|
149
|
+
onRetry: V,
|
|
148
150
|
searchable: !0,
|
|
149
151
|
searchPlaceholder: "Search customers...",
|
|
150
152
|
searchFields: [
|
|
@@ -152,21 +154,26 @@ function E() {
|
|
|
152
154
|
"email",
|
|
153
155
|
"company"
|
|
154
156
|
],
|
|
155
|
-
|
|
157
|
+
searchQuery: N,
|
|
158
|
+
onSearchQueryChange: (e) => {
|
|
159
|
+
P(e), A(0);
|
|
160
|
+
},
|
|
161
|
+
onRowClick: (e) => U(`customers/${e.id}`),
|
|
156
162
|
getRowId: (e) => e.id,
|
|
157
|
-
pageIndex:
|
|
158
|
-
pageSize:
|
|
159
|
-
onPageChange:
|
|
163
|
+
pageIndex: k,
|
|
164
|
+
pageSize: j,
|
|
165
|
+
onPageChange: A,
|
|
160
166
|
onPageSizeChange: (e) => {
|
|
161
|
-
|
|
167
|
+
M(e), A(0);
|
|
162
168
|
},
|
|
163
|
-
|
|
169
|
+
totalItems: L,
|
|
170
|
+
hasNextPage: R,
|
|
164
171
|
emptyIllustration: "empty-people",
|
|
165
172
|
emptyTitle: "No customers yet",
|
|
166
173
|
emptyDescription: "Add your first customer to start booking deliveries for them.",
|
|
167
|
-
emptyAction: /* @__PURE__ */
|
|
168
|
-
onClick: () =>
|
|
169
|
-
children: [/* @__PURE__ */
|
|
174
|
+
emptyAction: /* @__PURE__ */ w(m, {
|
|
175
|
+
onClick: () => U("customers/new"),
|
|
176
|
+
children: [/* @__PURE__ */ C(n, {
|
|
170
177
|
size: 16,
|
|
171
178
|
className: "mr-1.5"
|
|
172
179
|
}), "Add Customer"]
|
|
@@ -176,4 +183,4 @@ function E() {
|
|
|
176
183
|
});
|
|
177
184
|
}
|
|
178
185
|
//#endregion
|
|
179
|
-
export {
|
|
186
|
+
export { D as default };
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
1
|
+
import { ChevronLeft as e } from "../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
|
|
2
|
+
import { ChevronRight as t } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
3
|
+
import { CircleCheck as n } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
4
|
+
import { LoaderCircle as r } from "../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
5
|
+
import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
6
|
+
import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
7
|
+
import { PenLine as o } from "../node_modules/lucide-react/dist/esm/icons/pen-line.js";
|
|
8
|
+
import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
9
|
+
import { Type as c } from "../node_modules/lucide-react/dist/esm/icons/type.js";
|
|
10
|
+
import { Upload as l } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
|
|
11
|
+
import { mapOrderPriority as u, mapOrderStatus as d } from "../hooks/useOrders.js";
|
|
12
|
+
import { useCaptureEpod as f, useEpodPhotoUpload as p, useMyPendingEpodDeliveryJobs as m } from "../hooks/useEpod.js";
|
|
13
|
+
import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Textarea as S } from "../components/ui.js";
|
|
14
|
+
import { PageLayout as C } from "../components/PageLayout.js";
|
|
15
|
+
import { PriorityBadge as w, StatusBadge as T } from "../components/StatusBadge.js";
|
|
16
|
+
import { FormError as E } from "../components/FormError.js";
|
|
17
|
+
import { Notice as D, useNotice as O } from "../components/Notice.js";
|
|
18
|
+
import { formatAddress as k, formatDate as A } from "../utils/formatters.js";
|
|
19
|
+
import { SignaturePad as j } from "../components/SignaturePad.js";
|
|
20
|
+
import { useRef as M, useState as N } from "react";
|
|
21
|
+
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
20
22
|
//#region src/movethewheels/pages/DeliveryCapturePage.tsx
|
|
21
|
-
function
|
|
23
|
+
function L() {
|
|
22
24
|
return new Promise((e) => {
|
|
23
25
|
if (!navigator.geolocation) {
|
|
24
26
|
e(null);
|
|
@@ -31,122 +33,122 @@ function F() {
|
|
|
31
33
|
});
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
function
|
|
35
|
-
let { captureEpod:
|
|
36
|
+
function R({ job: e, onCaptured: t, onCancel: a }) {
|
|
37
|
+
let { captureEpod: u, isSubmitting: d, error: m } = f(), { upload: C, isUploading: w, error: T } = p(), D = M(null), [O, A] = N(""), [R, z] = N("drawn"), [B, V] = N(""), [H, U] = N(null), [W, G] = N(""), [K, q] = N(null), J = async () => {
|
|
36
38
|
q(null);
|
|
37
|
-
let
|
|
38
|
-
if (!
|
|
39
|
+
let n = O.trim();
|
|
40
|
+
if (!n) {
|
|
39
41
|
q("Recipient name is required.");
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
42
|
-
let
|
|
43
|
-
if (!
|
|
44
|
+
let r = R === "typed" ? B.trim() : D.current?.toDataUrl() ?? null;
|
|
45
|
+
if (!r) {
|
|
44
46
|
q(R === "typed" ? "Type the recipient full name as their signature." : "A signature is required.");
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
49
|
try {
|
|
48
|
-
let
|
|
49
|
-
H && (
|
|
50
|
-
let
|
|
51
|
-
await
|
|
52
|
-
deliveryJobId:
|
|
53
|
-
recipientName:
|
|
50
|
+
let i;
|
|
51
|
+
H && (i = [(await C(H)).fileId]);
|
|
52
|
+
let a = await L();
|
|
53
|
+
await u({
|
|
54
|
+
deliveryJobId: e.id,
|
|
55
|
+
recipientName: n,
|
|
54
56
|
signatureType: R,
|
|
55
|
-
signatureData:
|
|
56
|
-
photoFileIds:
|
|
57
|
-
latitude:
|
|
58
|
-
longitude:
|
|
59
|
-
locationAccuracy:
|
|
57
|
+
signatureData: r,
|
|
58
|
+
photoFileIds: i,
|
|
59
|
+
latitude: a?.coords.latitude,
|
|
60
|
+
longitude: a?.coords.longitude,
|
|
61
|
+
locationAccuracy: a?.coords.accuracy,
|
|
60
62
|
notes: W.trim() || void 0
|
|
61
|
-
}),
|
|
63
|
+
}), t();
|
|
62
64
|
} catch {}
|
|
63
|
-
}, Y =
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
+
}, Y = d || w;
|
|
66
|
+
return /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
65
67
|
className: "flex items-center gap-2",
|
|
66
68
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ F(s, { size: 18 }),
|
|
68
70
|
" Capture delivery for ",
|
|
69
|
-
|
|
71
|
+
e.deliveryJobNumber
|
|
70
72
|
]
|
|
71
|
-
}) }), /* @__PURE__ */
|
|
73
|
+
}) }), /* @__PURE__ */ I(_, {
|
|
72
74
|
className: "space-y-4",
|
|
73
75
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ I("div", {
|
|
75
77
|
className: "text-sm text-text-secondary space-y-1",
|
|
76
|
-
children: [
|
|
78
|
+
children: [e.customerName && /* @__PURE__ */ I("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ F("p", { children: k(e.deliveryAddress) })]
|
|
77
79
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ I("div", {
|
|
79
81
|
className: "space-y-1.5",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
82
|
+
children: [/* @__PURE__ */ F(x, {
|
|
81
83
|
htmlFor: "epod-recipient-name",
|
|
82
84
|
children: "Recipient name"
|
|
83
|
-
}), /* @__PURE__ */
|
|
85
|
+
}), /* @__PURE__ */ F(b, {
|
|
84
86
|
id: "epod-recipient-name",
|
|
85
|
-
value:
|
|
86
|
-
onChange: (e) =>
|
|
87
|
+
value: O,
|
|
88
|
+
onChange: (e) => A(e.target.value),
|
|
87
89
|
placeholder: "Who received the delivery?"
|
|
88
90
|
})]
|
|
89
91
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ I("div", {
|
|
91
93
|
className: "space-y-1.5",
|
|
92
94
|
children: [
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ F(x, { children: "Signature" }),
|
|
96
|
+
/* @__PURE__ */ I("div", {
|
|
95
97
|
className: "flex gap-2",
|
|
96
|
-
children: [/* @__PURE__ */
|
|
98
|
+
children: [/* @__PURE__ */ I(h, {
|
|
97
99
|
type: "button",
|
|
98
100
|
variant: R === "drawn" ? "default" : "outline",
|
|
99
101
|
size: "sm",
|
|
100
102
|
onClick: () => z("drawn"),
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
-
}), /* @__PURE__ */
|
|
103
|
+
children: [/* @__PURE__ */ F(o, { size: 14 }), " Draw"]
|
|
104
|
+
}), /* @__PURE__ */ I(h, {
|
|
103
105
|
type: "button",
|
|
104
106
|
variant: R === "typed" ? "default" : "outline",
|
|
105
107
|
size: "sm",
|
|
106
108
|
onClick: () => z("typed"),
|
|
107
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ F(c, { size: 14 }), " Type name instead"]
|
|
108
110
|
})]
|
|
109
111
|
}),
|
|
110
|
-
R === "drawn" ? /* @__PURE__ */
|
|
112
|
+
R === "drawn" ? /* @__PURE__ */ F(j, { ref: D }) : /* @__PURE__ */ F(b, {
|
|
111
113
|
value: B,
|
|
112
114
|
onChange: (e) => V(e.target.value),
|
|
113
115
|
placeholder: "Type full name as signature"
|
|
114
116
|
})
|
|
115
117
|
]
|
|
116
118
|
}),
|
|
117
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ I("div", {
|
|
118
120
|
className: "space-y-1.5",
|
|
119
121
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ F(x, {
|
|
121
123
|
htmlFor: "epod-photo",
|
|
122
124
|
children: "Delivery photo (optional)"
|
|
123
125
|
}),
|
|
124
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ I("div", {
|
|
125
127
|
className: "flex items-center gap-2",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ F("input", {
|
|
127
129
|
id: "epod-photo",
|
|
128
130
|
type: "file",
|
|
129
131
|
accept: "image/*",
|
|
130
132
|
capture: "environment",
|
|
131
133
|
onChange: (e) => U(e.target.files?.[0] ?? null),
|
|
132
134
|
className: "text-sm"
|
|
133
|
-
}), H && /* @__PURE__ */
|
|
135
|
+
}), H && /* @__PURE__ */ F(l, {
|
|
134
136
|
size: 14,
|
|
135
137
|
className: "text-text-secondary"
|
|
136
138
|
})]
|
|
137
139
|
}),
|
|
138
|
-
H && /* @__PURE__ */
|
|
140
|
+
H && /* @__PURE__ */ F("p", {
|
|
139
141
|
className: "text-xs text-text-secondary",
|
|
140
142
|
children: H.name
|
|
141
143
|
})
|
|
142
144
|
]
|
|
143
145
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ I("div", {
|
|
145
147
|
className: "space-y-1.5",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
148
|
+
children: [/* @__PURE__ */ F(x, {
|
|
147
149
|
htmlFor: "epod-notes",
|
|
148
150
|
children: "Notes (optional)"
|
|
149
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ F(S, {
|
|
150
152
|
id: "epod-notes",
|
|
151
153
|
value: W,
|
|
152
154
|
onChange: (e) => G(e.target.value),
|
|
@@ -154,99 +156,119 @@ function I({ job: r, onCaptured: c, onCancel: l }) {
|
|
|
154
156
|
rows: 2
|
|
155
157
|
})]
|
|
156
158
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ I("p", {
|
|
158
160
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
159
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ F(i, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
|
|
160
162
|
}),
|
|
161
|
-
K && /* @__PURE__ */
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */
|
|
163
|
+
K && /* @__PURE__ */ F(E, { message: K }),
|
|
164
|
+
m && /* @__PURE__ */ F(E, { message: m.message }),
|
|
165
|
+
T && /* @__PURE__ */ F(E, { message: T.message }),
|
|
166
|
+
/* @__PURE__ */ I("div", {
|
|
165
167
|
className: "flex gap-2 justify-end",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ F(h, {
|
|
167
169
|
type: "button",
|
|
168
170
|
variant: "outline",
|
|
169
|
-
onClick:
|
|
171
|
+
onClick: a,
|
|
170
172
|
disabled: Y,
|
|
171
173
|
children: "Cancel"
|
|
172
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ F(h, {
|
|
173
175
|
type: "button",
|
|
174
176
|
onClick: () => void J(),
|
|
175
177
|
disabled: Y,
|
|
176
|
-
children: Y ? /* @__PURE__ */ P
|
|
178
|
+
children: Y ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(r, {
|
|
177
179
|
size: 14,
|
|
178
180
|
className: "animate-spin"
|
|
179
|
-
}), " Submitting…"] }) : /* @__PURE__ */ P
|
|
181
|
+
}), " Submitting…"] }) : /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F(n, { size: 14 }), " Confirm delivery"] })
|
|
180
182
|
})]
|
|
181
183
|
})
|
|
182
184
|
]
|
|
183
185
|
})] });
|
|
184
186
|
}
|
|
185
|
-
function
|
|
186
|
-
let { jobs:
|
|
187
|
-
|
|
187
|
+
function z() {
|
|
188
|
+
let [r, i] = N(0), { jobs: o, hasMore: c, isLoading: l, error: f, refetch: p } = m({
|
|
189
|
+
limit: 20,
|
|
190
|
+
offset: r * 20
|
|
191
|
+
}), [v, y] = N(null), { message: b, notify: x } = O();
|
|
192
|
+
return /* @__PURE__ */ F(C, {
|
|
188
193
|
title: "My Deliveries",
|
|
189
194
|
subtitle: "Capture proof of delivery for your assigned stops",
|
|
190
|
-
icon: /* @__PURE__ */
|
|
191
|
-
children: /* @__PURE__ */
|
|
195
|
+
icon: /* @__PURE__ */ F(s, { size: 24 }),
|
|
196
|
+
children: /* @__PURE__ */ I("div", {
|
|
192
197
|
className: "space-y-4",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
194
|
-
job:
|
|
198
|
+
children: [/* @__PURE__ */ F(D, { message: b }), v ? /* @__PURE__ */ F(R, {
|
|
199
|
+
job: v,
|
|
195
200
|
onCaptured: () => {
|
|
196
|
-
|
|
201
|
+
x("Proof of delivery captured — delivery marked complete."), y(null), i(0), p();
|
|
197
202
|
},
|
|
198
|
-
onCancel: () =>
|
|
199
|
-
}) :
|
|
203
|
+
onCancel: () => y(null)
|
|
204
|
+
}) : l ? /* @__PURE__ */ F("p", {
|
|
200
205
|
className: "text-text-secondary text-center py-8",
|
|
201
206
|
children: "Loading your deliveries…"
|
|
202
|
-
}) :
|
|
207
|
+
}) : f ? /* @__PURE__ */ F(E, { message: f.message }) : o.length > 0 ? /* @__PURE__ */ I("div", {
|
|
203
208
|
className: "space-y-3",
|
|
204
|
-
children:
|
|
209
|
+
children: [o.map((e) => /* @__PURE__ */ F(g, { children: /* @__PURE__ */ I(_, {
|
|
205
210
|
className: "flex items-center justify-between gap-3 py-4",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
211
|
+
children: [/* @__PURE__ */ I("div", {
|
|
207
212
|
className: "min-w-0",
|
|
208
213
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ I("p", {
|
|
210
215
|
className: "font-medium flex items-center gap-2",
|
|
211
216
|
children: [
|
|
212
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ F(a, { size: 16 }),
|
|
213
218
|
" ",
|
|
214
219
|
e.deliveryJobNumber
|
|
215
220
|
]
|
|
216
221
|
}),
|
|
217
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ I("div", {
|
|
218
223
|
className: "flex flex-wrap items-center gap-1.5 py-1",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
220
|
-
status:
|
|
224
|
+
children: [/* @__PURE__ */ F(T, {
|
|
225
|
+
status: d(e.status),
|
|
221
226
|
type: "order",
|
|
222
227
|
size: "sm"
|
|
223
|
-
}), /* @__PURE__ */
|
|
224
|
-
priority:
|
|
228
|
+
}), /* @__PURE__ */ F(w, {
|
|
229
|
+
priority: u(e.priority),
|
|
225
230
|
size: "sm"
|
|
226
231
|
})]
|
|
227
232
|
}),
|
|
228
|
-
e.deliveryAddress && /* @__PURE__ */
|
|
233
|
+
e.deliveryAddress && /* @__PURE__ */ F("p", {
|
|
229
234
|
className: "text-sm text-text-secondary truncate",
|
|
230
|
-
children:
|
|
235
|
+
children: k(e.deliveryAddress)
|
|
231
236
|
}),
|
|
232
|
-
e.scheduledDelivery && /* @__PURE__ */
|
|
237
|
+
e.scheduledDelivery && /* @__PURE__ */ I("p", {
|
|
233
238
|
className: "text-xs text-text-secondary",
|
|
234
|
-
children: ["Scheduled ",
|
|
239
|
+
children: ["Scheduled ", A(e.scheduledDelivery, "short")]
|
|
235
240
|
})
|
|
236
241
|
]
|
|
237
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ F(h, {
|
|
238
243
|
type: "button",
|
|
239
244
|
size: "sm",
|
|
240
|
-
onClick: () =>
|
|
245
|
+
onClick: () => y(e),
|
|
241
246
|
children: "Capture"
|
|
242
247
|
})]
|
|
243
|
-
}) }, e.id))
|
|
244
|
-
|
|
248
|
+
}) }, e.id)), (r > 0 || c) && /* @__PURE__ */ I("div", {
|
|
249
|
+
className: "flex justify-end gap-2 pt-2",
|
|
250
|
+
children: [/* @__PURE__ */ I(h, {
|
|
251
|
+
type: "button",
|
|
252
|
+
variant: "outline",
|
|
253
|
+
size: "sm",
|
|
254
|
+
disabled: r === 0 || l,
|
|
255
|
+
onClick: () => i((e) => Math.max(0, e - 1)),
|
|
256
|
+
children: [/* @__PURE__ */ F(e, { size: 16 }), " Previous"]
|
|
257
|
+
}), /* @__PURE__ */ I(h, {
|
|
258
|
+
type: "button",
|
|
259
|
+
variant: "outline",
|
|
260
|
+
size: "sm",
|
|
261
|
+
disabled: !c || l,
|
|
262
|
+
onClick: () => i((e) => e + 1),
|
|
263
|
+
children: ["Next ", /* @__PURE__ */ F(t, { size: 16 })]
|
|
264
|
+
})]
|
|
265
|
+
})]
|
|
266
|
+
}) : /* @__PURE__ */ I("div", {
|
|
245
267
|
className: "text-center py-12",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
268
|
+
children: [/* @__PURE__ */ F(n, {
|
|
247
269
|
size: 40,
|
|
248
270
|
className: "mx-auto mb-3 text-text-secondary opacity-50"
|
|
249
|
-
}), /* @__PURE__ */
|
|
271
|
+
}), /* @__PURE__ */ F("p", {
|
|
250
272
|
className: "text-text-secondary",
|
|
251
273
|
children: "No deliveries awaiting proof of delivery."
|
|
252
274
|
})]
|
|
@@ -255,4 +277,4 @@ function L() {
|
|
|
255
277
|
});
|
|
256
278
|
}
|
|
257
279
|
//#endregion
|
|
258
|
-
export {
|
|
280
|
+
export { z as default };
|