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