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