@kareemelbalshe/any-table 1.0.2 → 1.0.4
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/FUTURE_ROADMAP.md +226 -0
- package/README.md +103 -8
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/legacyActionsAdapter.d.ts +20 -0
- package/dist/components/AnyTable.d.ts +5 -2
- package/dist/components/TableBody.d.ts +5 -1
- package/dist/components/TableConfirmDialog.d.ts +1 -1
- package/dist/components/TableEmptyState.d.ts +2 -1
- package/dist/components/TableErrorState.d.ts +1 -1
- package/dist/components/TableHeader.d.ts +2 -1
- package/dist/components/TablePagination.d.ts +1 -1
- package/dist/components/TableSearch.d.ts +1 -1
- package/dist/components/TableSkeleton.d.ts +1 -1
- package/dist/components/TableToolbar.d.ts +16 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useAnyTableController.d.ts +2 -1
- package/dist/hooks/useAnyTableData.d.ts +2 -1
- package/dist/hooks/useAnyTableSelection.d.ts +15 -0
- package/dist/hooks/useAnyTableVirtualizer.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1694 -1494
- package/dist/index.js.map +1 -1
- package/dist/renderers/ActionRenderer.d.ts +1 -1
- package/dist/renderers/CellRenderer.d.ts +1 -1
- package/dist/renderers/DefaultRenderers.d.ts +20 -59
- package/dist/style.css +1 -1
- package/dist/theme/defaultTheme.d.ts +3 -3
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/presets.d.ts +3 -0
- package/dist/types/table.types.d.ts +26 -0
- package/package.json +15 -8
- package/dist/favicon.svg +0 -65
- package/dist/logo.svg +0 -65
package/dist/index.js
CHANGED
|
@@ -1,277 +1,334 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (e == null) return s;
|
|
1
|
+
import r, { useMemo as $, useState as P, useEffect as G, useCallback as S, useRef as de, useImperativeHandle as Wt, createContext as Ft, useContext as qe } from "react";
|
|
2
|
+
function A(e, t, o = void 0) {
|
|
3
|
+
if (e == null) return o;
|
|
5
4
|
if (!t || typeof t != "string") return e;
|
|
6
5
|
if (t in e && e[t] !== void 0)
|
|
7
6
|
return e[t];
|
|
8
|
-
const
|
|
9
|
-
let
|
|
10
|
-
for (let
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
14
|
-
|
|
7
|
+
const i = t.replace(/\[(\w+)\]/g, ".$1").split(".");
|
|
8
|
+
let a = e;
|
|
9
|
+
for (let l = 0; l < i.length; l++) {
|
|
10
|
+
const m = i[l];
|
|
11
|
+
if (a == null)
|
|
12
|
+
return o;
|
|
13
|
+
a = a[m];
|
|
15
14
|
}
|
|
16
|
-
return
|
|
15
|
+
return a !== void 0 ? a : o;
|
|
17
16
|
}
|
|
18
|
-
function
|
|
17
|
+
function Lt(e) {
|
|
19
18
|
return e !== null && typeof e == "object" && !Array.isArray(e);
|
|
20
19
|
}
|
|
21
|
-
function
|
|
20
|
+
function le(e) {
|
|
22
21
|
if (!e || typeof e != "string") return "";
|
|
23
22
|
let t = e.replace(/[._\-]+/g, " ");
|
|
24
|
-
return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((
|
|
25
|
-
const
|
|
26
|
-
return
|
|
23
|
+
return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((o) => {
|
|
24
|
+
const s = o.toLowerCase();
|
|
25
|
+
return o.length <= 3 && o === o.toUpperCase() ? o : s.charAt(0).toUpperCase() + s.slice(1);
|
|
27
26
|
}).join(" ");
|
|
28
27
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
28
|
+
const Ot = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], It = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Ut = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], Vt = ["status", "state", "phase", "condition"];
|
|
29
|
+
function ie(e, t) {
|
|
30
|
+
const o = e.toLowerCase();
|
|
31
|
+
if (It.some((a) => o.includes(a)))
|
|
33
32
|
return "image";
|
|
34
|
-
if (
|
|
33
|
+
if (Ut.some((a) => o.includes(a)))
|
|
35
34
|
return "currency";
|
|
36
|
-
if (
|
|
35
|
+
if (Vt.some((a) => o.includes(a)))
|
|
37
36
|
return "status";
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
37
|
+
const s = t.filter((a) => a != null && a !== "");
|
|
38
|
+
if (s.length === 0)
|
|
40
39
|
return "string";
|
|
41
|
-
const
|
|
42
|
-
if (typeof
|
|
40
|
+
const i = s[0];
|
|
41
|
+
if (typeof i == "boolean" || o.startsWith("is") || o.startsWith("has"))
|
|
43
42
|
return "boolean";
|
|
44
|
-
if (Array.isArray(
|
|
43
|
+
if (Array.isArray(i))
|
|
45
44
|
return "array";
|
|
46
|
-
if (typeof
|
|
47
|
-
return
|
|
48
|
-
if (typeof
|
|
45
|
+
if (typeof i == "object")
|
|
46
|
+
return i.url && typeof i.url == "string" && Ue(i.url) ? "image" : "object";
|
|
47
|
+
if (typeof i == "number")
|
|
49
48
|
return "number";
|
|
50
|
-
if (typeof
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
49
|
+
if (typeof i == "string") {
|
|
50
|
+
const a = i.trim();
|
|
51
|
+
if (Ue(a))
|
|
53
52
|
return "image";
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
const l = o.includes("date") || o.includes("time") || o.endsWith("_at") || o.includes("_at_") || /(?:created|updated|deleted|modified|published)at$/i.test(o);
|
|
54
|
+
if (Yt(a) || l && a.length >= 8 && !isNaN(Date.parse(a)))
|
|
55
|
+
return a.includes("T") || a.includes(":") ? "datetime" : "date";
|
|
56
|
+
if (a.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a))
|
|
57
57
|
return "email";
|
|
58
|
-
if (
|
|
58
|
+
if (a.startsWith("http://") || a.startsWith("https://"))
|
|
59
59
|
return "url";
|
|
60
|
-
if (
|
|
60
|
+
if (o.includes("phone") || o.includes("mobile") || o.includes("tel"))
|
|
61
61
|
return "phone";
|
|
62
62
|
}
|
|
63
63
|
return "string";
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Ue(e) {
|
|
66
66
|
if (!e || typeof e != "string") return !1;
|
|
67
67
|
if (e.startsWith("data:image/")) return !0;
|
|
68
68
|
const t = e.toLowerCase().split("?")[0];
|
|
69
|
-
return
|
|
69
|
+
return Ot.some((o) => t.endsWith(o));
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Yt(e) {
|
|
72
72
|
return !e || typeof e != "string" || e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
function
|
|
74
|
+
const Gt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
|
|
75
|
+
function Kt(e, t = Gt, o = 2) {
|
|
76
76
|
if (!e || !e.length)
|
|
77
77
|
return [];
|
|
78
|
-
const
|
|
79
|
-
for (const
|
|
80
|
-
!
|
|
81
|
-
return Array.from(
|
|
78
|
+
const s = /* @__PURE__ */ new Map(), i = e.slice(0, 10);
|
|
79
|
+
for (const a of i)
|
|
80
|
+
!a || typeof a != "object" || Xe(a, "", s, i, t, 0, o);
|
|
81
|
+
return Array.from(s.values());
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
if (!(!e || typeof e != "object" ||
|
|
85
|
-
for (const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
|
|
83
|
+
function Xe(e, t, o, s, i, a, l) {
|
|
84
|
+
if (!(!e || typeof e != "object" || a > l))
|
|
85
|
+
for (const m of Object.keys(e)) {
|
|
86
|
+
if (i.includes(m)) continue;
|
|
87
|
+
const d = t ? `${t}.${m}` : m, c = e[m];
|
|
88
|
+
if (Lt(c) && !Zt(c) && a < l) {
|
|
89
|
+
Xe(c, d, o, s, i, a + 1, l);
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
|
-
if (!
|
|
93
|
-
const n =
|
|
94
|
-
|
|
95
|
-
key:
|
|
96
|
-
title:
|
|
97
|
-
type:
|
|
92
|
+
if (!o.has(d)) {
|
|
93
|
+
const n = s.map((g) => A(g, d)), f = ie(d, n);
|
|
94
|
+
o.set(d, {
|
|
95
|
+
key: d,
|
|
96
|
+
title: le(d),
|
|
97
|
+
type: f,
|
|
98
98
|
sortable: !0,
|
|
99
99
|
searchable: !0,
|
|
100
|
-
align:
|
|
100
|
+
align: f === "number" || f === "currency" ? "right" : "left"
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Zt(e, t) {
|
|
106
106
|
return "en" in e && "ar" in e && Object.keys(e).length <= 3 ? !1 : "url" in e && typeof e.url == "string" || "coordinates" in e || "lat" in e && "lng" in e;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
const { data: t = [], columns:
|
|
110
|
-
return
|
|
111
|
-
const
|
|
108
|
+
function Jt(e) {
|
|
109
|
+
const { data: t = [], columns: o, autoColumns: s = !0, thead: i, headerData: a } = e;
|
|
110
|
+
return a && Array.isArray(a) && a.length > 0 ? a.map((l, m) => {
|
|
111
|
+
const d = i && i[m] ? i[m] : le(l), c = t.map((f) => A(f, l)), n = ie(l, c);
|
|
112
112
|
return {
|
|
113
|
-
key:
|
|
114
|
-
title:
|
|
113
|
+
key: l,
|
|
114
|
+
title: d,
|
|
115
115
|
type: n,
|
|
116
116
|
sortable: !0,
|
|
117
117
|
searchable: !0,
|
|
118
118
|
align: n === "number" || n === "currency" ? "right" : "left"
|
|
119
119
|
};
|
|
120
|
-
}) :
|
|
121
|
-
if (typeof
|
|
122
|
-
const n = t.map((
|
|
120
|
+
}) : o && Array.isArray(o) && o.length > 0 ? o.map((l) => {
|
|
121
|
+
if (typeof l == "string") {
|
|
122
|
+
const n = t.map((g) => A(g, l)), f = ie(l, n);
|
|
123
123
|
return {
|
|
124
|
-
key:
|
|
125
|
-
title:
|
|
126
|
-
type:
|
|
124
|
+
key: l,
|
|
125
|
+
title: le(l),
|
|
126
|
+
type: f,
|
|
127
127
|
sortable: !0,
|
|
128
128
|
searchable: !0,
|
|
129
|
-
align:
|
|
129
|
+
align: f === "number" || f === "currency" ? "right" : "left"
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
const
|
|
132
|
+
const m = String(l.key), d = l.title !== void 0 ? l.title : le(m), c = l.type || ie(m, t.map((n) => A(n, m)));
|
|
133
133
|
return {
|
|
134
|
-
...
|
|
135
|
-
title:
|
|
136
|
-
type:
|
|
137
|
-
sortable:
|
|
138
|
-
searchable:
|
|
139
|
-
align:
|
|
134
|
+
...l,
|
|
135
|
+
title: d,
|
|
136
|
+
type: c,
|
|
137
|
+
sortable: l.sortable !== void 0 ? l.sortable : !0,
|
|
138
|
+
searchable: l.searchable !== void 0 ? l.searchable : !0,
|
|
139
|
+
align: l.align || (c === "number" || c === "currency" ? "right" : "left")
|
|
140
140
|
};
|
|
141
|
-
}) :
|
|
141
|
+
}) : s && t && t.length > 0 ? Kt(t) : [];
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function qt(e) {
|
|
144
|
+
const {
|
|
145
|
+
explicitActions: t,
|
|
146
|
+
buttons: o,
|
|
147
|
+
block: s,
|
|
148
|
+
handleBlock: i,
|
|
149
|
+
view: a,
|
|
150
|
+
linkView: l,
|
|
151
|
+
viewHandler: m,
|
|
152
|
+
edit: d,
|
|
153
|
+
linkEdit: c,
|
|
154
|
+
editHandler: n,
|
|
155
|
+
del: f,
|
|
156
|
+
handleDelete: g
|
|
157
|
+
} = e, u = [...t || []];
|
|
158
|
+
return o && Array.isArray(o) && o.forEach((b, y) => {
|
|
159
|
+
u.push({
|
|
160
|
+
id: `legacy-btn-${y}`,
|
|
161
|
+
label: b.label,
|
|
162
|
+
icon: b.icon,
|
|
163
|
+
className: b.className,
|
|
164
|
+
show: b.show,
|
|
165
|
+
hide: b.hide,
|
|
166
|
+
onClick: (v) => b.onClick(v)
|
|
167
|
+
});
|
|
168
|
+
}), s && i && u.push({
|
|
169
|
+
id: "legacy-block",
|
|
170
|
+
label: (b) => b.isBanned || !b.isActive ? "Unblock" : "Block",
|
|
171
|
+
variant: (b) => b.isBanned || !b.isActive ? "success" : "danger",
|
|
172
|
+
onClick: (b) => i(b?._id || b?.id)
|
|
173
|
+
}), a && (m || l) && u.push({
|
|
174
|
+
id: "legacy-view",
|
|
175
|
+
label: "View",
|
|
176
|
+
variant: "primary",
|
|
177
|
+
onClick: (b) => {
|
|
178
|
+
const y = b?._id || b?.id;
|
|
179
|
+
m ? m(y) : l && typeof window < "u" && (window.location.href = `${l}/${y}`);
|
|
180
|
+
}
|
|
181
|
+
}), d && (n || c) && u.push({
|
|
182
|
+
id: "legacy-edit",
|
|
183
|
+
label: "Edit",
|
|
184
|
+
variant: "info",
|
|
185
|
+
onClick: (b) => {
|
|
186
|
+
const y = b?._id || b?.id;
|
|
187
|
+
n ? n(y) : c && typeof window < "u" && (window.location.href = `${c}/${y}`);
|
|
188
|
+
}
|
|
189
|
+
}), f && g && u.push({
|
|
190
|
+
id: "legacy-del",
|
|
191
|
+
label: "Delete",
|
|
192
|
+
variant: "danger",
|
|
193
|
+
confirmation: {
|
|
194
|
+
title: "Delete Item",
|
|
195
|
+
message: "Are you sure you want to delete this record?"
|
|
196
|
+
},
|
|
197
|
+
onClick: (b) => g(b?._id || b?.id)
|
|
198
|
+
}), u;
|
|
199
|
+
}
|
|
200
|
+
function Xt({
|
|
144
201
|
config: e,
|
|
145
202
|
onSearchChange: t
|
|
146
203
|
}) {
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
if (!
|
|
150
|
-
if (
|
|
151
|
-
|
|
204
|
+
const o = $(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), s = o.enabled !== !1 && !!e, i = o.debounce ?? 350, [a, l] = P(""), [m, d] = P(""), [c, n] = P(!1);
|
|
205
|
+
G(() => {
|
|
206
|
+
if (!s) return;
|
|
207
|
+
if (a === "") {
|
|
208
|
+
d(""), n(!1), t?.("");
|
|
152
209
|
return;
|
|
153
210
|
}
|
|
154
211
|
n(!0);
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
},
|
|
212
|
+
const u = setTimeout(() => {
|
|
213
|
+
d(a), n(!1), t?.(a);
|
|
214
|
+
}, i);
|
|
158
215
|
return () => {
|
|
159
|
-
clearTimeout(
|
|
216
|
+
clearTimeout(u);
|
|
160
217
|
};
|
|
161
|
-
}, [
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
}, []),
|
|
165
|
-
|
|
218
|
+
}, [a, i, s, t]);
|
|
219
|
+
const f = S((u) => {
|
|
220
|
+
l(u);
|
|
221
|
+
}, []), g = S(() => {
|
|
222
|
+
l(""), d(""), n(!1), t?.("");
|
|
166
223
|
}, [t]);
|
|
167
224
|
return {
|
|
168
|
-
enabled:
|
|
169
|
-
search:
|
|
170
|
-
debouncedSearch:
|
|
171
|
-
isDebouncing:
|
|
172
|
-
setSearch:
|
|
173
|
-
clearSearch:
|
|
174
|
-
searchConfig:
|
|
225
|
+
enabled: s,
|
|
226
|
+
search: a,
|
|
227
|
+
debouncedSearch: m,
|
|
228
|
+
isDebouncing: c,
|
|
229
|
+
setSearch: f,
|
|
230
|
+
clearSearch: g,
|
|
231
|
+
searchConfig: o
|
|
175
232
|
};
|
|
176
233
|
}
|
|
177
|
-
function
|
|
234
|
+
function Qt({
|
|
178
235
|
config: e,
|
|
179
236
|
onSortChange: t
|
|
180
237
|
}) {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
), [
|
|
184
|
-
|
|
185
|
-
),
|
|
186
|
-
(
|
|
187
|
-
if (
|
|
188
|
-
if (
|
|
189
|
-
|
|
238
|
+
const o = $(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), s = o.enabled !== !1 && !!e, i = o.allowUnsort ?? !0, [a, l] = P(
|
|
239
|
+
o.defaultSortBy || null
|
|
240
|
+
), [m, d] = P(
|
|
241
|
+
o.defaultSortOrder || null
|
|
242
|
+
), c = S(
|
|
243
|
+
(g) => {
|
|
244
|
+
if (s) {
|
|
245
|
+
if (a !== g) {
|
|
246
|
+
l(g), d("asc"), t?.(g, "asc");
|
|
190
247
|
return;
|
|
191
248
|
}
|
|
192
|
-
|
|
249
|
+
m === "asc" ? (d("desc"), t?.(g, "desc")) : m === "desc" && i ? (l(null), d(null), t?.(null, null)) : (d("asc"), t?.(g, "asc"));
|
|
193
250
|
}
|
|
194
251
|
},
|
|
195
|
-
[
|
|
196
|
-
), n =
|
|
197
|
-
(
|
|
198
|
-
|
|
252
|
+
[s, a, m, i, t]
|
|
253
|
+
), n = S(
|
|
254
|
+
(g, u) => {
|
|
255
|
+
l(g), d(u), t?.(g, u);
|
|
199
256
|
},
|
|
200
257
|
[t]
|
|
201
|
-
),
|
|
202
|
-
|
|
258
|
+
), f = S(() => {
|
|
259
|
+
l(null), d(null), t?.(null, null);
|
|
203
260
|
}, [t]);
|
|
204
261
|
return {
|
|
205
|
-
enabled:
|
|
206
|
-
sortBy:
|
|
207
|
-
sortOrder:
|
|
208
|
-
toggleSort:
|
|
262
|
+
enabled: s,
|
|
263
|
+
sortBy: a,
|
|
264
|
+
sortOrder: m,
|
|
265
|
+
toggleSort: c,
|
|
209
266
|
setSorting: n,
|
|
210
|
-
resetSorting:
|
|
211
|
-
sortingConfig:
|
|
267
|
+
resetSorting: f,
|
|
268
|
+
sortingConfig: o
|
|
212
269
|
};
|
|
213
270
|
}
|
|
214
|
-
function
|
|
271
|
+
function er({
|
|
215
272
|
config: e,
|
|
216
273
|
totalRecords: t,
|
|
217
|
-
onPageChange:
|
|
274
|
+
onPageChange: o
|
|
218
275
|
}) {
|
|
219
|
-
const
|
|
220
|
-
(
|
|
221
|
-
const
|
|
222
|
-
|
|
276
|
+
const s = $(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), i = s.enabled !== !1 && !!e, a = s.defaultPage || 1, l = s.defaultPageSize || 10, m = s.pageSizeOptions || [5, 10, 20, 50, 100], [d, c] = P(a), [n, f] = P(l), g = Math.max(1, Math.ceil(t / Math.max(1, n))), u = S(
|
|
277
|
+
(p) => {
|
|
278
|
+
const x = Math.max(1, Math.min(p, g));
|
|
279
|
+
c(x), o?.(x, n);
|
|
223
280
|
},
|
|
224
|
-
[
|
|
225
|
-
),
|
|
226
|
-
(
|
|
227
|
-
|
|
281
|
+
[g, n, o]
|
|
282
|
+
), b = S(
|
|
283
|
+
(p) => {
|
|
284
|
+
f(p), c(1), o?.(1, p);
|
|
228
285
|
},
|
|
229
|
-
[
|
|
230
|
-
),
|
|
231
|
-
|
|
232
|
-
}, [
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
|
|
236
|
-
}, [
|
|
237
|
-
(
|
|
238
|
-
const
|
|
286
|
+
[o]
|
|
287
|
+
), y = S(() => {
|
|
288
|
+
d < g && u(d + 1);
|
|
289
|
+
}, [d, g, u]), v = S(() => {
|
|
290
|
+
d > 1 && u(d - 1);
|
|
291
|
+
}, [d, u]), T = S(() => {
|
|
292
|
+
c(1), f(l), o?.(1, l);
|
|
293
|
+
}, [l, o]), B = S(
|
|
294
|
+
(p = 5) => {
|
|
295
|
+
const x = Math.max(
|
|
239
296
|
1,
|
|
240
|
-
Math.min(
|
|
241
|
-
),
|
|
242
|
-
for (let
|
|
243
|
-
|
|
244
|
-
return
|
|
297
|
+
Math.min(d - Math.floor(p / 2), g - p + 1)
|
|
298
|
+
), k = Math.min(g, x + p - 1), w = [];
|
|
299
|
+
for (let D = x; D <= k; D++)
|
|
300
|
+
w.push(D);
|
|
301
|
+
return w;
|
|
245
302
|
},
|
|
246
|
-
[
|
|
247
|
-
),
|
|
248
|
-
(
|
|
249
|
-
if (!
|
|
250
|
-
const
|
|
251
|
-
return
|
|
303
|
+
[d, g]
|
|
304
|
+
), E = S(
|
|
305
|
+
(p) => {
|
|
306
|
+
if (!i) return p;
|
|
307
|
+
const x = (d - 1) * n;
|
|
308
|
+
return p.slice(x, x + n);
|
|
252
309
|
},
|
|
253
|
-
[
|
|
310
|
+
[i, d, n]
|
|
254
311
|
);
|
|
255
312
|
return {
|
|
256
|
-
enabled:
|
|
257
|
-
page:
|
|
313
|
+
enabled: i,
|
|
314
|
+
page: d,
|
|
258
315
|
pageSize: n,
|
|
259
316
|
totalRecords: t,
|
|
260
|
-
totalPages:
|
|
261
|
-
pageSizeOptions:
|
|
262
|
-
hasNextPage:
|
|
263
|
-
hasPrevPage:
|
|
264
|
-
setPage:
|
|
265
|
-
setPageSize:
|
|
266
|
-
nextPage:
|
|
267
|
-
prevPage:
|
|
268
|
-
resetPagination:
|
|
269
|
-
getPageWindow:
|
|
270
|
-
sliceData:
|
|
271
|
-
paginationConfig:
|
|
317
|
+
totalPages: g,
|
|
318
|
+
pageSizeOptions: m,
|
|
319
|
+
hasNextPage: d < g,
|
|
320
|
+
hasPrevPage: d > 1,
|
|
321
|
+
setPage: u,
|
|
322
|
+
setPageSize: b,
|
|
323
|
+
nextPage: y,
|
|
324
|
+
prevPage: v,
|
|
325
|
+
resetPagination: T,
|
|
326
|
+
getPageWindow: B,
|
|
327
|
+
sliceData: E,
|
|
328
|
+
paginationConfig: s
|
|
272
329
|
};
|
|
273
330
|
}
|
|
274
|
-
const
|
|
331
|
+
const tr = [
|
|
275
332
|
"total",
|
|
276
333
|
"totalCount",
|
|
277
334
|
"count",
|
|
@@ -287,7 +344,7 @@ const Vt = [
|
|
|
287
344
|
"pageInfo.total",
|
|
288
345
|
"pageInfo.totalCount",
|
|
289
346
|
"paging.total"
|
|
290
|
-
],
|
|
347
|
+
], rr = [
|
|
291
348
|
"page",
|
|
292
349
|
"currentPage",
|
|
293
350
|
"pageNumber",
|
|
@@ -297,7 +354,7 @@ const Vt = [
|
|
|
297
354
|
"pagination.page",
|
|
298
355
|
"pagination.currentPage",
|
|
299
356
|
"pageInfo.page"
|
|
300
|
-
],
|
|
357
|
+
], ar = [
|
|
301
358
|
"pageSize",
|
|
302
359
|
"limit",
|
|
303
360
|
"perPage",
|
|
@@ -308,7 +365,7 @@ const Vt = [
|
|
|
308
365
|
"pagination.pageSize",
|
|
309
366
|
"pagination.limit",
|
|
310
367
|
"pagination.perPage"
|
|
311
|
-
],
|
|
368
|
+
], nr = [
|
|
312
369
|
"totalPages",
|
|
313
370
|
"pageCount",
|
|
314
371
|
"lastPage",
|
|
@@ -319,95 +376,95 @@ const Vt = [
|
|
|
319
376
|
"pagination.totalPages",
|
|
320
377
|
"pagination.lastPage"
|
|
321
378
|
];
|
|
322
|
-
function
|
|
379
|
+
function q(e, t, o = 1, s = 10, i) {
|
|
323
380
|
if (!e || typeof e != "object") {
|
|
324
|
-
const
|
|
381
|
+
const c = i !== void 0 ? i : 0;
|
|
325
382
|
return {
|
|
326
|
-
page:
|
|
327
|
-
pageSize:
|
|
328
|
-
total:
|
|
329
|
-
totalPages: Math.max(1, Math.ceil(
|
|
383
|
+
page: o,
|
|
384
|
+
pageSize: s,
|
|
385
|
+
total: c,
|
|
386
|
+
totalPages: Math.max(1, Math.ceil(c / Math.max(1, s))),
|
|
330
387
|
hasNextPage: !1,
|
|
331
388
|
hasPrevPage: !1
|
|
332
389
|
};
|
|
333
390
|
}
|
|
334
|
-
let
|
|
391
|
+
let a;
|
|
335
392
|
if (t?.totalPath) {
|
|
336
|
-
const
|
|
337
|
-
typeof
|
|
393
|
+
const c = A(e, t.totalPath);
|
|
394
|
+
typeof c == "number" ? a = c : typeof c == "string" && !isNaN(Number(c)) && (a = Number(c));
|
|
338
395
|
}
|
|
339
|
-
if (
|
|
340
|
-
for (const
|
|
341
|
-
const n =
|
|
396
|
+
if (a === void 0)
|
|
397
|
+
for (const c of tr) {
|
|
398
|
+
const n = A(e, c);
|
|
342
399
|
if (typeof n == "number" && !isNaN(n)) {
|
|
343
|
-
|
|
400
|
+
a = n;
|
|
344
401
|
break;
|
|
345
402
|
}
|
|
346
403
|
if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
|
|
347
|
-
|
|
404
|
+
a = Number(n);
|
|
348
405
|
break;
|
|
349
406
|
}
|
|
350
407
|
}
|
|
351
|
-
|
|
352
|
-
let
|
|
408
|
+
a === void 0 && (a = i !== void 0 ? i : 0);
|
|
409
|
+
let l;
|
|
353
410
|
if (t?.pagePath) {
|
|
354
|
-
const
|
|
355
|
-
typeof
|
|
411
|
+
const c = A(e, t.pagePath);
|
|
412
|
+
typeof c == "number" ? l = c : typeof c == "string" && !isNaN(Number(c)) && (l = Number(c));
|
|
356
413
|
}
|
|
357
|
-
if (
|
|
358
|
-
for (const
|
|
359
|
-
const n =
|
|
414
|
+
if (l === void 0)
|
|
415
|
+
for (const c of rr) {
|
|
416
|
+
const n = A(e, c);
|
|
360
417
|
if (typeof n == "number" && !isNaN(n)) {
|
|
361
|
-
|
|
418
|
+
l = n;
|
|
362
419
|
break;
|
|
363
420
|
}
|
|
364
421
|
if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
|
|
365
|
-
|
|
422
|
+
l = Number(n);
|
|
366
423
|
break;
|
|
367
424
|
}
|
|
368
425
|
}
|
|
369
|
-
|
|
370
|
-
let
|
|
426
|
+
l === void 0 && (l = o);
|
|
427
|
+
let m;
|
|
371
428
|
if (t?.pageSizePath) {
|
|
372
|
-
const
|
|
373
|
-
typeof
|
|
429
|
+
const c = A(e, t.pageSizePath);
|
|
430
|
+
typeof c == "number" ? m = c : typeof c == "string" && !isNaN(Number(c)) && (m = Number(c));
|
|
374
431
|
}
|
|
375
|
-
if (
|
|
376
|
-
for (const
|
|
377
|
-
const n =
|
|
432
|
+
if (m === void 0)
|
|
433
|
+
for (const c of ar) {
|
|
434
|
+
const n = A(e, c);
|
|
378
435
|
if (typeof n == "number" && !isNaN(n)) {
|
|
379
|
-
|
|
436
|
+
m = n;
|
|
380
437
|
break;
|
|
381
438
|
}
|
|
382
439
|
if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
|
|
383
|
-
|
|
440
|
+
m = Number(n);
|
|
384
441
|
break;
|
|
385
442
|
}
|
|
386
443
|
}
|
|
387
|
-
|
|
388
|
-
let
|
|
444
|
+
m === void 0 && (m = s);
|
|
445
|
+
let d;
|
|
389
446
|
if (t?.totalPagesPath) {
|
|
390
|
-
const
|
|
391
|
-
typeof
|
|
447
|
+
const c = A(e, t.totalPagesPath);
|
|
448
|
+
typeof c == "number" ? d = c : typeof c == "string" && !isNaN(Number(c)) && (d = Number(c));
|
|
392
449
|
}
|
|
393
|
-
if (
|
|
394
|
-
for (const
|
|
395
|
-
const n =
|
|
450
|
+
if (d === void 0)
|
|
451
|
+
for (const c of nr) {
|
|
452
|
+
const n = A(e, c);
|
|
396
453
|
if (typeof n == "number" && !isNaN(n)) {
|
|
397
|
-
|
|
454
|
+
d = n;
|
|
398
455
|
break;
|
|
399
456
|
}
|
|
400
457
|
}
|
|
401
|
-
return (
|
|
402
|
-
total:
|
|
403
|
-
page:
|
|
404
|
-
pageSize:
|
|
405
|
-
totalPages:
|
|
406
|
-
hasNextPage:
|
|
407
|
-
hasPrevPage:
|
|
458
|
+
return (d === void 0 || d <= 0) && (d = Math.max(1, Math.ceil(a / Math.max(1, m)))), {
|
|
459
|
+
total: a,
|
|
460
|
+
page: l,
|
|
461
|
+
pageSize: m,
|
|
462
|
+
totalPages: d,
|
|
463
|
+
hasNextPage: l < d,
|
|
464
|
+
hasPrevPage: l > 1
|
|
408
465
|
};
|
|
409
466
|
}
|
|
410
|
-
const
|
|
467
|
+
const or = [
|
|
411
468
|
"data",
|
|
412
469
|
"items",
|
|
413
470
|
"results",
|
|
@@ -428,24 +485,24 @@ const qt = [
|
|
|
428
485
|
"subscriptions",
|
|
429
486
|
"deadLetters.items"
|
|
430
487
|
];
|
|
431
|
-
function
|
|
432
|
-
const
|
|
488
|
+
function sr(e, t, o) {
|
|
489
|
+
const s = o?.page || 1, i = o?.pageSize || 10;
|
|
433
490
|
if (t?.transformResponse && typeof t.transformResponse == "function") {
|
|
434
|
-
const
|
|
435
|
-
if (Array.isArray(
|
|
491
|
+
const a = t.transformResponse(e);
|
|
492
|
+
if (Array.isArray(a))
|
|
436
493
|
return {
|
|
437
|
-
data:
|
|
438
|
-
meta:
|
|
494
|
+
data: a,
|
|
495
|
+
meta: q(e, t.response, s, i, a.length),
|
|
439
496
|
raw: e
|
|
440
497
|
};
|
|
441
|
-
if (
|
|
442
|
-
const
|
|
443
|
-
total:
|
|
444
|
-
page:
|
|
445
|
-
pageSize:
|
|
446
|
-
totalPages:
|
|
447
|
-
} :
|
|
448
|
-
return { data:
|
|
498
|
+
if (a && typeof a == "object") {
|
|
499
|
+
const l = Array.isArray(a.data) ? a.data : [], m = a.meta ? {
|
|
500
|
+
total: a.meta.total !== void 0 ? a.meta.total : l.length,
|
|
501
|
+
page: a.meta.page !== void 0 ? a.meta.page : s,
|
|
502
|
+
pageSize: a.meta.pageSize !== void 0 ? a.meta.pageSize : i,
|
|
503
|
+
totalPages: a.meta.totalPages !== void 0 ? a.meta.totalPages : Math.max(1, Math.ceil((a.meta.total || l.length) / (a.meta.pageSize || i)))
|
|
504
|
+
} : q(e, t.response, s, i, l.length);
|
|
505
|
+
return { data: l, meta: m, raw: e };
|
|
449
506
|
}
|
|
450
507
|
}
|
|
451
508
|
if (Array.isArray(e))
|
|
@@ -453,48 +510,48 @@ function Xt(e, t, s) {
|
|
|
453
510
|
data: e,
|
|
454
511
|
meta: {
|
|
455
512
|
total: e.length,
|
|
456
|
-
page:
|
|
457
|
-
pageSize:
|
|
458
|
-
totalPages: Math.max(1, Math.ceil(e.length /
|
|
459
|
-
hasNextPage:
|
|
460
|
-
hasPrevPage:
|
|
513
|
+
page: s,
|
|
514
|
+
pageSize: i,
|
|
515
|
+
totalPages: Math.max(1, Math.ceil(e.length / i)),
|
|
516
|
+
hasNextPage: s * i < e.length,
|
|
517
|
+
hasPrevPage: s > 1
|
|
461
518
|
},
|
|
462
519
|
raw: e
|
|
463
520
|
};
|
|
464
521
|
if (t?.response?.dataPath) {
|
|
465
|
-
const
|
|
466
|
-
return { data:
|
|
522
|
+
const a = A(e, t.response.dataPath), l = Array.isArray(a) ? a : [], m = q(e, t.response, s, i, l.length);
|
|
523
|
+
return { data: l, meta: m, raw: e };
|
|
467
524
|
}
|
|
468
525
|
if (e && typeof e == "object") {
|
|
469
|
-
for (const
|
|
470
|
-
const
|
|
471
|
-
if (Array.isArray(
|
|
472
|
-
const
|
|
526
|
+
for (const a of or) {
|
|
527
|
+
const l = A(e, a);
|
|
528
|
+
if (Array.isArray(l)) {
|
|
529
|
+
const m = q(e, t?.response, s, i, l.length);
|
|
473
530
|
return {
|
|
474
|
-
data:
|
|
475
|
-
meta:
|
|
531
|
+
data: l,
|
|
532
|
+
meta: m,
|
|
476
533
|
raw: e
|
|
477
534
|
};
|
|
478
535
|
}
|
|
479
536
|
}
|
|
480
|
-
for (const
|
|
481
|
-
if (Array.isArray(e[
|
|
482
|
-
const
|
|
537
|
+
for (const a in e)
|
|
538
|
+
if (Array.isArray(e[a])) {
|
|
539
|
+
const l = q(e, t?.response, s, i, e[a].length);
|
|
483
540
|
return {
|
|
484
|
-
data: e[
|
|
485
|
-
meta:
|
|
541
|
+
data: e[a],
|
|
542
|
+
meta: l,
|
|
486
543
|
raw: e
|
|
487
544
|
};
|
|
488
545
|
}
|
|
489
546
|
if (Object.keys(e).length > 0 && !Array.isArray(e)) {
|
|
490
|
-
const
|
|
491
|
-
if (
|
|
547
|
+
const a = e.user || e.order || e.item || e.data || e;
|
|
548
|
+
if (a && typeof a == "object" && !Array.isArray(a))
|
|
492
549
|
return {
|
|
493
|
-
data: [
|
|
550
|
+
data: [a],
|
|
494
551
|
meta: {
|
|
495
552
|
total: 1,
|
|
496
553
|
page: 1,
|
|
497
|
-
pageSize:
|
|
554
|
+
pageSize: i,
|
|
498
555
|
totalPages: 1,
|
|
499
556
|
hasNextPage: !1,
|
|
500
557
|
hasPrevPage: !1
|
|
@@ -507,8 +564,8 @@ function Xt(e, t, s) {
|
|
|
507
564
|
data: [],
|
|
508
565
|
meta: {
|
|
509
566
|
total: 0,
|
|
510
|
-
page:
|
|
511
|
-
pageSize:
|
|
567
|
+
page: s,
|
|
568
|
+
pageSize: i,
|
|
512
569
|
totalPages: 1,
|
|
513
570
|
hasNextPage: !1,
|
|
514
571
|
hasPrevPage: !1
|
|
@@ -516,212 +573,372 @@ function Xt(e, t, s) {
|
|
|
516
573
|
raw: e
|
|
517
574
|
};
|
|
518
575
|
}
|
|
519
|
-
function
|
|
576
|
+
function lr(e, t, o, s) {
|
|
520
577
|
if (!e || !e.length) return [];
|
|
521
578
|
if (!t || typeof t != "string" || !t.trim()) return e;
|
|
522
|
-
const
|
|
523
|
-
if (
|
|
524
|
-
return e.filter((
|
|
525
|
-
const
|
|
526
|
-
return e.filter((
|
|
527
|
-
if (!
|
|
528
|
-
const
|
|
529
|
-
if (
|
|
530
|
-
for (const
|
|
531
|
-
const n =
|
|
532
|
-
n != null && (typeof n == "object" ?
|
|
579
|
+
const i = t.trim().toLowerCase();
|
|
580
|
+
if (s && typeof s == "function")
|
|
581
|
+
return e.filter((l) => s(l, i));
|
|
582
|
+
const a = i.split(/\s+/).filter(Boolean);
|
|
583
|
+
return e.filter((l) => {
|
|
584
|
+
if (!l || typeof l != "object") return !1;
|
|
585
|
+
const m = [];
|
|
586
|
+
if (o && o.length > 0)
|
|
587
|
+
for (const c of o) {
|
|
588
|
+
const n = A(l, c);
|
|
589
|
+
n != null && (typeof n == "object" ? m.push(JSON.stringify(n).toLowerCase()) : m.push(String(n).toLowerCase()));
|
|
533
590
|
}
|
|
534
591
|
else
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
return
|
|
592
|
+
pe(l, m);
|
|
593
|
+
const d = m.join(" ");
|
|
594
|
+
return a.every((c) => d.includes(c));
|
|
538
595
|
});
|
|
539
596
|
}
|
|
540
|
-
function
|
|
541
|
-
if (!(
|
|
597
|
+
function pe(e, t, o = 0) {
|
|
598
|
+
if (!(o > 4 || e === null || e === void 0)) {
|
|
542
599
|
if (typeof e != "object") {
|
|
543
600
|
t.push(String(e).toLowerCase());
|
|
544
601
|
return;
|
|
545
602
|
}
|
|
546
603
|
if (Array.isArray(e)) {
|
|
547
|
-
for (const
|
|
548
|
-
|
|
604
|
+
for (const s of e)
|
|
605
|
+
pe(s, t, o + 1);
|
|
549
606
|
return;
|
|
550
607
|
}
|
|
551
|
-
for (const
|
|
552
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
553
|
-
if (
|
|
554
|
-
|
|
608
|
+
for (const s in e)
|
|
609
|
+
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
610
|
+
if (s.startsWith("__") || s.toLowerCase().includes("password")) continue;
|
|
611
|
+
pe(e[s], t, o + 1);
|
|
555
612
|
}
|
|
556
613
|
}
|
|
557
614
|
}
|
|
558
|
-
function
|
|
559
|
-
if (!e || !e.length || !t || !
|
|
615
|
+
function ir(e, t, o, s) {
|
|
616
|
+
if (!e || !e.length || !t || !o)
|
|
560
617
|
return e;
|
|
561
|
-
const
|
|
562
|
-
return
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
618
|
+
const i = [...e];
|
|
619
|
+
return s && typeof s == "function" ? (i.sort((a, l) => {
|
|
620
|
+
const m = A(a, t), d = A(l, t);
|
|
621
|
+
if (m == null)
|
|
622
|
+
return d == null ? 0 : 1;
|
|
623
|
+
if (d == null) return -1;
|
|
624
|
+
const c = s(a, l);
|
|
625
|
+
return o === "desc" ? -c : c;
|
|
626
|
+
}), i) : (i.sort((a, l) => {
|
|
627
|
+
const m = A(a, t), d = A(l, t);
|
|
628
|
+
if (m == null)
|
|
629
|
+
return d == null ? 0 : 1;
|
|
630
|
+
if (d == null)
|
|
570
631
|
return -1;
|
|
571
|
-
let
|
|
572
|
-
if (typeof
|
|
573
|
-
|
|
574
|
-
else if (typeof
|
|
575
|
-
|
|
576
|
-
else if (
|
|
577
|
-
|
|
578
|
-
else if (typeof
|
|
579
|
-
|
|
632
|
+
let c = 0;
|
|
633
|
+
if (typeof m == "number" && typeof d == "number")
|
|
634
|
+
c = m - d;
|
|
635
|
+
else if (typeof m == "boolean" && typeof d == "boolean")
|
|
636
|
+
c = m === d ? 0 : m ? -1 : 1;
|
|
637
|
+
else if (m instanceof Date && d instanceof Date)
|
|
638
|
+
c = m.getTime() - d.getTime();
|
|
639
|
+
else if (typeof m == "string" && typeof d == "string" && Ve(m) && Ve(d))
|
|
640
|
+
c = new Date(m).getTime() - new Date(d).getTime();
|
|
580
641
|
else {
|
|
581
|
-
const n = String(
|
|
582
|
-
|
|
642
|
+
const n = String(m), f = String(d);
|
|
643
|
+
c = n.localeCompare(f, void 0, {
|
|
583
644
|
numeric: !0,
|
|
584
645
|
sensitivity: "base"
|
|
585
646
|
});
|
|
586
647
|
}
|
|
587
|
-
return
|
|
588
|
-
}),
|
|
648
|
+
return o === "desc" ? -c : c;
|
|
649
|
+
}), i);
|
|
589
650
|
}
|
|
590
|
-
function
|
|
651
|
+
function Ve(e) {
|
|
591
652
|
return e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
|
|
592
653
|
}
|
|
593
|
-
function
|
|
654
|
+
function dr({
|
|
594
655
|
data: e,
|
|
595
656
|
api: t,
|
|
596
|
-
columns:
|
|
597
|
-
searchQuery:
|
|
598
|
-
sortBy:
|
|
599
|
-
sortOrder:
|
|
600
|
-
page:
|
|
601
|
-
pageSize:
|
|
657
|
+
columns: o,
|
|
658
|
+
searchQuery: s,
|
|
659
|
+
sortBy: i,
|
|
660
|
+
sortOrder: a,
|
|
661
|
+
page: l,
|
|
662
|
+
pageSize: m,
|
|
663
|
+
paginationEnabled: d = !0,
|
|
602
664
|
manualLoading: c
|
|
603
665
|
}) {
|
|
604
|
-
const
|
|
605
|
-
if (!
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
const
|
|
610
|
-
[
|
|
611
|
-
[
|
|
612
|
-
page:
|
|
613
|
-
pageSize:
|
|
614
|
-
...
|
|
615
|
-
...
|
|
616
|
-
...
|
|
666
|
+
const n = !!(t && typeof t.fetcher == "function"), f = n && t?.mode !== "client", [g, u] = P([]), [b, y] = P(0), [v, T] = P(!1), [B, E] = P(null), [p, x] = P(0), k = de(null), w = S(async () => {
|
|
667
|
+
if (!n || !t?.fetcher) return;
|
|
668
|
+
k.current && k.current.abort();
|
|
669
|
+
const M = new AbortController();
|
|
670
|
+
k.current = M, T(!0), E(null);
|
|
671
|
+
const z = t.paramNames || {}, I = z.pageParam || "page", Q = z.pageSizeParam || "limit", K = z.searchParam || "q", U = z.sortByParam || "sortBy", L = z.sortOrderParam || "sortOrder", H = {
|
|
672
|
+
[I]: l,
|
|
673
|
+
[Q]: m,
|
|
674
|
+
page: l,
|
|
675
|
+
pageSize: m,
|
|
676
|
+
...s ? { [K]: s, search: s, q: s } : {},
|
|
677
|
+
...i ? { [U]: i, sortBy: i } : {},
|
|
678
|
+
...a ? { [L]: a, sortOrder: a } : {},
|
|
617
679
|
...t.params || {}
|
|
618
680
|
};
|
|
619
681
|
try {
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
623
|
-
|
|
682
|
+
const R = await t.fetcher(H, M.signal);
|
|
683
|
+
if (M.signal.aborted) return;
|
|
684
|
+
const V = sr(
|
|
685
|
+
R,
|
|
624
686
|
t,
|
|
625
|
-
|
|
687
|
+
H
|
|
626
688
|
);
|
|
627
|
-
|
|
628
|
-
} catch (
|
|
629
|
-
if (
|
|
689
|
+
u(V.data), y(V.meta.total), t.onSuccess?.(V);
|
|
690
|
+
} catch (R) {
|
|
691
|
+
if (R?.name === "AbortError" || R?.name === "CanceledError")
|
|
630
692
|
return;
|
|
631
|
-
|
|
693
|
+
E(R), t.onError?.(R);
|
|
632
694
|
} finally {
|
|
633
|
-
|
|
695
|
+
M.signal.aborted || T(!1);
|
|
634
696
|
}
|
|
635
|
-
}, [
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
}, [
|
|
639
|
-
|
|
697
|
+
}, [n, t, l, m, s, i, a]);
|
|
698
|
+
G(() => {
|
|
699
|
+
n && w();
|
|
700
|
+
}, [w, p]), G(() => () => {
|
|
701
|
+
k.current && k.current.abort();
|
|
640
702
|
}, []);
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
}, [
|
|
644
|
-
if (
|
|
703
|
+
const D = S(async () => {
|
|
704
|
+
n && x((M) => M + 1);
|
|
705
|
+
}, [n]), { displayRows: h, finalTotal: j } = $(() => {
|
|
706
|
+
if (f)
|
|
645
707
|
return {
|
|
646
|
-
displayRows:
|
|
708
|
+
displayRows: g,
|
|
647
709
|
finalTotal: b
|
|
648
710
|
};
|
|
649
|
-
const
|
|
711
|
+
const M = n ? g : e || [], z = o.filter((H) => H.searchable !== !1).map((H) => H.key), I = lr(M, s, z), K = o.find((H) => H.key === i)?.comparator, U = ir(I, i, a, K);
|
|
712
|
+
let L;
|
|
713
|
+
if (d) {
|
|
714
|
+
const H = (l - 1) * m;
|
|
715
|
+
L = U.slice(H, H + m);
|
|
716
|
+
} else
|
|
717
|
+
L = U;
|
|
650
718
|
return {
|
|
651
|
-
displayRows:
|
|
652
|
-
finalTotal:
|
|
719
|
+
displayRows: L,
|
|
720
|
+
finalTotal: I.length
|
|
653
721
|
};
|
|
654
722
|
}, [
|
|
723
|
+
f,
|
|
655
724
|
n,
|
|
656
|
-
|
|
657
|
-
u,
|
|
725
|
+
g,
|
|
658
726
|
e,
|
|
659
727
|
b,
|
|
660
|
-
s,
|
|
661
728
|
o,
|
|
662
|
-
|
|
663
|
-
r,
|
|
729
|
+
s,
|
|
664
730
|
i,
|
|
665
|
-
|
|
731
|
+
a,
|
|
732
|
+
l,
|
|
733
|
+
m,
|
|
734
|
+
d
|
|
666
735
|
]);
|
|
667
736
|
return {
|
|
668
|
-
rows:
|
|
669
|
-
totalRecords:
|
|
670
|
-
loading: c !== void 0 ? c :
|
|
671
|
-
error:
|
|
672
|
-
refresh:
|
|
673
|
-
isServerMode:
|
|
674
|
-
rawRemoteData:
|
|
737
|
+
rows: h,
|
|
738
|
+
totalRecords: j,
|
|
739
|
+
loading: c !== void 0 ? c : v,
|
|
740
|
+
error: B,
|
|
741
|
+
refresh: D,
|
|
742
|
+
isServerMode: f,
|
|
743
|
+
rawRemoteData: g
|
|
675
744
|
};
|
|
676
745
|
}
|
|
677
|
-
function
|
|
746
|
+
function cr({
|
|
678
747
|
tableRef: e,
|
|
679
748
|
refresh: t,
|
|
680
|
-
resetPagination:
|
|
681
|
-
resetSearch:
|
|
682
|
-
resetSorting:
|
|
683
|
-
setPage:
|
|
684
|
-
setPageSize:
|
|
685
|
-
setSearch:
|
|
686
|
-
setSorting:
|
|
687
|
-
selectedRows:
|
|
749
|
+
resetPagination: o,
|
|
750
|
+
resetSearch: s,
|
|
751
|
+
resetSorting: i,
|
|
752
|
+
setPage: a,
|
|
753
|
+
setPageSize: l,
|
|
754
|
+
setSearch: m,
|
|
755
|
+
setSorting: d,
|
|
756
|
+
selectedRows: c,
|
|
688
757
|
clearSelection: n,
|
|
689
|
-
getState:
|
|
758
|
+
getState: f,
|
|
759
|
+
scrollToIndex: g
|
|
690
760
|
}) {
|
|
691
|
-
|
|
761
|
+
Wt(
|
|
692
762
|
e,
|
|
693
763
|
() => ({
|
|
694
764
|
refresh: t,
|
|
695
765
|
reset: () => {
|
|
696
|
-
|
|
766
|
+
o(), s(), i(), n();
|
|
697
767
|
},
|
|
698
|
-
resetSearch:
|
|
699
|
-
resetSorting:
|
|
700
|
-
resetPagination:
|
|
701
|
-
setPage:
|
|
702
|
-
setPageSize:
|
|
703
|
-
setSearch:
|
|
704
|
-
setSorting:
|
|
705
|
-
getSelectedRows: () =>
|
|
768
|
+
resetSearch: s,
|
|
769
|
+
resetSorting: i,
|
|
770
|
+
resetPagination: o,
|
|
771
|
+
setPage: a,
|
|
772
|
+
setPageSize: l,
|
|
773
|
+
setSearch: m,
|
|
774
|
+
setSorting: d,
|
|
775
|
+
getSelectedRows: () => c,
|
|
706
776
|
clearSelection: n,
|
|
707
|
-
getState:
|
|
777
|
+
getState: f,
|
|
778
|
+
scrollToIndex: g
|
|
708
779
|
}),
|
|
709
780
|
[
|
|
710
781
|
t,
|
|
711
|
-
s,
|
|
712
782
|
o,
|
|
713
|
-
|
|
714
|
-
r,
|
|
783
|
+
s,
|
|
715
784
|
i,
|
|
716
|
-
|
|
717
|
-
|
|
785
|
+
a,
|
|
786
|
+
l,
|
|
787
|
+
m,
|
|
718
788
|
d,
|
|
789
|
+
c,
|
|
719
790
|
n,
|
|
720
|
-
|
|
791
|
+
f,
|
|
792
|
+
g
|
|
721
793
|
]
|
|
722
794
|
);
|
|
723
795
|
}
|
|
724
|
-
|
|
796
|
+
function mr({
|
|
797
|
+
rows: e,
|
|
798
|
+
rowKeyResolver: t,
|
|
799
|
+
onSelectionChange: o
|
|
800
|
+
}) {
|
|
801
|
+
const [s, i] = P(/* @__PURE__ */ new Set()), a = de(/* @__PURE__ */ new Map());
|
|
802
|
+
G(() => {
|
|
803
|
+
e && e.length > 0 && e.forEach((g, u) => {
|
|
804
|
+
const b = t(g, u);
|
|
805
|
+
s.has(b) && a.current.set(b, g);
|
|
806
|
+
});
|
|
807
|
+
}, [e, s, t]);
|
|
808
|
+
const l = S(
|
|
809
|
+
(g, u) => {
|
|
810
|
+
i((b) => {
|
|
811
|
+
const y = new Set(b);
|
|
812
|
+
y.has(g) ? (y.delete(g), a.current.delete(g)) : (y.add(g), a.current.set(g, u));
|
|
813
|
+
const v = Array.from(y).map(
|
|
814
|
+
(T) => a.current.get(T) || e.find((B, E) => t(B, E) === T)
|
|
815
|
+
).filter(Boolean);
|
|
816
|
+
return o?.(v, Array.from(y)), y;
|
|
817
|
+
});
|
|
818
|
+
},
|
|
819
|
+
[e, t, o]
|
|
820
|
+
), m = S(() => {
|
|
821
|
+
if (s.size === e.length && e.length > 0)
|
|
822
|
+
i(/* @__PURE__ */ new Set()), a.current.clear(), o?.([], []);
|
|
823
|
+
else {
|
|
824
|
+
const g = new Set(e.map((u, b) => t(u, b)));
|
|
825
|
+
e.forEach((u, b) => {
|
|
826
|
+
a.current.set(t(u, b), u);
|
|
827
|
+
}), i(g), o?.(e, Array.from(g));
|
|
828
|
+
}
|
|
829
|
+
}, [e, s.size, t, o]), d = S(() => {
|
|
830
|
+
i(/* @__PURE__ */ new Set()), a.current.clear(), o?.([], []);
|
|
831
|
+
}, [o]), c = e.length > 0 && s.size === e.length, n = s.size > 0 && s.size < e.length, f = $(() => Array.from(s).map(
|
|
832
|
+
(g) => a.current.get(g) || e.find((u, b) => t(u, b) === g)
|
|
833
|
+
).filter(Boolean), [e, s, t]);
|
|
834
|
+
return {
|
|
835
|
+
selectedKeys: s,
|
|
836
|
+
setSelectedKeys: i,
|
|
837
|
+
selectedRows: f,
|
|
838
|
+
onToggleSelectRow: l,
|
|
839
|
+
handleToggleSelectAll: m,
|
|
840
|
+
clearSelection: d,
|
|
841
|
+
allSelected: c,
|
|
842
|
+
isIndeterminate: n
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
function gr({
|
|
846
|
+
config: e,
|
|
847
|
+
totalCount: t,
|
|
848
|
+
scrollContainerRef: o
|
|
849
|
+
}) {
|
|
850
|
+
const s = $(() => typeof e == "object" && e !== null ? {
|
|
851
|
+
enabled: e.enabled !== !1,
|
|
852
|
+
rowHeight: e.rowHeight ?? 48,
|
|
853
|
+
maxHeight: e.maxHeight ?? 520,
|
|
854
|
+
overscan: e.overscan ?? 10
|
|
855
|
+
} : {
|
|
856
|
+
enabled: !!e,
|
|
857
|
+
rowHeight: 48,
|
|
858
|
+
maxHeight: 520,
|
|
859
|
+
overscan: 10
|
|
860
|
+
}, [e]), i = !!(s.enabled && t > 0), a = s.rowHeight || 48, l = s.maxHeight || 520, m = s.overscan ?? 10, [d, c] = P(0), [n, f] = P(
|
|
861
|
+
typeof l == "number" ? l : 520
|
|
862
|
+
), g = de(null);
|
|
863
|
+
G(() => {
|
|
864
|
+
if (!i) return;
|
|
865
|
+
const p = o.current;
|
|
866
|
+
if (!p) return;
|
|
867
|
+
p.clientHeight > 0 && f(p.clientHeight);
|
|
868
|
+
const x = () => {
|
|
869
|
+
g.current !== null && cancelAnimationFrame(g.current), g.current = requestAnimationFrame(() => {
|
|
870
|
+
p && c(p.scrollTop);
|
|
871
|
+
});
|
|
872
|
+
};
|
|
873
|
+
p.addEventListener("scroll", x, { passive: !0 });
|
|
874
|
+
let k = null;
|
|
875
|
+
return typeof ResizeObserver < "u" && (k = new ResizeObserver((w) => {
|
|
876
|
+
for (const D of w) {
|
|
877
|
+
const h = D.contentRect;
|
|
878
|
+
h.height > 0 && f(h.height);
|
|
879
|
+
}
|
|
880
|
+
}), k.observe(p)), () => {
|
|
881
|
+
p.removeEventListener("scroll", x), g.current !== null && cancelAnimationFrame(g.current), k && k.disconnect();
|
|
882
|
+
};
|
|
883
|
+
}, [i, o]);
|
|
884
|
+
const u = t * a, { startIndex: b, endIndex: y, paddingTop: v, paddingBottom: T } = $(() => {
|
|
885
|
+
if (!i || t === 0)
|
|
886
|
+
return {
|
|
887
|
+
startIndex: 0,
|
|
888
|
+
endIndex: Math.max(0, t - 1),
|
|
889
|
+
paddingTop: 0,
|
|
890
|
+
paddingBottom: 0
|
|
891
|
+
};
|
|
892
|
+
const p = Math.floor(d / a), x = Math.ceil(n / a), k = Math.max(0, p - m), w = Math.min(t - 1, p + x + m), D = k * a, h = Math.max(0, (t - 1 - w) * a);
|
|
893
|
+
return {
|
|
894
|
+
startIndex: k,
|
|
895
|
+
endIndex: w,
|
|
896
|
+
paddingTop: D,
|
|
897
|
+
paddingBottom: h
|
|
898
|
+
};
|
|
899
|
+
}, [i, t, a, d, n, m]), B = S(
|
|
900
|
+
(p, x = "auto") => {
|
|
901
|
+
const k = o.current;
|
|
902
|
+
if (!k) return;
|
|
903
|
+
const w = p * a, D = k.scrollTop, h = k.clientHeight || (typeof l == "number" ? l : 520);
|
|
904
|
+
let j = w;
|
|
905
|
+
if (x === "start")
|
|
906
|
+
j = w;
|
|
907
|
+
else if (x === "end")
|
|
908
|
+
j = w - h + a;
|
|
909
|
+
else if (x === "center")
|
|
910
|
+
j = w - h / 2 + a / 2;
|
|
911
|
+
else if (w < D)
|
|
912
|
+
j = w;
|
|
913
|
+
else if (w + a > D + h)
|
|
914
|
+
j = w - h + a;
|
|
915
|
+
else
|
|
916
|
+
return;
|
|
917
|
+
const M = Math.max(0, Math.min(j, u - h));
|
|
918
|
+
typeof k.scrollTo == "function" ? k.scrollTo({
|
|
919
|
+
top: M,
|
|
920
|
+
behavior: "smooth"
|
|
921
|
+
}) : k.scrollTop = M;
|
|
922
|
+
},
|
|
923
|
+
[a, l, u, o]
|
|
924
|
+
), E = S(
|
|
925
|
+
(p) => i ? p.slice(b, y + 1) : p,
|
|
926
|
+
[i, b, y]
|
|
927
|
+
);
|
|
928
|
+
return {
|
|
929
|
+
isVirtualized: i,
|
|
930
|
+
totalHeight: u,
|
|
931
|
+
paddingTop: v,
|
|
932
|
+
paddingBottom: T,
|
|
933
|
+
startIndex: b,
|
|
934
|
+
endIndex: y,
|
|
935
|
+
rowHeight: a,
|
|
936
|
+
maxHeight: l,
|
|
937
|
+
scrollToIndex: B,
|
|
938
|
+
sliceRows: E
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
const Qe = {
|
|
725
942
|
primary: "#2667EC",
|
|
726
943
|
primaryHover: "#1E54C6",
|
|
727
944
|
primaryLight: "#397FF6",
|
|
@@ -740,33 +957,19 @@ const tt = {
|
|
|
740
957
|
inputBg: "#1E293B",
|
|
741
958
|
rowHover: "rgba(38, 103, 236, 0.04)",
|
|
742
959
|
rowSelected: "rgba(38, 103, 236, 0.08)"
|
|
743
|
-
},
|
|
744
|
-
mode: "auto",
|
|
745
|
-
colors: tt,
|
|
746
|
-
borderRadius: "1rem",
|
|
747
|
-
fontFamily: "'Alexandria', system-ui, -apple-system, sans-serif",
|
|
748
|
-
density: "normal",
|
|
749
|
-
classes: {
|
|
750
|
-
container: "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100",
|
|
751
|
-
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors",
|
|
752
|
-
table: "w-full border-collapse text-left text-sm",
|
|
753
|
-
thead: "bg-gray-50/80 dark:bg-slate-800/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300 font-bold uppercase tracking-wider text-xs",
|
|
754
|
-
th: "py-3.5 px-4 font-bold select-none whitespace-nowrap",
|
|
755
|
-
tbody: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900",
|
|
756
|
-
tr: "transition-colors duration-150 hover:bg-gray-50/60 dark:hover:bg-slate-800/40",
|
|
757
|
-
td: "py-3 px-4 text-sm text-gray-700 dark:text-gray-300 align-middle",
|
|
758
|
-
searchContainer: "w-full sm:max-w-md relative flex items-center",
|
|
759
|
-
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all",
|
|
760
|
-
paginationContainer: "w-full flex flex-wrap items-center justify-between gap-4 pt-2 text-sm text-gray-600 dark:text-gray-400",
|
|
761
|
-
paginationButton: "h-9 min-w-[36px] px-3 flex items-center justify-center rounded-xl font-bold text-sm transition-all duration-150 bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
762
|
-
paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30",
|
|
763
|
-
paginationSelect: "h-9 px-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-gray-300 focus:outline-none focus:border-primary cursor-pointer"
|
|
764
|
-
}
|
|
765
|
-
}, Ve = {
|
|
960
|
+
}, Ye = {
|
|
766
961
|
default: {
|
|
767
|
-
colors:
|
|
962
|
+
colors: Qe,
|
|
768
963
|
borderRadius: "1rem",
|
|
769
|
-
density: "normal"
|
|
964
|
+
density: "normal",
|
|
965
|
+
classes: {
|
|
966
|
+
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors",
|
|
967
|
+
thead: "bg-gray-50/90 dark:bg-slate-800/90 backdrop-blur-md border-b border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300 font-bold uppercase text-xs tracking-wider",
|
|
968
|
+
tbody: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900",
|
|
969
|
+
tr: "transition-colors duration-150 hover:bg-blue-50/50 dark:hover:bg-blue-950/20",
|
|
970
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all",
|
|
971
|
+
paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30 font-bold"
|
|
972
|
+
}
|
|
770
973
|
},
|
|
771
974
|
midnight: {
|
|
772
975
|
colors: {
|
|
@@ -774,16 +977,16 @@ const tt = {
|
|
|
774
977
|
primaryHover: "#4F46E5",
|
|
775
978
|
primaryLight: "#818CF8",
|
|
776
979
|
rowHover: "rgba(99, 102, 241, 0.08)",
|
|
777
|
-
rowSelected: "rgba(99, 102, 241, 0.16)"
|
|
778
|
-
theadBg: "#0F172A",
|
|
779
|
-
theadText: "#C7D2FE"
|
|
980
|
+
rowSelected: "rgba(99, 102, 241, 0.16)"
|
|
780
981
|
},
|
|
781
982
|
borderRadius: "1.25rem",
|
|
782
983
|
classes: {
|
|
783
|
-
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-200 dark:border-indigo-
|
|
784
|
-
thead: "bg-indigo-
|
|
785
|
-
|
|
786
|
-
|
|
984
|
+
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-200 dark:border-indigo-900/70 bg-white dark:bg-[#090d1a] shadow-xl shadow-indigo-500/5 dark:shadow-indigo-950/40 transition-colors",
|
|
985
|
+
thead: "bg-indigo-50/90 dark:bg-[#0f172a] backdrop-blur-md border-b border-indigo-200 dark:border-indigo-900/80 text-indigo-900 dark:text-indigo-200 font-bold uppercase text-xs tracking-wider",
|
|
986
|
+
tbody: "divide-y divide-indigo-100 dark:divide-indigo-950/60 bg-white dark:bg-[#090d1a]",
|
|
987
|
+
tr: "transition-colors duration-150 hover:bg-indigo-50/70 dark:hover:bg-indigo-950/30",
|
|
988
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-indigo-200 dark:border-indigo-900/60 bg-white dark:bg-[#111728] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-indigo-300/40 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500 transition-all",
|
|
989
|
+
paginationButtonActive: "bg-indigo-600 text-white shadow-lg shadow-indigo-600/30 font-bold"
|
|
787
990
|
}
|
|
788
991
|
},
|
|
789
992
|
emerald: {
|
|
@@ -791,18 +994,17 @@ const tt = {
|
|
|
791
994
|
primary: "#10B981",
|
|
792
995
|
primaryHover: "#059669",
|
|
793
996
|
primaryLight: "#34D399",
|
|
794
|
-
border: "#10B98125",
|
|
795
997
|
rowHover: "rgba(16, 185, 129, 0.06)",
|
|
796
|
-
rowSelected: "rgba(16, 185, 129, 0.12)"
|
|
797
|
-
theadBg: "rgba(16, 185, 129, 0.08)",
|
|
798
|
-
theadText: "#065F46"
|
|
998
|
+
rowSelected: "rgba(16, 185, 129, 0.12)"
|
|
799
999
|
},
|
|
800
1000
|
borderRadius: "1rem",
|
|
801
1001
|
classes: {
|
|
802
|
-
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-
|
|
803
|
-
thead: "bg-emerald-
|
|
804
|
-
|
|
805
|
-
|
|
1002
|
+
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-300/60 dark:border-emerald-900/60 bg-white dark:bg-[#06140e] shadow-lg shadow-emerald-500/5 dark:shadow-emerald-950/30 transition-colors",
|
|
1003
|
+
thead: "bg-emerald-50/90 dark:bg-emerald-950/60 backdrop-blur-md border-b border-emerald-200 dark:border-emerald-900/60 text-emerald-900 dark:text-emerald-200 font-bold uppercase text-xs tracking-wider",
|
|
1004
|
+
tbody: "divide-y divide-emerald-100 dark:divide-emerald-950/60 bg-white dark:bg-[#06140e]",
|
|
1005
|
+
tr: "transition-colors duration-150 hover:bg-emerald-50/70 dark:hover:bg-emerald-950/30",
|
|
1006
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-emerald-300/60 dark:border-emerald-800/60 bg-white dark:bg-[#0c1c14] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-emerald-300/40 focus:outline-none focus:ring-2 focus:ring-emerald-500/40 focus:border-emerald-500 transition-all",
|
|
1007
|
+
paginationButtonActive: "bg-emerald-600 text-white shadow-md shadow-emerald-600/30 font-bold"
|
|
806
1008
|
}
|
|
807
1009
|
},
|
|
808
1010
|
ocean: {
|
|
@@ -812,16 +1014,16 @@ const tt = {
|
|
|
812
1014
|
primaryLight: "#38BDF8",
|
|
813
1015
|
secondary: "#06B6D4",
|
|
814
1016
|
rowHover: "rgba(14, 165, 233, 0.06)",
|
|
815
|
-
rowSelected: "rgba(14, 165, 233, 0.12)"
|
|
816
|
-
theadBg: "rgba(14, 165, 233, 0.08)",
|
|
817
|
-
theadText: "#0369A1"
|
|
1017
|
+
rowSelected: "rgba(14, 165, 233, 0.12)"
|
|
818
1018
|
},
|
|
819
1019
|
borderRadius: "1rem",
|
|
820
1020
|
classes: {
|
|
821
|
-
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-
|
|
822
|
-
thead: "bg-sky-
|
|
823
|
-
|
|
824
|
-
|
|
1021
|
+
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-300/60 dark:border-sky-900/60 bg-white dark:bg-[#07131d] shadow-lg shadow-sky-500/5 dark:shadow-sky-950/30 transition-colors",
|
|
1022
|
+
thead: "bg-sky-50/90 dark:bg-sky-950/60 backdrop-blur-md border-b border-sky-200 dark:border-sky-900/60 text-sky-900 dark:text-sky-200 font-bold uppercase text-xs tracking-wider",
|
|
1023
|
+
tbody: "divide-y divide-sky-100 dark:divide-sky-950/60 bg-white dark:bg-[#07131d]",
|
|
1024
|
+
tr: "transition-colors duration-150 hover:bg-sky-50/70 dark:hover:bg-sky-950/30",
|
|
1025
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-sky-300/60 dark:border-sky-800/60 bg-white dark:bg-[#0d1d2b] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-sky-300/40 focus:outline-none focus:ring-2 focus:ring-sky-500/40 focus:border-sky-500 transition-all",
|
|
1026
|
+
paginationButtonActive: "bg-sky-500 text-white shadow-md shadow-sky-500/30 font-bold"
|
|
825
1027
|
}
|
|
826
1028
|
},
|
|
827
1029
|
luxury: {
|
|
@@ -830,15 +1032,15 @@ const tt = {
|
|
|
830
1032
|
primaryHover: "#B45309",
|
|
831
1033
|
primaryLight: "#F59E0B",
|
|
832
1034
|
rowHover: "rgba(245, 158, 11, 0.06)",
|
|
833
|
-
rowSelected: "rgba(245, 158, 11, 0.14)"
|
|
834
|
-
theadBg: "rgba(245, 158, 11, 0.08)",
|
|
835
|
-
theadText: "#78350F"
|
|
1035
|
+
rowSelected: "rgba(245, 158, 11, 0.14)"
|
|
836
1036
|
},
|
|
837
1037
|
borderRadius: "1.25rem",
|
|
838
1038
|
classes: {
|
|
839
|
-
tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-300/
|
|
840
|
-
thead: "bg-amber-
|
|
841
|
-
|
|
1039
|
+
tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-300/80 dark:border-amber-700/60 bg-white dark:bg-[#14100a] shadow-xl shadow-amber-500/10 transition-colors",
|
|
1040
|
+
thead: "bg-amber-50/95 dark:bg-amber-950/80 backdrop-blur-md border-b border-amber-300/80 dark:border-amber-800/60 text-amber-950 dark:text-amber-200 font-black uppercase text-xs tracking-wider",
|
|
1041
|
+
tbody: "divide-y divide-amber-100 dark:divide-amber-950/60 bg-white dark:bg-[#14100a]",
|
|
1042
|
+
tr: "transition-colors duration-150 hover:bg-amber-50/80 dark:hover:bg-amber-950/40",
|
|
1043
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-amber-300/80 dark:border-amber-700/60 bg-white dark:bg-[#1c160e] text-gray-900 dark:text-amber-100 placeholder:text-gray-400 dark:placeholder:text-amber-400/40 focus:outline-none focus:ring-2 focus:ring-amber-500/40 focus:border-amber-500 transition-all",
|
|
842
1044
|
paginationButtonActive: "bg-gradient-to-r from-amber-500 to-yellow-500 text-white shadow-md shadow-amber-500/30 font-black"
|
|
843
1045
|
}
|
|
844
1046
|
},
|
|
@@ -848,16 +1050,16 @@ const tt = {
|
|
|
848
1050
|
primaryHover: "#E11D48",
|
|
849
1051
|
primaryLight: "#FB7185",
|
|
850
1052
|
rowHover: "rgba(244, 63, 94, 0.06)",
|
|
851
|
-
rowSelected: "rgba(244, 63, 94, 0.12)"
|
|
852
|
-
theadBg: "rgba(244, 63, 94, 0.08)",
|
|
853
|
-
theadText: "#881337"
|
|
1053
|
+
rowSelected: "rgba(244, 63, 94, 0.12)"
|
|
854
1054
|
},
|
|
855
1055
|
borderRadius: "1rem",
|
|
856
1056
|
classes: {
|
|
857
|
-
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-rose-
|
|
858
|
-
thead: "bg-rose-
|
|
859
|
-
|
|
860
|
-
|
|
1057
|
+
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-rose-300/60 dark:border-rose-900/60 bg-white dark:bg-[#15070c] shadow-lg shadow-rose-500/5 dark:shadow-rose-950/30 transition-colors",
|
|
1058
|
+
thead: "bg-rose-50/90 dark:bg-rose-950/60 backdrop-blur-md border-b border-rose-200 dark:border-rose-900/60 text-rose-900 dark:text-rose-200 font-bold uppercase text-xs tracking-wider",
|
|
1059
|
+
tbody: "divide-y divide-rose-100 dark:divide-rose-950/60 bg-white dark:bg-[#15070c]",
|
|
1060
|
+
tr: "transition-colors duration-150 hover:bg-rose-50/70 dark:hover:bg-rose-950/30",
|
|
1061
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-rose-300/60 dark:border-rose-800/60 bg-white dark:bg-[#1f0b13] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-rose-300/40 focus:outline-none focus:ring-2 focus:ring-rose-500/40 focus:border-rose-500 transition-all",
|
|
1062
|
+
paginationButtonActive: "bg-rose-500 text-white shadow-md shadow-rose-500/30 font-bold"
|
|
861
1063
|
}
|
|
862
1064
|
},
|
|
863
1065
|
minimal: {
|
|
@@ -881,236 +1083,282 @@ const tt = {
|
|
|
881
1083
|
borderRadius: "0.375rem",
|
|
882
1084
|
density: "compact",
|
|
883
1085
|
classes: {
|
|
884
|
-
tableWrapper: "w-full overflow-x-auto rounded-md border border-
|
|
885
|
-
thead: "bg-
|
|
886
|
-
|
|
887
|
-
|
|
1086
|
+
tableWrapper: "w-full overflow-x-auto rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-900 shadow-sm transition-colors",
|
|
1087
|
+
thead: "bg-slate-100 dark:bg-slate-800 border-b border-slate-300 dark:border-slate-700 text-slate-800 dark:text-slate-200 font-bold uppercase text-xs tracking-wider",
|
|
1088
|
+
tbody: "divide-y divide-slate-200 dark:divide-slate-800 bg-white dark:bg-slate-900",
|
|
1089
|
+
tr: "transition-colors hover:bg-slate-50 dark:hover:bg-slate-800/60",
|
|
1090
|
+
searchInput: "w-full pl-9 pr-8 py-1.5 rounded border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-800 text-xs",
|
|
1091
|
+
paginationButtonActive: "bg-blue-800 text-white font-bold"
|
|
888
1092
|
}
|
|
889
1093
|
}
|
|
890
|
-
},
|
|
1094
|
+
}, et = {
|
|
1095
|
+
mode: "auto",
|
|
1096
|
+
colors: Qe,
|
|
1097
|
+
borderRadius: "1rem",
|
|
1098
|
+
fontFamily: "'Alexandria', system-ui, -apple-system, sans-serif",
|
|
1099
|
+
density: "normal",
|
|
1100
|
+
classes: {
|
|
1101
|
+
container: "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100",
|
|
1102
|
+
tableWrapper: "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors",
|
|
1103
|
+
table: "w-full border-collapse text-left text-sm",
|
|
1104
|
+
thead: "bg-gray-50/80 dark:bg-slate-800/80 backdrop-blur-md border-b border-gray-200 dark:border-gray-800 text-gray-700 dark:text-gray-300 font-bold uppercase tracking-wider text-xs",
|
|
1105
|
+
th: "py-3.5 px-4 font-bold select-none whitespace-nowrap",
|
|
1106
|
+
tbody: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900",
|
|
1107
|
+
tr: "transition-colors duration-150 hover:bg-gray-50/60 dark:hover:bg-slate-800/40",
|
|
1108
|
+
td: "py-3 px-4 text-sm text-gray-700 dark:text-gray-300 align-middle",
|
|
1109
|
+
searchContainer: "w-full sm:max-w-md relative flex items-center",
|
|
1110
|
+
searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all",
|
|
1111
|
+
paginationContainer: "w-full flex flex-wrap items-center justify-between gap-4 pt-2 text-sm text-gray-600 dark:text-gray-400",
|
|
1112
|
+
paginationButton: "h-9 min-w-[36px] px-3 flex items-center justify-center rounded-xl font-bold text-sm transition-all duration-150 bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40 disabled:cursor-not-allowed",
|
|
1113
|
+
paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30",
|
|
1114
|
+
paginationSelect: "h-9 px-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-gray-300 focus:outline-none focus:border-primary cursor-pointer"
|
|
1115
|
+
}
|
|
1116
|
+
}, xe = Ft(et), ur = ({
|
|
891
1117
|
theme: e,
|
|
892
1118
|
preset: t,
|
|
893
|
-
children:
|
|
1119
|
+
children: o
|
|
894
1120
|
}) => {
|
|
895
|
-
const
|
|
896
|
-
const
|
|
1121
|
+
const s = qe(xe), i = $(() => {
|
|
1122
|
+
const a = s || et, l = t && Ye[t] ? Ye[t] : {};
|
|
897
1123
|
return {
|
|
898
|
-
...
|
|
899
|
-
...
|
|
1124
|
+
...a,
|
|
1125
|
+
...l,
|
|
900
1126
|
...e || {},
|
|
901
1127
|
colors: {
|
|
902
|
-
...
|
|
903
|
-
...
|
|
1128
|
+
...a.colors,
|
|
1129
|
+
...l.colors || {},
|
|
904
1130
|
...e?.colors || {}
|
|
905
1131
|
},
|
|
906
1132
|
classes: {
|
|
907
|
-
...
|
|
908
|
-
...
|
|
1133
|
+
...a.classes,
|
|
1134
|
+
...l.classes || {},
|
|
909
1135
|
...e?.classes || {}
|
|
910
1136
|
}
|
|
911
1137
|
};
|
|
912
|
-
}, [
|
|
913
|
-
return /* @__PURE__ */
|
|
1138
|
+
}, [s, t, e]);
|
|
1139
|
+
return /* @__PURE__ */ r.createElement(xe.Provider, { value: i }, o);
|
|
914
1140
|
};
|
|
915
|
-
function
|
|
916
|
-
return
|
|
1141
|
+
function X() {
|
|
1142
|
+
return qe(xe);
|
|
917
1143
|
}
|
|
918
|
-
|
|
1144
|
+
function br({
|
|
919
1145
|
value: e,
|
|
920
1146
|
onChange: t,
|
|
921
|
-
onClear:
|
|
922
|
-
isDebouncing:
|
|
923
|
-
placeholder:
|
|
924
|
-
})
|
|
925
|
-
const
|
|
926
|
-
return /* @__PURE__ */
|
|
927
|
-
|
|
1147
|
+
onClear: o,
|
|
1148
|
+
isDebouncing: s = !1,
|
|
1149
|
+
placeholder: i = "Search records..."
|
|
1150
|
+
}) {
|
|
1151
|
+
const a = X();
|
|
1152
|
+
return /* @__PURE__ */ r.createElement("div", { className: a.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center" }, /* @__PURE__ */ r.createElement("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center" }, /* @__PURE__ */ r.createElement(
|
|
1153
|
+
"svg",
|
|
1154
|
+
{
|
|
1155
|
+
className: "w-4 h-4",
|
|
1156
|
+
fill: "none",
|
|
1157
|
+
stroke: "currentColor",
|
|
1158
|
+
viewBox: "0 0 24 24",
|
|
1159
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1160
|
+
},
|
|
1161
|
+
/* @__PURE__ */ r.createElement(
|
|
1162
|
+
"path",
|
|
1163
|
+
{
|
|
1164
|
+
strokeLinecap: "round",
|
|
1165
|
+
strokeLinejoin: "round",
|
|
1166
|
+
strokeWidth: 2,
|
|
1167
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
1168
|
+
}
|
|
1169
|
+
)
|
|
1170
|
+
)), /* @__PURE__ */ r.createElement(
|
|
1171
|
+
"input",
|
|
1172
|
+
{
|
|
1173
|
+
type: "text",
|
|
1174
|
+
value: e,
|
|
1175
|
+
onChange: (l) => t(l.target.value),
|
|
1176
|
+
placeholder: i,
|
|
1177
|
+
className: a.classes?.searchInput || "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all"
|
|
1178
|
+
}
|
|
1179
|
+
), /* @__PURE__ */ r.createElement("div", { className: "absolute right-3 flex items-center gap-1.5" }, s && /* @__PURE__ */ r.createElement("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }), e && /* @__PURE__ */ r.createElement(
|
|
1180
|
+
"button",
|
|
1181
|
+
{
|
|
1182
|
+
type: "button",
|
|
1183
|
+
onClick: o,
|
|
1184
|
+
className: "p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded-full hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors",
|
|
1185
|
+
title: "Clear search"
|
|
1186
|
+
},
|
|
1187
|
+
/* @__PURE__ */ r.createElement(
|
|
928
1188
|
"svg",
|
|
929
1189
|
{
|
|
930
|
-
className: "w-
|
|
1190
|
+
className: "w-3.5 h-3.5",
|
|
931
1191
|
fill: "none",
|
|
932
1192
|
stroke: "currentColor",
|
|
933
1193
|
viewBox: "0 0 24 24",
|
|
934
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
)
|
|
978
|
-
] })
|
|
979
|
-
] });
|
|
980
|
-
}, sr = ({
|
|
1194
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
1195
|
+
},
|
|
1196
|
+
/* @__PURE__ */ r.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
|
|
1197
|
+
)
|
|
1198
|
+
)));
|
|
1199
|
+
}
|
|
1200
|
+
function fr({
|
|
1201
|
+
displayTitle: e,
|
|
1202
|
+
subtitle: t,
|
|
1203
|
+
isSearchEnabled: o,
|
|
1204
|
+
searchQuery: s = "",
|
|
1205
|
+
setSearch: i,
|
|
1206
|
+
clearSearch: a,
|
|
1207
|
+
isDebouncing: l = !1,
|
|
1208
|
+
searchPlaceholder: m,
|
|
1209
|
+
headerActions: d,
|
|
1210
|
+
add: c,
|
|
1211
|
+
linkAdd: n,
|
|
1212
|
+
addHandler: f
|
|
1213
|
+
}) {
|
|
1214
|
+
return !(e || t || o || d || c) ? null : /* @__PURE__ */ r.createElement("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1" }, (e || t) && /* @__PURE__ */ r.createElement("div", { className: "flex flex-col" }, e && /* @__PURE__ */ r.createElement("h3", { className: "text-lg font-bold tracking-tight text-gray-900 dark:text-white flex items-center gap-2" }, e), t && /* @__PURE__ */ r.createElement("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-0.5" }, t)), /* @__PURE__ */ r.createElement("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto" }, o && i && a && /* @__PURE__ */ r.createElement(
|
|
1215
|
+
br,
|
|
1216
|
+
{
|
|
1217
|
+
value: s,
|
|
1218
|
+
onChange: i,
|
|
1219
|
+
onClear: a,
|
|
1220
|
+
isDebouncing: l,
|
|
1221
|
+
placeholder: m
|
|
1222
|
+
}
|
|
1223
|
+
), d, c && /* @__PURE__ */ r.createElement(
|
|
1224
|
+
"button",
|
|
1225
|
+
{
|
|
1226
|
+
type: "button",
|
|
1227
|
+
onClick: () => {
|
|
1228
|
+
f ? f() : n && typeof window < "u" && (window.location.href = n);
|
|
1229
|
+
},
|
|
1230
|
+
className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-white text-xs sm:text-sm font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95 whitespace-nowrap"
|
|
1231
|
+
},
|
|
1232
|
+
/* @__PURE__ */ r.createElement("span", null, "+"),
|
|
1233
|
+
/* @__PURE__ */ r.createElement("span", null, "Add ", e || "Record")
|
|
1234
|
+
)));
|
|
1235
|
+
}
|
|
1236
|
+
function yr({
|
|
981
1237
|
columns: e,
|
|
982
1238
|
hasActions: t,
|
|
983
|
-
actionsTitle:
|
|
984
|
-
actionsWidth:
|
|
985
|
-
sortBy:
|
|
986
|
-
sortOrder:
|
|
987
|
-
onSort:
|
|
988
|
-
selectable:
|
|
989
|
-
allSelected:
|
|
990
|
-
isIndeterminate:
|
|
1239
|
+
actionsTitle: o = "Actions",
|
|
1240
|
+
actionsWidth: s,
|
|
1241
|
+
sortBy: i,
|
|
1242
|
+
sortOrder: a,
|
|
1243
|
+
onSort: l,
|
|
1244
|
+
selectable: m,
|
|
1245
|
+
allSelected: d,
|
|
1246
|
+
isIndeterminate: c,
|
|
991
1247
|
onToggleSelectAll: n,
|
|
992
|
-
headerClassName:
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1248
|
+
headerClassName: f = "",
|
|
1249
|
+
sticky: g = !1
|
|
1250
|
+
}) {
|
|
1251
|
+
const u = X(), b = {};
|
|
1252
|
+
return g && (b.position = "sticky", b.top = 0, b.zIndex = 10), u.colors?.theadBg && (b.backgroundColor = u.colors.theadBg), u.colors?.theadText && (b.color = u.colors.theadText), /* @__PURE__ */ r.createElement(
|
|
996
1253
|
"thead",
|
|
997
1254
|
{
|
|
998
1255
|
style: b,
|
|
999
|
-
className: `${
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1256
|
+
className: `${u.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800"} ${f}`
|
|
1257
|
+
},
|
|
1258
|
+
/* @__PURE__ */ r.createElement("tr", null, m && /* @__PURE__ */ r.createElement("th", { className: "w-10 px-4 py-3 text-center align-middle" }, /* @__PURE__ */ r.createElement(
|
|
1259
|
+
"input",
|
|
1260
|
+
{
|
|
1261
|
+
type: "checkbox",
|
|
1262
|
+
checked: d,
|
|
1263
|
+
ref: (y) => {
|
|
1264
|
+
y && (y.indeterminate = !!c);
|
|
1265
|
+
},
|
|
1266
|
+
onChange: n,
|
|
1267
|
+
className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
|
|
1268
|
+
}
|
|
1269
|
+
)), e.map((y) => {
|
|
1270
|
+
const v = i === y.key, T = y.sortable !== !1 && !!l, B = y.align === "center" ? "text-center" : y.align === "right" ? "text-right" : "text-left";
|
|
1271
|
+
return /* @__PURE__ */ r.createElement(
|
|
1272
|
+
"th",
|
|
1273
|
+
{
|
|
1274
|
+
key: String(y.key),
|
|
1275
|
+
style: {
|
|
1276
|
+
width: y.width,
|
|
1277
|
+
minWidth: y.minWidth,
|
|
1278
|
+
maxWidth: y.maxWidth
|
|
1279
|
+
},
|
|
1280
|
+
onClick: () => T && l?.(String(y.key)),
|
|
1281
|
+
className: `${u.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${B} ${y.headerClassName || ""} ${T ? "cursor-pointer hover:text-primary transition-colors group" : ""}`
|
|
1282
|
+
},
|
|
1283
|
+
/* @__PURE__ */ r.createElement(
|
|
1284
|
+
"div",
|
|
1003
1285
|
{
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
onChange: n,
|
|
1010
|
-
className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
|
|
1011
|
-
}
|
|
1012
|
-
) }),
|
|
1013
|
-
e.map((f) => {
|
|
1014
|
-
const k = l === f.key, C = f.sortable !== !1 && !!i, D = f.align === "center" ? "text-center" : f.align === "right" ? "text-right" : "text-left";
|
|
1015
|
-
return /* @__PURE__ */ a(
|
|
1016
|
-
"th",
|
|
1286
|
+
className: `inline-flex items-center gap-1.5 ${y.align === "center" ? "justify-center" : y.align === "right" ? "justify-end" : "justify-start"}`
|
|
1287
|
+
},
|
|
1288
|
+
/* @__PURE__ */ r.createElement("span", null, y.title),
|
|
1289
|
+
T && /* @__PURE__ */ r.createElement(
|
|
1290
|
+
"span",
|
|
1017
1291
|
{
|
|
1018
|
-
|
|
1019
|
-
width: f.width,
|
|
1020
|
-
minWidth: f.minWidth,
|
|
1021
|
-
maxWidth: f.maxWidth
|
|
1022
|
-
},
|
|
1023
|
-
onClick: () => C && i?.(String(f.key)),
|
|
1024
|
-
className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${D} ${f.headerClassName || ""} ${C ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
|
|
1025
|
-
children: /* @__PURE__ */ y(
|
|
1026
|
-
"div",
|
|
1027
|
-
{
|
|
1028
|
-
className: `inline-flex items-center gap-1.5 ${f.align === "center" ? "justify-center" : f.align === "right" ? "justify-end" : "justify-start"}`,
|
|
1029
|
-
children: [
|
|
1030
|
-
/* @__PURE__ */ a("span", { children: f.title }),
|
|
1031
|
-
C && /* @__PURE__ */ a(
|
|
1032
|
-
"span",
|
|
1033
|
-
{
|
|
1034
|
-
className: `inline-flex flex-col text-[10px] transition-transform ${k ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
|
|
1035
|
-
children: k ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ a("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
|
|
1036
|
-
}
|
|
1037
|
-
)
|
|
1038
|
-
]
|
|
1039
|
-
}
|
|
1040
|
-
)
|
|
1292
|
+
className: `inline-flex flex-col text-[10px] transition-transform ${v ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`
|
|
1041
1293
|
},
|
|
1042
|
-
|
|
1043
|
-
)
|
|
1044
|
-
}),
|
|
1045
|
-
t && /* @__PURE__ */ a(
|
|
1046
|
-
"th",
|
|
1047
|
-
{
|
|
1048
|
-
style: { width: o || "auto" },
|
|
1049
|
-
className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`,
|
|
1050
|
-
children: s
|
|
1051
|
-
}
|
|
1294
|
+
v ? a === "asc" ? "▲" : "▼" : /* @__PURE__ */ r.createElement("span", { className: "text-[9px] leading-none opacity-50" }, "▲▼")
|
|
1295
|
+
)
|
|
1052
1296
|
)
|
|
1053
|
-
|
|
1054
|
-
}
|
|
1297
|
+
);
|
|
1298
|
+
}), t && /* @__PURE__ */ r.createElement(
|
|
1299
|
+
"th",
|
|
1300
|
+
{
|
|
1301
|
+
style: { width: s || "auto" },
|
|
1302
|
+
className: `${u.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`
|
|
1303
|
+
},
|
|
1304
|
+
o
|
|
1305
|
+
))
|
|
1055
1306
|
);
|
|
1056
|
-
}
|
|
1307
|
+
}
|
|
1308
|
+
const _ = () => /* @__PURE__ */ r.createElement("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm" }, "—");
|
|
1309
|
+
function tt({ value: e }) {
|
|
1057
1310
|
if (e == null || e === "")
|
|
1058
|
-
return /* @__PURE__ */
|
|
1311
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1059
1312
|
const t = String(e);
|
|
1060
|
-
return /* @__PURE__ */
|
|
1061
|
-
}
|
|
1313
|
+
return /* @__PURE__ */ r.createElement("span", { className: "truncate block max-w-xs font-normal text-sm", title: t }, t);
|
|
1314
|
+
}
|
|
1315
|
+
function pr({ value: e }) {
|
|
1062
1316
|
if (e == null || isNaN(Number(e)))
|
|
1063
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1064
1318
|
const t = Number(e);
|
|
1065
|
-
return /* @__PURE__ */
|
|
1066
|
-
}
|
|
1319
|
+
return /* @__PURE__ */ r.createElement("span", { className: "font-mono text-sm font-medium" }, t.toLocaleString());
|
|
1320
|
+
}
|
|
1321
|
+
function xr({ value: e }) {
|
|
1067
1322
|
if (e == null)
|
|
1068
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1069
1324
|
const t = !!e;
|
|
1070
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ r.createElement(
|
|
1071
1326
|
"span",
|
|
1072
1327
|
{
|
|
1073
|
-
className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold tracking-wide ${t ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20" : "bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/20"}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
]
|
|
1078
|
-
}
|
|
1328
|
+
className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold tracking-wide ${t ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20" : "bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/20"}`
|
|
1329
|
+
},
|
|
1330
|
+
/* @__PURE__ */ r.createElement("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
|
|
1331
|
+
t ? "Yes" : "No"
|
|
1079
1332
|
);
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
s.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
|
|
1088
|
-
t && /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: s.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
|
|
1089
|
-
] });
|
|
1090
|
-
}, lr = ({ value: e, column: t }) => {
|
|
1333
|
+
}
|
|
1334
|
+
function Ge({ value: e, isDateTime: t = !1 }) {
|
|
1335
|
+
if (!e) return /* @__PURE__ */ r.createElement(_, null);
|
|
1336
|
+
const o = e instanceof Date ? e : new Date(e);
|
|
1337
|
+
return isNaN(o.getTime()) ? /* @__PURE__ */ r.createElement(tt, { value: e, column: { key: "" } }) : /* @__PURE__ */ r.createElement("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300" }, o.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }), t && /* @__PURE__ */ r.createElement("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5" }, o.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" })));
|
|
1338
|
+
}
|
|
1339
|
+
function hr({ value: e, column: t }) {
|
|
1091
1340
|
if (e == null || isNaN(Number(e)))
|
|
1092
|
-
return /* @__PURE__ */
|
|
1093
|
-
const
|
|
1094
|
-
return /* @__PURE__ */
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
] });
|
|
1099
|
-
}, Ze = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E", dr = ({ value: e }) => {
|
|
1341
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1342
|
+
const o = Number(e), s = t.currency || "EGP";
|
|
1343
|
+
return /* @__PURE__ */ r.createElement("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white" }, o.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }), " ", /* @__PURE__ */ r.createElement("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400" }, s));
|
|
1344
|
+
}
|
|
1345
|
+
const Ke = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E";
|
|
1346
|
+
function kr({ value: e }) {
|
|
1100
1347
|
let t = "";
|
|
1101
|
-
return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t =
|
|
1348
|
+
return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Ke), /* @__PURE__ */ r.createElement("div", { className: "flex items-center justify-center" }, /* @__PURE__ */ r.createElement(
|
|
1102
1349
|
"img",
|
|
1103
1350
|
{
|
|
1104
1351
|
src: t,
|
|
1105
1352
|
alt: "Thumbnail",
|
|
1106
1353
|
className: "w-10 h-10 rounded-full object-cover border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 shadow-sm",
|
|
1107
1354
|
loading: "lazy",
|
|
1108
|
-
onError: (
|
|
1109
|
-
|
|
1355
|
+
onError: (o) => {
|
|
1356
|
+
o.target.src = Ke;
|
|
1110
1357
|
}
|
|
1111
1358
|
}
|
|
1112
|
-
)
|
|
1113
|
-
}
|
|
1359
|
+
));
|
|
1360
|
+
}
|
|
1361
|
+
const wr = {
|
|
1114
1362
|
active: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
|
|
1115
1363
|
delivered: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
|
|
1116
1364
|
completed: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
|
|
@@ -1126,251 +1374,254 @@ const nr = ({
|
|
|
1126
1374
|
cancelled: { bg: "bg-rose-500/10 border-rose-500/20", text: "text-rose-600 dark:text-rose-400", dot: "bg-rose-500" },
|
|
1127
1375
|
offline: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" },
|
|
1128
1376
|
closed: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" }
|
|
1129
|
-
}
|
|
1377
|
+
};
|
|
1378
|
+
function vr({ value: e, column: t }) {
|
|
1130
1379
|
if (e == null || e === "")
|
|
1131
|
-
return /* @__PURE__ */
|
|
1132
|
-
const
|
|
1133
|
-
if (t.statusMap && t.statusMap[
|
|
1134
|
-
const
|
|
1135
|
-
return /* @__PURE__ */
|
|
1380
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1381
|
+
const o = String(e), s = o.toLowerCase();
|
|
1382
|
+
if (t.statusMap && t.statusMap[o]) {
|
|
1383
|
+
const a = t.statusMap[o];
|
|
1384
|
+
return /* @__PURE__ */ r.createElement(
|
|
1136
1385
|
"span",
|
|
1137
1386
|
{
|
|
1138
1387
|
className: "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border",
|
|
1139
|
-
style: { color:
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
]
|
|
1144
|
-
}
|
|
1388
|
+
style: { color: a.color, backgroundColor: a.bg }
|
|
1389
|
+
},
|
|
1390
|
+
/* @__PURE__ */ r.createElement("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: a.color } }),
|
|
1391
|
+
a.label || o
|
|
1145
1392
|
);
|
|
1146
1393
|
}
|
|
1147
|
-
const
|
|
1394
|
+
const i = wr[s] || {
|
|
1148
1395
|
bg: "bg-gray-500/10 border-gray-500/20",
|
|
1149
1396
|
text: "text-gray-700 dark:text-gray-300",
|
|
1150
1397
|
dot: "bg-gray-400"
|
|
1151
1398
|
};
|
|
1152
|
-
return /* @__PURE__ */
|
|
1399
|
+
return /* @__PURE__ */ r.createElement(
|
|
1153
1400
|
"span",
|
|
1154
1401
|
{
|
|
1155
|
-
className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border ${
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
]
|
|
1160
|
-
}
|
|
1402
|
+
className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border ${i.bg} ${i.text}`
|
|
1403
|
+
},
|
|
1404
|
+
/* @__PURE__ */ r.createElement("span", { className: `w-1.5 h-1.5 rounded-full ${i.dot}` }),
|
|
1405
|
+
o
|
|
1161
1406
|
);
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1407
|
+
}
|
|
1408
|
+
function Er({ value: e }) {
|
|
1409
|
+
return !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ r.createElement(_, null) : /* @__PURE__ */ r.createElement("div", { className: "flex flex-wrap gap-1 items-center" }, e.slice(0, 3).map((t, o) => /* @__PURE__ */ r.createElement(
|
|
1164
1410
|
"span",
|
|
1165
1411
|
{
|
|
1166
|
-
|
|
1167
|
-
|
|
1412
|
+
key: o,
|
|
1413
|
+
className: "inline-block px-2 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700"
|
|
1168
1414
|
},
|
|
1169
|
-
|
|
1170
|
-
)),
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
if (!e) return /* @__PURE__ */
|
|
1415
|
+
typeof t == "object" ? JSON.stringify(t) : String(t)
|
|
1416
|
+
)), e.length > 3 && /* @__PURE__ */ r.createElement("span", { className: "text-xs text-gray-400 font-medium" }, "+", e.length - 3));
|
|
1417
|
+
}
|
|
1418
|
+
function Nr({ value: e }) {
|
|
1419
|
+
return !e || typeof e != "object" ? /* @__PURE__ */ r.createElement(_, null) : "en" in e || "ar" in e ? /* @__PURE__ */ r.createElement("span", { className: "font-medium text-sm" }, e.en || e.ar || "") : /* @__PURE__ */ r.createElement("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e) }, JSON.stringify(e));
|
|
1420
|
+
}
|
|
1421
|
+
function Ar({ value: e }) {
|
|
1422
|
+
if (!e) return /* @__PURE__ */ r.createElement(_, null);
|
|
1177
1423
|
const t = String(e);
|
|
1178
|
-
return /* @__PURE__ */
|
|
1424
|
+
return /* @__PURE__ */ r.createElement(
|
|
1179
1425
|
"a",
|
|
1180
1426
|
{
|
|
1181
1427
|
href: t,
|
|
1182
1428
|
target: "_blank",
|
|
1183
1429
|
rel: "noopener noreferrer",
|
|
1184
|
-
className: "text-primary hover:underline text-sm font-medium inline-flex items-center gap-1"
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
]
|
|
1189
|
-
}
|
|
1430
|
+
className: "text-primary hover:underline text-sm font-medium inline-flex items-center gap-1"
|
|
1431
|
+
},
|
|
1432
|
+
/* @__PURE__ */ r.createElement("span", { className: "truncate max-w-[150px]" }, t),
|
|
1433
|
+
/* @__PURE__ */ r.createElement("span", { className: "text-xs" }, "↗")
|
|
1190
1434
|
);
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1435
|
+
}
|
|
1436
|
+
function Tr({ value: e }) {
|
|
1437
|
+
if (!e) return /* @__PURE__ */ r.createElement(_, null);
|
|
1193
1438
|
const t = String(e);
|
|
1194
|
-
return /* @__PURE__ */
|
|
1439
|
+
return /* @__PURE__ */ r.createElement(
|
|
1195
1440
|
"a",
|
|
1196
1441
|
{
|
|
1197
1442
|
href: `mailto:${t}`,
|
|
1198
|
-
className: "text-primary hover:underline text-sm font-medium truncate block max-w-xs"
|
|
1199
|
-
|
|
1200
|
-
|
|
1443
|
+
className: "text-primary hover:underline text-sm font-medium truncate block max-w-xs"
|
|
1444
|
+
},
|
|
1445
|
+
t
|
|
1201
1446
|
);
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1447
|
+
}
|
|
1448
|
+
function Sr({ value: e }) {
|
|
1449
|
+
if (!e) return /* @__PURE__ */ r.createElement(_, null);
|
|
1204
1450
|
const t = String(e);
|
|
1205
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ r.createElement(
|
|
1206
1452
|
"a",
|
|
1207
1453
|
{
|
|
1208
1454
|
href: `tel:${t}`,
|
|
1209
|
-
className: "font-mono text-sm text-gray-800 dark:text-gray-200 hover:text-primary transition-colors"
|
|
1210
|
-
|
|
1211
|
-
|
|
1455
|
+
className: "font-mono text-sm text-gray-800 dark:text-gray-200 hover:text-primary transition-colors"
|
|
1456
|
+
},
|
|
1457
|
+
t
|
|
1212
1458
|
);
|
|
1213
|
-
}
|
|
1459
|
+
}
|
|
1460
|
+
function Cr({ value: e }) {
|
|
1214
1461
|
if (e == null || isNaN(Number(e)))
|
|
1215
|
-
return /* @__PURE__ */
|
|
1216
|
-
const t = Math.min(100, Math.max(0, Math.round(Number(e)))),
|
|
1217
|
-
return /* @__PURE__ */
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
{
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
t,
|
|
1227
|
-
"%"
|
|
1228
|
-
] })
|
|
1229
|
-
] });
|
|
1230
|
-
}, pr = ({ value: e }) => {
|
|
1462
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1463
|
+
const t = Math.min(100, Math.max(0, Math.round(Number(e)))), o = t >= 80 ? "bg-emerald-500" : t >= 50 ? "bg-blue-500" : t >= 30 ? "bg-amber-500" : "bg-rose-500";
|
|
1464
|
+
return /* @__PURE__ */ r.createElement("div", { className: "flex items-center gap-2.5 min-w-[120px]" }, /* @__PURE__ */ r.createElement("div", { className: "flex-1 h-2 rounded-full bg-gray-200 dark:bg-slate-700 overflow-hidden" }, /* @__PURE__ */ r.createElement(
|
|
1465
|
+
"div",
|
|
1466
|
+
{
|
|
1467
|
+
className: `h-full rounded-full ${o} transition-all duration-500`,
|
|
1468
|
+
style: { width: `${t}%` }
|
|
1469
|
+
}
|
|
1470
|
+
)), /* @__PURE__ */ r.createElement("span", { className: "font-mono text-xs font-bold text-gray-700 dark:text-gray-300 w-9 text-right" }, t, "%"));
|
|
1471
|
+
}
|
|
1472
|
+
function Pr({ value: e }) {
|
|
1231
1473
|
if (e == null || isNaN(Number(e)))
|
|
1232
|
-
return /* @__PURE__ */
|
|
1474
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1233
1475
|
const t = Number(e);
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
/* @__PURE__ */ a("span", { className: "text-gray-400 dark:text-gray-500 text-[10px]", children: "/ 5" })
|
|
1238
|
-
] });
|
|
1239
|
-
}, xr = ({ value: e }) => {
|
|
1476
|
+
return /* @__PURE__ */ r.createElement("div", { className: "inline-flex items-center gap-1.5 font-medium text-xs text-amber-500" }, /* @__PURE__ */ r.createElement("span", { className: "text-sm" }, "★"), /* @__PURE__ */ r.createElement("span", { className: "font-bold text-gray-900 dark:text-gray-100" }, t.toFixed(1)), /* @__PURE__ */ r.createElement("span", { className: "text-gray-400 dark:text-gray-500 text-[10px]" }, "/ 5"));
|
|
1477
|
+
}
|
|
1478
|
+
function $r({ value: e }) {
|
|
1240
1479
|
if (e == null || e === "")
|
|
1241
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ r.createElement(_, null);
|
|
1242
1481
|
const t = String(e);
|
|
1243
|
-
return /* @__PURE__ */
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1482
|
+
return /* @__PURE__ */ r.createElement("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-lg text-xs font-bold bg-primary/10 text-primary border border-primary/20" }, t);
|
|
1483
|
+
}
|
|
1484
|
+
function Br({
|
|
1485
|
+
row: e,
|
|
1486
|
+
column: t,
|
|
1487
|
+
rowIndex: o
|
|
1488
|
+
}) {
|
|
1489
|
+
const s = A(e, t.key);
|
|
1246
1490
|
if (t.render && typeof t.render == "function")
|
|
1247
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, t.render(s, e, o));
|
|
1248
1492
|
if (t.formatter && typeof t.formatter == "function")
|
|
1249
|
-
return /* @__PURE__ */
|
|
1493
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, t.formatter(s, e, o));
|
|
1250
1494
|
switch (t.type) {
|
|
1251
1495
|
case "boolean":
|
|
1252
|
-
return /* @__PURE__ */
|
|
1496
|
+
return /* @__PURE__ */ r.createElement(xr, { value: s, column: t });
|
|
1253
1497
|
case "number":
|
|
1254
|
-
return /* @__PURE__ */
|
|
1498
|
+
return /* @__PURE__ */ r.createElement(pr, { value: s, column: t });
|
|
1255
1499
|
case "currency":
|
|
1256
|
-
return /* @__PURE__ */
|
|
1500
|
+
return /* @__PURE__ */ r.createElement(hr, { value: s, column: t });
|
|
1257
1501
|
case "date":
|
|
1258
|
-
return /* @__PURE__ */
|
|
1502
|
+
return /* @__PURE__ */ r.createElement(Ge, { value: s, column: t, isDateTime: !1 });
|
|
1259
1503
|
case "datetime":
|
|
1260
|
-
return /* @__PURE__ */
|
|
1504
|
+
return /* @__PURE__ */ r.createElement(Ge, { value: s, column: t, isDateTime: !0 });
|
|
1261
1505
|
case "image":
|
|
1262
|
-
return /* @__PURE__ */
|
|
1506
|
+
return /* @__PURE__ */ r.createElement(kr, { value: s, column: t });
|
|
1263
1507
|
case "status":
|
|
1264
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ r.createElement(vr, { value: s, column: t });
|
|
1265
1509
|
case "progress":
|
|
1266
|
-
return /* @__PURE__ */
|
|
1510
|
+
return /* @__PURE__ */ r.createElement(Cr, { value: s, column: t });
|
|
1267
1511
|
case "rating":
|
|
1268
|
-
return /* @__PURE__ */
|
|
1512
|
+
return /* @__PURE__ */ r.createElement(Pr, { value: s, column: t });
|
|
1269
1513
|
case "badge":
|
|
1270
|
-
return /* @__PURE__ */
|
|
1514
|
+
return /* @__PURE__ */ r.createElement($r, { value: s, column: t });
|
|
1271
1515
|
case "array":
|
|
1272
|
-
return /* @__PURE__ */
|
|
1516
|
+
return /* @__PURE__ */ r.createElement(Er, { value: s, column: t });
|
|
1273
1517
|
case "object":
|
|
1274
|
-
return /* @__PURE__ */
|
|
1518
|
+
return /* @__PURE__ */ r.createElement(Nr, { value: s, column: t });
|
|
1275
1519
|
case "url":
|
|
1276
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ r.createElement(Ar, { value: s, column: t });
|
|
1277
1521
|
case "email":
|
|
1278
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ r.createElement(Tr, { value: s, column: t });
|
|
1279
1523
|
case "phone":
|
|
1280
|
-
return /* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ r.createElement(Sr, { value: s, column: t });
|
|
1281
1525
|
default:
|
|
1282
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ r.createElement(tt, { value: s, column: t });
|
|
1283
1527
|
}
|
|
1284
|
-
}
|
|
1528
|
+
}
|
|
1529
|
+
function Dr({
|
|
1285
1530
|
isOpen: e,
|
|
1286
1531
|
title: t,
|
|
1287
|
-
message:
|
|
1288
|
-
confirmText:
|
|
1289
|
-
cancelText:
|
|
1290
|
-
type:
|
|
1291
|
-
onClose:
|
|
1292
|
-
onConfirm:
|
|
1293
|
-
isLoading:
|
|
1294
|
-
})
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1532
|
+
message: o,
|
|
1533
|
+
confirmText: s = "Confirm",
|
|
1534
|
+
cancelText: i = "Cancel",
|
|
1535
|
+
type: a = "danger",
|
|
1536
|
+
onClose: l,
|
|
1537
|
+
onConfirm: m,
|
|
1538
|
+
isLoading: d = !1
|
|
1539
|
+
}) {
|
|
1540
|
+
return G(() => {
|
|
1541
|
+
const c = (n) => {
|
|
1542
|
+
n.key === "Escape" && l();
|
|
1543
|
+
};
|
|
1544
|
+
return e && window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
|
|
1545
|
+
}, [e, l]), e ? /* @__PURE__ */ r.createElement(
|
|
1546
|
+
"div",
|
|
1547
|
+
{
|
|
1548
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm any-table-fade-in",
|
|
1549
|
+
onClick: l
|
|
1550
|
+
},
|
|
1551
|
+
/* @__PURE__ */ r.createElement(
|
|
1305
1552
|
"div",
|
|
1306
1553
|
{
|
|
1307
1554
|
className: "bg-white dark:bg-slate-900 border border-gray-200 dark:border-gray-800 w-full max-w-md rounded-2xl p-6 shadow-2xl transform transition-all text-center",
|
|
1308
|
-
onClick: (
|
|
1309
|
-
role: "dialog"
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
}
|
|
1340
|
-
)
|
|
1341
|
-
] })
|
|
1342
|
-
]
|
|
1343
|
-
}
|
|
1555
|
+
onClick: (c) => c.stopPropagation(),
|
|
1556
|
+
role: "dialog"
|
|
1557
|
+
},
|
|
1558
|
+
/* @__PURE__ */ r.createElement(
|
|
1559
|
+
"div",
|
|
1560
|
+
{
|
|
1561
|
+
className: `mx-auto mb-4 w-14 h-14 rounded-full flex items-center justify-center text-2xl ${a === "danger" ? "bg-rose-500/10 text-rose-500" : a === "warning" ? "bg-amber-500/10 text-amber-500" : "bg-blue-500/10 text-blue-500"}`
|
|
1562
|
+
},
|
|
1563
|
+
a === "danger" ? "⚠️" : a === "warning" ? "⚡" : "ℹ️"
|
|
1564
|
+
),
|
|
1565
|
+
/* @__PURE__ */ r.createElement("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2" }, t),
|
|
1566
|
+
/* @__PURE__ */ r.createElement("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed" }, o),
|
|
1567
|
+
/* @__PURE__ */ r.createElement("div", { className: "flex items-center justify-center gap-3" }, /* @__PURE__ */ r.createElement(
|
|
1568
|
+
"button",
|
|
1569
|
+
{
|
|
1570
|
+
type: "button",
|
|
1571
|
+
disabled: d,
|
|
1572
|
+
onClick: l,
|
|
1573
|
+
className: "w-full py-2.5 px-4 rounded-xl border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 font-bold text-sm hover:bg-gray-200 dark:hover:bg-slate-700 transition-colors disabled:opacity-50"
|
|
1574
|
+
},
|
|
1575
|
+
i
|
|
1576
|
+
), /* @__PURE__ */ r.createElement(
|
|
1577
|
+
"button",
|
|
1578
|
+
{
|
|
1579
|
+
type: "button",
|
|
1580
|
+
disabled: d,
|
|
1581
|
+
onClick: m,
|
|
1582
|
+
className: `w-full py-2.5 px-4 rounded-xl font-bold text-sm text-white transition-all shadow-md active:scale-95 disabled:opacity-50 ${a === "danger" ? "bg-rose-600 hover:bg-rose-700 shadow-rose-600/30" : "bg-primary hover:bg-primary-soft shadow-primary/30"}`
|
|
1583
|
+
},
|
|
1584
|
+
d ? "Processing..." : s
|
|
1585
|
+
))
|
|
1344
1586
|
)
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
function
|
|
1587
|
+
) : null;
|
|
1588
|
+
}
|
|
1589
|
+
function rt(e, t) {
|
|
1348
1590
|
if (!e) return null;
|
|
1349
|
-
if (
|
|
1591
|
+
if (r.isValidElement(e))
|
|
1350
1592
|
return e;
|
|
1351
1593
|
if (typeof e == "function") {
|
|
1352
|
-
if (e.prototype && e.prototype.isReactComponent)
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1594
|
+
if (e.prototype && e.prototype.isReactComponent) {
|
|
1595
|
+
const i = e;
|
|
1596
|
+
return /* @__PURE__ */ r.createElement(i, { className: "w-4 h-4 shrink-0" });
|
|
1597
|
+
}
|
|
1598
|
+
const o = e.displayName || e.name || "";
|
|
1599
|
+
if (/^[A-Z]/.test(o)) {
|
|
1600
|
+
const i = e;
|
|
1601
|
+
return /* @__PURE__ */ r.createElement(i, { className: "w-4 h-4 shrink-0" });
|
|
1602
|
+
}
|
|
1357
1603
|
try {
|
|
1358
|
-
const
|
|
1359
|
-
return
|
|
1604
|
+
const i = e(t);
|
|
1605
|
+
return rt(i, t);
|
|
1360
1606
|
} catch {
|
|
1361
|
-
|
|
1607
|
+
const i = e;
|
|
1608
|
+
return /* @__PURE__ */ r.createElement(i, { className: "w-4 h-4 shrink-0" });
|
|
1362
1609
|
}
|
|
1363
1610
|
}
|
|
1364
|
-
|
|
1611
|
+
if (typeof e == "object" && e !== null && (e.$$typeof || e.render)) {
|
|
1612
|
+
const o = e;
|
|
1613
|
+
return /* @__PURE__ */ r.createElement(o, { className: "w-4 h-4 shrink-0" });
|
|
1614
|
+
}
|
|
1615
|
+
return typeof e == "string" ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") || e.startsWith("./") || e.startsWith("data:image/") || /\.(png|jpe?g|svg|webp|gif|ico)$/i.test(e) ? /* @__PURE__ */ r.createElement(
|
|
1365
1616
|
"img",
|
|
1366
1617
|
{
|
|
1367
1618
|
src: e,
|
|
1368
1619
|
alt: "action-icon",
|
|
1369
1620
|
className: "w-4 h-4 object-contain shrink-0 inline-block"
|
|
1370
1621
|
}
|
|
1371
|
-
) : /* @__PURE__ */
|
|
1622
|
+
) : /* @__PURE__ */ r.createElement("span", { className: "inline-flex items-center justify-center leading-none text-base" }, e) : e;
|
|
1372
1623
|
}
|
|
1373
|
-
const
|
|
1624
|
+
const Ze = {
|
|
1374
1625
|
primary: "bg-primary text-white hover:bg-primary-soft shadow-sm shadow-primary/20",
|
|
1375
1626
|
secondary: "bg-emerald-600 text-white hover:bg-emerald-700 shadow-sm shadow-emerald-600/20",
|
|
1376
1627
|
success: "bg-emerald-500 text-white hover:bg-emerald-600 shadow-sm shadow-emerald-500/20",
|
|
@@ -1379,775 +1630,724 @@ const Je = {
|
|
|
1379
1630
|
info: "bg-sky-500 text-white hover:bg-sky-600 shadow-sm shadow-sky-500/20",
|
|
1380
1631
|
neutral: "bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-700",
|
|
1381
1632
|
ghost: "bg-transparent text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1633
|
+
};
|
|
1634
|
+
function Mr({
|
|
1635
|
+
row: e,
|
|
1636
|
+
actions: t,
|
|
1637
|
+
context: o
|
|
1638
|
+
}) {
|
|
1639
|
+
const [s, i] = P(null), [a, l] = P({});
|
|
1384
1640
|
if (!t || !t.length)
|
|
1385
1641
|
return null;
|
|
1386
|
-
const
|
|
1642
|
+
const m = async (n) => {
|
|
1387
1643
|
if (n.confirmation) {
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1644
|
+
const f = typeof n.confirmation.title == "function" ? n.confirmation.title(e) : n.confirmation.title || "Confirm Action", g = typeof n.confirmation.message == "function" ? n.confirmation.message(e) : n.confirmation.message || "Are you sure you want to perform this action?";
|
|
1645
|
+
i({
|
|
1390
1646
|
isOpen: !0,
|
|
1391
|
-
title:
|
|
1392
|
-
message:
|
|
1647
|
+
title: f,
|
|
1648
|
+
message: g,
|
|
1393
1649
|
confirmText: n.confirmation.confirmText || "Confirm",
|
|
1394
1650
|
cancelText: n.confirmation.cancelText || "Cancel",
|
|
1395
1651
|
type: n.confirmation.type || "danger",
|
|
1396
1652
|
onConfirm: async () => {
|
|
1397
|
-
|
|
1653
|
+
i(null), await d(n);
|
|
1398
1654
|
}
|
|
1399
1655
|
});
|
|
1400
1656
|
return;
|
|
1401
1657
|
}
|
|
1402
|
-
await
|
|
1403
|
-
},
|
|
1658
|
+
await d(n);
|
|
1659
|
+
}, d = async (n) => {
|
|
1404
1660
|
if (n.type === "button" || !n.type) {
|
|
1405
|
-
|
|
1661
|
+
l((f) => ({ ...f, [n.id]: !0 }));
|
|
1406
1662
|
try {
|
|
1407
|
-
await n.onClick(e,
|
|
1663
|
+
await n.onClick(e, o);
|
|
1408
1664
|
} finally {
|
|
1409
|
-
|
|
1665
|
+
l((f) => ({ ...f, [n.id]: !1 }));
|
|
1410
1666
|
}
|
|
1411
1667
|
}
|
|
1412
|
-
},
|
|
1413
|
-
const
|
|
1414
|
-
|
|
1668
|
+
}, c = async (n, f) => {
|
|
1669
|
+
const g = !f;
|
|
1670
|
+
l((u) => ({ ...u, [n.id]: !0 }));
|
|
1415
1671
|
try {
|
|
1416
|
-
await n.onChange(e,
|
|
1672
|
+
await n.onChange(e, g, o);
|
|
1417
1673
|
} finally {
|
|
1418
|
-
|
|
1674
|
+
l((u) => ({ ...u, [n.id]: !1 }));
|
|
1419
1675
|
}
|
|
1420
1676
|
};
|
|
1421
|
-
return /* @__PURE__ */
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
"div",
|
|
1431
|
-
{
|
|
1432
|
-
className: "flex items-center gap-2",
|
|
1433
|
-
title: k || b,
|
|
1434
|
-
children: [
|
|
1435
|
-
b && /* @__PURE__ */ y("span", { className: "text-xs font-semibold text-gray-500", children: [
|
|
1436
|
-
b,
|
|
1437
|
-
":"
|
|
1438
|
-
] }),
|
|
1439
|
-
/* @__PURE__ */ a(
|
|
1440
|
-
"button",
|
|
1441
|
-
{
|
|
1442
|
-
type: "button",
|
|
1443
|
-
role: "switch",
|
|
1444
|
-
"aria-checked": w,
|
|
1445
|
-
disabled: u || m,
|
|
1446
|
-
onClick: () => d(N, w),
|
|
1447
|
-
className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${w ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${C}`,
|
|
1448
|
-
children: /* @__PURE__ */ a(
|
|
1449
|
-
"span",
|
|
1450
|
-
{
|
|
1451
|
-
"aria-hidden": "true",
|
|
1452
|
-
className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${w ? "translate-x-5" : "translate-x-0"}`,
|
|
1453
|
-
children: m && /* @__PURE__ */ a("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
|
|
1454
|
-
}
|
|
1455
|
-
)
|
|
1456
|
-
}
|
|
1457
|
-
)
|
|
1458
|
-
]
|
|
1459
|
-
},
|
|
1460
|
-
n.id
|
|
1461
|
-
);
|
|
1462
|
-
}
|
|
1463
|
-
const D = typeof n.variant == "function" ? n.variant(e) : n.variant || "neutral", _ = Je[D] || Je.neutral, x = !b && f ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
|
|
1464
|
-
return /* @__PURE__ */ y(
|
|
1465
|
-
"button",
|
|
1677
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement("div", { className: "flex items-center justify-end gap-2 pr-2" }, t.map((n) => {
|
|
1678
|
+
if (typeof n.hide == "function" && n.hide(e) || typeof n.show == "function" && !n.show(e)) return null;
|
|
1679
|
+
const f = typeof n.disabled == "function" ? n.disabled(e) : !!n.disabled, g = a[n.id] || (typeof n.loading == "function" ? n.loading(e) : !!n.loading), u = typeof n.label == "function" ? n.label(e) : n.label, b = rt(n.icon, e), y = typeof n.tooltip == "function" ? n.tooltip(e) : n.tooltip, v = typeof n.className == "function" ? n.className(e) : n.className || "";
|
|
1680
|
+
if (n.type === "custom" && n.render)
|
|
1681
|
+
return /* @__PURE__ */ r.createElement(r.Fragment, { key: n.id }, n.render(e, o));
|
|
1682
|
+
if (n.type === "switch") {
|
|
1683
|
+
const p = n, x = p.checked(e);
|
|
1684
|
+
return /* @__PURE__ */ r.createElement(
|
|
1685
|
+
"div",
|
|
1466
1686
|
{
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
title: k,
|
|
1471
|
-
style: n.color ? { backgroundColor: n.color, color: "#ffffff" } : void 0,
|
|
1472
|
-
className: `inline-flex items-center justify-center gap-1.5 ${x} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${_} ${C}`,
|
|
1473
|
-
children: [
|
|
1474
|
-
m ? /* @__PURE__ */ a("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : f && /* @__PURE__ */ a("span", { className: "text-sm flex items-center justify-center shrink-0", children: f }),
|
|
1475
|
-
b && /* @__PURE__ */ a("span", { children: b })
|
|
1476
|
-
]
|
|
1687
|
+
key: n.id,
|
|
1688
|
+
className: "flex items-center gap-2",
|
|
1689
|
+
title: y || u
|
|
1477
1690
|
},
|
|
1478
|
-
|
|
1691
|
+
u && /* @__PURE__ */ r.createElement("span", { className: "text-xs font-semibold text-gray-500" }, u, ":"),
|
|
1692
|
+
/* @__PURE__ */ r.createElement(
|
|
1693
|
+
"button",
|
|
1694
|
+
{
|
|
1695
|
+
type: "button",
|
|
1696
|
+
role: "switch",
|
|
1697
|
+
"aria-checked": x,
|
|
1698
|
+
disabled: f || g,
|
|
1699
|
+
onClick: () => c(p, x),
|
|
1700
|
+
className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${x ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${v}`
|
|
1701
|
+
},
|
|
1702
|
+
/* @__PURE__ */ r.createElement(
|
|
1703
|
+
"span",
|
|
1704
|
+
{
|
|
1705
|
+
"aria-hidden": "true",
|
|
1706
|
+
className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${x ? "translate-x-5" : "translate-x-0"}`
|
|
1707
|
+
},
|
|
1708
|
+
g && /* @__PURE__ */ r.createElement("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
|
|
1709
|
+
)
|
|
1710
|
+
)
|
|
1479
1711
|
);
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
|
|
1712
|
+
}
|
|
1713
|
+
const T = typeof n.variant == "function" ? n.variant(e) : n.variant || "neutral", B = Ze[T] || Ze.neutral, E = !u && b ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
|
|
1714
|
+
return /* @__PURE__ */ r.createElement(
|
|
1715
|
+
"button",
|
|
1483
1716
|
{
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
},
|
|
1717
|
+
key: n.id,
|
|
1718
|
+
type: "button",
|
|
1719
|
+
disabled: f || g,
|
|
1720
|
+
onClick: () => m(n),
|
|
1721
|
+
title: y,
|
|
1722
|
+
style: n.color ? { backgroundColor: n.color, color: "#ffffff" } : void 0,
|
|
1723
|
+
className: `inline-flex items-center justify-center gap-1.5 ${E} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${B} ${v}`
|
|
1724
|
+
},
|
|
1725
|
+
g ? /* @__PURE__ */ r.createElement("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : b && /* @__PURE__ */ r.createElement("span", { className: "text-sm flex items-center justify-center shrink-0" }, b),
|
|
1726
|
+
u && /* @__PURE__ */ r.createElement("span", null, u)
|
|
1727
|
+
);
|
|
1728
|
+
})), s && /* @__PURE__ */ r.createElement(
|
|
1729
|
+
Dr,
|
|
1730
|
+
{
|
|
1731
|
+
isOpen: s.isOpen,
|
|
1732
|
+
title: s.title,
|
|
1733
|
+
message: s.message,
|
|
1734
|
+
confirmText: s.confirmText,
|
|
1735
|
+
cancelText: s.cancelText,
|
|
1736
|
+
type: s.type,
|
|
1737
|
+
onClose: () => i(null),
|
|
1738
|
+
onConfirm: s.onConfirm
|
|
1739
|
+
}
|
|
1740
|
+
));
|
|
1741
|
+
}
|
|
1742
|
+
function Hr({
|
|
1496
1743
|
rows: e,
|
|
1497
1744
|
columns: t,
|
|
1498
|
-
actions:
|
|
1499
|
-
actionContext:
|
|
1500
|
-
rowKeyResolver:
|
|
1501
|
-
selectable:
|
|
1502
|
-
selectedKeys:
|
|
1503
|
-
onToggleSelectRow:
|
|
1504
|
-
onRowClick:
|
|
1505
|
-
striped:
|
|
1745
|
+
actions: o,
|
|
1746
|
+
actionContext: s,
|
|
1747
|
+
rowKeyResolver: i,
|
|
1748
|
+
selectable: a,
|
|
1749
|
+
selectedKeys: l,
|
|
1750
|
+
onToggleSelectRow: m,
|
|
1751
|
+
onRowClick: d,
|
|
1752
|
+
striped: c = !1,
|
|
1506
1753
|
hoverable: n = !0,
|
|
1507
|
-
rowClassName:
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1754
|
+
rowClassName: f,
|
|
1755
|
+
isVirtualized: g = !1,
|
|
1756
|
+
paddingTop: u = 0,
|
|
1757
|
+
paddingBottom: b = 0,
|
|
1758
|
+
startIndex: y = 0
|
|
1759
|
+
}) {
|
|
1760
|
+
const v = X(), T = !!(o && o.length > 0), B = t.length + (a ? 1 : 0) + (T ? 1 : 0);
|
|
1761
|
+
return /* @__PURE__ */ r.createElement("tbody", { className: v.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900" }, g && u > 0 && /* @__PURE__ */ r.createElement(
|
|
1762
|
+
"tr",
|
|
1763
|
+
{
|
|
1764
|
+
style: { height: `${u}px`, border: 0 },
|
|
1765
|
+
"aria-hidden": "true",
|
|
1766
|
+
className: "pointer-events-none"
|
|
1767
|
+
},
|
|
1768
|
+
/* @__PURE__ */ r.createElement(
|
|
1769
|
+
"td",
|
|
1770
|
+
{
|
|
1771
|
+
colSpan: B,
|
|
1772
|
+
style: { height: `${u}px`, padding: 0, border: 0 }
|
|
1773
|
+
}
|
|
1774
|
+
)
|
|
1775
|
+
), e.map((E, p) => {
|
|
1776
|
+
const x = y + p, k = i(E, x), w = l?.has(k), D = typeof f == "function" ? f(E, x) : f || "";
|
|
1777
|
+
return /* @__PURE__ */ r.createElement(
|
|
1513
1778
|
"tr",
|
|
1514
1779
|
{
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
r && /* @__PURE__ */ a(
|
|
1519
|
-
"td",
|
|
1520
|
-
{
|
|
1521
|
-
className: "w-10 px-4 py-3 text-center align-middle",
|
|
1522
|
-
onClick: (x) => x.stopPropagation(),
|
|
1523
|
-
children: /* @__PURE__ */ a(
|
|
1524
|
-
"input",
|
|
1525
|
-
{
|
|
1526
|
-
type: "checkbox",
|
|
1527
|
-
checked: D,
|
|
1528
|
-
onChange: () => g?.(C, f),
|
|
1529
|
-
className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
|
|
1530
|
-
}
|
|
1531
|
-
)
|
|
1532
|
-
}
|
|
1533
|
-
),
|
|
1534
|
-
t.map((x) => {
|
|
1535
|
-
const N = x.align === "center" ? "text-center" : x.align === "right" ? "text-right" : "text-left", w = typeof x.className == "function" ? x.className(f?.[x.key], f, k) : x.className || "";
|
|
1536
|
-
return /* @__PURE__ */ a(
|
|
1537
|
-
"td",
|
|
1538
|
-
{
|
|
1539
|
-
style: {
|
|
1540
|
-
width: x.width,
|
|
1541
|
-
minWidth: x.minWidth,
|
|
1542
|
-
maxWidth: x.maxWidth
|
|
1543
|
-
},
|
|
1544
|
-
className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${N} ${w}`,
|
|
1545
|
-
children: /* @__PURE__ */ a(kr, { row: f, column: x, rowIndex: k })
|
|
1546
|
-
},
|
|
1547
|
-
String(x.key)
|
|
1548
|
-
);
|
|
1549
|
-
}),
|
|
1550
|
-
b && /* @__PURE__ */ a(
|
|
1551
|
-
"td",
|
|
1552
|
-
{
|
|
1553
|
-
className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} text-right`,
|
|
1554
|
-
onClick: (x) => x.stopPropagation(),
|
|
1555
|
-
children: /* @__PURE__ */ a(
|
|
1556
|
-
Nr,
|
|
1557
|
-
{
|
|
1558
|
-
row: f,
|
|
1559
|
-
actions: s || [],
|
|
1560
|
-
context: o
|
|
1561
|
-
}
|
|
1562
|
-
)
|
|
1563
|
-
}
|
|
1564
|
-
)
|
|
1565
|
-
]
|
|
1780
|
+
key: String(k),
|
|
1781
|
+
onClick: (h) => d?.(E, x, h),
|
|
1782
|
+
className: `${v.classes?.tr || "transition-colors duration-150"} ${c && x % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${n ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${w ? "bg-primary/5 dark:bg-primary/10" : ""} ${d ? "cursor-pointer" : ""} ${D}`
|
|
1566
1783
|
},
|
|
1567
|
-
|
|
1784
|
+
a && /* @__PURE__ */ r.createElement(
|
|
1785
|
+
"td",
|
|
1786
|
+
{
|
|
1787
|
+
className: "w-10 px-4 py-3 text-center align-middle",
|
|
1788
|
+
onClick: (h) => h.stopPropagation()
|
|
1789
|
+
},
|
|
1790
|
+
/* @__PURE__ */ r.createElement(
|
|
1791
|
+
"input",
|
|
1792
|
+
{
|
|
1793
|
+
type: "checkbox",
|
|
1794
|
+
checked: w,
|
|
1795
|
+
onChange: () => m?.(k, E),
|
|
1796
|
+
className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
|
|
1797
|
+
}
|
|
1798
|
+
)
|
|
1799
|
+
),
|
|
1800
|
+
t.map((h) => {
|
|
1801
|
+
const j = h.align === "center" ? "text-center" : h.align === "right" ? "text-right" : "text-left", M = typeof h.className == "function" ? h.className(E?.[h.key], E, x) : h.className || "";
|
|
1802
|
+
return /* @__PURE__ */ r.createElement(
|
|
1803
|
+
"td",
|
|
1804
|
+
{
|
|
1805
|
+
key: String(h.key),
|
|
1806
|
+
style: {
|
|
1807
|
+
width: h.width,
|
|
1808
|
+
minWidth: h.minWidth,
|
|
1809
|
+
maxWidth: h.maxWidth
|
|
1810
|
+
},
|
|
1811
|
+
className: `${v.classes?.td || "py-3 px-4 text-sm align-middle"} ${j} ${M}`
|
|
1812
|
+
},
|
|
1813
|
+
/* @__PURE__ */ r.createElement(Br, { row: E, column: h, rowIndex: x })
|
|
1814
|
+
);
|
|
1815
|
+
}),
|
|
1816
|
+
T && /* @__PURE__ */ r.createElement(
|
|
1817
|
+
"td",
|
|
1818
|
+
{
|
|
1819
|
+
className: `${v.classes?.td || "py-3 px-4 text-sm align-middle"} text-right`,
|
|
1820
|
+
onClick: (h) => h.stopPropagation()
|
|
1821
|
+
},
|
|
1822
|
+
/* @__PURE__ */ r.createElement(
|
|
1823
|
+
Mr,
|
|
1824
|
+
{
|
|
1825
|
+
row: E,
|
|
1826
|
+
actions: o || [],
|
|
1827
|
+
context: s
|
|
1828
|
+
}
|
|
1829
|
+
)
|
|
1830
|
+
)
|
|
1568
1831
|
);
|
|
1569
|
-
})
|
|
1570
|
-
|
|
1832
|
+
}), g && b > 0 && /* @__PURE__ */ r.createElement(
|
|
1833
|
+
"tr",
|
|
1834
|
+
{
|
|
1835
|
+
style: { height: `${b}px`, border: 0 },
|
|
1836
|
+
"aria-hidden": "true",
|
|
1837
|
+
className: "pointer-events-none"
|
|
1838
|
+
},
|
|
1839
|
+
/* @__PURE__ */ r.createElement(
|
|
1840
|
+
"td",
|
|
1841
|
+
{
|
|
1842
|
+
colSpan: B,
|
|
1843
|
+
style: { height: `${b}px`, padding: 0, border: 0 }
|
|
1844
|
+
}
|
|
1845
|
+
)
|
|
1846
|
+
));
|
|
1847
|
+
}
|
|
1848
|
+
function _r({
|
|
1571
1849
|
page: e,
|
|
1572
1850
|
pageSize: t,
|
|
1573
|
-
totalRecords:
|
|
1574
|
-
totalPages:
|
|
1575
|
-
pageSizeOptions:
|
|
1576
|
-
onPageChange:
|
|
1577
|
-
onPageSizeChange:
|
|
1578
|
-
showPageSizeSelector:
|
|
1579
|
-
showTotalCount:
|
|
1580
|
-
pageWindow:
|
|
1581
|
-
})
|
|
1582
|
-
const n =
|
|
1583
|
-
return /* @__PURE__ */
|
|
1851
|
+
totalRecords: o,
|
|
1852
|
+
totalPages: s,
|
|
1853
|
+
pageSizeOptions: i = [5, 10, 20, 50, 100],
|
|
1854
|
+
onPageChange: a,
|
|
1855
|
+
onPageSizeChange: l,
|
|
1856
|
+
showPageSizeSelector: m = !0,
|
|
1857
|
+
showTotalCount: d = !0,
|
|
1858
|
+
pageWindow: c
|
|
1859
|
+
}) {
|
|
1860
|
+
const n = X(), f = Math.min((e - 1) * t + 1, o), g = Math.min(e * t, o);
|
|
1861
|
+
return /* @__PURE__ */ r.createElement(
|
|
1584
1862
|
"div",
|
|
1585
1863
|
{
|
|
1586
|
-
className: n.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400"
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
children: "‹"
|
|
1631
|
-
}
|
|
1632
|
-
),
|
|
1633
|
-
d.map((b) => {
|
|
1634
|
-
const f = b === e;
|
|
1635
|
-
return /* @__PURE__ */ a(
|
|
1636
|
-
"button",
|
|
1637
|
-
{
|
|
1638
|
-
type: "button",
|
|
1639
|
-
onClick: () => r(b),
|
|
1640
|
-
className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${f ? n.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
|
|
1641
|
-
children: b
|
|
1642
|
-
},
|
|
1643
|
-
b
|
|
1644
|
-
);
|
|
1645
|
-
}),
|
|
1646
|
-
/* @__PURE__ */ a(
|
|
1647
|
-
"button",
|
|
1648
|
-
{
|
|
1649
|
-
type: "button",
|
|
1650
|
-
disabled: e >= o,
|
|
1651
|
-
onClick: () => r(e + 1),
|
|
1652
|
-
"aria-label": "Next Page",
|
|
1653
|
-
className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
|
|
1654
|
-
children: "›"
|
|
1655
|
-
}
|
|
1656
|
-
)
|
|
1657
|
-
] })
|
|
1658
|
-
]
|
|
1659
|
-
}
|
|
1864
|
+
className: n.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400"
|
|
1865
|
+
},
|
|
1866
|
+
/* @__PURE__ */ r.createElement("div", { className: "flex items-center gap-3" }, d && o > 0 ? /* @__PURE__ */ r.createElement("span", { className: "text-xs sm:text-sm font-medium" }, "Showing ", /* @__PURE__ */ r.createElement("strong", { className: "text-gray-900 dark:text-white font-bold" }, f), " to", " ", /* @__PURE__ */ r.createElement("strong", { className: "text-gray-900 dark:text-white font-bold" }, g), " of", " ", /* @__PURE__ */ r.createElement("strong", { className: "text-gray-900 dark:text-white font-bold" }, o.toLocaleString()), " results") : /* @__PURE__ */ r.createElement("span", { className: "text-xs sm:text-sm font-medium" }, "Page ", e, " of ", s), m && /* @__PURE__ */ r.createElement("div", { className: "flex items-center gap-2 ml-2" }, /* @__PURE__ */ r.createElement("span", { className: "text-xs text-gray-500 hidden sm:inline" }, "Rows:"), /* @__PURE__ */ r.createElement(
|
|
1867
|
+
"select",
|
|
1868
|
+
{
|
|
1869
|
+
value: t,
|
|
1870
|
+
onChange: (u) => l(Number(u.target.value)),
|
|
1871
|
+
className: n.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer"
|
|
1872
|
+
},
|
|
1873
|
+
i.map((u) => /* @__PURE__ */ r.createElement("option", { key: u, value: u, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white" }, u, " / page"))
|
|
1874
|
+
))),
|
|
1875
|
+
/* @__PURE__ */ r.createElement("div", { className: "flex items-center gap-1.5 ml-auto" }, /* @__PURE__ */ r.createElement(
|
|
1876
|
+
"button",
|
|
1877
|
+
{
|
|
1878
|
+
type: "button",
|
|
1879
|
+
disabled: e <= 1,
|
|
1880
|
+
onClick: () => a(e - 1),
|
|
1881
|
+
"aria-label": "Previous Page",
|
|
1882
|
+
className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`
|
|
1883
|
+
},
|
|
1884
|
+
"‹"
|
|
1885
|
+
), c.map((u) => {
|
|
1886
|
+
const b = u === e;
|
|
1887
|
+
return /* @__PURE__ */ r.createElement(
|
|
1888
|
+
"button",
|
|
1889
|
+
{
|
|
1890
|
+
key: u,
|
|
1891
|
+
type: "button",
|
|
1892
|
+
onClick: () => a(u),
|
|
1893
|
+
className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${b ? n.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`
|
|
1894
|
+
},
|
|
1895
|
+
u
|
|
1896
|
+
);
|
|
1897
|
+
}), /* @__PURE__ */ r.createElement(
|
|
1898
|
+
"button",
|
|
1899
|
+
{
|
|
1900
|
+
type: "button",
|
|
1901
|
+
disabled: e >= s,
|
|
1902
|
+
onClick: () => a(e + 1),
|
|
1903
|
+
"aria-label": "Next Page",
|
|
1904
|
+
className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`
|
|
1905
|
+
},
|
|
1906
|
+
"›"
|
|
1907
|
+
))
|
|
1660
1908
|
);
|
|
1661
|
-
}
|
|
1909
|
+
}
|
|
1910
|
+
function jr({
|
|
1662
1911
|
columnsCount: e = 5,
|
|
1663
1912
|
rowsCount: t = 5,
|
|
1664
|
-
hasActions:
|
|
1665
|
-
})
|
|
1666
|
-
Array.from({ length:
|
|
1913
|
+
hasActions: o = !0
|
|
1914
|
+
}) {
|
|
1915
|
+
return /* @__PURE__ */ r.createElement("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900" }, Array.from({ length: t }).map((s, i) => /* @__PURE__ */ r.createElement("tr", { key: i, className: "any-table-pulse" }, Array.from({ length: e }).map((a, l) => /* @__PURE__ */ r.createElement("td", { key: l, className: "py-4 px-4 align-middle" }, /* @__PURE__ */ r.createElement(
|
|
1667
1916
|
"div",
|
|
1668
1917
|
{
|
|
1669
1918
|
className: "h-4 bg-gray-200 dark:bg-slate-700/60 rounded-md",
|
|
1670
1919
|
style: {
|
|
1671
|
-
width: `${Math.floor(40 + (
|
|
1920
|
+
width: `${Math.floor(40 + (l * 19 + i * 13) % 45)}%`
|
|
1672
1921
|
}
|
|
1673
1922
|
}
|
|
1674
|
-
) },
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
/* @__PURE__ */ a("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
|
|
1678
|
-
] }) })
|
|
1679
|
-
] }, l)) }), Sr = ({
|
|
1923
|
+
))), o && /* @__PURE__ */ r.createElement("td", { className: "py-4 px-4 text-right align-middle pr-6" }, /* @__PURE__ */ r.createElement("div", { className: "inline-flex gap-2 justify-end" }, /* @__PURE__ */ r.createElement("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }), /* @__PURE__ */ r.createElement("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }))))));
|
|
1924
|
+
}
|
|
1925
|
+
function zr({
|
|
1680
1926
|
title: e,
|
|
1681
1927
|
description: t,
|
|
1682
|
-
isSearchActive:
|
|
1683
|
-
onClearSearch:
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (s ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
|
|
1688
|
-
s && o && /* @__PURE__ */ a(
|
|
1928
|
+
isSearchActive: o = !1,
|
|
1929
|
+
onClearSearch: s,
|
|
1930
|
+
colSpan: i
|
|
1931
|
+
}) {
|
|
1932
|
+
const a = o ? "No matching records found" : "No data available", l = o ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.", m = /* @__PURE__ */ r.createElement("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in" }, /* @__PURE__ */ r.createElement("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner" }, o ? "🔍" : "📂"), /* @__PURE__ */ r.createElement("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1" }, e || a), /* @__PURE__ */ r.createElement("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed" }, t || l), o && s && /* @__PURE__ */ r.createElement(
|
|
1689
1933
|
"button",
|
|
1690
1934
|
{
|
|
1691
1935
|
type: "button",
|
|
1692
|
-
onClick:
|
|
1693
|
-
className: "px-4 py-2 rounded-xl bg-primary text-white text-xs font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95"
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
)
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
"button",
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
}
|
|
1714
|
-
)
|
|
1715
|
-
] });
|
|
1716
|
-
};
|
|
1717
|
-
function qe(e) {
|
|
1936
|
+
onClick: s,
|
|
1937
|
+
className: "px-4 py-2 rounded-xl bg-primary text-white text-xs font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95"
|
|
1938
|
+
},
|
|
1939
|
+
"Clear Search Filter"
|
|
1940
|
+
));
|
|
1941
|
+
return i !== void 0 ? /* @__PURE__ */ r.createElement("tbody", null, /* @__PURE__ */ r.createElement("tr", null, /* @__PURE__ */ r.createElement("td", { colSpan: i, className: "p-0" }, m))) : m;
|
|
1942
|
+
}
|
|
1943
|
+
function Rr({ error: e, onRetry: t }) {
|
|
1944
|
+
const o = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
|
|
1945
|
+
return /* @__PURE__ */ r.createElement("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in" }, /* @__PURE__ */ r.createElement("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20" }, "⚠️"), /* @__PURE__ */ r.createElement("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1" }, "Unable to load data"), /* @__PURE__ */ r.createElement("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10" }, o), t && /* @__PURE__ */ r.createElement(
|
|
1946
|
+
"button",
|
|
1947
|
+
{
|
|
1948
|
+
type: "button",
|
|
1949
|
+
onClick: t,
|
|
1950
|
+
className: "inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-xs font-bold hover:bg-gray-800 dark:hover:bg-gray-100 transition-all shadow-md active:scale-95"
|
|
1951
|
+
},
|
|
1952
|
+
/* @__PURE__ */ r.createElement("span", null, "🔄"),
|
|
1953
|
+
/* @__PURE__ */ r.createElement("span", null, "Retry Request")
|
|
1954
|
+
));
|
|
1955
|
+
}
|
|
1956
|
+
function Je(e) {
|
|
1718
1957
|
const {
|
|
1719
1958
|
data: t,
|
|
1720
|
-
api:
|
|
1721
|
-
columns:
|
|
1722
|
-
autoColumns:
|
|
1723
|
-
rowKey:
|
|
1724
|
-
title:
|
|
1725
|
-
subtitle:
|
|
1726
|
-
actions:
|
|
1727
|
-
actionsTitle:
|
|
1959
|
+
api: o,
|
|
1960
|
+
columns: s,
|
|
1961
|
+
autoColumns: i = !0,
|
|
1962
|
+
rowKey: a,
|
|
1963
|
+
title: l,
|
|
1964
|
+
subtitle: m,
|
|
1965
|
+
actions: d,
|
|
1966
|
+
actionsTitle: c = "Actions",
|
|
1728
1967
|
actionsWidth: n,
|
|
1729
|
-
search:
|
|
1730
|
-
sorting:
|
|
1731
|
-
pagination:
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1968
|
+
search: f = !0,
|
|
1969
|
+
sorting: g = !0,
|
|
1970
|
+
pagination: u,
|
|
1971
|
+
virtualized: b = !1,
|
|
1972
|
+
selectable: y = !1,
|
|
1973
|
+
onSelectionChange: v,
|
|
1974
|
+
onRowClick: T,
|
|
1975
|
+
loading: B,
|
|
1976
|
+
loadingComponent: E,
|
|
1977
|
+
emptyComponent: p,
|
|
1978
|
+
emptyTitle: x,
|
|
1979
|
+
emptyDescription: k,
|
|
1980
|
+
errorComponent: w,
|
|
1981
|
+
className: D = "",
|
|
1982
|
+
tableClassName: h = "",
|
|
1983
|
+
headerClassName: j = "",
|
|
1984
|
+
rowClassName: M,
|
|
1985
|
+
headerActions: z,
|
|
1986
|
+
showHeader: I = !0,
|
|
1987
|
+
bordered: Q = !0,
|
|
1988
|
+
striped: K = !1,
|
|
1989
|
+
hoverable: U = !0,
|
|
1990
|
+
compact: L = !1,
|
|
1991
|
+
stickyHeader: H = !1,
|
|
1992
|
+
tableRef: R,
|
|
1753
1993
|
// Legacy Wasel Props
|
|
1754
|
-
thead:
|
|
1755
|
-
headerData:
|
|
1756
|
-
tbodys:
|
|
1757
|
-
titleHeader:
|
|
1758
|
-
add:
|
|
1759
|
-
linkAdd:
|
|
1760
|
-
addHandler:
|
|
1761
|
-
view:
|
|
1762
|
-
linkView:
|
|
1763
|
-
viewHandler:
|
|
1764
|
-
edit:
|
|
1765
|
-
linkEdit:
|
|
1766
|
-
editHandler:
|
|
1767
|
-
del:
|
|
1768
|
-
handleDelete:
|
|
1769
|
-
block:
|
|
1770
|
-
handleBlock:
|
|
1771
|
-
buttons:
|
|
1772
|
-
} = e,
|
|
1773
|
-
data:
|
|
1774
|
-
columns:
|
|
1775
|
-
autoColumns:
|
|
1776
|
-
thead:
|
|
1777
|
-
headerData:
|
|
1778
|
-
}).filter((
|
|
1779
|
-
(
|
|
1780
|
-
if (typeof
|
|
1781
|
-
return
|
|
1782
|
-
if (typeof
|
|
1783
|
-
const
|
|
1784
|
-
if (
|
|
1994
|
+
thead: V,
|
|
1995
|
+
headerData: he,
|
|
1996
|
+
tbodys: ke,
|
|
1997
|
+
titleHeader: at,
|
|
1998
|
+
add: nt,
|
|
1999
|
+
linkAdd: ot,
|
|
2000
|
+
addHandler: st,
|
|
2001
|
+
view: we,
|
|
2002
|
+
linkView: ve,
|
|
2003
|
+
viewHandler: Ee,
|
|
2004
|
+
edit: Ne,
|
|
2005
|
+
linkEdit: Ae,
|
|
2006
|
+
editHandler: Te,
|
|
2007
|
+
del: Se,
|
|
2008
|
+
handleDelete: Ce,
|
|
2009
|
+
block: Pe,
|
|
2010
|
+
handleBlock: $e,
|
|
2011
|
+
buttons: Be
|
|
2012
|
+
} = e, C = X(), ee = $(() => t || ke || void 0, [t, ke]), Z = $(() => Jt({
|
|
2013
|
+
data: ee,
|
|
2014
|
+
columns: s,
|
|
2015
|
+
autoColumns: i,
|
|
2016
|
+
thead: V,
|
|
2017
|
+
headerData: he
|
|
2018
|
+
}).filter((F) => typeof F.hidden == "function" ? !F.hidden({ data: ee || [] }) : !F.hidden), [ee, s, i, V, he]), De = S(
|
|
2019
|
+
(N, F) => {
|
|
2020
|
+
if (typeof a == "function")
|
|
2021
|
+
return a(N, F);
|
|
2022
|
+
if (typeof a == "string") {
|
|
2023
|
+
const ye = A(N, a);
|
|
2024
|
+
if (ye != null) return ye;
|
|
1785
2025
|
}
|
|
1786
|
-
const
|
|
1787
|
-
return
|
|
2026
|
+
const fe = N?._id ?? N?.id ?? N?.key;
|
|
2027
|
+
return fe ?? F;
|
|
1788
2028
|
},
|
|
1789
|
-
[
|
|
2029
|
+
[a]
|
|
1790
2030
|
), {
|
|
1791
|
-
enabled: We,
|
|
1792
|
-
search: Re,
|
|
1793
|
-
debouncedSearch: ze,
|
|
1794
|
-
isDebouncing: ot,
|
|
1795
|
-
setSearch: Le,
|
|
1796
|
-
clearSearch: xe,
|
|
1797
|
-
searchConfig: it
|
|
1798
|
-
} = Kt({ config: u }), {
|
|
1799
2031
|
enabled: lt,
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
he
|
|
1861
|
-
]), [mt, ut] = S(1), [bt, ft] = S(10), {
|
|
1862
|
-
rows: T,
|
|
1863
|
-
totalRecords: Ne,
|
|
1864
|
-
loading: le,
|
|
1865
|
-
error: J,
|
|
1866
|
-
refresh: q,
|
|
1867
|
-
isServerMode: yt
|
|
1868
|
-
} = tr({
|
|
1869
|
-
data: ie,
|
|
1870
|
-
api: s,
|
|
1871
|
-
columns: G,
|
|
1872
|
-
searchQuery: ze,
|
|
1873
|
-
sortBy: ke,
|
|
1874
|
-
sortOrder: we,
|
|
1875
|
-
page: mt,
|
|
1876
|
-
pageSize: bt,
|
|
1877
|
-
manualLoading: D
|
|
2032
|
+
search: Me,
|
|
2033
|
+
debouncedSearch: it,
|
|
2034
|
+
isDebouncing: dt,
|
|
2035
|
+
setSearch: He,
|
|
2036
|
+
clearSearch: _e,
|
|
2037
|
+
searchConfig: ct
|
|
2038
|
+
} = Xt({ config: f }), {
|
|
2039
|
+
enabled: mt,
|
|
2040
|
+
sortBy: ce,
|
|
2041
|
+
sortOrder: me,
|
|
2042
|
+
toggleSort: gt,
|
|
2043
|
+
setSorting: ut,
|
|
2044
|
+
resetSorting: bt
|
|
2045
|
+
} = Qt({ config: g }), je = $(
|
|
2046
|
+
() => qt({
|
|
2047
|
+
explicitActions: d,
|
|
2048
|
+
buttons: Be,
|
|
2049
|
+
block: Pe,
|
|
2050
|
+
handleBlock: $e,
|
|
2051
|
+
view: we,
|
|
2052
|
+
linkView: ve,
|
|
2053
|
+
viewHandler: Ee,
|
|
2054
|
+
edit: Ne,
|
|
2055
|
+
linkEdit: Ae,
|
|
2056
|
+
editHandler: Te,
|
|
2057
|
+
del: Se,
|
|
2058
|
+
handleDelete: Ce
|
|
2059
|
+
}),
|
|
2060
|
+
[
|
|
2061
|
+
d,
|
|
2062
|
+
Be,
|
|
2063
|
+
Pe,
|
|
2064
|
+
$e,
|
|
2065
|
+
we,
|
|
2066
|
+
ve,
|
|
2067
|
+
Ee,
|
|
2068
|
+
Ne,
|
|
2069
|
+
Ae,
|
|
2070
|
+
Te,
|
|
2071
|
+
Se,
|
|
2072
|
+
Ce
|
|
2073
|
+
]
|
|
2074
|
+
), [ft, yt] = P(1), [pt, xt] = P(10), ze = $(() => typeof b == "object" && b !== null ? b.enabled !== !1 : !!b, [b]), Y = $(() => u !== void 0 ? u : !ze, [ze, u]), ht = $(() => typeof Y == "object" && Y !== null ? Y.enabled !== !1 : !!Y, [Y]), {
|
|
2075
|
+
rows: W,
|
|
2076
|
+
totalRecords: ge,
|
|
2077
|
+
loading: te,
|
|
2078
|
+
error: re,
|
|
2079
|
+
refresh: J,
|
|
2080
|
+
isServerMode: kt
|
|
2081
|
+
} = dr({
|
|
2082
|
+
data: ee,
|
|
2083
|
+
api: o,
|
|
2084
|
+
columns: Z,
|
|
2085
|
+
searchQuery: it,
|
|
2086
|
+
sortBy: ce,
|
|
2087
|
+
sortOrder: me,
|
|
2088
|
+
page: ft,
|
|
2089
|
+
pageSize: pt,
|
|
2090
|
+
paginationEnabled: ht,
|
|
2091
|
+
manualLoading: B
|
|
1878
2092
|
}), {
|
|
1879
|
-
enabled:
|
|
1880
|
-
page:
|
|
1881
|
-
pageSize:
|
|
1882
|
-
totalPages:
|
|
1883
|
-
pageSizeOptions:
|
|
1884
|
-
setPage:
|
|
1885
|
-
setPageSize:
|
|
1886
|
-
resetPagination:
|
|
1887
|
-
getPageWindow:
|
|
1888
|
-
paginationConfig:
|
|
1889
|
-
} =
|
|
1890
|
-
config:
|
|
1891
|
-
totalRecords:
|
|
1892
|
-
onPageChange: (
|
|
1893
|
-
|
|
2093
|
+
enabled: wt,
|
|
2094
|
+
page: ae,
|
|
2095
|
+
pageSize: ue,
|
|
2096
|
+
totalPages: Re,
|
|
2097
|
+
pageSizeOptions: vt,
|
|
2098
|
+
setPage: ne,
|
|
2099
|
+
setPageSize: We,
|
|
2100
|
+
resetPagination: Et,
|
|
2101
|
+
getPageWindow: Nt,
|
|
2102
|
+
paginationConfig: Fe
|
|
2103
|
+
} = er({
|
|
2104
|
+
config: Y,
|
|
2105
|
+
totalRecords: ge,
|
|
2106
|
+
onPageChange: (N, F) => {
|
|
2107
|
+
yt(N), xt(F);
|
|
1894
2108
|
}
|
|
1895
|
-
}),
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
),
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
2109
|
+
}), Le = de(null), {
|
|
2110
|
+
isVirtualized: O,
|
|
2111
|
+
paddingTop: At,
|
|
2112
|
+
paddingBottom: Tt,
|
|
2113
|
+
startIndex: St,
|
|
2114
|
+
maxHeight: oe,
|
|
2115
|
+
scrollToIndex: Ct,
|
|
2116
|
+
sliceRows: Oe
|
|
2117
|
+
} = gr({
|
|
2118
|
+
config: b,
|
|
2119
|
+
totalCount: W.length,
|
|
2120
|
+
scrollContainerRef: Le
|
|
2121
|
+
}), Pt = $(() => O ? Oe(W) : W, [O, W, Oe]), {
|
|
2122
|
+
selectedKeys: Ie,
|
|
2123
|
+
selectedRows: se,
|
|
2124
|
+
onToggleSelectRow: $t,
|
|
2125
|
+
handleToggleSelectAll: Bt,
|
|
2126
|
+
clearSelection: Dt,
|
|
2127
|
+
allSelected: Mt,
|
|
2128
|
+
isIndeterminate: Ht
|
|
2129
|
+
} = mr({
|
|
2130
|
+
rows: W,
|
|
2131
|
+
rowKeyResolver: De,
|
|
2132
|
+
onSelectionChange: v
|
|
2133
|
+
}), _t = $(
|
|
1917
2134
|
() => ({
|
|
1918
|
-
refresh:
|
|
1919
|
-
loading:
|
|
1920
|
-
page:
|
|
1921
|
-
selectedRows:
|
|
1922
|
-
setPage:
|
|
2135
|
+
refresh: J,
|
|
2136
|
+
loading: te,
|
|
2137
|
+
page: ae,
|
|
2138
|
+
selectedRows: se,
|
|
2139
|
+
setPage: ne
|
|
1923
2140
|
}),
|
|
1924
|
-
[
|
|
2141
|
+
[J, te, ae, se, ne]
|
|
1925
2142
|
);
|
|
1926
|
-
|
|
1927
|
-
tableRef:
|
|
1928
|
-
refresh:
|
|
1929
|
-
resetPagination:
|
|
1930
|
-
resetSearch:
|
|
1931
|
-
resetSorting:
|
|
1932
|
-
setPage:
|
|
1933
|
-
setPageSize:
|
|
1934
|
-
setSearch:
|
|
1935
|
-
setSorting:
|
|
1936
|
-
selectedRows:
|
|
1937
|
-
clearSelection:
|
|
2143
|
+
cr({
|
|
2144
|
+
tableRef: R,
|
|
2145
|
+
refresh: J,
|
|
2146
|
+
resetPagination: Et,
|
|
2147
|
+
resetSearch: _e,
|
|
2148
|
+
resetSorting: bt,
|
|
2149
|
+
setPage: ne,
|
|
2150
|
+
setPageSize: We,
|
|
2151
|
+
setSearch: He,
|
|
2152
|
+
setSorting: ut,
|
|
2153
|
+
selectedRows: se,
|
|
2154
|
+
clearSelection: Dt,
|
|
2155
|
+
scrollToIndex: Ct,
|
|
1938
2156
|
getState: () => ({
|
|
1939
|
-
data:
|
|
1940
|
-
loading:
|
|
1941
|
-
error:
|
|
1942
|
-
page:
|
|
1943
|
-
pageSize:
|
|
1944
|
-
total:
|
|
1945
|
-
totalPages:
|
|
1946
|
-
search:
|
|
1947
|
-
sortBy:
|
|
1948
|
-
sortOrder:
|
|
1949
|
-
selectedRowKeys: Array.from(
|
|
1950
|
-
selectedRows:
|
|
1951
|
-
isServerMode:
|
|
2157
|
+
data: W,
|
|
2158
|
+
loading: te,
|
|
2159
|
+
error: re,
|
|
2160
|
+
page: ae,
|
|
2161
|
+
pageSize: ue,
|
|
2162
|
+
total: ge,
|
|
2163
|
+
totalPages: Re,
|
|
2164
|
+
search: Me,
|
|
2165
|
+
sortBy: ce,
|
|
2166
|
+
sortOrder: me,
|
|
2167
|
+
selectedRowKeys: Array.from(Ie),
|
|
2168
|
+
selectedRows: se,
|
|
2169
|
+
isServerMode: kt
|
|
1952
2170
|
})
|
|
1953
2171
|
});
|
|
1954
|
-
const
|
|
1955
|
-
const
|
|
1956
|
-
return
|
|
1957
|
-
}, [
|
|
1958
|
-
|
|
2172
|
+
const jt = l || at, be = je.length > 0, zt = $(() => {
|
|
2173
|
+
const N = {};
|
|
2174
|
+
return C.borderRadius && (N["--any-table-radius"] = C.borderRadius), C.fontFamily && (N["--any-table-font"] = C.fontFamily, N.fontFamily = C.fontFamily), C.colors?.primary && (N["--any-table-primary"] = C.colors.primary), C.colors?.primaryHover && (N["--any-table-primary-hover"] = C.colors.primaryHover), C.colors?.border && (N["--any-table-border"] = C.colors.border), N;
|
|
2175
|
+
}, [C]), Rt = $(() => {
|
|
2176
|
+
const N = {};
|
|
2177
|
+
return C.borderRadius && (N.borderRadius = C.borderRadius), O && (N.maxHeight = typeof oe == "number" ? `${oe}px` : oe, N.overflowY = "auto", N.position = "relative"), N;
|
|
2178
|
+
}, [C.borderRadius, O, oe]);
|
|
2179
|
+
return /* @__PURE__ */ r.createElement(
|
|
1959
2180
|
"div",
|
|
1960
2181
|
{
|
|
1961
|
-
style:
|
|
1962
|
-
className: `any-table-wrapper ${
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
]
|
|
1996
|
-
}
|
|
1997
|
-
)
|
|
1998
|
-
] })
|
|
1999
|
-
] }),
|
|
2000
|
-
/* @__PURE__ */ a(
|
|
2001
|
-
"div",
|
|
2182
|
+
style: zt,
|
|
2183
|
+
className: `any-table-wrapper ${C.classes?.container || "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100"} ${D}`
|
|
2184
|
+
},
|
|
2185
|
+
/* @__PURE__ */ r.createElement(
|
|
2186
|
+
fr,
|
|
2187
|
+
{
|
|
2188
|
+
displayTitle: jt,
|
|
2189
|
+
subtitle: m,
|
|
2190
|
+
isSearchEnabled: lt,
|
|
2191
|
+
searchQuery: Me,
|
|
2192
|
+
setSearch: He,
|
|
2193
|
+
clearSearch: _e,
|
|
2194
|
+
isDebouncing: dt,
|
|
2195
|
+
searchPlaceholder: ct.placeholder,
|
|
2196
|
+
headerActions: z,
|
|
2197
|
+
add: nt,
|
|
2198
|
+
linkAdd: ot,
|
|
2199
|
+
addHandler: st
|
|
2200
|
+
}
|
|
2201
|
+
),
|
|
2202
|
+
/* @__PURE__ */ r.createElement(
|
|
2203
|
+
"div",
|
|
2204
|
+
{
|
|
2205
|
+
ref: Le,
|
|
2206
|
+
style: Rt,
|
|
2207
|
+
className: `${C.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors"} ${Q ? "" : "border-0 shadow-none"}`
|
|
2208
|
+
},
|
|
2209
|
+
re ? typeof w == "function" ? w(re, J) : w || /* @__PURE__ */ r.createElement(Rr, { error: re, onRetry: J }) : /* @__PURE__ */ r.createElement(
|
|
2210
|
+
"table",
|
|
2211
|
+
{
|
|
2212
|
+
className: `${C.classes?.table || "w-full border-collapse text-left text-sm"} ${L || C.density === "compact" ? "text-xs" : ""} ${H || O ? "relative" : ""} ${h}`
|
|
2213
|
+
},
|
|
2214
|
+
I && /* @__PURE__ */ r.createElement(
|
|
2215
|
+
yr,
|
|
2002
2216
|
{
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
actionsWidth: n,
|
|
2017
|
-
sortBy: ke,
|
|
2018
|
-
sortOrder: we,
|
|
2019
|
-
onSort: lt ? dt : void 0,
|
|
2020
|
-
selectable: f,
|
|
2021
|
-
allSelected: At,
|
|
2022
|
-
isIndeterminate: Ct,
|
|
2023
|
-
onToggleSelectAll: Nt,
|
|
2024
|
-
headerClassName: ye
|
|
2025
|
-
}
|
|
2026
|
-
),
|
|
2027
|
-
le && T.length === 0 ? _ ? /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0), children: _ }) }) }) : /* @__PURE__ */ a(
|
|
2028
|
-
Cr,
|
|
2029
|
-
{
|
|
2030
|
-
columnsCount: G.length + (f ? 1 : 0),
|
|
2031
|
-
rowsCount: ve || 5,
|
|
2032
|
-
hasActions: me
|
|
2033
|
-
}
|
|
2034
|
-
) : T.length === 0 ? (
|
|
2035
|
-
/* Empty State */
|
|
2036
|
-
/* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
|
|
2037
|
-
"td",
|
|
2038
|
-
{
|
|
2039
|
-
colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0),
|
|
2040
|
-
className: "p-0",
|
|
2041
|
-
children: x || /* @__PURE__ */ a(
|
|
2042
|
-
Sr,
|
|
2043
|
-
{
|
|
2044
|
-
title: N,
|
|
2045
|
-
description: w,
|
|
2046
|
-
isSearchActive: !!ze,
|
|
2047
|
-
onClearSearch: xe
|
|
2048
|
-
}
|
|
2049
|
-
)
|
|
2050
|
-
}
|
|
2051
|
-
) }) })
|
|
2052
|
-
) : (
|
|
2053
|
-
/* Body Rows */
|
|
2054
|
-
/* @__PURE__ */ a(
|
|
2055
|
-
vr,
|
|
2056
|
-
{
|
|
2057
|
-
rows: T,
|
|
2058
|
-
columns: G,
|
|
2059
|
-
actions: Oe,
|
|
2060
|
-
actionContext: Ae,
|
|
2061
|
-
rowKeyResolver: O,
|
|
2062
|
-
selectable: f,
|
|
2063
|
-
selectedKeys: z,
|
|
2064
|
-
onToggleSelectRow: wt,
|
|
2065
|
-
onRowClick: C,
|
|
2066
|
-
striped: V,
|
|
2067
|
-
hoverable: Y,
|
|
2068
|
-
rowClassName: j
|
|
2069
|
-
}
|
|
2070
|
-
)
|
|
2071
|
-
)
|
|
2072
|
-
]
|
|
2073
|
-
}
|
|
2074
|
-
)
|
|
2217
|
+
columns: Z,
|
|
2218
|
+
hasActions: be,
|
|
2219
|
+
actionsTitle: c,
|
|
2220
|
+
actionsWidth: n,
|
|
2221
|
+
sortBy: ce,
|
|
2222
|
+
sortOrder: me,
|
|
2223
|
+
onSort: mt ? gt : void 0,
|
|
2224
|
+
selectable: y,
|
|
2225
|
+
allSelected: Mt,
|
|
2226
|
+
isIndeterminate: Ht,
|
|
2227
|
+
onToggleSelectAll: Bt,
|
|
2228
|
+
headerClassName: j,
|
|
2229
|
+
sticky: H || O
|
|
2075
2230
|
}
|
|
2076
2231
|
),
|
|
2077
|
-
|
|
2078
|
-
|
|
2232
|
+
te && W.length === 0 ? E || /* @__PURE__ */ r.createElement(
|
|
2233
|
+
jr,
|
|
2079
2234
|
{
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
totalRecords: Ne,
|
|
2083
|
-
totalPages: He,
|
|
2084
|
-
pageSizeOptions: pt,
|
|
2085
|
-
onPageChange: ce,
|
|
2086
|
-
onPageSizeChange: Ue,
|
|
2087
|
-
showPageSizeSelector: Ke.showPageSizeSelector,
|
|
2088
|
-
showTotalCount: Ke.showTotalCount,
|
|
2089
|
-
pageWindow: kt(5)
|
|
2235
|
+
columnsCount: Z.length + (y ? 1 : 0) + (be ? 1 : 0),
|
|
2236
|
+
rowsCount: ue || 5
|
|
2090
2237
|
}
|
|
2238
|
+
) : W.length === 0 ? (
|
|
2239
|
+
// Empty State
|
|
2240
|
+
p || /* @__PURE__ */ r.createElement(
|
|
2241
|
+
zr,
|
|
2242
|
+
{
|
|
2243
|
+
title: x,
|
|
2244
|
+
description: k,
|
|
2245
|
+
colSpan: Z.length + (y ? 1 : 0) + (be ? 1 : 0)
|
|
2246
|
+
}
|
|
2247
|
+
)
|
|
2248
|
+
) : (
|
|
2249
|
+
// Table Body
|
|
2250
|
+
/* @__PURE__ */ r.createElement(
|
|
2251
|
+
Hr,
|
|
2252
|
+
{
|
|
2253
|
+
rows: Pt,
|
|
2254
|
+
columns: Z,
|
|
2255
|
+
actions: je,
|
|
2256
|
+
actionContext: _t,
|
|
2257
|
+
rowKeyResolver: De,
|
|
2258
|
+
selectable: y,
|
|
2259
|
+
selectedKeys: Ie,
|
|
2260
|
+
onToggleSelectRow: $t,
|
|
2261
|
+
onRowClick: T,
|
|
2262
|
+
striped: K,
|
|
2263
|
+
hoverable: U,
|
|
2264
|
+
rowClassName: M,
|
|
2265
|
+
isVirtualized: O,
|
|
2266
|
+
paddingTop: At,
|
|
2267
|
+
paddingBottom: Tt,
|
|
2268
|
+
startIndex: St
|
|
2269
|
+
}
|
|
2270
|
+
)
|
|
2091
2271
|
)
|
|
2092
|
-
|
|
2093
|
-
|
|
2272
|
+
)
|
|
2273
|
+
),
|
|
2274
|
+
wt && /* @__PURE__ */ r.createElement(
|
|
2275
|
+
_r,
|
|
2276
|
+
{
|
|
2277
|
+
page: ae,
|
|
2278
|
+
pageSize: ue,
|
|
2279
|
+
totalRecords: ge,
|
|
2280
|
+
totalPages: Re,
|
|
2281
|
+
pageSizeOptions: vt,
|
|
2282
|
+
onPageChange: ne,
|
|
2283
|
+
onPageSizeChange: We,
|
|
2284
|
+
showPageSizeSelector: Fe.showPageSizeSelector,
|
|
2285
|
+
showTotalCount: Fe.showTotalCount,
|
|
2286
|
+
pageWindow: Nt(5)
|
|
2287
|
+
}
|
|
2288
|
+
)
|
|
2094
2289
|
);
|
|
2095
2290
|
}
|
|
2096
|
-
function
|
|
2097
|
-
|
|
2098
|
-
}
|
|
2291
|
+
const Fr = r.forwardRef(function(t, o) {
|
|
2292
|
+
const s = o || t.tableRef;
|
|
2293
|
+
return !t.theme && !t.preset ? /* @__PURE__ */ r.createElement(Je, { ...t, tableRef: s }) : /* @__PURE__ */ r.createElement(ur, { theme: t.theme, preset: t.preset }, /* @__PURE__ */ r.createElement(Je, { ...t, tableRef: s }));
|
|
2294
|
+
});
|
|
2099
2295
|
export {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2296
|
+
Mr as ActionRenderer,
|
|
2297
|
+
Fr as AnyTable,
|
|
2298
|
+
Je as AnyTableInner,
|
|
2299
|
+
ur as AnyTableThemeProvider,
|
|
2300
|
+
Er as ArrayRenderer,
|
|
2301
|
+
$r as BadgeRenderer,
|
|
2302
|
+
xr as BooleanRenderer,
|
|
2303
|
+
Br as CellRenderer,
|
|
2304
|
+
Dr as ConfirmModal,
|
|
2305
|
+
hr as CurrencyRenderer,
|
|
2306
|
+
Qe as DEFAULT_THEME_COLORS,
|
|
2307
|
+
Ge as DateRenderer,
|
|
2308
|
+
Tr as EmailRenderer,
|
|
2309
|
+
_ as FallbackPlaceholder,
|
|
2310
|
+
kr as ImageRenderer,
|
|
2311
|
+
pr as NumberRenderer,
|
|
2312
|
+
Nr as ObjectRenderer,
|
|
2313
|
+
Sr as PhoneRenderer,
|
|
2314
|
+
Cr as ProgressRenderer,
|
|
2315
|
+
Pr as RatingRenderer,
|
|
2316
|
+
vr as StatusRenderer,
|
|
2317
|
+
tt as StringRenderer,
|
|
2318
|
+
Ye as TABLE_PRESETS,
|
|
2319
|
+
Hr as TableBody,
|
|
2320
|
+
zr as TableEmptyState,
|
|
2321
|
+
Rr as TableErrorState,
|
|
2322
|
+
yr as TableHeader,
|
|
2323
|
+
_r as TablePagination,
|
|
2324
|
+
br as TableSearch,
|
|
2325
|
+
jr as TableSkeleton,
|
|
2326
|
+
fr as TableToolbar,
|
|
2327
|
+
Ar as UrlRenderer,
|
|
2328
|
+
Fr as default,
|
|
2329
|
+
et as defaultAnyTableTheme,
|
|
2330
|
+
q as extractPaginationMeta,
|
|
2331
|
+
lr as filterRowsBySearch,
|
|
2332
|
+
Kt as generateAutoColumns,
|
|
2333
|
+
A as getNestedValue,
|
|
2334
|
+
ie as inferColumnType,
|
|
2335
|
+
Ue as isImageUrl,
|
|
2336
|
+
Yt as isIsoDate,
|
|
2337
|
+
Lt as isPlainObject,
|
|
2338
|
+
sr as normalizeApiResponse,
|
|
2339
|
+
rt as renderActionIcon,
|
|
2340
|
+
Jt as resolveColumns,
|
|
2341
|
+
qt as resolveTableActions,
|
|
2342
|
+
ir as sortRows,
|
|
2343
|
+
le as toTitleCase,
|
|
2344
|
+
cr as useAnyTableController,
|
|
2345
|
+
dr as useAnyTableData,
|
|
2346
|
+
er as useAnyTablePagination,
|
|
2347
|
+
Xt as useAnyTableSearch,
|
|
2348
|
+
mr as useAnyTableSelection,
|
|
2349
|
+
Qt as useAnyTableSorting,
|
|
2350
|
+
X as useAnyTableTheme,
|
|
2351
|
+
gr as useAnyTableVirtualizer
|
|
2152
2352
|
};
|
|
2153
2353
|
//# sourceMappingURL=index.js.map
|