@burdenoff/microfe-movethewheels 2026.703.3 → 2026.703.5
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/{AIAssistantPage-C3cPsWt-.js → AIAssistantPage-D2gaEL1U.js} +16 -15
- package/dist/AnalyticsPage-DZMlEoBi.js +194 -0
- package/dist/CreateOrderPage-CWHx8yys.js +490 -0
- package/dist/CustomerDetailsPage-nR4oZ_ju.js +615 -0
- package/dist/CustomersPage-Bbvwvn8k.js +205 -0
- package/dist/DashboardPage-DrEhNf7N.js +542 -0
- package/dist/DataTable-CqMUD4er.js +340 -0
- package/dist/DocumentsCard-edDkgnJj.js +169 -0
- package/dist/DriverDetailsPage-whEMOWs9.js +490 -0
- package/dist/DriversPage-CHF2ZEzd.js +221 -0
- package/dist/FinancePage-Dn9GrW-1.js +175 -0
- package/dist/{FleetPage-DqkFi3s3.js → FleetPage-CrtGPy-p.js} +36 -35
- package/dist/{FormError-BlOjnXOq.js → FormError-BKcb_wT-.js} +1 -1
- package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-WYdwZomZ.js} +52 -72
- package/dist/InventoryPage-l5A1f753.js +259 -0
- package/dist/LiveTrackingPage-DhEaNKZ4.js +429 -0
- package/dist/MarketplacePage-B9RYOb1Y.js +426 -0
- package/dist/MetricCard-y3bWHKUQ.js +191 -0
- package/dist/Notice-DOO-tjpV.js +46 -0
- package/dist/OrderDetailsPage-CwYHwk1K.js +584 -0
- package/dist/OrdersListPage-DhZJoQeI.js +386 -0
- package/dist/{PageLayout-D4LDHJJq.js → PageLayout-BniRJaQ6.js} +1 -1
- package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-1Gm9JKy0.js} +56 -56
- package/dist/ProductsPage-C8sn-1tN.js +186 -0
- package/dist/ReportsPage-D1tb0dcz.js +377 -0
- package/dist/RouteDetailsPage-CkMyR9b_.js +610 -0
- package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-QkENzsE5.js} +58 -47
- package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-DV3_tU_X.js} +16 -38
- package/dist/Sparkline-K2RMJ58u.js +16729 -0
- package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-BNHXYvZx.js} +7 -7
- package/dist/TrackingPage-BZrg4RCu.js +368 -0
- package/dist/VehicleDetailsPage-D-8XPZ2G.js +393 -0
- package/dist/VehiclesPage-D5BELbtM.js +184 -0
- package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-Cmg-8Frn.js} +70 -70
- package/dist/WarehousesPage-C1Y1M867.js +182 -0
- package/dist/{arrow-left-n48Y-Wis.js → arrow-left-ClW4Isj7.js} +1 -1
- package/dist/arrow-right-CmKOmIkh.js +11 -0
- package/dist/arrow-up-BJijRLAZ.js +17 -0
- package/dist/{box-D9Pal4HM.js → box-BT3NsRQP.js} +1 -1
- package/dist/boxes-B_OGvQiW.js +54 -0
- package/dist/{chart-column-BFIJysDR.js → chart-column-DQTTdUPk.js} +1 -1
- package/dist/charts-Tj_PPTfA.js +2018 -0
- package/dist/chevron-left-B1rZyWWb.js +8 -0
- package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-BIcwUJZq.js} +1 -1
- package/dist/chunk-BdsCSvBP.js +20 -0
- package/dist/{circle-alert-iY24lSlp.js → circle-alert-CNkuDNc6.js} +1 -1
- package/dist/circle-check-Cs1OVjtV.js +13 -0
- package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-C-p4eNwn.js} +1 -1
- package/dist/{clock-DJZtdl8u.js → clock-dRGG4rkF.js} +1 -1
- package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-B6RoYHHz.js} +1 -1
- package/dist/{download-DRXxoiQR.js → download-DP04iWTd.js} +1 -1
- package/dist/{file-text-DWWY6_f5.js → file-text-BuDx4hZp.js} +1 -1
- package/dist/{filter-DloLC2eE.js → filter-BD483_8g.js} +1 -1
- package/dist/{wrench-CANXWxF-.js → fuel-DLH1ag04.js} +3 -6
- package/dist/index.css +2 -0
- package/dist/index.js +150 -172
- package/dist/{map-CkJaULb2.js → map-DNQn9fyY.js} +1 -1
- package/dist/{map-pin-BGiCvyCs.js → map-pin-CqN1bbT1.js} +1 -1
- package/dist/mapMarkers-NCV9MRKR.js +28 -0
- package/dist/maps-yzLqiK_C.js +5070 -0
- package/dist/{navigation-D36prnAn.js → navigation-CgGUt2tR.js} +1 -1
- package/dist/{package-BChUzpJS.js → package-DmRF7iQD.js} +1 -1
- package/dist/{phone-Ac9s3mo_.js → phone-Cl32EXKW.js} +1 -1
- package/dist/{plus-Z76q-FZm.js → plus-DlANgOFx.js} +1 -1
- package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-rW59D4b7.js} +1 -1
- package/dist/route-CWjPrtAN.js +22 -0
- package/dist/{save-CojywNhG.js → save-UDlog7hg.js} +1 -1
- package/dist/{search-CDGefqb3.js → search-DNIG5Ck7.js} +1 -1
- package/dist/{square-pen-CopE9GmB.js → square-pen-BcfB3Grd.js} +1 -1
- package/dist/{star-nHlLjDKR.js → star-CVZHFwDx.js} +1 -1
- package/dist/{store-BR9Voi5E.js → store-bwnmCK9f.js} +1 -1
- package/dist/{trash-2-BKhar6Hs.js → trash-2-B80G12d4.js} +1 -1
- package/dist/{trending-up-Dohgd4t_.js → trending-up-CH4R4KOa.js} +1 -1
- package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-CmS8AUU6.js} +1 -1
- package/dist/{truck-C0v_hbLR.js → truck-9rLDncav.js} +1 -1
- package/dist/upload-DanJY1Vo.js +21 -0
- package/dist/{useAssistant-D4v3oxD3.js → useAssistant-CnEwkTLm.js} +11 -28
- package/dist/{useCustomers-BmTNGxiI.js → useCustomers-ChJao1ET.js} +30 -27
- package/dist/{useFleet-DKqXZ16m.js → useFleet-g5Yri0G8.js} +82 -70
- package/dist/{useImportExport-DHr-SWSw.js → useImportExport-MYwIT3rE.js} +1 -1
- package/dist/{useInventory-DkyiVY_A.js → useInventory-BSOn-R1c.js} +84 -39
- package/dist/{useOrders-Cfk1GLiq.js → useOrders-BSiqo61w.js} +59 -48
- package/dist/{useReports-CTqZr-AB.js → useReports-fWESfsF9.js} +41 -35
- package/dist/{useRoutes-BQWO607N.js → useRoutes-zD8Yp323.js} +50 -42
- package/dist/{useSettings-CkDH_-gM.js → useSettings-B1lsWeZ1.js} +6 -6
- package/dist/{useTracking-B-va1kO3.js → useTracking-BKG0I2ln.js} +3 -3
- package/dist/{user-jyFU3lXk.js → user-DU51el3m.js} +1 -1
- package/dist/user-check-IMhk-qkX.js +20 -0
- package/dist/{users-DZ-ilS6B.js → users-B8KhJBGg.js} +1 -1
- package/dist/{warehouse-6m5kXMLu.js → warehouse-CcMMioeY.js} +1 -1
- package/dist/wrench-Dg-sgH2e.js +8 -0
- package/dist/x-C4ObLVEa.js +11 -0
- package/package.json +5 -1
- package/src/movethewheels/components/DataTable.tsx +252 -84
- package/src/movethewheels/components/DocumentsCard.tsx +102 -0
- package/src/movethewheels/components/GlassPanel.tsx +71 -0
- package/src/movethewheels/components/MetricCard.tsx +171 -73
- package/src/movethewheels/components/Notice.tsx +61 -0
- package/src/movethewheels/components/StatusBadge.tsx +7 -6
- package/src/movethewheels/components/charts/ChartShell.tsx +78 -0
- package/src/movethewheels/components/charts/Sparkline.tsx +85 -0
- package/src/movethewheels/components/charts/StatusDonut.tsx +115 -0
- package/src/movethewheels/components/charts/TrendChart.tsx +179 -0
- package/src/movethewheels/components/charts/VolumeBar.tsx +97 -0
- package/src/movethewheels/components/charts/chartTokens.ts +43 -0
- package/src/movethewheels/components/charts/index.ts +9 -0
- package/src/movethewheels/components/index.ts +51 -1
- package/src/movethewheels/components/maps/LogisticsMap.tsx +94 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +118 -0
- package/src/movethewheels/components/maps/RouteMap.tsx +71 -0
- package/src/movethewheels/components/maps/TrackingMap.tsx +102 -0
- package/src/movethewheels/components/maps/index.ts +16 -0
- package/src/movethewheels/components/maps/leaflet-setup.ts +124 -0
- package/src/movethewheels/components/maps/map-markers.css +121 -0
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useAnalytics.ts +109 -4
- package/src/movethewheels/hooks/useCustomers.ts +11 -4
- package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
- package/src/movethewheels/hooks/useFleet.ts +26 -7
- package/src/movethewheels/hooks/useInventory.ts +70 -7
- package/src/movethewheels/hooks/useOrders.ts +32 -2
- package/src/movethewheels/hooks/useReports.ts +14 -4
- package/src/movethewheels/hooks/useRoutes.ts +20 -3
- package/src/movethewheels/pages/AnalyticsPage.tsx +93 -73
- package/src/movethewheels/pages/CreateOrderPage.tsx +48 -20
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
- package/src/movethewheels/pages/CustomersPage.tsx +53 -28
- package/src/movethewheels/pages/DashboardPage.tsx +238 -12
- package/src/movethewheels/pages/DriverDetailsPage.tsx +17 -31
- package/src/movethewheels/pages/DriversPage.tsx +59 -31
- package/src/movethewheels/pages/FinancePage.tsx +103 -82
- package/src/movethewheels/pages/InventoryPage.tsx +15 -3
- package/src/movethewheels/pages/LiveTrackingPage.tsx +124 -16
- package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
- package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
- package/src/movethewheels/pages/OrdersListPage.tsx +118 -47
- package/src/movethewheels/pages/ProductsPage.tsx +52 -28
- package/src/movethewheels/pages/ReportsPage.tsx +88 -4
- package/src/movethewheels/pages/RouteDetailsPage.tsx +119 -19
- package/src/movethewheels/pages/RoutesPage.tsx +22 -6
- package/src/movethewheels/pages/SettingsPage.tsx +5 -21
- package/src/movethewheels/pages/TrackingPage.tsx +76 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -34
- package/src/movethewheels/pages/VehiclesPage.tsx +58 -27
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/WarehousesPage.tsx +47 -36
- package/src/movethewheels/types/index.ts +9 -1
- package/src/movethewheels/utils/download.ts +62 -0
- package/src/movethewheels/utils/mapMarkers.ts +58 -0
- package/dist/AnalyticsPage-Dz6g2MvK.js +0 -215
- package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
- package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
- package/dist/CustomersPage-BKxMS1AV.js +0 -161
- package/dist/DashboardPage-BVjQi0EB.js +0 -387
- package/dist/DataTable-DmciIKKM.js +0 -249
- package/dist/DriverDetailsPage-CN3WQ0B9.js +0 -507
- package/dist/DriversPage-CH9rjQC-.js +0 -165
- package/dist/FinancePage-DEDykSOP.js +0 -158
- package/dist/InventoryPage-e0ze63iX.js +0 -253
- package/dist/LiveTrackingPage-DCX-K-LR.js +0 -379
- package/dist/MarketplacePage-CIQ97_zp.js +0 -247
- package/dist/MetricCard-BY0QrMD4.js +0 -146
- package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
- package/dist/OrdersListPage-Cn90P1Xx.js +0 -307
- package/dist/ProductsPage-QJfHHpqB.js +0 -169
- package/dist/ReportsPage-Zp53q3_8.js +0 -284
- package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
- package/dist/TrackingPage-W-jtdM3Y.js +0 -325
- package/dist/VehicleDetailsPage-Bceo5oz3.js +0 -410
- package/dist/VehiclesPage-ApKThYeG.js +0 -165
- package/dist/WarehousesPage-DCbXXXWE.js +0 -162
- package/dist/useAnalytics-DS8n0xgg.js +0 -297
- /package/dist/{formatters-CF2S2l1m.js → formatters-FWJDwTFv.js} +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { i as e, l as t, lt as n, st as r, ut as i } from "./PageLayout-BniRJaQ6.js";
|
|
2
|
+
import { t as a } from "./DataTable-CqMUD4er.js";
|
|
3
|
+
import { t as o } from "./download-DP04iWTd.js";
|
|
4
|
+
import { t as s } from "./package-DmRF7iQD.js";
|
|
5
|
+
import { t as c } from "./plus-DlANgOFx.js";
|
|
6
|
+
import { t as l } from "./refresh-cw-rW59D4b7.js";
|
|
7
|
+
import { t as u } from "./triangle-alert-CmS8AUU6.js";
|
|
8
|
+
import { a as d, i as f } from "./useInventory-BSOn-R1c.js";
|
|
9
|
+
import { r as p, t as m } from "./MetricCard-y3bWHKUQ.js";
|
|
10
|
+
import { n as h } from "./formatters-FWJDwTFv.js";
|
|
11
|
+
import { useState as g } from "react";
|
|
12
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
13
|
+
import { CTAOverflowMenu as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
//#region node_modules/lucide-react/dist/esm/icons/thermometer.js
|
|
15
|
+
var x = i("Thermometer", [["path", {
|
|
16
|
+
d: "M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",
|
|
17
|
+
key: "17jzev"
|
|
18
|
+
}]]);
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/movethewheels/pages/ProductsPage.tsx
|
|
21
|
+
function S() {
|
|
22
|
+
let { basePath: i, navigate: S } = r(), [C, w] = g(0), [T, E] = g(25), { products: D, hasMore: O, isLoading: k, refetch: A } = d({
|
|
23
|
+
limit: T,
|
|
24
|
+
offset: C * T
|
|
25
|
+
}), { stats: j } = f(), M = (e) => S?.(n(i, e));
|
|
26
|
+
return /* @__PURE__ */ v(e, {
|
|
27
|
+
title: "Products",
|
|
28
|
+
subtitle: `${j.total} products`,
|
|
29
|
+
icon: /* @__PURE__ */ _(s, { size: 24 }),
|
|
30
|
+
headerActions: /* @__PURE__ */ _(y, {
|
|
31
|
+
primary: {
|
|
32
|
+
label: "Add Product",
|
|
33
|
+
icon: /* @__PURE__ */ _(c, { size: 16 }),
|
|
34
|
+
onSelect: () => M("inventory/products/new")
|
|
35
|
+
},
|
|
36
|
+
actions: [{
|
|
37
|
+
label: "Refresh",
|
|
38
|
+
icon: /* @__PURE__ */ _(l, { size: 16 }),
|
|
39
|
+
onSelect: () => A()
|
|
40
|
+
}, {
|
|
41
|
+
label: "Export",
|
|
42
|
+
icon: /* @__PURE__ */ _(o, { size: 16 }),
|
|
43
|
+
onSelect: () => M("import-export")
|
|
44
|
+
}]
|
|
45
|
+
}),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ _(b, {
|
|
48
|
+
icon: /* @__PURE__ */ _(s, { size: 18 }),
|
|
49
|
+
children: "The catalog of items you ship. Each product's dimensions, weight, value and handling flags (fragile, hazardous, temperature-controlled) drive how it's packed, priced and routed — keep them accurate so shipments are quoted and handled correctly."
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
52
|
+
className: "mb-3 text-sm font-medium text-text-secondary",
|
|
53
|
+
children: "Catalog at a glance"
|
|
54
|
+
}), /* @__PURE__ */ v(p, {
|
|
55
|
+
columns: 3,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ _(m, {
|
|
58
|
+
label: "Total products",
|
|
59
|
+
value: j.total,
|
|
60
|
+
icon: /* @__PURE__ */ _(s, { size: 20 }),
|
|
61
|
+
accent: "brand"
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ _(m, {
|
|
64
|
+
label: "Special handling",
|
|
65
|
+
value: j.specialHandling,
|
|
66
|
+
icon: /* @__PURE__ */ _(u, { size: 20 }),
|
|
67
|
+
accent: "warning",
|
|
68
|
+
subtitle: "Fragile or hazardous"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ _(m, {
|
|
71
|
+
label: "Temp-controlled",
|
|
72
|
+
value: j.temperatureControlled,
|
|
73
|
+
icon: /* @__PURE__ */ _(x, { size: 20 }),
|
|
74
|
+
accent: "blue"
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
})] }),
|
|
78
|
+
/* @__PURE__ */ _(a, {
|
|
79
|
+
columns: [
|
|
80
|
+
{
|
|
81
|
+
id: "sku",
|
|
82
|
+
header: "SKU",
|
|
83
|
+
accessorKey: "sku",
|
|
84
|
+
sortable: !0,
|
|
85
|
+
cell: (e) => /* @__PURE__ */ _("span", {
|
|
86
|
+
className: "font-mono",
|
|
87
|
+
children: e.sku
|
|
88
|
+
})
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "name",
|
|
92
|
+
header: "Product Name",
|
|
93
|
+
accessorKey: "name",
|
|
94
|
+
sortable: !0,
|
|
95
|
+
cell: (e) => /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
|
|
96
|
+
className: "font-medium",
|
|
97
|
+
children: e.name
|
|
98
|
+
}), /* @__PURE__ */ _("p", {
|
|
99
|
+
className: "text-sm text-text-secondary line-clamp-1",
|
|
100
|
+
children: e.description
|
|
101
|
+
})] })
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "category",
|
|
105
|
+
header: "Category",
|
|
106
|
+
accessorKey: "category",
|
|
107
|
+
sortable: !0,
|
|
108
|
+
cell: (e) => /* @__PURE__ */ _(t, {
|
|
109
|
+
variant: "outline",
|
|
110
|
+
children: e.category
|
|
111
|
+
})
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "dimensions",
|
|
115
|
+
header: "Dimensions",
|
|
116
|
+
cell: (e) => `${e.dimensions.length}x${e.dimensions.width}x${e.dimensions.height} ${e.dimensions.unit}`
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "weight",
|
|
120
|
+
header: "Weight",
|
|
121
|
+
accessorKey: "weight",
|
|
122
|
+
sortable: !0,
|
|
123
|
+
cell: (e) => `${e.weight} kg`
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "value",
|
|
127
|
+
header: "Value",
|
|
128
|
+
accessorKey: "value",
|
|
129
|
+
sortable: !0,
|
|
130
|
+
cell: (e) => /* @__PURE__ */ _("span", {
|
|
131
|
+
className: "font-medium",
|
|
132
|
+
children: h(e.value)
|
|
133
|
+
})
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "flags",
|
|
137
|
+
header: "Flags",
|
|
138
|
+
cell: (e) => /* @__PURE__ */ v("div", {
|
|
139
|
+
className: "flex gap-1",
|
|
140
|
+
children: [
|
|
141
|
+
e.fragile && /* @__PURE__ */ _(t, {
|
|
142
|
+
variant: "destructive",
|
|
143
|
+
className: "text-xs",
|
|
144
|
+
children: "Fragile"
|
|
145
|
+
}),
|
|
146
|
+
e.hazardous && /* @__PURE__ */ _(t, {
|
|
147
|
+
variant: "destructive",
|
|
148
|
+
className: "text-xs",
|
|
149
|
+
children: "Hazardous"
|
|
150
|
+
}),
|
|
151
|
+
e.temperatureControlled && /* @__PURE__ */ _(t, {
|
|
152
|
+
variant: "secondary",
|
|
153
|
+
className: "text-xs",
|
|
154
|
+
children: "Temp Control"
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
data: D,
|
|
161
|
+
isLoading: k,
|
|
162
|
+
searchable: !0,
|
|
163
|
+
searchPlaceholder: "Search products...",
|
|
164
|
+
searchFields: [
|
|
165
|
+
"name",
|
|
166
|
+
"sku",
|
|
167
|
+
"category"
|
|
168
|
+
],
|
|
169
|
+
onRowClick: (e) => M(`inventory/products/${e.id}`),
|
|
170
|
+
getRowId: (e) => e.id,
|
|
171
|
+
pageIndex: C,
|
|
172
|
+
pageSize: T,
|
|
173
|
+
onPageChange: w,
|
|
174
|
+
onPageSizeChange: (e) => {
|
|
175
|
+
E(e), w(0);
|
|
176
|
+
},
|
|
177
|
+
hasNextPage: O,
|
|
178
|
+
emptyIllustration: "empty-files",
|
|
179
|
+
emptyTitle: "No products yet",
|
|
180
|
+
emptyDescription: "Add products to your catalog so they can be added to orders and stocked in warehouses."
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { S as default };
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import { B as e, F as t, I as n, L as r, P as i, R as a, d as o, f as s, g as c, h as l, i as u, l as d, u as f, ut as p } from "./PageLayout-BniRJaQ6.js";
|
|
2
|
+
import { t as m } from "./chevron-left-B1rZyWWb.js";
|
|
3
|
+
import { t as h } from "./chevron-right-BIcwUJZq.js";
|
|
4
|
+
import { t as ee } from "./clock-dRGG4rkF.js";
|
|
5
|
+
import { t as te } from "./download-DP04iWTd.js";
|
|
6
|
+
import { t as g } from "./filter-BD483_8g.js";
|
|
7
|
+
import { t as _ } from "./plus-DlANgOFx.js";
|
|
8
|
+
import { n as v, o as y } from "./charts-Tj_PPTfA.js";
|
|
9
|
+
import { t as b } from "./useReports-fWESfsF9.js";
|
|
10
|
+
import { r as x } from "./formatters-FWJDwTFv.js";
|
|
11
|
+
import { useState as S } from "react";
|
|
12
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
13
|
+
import { EmphasisPanel as T, IllustratedEmptyState as E, PagePurpose as ne } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
//#region node_modules/lucide-react/dist/esm/icons/calendar.js
|
|
15
|
+
var re = p("Calendar", [
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M8 2v4",
|
|
18
|
+
key: "1cmpym"
|
|
19
|
+
}],
|
|
20
|
+
["path", {
|
|
21
|
+
d: "M16 2v4",
|
|
22
|
+
key: "4m81vk"
|
|
23
|
+
}],
|
|
24
|
+
["rect", {
|
|
25
|
+
width: "18",
|
|
26
|
+
height: "18",
|
|
27
|
+
x: "3",
|
|
28
|
+
y: "4",
|
|
29
|
+
rx: "2",
|
|
30
|
+
key: "1hopcy"
|
|
31
|
+
}],
|
|
32
|
+
["path", {
|
|
33
|
+
d: "M3 10h18",
|
|
34
|
+
key: "8toen8"
|
|
35
|
+
}]
|
|
36
|
+
]), D = p("FileChartColumnIncreasing", [
|
|
37
|
+
["path", {
|
|
38
|
+
d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",
|
|
39
|
+
key: "1rqfz7"
|
|
40
|
+
}],
|
|
41
|
+
["path", {
|
|
42
|
+
d: "M14 2v4a2 2 0 0 0 2 2h4",
|
|
43
|
+
key: "tnqrlb"
|
|
44
|
+
}],
|
|
45
|
+
["path", {
|
|
46
|
+
d: "M8 18v-2",
|
|
47
|
+
key: "qcmpov"
|
|
48
|
+
}],
|
|
49
|
+
["path", {
|
|
50
|
+
d: "M12 18v-4",
|
|
51
|
+
key: "q1q25u"
|
|
52
|
+
}],
|
|
53
|
+
["path", {
|
|
54
|
+
d: "M16 18v-6",
|
|
55
|
+
key: "15y0np"
|
|
56
|
+
}]
|
|
57
|
+
]);
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/movethewheels/utils/download.ts
|
|
60
|
+
function O(e, t, n) {
|
|
61
|
+
if (typeof document > "u") return;
|
|
62
|
+
let r = new Blob([t], { type: n }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
63
|
+
a.href = i, a.download = e, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(i);
|
|
64
|
+
}
|
|
65
|
+
function ie(e, t) {
|
|
66
|
+
O(e, JSON.stringify(t, null, 2), "application/json");
|
|
67
|
+
}
|
|
68
|
+
function k(e) {
|
|
69
|
+
if (!e || typeof e != "object") return null;
|
|
70
|
+
let t = Object.entries(e);
|
|
71
|
+
if (t.length === 0) return null;
|
|
72
|
+
let n = (e) => /[",\n]/.test(e) ? `"${e.replace(/"/g, "\"\"")}"` : e, r = (e) => e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e), i = ["Field,Value"];
|
|
73
|
+
for (let [e, a] of t) i.push(`${n(e)},${n(r(a))}`);
|
|
74
|
+
return i.join("\n");
|
|
75
|
+
}
|
|
76
|
+
function A(e) {
|
|
77
|
+
return e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "report";
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/movethewheels/pages/ReportsPage.tsx
|
|
81
|
+
var j = [
|
|
82
|
+
{
|
|
83
|
+
value: "operations",
|
|
84
|
+
label: "Operations Summary"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: "finance",
|
|
88
|
+
label: "Financial Report"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
value: "fleet",
|
|
92
|
+
label: "Fleet Utilization"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "customers",
|
|
96
|
+
label: "Customer Analytics"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
value: "inventory",
|
|
100
|
+
label: "Inventory Status"
|
|
101
|
+
}
|
|
102
|
+
], M = 10;
|
|
103
|
+
function N() {
|
|
104
|
+
let [p, N] = S(0), { reports: P, hasMore: F, isLoading: I, error: L, refetch: R, createReport: z, generateReport: B } = b({
|
|
105
|
+
limit: M,
|
|
106
|
+
offset: p * M
|
|
107
|
+
}), { analytics: V } = y(), H = V.trends.dailyOrders.slice(-7), [U, W] = S("operations"), [G, K] = S(null), [q, J] = S(!1), [Y, X] = S(null), Z = (e) => j.find((t) => t.value === e)?.label ?? e, Q = async (e) => {
|
|
108
|
+
J(!0), X(null);
|
|
109
|
+
let t = {
|
|
110
|
+
name: `${Z(U)}${e ? " (Scheduled)" : ""}`,
|
|
111
|
+
type: U,
|
|
112
|
+
description: `${Z(U)} generated from live operational data`,
|
|
113
|
+
...e ? { schedule: e } : {}
|
|
114
|
+
};
|
|
115
|
+
try {
|
|
116
|
+
await z(t), X({
|
|
117
|
+
tone: "success",
|
|
118
|
+
text: e ? "Scheduled report created." : "Report created."
|
|
119
|
+
});
|
|
120
|
+
} catch (e) {
|
|
121
|
+
X({
|
|
122
|
+
tone: "error",
|
|
123
|
+
text: e instanceof Error ? e.message : "Could not create report."
|
|
124
|
+
});
|
|
125
|
+
} finally {
|
|
126
|
+
J(!1);
|
|
127
|
+
}
|
|
128
|
+
}, ae = async (e) => {
|
|
129
|
+
K(e), X(null);
|
|
130
|
+
try {
|
|
131
|
+
let t = await B(e), n = `${A(t.report.name)}-${t.generatedAt.slice(0, 10)}`, r = k(t.result ?? null);
|
|
132
|
+
r ? O(`${n}.csv`, r, "text/csv") : ie(`${n}.json`, t), X({
|
|
133
|
+
tone: "success",
|
|
134
|
+
text: "Report generated and downloaded."
|
|
135
|
+
});
|
|
136
|
+
} catch (e) {
|
|
137
|
+
X({
|
|
138
|
+
tone: "error",
|
|
139
|
+
text: e instanceof Error ? e.message : "Could not generate report."
|
|
140
|
+
});
|
|
141
|
+
} finally {
|
|
142
|
+
K(null);
|
|
143
|
+
}
|
|
144
|
+
}, $ = P.filter((e) => e.schedule);
|
|
145
|
+
return /* @__PURE__ */ w(u, {
|
|
146
|
+
title: "Reports",
|
|
147
|
+
subtitle: "Generate and schedule reports",
|
|
148
|
+
icon: /* @__PURE__ */ C(D, { size: 24 }),
|
|
149
|
+
headerActions: /* @__PURE__ */ w("div", {
|
|
150
|
+
className: "flex gap-2",
|
|
151
|
+
children: [/* @__PURE__ */ w(i, {
|
|
152
|
+
value: U,
|
|
153
|
+
onValueChange: W,
|
|
154
|
+
children: [/* @__PURE__ */ C(r, {
|
|
155
|
+
className: "w-[190px]",
|
|
156
|
+
children: /* @__PURE__ */ C(a, {})
|
|
157
|
+
}), /* @__PURE__ */ C(t, { children: j.map((e) => /* @__PURE__ */ C(n, {
|
|
158
|
+
value: e.value,
|
|
159
|
+
children: e.label
|
|
160
|
+
}, e.value)) })]
|
|
161
|
+
}), /* @__PURE__ */ w(f, {
|
|
162
|
+
onClick: () => void Q(),
|
|
163
|
+
disabled: q,
|
|
164
|
+
children: [/* @__PURE__ */ C(_, { size: 16 }), " Create Report"]
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ C(ne, {
|
|
169
|
+
icon: /* @__PURE__ */ C(D, { size: 18 }),
|
|
170
|
+
children: "Turn your operational data into shareable summaries. Generate one-off reports on orders, finance, fleet, customers or inventory, or schedule them to land in inboxes automatically — so stakeholders always have the latest numbers without logging in."
|
|
171
|
+
}),
|
|
172
|
+
Y && /* @__PURE__ */ C("div", {
|
|
173
|
+
role: "status",
|
|
174
|
+
className: `rounded-lg p-3 text-sm ${Y.tone === "success" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-error-bg-subtle text-status-error-text"}`,
|
|
175
|
+
children: Y.text
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ w("div", {
|
|
178
|
+
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
179
|
+
children: [/* @__PURE__ */ w("div", {
|
|
180
|
+
className: "lg:col-span-2 space-y-4",
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ C("h3", {
|
|
183
|
+
className: "font-semibold",
|
|
184
|
+
children: "Available Reports"
|
|
185
|
+
}),
|
|
186
|
+
I ? /* @__PURE__ */ C("div", {
|
|
187
|
+
className: "space-y-3",
|
|
188
|
+
children: Array.from({ length: 3 }).map((t, n) => /* @__PURE__ */ C(e, { className: "h-20 w-full rounded-lg" }, n))
|
|
189
|
+
}) : L ? /* @__PURE__ */ C(o, {
|
|
190
|
+
className: "border-status-error-border",
|
|
191
|
+
children: /* @__PURE__ */ w(s, {
|
|
192
|
+
className: "p-6 text-center space-y-3",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ C("p", {
|
|
195
|
+
className: "text-status-error-text font-medium",
|
|
196
|
+
children: "Couldn't load reports"
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ C("p", {
|
|
199
|
+
className: "text-sm text-text-secondary",
|
|
200
|
+
children: L.message
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ C(f, {
|
|
203
|
+
variant: "outline",
|
|
204
|
+
onClick: R,
|
|
205
|
+
children: "Retry"
|
|
206
|
+
})
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
}) : P.length === 0 ? /* @__PURE__ */ C(o, { children: /* @__PURE__ */ C(s, {
|
|
210
|
+
className: "p-0",
|
|
211
|
+
children: /* @__PURE__ */ C(E, {
|
|
212
|
+
illustration: "empty-data",
|
|
213
|
+
title: "No reports yet",
|
|
214
|
+
description: "Create your first report to turn live operational data into a shareable summary.",
|
|
215
|
+
action: /* @__PURE__ */ w(f, {
|
|
216
|
+
onClick: () => void Q(),
|
|
217
|
+
disabled: q,
|
|
218
|
+
children: [/* @__PURE__ */ C(_, {
|
|
219
|
+
size: 16,
|
|
220
|
+
className: "mr-1.5"
|
|
221
|
+
}), " Create Report"]
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
}) }) : P.map((e) => /* @__PURE__ */ C(o, { children: /* @__PURE__ */ C(s, {
|
|
225
|
+
className: "p-4",
|
|
226
|
+
children: /* @__PURE__ */ w("div", {
|
|
227
|
+
className: "flex items-center justify-between",
|
|
228
|
+
children: [/* @__PURE__ */ w("div", {
|
|
229
|
+
className: "flex items-center gap-3",
|
|
230
|
+
children: [/* @__PURE__ */ C("div", {
|
|
231
|
+
className: "w-10 h-10 rounded-lg bg-action-primary-bg/10 flex items-center justify-center",
|
|
232
|
+
children: /* @__PURE__ */ C(D, {
|
|
233
|
+
size: 20,
|
|
234
|
+
className: "text-primary"
|
|
235
|
+
})
|
|
236
|
+
}), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
|
|
237
|
+
className: "font-medium",
|
|
238
|
+
children: e.name
|
|
239
|
+
}), /* @__PURE__ */ C("p", {
|
|
240
|
+
className: "text-sm text-text-secondary",
|
|
241
|
+
children: e.description ?? Z(e.type)
|
|
242
|
+
})] })]
|
|
243
|
+
}), /* @__PURE__ */ w("div", {
|
|
244
|
+
className: "flex items-center gap-3",
|
|
245
|
+
children: [/* @__PURE__ */ w("div", {
|
|
246
|
+
className: "text-right",
|
|
247
|
+
children: [/* @__PURE__ */ C(d, {
|
|
248
|
+
variant: "outline",
|
|
249
|
+
children: e.schedule ?? "On demand"
|
|
250
|
+
}), e.lastGenerated && /* @__PURE__ */ w("p", {
|
|
251
|
+
className: "text-xs text-text-secondary mt-1",
|
|
252
|
+
children: ["Last: ", x(new Date(e.lastGenerated), "short")]
|
|
253
|
+
})]
|
|
254
|
+
}), /* @__PURE__ */ C(f, {
|
|
255
|
+
variant: "outline",
|
|
256
|
+
size: "sm",
|
|
257
|
+
"aria-label": `Generate ${e.name}`,
|
|
258
|
+
disabled: G === e.id,
|
|
259
|
+
onClick: () => void ae(e.id),
|
|
260
|
+
children: /* @__PURE__ */ C(te, { size: 14 })
|
|
261
|
+
})]
|
|
262
|
+
})]
|
|
263
|
+
})
|
|
264
|
+
}) }, e.id)),
|
|
265
|
+
!I && !L && (P.length > 0 || p > 0) && /* @__PURE__ */ w("div", {
|
|
266
|
+
className: "flex flex-wrap items-center justify-between gap-3 pt-1",
|
|
267
|
+
children: [/* @__PURE__ */ w("span", {
|
|
268
|
+
className: "text-sm text-text-secondary",
|
|
269
|
+
children: [
|
|
270
|
+
"Showing ",
|
|
271
|
+
P.length === 0 ? 0 : p * M + 1,
|
|
272
|
+
" to",
|
|
273
|
+
" ",
|
|
274
|
+
p * M + P.length
|
|
275
|
+
]
|
|
276
|
+
}), /* @__PURE__ */ w("div", {
|
|
277
|
+
className: "flex items-center gap-1",
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ C(f, {
|
|
280
|
+
variant: "outline",
|
|
281
|
+
size: "icon",
|
|
282
|
+
className: "h-8 w-8",
|
|
283
|
+
"aria-label": "Previous page",
|
|
284
|
+
onClick: () => N((e) => Math.max(0, e - 1)),
|
|
285
|
+
disabled: p === 0,
|
|
286
|
+
children: /* @__PURE__ */ C(m, { className: "h-4 w-4" })
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ w("span", {
|
|
289
|
+
className: "px-3 text-sm",
|
|
290
|
+
children: ["Page ", p + 1]
|
|
291
|
+
}),
|
|
292
|
+
/* @__PURE__ */ C(f, {
|
|
293
|
+
variant: "outline",
|
|
294
|
+
size: "icon",
|
|
295
|
+
className: "h-8 w-8",
|
|
296
|
+
"aria-label": "Next page",
|
|
297
|
+
onClick: () => N((e) => e + 1),
|
|
298
|
+
disabled: !F,
|
|
299
|
+
children: /* @__PURE__ */ C(h, { className: "h-4 w-4" })
|
|
300
|
+
})
|
|
301
|
+
]
|
|
302
|
+
})]
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
}), /* @__PURE__ */ w("div", {
|
|
306
|
+
className: "space-y-6",
|
|
307
|
+
children: [
|
|
308
|
+
/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(c, {
|
|
309
|
+
className: "text-base",
|
|
310
|
+
children: "Data preview"
|
|
311
|
+
}) }), /* @__PURE__ */ w(s, { children: [/* @__PURE__ */ C("p", {
|
|
312
|
+
className: "mb-2 text-xs text-text-secondary",
|
|
313
|
+
children: "Order volume · last 7 days"
|
|
314
|
+
}), /* @__PURE__ */ C(v, {
|
|
315
|
+
xKey: "date",
|
|
316
|
+
height: 160,
|
|
317
|
+
showLegend: !1,
|
|
318
|
+
data: H,
|
|
319
|
+
series: [{
|
|
320
|
+
dataKey: "orders",
|
|
321
|
+
name: "Orders"
|
|
322
|
+
}],
|
|
323
|
+
emptyMessage: "No order data to preview yet"
|
|
324
|
+
})] })] }),
|
|
325
|
+
/* @__PURE__ */ w(T, {
|
|
326
|
+
className: "space-y-3",
|
|
327
|
+
children: [
|
|
328
|
+
/* @__PURE__ */ w("h2", {
|
|
329
|
+
className: "flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
330
|
+
children: [/* @__PURE__ */ C(ee, { size: 18 }), " Scheduled Reports"]
|
|
331
|
+
}),
|
|
332
|
+
$.length === 0 ? /* @__PURE__ */ C("p", {
|
|
333
|
+
className: "text-sm text-text-secondary",
|
|
334
|
+
children: "No scheduled reports yet. Schedule one to have it generated automatically."
|
|
335
|
+
}) : $.map((e) => /* @__PURE__ */ w("div", {
|
|
336
|
+
className: "p-3 border border-border-seam rounded-lg",
|
|
337
|
+
children: [/* @__PURE__ */ C("p", {
|
|
338
|
+
className: "font-medium",
|
|
339
|
+
children: e.name
|
|
340
|
+
}), /* @__PURE__ */ w("p", {
|
|
341
|
+
className: "text-sm text-text-secondary",
|
|
342
|
+
children: ["Schedule: ", e.schedule]
|
|
343
|
+
})]
|
|
344
|
+
}, e.id)),
|
|
345
|
+
/* @__PURE__ */ C(f, {
|
|
346
|
+
variant: "outline",
|
|
347
|
+
className: "w-full",
|
|
348
|
+
disabled: q,
|
|
349
|
+
onClick: () => void Q("daily"),
|
|
350
|
+
children: "Schedule New Report"
|
|
351
|
+
})
|
|
352
|
+
]
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ w(o, { children: [/* @__PURE__ */ C(l, { children: /* @__PURE__ */ C(c, { children: "Quick Actions" }) }), /* @__PURE__ */ w(s, {
|
|
355
|
+
className: "space-y-2",
|
|
356
|
+
children: [/* @__PURE__ */ w(f, {
|
|
357
|
+
variant: "outline",
|
|
358
|
+
className: "w-full justify-start",
|
|
359
|
+
disabled: q,
|
|
360
|
+
onClick: () => void Q("weekly"),
|
|
361
|
+
children: [/* @__PURE__ */ C(re, { size: 16 }), " Schedule Report"]
|
|
362
|
+
}), /* @__PURE__ */ w(f, {
|
|
363
|
+
variant: "outline",
|
|
364
|
+
className: "w-full justify-start",
|
|
365
|
+
disabled: q,
|
|
366
|
+
onClick: () => void Q(),
|
|
367
|
+
children: [/* @__PURE__ */ C(g, { size: 16 }), " Custom Report"]
|
|
368
|
+
})]
|
|
369
|
+
})] })
|
|
370
|
+
]
|
|
371
|
+
})]
|
|
372
|
+
})
|
|
373
|
+
]
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
//#endregion
|
|
377
|
+
export { N as default };
|