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