@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CarbonFootprintPanel.js +1 -1
- package/dist/components/CustomerPicker.js +271 -0
- package/dist/components/DataTable.js +140 -139
- package/dist/components/DocumentsCard.js +14 -8
- package/dist/generated/wspace-types.d.ts +1043 -5
- package/dist/hooks/useAnalytics.js +21 -1
- package/dist/hooks/useCustomers.js +94 -78
- package/dist/hooks/useDebouncedValue.js +11 -0
- package/dist/hooks/useEntityDocuments.js +28 -18
- package/dist/hooks/useEpod.js +24 -17
- package/dist/hooks/useFleet.js +146 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +73 -73
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
- package/dist/movethewheels/components/DataTable.d.ts +5 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
- package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
- package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +7 -5
- package/dist/movethewheels/utils/navigation.d.ts +14 -0
- package/dist/pages/CreateOrderPage.js +228 -217
- package/dist/pages/CustomerDetailsPage.js +220 -220
- package/dist/pages/CustomersPage.js +61 -54
- package/dist/pages/DeliveryCapturePage.js +131 -109
- package/dist/pages/DriversPage.js +100 -92
- package/dist/pages/InventoryPage.js +239 -236
- package/dist/pages/MultiModalShipmentPage.js +163 -130
- package/dist/pages/OrderDetailsPage.js +224 -208
- package/dist/pages/OrdersListPage.js +66 -60
- package/dist/pages/ProductDetailsPage.js +241 -200
- package/dist/pages/ProductsPage.js +59 -52
- package/dist/pages/RouteDetailsPage.js +343 -321
- package/dist/pages/RoutesPage.js +55 -48
- package/dist/pages/VehiclesPage.js +63 -56
- package/dist/pages/WarehousesPage.js +60 -53
- package/dist/utils/navigation.js +22 -1
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +1188 -5
- package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
- package/src/movethewheels/components/CustomerPicker.tsx +321 -0
- package/src/movethewheels/components/DataTable.tsx +34 -18
- package/src/movethewheels/components/DocumentsCard.tsx +6 -1
- package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
- package/src/movethewheels/hooks/useAnalytics.ts +27 -0
- package/src/movethewheels/hooks/useCustomers.ts +64 -24
- package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
- package/src/movethewheels/hooks/useEpod.ts +14 -7
- package/src/movethewheels/hooks/useFleet.ts +58 -37
- package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
- package/src/movethewheels/hooks/useInventory.ts +211 -90
- package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
- package/src/movethewheels/hooks/useOrders.ts +13 -14
- package/src/movethewheels/hooks/useRoutes.ts +80 -23
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
- package/src/movethewheels/pages/CustomersPage.tsx +11 -1
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
- package/src/movethewheels/pages/DriversPage.tsx +24 -12
- package/src/movethewheels/pages/InventoryPage.tsx +57 -32
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
- package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
- package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
- package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
- package/src/movethewheels/pages/ProductsPage.tsx +11 -1
- package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
- package/src/movethewheels/pages/RoutesPage.tsx +11 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
- package/src/movethewheels/types/index.ts +7 -5
- package/src/movethewheels/utils/navigation.ts +32 -0
|
@@ -9,56 +9,57 @@ import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/ref
|
|
|
9
9
|
import { Search as te } from "../node_modules/lucide-react/dist/esm/icons/search.js";
|
|
10
10
|
import { TriangleAlert as ne } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
|
|
11
11
|
import { cn as s } from "../utils/cn.js";
|
|
12
|
-
import { Button as c, Input as re, Select as ie, SelectContent as ae, SelectItem as oe, SelectTrigger as se, SelectValue as ce, Skeleton as l, Table as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { IllustratedEmptyState as
|
|
12
|
+
import { Button as c, Input as re, Select as ie, SelectContent as ae, SelectItem as oe, SelectTrigger as se, SelectValue as ce, Skeleton as l, Table as u, TableBody as d, TableCell as f, TableHead as p, TableHeader as m, TableRow as h } from "./ui.js";
|
|
13
|
+
import { useMemo as g, useState as _ } from "react";
|
|
14
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
|
+
import { IllustratedEmptyState as b } from "@burdenoff/fe-libs/ui";
|
|
16
16
|
//#region src/movethewheels/components/DataTable.tsx
|
|
17
|
-
function
|
|
17
|
+
function x({ columns: x, data: S, isLoading: le = !1, error: ue = null, onRetry: de, searchable: fe = !1, searchPlaceholder: pe = "Search...", searchFields: C, searchQuery: me, onSearchQueryChange: w, pagination: T = !0, pageSize: E = 10, pageSizeOptions: he = [
|
|
18
18
|
10,
|
|
19
19
|
25,
|
|
20
20
|
50,
|
|
21
21
|
100
|
|
22
|
-
], onRowClick: D, rowClassName: O, emptyMessage: k = "No data found", emptyIllustration: A, emptyTitle:
|
|
23
|
-
let F = typeof N == "function", I =
|
|
24
|
-
if (
|
|
25
|
-
let e =
|
|
26
|
-
return
|
|
22
|
+
], onRowClick: D, rowClassName: O, emptyMessage: k = "No data found", emptyIllustration: A, emptyTitle: ge, emptyDescription: _e, emptyAction: ve, className: j, getRowId: M, pageIndex: ye, onPageChange: N, onPageSizeChange: be, totalItems: P, hasNextPage: xe }) {
|
|
23
|
+
let F = typeof N == "function", I = ye ?? 0, [Se, Ce] = _(""), L = typeof w == "function", R = L ? me ?? "" : Se, [z, B] = _(null), [V, H] = _(null), [U, W] = _(1), [G, we] = _(E), K = F ? E : G, q = g(() => {
|
|
24
|
+
if (L || !R || !C || C.length === 0) return S;
|
|
25
|
+
let e = R.toLowerCase();
|
|
26
|
+
return S.filter((t) => C.some((n) => {
|
|
27
27
|
let r = t[n];
|
|
28
28
|
return r != null && String(r).toLowerCase().includes(e);
|
|
29
29
|
}));
|
|
30
30
|
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
S,
|
|
32
|
+
R,
|
|
33
|
+
C,
|
|
34
|
+
L
|
|
35
|
+
]), J = g(() => {
|
|
36
|
+
if (F || !z || !V) return q;
|
|
37
|
+
let e = x.find((e) => e.id === z);
|
|
38
|
+
return e?.accessorKey ? [...q].sort((t, n) => {
|
|
38
39
|
let r = t[e.accessorKey], i = n[e.accessorKey];
|
|
39
40
|
if (r == null) return 1;
|
|
40
41
|
if (i == null) return -1;
|
|
41
42
|
let a = 0;
|
|
42
|
-
return a = typeof r == "string" && typeof i == "string" ? r.localeCompare(i) : typeof r == "number" && typeof i == "number" ? r - i : r instanceof Date && i instanceof Date ? r.getTime() - i.getTime() : String(r).localeCompare(String(i)),
|
|
43
|
-
}) :
|
|
44
|
-
}, [
|
|
45
|
-
K,
|
|
46
|
-
R,
|
|
47
|
-
B,
|
|
48
|
-
b
|
|
49
|
-
]), J = h(() => {
|
|
50
|
-
if (!T || F) return q;
|
|
51
|
-
let e = (H - 1) * W;
|
|
52
|
-
return q.slice(e, e + W);
|
|
43
|
+
return a = typeof r == "string" && typeof i == "string" ? r.localeCompare(i) : typeof r == "number" && typeof i == "number" ? r - i : r instanceof Date && i instanceof Date ? r.getTime() - i.getTime() : String(r).localeCompare(String(i)), V === "asc" ? a : -a;
|
|
44
|
+
}) : q;
|
|
53
45
|
}, [
|
|
54
46
|
q,
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
z,
|
|
48
|
+
V,
|
|
49
|
+
x
|
|
50
|
+
]), Y = g(() => {
|
|
51
|
+
if (!T || F) return J;
|
|
52
|
+
let e = (U - 1) * G;
|
|
53
|
+
return J.slice(e, e + G);
|
|
54
|
+
}, [
|
|
55
|
+
J,
|
|
56
|
+
U,
|
|
57
|
+
G,
|
|
57
58
|
T,
|
|
58
59
|
F
|
|
59
|
-
]),
|
|
60
|
-
|
|
61
|
-
},
|
|
60
|
+
]), X = Math.max(1, Math.ceil(J.length / G)), Z = typeof P == "number", Q = Z ? Math.max(1, Math.ceil(P / K)) : void 0, Te = (e) => {
|
|
61
|
+
F || (z === e ? V === "asc" ? H("desc") : V === "desc" && (B(null), H(null)) : (B(e), H("asc")));
|
|
62
|
+
}, Ee = (r) => z === r ? v(V === "asc" ? n : e, { className: "w-4 h-4 text-primary" }) : /* @__PURE__ */ v(t, { className: "w-4 h-4 text-text-secondary/50" }), De = (e, t) => {
|
|
62
63
|
if (t.cell) return t.cell(e);
|
|
63
64
|
if (t.accessorKey) {
|
|
64
65
|
let n = e[t.accessorKey];
|
|
@@ -66,116 +67,116 @@ function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry:
|
|
|
66
67
|
}
|
|
67
68
|
return "-";
|
|
68
69
|
};
|
|
69
|
-
if (
|
|
70
|
+
if (le) return /* @__PURE__ */ y("div", {
|
|
70
71
|
className: s("space-y-4", j),
|
|
71
72
|
children: [
|
|
72
|
-
|
|
73
|
+
fe && /* @__PURE__ */ v("div", {
|
|
73
74
|
className: "flex items-center gap-4",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ v(l, { className: "h-10 w-64" })
|
|
75
76
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ v("div", {
|
|
77
78
|
className: "hidden md:block rounded-card border border-border-seam bg-bg-surface shadow-elevation-1",
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ y(u, { children: [/* @__PURE__ */ v(m, { children: /* @__PURE__ */ v(h, { children: x.map((e) => /* @__PURE__ */ v(p, { children: /* @__PURE__ */ v(l, { className: "h-4 w-20 motion-safe:animate-vc-shimmer" }) }, e.id)) }) }), /* @__PURE__ */ v(d, { children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ v(h, { children: x.map((e) => /* @__PURE__ */ v(f, { children: /* @__PURE__ */ v(l, { className: "h-4 w-full max-w-[100px] motion-safe:animate-vc-shimmer" }) }, e.id)) }, t)) })] })
|
|
79
80
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ v("div", {
|
|
81
82
|
className: "md:hidden space-y-3",
|
|
82
|
-
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */
|
|
83
|
+
children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ y("div", {
|
|
83
84
|
className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-elevation-1",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ v(l, { className: "h-4 w-2/3 mb-2 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ v(l, { className: "h-4 w-1/2 motion-safe:animate-vc-shimmer" })]
|
|
85
86
|
}, t))
|
|
86
87
|
})
|
|
87
88
|
]
|
|
88
89
|
});
|
|
89
|
-
if (
|
|
90
|
+
if (ue && S.length === 0) return /* @__PURE__ */ y("div", {
|
|
90
91
|
className: s("flex flex-col items-center justify-center gap-3 rounded-card border border-border-seam bg-bg-surface px-6 py-14 text-center shadow-elevation-1", j),
|
|
91
92
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ v("div", {
|
|
93
94
|
className: "flex h-12 w-12 items-center justify-center rounded-full bg-status-error-bg text-status-error-text",
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ v(ne, { size: 22 })
|
|
95
96
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ v("p", {
|
|
97
98
|
className: "text-base font-medium text-text-primary",
|
|
98
99
|
children: "Couldn’t load this list"
|
|
99
100
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ v("p", {
|
|
101
102
|
className: "max-w-sm text-sm text-text-secondary",
|
|
102
103
|
children: "The service was briefly unreachable. This is usually momentary — try again."
|
|
103
104
|
}),
|
|
104
|
-
|
|
105
|
+
de && /* @__PURE__ */ y(c, {
|
|
105
106
|
variant: "outline",
|
|
106
107
|
size: "sm",
|
|
107
|
-
onClick:
|
|
108
|
+
onClick: de,
|
|
108
109
|
className: "mt-1",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
110
|
+
children: [/* @__PURE__ */ v(ee, {
|
|
110
111
|
size: 14,
|
|
111
112
|
className: "mr-1.5"
|
|
112
113
|
}), "Retry"]
|
|
113
114
|
})
|
|
114
115
|
]
|
|
115
116
|
});
|
|
116
|
-
let
|
|
117
|
+
let Oe = Y.length === 0, $ = () => A ? R ? /* @__PURE__ */ v(b, {
|
|
117
118
|
illustration: "empty-search",
|
|
118
119
|
title: "No matches",
|
|
119
|
-
description: `Nothing matches “${
|
|
120
|
-
}) : /* @__PURE__ */
|
|
120
|
+
description: `Nothing matches “${R}”. Try a different search.`
|
|
121
|
+
}) : /* @__PURE__ */ v(b, {
|
|
121
122
|
illustration: A,
|
|
122
|
-
title:
|
|
123
|
-
description:
|
|
124
|
-
action:
|
|
125
|
-
}) : /* @__PURE__ */
|
|
123
|
+
title: ge ?? k,
|
|
124
|
+
description: _e,
|
|
125
|
+
action: ve
|
|
126
|
+
}) : /* @__PURE__ */ v("p", {
|
|
126
127
|
className: "text-text-secondary",
|
|
127
128
|
children: k
|
|
128
|
-
}),
|
|
129
|
-
return /* @__PURE__ */
|
|
129
|
+
}), ke = T && (F ? J.length > 0 || I > 0 : J.length > 0);
|
|
130
|
+
return /* @__PURE__ */ y("div", {
|
|
130
131
|
className: s("space-y-4", j),
|
|
131
132
|
children: [
|
|
132
|
-
|
|
133
|
+
fe && /* @__PURE__ */ v("div", {
|
|
133
134
|
className: "flex items-center gap-4",
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ y("div", {
|
|
135
136
|
className: "relative flex-1 max-w-sm",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
137
|
-
placeholder:
|
|
138
|
-
value:
|
|
137
|
+
children: [/* @__PURE__ */ v(te, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-secondary" }), /* @__PURE__ */ v(re, {
|
|
138
|
+
placeholder: pe,
|
|
139
|
+
value: R,
|
|
139
140
|
onChange: (e) => {
|
|
140
|
-
|
|
141
|
+
L ? w?.(e.target.value) : (Ce(e.target.value), W(1));
|
|
141
142
|
},
|
|
142
143
|
className: "pl-9"
|
|
143
144
|
})]
|
|
144
145
|
})
|
|
145
146
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ v("div", {
|
|
147
148
|
className: "hidden md:block overflow-x-auto rounded-card border border-border-seam bg-bg-surface shadow-elevation-1",
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
className: s(e.sortable && "cursor-pointer select-none hover:bg-bg-sunken/50", e.headerClassName),
|
|
150
|
-
onClick: () => e.sortable &&
|
|
151
|
-
children: /* @__PURE__ */
|
|
149
|
+
children: /* @__PURE__ */ y(u, { children: [/* @__PURE__ */ v(m, { children: /* @__PURE__ */ v(h, { children: x.map((e) => /* @__PURE__ */ v(p, {
|
|
150
|
+
className: s(!F && e.sortable && "cursor-pointer select-none hover:bg-bg-sunken/50", e.headerClassName),
|
|
151
|
+
onClick: () => !F && e.sortable && Te(e.id),
|
|
152
|
+
children: /* @__PURE__ */ y("div", {
|
|
152
153
|
className: "flex items-center gap-2",
|
|
153
|
-
children: [e.header, e.sortable &&
|
|
154
|
+
children: [e.header, !F && e.sortable && Ee(e.id)]
|
|
154
155
|
})
|
|
155
|
-
}, e.id)) }) }), /* @__PURE__ */
|
|
156
|
-
colSpan:
|
|
156
|
+
}, e.id)) }) }), /* @__PURE__ */ v(d, { children: Oe ? /* @__PURE__ */ v(h, { children: /* @__PURE__ */ v(f, {
|
|
157
|
+
colSpan: x.length,
|
|
157
158
|
className: "py-8 text-center",
|
|
158
|
-
children:
|
|
159
|
-
}) }) :
|
|
159
|
+
children: $()
|
|
160
|
+
}) }) : Y.map((e, t) => {
|
|
160
161
|
let n = M ? M(e) : t, r = typeof O == "function" ? O(e) : O;
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ v(h, {
|
|
162
163
|
className: s(D && "cursor-pointer hover:bg-bg-sunken/50", r),
|
|
163
164
|
onClick: () => D?.(e),
|
|
164
|
-
children:
|
|
165
|
+
children: x.map((t) => /* @__PURE__ */ v(f, {
|
|
165
166
|
className: t.className,
|
|
166
|
-
children:
|
|
167
|
+
children: De(e, t)
|
|
167
168
|
}, t.id))
|
|
168
169
|
}, n);
|
|
169
170
|
}) })] })
|
|
170
171
|
}),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ v("div", {
|
|
172
173
|
className: "md:hidden space-y-3",
|
|
173
|
-
children:
|
|
174
|
+
children: Oe ? /* @__PURE__ */ v("div", {
|
|
174
175
|
className: "rounded-card border border-border-seam bg-bg-surface p-6 text-center shadow-elevation-1",
|
|
175
|
-
children:
|
|
176
|
-
}) :
|
|
176
|
+
children: $()
|
|
177
|
+
}) : Y.map((e, t) => {
|
|
177
178
|
let n = M ? M(e) : t, r = typeof O == "function" ? O(e) : O;
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
+
return /* @__PURE__ */ v("div", {
|
|
179
180
|
role: D ? "button" : void 0,
|
|
180
181
|
tabIndex: D ? 0 : void 0,
|
|
181
182
|
className: s("rounded-card border border-border-seam bg-bg-surface p-4 shadow-elevation-1", D && "cursor-pointer hover:bg-bg-sunken/50", r),
|
|
@@ -183,154 +184,154 @@ function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry:
|
|
|
183
184
|
onKeyDown: (t) => {
|
|
184
185
|
D && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), D(e));
|
|
185
186
|
},
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ v("dl", {
|
|
187
188
|
className: "space-y-2",
|
|
188
|
-
children:
|
|
189
|
+
children: x.map((t) => /* @__PURE__ */ y("div", {
|
|
189
190
|
className: "flex items-start justify-between gap-3",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
191
|
+
children: [/* @__PURE__ */ v("dt", {
|
|
191
192
|
className: "text-xs font-medium text-text-secondary shrink-0",
|
|
192
193
|
children: t.header
|
|
193
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ v("dd", {
|
|
194
195
|
className: "text-sm text-right min-w-0",
|
|
195
|
-
children:
|
|
196
|
+
children: De(e, t)
|
|
196
197
|
})]
|
|
197
198
|
}, t.id))
|
|
198
199
|
})
|
|
199
200
|
}, n);
|
|
200
201
|
})
|
|
201
202
|
}),
|
|
202
|
-
|
|
203
|
+
ke && /* @__PURE__ */ y("div", {
|
|
203
204
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ y("div", {
|
|
205
206
|
className: "flex flex-wrap items-center gap-2 text-sm text-text-secondary",
|
|
206
207
|
children: [
|
|
207
|
-
F ? /* @__PURE__ */
|
|
208
|
+
F ? /* @__PURE__ */ y("span", { children: [
|
|
208
209
|
"Showing ",
|
|
209
|
-
|
|
210
|
+
J.length === 0 ? 0 : I * K + 1,
|
|
210
211
|
" to",
|
|
211
212
|
" ",
|
|
212
|
-
I *
|
|
213
|
-
|
|
214
|
-
] }) : /* @__PURE__ */
|
|
213
|
+
I * K + J.length,
|
|
214
|
+
Z ? ` of ${P}` : ""
|
|
215
|
+
] }) : /* @__PURE__ */ y("span", { children: [
|
|
215
216
|
"Showing ",
|
|
216
|
-
(
|
|
217
|
+
(U - 1) * G + 1,
|
|
217
218
|
" to",
|
|
218
219
|
" ",
|
|
219
|
-
Math.min(
|
|
220
|
+
Math.min(U * G, J.length),
|
|
220
221
|
" of ",
|
|
221
|
-
|
|
222
|
+
J.length
|
|
222
223
|
] }),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
value: String(
|
|
224
|
+
/* @__PURE__ */ y(ie, {
|
|
225
|
+
value: String(K),
|
|
225
226
|
onValueChange: (e) => {
|
|
226
227
|
let t = Number(e);
|
|
227
|
-
F ?
|
|
228
|
+
F ? be?.(t) : (we(t), W(1));
|
|
228
229
|
},
|
|
229
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ v(se, {
|
|
230
231
|
className: "w-[70px] h-8",
|
|
231
|
-
children: /* @__PURE__ */
|
|
232
|
-
}), /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ v(ce, {})
|
|
233
|
+
}), /* @__PURE__ */ v(ae, { children: he.map((e) => /* @__PURE__ */ v(oe, {
|
|
233
234
|
value: String(e),
|
|
234
235
|
children: e
|
|
235
236
|
}, e)) })]
|
|
236
237
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ v("span", { children: "per page" })
|
|
238
239
|
]
|
|
239
|
-
}), F ? /* @__PURE__ */
|
|
240
|
+
}), F ? /* @__PURE__ */ y("div", {
|
|
240
241
|
className: "flex items-center gap-1",
|
|
241
242
|
children: [
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ v(c, {
|
|
243
244
|
variant: "outline",
|
|
244
245
|
size: "icon",
|
|
245
246
|
className: "h-8 w-8",
|
|
246
247
|
"aria-label": "First page",
|
|
247
248
|
onClick: () => N?.(0),
|
|
248
249
|
disabled: I === 0,
|
|
249
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ v(a, { className: "h-4 w-4" })
|
|
250
251
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ v(c, {
|
|
252
253
|
variant: "outline",
|
|
253
254
|
size: "icon",
|
|
254
255
|
className: "h-8 w-8",
|
|
255
256
|
"aria-label": "Previous page",
|
|
256
257
|
onClick: () => N?.(Math.max(0, I - 1)),
|
|
257
258
|
disabled: I === 0,
|
|
258
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ v(r, { className: "h-4 w-4" })
|
|
259
260
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ y("span", {
|
|
261
262
|
className: "px-3 text-sm",
|
|
262
263
|
children: [
|
|
263
264
|
"Page ",
|
|
264
265
|
I + 1,
|
|
265
|
-
|
|
266
|
+
Z ? ` of ${Q}` : ""
|
|
266
267
|
]
|
|
267
268
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ v(c, {
|
|
269
270
|
variant: "outline",
|
|
270
271
|
size: "icon",
|
|
271
272
|
className: "h-8 w-8",
|
|
272
273
|
"aria-label": "Next page",
|
|
273
274
|
onClick: () => N?.(I + 1),
|
|
274
|
-
disabled:
|
|
275
|
-
children: /* @__PURE__ */
|
|
275
|
+
disabled: Z ? I + 1 >= (Q ?? 1) : !xe,
|
|
276
|
+
children: /* @__PURE__ */ v(i, { className: "h-4 w-4" })
|
|
276
277
|
}),
|
|
277
|
-
|
|
278
|
+
Z && /* @__PURE__ */ v(c, {
|
|
278
279
|
variant: "outline",
|
|
279
280
|
size: "icon",
|
|
280
281
|
className: "h-8 w-8",
|
|
281
282
|
"aria-label": "Last page",
|
|
282
|
-
onClick: () => N?.((
|
|
283
|
-
disabled: I + 1 >= (
|
|
284
|
-
children: /* @__PURE__ */
|
|
283
|
+
onClick: () => N?.((Q ?? 1) - 1),
|
|
284
|
+
disabled: I + 1 >= (Q ?? 1),
|
|
285
|
+
children: /* @__PURE__ */ v(o, { className: "h-4 w-4" })
|
|
285
286
|
})
|
|
286
287
|
]
|
|
287
|
-
}) : /* @__PURE__ */
|
|
288
|
+
}) : /* @__PURE__ */ y("div", {
|
|
288
289
|
className: "flex items-center gap-1",
|
|
289
290
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ v(c, {
|
|
291
292
|
variant: "outline",
|
|
292
293
|
size: "icon",
|
|
293
294
|
className: "h-8 w-8",
|
|
294
295
|
"aria-label": "First page",
|
|
295
|
-
onClick: () =>
|
|
296
|
-
disabled:
|
|
297
|
-
children: /* @__PURE__ */
|
|
296
|
+
onClick: () => W(1),
|
|
297
|
+
disabled: U === 1,
|
|
298
|
+
children: /* @__PURE__ */ v(a, { className: "h-4 w-4" })
|
|
298
299
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ v(c, {
|
|
300
301
|
variant: "outline",
|
|
301
302
|
size: "icon",
|
|
302
303
|
className: "h-8 w-8",
|
|
303
304
|
"aria-label": "Previous page",
|
|
304
|
-
onClick: () =>
|
|
305
|
-
disabled:
|
|
306
|
-
children: /* @__PURE__ */
|
|
305
|
+
onClick: () => W((e) => Math.max(1, e - 1)),
|
|
306
|
+
disabled: U === 1,
|
|
307
|
+
children: /* @__PURE__ */ v(r, { className: "h-4 w-4" })
|
|
307
308
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ y("span", {
|
|
309
310
|
className: "px-3 text-sm",
|
|
310
311
|
children: [
|
|
311
312
|
"Page ",
|
|
312
|
-
|
|
313
|
+
U,
|
|
313
314
|
" of ",
|
|
314
|
-
|
|
315
|
+
X
|
|
315
316
|
]
|
|
316
317
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ v(c, {
|
|
318
319
|
variant: "outline",
|
|
319
320
|
size: "icon",
|
|
320
321
|
className: "h-8 w-8",
|
|
321
322
|
"aria-label": "Next page",
|
|
322
|
-
onClick: () =>
|
|
323
|
-
disabled:
|
|
324
|
-
children: /* @__PURE__ */
|
|
323
|
+
onClick: () => W((e) => Math.min(X, e + 1)),
|
|
324
|
+
disabled: U === X,
|
|
325
|
+
children: /* @__PURE__ */ v(i, { className: "h-4 w-4" })
|
|
325
326
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ v(c, {
|
|
327
328
|
variant: "outline",
|
|
328
329
|
size: "icon",
|
|
329
330
|
className: "h-8 w-8",
|
|
330
331
|
"aria-label": "Last page",
|
|
331
|
-
onClick: () =>
|
|
332
|
-
disabled:
|
|
333
|
-
children: /* @__PURE__ */
|
|
332
|
+
onClick: () => W(X),
|
|
333
|
+
disabled: U === X,
|
|
334
|
+
children: /* @__PURE__ */ v(o, { className: "h-4 w-4" })
|
|
334
335
|
})
|
|
335
336
|
]
|
|
336
337
|
})]
|
|
@@ -339,4 +340,4 @@ function b({ columns: b, data: x, isLoading: ue = !1, error: de = null, onRetry:
|
|
|
339
340
|
});
|
|
340
341
|
}
|
|
341
342
|
//#endregion
|
|
342
|
-
export {
|
|
343
|
+
export { x as DataTable };
|
|
@@ -20,7 +20,7 @@ function m(e) {
|
|
|
20
20
|
return `${n.toFixed(n >= 10 || r === 0 ? 0 : 1)} ${t[r]}`;
|
|
21
21
|
}
|
|
22
22
|
function h({ entityType: h, entityId: g }) {
|
|
23
|
-
let { navigate: _ } = i(), { documents: v,
|
|
23
|
+
let { navigate: _ } = i(), { documents: v, hasMore: y, isLoading: b, loadMore: x } = a(h, g), S = () => _("/files/browse");
|
|
24
24
|
return /* @__PURE__ */ p(s, { children: [/* @__PURE__ */ p(l, {
|
|
25
25
|
className: "flex flex-row items-center justify-between",
|
|
26
26
|
children: [/* @__PURE__ */ p(u, {
|
|
@@ -29,15 +29,15 @@ function h({ entityType: h, entityId: g }) {
|
|
|
29
29
|
}), /* @__PURE__ */ p(o, {
|
|
30
30
|
variant: "outline",
|
|
31
31
|
size: "sm",
|
|
32
|
-
onClick:
|
|
32
|
+
onClick: S,
|
|
33
33
|
children: [/* @__PURE__ */ f(r, { size: 14 }), " Add / Manage"]
|
|
34
34
|
})]
|
|
35
|
-
}), /* @__PURE__ */ f(c, { children:
|
|
35
|
+
}), /* @__PURE__ */ f(c, { children: b ? /* @__PURE__ */ f("p", {
|
|
36
36
|
className: "text-text-secondary text-center py-4",
|
|
37
37
|
children: "Loading documents…"
|
|
38
|
-
}) : v.length > 0 ? /* @__PURE__ */
|
|
38
|
+
}) : v.length > 0 ? /* @__PURE__ */ p("div", {
|
|
39
39
|
className: "space-y-3",
|
|
40
|
-
children: v.map((n) => /* @__PURE__ */ p("div", {
|
|
40
|
+
children: [v.map((n) => /* @__PURE__ */ p("div", {
|
|
41
41
|
className: "flex items-center justify-between gap-3 p-3 border rounded-lg",
|
|
42
42
|
children: [/* @__PURE__ */ p("div", {
|
|
43
43
|
className: "min-w-0",
|
|
@@ -61,10 +61,16 @@ function h({ entityType: h, entityId: g }) {
|
|
|
61
61
|
}) : /* @__PURE__ */ p(o, {
|
|
62
62
|
variant: "ghost",
|
|
63
63
|
size: "sm",
|
|
64
|
-
onClick:
|
|
64
|
+
onClick: S,
|
|
65
65
|
children: [/* @__PURE__ */ f(t, { size: 14 }), " View"]
|
|
66
66
|
})]
|
|
67
|
-
}, n.id))
|
|
67
|
+
}, n.id)), y && /* @__PURE__ */ f(o, {
|
|
68
|
+
variant: "outline",
|
|
69
|
+
size: "sm",
|
|
70
|
+
onClick: x,
|
|
71
|
+
disabled: b,
|
|
72
|
+
children: "Load more documents"
|
|
73
|
+
})]
|
|
68
74
|
}) : /* @__PURE__ */ p("div", {
|
|
69
75
|
className: "text-center py-6",
|
|
70
76
|
children: [
|
|
@@ -78,7 +84,7 @@ function h({ entityType: h, entityId: g }) {
|
|
|
78
84
|
}),
|
|
79
85
|
/* @__PURE__ */ f("button", {
|
|
80
86
|
type: "button",
|
|
81
|
-
onClick:
|
|
87
|
+
onClick: S,
|
|
82
88
|
className: "mt-1 text-sm text-primary hover:underline",
|
|
83
89
|
children: "Add them in Files"
|
|
84
90
|
})
|