@burdenoff/microfe-movethewheels 2026.1114.1 → 2026.1123.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/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 +3 -2
- 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
|
@@ -2,23 +2,26 @@ import e from "../node_modules/lucide-react/dist/esm/icons/warehouse.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/square-pen.js";
|
|
4
4
|
import r from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
5
|
+
import ee from "../node_modules/lucide-react/dist/esm/icons/clock.js";
|
|
6
|
+
import i from "../node_modules/lucide-react/dist/esm/icons/box.js";
|
|
7
|
+
import a from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
8
|
+
import o from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
9
|
+
import s from "../node_modules/lucide-react/dist/esm/icons/layers.js";
|
|
10
|
+
import te from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
11
|
+
import c from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
12
|
+
import { ErrorState as ne, LoadingState as l, PageLayout as u } from "../components/PageLayout.js";
|
|
10
13
|
import { Badge as d, Button as f, Card as p, CardContent as m, CardHeader as h, CardTitle as g, Input as _, Label as v, Progress as y, Select as b, SelectContent as x, SelectItem as S, SelectTrigger as C, SelectValue as w } from "../components/ui.js";
|
|
11
|
-
import { useInventory as T, useWarehouse as
|
|
12
|
-
import { useMoveTheWheels as
|
|
13
|
-
import { formatAddress as
|
|
14
|
-
import { joinPath as
|
|
15
|
-
import { FormError as
|
|
16
|
-
import { useEffect as
|
|
17
|
-
import { useLocation as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import { EmphasisPanel as
|
|
14
|
+
import { useInventory as T, useWarehouse as re } from "../hooks/useInventory.js";
|
|
15
|
+
import { useMoveTheWheels as E } from "../providers/MoveTheWheelsProvider.js";
|
|
16
|
+
import { formatAddress as D } from "../utils/formatters.js";
|
|
17
|
+
import { joinPath as O } from "../utils/navigation.js";
|
|
18
|
+
import { FormError as k } from "../components/FormError.js";
|
|
19
|
+
import { useEffect as A, useState as j } from "react";
|
|
20
|
+
import { useLocation as M, useParams as N } from "react-router";
|
|
21
|
+
import { Fragment as ie, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
22
|
+
import { EmphasisPanel as I, NextSteps as L, PagePurpose as R, ResponsiveDialog as z, ResponsiveDialogContent as B, ResponsiveDialogDescription as V, ResponsiveDialogFooter as H, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W } from "@burdenoff/fe-libs/ui";
|
|
20
23
|
// src/movethewheels/pages/WarehouseDetailsPage.tsx
|
|
21
|
-
var
|
|
24
|
+
var ae = [
|
|
22
25
|
{
|
|
23
26
|
value: "DISTRIBUTION",
|
|
24
27
|
label: "Distribution"
|
|
@@ -39,15 +42,15 @@ var re = [
|
|
|
39
42
|
value: "RETAIL",
|
|
40
43
|
label: "Retail"
|
|
41
44
|
}
|
|
42
|
-
],
|
|
45
|
+
], oe = [{
|
|
43
46
|
value: "ACTIVE",
|
|
44
47
|
label: "Active"
|
|
45
48
|
}, {
|
|
46
49
|
value: "INACTIVE",
|
|
47
50
|
label: "Inactive"
|
|
48
51
|
}];
|
|
49
|
-
function
|
|
50
|
-
let { basePath:
|
|
52
|
+
function G({ editId: n, onSaved: ee }) {
|
|
53
|
+
let { basePath: i, navigate: s } = E(), { createWarehouse: te, updateWarehouse: c, deleteWarehouse: ne } = T(), { warehouse: l } = re(n), d = !!n, [y, D] = j({
|
|
51
54
|
code: "",
|
|
52
55
|
name: "",
|
|
53
56
|
type: "DISTRIBUTION",
|
|
@@ -61,149 +64,149 @@ function W({ editId: n, onSaved: i }) {
|
|
|
61
64
|
usedCapacity: "",
|
|
62
65
|
contactEmail: "",
|
|
63
66
|
contactPhone: ""
|
|
64
|
-
}), [
|
|
65
|
-
|
|
66
|
-
n &&
|
|
67
|
-
code:
|
|
68
|
-
name:
|
|
69
|
-
type:
|
|
70
|
-
status:
|
|
71
|
-
street:
|
|
72
|
-
city:
|
|
73
|
-
state:
|
|
74
|
-
postalCode:
|
|
75
|
-
country:
|
|
76
|
-
totalCapacity:
|
|
77
|
-
usedCapacity:
|
|
78
|
-
contactEmail:
|
|
79
|
-
contactPhone:
|
|
67
|
+
}), [M, N] = j(!1), [ie, L] = j(null), [G, K] = j(!1), [q, J] = j(!1), [Y, X] = j(null);
|
|
68
|
+
A(() => {
|
|
69
|
+
n && l && D({
|
|
70
|
+
code: l.code || "",
|
|
71
|
+
name: l.name || "",
|
|
72
|
+
type: l.type ? l.type.toUpperCase() : "DISTRIBUTION",
|
|
73
|
+
status: l.status ?? "",
|
|
74
|
+
street: l.address.street ?? "",
|
|
75
|
+
city: l.address.city ?? "",
|
|
76
|
+
state: l.address.state ?? "",
|
|
77
|
+
postalCode: l.address.postalCode ?? "",
|
|
78
|
+
country: l.address.country ?? "",
|
|
79
|
+
totalCapacity: l.capacity.totalSpace === void 0 ? "" : String(l.capacity.totalSpace),
|
|
80
|
+
usedCapacity: l.capacity.usedSpace === void 0 ? "" : String(l.capacity.usedSpace),
|
|
81
|
+
contactEmail: l.contactInfo?.email || "",
|
|
82
|
+
contactPhone: l.contactInfo?.phone || ""
|
|
80
83
|
});
|
|
81
|
-
}, [n,
|
|
82
|
-
let Z = () =>
|
|
84
|
+
}, [n, l]);
|
|
85
|
+
let Z = () => s?.(O(i, "inventory/warehouses")), Q = (e, t) => D((n) => ({
|
|
83
86
|
...n,
|
|
84
87
|
[e]: t
|
|
85
88
|
})), $ = async (e) => {
|
|
86
|
-
if (e.preventDefault(), !
|
|
87
|
-
else if (!
|
|
89
|
+
if (e.preventDefault(), !y.code.trim() || !y.name.trim()) L("Warehouse code and name are required.");
|
|
90
|
+
else if (!y.street.trim() || !y.city.trim()) L("A street and city are required for the warehouse address.");
|
|
88
91
|
else {
|
|
89
|
-
|
|
92
|
+
N(!0), L(null);
|
|
90
93
|
try {
|
|
91
|
-
let e =
|
|
92
|
-
street:
|
|
93
|
-
city:
|
|
94
|
-
state:
|
|
95
|
-
postalCode:
|
|
96
|
-
country:
|
|
97
|
-
}).filter(([, e]) => e.length > 0)),
|
|
98
|
-
code:
|
|
99
|
-
name:
|
|
100
|
-
type:
|
|
101
|
-
status:
|
|
94
|
+
let e = y.totalCapacity.trim() ? Number(y.totalCapacity) : void 0, t = y.usedCapacity.trim() ? Number(y.usedCapacity) : void 0, r = Object.fromEntries(Object.entries({
|
|
95
|
+
street: y.street.trim(),
|
|
96
|
+
city: y.city.trim(),
|
|
97
|
+
state: y.state.trim(),
|
|
98
|
+
postalCode: y.postalCode.trim(),
|
|
99
|
+
country: y.country.trim()
|
|
100
|
+
}).filter(([, e]) => e.length > 0)), a = {
|
|
101
|
+
code: y.code.trim(),
|
|
102
|
+
name: y.name.trim(),
|
|
103
|
+
type: y.type,
|
|
104
|
+
status: y.status.trim() || void 0,
|
|
102
105
|
address: r,
|
|
103
|
-
contactInfo:
|
|
104
|
-
email:
|
|
105
|
-
phone:
|
|
106
|
+
contactInfo: y.contactEmail.trim() || y.contactPhone.trim() ? {
|
|
107
|
+
email: y.contactEmail.trim() || void 0,
|
|
108
|
+
phone: y.contactPhone.trim() || void 0
|
|
106
109
|
} : void 0,
|
|
107
110
|
totalCapacity: e !== void 0 && !Number.isNaN(e) ? e : void 0,
|
|
108
111
|
usedCapacity: t !== void 0 && !Number.isNaN(t) ? t : void 0
|
|
109
112
|
};
|
|
110
|
-
if (n) await
|
|
113
|
+
if (n) await c(n, a), await ee?.(), s?.(O(i, `inventory/warehouses/${n}`));
|
|
111
114
|
else {
|
|
112
|
-
let e = await
|
|
113
|
-
|
|
115
|
+
let e = await te(a);
|
|
116
|
+
s?.(O(i, `inventory/warehouses/${e.id}`));
|
|
114
117
|
}
|
|
115
118
|
} catch (e) {
|
|
116
|
-
console.error("Failed to create warehouse:", e),
|
|
119
|
+
console.error("Failed to create warehouse:", e), L(e instanceof Error ? e.message : "Failed to create warehouse. Please try again."), N(!1);
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
122
|
};
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
title:
|
|
123
|
+
return /* @__PURE__ */ F(u, {
|
|
124
|
+
title: d ? "Edit Warehouse" : "Add Warehouse",
|
|
122
125
|
subtitle: "Register a storage and fulfilment site",
|
|
123
|
-
icon: /* @__PURE__ */
|
|
124
|
-
headerActions: /* @__PURE__ */
|
|
126
|
+
icon: /* @__PURE__ */ P(e, { size: 24 }),
|
|
127
|
+
headerActions: /* @__PURE__ */ F("div", {
|
|
125
128
|
className: "flex gap-2",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ F(f, {
|
|
127
130
|
variant: "outline",
|
|
128
131
|
onClick: Z,
|
|
129
|
-
disabled:
|
|
130
|
-
children: [/* @__PURE__ */
|
|
131
|
-
}), /* @__PURE__ */
|
|
132
|
+
disabled: M,
|
|
133
|
+
children: [/* @__PURE__ */ P(t, { size: 16 }), " Cancel"]
|
|
134
|
+
}), /* @__PURE__ */ F(f, {
|
|
132
135
|
onClick: $,
|
|
133
|
-
disabled:
|
|
136
|
+
disabled: M,
|
|
134
137
|
children: [
|
|
135
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ P(a, { size: 16 }),
|
|
136
139
|
" ",
|
|
137
|
-
|
|
140
|
+
d ? M ? "Saving..." : "Save Changes" : M ? "Saving..." : "Add Warehouse"
|
|
138
141
|
]
|
|
139
142
|
})]
|
|
140
143
|
}),
|
|
141
144
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
icon: /* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ P(R, {
|
|
146
|
+
icon: /* @__PURE__ */ P(e, { size: 18 }),
|
|
144
147
|
children: "Add a warehouse so you can store inventory and fulfil orders from it. A code, name, type and location get it on the network — set a total capacity to track utilization."
|
|
145
148
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ F("form", {
|
|
147
150
|
onSubmit: $,
|
|
148
151
|
className: "max-w-2xl space-y-6",
|
|
149
152
|
children: [
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ P(k, { message: ie }),
|
|
154
|
+
/* @__PURE__ */ F(I, { children: [/* @__PURE__ */ P("h2", {
|
|
152
155
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
153
156
|
children: "Warehouse Details"
|
|
154
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ F("div", {
|
|
155
158
|
className: "space-y-4",
|
|
156
159
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ F("div", {
|
|
158
161
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
159
162
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ F("div", {
|
|
161
164
|
className: "space-y-2",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ F(v, {
|
|
163
166
|
htmlFor: "code",
|
|
164
|
-
children: ["Code ", /* @__PURE__ */
|
|
167
|
+
children: ["Code ", /* @__PURE__ */ P("span", {
|
|
165
168
|
className: "text-status-error-text",
|
|
166
169
|
children: "*"
|
|
167
170
|
})]
|
|
168
|
-
}), /* @__PURE__ */
|
|
171
|
+
}), /* @__PURE__ */ P(_, {
|
|
169
172
|
id: "code",
|
|
170
|
-
value:
|
|
173
|
+
value: y.code,
|
|
171
174
|
onChange: (e) => Q("code", e.target.value),
|
|
172
175
|
placeholder: "WH-SF-01",
|
|
173
176
|
required: !0
|
|
174
177
|
})]
|
|
175
178
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ F("div", {
|
|
177
180
|
className: "space-y-2",
|
|
178
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ F(v, {
|
|
179
182
|
htmlFor: "name",
|
|
180
|
-
children: ["Name ", /* @__PURE__ */
|
|
183
|
+
children: ["Name ", /* @__PURE__ */ P("span", {
|
|
181
184
|
className: "text-status-error-text",
|
|
182
185
|
children: "*"
|
|
183
186
|
})]
|
|
184
|
-
}), /* @__PURE__ */
|
|
187
|
+
}), /* @__PURE__ */ P(_, {
|
|
185
188
|
id: "name",
|
|
186
|
-
value:
|
|
189
|
+
value: y.name,
|
|
187
190
|
onChange: (e) => Q("name", e.target.value),
|
|
188
191
|
placeholder: "San Francisco DC",
|
|
189
192
|
required: !0
|
|
190
193
|
})]
|
|
191
194
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ F("div", {
|
|
193
196
|
className: "space-y-2",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ F(v, {
|
|
195
198
|
htmlFor: "type",
|
|
196
|
-
children: ["Type ", /* @__PURE__ */
|
|
199
|
+
children: ["Type ", /* @__PURE__ */ P("span", {
|
|
197
200
|
className: "text-status-error-text",
|
|
198
201
|
children: "*"
|
|
199
202
|
})]
|
|
200
|
-
}), /* @__PURE__ */
|
|
201
|
-
value:
|
|
203
|
+
}), /* @__PURE__ */ F(b, {
|
|
204
|
+
value: y.type,
|
|
202
205
|
onValueChange: (e) => Q("type", e),
|
|
203
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ P(C, {
|
|
204
207
|
id: "type",
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
}), /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ P(w, {})
|
|
209
|
+
}), /* @__PURE__ */ P(x, { children: ae.map((e) => /* @__PURE__ */ P(S, {
|
|
207
210
|
value: e.value,
|
|
208
211
|
children: e.label
|
|
209
212
|
}, e.value)) })]
|
|
@@ -211,78 +214,78 @@ function W({ editId: n, onSaved: i }) {
|
|
|
211
214
|
})
|
|
212
215
|
]
|
|
213
216
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ F("div", {
|
|
215
218
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
216
219
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ F("div", {
|
|
218
221
|
className: "space-y-2",
|
|
219
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ P(v, {
|
|
220
223
|
htmlFor: "status",
|
|
221
224
|
children: "Status"
|
|
222
|
-
}), /* @__PURE__ */
|
|
223
|
-
value:
|
|
225
|
+
}), /* @__PURE__ */ F(b, {
|
|
226
|
+
value: y.status,
|
|
224
227
|
onValueChange: (e) => Q("status", e),
|
|
225
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ P(C, {
|
|
226
229
|
id: "status",
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
-
}), /* @__PURE__ */
|
|
230
|
+
children: /* @__PURE__ */ P(w, {})
|
|
231
|
+
}), /* @__PURE__ */ P(x, { children: oe.map((e) => /* @__PURE__ */ P(S, {
|
|
229
232
|
value: e.value,
|
|
230
233
|
children: e.label
|
|
231
234
|
}, e.value)) })]
|
|
232
235
|
})]
|
|
233
236
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ F("div", {
|
|
235
238
|
className: "space-y-2",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ P(v, {
|
|
237
240
|
htmlFor: "totalCapacity",
|
|
238
241
|
children: "Total Capacity (sq ft)"
|
|
239
|
-
}), /* @__PURE__ */
|
|
242
|
+
}), /* @__PURE__ */ P(_, {
|
|
240
243
|
id: "totalCapacity",
|
|
241
244
|
type: "number",
|
|
242
245
|
min: "0",
|
|
243
|
-
value:
|
|
246
|
+
value: y.totalCapacity,
|
|
244
247
|
onChange: (e) => Q("totalCapacity", e.target.value),
|
|
245
248
|
placeholder: "50000"
|
|
246
249
|
})]
|
|
247
250
|
}),
|
|
248
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ F("div", {
|
|
249
252
|
className: "space-y-2",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ P(v, {
|
|
251
254
|
htmlFor: "usedCapacity",
|
|
252
255
|
children: "Used Capacity (sq ft)"
|
|
253
|
-
}), /* @__PURE__ */
|
|
256
|
+
}), /* @__PURE__ */ P(_, {
|
|
254
257
|
id: "usedCapacity",
|
|
255
258
|
type: "number",
|
|
256
259
|
min: "0",
|
|
257
|
-
value:
|
|
260
|
+
value: y.usedCapacity,
|
|
258
261
|
onChange: (e) => Q("usedCapacity", e.target.value),
|
|
259
262
|
placeholder: "0"
|
|
260
263
|
})]
|
|
261
264
|
})
|
|
262
265
|
]
|
|
263
266
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ F("div", {
|
|
265
268
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
266
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ F("div", {
|
|
267
270
|
className: "space-y-2",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ P(v, {
|
|
269
272
|
htmlFor: "contactEmail",
|
|
270
273
|
children: "Contact Email"
|
|
271
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ P(_, {
|
|
272
275
|
id: "contactEmail",
|
|
273
276
|
type: "email",
|
|
274
|
-
value:
|
|
277
|
+
value: y.contactEmail,
|
|
275
278
|
onChange: (e) => Q("contactEmail", e.target.value),
|
|
276
279
|
placeholder: "dc-sf@example.com"
|
|
277
280
|
})]
|
|
278
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ F("div", {
|
|
279
282
|
className: "space-y-2",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ P(v, {
|
|
281
284
|
htmlFor: "contactPhone",
|
|
282
285
|
children: "Contact Phone"
|
|
283
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ P(_, {
|
|
284
287
|
id: "contactPhone",
|
|
285
|
-
value:
|
|
288
|
+
value: y.contactPhone,
|
|
286
289
|
onChange: (e) => Q("contactPhone", e.target.value),
|
|
287
290
|
placeholder: "+1-555-0100"
|
|
288
291
|
})]
|
|
@@ -290,78 +293,78 @@ function W({ editId: n, onSaved: i }) {
|
|
|
290
293
|
})
|
|
291
294
|
]
|
|
292
295
|
})] }),
|
|
293
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
|
|
294
297
|
className: "flex items-center gap-2",
|
|
295
298
|
children: [
|
|
296
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ P(r, { size: 18 }),
|
|
297
300
|
" Address ",
|
|
298
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ P("span", {
|
|
299
302
|
className: "text-status-error-text",
|
|
300
303
|
children: "*"
|
|
301
304
|
})
|
|
302
305
|
]
|
|
303
|
-
}) }), /* @__PURE__ */
|
|
306
|
+
}) }), /* @__PURE__ */ F(m, {
|
|
304
307
|
className: "space-y-4",
|
|
305
308
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ F("div", {
|
|
307
310
|
className: "space-y-2",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
311
|
+
children: [/* @__PURE__ */ P(v, {
|
|
309
312
|
htmlFor: "street",
|
|
310
313
|
children: "Street"
|
|
311
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ P(_, {
|
|
312
315
|
id: "street",
|
|
313
|
-
value:
|
|
316
|
+
value: y.street,
|
|
314
317
|
onChange: (e) => Q("street", e.target.value),
|
|
315
318
|
placeholder: "500 Industrial Way"
|
|
316
319
|
})]
|
|
317
320
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ F("div", {
|
|
319
322
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ F("div", {
|
|
321
324
|
className: "space-y-2",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ P(v, {
|
|
323
326
|
htmlFor: "city",
|
|
324
327
|
children: "City"
|
|
325
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ P(_, {
|
|
326
329
|
id: "city",
|
|
327
|
-
value:
|
|
330
|
+
value: y.city,
|
|
328
331
|
onChange: (e) => Q("city", e.target.value),
|
|
329
332
|
placeholder: "San Francisco"
|
|
330
333
|
})]
|
|
331
|
-
}), /* @__PURE__ */
|
|
334
|
+
}), /* @__PURE__ */ F("div", {
|
|
332
335
|
className: "space-y-2",
|
|
333
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ P(v, {
|
|
334
337
|
htmlFor: "state",
|
|
335
338
|
children: "State"
|
|
336
|
-
}), /* @__PURE__ */
|
|
339
|
+
}), /* @__PURE__ */ P(_, {
|
|
337
340
|
id: "state",
|
|
338
|
-
value:
|
|
341
|
+
value: y.state,
|
|
339
342
|
onChange: (e) => Q("state", e.target.value),
|
|
340
343
|
placeholder: "CA"
|
|
341
344
|
})]
|
|
342
345
|
})]
|
|
343
346
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ F("div", {
|
|
345
348
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
346
|
-
children: [/* @__PURE__ */
|
|
349
|
+
children: [/* @__PURE__ */ F("div", {
|
|
347
350
|
className: "space-y-2",
|
|
348
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ P(v, {
|
|
349
352
|
htmlFor: "postalCode",
|
|
350
353
|
children: "ZIP / Postal Code"
|
|
351
|
-
}), /* @__PURE__ */
|
|
354
|
+
}), /* @__PURE__ */ P(_, {
|
|
352
355
|
id: "postalCode",
|
|
353
|
-
value:
|
|
356
|
+
value: y.postalCode,
|
|
354
357
|
onChange: (e) => Q("postalCode", e.target.value),
|
|
355
358
|
placeholder: "94103"
|
|
356
359
|
})]
|
|
357
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ F("div", {
|
|
358
361
|
className: "space-y-2",
|
|
359
|
-
children: [/* @__PURE__ */
|
|
362
|
+
children: [/* @__PURE__ */ P(v, {
|
|
360
363
|
htmlFor: "country",
|
|
361
364
|
children: "Country"
|
|
362
|
-
}), /* @__PURE__ */
|
|
365
|
+
}), /* @__PURE__ */ P(_, {
|
|
363
366
|
id: "country",
|
|
364
|
-
value:
|
|
367
|
+
value: y.country,
|
|
365
368
|
onChange: (e) => Q("country", e.target.value),
|
|
366
369
|
placeholder: "USA"
|
|
367
370
|
})]
|
|
@@ -369,186 +372,469 @@ function W({ editId: n, onSaved: i }) {
|
|
|
369
372
|
})
|
|
370
373
|
]
|
|
371
374
|
})] }),
|
|
372
|
-
|
|
375
|
+
d && /* @__PURE__ */ F(p, {
|
|
373
376
|
className: "border-status-error-border",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
|
|
375
378
|
className: "flex items-center gap-2 text-status-error-text",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
377
|
-
}) }), /* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ P(o, { size: 18 }), " Delete Warehouse"]
|
|
380
|
+
}) }), /* @__PURE__ */ F(m, { children: [/* @__PURE__ */ P("p", {
|
|
378
381
|
className: "mb-3 text-sm text-text-secondary",
|
|
379
382
|
children: "Removes this warehouse from your network. This cannot be undone from here."
|
|
380
|
-
}), /* @__PURE__ */
|
|
383
|
+
}), /* @__PURE__ */ F(f, {
|
|
381
384
|
type: "button",
|
|
382
385
|
variant: "outline",
|
|
383
386
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
384
|
-
onClick: () =>
|
|
385
|
-
children: [/* @__PURE__ */
|
|
387
|
+
onClick: () => K(!0),
|
|
388
|
+
children: [/* @__PURE__ */ P(o, { size: 16 }), " Delete this warehouse"]
|
|
386
389
|
})] })]
|
|
387
390
|
})
|
|
388
391
|
]
|
|
389
392
|
}),
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
open:
|
|
392
|
-
onOpenChange:
|
|
393
|
-
children: /* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ P(z, {
|
|
394
|
+
open: G,
|
|
395
|
+
onOpenChange: K,
|
|
396
|
+
children: /* @__PURE__ */ F(B, { children: [
|
|
397
|
+
/* @__PURE__ */ F(U, { children: [/* @__PURE__ */ P(W, { children: "Delete this warehouse?" }), /* @__PURE__ */ F(V, { children: [
|
|
395
398
|
"This removes ",
|
|
396
|
-
|
|
399
|
+
y.name || "this warehouse",
|
|
397
400
|
" and cannot be undone from here."
|
|
398
401
|
] })] }),
|
|
399
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ P("div", {
|
|
400
403
|
className: "px-1",
|
|
401
|
-
children: /* @__PURE__ */
|
|
404
|
+
children: /* @__PURE__ */ P(k, { message: Y })
|
|
402
405
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ F(H, { children: [/* @__PURE__ */ P(f, {
|
|
404
407
|
variant: "outline",
|
|
405
|
-
onClick: () =>
|
|
406
|
-
disabled:
|
|
408
|
+
onClick: () => K(!1),
|
|
409
|
+
disabled: q,
|
|
407
410
|
children: "Cancel"
|
|
408
|
-
}), /* @__PURE__ */
|
|
411
|
+
}), /* @__PURE__ */ P(f, {
|
|
409
412
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
410
413
|
onClick: async () => {
|
|
411
414
|
if (n) {
|
|
412
|
-
|
|
415
|
+
J(!0), X(null);
|
|
413
416
|
try {
|
|
414
|
-
await
|
|
417
|
+
await ne(n), K(!1), Z();
|
|
415
418
|
} catch (e) {
|
|
416
|
-
X(e instanceof Error ? e.message : "Failed to delete warehouse."),
|
|
419
|
+
X(e instanceof Error ? e.message : "Failed to delete warehouse."), J(!1);
|
|
417
420
|
}
|
|
418
421
|
}
|
|
419
422
|
},
|
|
420
|
-
disabled:
|
|
421
|
-
children:
|
|
423
|
+
disabled: q,
|
|
424
|
+
children: q ? "Deleting..." : "Delete warehouse"
|
|
422
425
|
})] })
|
|
423
426
|
] })
|
|
424
427
|
})
|
|
425
428
|
]
|
|
426
429
|
});
|
|
427
430
|
}
|
|
428
|
-
function
|
|
429
|
-
let { warehouseId:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
431
|
+
function K() {
|
|
432
|
+
let { warehouseId: a } = N(), { basePath: v, navigate: T } = E(), k = M().pathname.endsWith("/edit"), { warehouse: A, isLoading: z, error: B, refetch: V, reload: H, addZone: U, removeZone: W, addStaff: ae, removeStaff: oe } = re(a), [K, q] = j(!1), [J, Y] = j({
|
|
433
|
+
code: "",
|
|
434
|
+
name: "",
|
|
435
|
+
zoneType: "STORAGE"
|
|
436
|
+
}), [X, Z] = j(!1), [Q, $] = j({
|
|
437
|
+
name: "",
|
|
438
|
+
role: "PICKER",
|
|
439
|
+
shift: "DAY"
|
|
440
|
+
}), se = () => T?.(O(v, "inventory/warehouses")), ce = (e) => T?.(O(v, e));
|
|
441
|
+
if (!a) return /* @__PURE__ */ P(G, {});
|
|
442
|
+
if (k) return /* @__PURE__ */ P(G, {
|
|
443
|
+
editId: a,
|
|
444
|
+
onSaved: H
|
|
434
445
|
});
|
|
435
|
-
if (
|
|
436
|
-
if (
|
|
446
|
+
if (z) return /* @__PURE__ */ P(l, { message: "Loading warehouse details..." });
|
|
447
|
+
if (B || !A) return /* @__PURE__ */ P(ne, {
|
|
437
448
|
title: "Warehouse not found",
|
|
438
|
-
onRetry:
|
|
449
|
+
onRetry: V
|
|
439
450
|
});
|
|
440
|
-
let
|
|
441
|
-
return /* @__PURE__ */
|
|
442
|
-
title:
|
|
443
|
-
subtitle: `Code: ${
|
|
444
|
-
icon: /* @__PURE__ */
|
|
445
|
-
headerActions: /* @__PURE__ */
|
|
451
|
+
let le = A.status?.toUpperCase() === "ACTIVE";
|
|
452
|
+
return /* @__PURE__ */ F(u, {
|
|
453
|
+
title: A.name,
|
|
454
|
+
subtitle: `Code: ${A.code}`,
|
|
455
|
+
icon: /* @__PURE__ */ P(e, { size: 24 }),
|
|
456
|
+
headerActions: /* @__PURE__ */ F("div", {
|
|
446
457
|
className: "flex gap-2",
|
|
447
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ F(f, {
|
|
448
459
|
variant: "outline",
|
|
449
|
-
onClick:
|
|
450
|
-
children: [/* @__PURE__ */
|
|
451
|
-
}), /* @__PURE__ */
|
|
452
|
-
onClick: () =>
|
|
453
|
-
children: [/* @__PURE__ */
|
|
460
|
+
onClick: se,
|
|
461
|
+
children: [/* @__PURE__ */ P(t, { size: 16 }), " Back"]
|
|
462
|
+
}), /* @__PURE__ */ F(f, {
|
|
463
|
+
onClick: () => T?.(O(v, `inventory/warehouses/${a}/edit`)),
|
|
464
|
+
children: [/* @__PURE__ */ P(n, { size: 16 }), " Edit"]
|
|
454
465
|
})]
|
|
455
466
|
}),
|
|
456
|
-
headerContent: /* @__PURE__ */
|
|
467
|
+
headerContent: /* @__PURE__ */ F("div", {
|
|
457
468
|
className: "flex gap-2",
|
|
458
|
-
children: [/* @__PURE__ */
|
|
459
|
-
variant:
|
|
460
|
-
children:
|
|
461
|
-
}), /* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ P(d, {
|
|
470
|
+
variant: A.status ? le ? "default" : "secondary" : "outline",
|
|
471
|
+
children: A.status ? le ? "Active" : "Inactive" : "Not provided"
|
|
472
|
+
}), /* @__PURE__ */ P(d, {
|
|
462
473
|
variant: "outline",
|
|
463
474
|
className: "capitalize",
|
|
464
|
-
children:
|
|
475
|
+
children: A.type.replace("_", " ")
|
|
465
476
|
})]
|
|
466
477
|
}),
|
|
467
478
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
icon: /* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ P(R, {
|
|
480
|
+
icon: /* @__PURE__ */ P(e, { size: 18 }),
|
|
470
481
|
children: "A storage and fulfilment site at a glance — how full it is, its operating hours and how to reach it. Use it to decide whether this warehouse has the space and hours to fulfil an order."
|
|
471
482
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ P(L, {
|
|
473
484
|
storageKey: "movethewheels-warehouse-details",
|
|
474
485
|
steps: [{
|
|
475
486
|
id: "inventory",
|
|
476
487
|
label: "Review stock here",
|
|
477
488
|
description: "See which products are stored at this site.",
|
|
478
|
-
icon: /* @__PURE__ */
|
|
479
|
-
onClick: () =>
|
|
489
|
+
icon: /* @__PURE__ */ P(i, { size: 16 }),
|
|
490
|
+
onClick: () => ce("inventory/products")
|
|
480
491
|
}, {
|
|
481
492
|
id: "fulfil",
|
|
482
493
|
label: "Fulfil an order from this site",
|
|
483
494
|
description: "Pick a pending order to ship out of this warehouse.",
|
|
484
|
-
icon: /* @__PURE__ */
|
|
485
|
-
onClick: () =>
|
|
495
|
+
icon: /* @__PURE__ */ P(r, { size: 16 }),
|
|
496
|
+
onClick: () => ce("orders")
|
|
486
497
|
}]
|
|
487
498
|
}),
|
|
488
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ F("div", {
|
|
489
500
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
490
|
-
children: [/* @__PURE__ */
|
|
501
|
+
children: [/* @__PURE__ */ F("div", {
|
|
491
502
|
className: "lg:col-span-2 space-y-6",
|
|
492
|
-
children: [
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
+
children: [
|
|
504
|
+
/* @__PURE__ */ F(I, { children: [/* @__PURE__ */ F("h2", {
|
|
505
|
+
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
506
|
+
children: [/* @__PURE__ */ P(i, { size: 18 }), " Capacity"]
|
|
507
|
+
}), /* @__PURE__ */ P("div", { children: A.utilization !== void 0 && A.capacity.usedSpace !== void 0 && A.capacity.totalSpace !== void 0 ? /* @__PURE__ */ F(ie, { children: [
|
|
508
|
+
/* @__PURE__ */ F("div", {
|
|
509
|
+
className: "flex justify-between text-sm mb-2",
|
|
510
|
+
children: [/* @__PURE__ */ P("span", { children: "Space Utilization" }), /* @__PURE__ */ F("span", { children: [A.utilization.toFixed(0), "%"] })]
|
|
511
|
+
}),
|
|
512
|
+
/* @__PURE__ */ P(y, { value: A.utilization }),
|
|
513
|
+
/* @__PURE__ */ F("p", {
|
|
514
|
+
className: "text-sm text-text-secondary mt-1",
|
|
515
|
+
children: [
|
|
516
|
+
A.capacity.usedSpace.toLocaleString(),
|
|
517
|
+
" /",
|
|
518
|
+
" ",
|
|
519
|
+
A.capacity.totalSpace.toLocaleString(),
|
|
520
|
+
" sq ft"
|
|
521
|
+
]
|
|
522
|
+
})
|
|
523
|
+
] }) : /* @__PURE__ */ P("p", {
|
|
524
|
+
className: "text-sm text-text-secondary",
|
|
525
|
+
children: "Not provided"
|
|
526
|
+
}) })] }),
|
|
527
|
+
/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
|
|
528
|
+
className: "flex items-center gap-2",
|
|
529
|
+
children: [/* @__PURE__ */ P(ee, { size: 18 }), " Operating Hours"]
|
|
530
|
+
}) }), /* @__PURE__ */ P(m, { children: Object.keys(A.operatingHours).length > 0 ? /* @__PURE__ */ P("div", {
|
|
531
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
532
|
+
children: Object.entries(A.operatingHours).map(([e, t]) => /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
533
|
+
className: "text-sm font-medium",
|
|
534
|
+
children: e
|
|
535
|
+
}), /* @__PURE__ */ P("p", {
|
|
536
|
+
className: "text-sm text-text-secondary",
|
|
537
|
+
children: t ? `${t.open} - ${t.close}` : "Closed"
|
|
538
|
+
})] }, e))
|
|
539
|
+
}) : /* @__PURE__ */ P("p", {
|
|
540
|
+
className: "text-sm text-text-secondary",
|
|
541
|
+
children: "Not recorded"
|
|
542
|
+
}) })] }),
|
|
543
|
+
A.metrics && /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ P(g, { children: "Facility Metrics" }) }), /* @__PURE__ */ P(m, { children: /* @__PURE__ */ F("div", {
|
|
544
|
+
className: "grid grid-cols-2 sm:grid-cols-4 gap-4 text-sm",
|
|
503
545
|
children: [
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
546
|
+
/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
547
|
+
className: "text-xs text-text-secondary",
|
|
548
|
+
children: "Active Locations"
|
|
549
|
+
}), /* @__PURE__ */ F("p", {
|
|
550
|
+
className: "text-lg font-semibold",
|
|
551
|
+
children: [
|
|
552
|
+
A.metrics.activeLocations,
|
|
553
|
+
"/",
|
|
554
|
+
A.metrics.totalLocations
|
|
555
|
+
]
|
|
556
|
+
})] }),
|
|
557
|
+
/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
558
|
+
className: "text-xs text-text-secondary",
|
|
559
|
+
children: "Zones"
|
|
560
|
+
}), /* @__PURE__ */ P("p", {
|
|
561
|
+
className: "text-lg font-semibold",
|
|
562
|
+
children: A.metrics.zoneCount
|
|
563
|
+
})] }),
|
|
564
|
+
/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
565
|
+
className: "text-xs text-text-secondary",
|
|
566
|
+
children: "Active Staff"
|
|
567
|
+
}), /* @__PURE__ */ P("p", {
|
|
568
|
+
className: "text-lg font-semibold",
|
|
569
|
+
children: A.metrics.staffCount
|
|
570
|
+
})] }),
|
|
571
|
+
/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
572
|
+
className: "text-xs text-text-secondary",
|
|
573
|
+
children: "SKUs / On Hand"
|
|
574
|
+
}), /* @__PURE__ */ F("p", {
|
|
575
|
+
className: "text-lg font-semibold",
|
|
576
|
+
children: [
|
|
577
|
+
A.metrics.totalSkus,
|
|
578
|
+
" (",
|
|
579
|
+
A.metrics.totalOnHand.toLocaleString(),
|
|
580
|
+
")"
|
|
581
|
+
]
|
|
582
|
+
})] })
|
|
509
583
|
]
|
|
510
|
-
})
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
584
|
+
}) })] }),
|
|
585
|
+
/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ F(h, {
|
|
586
|
+
className: "flex flex-row items-center justify-between gap-2",
|
|
587
|
+
children: [/* @__PURE__ */ F(g, {
|
|
588
|
+
className: "flex items-center gap-2",
|
|
589
|
+
children: [/* @__PURE__ */ P(s, {
|
|
590
|
+
size: 18,
|
|
591
|
+
"aria-hidden": "true"
|
|
592
|
+
}), " Zones"]
|
|
593
|
+
}), /* @__PURE__ */ F(f, {
|
|
594
|
+
variant: "outline",
|
|
595
|
+
size: "sm",
|
|
596
|
+
onClick: () => q((e) => !e),
|
|
597
|
+
children: [
|
|
598
|
+
/* @__PURE__ */ P(c, {
|
|
599
|
+
size: 14,
|
|
600
|
+
"aria-hidden": "true"
|
|
601
|
+
}),
|
|
602
|
+
" ",
|
|
603
|
+
K ? "Close" : "Add zone"
|
|
604
|
+
]
|
|
605
|
+
})]
|
|
606
|
+
}), /* @__PURE__ */ F(m, {
|
|
607
|
+
className: "space-y-4",
|
|
608
|
+
children: [K && /* @__PURE__ */ F("form", {
|
|
609
|
+
className: "space-y-3 rounded-lg border border-border-seam p-3",
|
|
610
|
+
onSubmit: async (e) => {
|
|
611
|
+
e.preventDefault(), J.code.trim() && J.name.trim() && (await U({
|
|
612
|
+
code: J.code.trim(),
|
|
613
|
+
name: J.name.trim(),
|
|
614
|
+
zoneType: J.zoneType
|
|
615
|
+
}), Y({
|
|
616
|
+
code: "",
|
|
617
|
+
name: "",
|
|
618
|
+
zoneType: "STORAGE"
|
|
619
|
+
}), q(!1));
|
|
620
|
+
},
|
|
621
|
+
children: [/* @__PURE__ */ F("div", {
|
|
622
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
623
|
+
children: [
|
|
624
|
+
/* @__PURE__ */ P(_, {
|
|
625
|
+
placeholder: "Code (e.g. Z-A1)",
|
|
626
|
+
required: !0,
|
|
627
|
+
value: J.code,
|
|
628
|
+
onChange: (e) => Y((t) => ({
|
|
629
|
+
...t,
|
|
630
|
+
code: e.target.value
|
|
631
|
+
}))
|
|
632
|
+
}),
|
|
633
|
+
/* @__PURE__ */ P(_, {
|
|
634
|
+
placeholder: "Zone name",
|
|
635
|
+
required: !0,
|
|
636
|
+
value: J.name,
|
|
637
|
+
onChange: (e) => Y((t) => ({
|
|
638
|
+
...t,
|
|
639
|
+
name: e.target.value
|
|
640
|
+
}))
|
|
641
|
+
}),
|
|
642
|
+
/* @__PURE__ */ F(b, {
|
|
643
|
+
value: J.zoneType,
|
|
644
|
+
onValueChange: (e) => Y((t) => ({
|
|
645
|
+
...t,
|
|
646
|
+
zoneType: e
|
|
647
|
+
})),
|
|
648
|
+
children: [/* @__PURE__ */ P(C, { children: /* @__PURE__ */ P(w, {}) }), /* @__PURE__ */ P(x, { children: [
|
|
649
|
+
"STORAGE",
|
|
650
|
+
"RECEIVING",
|
|
651
|
+
"SHIPPING",
|
|
652
|
+
"COLD",
|
|
653
|
+
"HAZMAT",
|
|
654
|
+
"STAGING",
|
|
655
|
+
"RETURNS"
|
|
656
|
+
].map((e) => /* @__PURE__ */ P(S, {
|
|
657
|
+
value: e,
|
|
658
|
+
children: e
|
|
659
|
+
}, e)) })]
|
|
660
|
+
})
|
|
661
|
+
]
|
|
662
|
+
}), /* @__PURE__ */ P(f, {
|
|
663
|
+
type: "submit",
|
|
664
|
+
size: "sm",
|
|
665
|
+
children: "Save zone"
|
|
666
|
+
})]
|
|
667
|
+
}), A.zones && A.zones.length > 0 ? /* @__PURE__ */ P("ul", {
|
|
668
|
+
className: "divide-y divide-border-seam",
|
|
669
|
+
children: A.zones.map((e) => /* @__PURE__ */ F("li", {
|
|
670
|
+
className: "flex items-center justify-between gap-3 py-2 text-sm",
|
|
671
|
+
children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ F("p", {
|
|
672
|
+
className: "font-medium",
|
|
673
|
+
children: [
|
|
674
|
+
e.code,
|
|
675
|
+
" — ",
|
|
676
|
+
e.name
|
|
677
|
+
]
|
|
678
|
+
}), /* @__PURE__ */ F("p", {
|
|
679
|
+
className: "text-xs text-text-secondary",
|
|
680
|
+
children: [
|
|
681
|
+
e.zoneType,
|
|
682
|
+
" · ",
|
|
683
|
+
e.status,
|
|
684
|
+
e.temperatureRange ? ` · ${e.temperatureRange}` : ""
|
|
685
|
+
]
|
|
686
|
+
})] }), /* @__PURE__ */ P(f, {
|
|
687
|
+
variant: "ghost",
|
|
688
|
+
size: "sm",
|
|
689
|
+
className: "text-status-error-text",
|
|
690
|
+
"aria-label": `Delete zone ${e.code}`,
|
|
691
|
+
onClick: () => void W(e.id),
|
|
692
|
+
children: /* @__PURE__ */ P(o, {
|
|
693
|
+
size: 14,
|
|
694
|
+
"aria-hidden": "true"
|
|
695
|
+
})
|
|
696
|
+
})]
|
|
697
|
+
}, e.id))
|
|
698
|
+
}) : /* @__PURE__ */ P("p", {
|
|
699
|
+
className: "text-sm text-text-secondary",
|
|
700
|
+
children: "No warehouse zones configured yet."
|
|
701
|
+
})]
|
|
702
|
+
})] }),
|
|
703
|
+
/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ F(h, {
|
|
704
|
+
className: "flex flex-row items-center justify-between gap-2",
|
|
705
|
+
children: [/* @__PURE__ */ F(g, {
|
|
706
|
+
className: "flex items-center gap-2",
|
|
707
|
+
children: [/* @__PURE__ */ P(te, {
|
|
708
|
+
size: 18,
|
|
709
|
+
"aria-hidden": "true"
|
|
710
|
+
}), " Staff Roster"]
|
|
711
|
+
}), /* @__PURE__ */ F(f, {
|
|
712
|
+
variant: "outline",
|
|
713
|
+
size: "sm",
|
|
714
|
+
onClick: () => Z((e) => !e),
|
|
715
|
+
children: [
|
|
716
|
+
/* @__PURE__ */ P(c, {
|
|
717
|
+
size: 14,
|
|
718
|
+
"aria-hidden": "true"
|
|
719
|
+
}),
|
|
720
|
+
" ",
|
|
721
|
+
X ? "Close" : "Add staff"
|
|
722
|
+
]
|
|
723
|
+
})]
|
|
724
|
+
}), /* @__PURE__ */ F(m, {
|
|
725
|
+
className: "space-y-4",
|
|
726
|
+
children: [X && /* @__PURE__ */ F("form", {
|
|
727
|
+
className: "space-y-3 rounded-lg border border-border-seam p-3",
|
|
728
|
+
onSubmit: async (e) => {
|
|
729
|
+
e.preventDefault(), Q.name.trim() && (await ae({
|
|
730
|
+
name: Q.name.trim(),
|
|
731
|
+
role: Q.role,
|
|
732
|
+
shift: Q.shift.trim() || void 0
|
|
733
|
+
}), $({
|
|
734
|
+
name: "",
|
|
735
|
+
role: "PICKER",
|
|
736
|
+
shift: "DAY"
|
|
737
|
+
}), Z(!1));
|
|
738
|
+
},
|
|
739
|
+
children: [/* @__PURE__ */ F("div", {
|
|
740
|
+
className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
|
|
741
|
+
children: [
|
|
742
|
+
/* @__PURE__ */ P(_, {
|
|
743
|
+
placeholder: "Full name",
|
|
744
|
+
required: !0,
|
|
745
|
+
value: Q.name,
|
|
746
|
+
onChange: (e) => $((t) => ({
|
|
747
|
+
...t,
|
|
748
|
+
name: e.target.value
|
|
749
|
+
}))
|
|
750
|
+
}),
|
|
751
|
+
/* @__PURE__ */ F(b, {
|
|
752
|
+
value: Q.role,
|
|
753
|
+
onValueChange: (e) => $((t) => ({
|
|
754
|
+
...t,
|
|
755
|
+
role: e
|
|
756
|
+
})),
|
|
757
|
+
children: [/* @__PURE__ */ P(C, { children: /* @__PURE__ */ P(w, {}) }), /* @__PURE__ */ P(x, { children: [
|
|
758
|
+
"MANAGER",
|
|
759
|
+
"SUPERVISOR",
|
|
760
|
+
"PICKER",
|
|
761
|
+
"PACKER",
|
|
762
|
+
"LOADER",
|
|
763
|
+
"INVENTORY_CLERK"
|
|
764
|
+
].map((e) => /* @__PURE__ */ P(S, {
|
|
765
|
+
value: e,
|
|
766
|
+
children: e.replace("_", " ")
|
|
767
|
+
}, e)) })]
|
|
768
|
+
}),
|
|
769
|
+
/* @__PURE__ */ P(_, {
|
|
770
|
+
placeholder: "Shift (e.g. DAY)",
|
|
771
|
+
value: Q.shift,
|
|
772
|
+
onChange: (e) => $((t) => ({
|
|
773
|
+
...t,
|
|
774
|
+
shift: e.target.value
|
|
775
|
+
}))
|
|
776
|
+
})
|
|
777
|
+
]
|
|
778
|
+
}), /* @__PURE__ */ P(f, {
|
|
779
|
+
type: "submit",
|
|
780
|
+
size: "sm",
|
|
781
|
+
children: "Save staff member"
|
|
782
|
+
})]
|
|
783
|
+
}), A.staff && A.staff.length > 0 ? /* @__PURE__ */ P("ul", {
|
|
784
|
+
className: "divide-y divide-border-seam",
|
|
785
|
+
children: A.staff.map((e) => /* @__PURE__ */ F("li", {
|
|
786
|
+
className: "flex items-center justify-between gap-3 py-2 text-sm",
|
|
787
|
+
children: [/* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
788
|
+
className: "font-medium",
|
|
789
|
+
children: e.name
|
|
790
|
+
}), /* @__PURE__ */ F("p", {
|
|
791
|
+
className: "text-xs text-text-secondary",
|
|
792
|
+
children: [
|
|
793
|
+
e.role.replace("_", " "),
|
|
794
|
+
" · ",
|
|
795
|
+
e.status,
|
|
796
|
+
e.shift ? ` · ${e.shift}` : ""
|
|
797
|
+
]
|
|
798
|
+
})] }), /* @__PURE__ */ P(f, {
|
|
799
|
+
variant: "ghost",
|
|
800
|
+
size: "sm",
|
|
801
|
+
className: "text-status-error-text",
|
|
802
|
+
"aria-label": `Delete staff member ${e.name}`,
|
|
803
|
+
onClick: () => void oe(e.id),
|
|
804
|
+
children: /* @__PURE__ */ P(o, {
|
|
805
|
+
size: 14,
|
|
806
|
+
"aria-hidden": "true"
|
|
807
|
+
})
|
|
808
|
+
})]
|
|
809
|
+
}, e.id))
|
|
810
|
+
}) : /* @__PURE__ */ P("p", {
|
|
811
|
+
className: "text-sm text-text-secondary",
|
|
812
|
+
children: "No staff assigned to this warehouse yet."
|
|
813
|
+
})]
|
|
814
|
+
})] })
|
|
815
|
+
]
|
|
816
|
+
}), /* @__PURE__ */ F("div", {
|
|
531
817
|
className: "space-y-6",
|
|
532
|
-
children: [/* @__PURE__ */
|
|
818
|
+
children: [/* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ F(g, {
|
|
533
819
|
className: "flex items-center gap-2",
|
|
534
|
-
children: [/* @__PURE__ */
|
|
535
|
-
}) }), /* @__PURE__ */
|
|
820
|
+
children: [/* @__PURE__ */ P(r, { size: 18 }), " Location"]
|
|
821
|
+
}) }), /* @__PURE__ */ P(m, { children: /* @__PURE__ */ P("p", {
|
|
536
822
|
className: "text-sm",
|
|
537
|
-
children:
|
|
538
|
-
}) })] }), (
|
|
823
|
+
children: D(A.address) || "—"
|
|
824
|
+
}) })] }), (A.contactInfo?.email || A.contactInfo?.phone) && /* @__PURE__ */ F(p, { children: [/* @__PURE__ */ P(h, { children: /* @__PURE__ */ P(g, { children: "Contact" }) }), /* @__PURE__ */ F(m, {
|
|
539
825
|
className: "space-y-3",
|
|
540
|
-
children: [
|
|
826
|
+
children: [A.contactInfo?.email && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
541
827
|
className: "text-sm text-text-secondary",
|
|
542
828
|
children: "Email"
|
|
543
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ P("p", {
|
|
544
830
|
className: "font-medium",
|
|
545
|
-
children:
|
|
546
|
-
})] }),
|
|
831
|
+
children: A.contactInfo.email
|
|
832
|
+
})] }), A.contactInfo?.phone && /* @__PURE__ */ F("div", { children: [/* @__PURE__ */ P("p", {
|
|
547
833
|
className: "text-sm text-text-secondary",
|
|
548
834
|
children: "Phone"
|
|
549
|
-
}), /* @__PURE__ */
|
|
835
|
+
}), /* @__PURE__ */ P("p", {
|
|
550
836
|
className: "font-medium",
|
|
551
|
-
children:
|
|
837
|
+
children: A.contactInfo.phone
|
|
552
838
|
})] })]
|
|
553
839
|
})] })]
|
|
554
840
|
})]
|
|
@@ -556,4 +842,4 @@ function G() {
|
|
|
556
842
|
]
|
|
557
843
|
});
|
|
558
844
|
}
|
|
559
|
-
export {
|
|
845
|
+
export { K as default };
|