@burdenoff/microfe-movethewheels 2026.1117.1 → 2026.1123.2
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/MoveTheWheelsRoot.js +149 -133
- package/dist/MoveTheWheelsRoutes.js +157 -139
- package/dist/components/EntityConversationsCard.js +145 -0
- package/dist/components/maps/MapCanvas.js +4 -3
- package/dist/events/rybbit.js +87 -0
- package/dist/generated/tracking-quality-operations.d.ts +342 -0
- package/dist/hooks/useEntityComments.js +111 -0
- package/dist/hooks/useFleet.js +394 -311
- package/dist/hooks/useInventory.js +378 -313
- package/dist/hooks/useMultiModalShipments.js +58 -53
- package/dist/hooks/useOrders.js +178 -158
- package/dist/hooks/useRoutes.js +146 -130
- package/dist/index.js +35 -34
- package/dist/movethewheels/components/EntityConversationsCard.d.ts +8 -0
- package/dist/movethewheels/events/rybbit.d.ts +27 -0
- package/dist/movethewheels/hooks/useEntityComments.d.ts +26 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +73 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +19 -0
- package/dist/movethewheels/index.d.ts +1 -0
- package/dist/movethewheels/pages/DocumentsLibraryPage.d.ts +1 -0
- package/dist/movethewheels/pages/NotificationsCenterPage.d.ts +1 -0
- package/dist/movethewheels/types/index.d.ts +95 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/layers.js +17 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/message-square.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/send.js +10 -0
- package/dist/pages/DocumentsLibraryPage.js +235 -0
- package/dist/pages/DriverDetailsPage.js +625 -351
- package/dist/pages/NotificationsCenterPage.js +310 -0
- package/dist/pages/OrderDetailsPage.js +48 -42
- package/dist/pages/RouteDetailsPage.js +257 -251
- package/dist/pages/TrackingPage.js +202 -196
- package/dist/pages/VehicleDetailsPage.js +616 -314
- package/dist/pages/WarehouseDetailsPage.js +539 -253
- package/dist/stories/ControlTowerWidgets.stories.d.ts +10 -0
- package/dist/stories/DataTable.stories.d.ts +15 -0
- package/dist/stories/FleetCards.stories.d.ts +9 -0
- package/dist/stories/OrderForms.stories.d.ts +8 -0
- package/dist/stories/RouteMap.stories.d.ts +7 -0
- package/dist/stories/ShipmentTimeline.stories.d.ts +6 -0
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +407 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +16 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +17 -2
- package/src/movethewheels/components/EntityConversationsCard.tsx +143 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +3 -3
- package/src/movethewheels/events/__tests__/rybbit.test.ts +98 -0
- package/src/movethewheels/events/rybbit.ts +191 -0
- package/src/movethewheels/hooks/useEntityComments.ts +258 -0
- package/src/movethewheels/hooks/useFleet.ts +300 -5
- package/src/movethewheels/hooks/useInventory.ts +231 -3
- package/src/movethewheels/hooks/useMultiModalShipments.ts +8 -1
- package/src/movethewheels/hooks/useOrders.ts +19 -3
- package/src/movethewheels/hooks/useRoutes.ts +14 -2
- package/src/movethewheels/index.ts +1 -0
- package/src/movethewheels/pages/DocumentsLibraryPage.tsx +229 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +250 -1
- package/src/movethewheels/pages/NotificationsCenterPage.tsx +331 -0
- package/src/movethewheels/pages/OrderDetailsPage.tsx +8 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +6 -0
- package/src/movethewheels/pages/TrackingPage.tsx +8 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +255 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +266 -2
- package/src/movethewheels/types/index.ts +103 -2
- package/src/stories/ControlTowerWidgets.stories.tsx +150 -0
- package/src/stories/DataTable.stories.tsx +94 -0
- package/src/stories/FleetCards.stories.tsx +77 -0
- package/src/stories/OrderForms.stories.tsx +84 -0
- package/src/stories/RouteMap.stories.tsx +43 -0
- package/src/stories/ShipmentTimeline.stories.tsx +128 -0
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
import e from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
2
2
|
import t from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
3
3
|
import n from "../node_modules/lucide-react/dist/esm/icons/star.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
4
|
+
import ee from "../node_modules/lucide-react/dist/esm/icons/dollar-sign.js";
|
|
5
|
+
import r from "../node_modules/lucide-react/dist/esm/icons/clock.js";
|
|
6
|
+
import i from "../node_modules/lucide-react/dist/esm/icons/file-text.js";
|
|
7
|
+
import a from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
8
|
+
import o from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
9
|
+
import s from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
10
|
+
import c from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
|
|
11
|
+
import l from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
12
|
+
import te from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
13
|
+
import ne from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
|
|
14
|
+
import re from "../node_modules/lucide-react/dist/esm/icons/shield-check.js";
|
|
15
|
+
import u from "../node_modules/lucide-react/dist/esm/icons/calendar.js";
|
|
16
|
+
import d from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
17
|
+
import { ErrorState as f, LoadingState as p, PageLayout as ie } from "../components/PageLayout.js";
|
|
15
18
|
import { StatusBadge as m } from "../components/StatusBadge.js";
|
|
16
|
-
import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as
|
|
17
|
-
import { EntityCombobox as
|
|
18
|
-
import { toApiDriverStatus as
|
|
19
|
-
import { useDebouncedValue as
|
|
20
|
-
import { useRefetchOnLeaveEdit as
|
|
21
|
-
import { useMoveTheWheels as
|
|
22
|
-
import { formatCurrency as
|
|
23
|
-
import { driverLicenseExpiryInput as
|
|
24
|
-
import { joinPath as
|
|
25
|
-
import { FormError as
|
|
26
|
-
import { DocumentsCard as
|
|
27
|
-
import { DRIVER_STATUS_LABELS as
|
|
28
|
-
import { useEffect as
|
|
29
|
-
import { useLocation as
|
|
30
|
-
import { Fragment as
|
|
31
|
-
import { EmphasisPanel as
|
|
19
|
+
import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as ae, SelectContent as oe, SelectItem as se, SelectTrigger as ce, SelectValue as le, Textarea as S } from "../components/ui.js";
|
|
20
|
+
import { EntityCombobox as C } from "../components/EntityCombobox.js";
|
|
21
|
+
import { toApiDriverStatus as w, useDriver as ue, useFleet as de, useVehicle as fe, useVehicles as pe } from "../hooks/useFleet.js";
|
|
22
|
+
import { useDebouncedValue as T } from "../hooks/useDebouncedValue.js";
|
|
23
|
+
import { useRefetchOnLeaveEdit as E } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
24
|
+
import { useMoveTheWheels as me } from "../providers/MoveTheWheelsProvider.js";
|
|
25
|
+
import { formatCurrency as D, formatDate as O } from "../utils/formatters.js";
|
|
26
|
+
import { driverLicenseExpiryInput as he, driverLicenseExpiryUpdate as ge, parseDriverLicenseExpiry as _e } from "../utils/driverLicenseExpiry.js";
|
|
27
|
+
import { joinPath as k } from "../utils/navigation.js";
|
|
28
|
+
import { FormError as A } from "../components/FormError.js";
|
|
29
|
+
import { DocumentsCard as ve } from "../components/DocumentsCard.js";
|
|
30
|
+
import { DRIVER_STATUS_LABELS as j } from "../constants/index.js";
|
|
31
|
+
import { useEffect as M, useState as N } from "react";
|
|
32
|
+
import { useLocation as ye, useParams as P } from "react-router";
|
|
33
|
+
import { Fragment as be, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
34
|
+
import { EmphasisPanel as L, NextSteps as R, PagePurpose as xe, ResponsiveDialog as z, ResponsiveDialogContent as B, ResponsiveDialogDescription as V, ResponsiveDialogFooter as H, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W } from "@burdenoff/fe-libs/ui";
|
|
32
35
|
// src/movethewheels/pages/DriverDetailsPage.tsx
|
|
33
|
-
var
|
|
36
|
+
var Se = Object.entries(j).map(([e, t]) => ({
|
|
34
37
|
value: e,
|
|
35
38
|
label: t
|
|
36
|
-
})),
|
|
39
|
+
})), G = (e) => e ? e.toISOString().slice(0, 10) : "", K = (e) => e ? `${e}T12:00:00.000Z` : void 0, q = {
|
|
37
40
|
employeeId: "",
|
|
38
41
|
firstName: "",
|
|
39
42
|
lastName: "",
|
|
@@ -53,83 +56,83 @@ var ve = Object.entries(F).map(([e, t]) => ({
|
|
|
53
56
|
payCurrency: "",
|
|
54
57
|
onLeaveUntil: ""
|
|
55
58
|
};
|
|
56
|
-
function
|
|
57
|
-
let { basePath:
|
|
59
|
+
function J({ editId: n }) {
|
|
60
|
+
let { basePath: r, navigate: i } = me(), { createDriver: a, updateDriver: o, deleteDriver: re } = de(), { driver: u, refetch: d } = ue(n), f = !!n, [p, m] = N(q), [E, D] = N(!1), [ve, j] = N(null), [ye, P] = N(!1), [R, J] = N(""), [Y, Ce] = N(!1), [we, X] = N(null), [Te, Z] = N(!1), [Q, Ee] = N(!1), [De, Oe] = N(null), [ke, Ae] = N(""), je = T(ke), { vehicles: Me, isLoading: Ne, isLoadingMore: Pe, hasMore: Fe, totalVehicles: Ie, loadMore: Le } = pe({
|
|
58
61
|
limit: 20,
|
|
59
62
|
search: je || void 0
|
|
60
|
-
}), { vehicle: Re, isLoading: ze } =
|
|
61
|
-
|
|
62
|
-
if (!n || !
|
|
63
|
-
let [e, ...t] =
|
|
64
|
-
|
|
65
|
-
employeeId:
|
|
63
|
+
}), { vehicle: Re, isLoading: ze } = fe(p.vehicleId || void 0);
|
|
64
|
+
M(() => {
|
|
65
|
+
if (!n || !u) return;
|
|
66
|
+
let [e, ...t] = u.fullName.trim().split(/\s+/);
|
|
67
|
+
m({
|
|
68
|
+
employeeId: u.employeeId || "",
|
|
66
69
|
firstName: e || "",
|
|
67
70
|
lastName: t.join(" "),
|
|
68
|
-
email:
|
|
69
|
-
phone:
|
|
70
|
-
licenseNumber:
|
|
71
|
-
licenseClass:
|
|
72
|
-
licenseExpiry:
|
|
73
|
-
status:
|
|
74
|
-
vehicleId:
|
|
75
|
-
vehicleIds:
|
|
76
|
-
rating:
|
|
77
|
-
notes:
|
|
78
|
-
hireDate:
|
|
79
|
-
baseSalary:
|
|
80
|
-
bonusYtd:
|
|
81
|
-
payCurrency:
|
|
82
|
-
onLeaveUntil:
|
|
71
|
+
email: u.email || "",
|
|
72
|
+
phone: u.phone || "",
|
|
73
|
+
licenseNumber: u.licenseNumber || "",
|
|
74
|
+
licenseClass: u.licenseType || "",
|
|
75
|
+
licenseExpiry: he(u.licenseExpiry),
|
|
76
|
+
status: u.status,
|
|
77
|
+
vehicleId: u.assignedVehicle || "",
|
|
78
|
+
vehicleIds: u.vehicleIds,
|
|
79
|
+
rating: u.rating ? String(u.rating) : "",
|
|
80
|
+
notes: u.notes || "",
|
|
81
|
+
hireDate: G(u.hireDate),
|
|
82
|
+
baseSalary: u.baseSalary === void 0 ? "" : String(u.baseSalary),
|
|
83
|
+
bonusYtd: u.bonusYtd === void 0 ? "" : String(u.bonusYtd),
|
|
84
|
+
payCurrency: u.payCurrency || "",
|
|
85
|
+
onLeaveUntil: G(u.onLeaveUntil)
|
|
83
86
|
});
|
|
84
|
-
}, [n,
|
|
85
|
-
let Be = () =>
|
|
86
|
-
firstName:
|
|
87
|
-
lastName:
|
|
88
|
-
email:
|
|
89
|
-
phone:
|
|
90
|
-
licenseNumber:
|
|
91
|
-
licenseClass:
|
|
92
|
-
licenseExpiry:
|
|
93
|
-
status:
|
|
94
|
-
vehicleId:
|
|
95
|
-
vehicleIds:
|
|
96
|
-
rating:
|
|
97
|
-
notes:
|
|
98
|
-
hireDate:
|
|
99
|
-
baseSalary:
|
|
100
|
-
bonusYtd:
|
|
101
|
-
payCurrency:
|
|
102
|
-
...e ? { onLeaveUntil:
|
|
87
|
+
}, [n, u]);
|
|
88
|
+
let Be = () => i?.(k(r, "fleet/drivers")), $ = (e = !0) => ({
|
|
89
|
+
firstName: p.firstName.trim(),
|
|
90
|
+
lastName: p.lastName.trim(),
|
|
91
|
+
email: p.email.trim() || void 0,
|
|
92
|
+
phone: p.phone.trim() || void 0,
|
|
93
|
+
licenseNumber: p.licenseNumber.trim() || void 0,
|
|
94
|
+
licenseClass: p.licenseClass.trim() || void 0,
|
|
95
|
+
licenseExpiry: f ? ge(p.licenseExpiry, u?.licenseExpiry) : _e(p.licenseExpiry),
|
|
96
|
+
status: w(p.status),
|
|
97
|
+
vehicleId: p.vehicleId || null,
|
|
98
|
+
vehicleIds: p.vehicleIds,
|
|
99
|
+
rating: p.rating.trim() ? Number(p.rating) : void 0,
|
|
100
|
+
notes: p.notes.trim() || void 0,
|
|
101
|
+
hireDate: K(p.hireDate),
|
|
102
|
+
baseSalary: p.baseSalary.trim() ? Number(p.baseSalary) : void 0,
|
|
103
|
+
bonusYtd: p.bonusYtd.trim() ? Number(p.bonusYtd) : void 0,
|
|
104
|
+
payCurrency: p.payCurrency.trim() || void 0,
|
|
105
|
+
...e ? { onLeaveUntil: K(p.onLeaveUntil) ?? null } : {}
|
|
103
106
|
}), Ve = () => ({
|
|
104
|
-
employeeId:
|
|
107
|
+
employeeId: p.employeeId.trim(),
|
|
105
108
|
...$(!1)
|
|
106
109
|
}), He = async (e) => {
|
|
107
|
-
if (e.preventDefault(), !
|
|
108
|
-
else if (!
|
|
110
|
+
if (e.preventDefault(), !p.employeeId.trim() || !p.firstName.trim() || !p.lastName.trim()) j("Employee ID, first name and last name are required.");
|
|
111
|
+
else if (!p.phone.trim()) j("Phone is required so this driver can be reached.");
|
|
109
112
|
else {
|
|
110
|
-
|
|
113
|
+
D(!0), j(null);
|
|
111
114
|
try {
|
|
112
115
|
if (n) {
|
|
113
|
-
let e = await
|
|
114
|
-
|
|
116
|
+
let e = await o(n, $());
|
|
117
|
+
i?.(k(r, `fleet/drivers/${e.id}`));
|
|
115
118
|
} else {
|
|
116
|
-
let e = await
|
|
117
|
-
|
|
119
|
+
let e = await a(Ve());
|
|
120
|
+
i?.(k(r, `fleet/drivers/${e.id}`));
|
|
118
121
|
}
|
|
119
122
|
} catch (e) {
|
|
120
|
-
console.error("Failed to save driver:", e),
|
|
123
|
+
console.error("Failed to save driver:", e), j(e instanceof Error ? e.message : "Failed to save driver. Please try again."), D(!1);
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
}, Ue = async () => {
|
|
124
|
-
if (!n || !
|
|
127
|
+
if (!n || !R.trim()) X("A reason is required to dismiss a driver.");
|
|
125
128
|
else {
|
|
126
129
|
Ce(!0), X(null);
|
|
127
130
|
try {
|
|
128
|
-
await
|
|
131
|
+
await o(n, {
|
|
129
132
|
...$(),
|
|
130
133
|
terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
131
|
-
terminationReason:
|
|
132
|
-
}),
|
|
134
|
+
terminationReason: R.trim()
|
|
135
|
+
}), P(!1), await d(), i?.(k(r, `fleet/drivers/${n}`));
|
|
133
136
|
} catch (e) {
|
|
134
137
|
X(e instanceof Error ? e.message : "Failed to dismiss driver.");
|
|
135
138
|
} finally {
|
|
@@ -140,105 +143,105 @@ function K({ editId: n }) {
|
|
|
140
143
|
if (n) {
|
|
141
144
|
Ee(!0), Oe(null);
|
|
142
145
|
try {
|
|
143
|
-
await
|
|
146
|
+
await re(n), Z(!1), i?.(k(r, "fleet/drivers"));
|
|
144
147
|
} catch (e) {
|
|
145
148
|
Oe(e instanceof Error ? e.message : "Failed to delete driver.");
|
|
146
149
|
} finally {
|
|
147
150
|
Ee(!1);
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
|
-
}, Ge =
|
|
151
|
-
return /* @__PURE__ */
|
|
152
|
-
title:
|
|
153
|
+
}, Ge = f && !!u?.terminatedAt;
|
|
154
|
+
return /* @__PURE__ */ I(ie, {
|
|
155
|
+
title: f ? "Edit Driver" : "Add Driver",
|
|
153
156
|
subtitle: "Add a driver to your workforce",
|
|
154
|
-
icon: /* @__PURE__ */
|
|
155
|
-
headerActions: /* @__PURE__ */
|
|
157
|
+
icon: /* @__PURE__ */ F(e, { size: 24 }),
|
|
158
|
+
headerActions: /* @__PURE__ */ I("div", {
|
|
156
159
|
className: "flex gap-2",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
160
|
+
children: [/* @__PURE__ */ I(h, {
|
|
158
161
|
variant: "outline",
|
|
159
162
|
onClick: Be,
|
|
160
|
-
disabled:
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
-
}), /* @__PURE__ */
|
|
163
|
+
disabled: E,
|
|
164
|
+
children: [/* @__PURE__ */ F(t, { size: 16 }), " Cancel"]
|
|
165
|
+
}), /* @__PURE__ */ I(h, {
|
|
163
166
|
onClick: He,
|
|
164
|
-
disabled:
|
|
167
|
+
disabled: E,
|
|
165
168
|
children: [
|
|
166
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ F(s, { size: 16 }),
|
|
167
170
|
" ",
|
|
168
|
-
|
|
171
|
+
f ? E ? "Saving..." : "Save Changes" : E ? "Saving..." : "Add Driver"
|
|
169
172
|
]
|
|
170
173
|
})]
|
|
171
174
|
}),
|
|
172
175
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
icon: /* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ F(xe, {
|
|
177
|
+
icon: /* @__PURE__ */ F(e, { size: 18 }),
|
|
175
178
|
children: "Add a driver so they can be assigned to orders and routes. An employee ID, name and phone get them on the roster — add licensing, a vehicle and HR details to keep the record complete."
|
|
176
179
|
}),
|
|
177
|
-
Ge &&
|
|
180
|
+
Ge && u?.terminatedAt && /* @__PURE__ */ I("div", {
|
|
178
181
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
179
|
-
children: [/* @__PURE__ */
|
|
182
|
+
children: [/* @__PURE__ */ I("p", {
|
|
180
183
|
className: "font-medium",
|
|
181
184
|
children: [
|
|
182
185
|
"This driver was dismissed on ",
|
|
183
|
-
|
|
186
|
+
O(u.terminatedAt, "full"),
|
|
184
187
|
"."
|
|
185
188
|
]
|
|
186
|
-
}),
|
|
189
|
+
}), u.terminationReason && /* @__PURE__ */ I("p", {
|
|
187
190
|
className: "mt-1",
|
|
188
|
-
children: ["Reason: ",
|
|
191
|
+
children: ["Reason: ", u.terminationReason]
|
|
189
192
|
})]
|
|
190
193
|
}),
|
|
191
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ I("form", {
|
|
192
195
|
onSubmit: He,
|
|
193
196
|
className: "max-w-3xl space-y-6",
|
|
194
197
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ F(A, { message: ve }),
|
|
199
|
+
/* @__PURE__ */ I(L, { children: [/* @__PURE__ */ F("h2", {
|
|
197
200
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
198
201
|
children: "Driver Details"
|
|
199
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ I("div", {
|
|
200
203
|
className: "space-y-4",
|
|
201
204
|
children: [
|
|
202
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ I("div", {
|
|
203
206
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
204
207
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
208
|
+
/* @__PURE__ */ I("div", {
|
|
206
209
|
className: "space-y-2",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ I(x, {
|
|
208
211
|
htmlFor: "employeeId",
|
|
209
212
|
children: [
|
|
210
213
|
"Employee ID ",
|
|
211
|
-
|
|
214
|
+
f ? "(immutable)" : "",
|
|
212
215
|
" ",
|
|
213
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ F("span", {
|
|
214
217
|
className: "text-status-error-text",
|
|
215
|
-
children: !
|
|
218
|
+
children: !f && "*"
|
|
216
219
|
})
|
|
217
220
|
]
|
|
218
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ F(b, {
|
|
219
222
|
id: "employeeId",
|
|
220
|
-
value:
|
|
221
|
-
onChange: (e) =>
|
|
223
|
+
value: p.employeeId,
|
|
224
|
+
onChange: (e) => m((t) => ({
|
|
222
225
|
...t,
|
|
223
226
|
employeeId: e.target.value
|
|
224
227
|
})),
|
|
225
228
|
placeholder: "EMP-001",
|
|
226
229
|
required: !0,
|
|
227
|
-
disabled:
|
|
230
|
+
disabled: f
|
|
228
231
|
})]
|
|
229
232
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ I("div", {
|
|
231
234
|
className: "space-y-2",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ I(x, {
|
|
233
236
|
htmlFor: "firstName",
|
|
234
|
-
children: ["First Name ", /* @__PURE__ */
|
|
237
|
+
children: ["First Name ", /* @__PURE__ */ F("span", {
|
|
235
238
|
className: "text-status-error-text",
|
|
236
239
|
children: "*"
|
|
237
240
|
})]
|
|
238
|
-
}), /* @__PURE__ */
|
|
241
|
+
}), /* @__PURE__ */ F(b, {
|
|
239
242
|
id: "firstName",
|
|
240
|
-
value:
|
|
241
|
-
onChange: (e) =>
|
|
243
|
+
value: p.firstName,
|
|
244
|
+
onChange: (e) => m((t) => ({
|
|
242
245
|
...t,
|
|
243
246
|
firstName: e.target.value
|
|
244
247
|
})),
|
|
@@ -246,18 +249,18 @@ function K({ editId: n }) {
|
|
|
246
249
|
required: !0
|
|
247
250
|
})]
|
|
248
251
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ I("div", {
|
|
250
253
|
className: "space-y-2",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ I(x, {
|
|
252
255
|
htmlFor: "lastName",
|
|
253
|
-
children: ["Last Name ", /* @__PURE__ */
|
|
256
|
+
children: ["Last Name ", /* @__PURE__ */ F("span", {
|
|
254
257
|
className: "text-status-error-text",
|
|
255
258
|
children: "*"
|
|
256
259
|
})]
|
|
257
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ F(b, {
|
|
258
261
|
id: "lastName",
|
|
259
|
-
value:
|
|
260
|
-
onChange: (e) =>
|
|
262
|
+
value: p.lastName,
|
|
263
|
+
onChange: (e) => m((t) => ({
|
|
261
264
|
...t,
|
|
262
265
|
lastName: e.target.value
|
|
263
266
|
})),
|
|
@@ -267,37 +270,37 @@ function K({ editId: n }) {
|
|
|
267
270
|
})
|
|
268
271
|
]
|
|
269
272
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ I("div", {
|
|
271
274
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
272
275
|
children: [
|
|
273
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ I("div", {
|
|
274
277
|
className: "space-y-2",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
278
|
+
children: [/* @__PURE__ */ F(x, {
|
|
276
279
|
htmlFor: "email",
|
|
277
280
|
children: "Email"
|
|
278
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ F(b, {
|
|
279
282
|
id: "email",
|
|
280
283
|
type: "email",
|
|
281
|
-
value:
|
|
282
|
-
onChange: (e) =>
|
|
284
|
+
value: p.email,
|
|
285
|
+
onChange: (e) => m((t) => ({
|
|
283
286
|
...t,
|
|
284
287
|
email: e.target.value
|
|
285
288
|
})),
|
|
286
289
|
placeholder: "jane.doe@example.com"
|
|
287
290
|
})]
|
|
288
291
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ I("div", {
|
|
290
293
|
className: "space-y-2",
|
|
291
|
-
children: [/* @__PURE__ */
|
|
294
|
+
children: [/* @__PURE__ */ I(x, {
|
|
292
295
|
htmlFor: "phone",
|
|
293
|
-
children: ["Phone ", /* @__PURE__ */
|
|
296
|
+
children: ["Phone ", /* @__PURE__ */ F("span", {
|
|
294
297
|
className: "text-status-error-text",
|
|
295
298
|
children: "*"
|
|
296
299
|
})]
|
|
297
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ F(b, {
|
|
298
301
|
id: "phone",
|
|
299
|
-
value:
|
|
300
|
-
onChange: (e) =>
|
|
302
|
+
value: p.phone,
|
|
303
|
+
onChange: (e) => m((t) => ({
|
|
301
304
|
...t,
|
|
302
305
|
phone: e.target.value
|
|
303
306
|
})),
|
|
@@ -305,21 +308,21 @@ function K({ editId: n }) {
|
|
|
305
308
|
required: !0
|
|
306
309
|
})]
|
|
307
310
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ I("div", {
|
|
309
312
|
className: "space-y-2",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
313
|
+
children: [/* @__PURE__ */ F(x, {
|
|
311
314
|
htmlFor: "status",
|
|
312
315
|
children: "Status"
|
|
313
|
-
}), /* @__PURE__ */
|
|
314
|
-
value:
|
|
315
|
-
onValueChange: (e) =>
|
|
316
|
+
}), /* @__PURE__ */ I(ae, {
|
|
317
|
+
value: p.status,
|
|
318
|
+
onValueChange: (e) => m((t) => ({
|
|
316
319
|
...t,
|
|
317
320
|
status: e
|
|
318
321
|
})),
|
|
319
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ F(ce, {
|
|
320
323
|
id: "status",
|
|
321
|
-
children: /* @__PURE__ */
|
|
322
|
-
}), /* @__PURE__ */
|
|
324
|
+
children: /* @__PURE__ */ F(le, {})
|
|
325
|
+
}), /* @__PURE__ */ F(oe, { children: Se.map((e) => /* @__PURE__ */ F(se, {
|
|
323
326
|
value: e.value,
|
|
324
327
|
children: e.label
|
|
325
328
|
}, e.value)) })]
|
|
@@ -327,71 +330,71 @@ function K({ editId: n }) {
|
|
|
327
330
|
})
|
|
328
331
|
]
|
|
329
332
|
}),
|
|
330
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ I("div", {
|
|
331
334
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
332
335
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ I("div", {
|
|
334
337
|
className: "space-y-2",
|
|
335
|
-
children: [/* @__PURE__ */
|
|
338
|
+
children: [/* @__PURE__ */ F(x, {
|
|
336
339
|
htmlFor: "licenseNumber",
|
|
337
340
|
children: "License Number"
|
|
338
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ F(b, {
|
|
339
342
|
id: "licenseNumber",
|
|
340
|
-
value:
|
|
341
|
-
onChange: (e) =>
|
|
343
|
+
value: p.licenseNumber,
|
|
344
|
+
onChange: (e) => m((t) => ({
|
|
342
345
|
...t,
|
|
343
346
|
licenseNumber: e.target.value
|
|
344
347
|
})),
|
|
345
348
|
placeholder: "D1234567"
|
|
346
349
|
})]
|
|
347
350
|
}),
|
|
348
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ I("div", {
|
|
349
352
|
className: "space-y-2",
|
|
350
|
-
children: [/* @__PURE__ */
|
|
353
|
+
children: [/* @__PURE__ */ F(x, {
|
|
351
354
|
htmlFor: "licenseClass",
|
|
352
355
|
children: "License Class"
|
|
353
|
-
}), /* @__PURE__ */
|
|
356
|
+
}), /* @__PURE__ */ F(b, {
|
|
354
357
|
id: "licenseClass",
|
|
355
|
-
value:
|
|
356
|
-
onChange: (e) =>
|
|
358
|
+
value: p.licenseClass,
|
|
359
|
+
onChange: (e) => m((t) => ({
|
|
357
360
|
...t,
|
|
358
361
|
licenseClass: e.target.value
|
|
359
362
|
})),
|
|
360
363
|
placeholder: "Class A"
|
|
361
364
|
})]
|
|
362
365
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ I("div", {
|
|
364
367
|
className: "space-y-2 md:col-span-3",
|
|
365
368
|
children: [
|
|
366
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ I("div", {
|
|
367
370
|
className: "flex items-center justify-between gap-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ F(x, {
|
|
369
372
|
htmlFor: "licenseExpiry",
|
|
370
373
|
children: "Licence expiry (UTC)"
|
|
371
|
-
}),
|
|
374
|
+
}), p.licenseExpiry && /* @__PURE__ */ F(h, {
|
|
372
375
|
type: "button",
|
|
373
376
|
variant: "ghost",
|
|
374
377
|
size: "sm",
|
|
375
378
|
"aria-label": "Clear recorded licence expiry",
|
|
376
|
-
onClick: () =>
|
|
379
|
+
onClick: () => m((e) => ({
|
|
377
380
|
...e,
|
|
378
381
|
licenseExpiry: ""
|
|
379
382
|
})),
|
|
380
383
|
children: "Clear"
|
|
381
384
|
})]
|
|
382
385
|
}),
|
|
383
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ F(b, {
|
|
384
387
|
id: "licenseExpiry",
|
|
385
388
|
type: "datetime-local",
|
|
386
389
|
step: "0.001",
|
|
387
390
|
"aria-describedby": "licenseExpiryHelp",
|
|
388
|
-
value:
|
|
389
|
-
onChange: (e) =>
|
|
391
|
+
value: p.licenseExpiry,
|
|
392
|
+
onChange: (e) => m((t) => ({
|
|
390
393
|
...t,
|
|
391
394
|
licenseExpiry: e.target.value
|
|
392
395
|
}))
|
|
393
396
|
}),
|
|
394
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ F("p", {
|
|
395
398
|
id: "licenseExpiryHelp",
|
|
396
399
|
className: "text-xs text-text-secondary",
|
|
397
400
|
children: "Enter the recorded UTC time. Blank means expiry not recorded; clearing removes it. A recorded expiry does not certify legal driving eligibility."
|
|
@@ -400,28 +403,28 @@ function K({ editId: n }) {
|
|
|
400
403
|
})
|
|
401
404
|
]
|
|
402
405
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ I("div", {
|
|
404
407
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
408
|
+
children: [/* @__PURE__ */ I("div", {
|
|
406
409
|
className: "space-y-2",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ F(x, {
|
|
408
411
|
htmlFor: "vehicleSearch",
|
|
409
412
|
children: "Search vehicles"
|
|
410
|
-
}), /* @__PURE__ */
|
|
413
|
+
}), /* @__PURE__ */ F(b, {
|
|
411
414
|
id: "vehicleSearch",
|
|
412
415
|
value: ke,
|
|
413
416
|
onChange: (e) => Ae(e.target.value),
|
|
414
417
|
placeholder: "Vehicle number or type"
|
|
415
418
|
})]
|
|
416
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ I("div", {
|
|
417
420
|
className: "space-y-2",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ F(x, {
|
|
419
422
|
htmlFor: "vehicle",
|
|
420
423
|
children: "Assigned Vehicle"
|
|
421
|
-
}), /* @__PURE__ */
|
|
424
|
+
}), /* @__PURE__ */ F(C, {
|
|
422
425
|
id: "vehicle",
|
|
423
|
-
value:
|
|
424
|
-
onChange: (e) =>
|
|
426
|
+
value: p.vehicleId,
|
|
427
|
+
onChange: (e) => m((t) => ({
|
|
425
428
|
...t,
|
|
426
429
|
vehicleId: e,
|
|
427
430
|
vehicleIds: e ? [e] : []
|
|
@@ -430,8 +433,8 @@ function K({ editId: n }) {
|
|
|
430
433
|
loading: Ne,
|
|
431
434
|
getId: (e) => e.id,
|
|
432
435
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
433
|
-
renderOption: (e) => /* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
436
|
+
renderOption: (e) => /* @__PURE__ */ I(be, { children: [
|
|
437
|
+
/* @__PURE__ */ F(te, {
|
|
435
438
|
size: 14,
|
|
436
439
|
className: "mr-2 inline text-text-secondary"
|
|
437
440
|
}),
|
|
@@ -451,65 +454,65 @@ function K({ editId: n }) {
|
|
|
451
454
|
})]
|
|
452
455
|
})]
|
|
453
456
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ I("div", {
|
|
455
458
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
456
459
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ I("div", {
|
|
458
461
|
className: "space-y-2",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ F(x, {
|
|
460
463
|
htmlFor: "rating",
|
|
461
464
|
children: "Rating (0–5)"
|
|
462
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ F(b, {
|
|
463
466
|
id: "rating",
|
|
464
467
|
type: "number",
|
|
465
468
|
min: 0,
|
|
466
469
|
max: 5,
|
|
467
470
|
step: .1,
|
|
468
|
-
value:
|
|
469
|
-
onChange: (e) =>
|
|
471
|
+
value: p.rating,
|
|
472
|
+
onChange: (e) => m((t) => ({
|
|
470
473
|
...t,
|
|
471
474
|
rating: e.target.value
|
|
472
475
|
})),
|
|
473
476
|
placeholder: "4.8"
|
|
474
477
|
})]
|
|
475
478
|
}),
|
|
476
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ I("div", {
|
|
477
480
|
className: "space-y-2",
|
|
478
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ F(x, {
|
|
479
482
|
htmlFor: "hireDate",
|
|
480
483
|
children: "Hire Date"
|
|
481
|
-
}), /* @__PURE__ */
|
|
484
|
+
}), /* @__PURE__ */ F(b, {
|
|
482
485
|
id: "hireDate",
|
|
483
486
|
type: "date",
|
|
484
|
-
value:
|
|
485
|
-
onChange: (e) =>
|
|
487
|
+
value: p.hireDate,
|
|
488
|
+
onChange: (e) => m((t) => ({
|
|
486
489
|
...t,
|
|
487
490
|
hireDate: e.target.value
|
|
488
491
|
}))
|
|
489
492
|
})]
|
|
490
493
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ I("div", {
|
|
492
495
|
className: "space-y-2",
|
|
493
|
-
children: [/* @__PURE__ */
|
|
496
|
+
children: [/* @__PURE__ */ I("div", {
|
|
494
497
|
className: "flex items-center justify-between gap-2",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
498
|
+
children: [/* @__PURE__ */ F(x, {
|
|
496
499
|
htmlFor: "onLeaveUntil",
|
|
497
500
|
children: "On Leave Until"
|
|
498
|
-
}),
|
|
501
|
+
}), p.onLeaveUntil && /* @__PURE__ */ F(h, {
|
|
499
502
|
type: "button",
|
|
500
503
|
variant: "ghost",
|
|
501
504
|
size: "sm",
|
|
502
|
-
onClick: () =>
|
|
505
|
+
onClick: () => m((e) => ({
|
|
503
506
|
...e,
|
|
504
507
|
onLeaveUntil: ""
|
|
505
508
|
})),
|
|
506
509
|
children: "Clear"
|
|
507
510
|
})]
|
|
508
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */ F(b, {
|
|
509
512
|
id: "onLeaveUntil",
|
|
510
513
|
type: "date",
|
|
511
|
-
value:
|
|
512
|
-
onChange: (e) =>
|
|
514
|
+
value: p.onLeaveUntil,
|
|
515
|
+
onChange: (e) => m((t) => ({
|
|
513
516
|
...t,
|
|
514
517
|
onLeaveUntil: e.target.value
|
|
515
518
|
}))
|
|
@@ -519,57 +522,57 @@ function K({ editId: n }) {
|
|
|
519
522
|
})
|
|
520
523
|
]
|
|
521
524
|
})] }),
|
|
522
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
523
526
|
className: "flex items-center gap-2",
|
|
524
|
-
children: [/* @__PURE__ */
|
|
525
|
-
}) }), /* @__PURE__ */
|
|
527
|
+
children: [/* @__PURE__ */ F(ee, { size: 18 }), " Compensation"]
|
|
528
|
+
}) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ I("div", {
|
|
526
529
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
527
530
|
children: [
|
|
528
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ I("div", {
|
|
529
532
|
className: "space-y-2",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ F(x, {
|
|
531
534
|
htmlFor: "baseSalary",
|
|
532
535
|
children: "Base Salary (annual)"
|
|
533
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ F(b, {
|
|
534
537
|
id: "baseSalary",
|
|
535
538
|
type: "number",
|
|
536
539
|
min: 0,
|
|
537
540
|
step: .01,
|
|
538
|
-
value:
|
|
539
|
-
onChange: (e) =>
|
|
541
|
+
value: p.baseSalary,
|
|
542
|
+
onChange: (e) => m((t) => ({
|
|
540
543
|
...t,
|
|
541
544
|
baseSalary: e.target.value
|
|
542
545
|
})),
|
|
543
546
|
placeholder: "55000"
|
|
544
547
|
})]
|
|
545
548
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ I("div", {
|
|
547
550
|
className: "space-y-2",
|
|
548
|
-
children: [/* @__PURE__ */
|
|
551
|
+
children: [/* @__PURE__ */ F(x, {
|
|
549
552
|
htmlFor: "bonusYtd",
|
|
550
553
|
children: "Bonus (YTD)"
|
|
551
|
-
}), /* @__PURE__ */
|
|
554
|
+
}), /* @__PURE__ */ F(b, {
|
|
552
555
|
id: "bonusYtd",
|
|
553
556
|
type: "number",
|
|
554
557
|
min: 0,
|
|
555
558
|
step: .01,
|
|
556
|
-
value:
|
|
557
|
-
onChange: (e) =>
|
|
559
|
+
value: p.bonusYtd,
|
|
560
|
+
onChange: (e) => m((t) => ({
|
|
558
561
|
...t,
|
|
559
562
|
bonusYtd: e.target.value
|
|
560
563
|
})),
|
|
561
564
|
placeholder: "1200"
|
|
562
565
|
})]
|
|
563
566
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ I("div", {
|
|
565
568
|
className: "space-y-2",
|
|
566
|
-
children: [/* @__PURE__ */
|
|
569
|
+
children: [/* @__PURE__ */ F(x, {
|
|
567
570
|
htmlFor: "payCurrency",
|
|
568
571
|
children: "Currency"
|
|
569
|
-
}), /* @__PURE__ */
|
|
572
|
+
}), /* @__PURE__ */ F(b, {
|
|
570
573
|
id: "payCurrency",
|
|
571
|
-
value:
|
|
572
|
-
onChange: (e) =>
|
|
574
|
+
value: p.payCurrency,
|
|
575
|
+
onChange: (e) => m((t) => ({
|
|
573
576
|
...t,
|
|
574
577
|
payCurrency: e.target.value
|
|
575
578
|
})),
|
|
@@ -579,71 +582,71 @@ function K({ editId: n }) {
|
|
|
579
582
|
})
|
|
580
583
|
]
|
|
581
584
|
}) })] }),
|
|
582
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
583
586
|
className: "flex items-center gap-2",
|
|
584
|
-
children: [/* @__PURE__ */
|
|
585
|
-
}) }), /* @__PURE__ */
|
|
586
|
-
value:
|
|
587
|
-
onChange: (e) =>
|
|
587
|
+
children: [/* @__PURE__ */ F(ne, { size: 18 }), " HR Notes"]
|
|
588
|
+
}) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F(S, {
|
|
589
|
+
value: p.notes,
|
|
590
|
+
onChange: (e) => m((t) => ({
|
|
588
591
|
...t,
|
|
589
592
|
notes: e.target.value
|
|
590
593
|
})),
|
|
591
594
|
placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
|
|
592
595
|
rows: 4
|
|
593
596
|
}) })] }),
|
|
594
|
-
|
|
597
|
+
f && !Ge && /* @__PURE__ */ I(g, {
|
|
595
598
|
className: "border-status-error-border",
|
|
596
|
-
children: [/* @__PURE__ */
|
|
599
|
+
children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
597
600
|
className: "flex items-center gap-2 text-status-error-text",
|
|
598
|
-
children: [/* @__PURE__ */
|
|
599
|
-
}) }), /* @__PURE__ */
|
|
601
|
+
children: [/* @__PURE__ */ F(c, { size: 18 }), " Dismiss Driver"]
|
|
602
|
+
}) }), /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F("p", {
|
|
600
603
|
className: "mb-3 text-sm text-text-secondary",
|
|
601
604
|
children: "Dismissing a driver marks them as no longer employed. Their delivery and route history stays visible; they can no longer be assigned new work. This cannot be undone from here."
|
|
602
|
-
}), /* @__PURE__ */
|
|
605
|
+
}), /* @__PURE__ */ I(h, {
|
|
603
606
|
type: "button",
|
|
604
607
|
variant: "outline",
|
|
605
608
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
606
|
-
onClick: () =>
|
|
607
|
-
children: [/* @__PURE__ */
|
|
609
|
+
onClick: () => P(!0),
|
|
610
|
+
children: [/* @__PURE__ */ F(c, { size: 16 }), " Dismiss this driver"]
|
|
608
611
|
})] })]
|
|
609
612
|
}),
|
|
610
|
-
|
|
613
|
+
f && /* @__PURE__ */ I(g, {
|
|
611
614
|
className: "border-status-error-border",
|
|
612
|
-
children: [/* @__PURE__ */
|
|
615
|
+
children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
613
616
|
className: "flex items-center gap-2 text-status-error-text",
|
|
614
|
-
children: [/* @__PURE__ */
|
|
615
|
-
}) }), /* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ F(l, { size: 18 }), " Delete Driver"]
|
|
618
|
+
}) }), /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F("p", {
|
|
616
619
|
className: "mb-3 text-sm text-text-secondary",
|
|
617
620
|
children: "Removes this driver record, for example one entered by mistake, and unlinks them from any vehicle. To keep delivery history for someone who has left, dismiss them instead. This cannot be undone from here."
|
|
618
|
-
}), /* @__PURE__ */
|
|
621
|
+
}), /* @__PURE__ */ I(h, {
|
|
619
622
|
type: "button",
|
|
620
623
|
variant: "outline",
|
|
621
624
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
622
625
|
onClick: () => Z(!0),
|
|
623
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ F(l, { size: 16 }), " Delete this driver"]
|
|
624
627
|
})] })]
|
|
625
628
|
})
|
|
626
629
|
]
|
|
627
630
|
}),
|
|
628
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ F(z, {
|
|
629
632
|
open: Te,
|
|
630
633
|
onOpenChange: Z,
|
|
631
|
-
children: /* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
634
|
+
children: /* @__PURE__ */ I(B, { children: [
|
|
635
|
+
/* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(W, { children: "Delete this driver?" }), /* @__PURE__ */ I(V, { children: [
|
|
633
636
|
"This removes ",
|
|
634
|
-
`${
|
|
637
|
+
`${p.firstName} ${p.lastName}`.trim() || "this driver",
|
|
635
638
|
" and unlinks them from any vehicle. It cannot be undone from here."
|
|
636
639
|
] })] }),
|
|
637
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ F("div", {
|
|
638
641
|
className: "px-1",
|
|
639
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ F(A, { message: De })
|
|
640
643
|
}),
|
|
641
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ I(H, { children: [/* @__PURE__ */ F(h, {
|
|
642
645
|
variant: "outline",
|
|
643
646
|
onClick: () => Z(!1),
|
|
644
647
|
disabled: Q,
|
|
645
648
|
children: "Cancel"
|
|
646
|
-
}), /* @__PURE__ */
|
|
649
|
+
}), /* @__PURE__ */ F(h, {
|
|
647
650
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
648
651
|
onClick: We,
|
|
649
652
|
disabled: Q,
|
|
@@ -651,37 +654,37 @@ function K({ editId: n }) {
|
|
|
651
654
|
})] })
|
|
652
655
|
] })
|
|
653
656
|
}),
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
open:
|
|
656
|
-
onOpenChange:
|
|
657
|
-
children: /* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ F(z, {
|
|
658
|
+
open: ye,
|
|
659
|
+
onOpenChange: P,
|
|
660
|
+
children: /* @__PURE__ */ I(B, { children: [
|
|
661
|
+
/* @__PURE__ */ I(U, { children: [/* @__PURE__ */ F(W, { children: "Dismiss this driver?" }), /* @__PURE__ */ F(V, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
|
|
662
|
+
/* @__PURE__ */ I("div", {
|
|
660
663
|
className: "space-y-2 px-1",
|
|
661
664
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ I(x, {
|
|
663
666
|
htmlFor: "dismissReason",
|
|
664
|
-
children: ["Reason ", /* @__PURE__ */
|
|
667
|
+
children: ["Reason ", /* @__PURE__ */ F("span", {
|
|
665
668
|
className: "text-status-error-text",
|
|
666
669
|
children: "*"
|
|
667
670
|
})]
|
|
668
671
|
}),
|
|
669
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ F(S, {
|
|
670
673
|
id: "dismissReason",
|
|
671
|
-
value:
|
|
672
|
-
onChange: (e) =>
|
|
674
|
+
value: R,
|
|
675
|
+
onChange: (e) => J(e.target.value),
|
|
673
676
|
placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
|
|
674
677
|
rows: 3
|
|
675
678
|
}),
|
|
676
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ F(A, { message: we })
|
|
677
680
|
]
|
|
678
681
|
}),
|
|
679
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ I(H, { children: [/* @__PURE__ */ F(h, {
|
|
680
683
|
variant: "outline",
|
|
681
|
-
onClick: () =>
|
|
684
|
+
onClick: () => P(!1),
|
|
682
685
|
disabled: Y,
|
|
683
686
|
children: "Cancel"
|
|
684
|
-
}), /* @__PURE__ */
|
|
687
|
+
}), /* @__PURE__ */ F(h, {
|
|
685
688
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
686
689
|
onClick: Ue,
|
|
687
690
|
disabled: Y,
|
|
@@ -692,41 +695,51 @@ function K({ editId: n }) {
|
|
|
692
695
|
]
|
|
693
696
|
});
|
|
694
697
|
}
|
|
695
|
-
function
|
|
696
|
-
let { driverId:
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
698
|
+
function Y() {
|
|
699
|
+
let { driverId: s } = P(), c = ye().pathname.endsWith("/edit"), { basePath: S, navigate: C } = me(), { driver: w, isLoading: de, error: pe, refetch: T, addShift: he, removeShift: ge, addComplianceRecord: _e, removeComplianceRecord: A } = ue(s), [j, M] = N(!1), [L, z] = N({
|
|
700
|
+
shiftDate: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
701
|
+
startTime: "08:00",
|
|
702
|
+
endTime: "16:00",
|
|
703
|
+
status: "SCHEDULED"
|
|
704
|
+
}), [B, V] = N(!1), [H, U] = N({
|
|
705
|
+
recordType: "MEDICAL_CERT",
|
|
706
|
+
status: "VALID",
|
|
707
|
+
expiresAt: "",
|
|
708
|
+
referenceNumber: ""
|
|
709
|
+
});
|
|
710
|
+
E(c, T);
|
|
711
|
+
let { vehicle: W } = fe(w?.assignedVehicle), Se = () => C?.(k(S, "fleet/drivers")), G = (e) => C?.(k(S, e));
|
|
712
|
+
if (!s) return /* @__PURE__ */ F(J, {});
|
|
713
|
+
if (c) return /* @__PURE__ */ F(J, { editId: s });
|
|
714
|
+
if (de) return /* @__PURE__ */ F(p, { message: "Loading driver details..." });
|
|
715
|
+
if (pe || !w) return /* @__PURE__ */ F(f, {
|
|
703
716
|
title: "Driver not found",
|
|
704
|
-
onRetry:
|
|
717
|
+
onRetry: T
|
|
705
718
|
});
|
|
706
|
-
let
|
|
707
|
-
return /* @__PURE__ */
|
|
708
|
-
title:
|
|
709
|
-
subtitle: `Employee ID: ${
|
|
710
|
-
icon: /* @__PURE__ */
|
|
711
|
-
headerActions: /* @__PURE__ */
|
|
719
|
+
let K = !!w.terminatedAt, q = w.onLeaveUntil && w.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? w.onLeaveUntil : void 0, Y = w.baseSalary !== void 0 || w.bonusYtd !== void 0;
|
|
720
|
+
return /* @__PURE__ */ I(ie, {
|
|
721
|
+
title: w.fullName,
|
|
722
|
+
subtitle: `Employee ID: ${w.employeeId}`,
|
|
723
|
+
icon: /* @__PURE__ */ F(e, { size: 24 }),
|
|
724
|
+
headerActions: /* @__PURE__ */ I("div", {
|
|
712
725
|
className: "flex gap-2",
|
|
713
|
-
children: [/* @__PURE__ */
|
|
726
|
+
children: [/* @__PURE__ */ I(h, {
|
|
714
727
|
variant: "outline",
|
|
715
|
-
onClick:
|
|
716
|
-
children: [/* @__PURE__ */
|
|
717
|
-
}), /* @__PURE__ */
|
|
718
|
-
onClick: () =>
|
|
719
|
-
children: [/* @__PURE__ */
|
|
728
|
+
onClick: Se,
|
|
729
|
+
children: [/* @__PURE__ */ F(t, { size: 16 }), " Back"]
|
|
730
|
+
}), /* @__PURE__ */ I(h, {
|
|
731
|
+
onClick: () => C?.(k(S, "fleet/drivers/" + s + "/edit")),
|
|
732
|
+
children: [/* @__PURE__ */ F(a, { size: 16 }), " Edit"]
|
|
720
733
|
})]
|
|
721
734
|
}),
|
|
722
|
-
headerContent: /* @__PURE__ */
|
|
735
|
+
headerContent: /* @__PURE__ */ I("div", {
|
|
723
736
|
className: "flex flex-wrap items-center gap-4",
|
|
724
737
|
children: [
|
|
725
|
-
/* @__PURE__ */
|
|
726
|
-
status:
|
|
738
|
+
/* @__PURE__ */ F(m, {
|
|
739
|
+
status: w.status,
|
|
727
740
|
type: "driver"
|
|
728
741
|
}),
|
|
729
|
-
|
|
742
|
+
K && /* @__PURE__ */ F(m, {
|
|
730
743
|
status: "dismissed",
|
|
731
744
|
label: "Dismissed",
|
|
732
745
|
customColors: {
|
|
@@ -734,168 +747,429 @@ function q() {
|
|
|
734
747
|
text: "text-status-error-text"
|
|
735
748
|
}
|
|
736
749
|
}),
|
|
737
|
-
|
|
750
|
+
q && !K && /* @__PURE__ */ F(m, {
|
|
738
751
|
status: "on_leave",
|
|
739
|
-
label: `On leave until ${
|
|
752
|
+
label: `On leave until ${O(q, "short")}`,
|
|
740
753
|
customColors: {
|
|
741
754
|
bg: "bg-status-warning-bg-subtle",
|
|
742
755
|
text: "text-status-warning-text"
|
|
743
756
|
}
|
|
744
757
|
}),
|
|
745
|
-
|
|
758
|
+
w.rating !== void 0 && /* @__PURE__ */ I("div", {
|
|
746
759
|
className: "flex items-center gap-1",
|
|
747
|
-
children: [/* @__PURE__ */
|
|
760
|
+
children: [/* @__PURE__ */ F(n, {
|
|
748
761
|
size: 16,
|
|
749
762
|
className: "text-status-warning-text fill-current"
|
|
750
|
-
}), /* @__PURE__ */
|
|
763
|
+
}), /* @__PURE__ */ F("span", {
|
|
751
764
|
className: "font-medium",
|
|
752
|
-
children:
|
|
765
|
+
children: w.rating.toFixed(1)
|
|
753
766
|
})]
|
|
754
767
|
})
|
|
755
768
|
]
|
|
756
769
|
}),
|
|
757
770
|
children: [
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
icon: /* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ F(xe, {
|
|
772
|
+
icon: /* @__PURE__ */ F(e, { size: 18 }),
|
|
760
773
|
children: "Review the recorded licensing, assigned vehicle, documents and HR facts before assignment. These records do not certify legal driving eligibility or duty-hours availability."
|
|
761
774
|
}),
|
|
762
|
-
/* @__PURE__ */ R
|
|
775
|
+
/* @__PURE__ */ F(R, {
|
|
763
776
|
storageKey: "movethewheels-driver-details",
|
|
764
777
|
steps: [
|
|
765
778
|
{
|
|
766
779
|
id: "assign",
|
|
767
780
|
label: "Assign to an order",
|
|
768
781
|
description: "Hand a pending delivery to this driver.",
|
|
769
|
-
icon: /* @__PURE__ */
|
|
770
|
-
onClick: () =>
|
|
782
|
+
icon: /* @__PURE__ */ F(o, { size: 16 }),
|
|
783
|
+
onClick: () => G("orders")
|
|
771
784
|
},
|
|
772
785
|
{
|
|
773
786
|
id: "routes",
|
|
774
787
|
label: "Plan their route",
|
|
775
788
|
description: "Batch nearby drop-offs into an optimized itinerary.",
|
|
776
|
-
icon: /* @__PURE__ */
|
|
777
|
-
onClick: () =>
|
|
789
|
+
icon: /* @__PURE__ */ F(r, { size: 16 }),
|
|
790
|
+
onClick: () => G("routes")
|
|
778
791
|
},
|
|
779
792
|
{
|
|
780
793
|
id: "edit",
|
|
781
794
|
label: "Update driver record",
|
|
782
795
|
description: "Refresh documents, license or HR details.",
|
|
783
|
-
icon: /* @__PURE__ */
|
|
796
|
+
icon: /* @__PURE__ */ F(a, { size: 16 }),
|
|
784
797
|
onClick: () => {}
|
|
785
798
|
}
|
|
786
799
|
]
|
|
787
800
|
}),
|
|
788
|
-
|
|
801
|
+
K && /* @__PURE__ */ I("div", {
|
|
789
802
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
790
|
-
children: [/* @__PURE__ */
|
|
803
|
+
children: [/* @__PURE__ */ I("p", {
|
|
791
804
|
className: "font-medium",
|
|
792
|
-
children: ["Dismissed ",
|
|
793
|
-
}),
|
|
805
|
+
children: ["Dismissed ", w.terminatedAt && O(w.terminatedAt, "full")]
|
|
806
|
+
}), w.terminationReason && /* @__PURE__ */ I("p", {
|
|
794
807
|
className: "mt-1",
|
|
795
|
-
children: ["Reason: ",
|
|
808
|
+
children: ["Reason: ", w.terminationReason]
|
|
796
809
|
})]
|
|
797
810
|
}),
|
|
798
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ I("div", {
|
|
799
812
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
800
|
-
children: [/* @__PURE__ */
|
|
813
|
+
children: [/* @__PURE__ */ I("div", {
|
|
801
814
|
className: "lg:col-span-2 space-y-6",
|
|
802
815
|
children: [
|
|
803
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
804
817
|
className: "flex items-center gap-2",
|
|
805
|
-
children: [/* @__PURE__ */
|
|
806
|
-
}) }), /* @__PURE__ */
|
|
818
|
+
children: [/* @__PURE__ */ F(i, { size: 18 }), " License"]
|
|
819
|
+
}) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F("div", {
|
|
807
820
|
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
808
|
-
children: /* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
821
|
+
children: /* @__PURE__ */ I("div", { children: [
|
|
822
|
+
/* @__PURE__ */ F("p", {
|
|
810
823
|
className: "font-medium",
|
|
811
824
|
children: "Driver's License"
|
|
812
825
|
}),
|
|
813
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ I("p", {
|
|
814
827
|
className: "text-sm text-text-secondary",
|
|
815
|
-
children: [
|
|
828
|
+
children: [w.licenseNumber || "—", w.licenseType ? ` - ${w.licenseType}` : ""]
|
|
816
829
|
}),
|
|
817
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ F("p", {
|
|
818
831
|
className: "text-sm text-text-secondary break-all",
|
|
819
|
-
children:
|
|
832
|
+
children: w.licenseExpiry ? `Recorded expiry (UTC): ${w.licenseExpiry.toISOString()}` : "Expiry not recorded"
|
|
820
833
|
})
|
|
821
834
|
] })
|
|
822
835
|
}) })] }),
|
|
823
|
-
|
|
836
|
+
w.notes && /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
824
837
|
className: "flex items-center gap-2",
|
|
825
|
-
children: [/* @__PURE__ */
|
|
826
|
-
}) }), /* @__PURE__ */
|
|
838
|
+
children: [/* @__PURE__ */ F(ne, { size: 18 }), " HR Notes"]
|
|
839
|
+
}) }), /* @__PURE__ */ F(_, { children: /* @__PURE__ */ F("p", {
|
|
827
840
|
className: "text-sm whitespace-pre-wrap",
|
|
828
|
-
children:
|
|
841
|
+
children: w.notes
|
|
829
842
|
}) })] }),
|
|
830
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ F(ve, {
|
|
831
844
|
entityType: "driver",
|
|
832
|
-
entityId:
|
|
833
|
-
})
|
|
845
|
+
entityId: w.id
|
|
846
|
+
}),
|
|
847
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ I(v, {
|
|
848
|
+
className: "flex flex-row items-center justify-between gap-2",
|
|
849
|
+
children: [/* @__PURE__ */ I(y, {
|
|
850
|
+
className: "flex items-center gap-2",
|
|
851
|
+
children: [/* @__PURE__ */ F(u, {
|
|
852
|
+
size: 18,
|
|
853
|
+
"aria-hidden": "true"
|
|
854
|
+
}), " Shift Roster"]
|
|
855
|
+
}), /* @__PURE__ */ I(h, {
|
|
856
|
+
variant: "outline",
|
|
857
|
+
size: "sm",
|
|
858
|
+
onClick: () => M((e) => !e),
|
|
859
|
+
children: [
|
|
860
|
+
/* @__PURE__ */ F(d, {
|
|
861
|
+
size: 14,
|
|
862
|
+
"aria-hidden": "true"
|
|
863
|
+
}),
|
|
864
|
+
" ",
|
|
865
|
+
j ? "Close" : "Add shift"
|
|
866
|
+
]
|
|
867
|
+
})]
|
|
868
|
+
}), /* @__PURE__ */ I(_, {
|
|
869
|
+
className: "space-y-4",
|
|
870
|
+
children: [j && /* @__PURE__ */ I("form", {
|
|
871
|
+
className: "space-y-3 rounded-lg border border-border-seam p-3",
|
|
872
|
+
onSubmit: async (e) => {
|
|
873
|
+
e.preventDefault(), await he({
|
|
874
|
+
shiftDate: `${L.shiftDate}T12:00:00.000Z`,
|
|
875
|
+
startTime: L.startTime,
|
|
876
|
+
endTime: L.endTime,
|
|
877
|
+
status: L.status
|
|
878
|
+
}), M(!1);
|
|
879
|
+
},
|
|
880
|
+
children: [/* @__PURE__ */ I("div", {
|
|
881
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
882
|
+
children: [
|
|
883
|
+
/* @__PURE__ */ I("div", {
|
|
884
|
+
className: "space-y-1",
|
|
885
|
+
children: [/* @__PURE__ */ F(x, {
|
|
886
|
+
htmlFor: "shift-date",
|
|
887
|
+
children: "Date"
|
|
888
|
+
}), /* @__PURE__ */ F(b, {
|
|
889
|
+
id: "shift-date",
|
|
890
|
+
type: "date",
|
|
891
|
+
required: !0,
|
|
892
|
+
value: L.shiftDate,
|
|
893
|
+
onChange: (e) => z((t) => ({
|
|
894
|
+
...t,
|
|
895
|
+
shiftDate: e.target.value
|
|
896
|
+
}))
|
|
897
|
+
})]
|
|
898
|
+
}),
|
|
899
|
+
/* @__PURE__ */ I("div", {
|
|
900
|
+
className: "space-y-1",
|
|
901
|
+
children: [/* @__PURE__ */ F(x, {
|
|
902
|
+
htmlFor: "shift-start",
|
|
903
|
+
children: "Start"
|
|
904
|
+
}), /* @__PURE__ */ F(b, {
|
|
905
|
+
id: "shift-start",
|
|
906
|
+
type: "time",
|
|
907
|
+
required: !0,
|
|
908
|
+
value: L.startTime,
|
|
909
|
+
onChange: (e) => z((t) => ({
|
|
910
|
+
...t,
|
|
911
|
+
startTime: e.target.value
|
|
912
|
+
}))
|
|
913
|
+
})]
|
|
914
|
+
}),
|
|
915
|
+
/* @__PURE__ */ I("div", {
|
|
916
|
+
className: "space-y-1",
|
|
917
|
+
children: [/* @__PURE__ */ F(x, {
|
|
918
|
+
htmlFor: "shift-end",
|
|
919
|
+
children: "End"
|
|
920
|
+
}), /* @__PURE__ */ F(b, {
|
|
921
|
+
id: "shift-end",
|
|
922
|
+
type: "time",
|
|
923
|
+
required: !0,
|
|
924
|
+
value: L.endTime,
|
|
925
|
+
onChange: (e) => z((t) => ({
|
|
926
|
+
...t,
|
|
927
|
+
endTime: e.target.value
|
|
928
|
+
}))
|
|
929
|
+
})]
|
|
930
|
+
})
|
|
931
|
+
]
|
|
932
|
+
}), /* @__PURE__ */ F(h, {
|
|
933
|
+
type: "submit",
|
|
934
|
+
size: "sm",
|
|
935
|
+
children: "Save shift"
|
|
936
|
+
})]
|
|
937
|
+
}), w.shifts && w.shifts.length > 0 ? /* @__PURE__ */ F("ul", {
|
|
938
|
+
className: "divide-y divide-border-seam",
|
|
939
|
+
children: w.shifts.map((e) => /* @__PURE__ */ I("li", {
|
|
940
|
+
className: "flex items-center justify-between gap-3 py-2 text-sm",
|
|
941
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ I("p", {
|
|
942
|
+
className: "font-medium",
|
|
943
|
+
children: [
|
|
944
|
+
O(e.shiftDate, "short"),
|
|
945
|
+
" · ",
|
|
946
|
+
e.startTime,
|
|
947
|
+
" –",
|
|
948
|
+
" ",
|
|
949
|
+
e.endTime
|
|
950
|
+
]
|
|
951
|
+
}), /* @__PURE__ */ I("p", {
|
|
952
|
+
className: "text-xs text-text-secondary",
|
|
953
|
+
children: [e.status, e.notes ? ` · ${e.notes}` : ""]
|
|
954
|
+
})] }), /* @__PURE__ */ F(h, {
|
|
955
|
+
variant: "ghost",
|
|
956
|
+
size: "sm",
|
|
957
|
+
className: "text-status-error-text",
|
|
958
|
+
"aria-label": `Delete shift ${e.startTime}`,
|
|
959
|
+
onClick: () => void ge(e.id),
|
|
960
|
+
children: /* @__PURE__ */ F(l, {
|
|
961
|
+
size: 14,
|
|
962
|
+
"aria-hidden": "true"
|
|
963
|
+
})
|
|
964
|
+
})]
|
|
965
|
+
}, e.id))
|
|
966
|
+
}) : /* @__PURE__ */ F("p", {
|
|
967
|
+
className: "text-sm text-text-secondary",
|
|
968
|
+
children: "No shifts scheduled yet."
|
|
969
|
+
})]
|
|
970
|
+
})] }),
|
|
971
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ I(v, {
|
|
972
|
+
className: "flex flex-row items-center justify-between gap-2",
|
|
973
|
+
children: [/* @__PURE__ */ I(y, {
|
|
974
|
+
className: "flex items-center gap-2",
|
|
975
|
+
children: [/* @__PURE__ */ F(re, {
|
|
976
|
+
size: 18,
|
|
977
|
+
"aria-hidden": "true"
|
|
978
|
+
}), " Compliance Records"]
|
|
979
|
+
}), /* @__PURE__ */ I(h, {
|
|
980
|
+
variant: "outline",
|
|
981
|
+
size: "sm",
|
|
982
|
+
onClick: () => V((e) => !e),
|
|
983
|
+
children: [
|
|
984
|
+
/* @__PURE__ */ F(d, {
|
|
985
|
+
size: 14,
|
|
986
|
+
"aria-hidden": "true"
|
|
987
|
+
}),
|
|
988
|
+
" ",
|
|
989
|
+
B ? "Close" : "Add record"
|
|
990
|
+
]
|
|
991
|
+
})]
|
|
992
|
+
}), /* @__PURE__ */ I(_, {
|
|
993
|
+
className: "space-y-4",
|
|
994
|
+
children: [B && /* @__PURE__ */ I("form", {
|
|
995
|
+
className: "space-y-3 rounded-lg border border-border-seam p-3",
|
|
996
|
+
onSubmit: async (e) => {
|
|
997
|
+
e.preventDefault(), await _e({
|
|
998
|
+
recordType: H.recordType,
|
|
999
|
+
status: H.status,
|
|
1000
|
+
expiresAt: H.expiresAt ? `${H.expiresAt}T12:00:00.000Z` : void 0,
|
|
1001
|
+
referenceNumber: H.referenceNumber.trim() || void 0
|
|
1002
|
+
}), V(!1), U({
|
|
1003
|
+
recordType: "MEDICAL_CERT",
|
|
1004
|
+
status: "VALID",
|
|
1005
|
+
expiresAt: "",
|
|
1006
|
+
referenceNumber: ""
|
|
1007
|
+
});
|
|
1008
|
+
},
|
|
1009
|
+
children: [/* @__PURE__ */ I("div", {
|
|
1010
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
1011
|
+
children: [
|
|
1012
|
+
/* @__PURE__ */ I("div", {
|
|
1013
|
+
className: "space-y-1",
|
|
1014
|
+
children: [/* @__PURE__ */ F(x, {
|
|
1015
|
+
htmlFor: "comp-type",
|
|
1016
|
+
children: "Record Type"
|
|
1017
|
+
}), /* @__PURE__ */ I(ae, {
|
|
1018
|
+
value: H.recordType,
|
|
1019
|
+
onValueChange: (e) => U((t) => ({
|
|
1020
|
+
...t,
|
|
1021
|
+
recordType: e
|
|
1022
|
+
})),
|
|
1023
|
+
children: [/* @__PURE__ */ F(ce, {
|
|
1024
|
+
id: "comp-type",
|
|
1025
|
+
children: /* @__PURE__ */ F(le, {})
|
|
1026
|
+
}), /* @__PURE__ */ F(oe, { children: [
|
|
1027
|
+
"LICENSE",
|
|
1028
|
+
"MEDICAL_CERT",
|
|
1029
|
+
"BACKGROUND_CHECK",
|
|
1030
|
+
"HAZMAT",
|
|
1031
|
+
"TRAINING",
|
|
1032
|
+
"INSURANCE",
|
|
1033
|
+
"OTHER"
|
|
1034
|
+
].map((e) => /* @__PURE__ */ F(se, {
|
|
1035
|
+
value: e,
|
|
1036
|
+
children: e.replace("_", " ")
|
|
1037
|
+
}, e)) })]
|
|
1038
|
+
})]
|
|
1039
|
+
}),
|
|
1040
|
+
/* @__PURE__ */ I("div", {
|
|
1041
|
+
className: "space-y-1",
|
|
1042
|
+
children: [/* @__PURE__ */ F(x, {
|
|
1043
|
+
htmlFor: "comp-ref",
|
|
1044
|
+
children: "Reference #"
|
|
1045
|
+
}), /* @__PURE__ */ F(b, {
|
|
1046
|
+
id: "comp-ref",
|
|
1047
|
+
placeholder: "CERT-2026-01",
|
|
1048
|
+
value: H.referenceNumber,
|
|
1049
|
+
onChange: (e) => U((t) => ({
|
|
1050
|
+
...t,
|
|
1051
|
+
referenceNumber: e.target.value
|
|
1052
|
+
}))
|
|
1053
|
+
})]
|
|
1054
|
+
}),
|
|
1055
|
+
/* @__PURE__ */ I("div", {
|
|
1056
|
+
className: "space-y-1",
|
|
1057
|
+
children: [/* @__PURE__ */ F(x, {
|
|
1058
|
+
htmlFor: "comp-exp",
|
|
1059
|
+
children: "Expires"
|
|
1060
|
+
}), /* @__PURE__ */ F(b, {
|
|
1061
|
+
id: "comp-exp",
|
|
1062
|
+
type: "date",
|
|
1063
|
+
value: H.expiresAt,
|
|
1064
|
+
onChange: (e) => U((t) => ({
|
|
1065
|
+
...t,
|
|
1066
|
+
expiresAt: e.target.value
|
|
1067
|
+
}))
|
|
1068
|
+
})]
|
|
1069
|
+
})
|
|
1070
|
+
]
|
|
1071
|
+
}), /* @__PURE__ */ F(h, {
|
|
1072
|
+
type: "submit",
|
|
1073
|
+
size: "sm",
|
|
1074
|
+
children: "Save compliance record"
|
|
1075
|
+
})]
|
|
1076
|
+
}), w.complianceRecords && w.complianceRecords.length > 0 ? /* @__PURE__ */ F("ul", {
|
|
1077
|
+
className: "divide-y divide-border-seam",
|
|
1078
|
+
children: w.complianceRecords.map((e) => /* @__PURE__ */ I("li", {
|
|
1079
|
+
className: "flex items-center justify-between gap-3 py-2 text-sm",
|
|
1080
|
+
children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ I("p", {
|
|
1081
|
+
className: "font-medium",
|
|
1082
|
+
children: [
|
|
1083
|
+
e.recordType.replace("_", " "),
|
|
1084
|
+
" (",
|
|
1085
|
+
e.status.replace("_", " "),
|
|
1086
|
+
")"
|
|
1087
|
+
]
|
|
1088
|
+
}), /* @__PURE__ */ I("p", {
|
|
1089
|
+
className: "text-xs text-text-secondary",
|
|
1090
|
+
children: [e.referenceNumber ? `Ref: ${e.referenceNumber}` : "No reference #", e.expiresAt ? ` · Expires ${O(e.expiresAt, "short")}` : ""]
|
|
1091
|
+
})] }), /* @__PURE__ */ F(h, {
|
|
1092
|
+
variant: "ghost",
|
|
1093
|
+
size: "sm",
|
|
1094
|
+
className: "text-status-error-text",
|
|
1095
|
+
"aria-label": `Delete compliance record ${e.recordType}`,
|
|
1096
|
+
onClick: () => void A(e.id),
|
|
1097
|
+
children: /* @__PURE__ */ F(l, {
|
|
1098
|
+
size: 14,
|
|
1099
|
+
"aria-hidden": "true"
|
|
1100
|
+
})
|
|
1101
|
+
})]
|
|
1102
|
+
}, e.id))
|
|
1103
|
+
}) : /* @__PURE__ */ F("p", {
|
|
1104
|
+
className: "text-sm text-text-secondary",
|
|
1105
|
+
children: "No compliance records stored yet."
|
|
1106
|
+
})]
|
|
1107
|
+
})] })
|
|
834
1108
|
]
|
|
835
|
-
}), /* @__PURE__ */
|
|
1109
|
+
}), /* @__PURE__ */ I("div", {
|
|
836
1110
|
className: "space-y-6",
|
|
837
1111
|
children: [
|
|
838
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
839
1113
|
className: "flex items-center gap-2",
|
|
840
|
-
children: [/* @__PURE__ */
|
|
841
|
-
}) }), /* @__PURE__ */
|
|
1114
|
+
children: [/* @__PURE__ */ F(te, { size: 18 }), " Assigned Vehicle"]
|
|
1115
|
+
}) }), /* @__PURE__ */ F(_, { children: w.assignedVehicle ? W ? /* @__PURE__ */ I("button", {
|
|
842
1116
|
type: "button",
|
|
843
1117
|
className: "text-sm font-medium text-primary hover:underline",
|
|
844
|
-
onClick: () =>
|
|
1118
|
+
onClick: () => G(`fleet/vehicles/${W.id}`),
|
|
845
1119
|
children: [
|
|
846
|
-
|
|
1120
|
+
W.vehicleNumber,
|
|
847
1121
|
" (",
|
|
848
|
-
|
|
1122
|
+
W.type,
|
|
849
1123
|
")"
|
|
850
1124
|
]
|
|
851
|
-
}) : /* @__PURE__ */
|
|
1125
|
+
}) : /* @__PURE__ */ F("p", {
|
|
852
1126
|
className: "text-sm text-text-secondary",
|
|
853
1127
|
children: "Loading…"
|
|
854
|
-
}) : /* @__PURE__ */
|
|
1128
|
+
}) : /* @__PURE__ */ F("p", {
|
|
855
1129
|
className: "text-sm text-text-secondary",
|
|
856
1130
|
children: "No vehicle assigned"
|
|
857
1131
|
}) })] }),
|
|
858
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ F(y, { children: "Record" }) }), /* @__PURE__ */ F(_, {
|
|
859
1133
|
className: "space-y-4",
|
|
860
|
-
children: /* @__PURE__ */
|
|
1134
|
+
children: /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
861
1135
|
className: "text-sm text-text-secondary",
|
|
862
1136
|
children: "Hire Date"
|
|
863
|
-
}), /* @__PURE__ */
|
|
1137
|
+
}), /* @__PURE__ */ F("p", {
|
|
864
1138
|
className: "font-medium",
|
|
865
|
-
children:
|
|
1139
|
+
children: w.hireDate ? O(w.hireDate) : "Not recorded"
|
|
866
1140
|
})] })
|
|
867
1141
|
})] }),
|
|
868
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
869
1143
|
className: "flex items-center gap-2",
|
|
870
|
-
children: [/* @__PURE__ */
|
|
871
|
-
}) }), /* @__PURE__ */
|
|
1144
|
+
children: [/* @__PURE__ */ F(ee, { size: 18 }), " Compensation"]
|
|
1145
|
+
}) }), /* @__PURE__ */ F(_, {
|
|
872
1146
|
className: "space-y-3",
|
|
873
|
-
children:
|
|
1147
|
+
children: Y ? /* @__PURE__ */ I(be, { children: [w.baseSalary !== void 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
874
1148
|
className: "text-sm text-text-secondary",
|
|
875
1149
|
children: "Base Salary"
|
|
876
|
-
}), /* @__PURE__ */
|
|
1150
|
+
}), /* @__PURE__ */ I("p", {
|
|
877
1151
|
className: "font-medium",
|
|
878
|
-
children: [
|
|
879
|
-
})] }),
|
|
1152
|
+
children: [D(w.baseSalary, w.payCurrency || void 0), "/year"]
|
|
1153
|
+
})] }), w.bonusYtd !== void 0 && /* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F("p", {
|
|
880
1154
|
className: "text-sm text-text-secondary",
|
|
881
1155
|
children: "Bonus (YTD)"
|
|
882
|
-
}), /* @__PURE__ */
|
|
1156
|
+
}), /* @__PURE__ */ F("p", {
|
|
883
1157
|
className: "font-medium",
|
|
884
|
-
children:
|
|
885
|
-
})] })] }) : /* @__PURE__ */
|
|
1158
|
+
children: D(w.bonusYtd, w.payCurrency || void 0)
|
|
1159
|
+
})] })] }) : /* @__PURE__ */ F("p", {
|
|
886
1160
|
className: "text-sm text-text-secondary",
|
|
887
1161
|
children: "Not recorded"
|
|
888
1162
|
})
|
|
889
1163
|
})] }),
|
|
890
|
-
|
|
1164
|
+
w.currentLocation && /* @__PURE__ */ I(g, { children: [/* @__PURE__ */ F(v, { children: /* @__PURE__ */ I(y, {
|
|
891
1165
|
className: "flex items-center gap-2",
|
|
892
|
-
children: [/* @__PURE__ */
|
|
893
|
-
}) }), /* @__PURE__ */
|
|
1166
|
+
children: [/* @__PURE__ */ F(o, { size: 18 }), " Current Location"]
|
|
1167
|
+
}) }), /* @__PURE__ */ I(_, { children: [/* @__PURE__ */ F("p", {
|
|
894
1168
|
className: "text-sm",
|
|
895
|
-
children:
|
|
896
|
-
}), /* @__PURE__ */
|
|
1169
|
+
children: w.currentLocation.address || "Location updating..."
|
|
1170
|
+
}), /* @__PURE__ */ F("p", {
|
|
897
1171
|
className: "text-xs text-text-secondary mt-1",
|
|
898
|
-
children:
|
|
1172
|
+
children: w.currentLocation.timestamp ? `Updated ${O(w.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
899
1173
|
})] })] })
|
|
900
1174
|
]
|
|
901
1175
|
})]
|
|
@@ -903,4 +1177,4 @@ function q() {
|
|
|
903
1177
|
]
|
|
904
1178
|
});
|
|
905
1179
|
}
|
|
906
|
-
export {
|
|
1180
|
+
export { Y as default };
|