better-table 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/better-table.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import B, { useContext as Ee, createContext as Oe, useCallback as
|
|
2
|
-
import { jsx as r, jsxs as y, Fragment as
|
|
1
|
+
import B, { useContext as Ee, createContext as Oe, useCallback as g, useMemo as A, useEffect as Fe, useState as I } from "react";
|
|
2
|
+
import { jsx as r, jsxs as y, Fragment as Ke } from "react/jsx-runtime";
|
|
3
3
|
import "./styles.js";
|
|
4
|
-
const
|
|
4
|
+
const He = {
|
|
5
5
|
search: "Buscar",
|
|
6
6
|
searchPlaceholder: "Buscar...",
|
|
7
7
|
noData: "No hay datos",
|
|
@@ -18,72 +18,72 @@ const Ve = {
|
|
|
18
18
|
clearFilters: "Limpiar filtros",
|
|
19
19
|
selectAll: "Seleccionar todo",
|
|
20
20
|
deselectAll: "Deseleccionar todo"
|
|
21
|
-
},
|
|
22
|
-
function
|
|
23
|
-
const e = Ee(
|
|
21
|
+
}, xe = Oe(null);
|
|
22
|
+
function x() {
|
|
23
|
+
const e = Ee(xe);
|
|
24
24
|
if (!e)
|
|
25
25
|
throw new Error("useTableContext must be used within a TableProvider");
|
|
26
26
|
return e;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function Ve({
|
|
29
29
|
value: e,
|
|
30
|
-
children:
|
|
30
|
+
children: a
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */ r(
|
|
32
|
+
return /* @__PURE__ */ r(xe.Provider, { value: e, children: a });
|
|
33
33
|
}
|
|
34
34
|
function $e(e) {
|
|
35
|
-
var
|
|
35
|
+
var a, n, l = "";
|
|
36
36
|
if (typeof e == "string" || typeof e == "number") l += e;
|
|
37
37
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
38
|
-
var
|
|
39
|
-
for (
|
|
40
|
-
} else for (
|
|
38
|
+
var i = e.length;
|
|
39
|
+
for (a = 0; a < i; a++) e[a] && (n = $e(e[a])) && (l && (l += " "), l += n);
|
|
40
|
+
} else for (n in e) e[n] && (l && (l += " "), l += n);
|
|
41
41
|
return l;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
for (var e,
|
|
43
|
+
function P() {
|
|
44
|
+
for (var e, a, n = 0, l = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (a = $e(e)) && (l && (l += " "), l += a);
|
|
45
45
|
return l;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function qe({
|
|
48
48
|
column: e
|
|
49
49
|
}) {
|
|
50
50
|
const {
|
|
51
|
-
sortState:
|
|
52
|
-
handleSort:
|
|
51
|
+
sortState: a,
|
|
52
|
+
handleSort: n,
|
|
53
53
|
filters: l,
|
|
54
|
-
setFilter:
|
|
54
|
+
setFilter: i,
|
|
55
55
|
locale: t
|
|
56
|
-
} =
|
|
57
|
-
e.sortable !== !1 &&
|
|
58
|
-
}, [e.id, e.sortable,
|
|
59
|
-
(
|
|
60
|
-
const p =
|
|
61
|
-
e.type === "boolean" ? p === "" ?
|
|
56
|
+
} = x(), s = a.columnId === e.id, c = s ? a.direction : null, d = g(() => {
|
|
57
|
+
e.sortable !== !1 && n(e.id);
|
|
58
|
+
}, [e.id, e.sortable, n]), b = g(
|
|
59
|
+
(u) => {
|
|
60
|
+
const p = u.target.value;
|
|
61
|
+
e.type === "boolean" ? p === "" ? i(e.id, null) : i(e.id, p === "true") : i(e.id, p || null);
|
|
62
62
|
},
|
|
63
|
-
[e.id, e.type,
|
|
64
|
-
),
|
|
65
|
-
(
|
|
66
|
-
|
|
63
|
+
[e.id, e.type, i]
|
|
64
|
+
), h = g(
|
|
65
|
+
(u) => {
|
|
66
|
+
u.key === "Enter" && e.sortable !== !1 && n(e.id);
|
|
67
67
|
},
|
|
68
|
-
[e.id, e.sortable,
|
|
69
|
-
),
|
|
68
|
+
[e.id, e.sortable, n]
|
|
69
|
+
), m = () => e.sortable === !1 || e.type === "custom" ? null : /* @__PURE__ */ r(
|
|
70
70
|
"button",
|
|
71
71
|
{
|
|
72
|
-
className:
|
|
72
|
+
className: P("bt-sort-btn", s && "bt-active"),
|
|
73
73
|
onClick: d,
|
|
74
|
-
"aria-label":
|
|
74
|
+
"aria-label": c === "asc" ? t.sortDesc : t.sortAsc,
|
|
75
75
|
type: "button",
|
|
76
|
-
children:
|
|
76
|
+
children: s ? c === "asc" ? "↑" : "↓" : "⇅"
|
|
77
77
|
}
|
|
78
|
-
),
|
|
78
|
+
), f = () => {
|
|
79
79
|
if (e.filterable === !1 || e.type === "custom")
|
|
80
80
|
return null;
|
|
81
|
-
const
|
|
81
|
+
const u = l[e.id];
|
|
82
82
|
return e.type === "boolean" ? /* @__PURE__ */ y(
|
|
83
83
|
"select",
|
|
84
84
|
{
|
|
85
85
|
className: "bt-filter-select",
|
|
86
|
-
value:
|
|
86
|
+
value: u == null ? "" : String(u),
|
|
87
87
|
onChange: b,
|
|
88
88
|
"aria-label": `${t.filterBy} ${e.header}`,
|
|
89
89
|
children: [
|
|
@@ -98,7 +98,7 @@ function Je({
|
|
|
98
98
|
type: e.type === "number" ? "number" : "text",
|
|
99
99
|
className: "bt-filter-input",
|
|
100
100
|
placeholder: `${t.filterBy}...`,
|
|
101
|
-
value:
|
|
101
|
+
value: u != null ? String(u) : "",
|
|
102
102
|
onChange: b,
|
|
103
103
|
"aria-label": `${t.filterBy} ${e.header}`
|
|
104
104
|
}
|
|
@@ -107,176 +107,174 @@ function Je({
|
|
|
107
107
|
return e.headerCell ? /* @__PURE__ */ r(
|
|
108
108
|
"th",
|
|
109
109
|
{
|
|
110
|
-
className:
|
|
110
|
+
className: P("bt-th", e.align && `bt-align-${e.align}`),
|
|
111
111
|
style: { width: e.width },
|
|
112
112
|
children: e.headerCell(e)
|
|
113
113
|
}
|
|
114
114
|
) : /* @__PURE__ */ r(
|
|
115
115
|
"th",
|
|
116
116
|
{
|
|
117
|
-
className:
|
|
117
|
+
className: P("bt-th", e.align && `bt-align-${e.align}`),
|
|
118
118
|
style: { width: e.width },
|
|
119
119
|
role: "columnheader",
|
|
120
|
-
"aria-sort":
|
|
120
|
+
"aria-sort": s ? c === "asc" ? "ascending" : "descending" : void 0,
|
|
121
121
|
tabIndex: e.sortable !== !1 ? 0 : void 0,
|
|
122
|
-
onKeyDown: e.sortable !== !1 ?
|
|
122
|
+
onKeyDown: e.sortable !== !1 ? h : void 0,
|
|
123
123
|
children: /* @__PURE__ */ y("div", { className: "bt-th-content", children: [
|
|
124
124
|
/* @__PURE__ */ y("div", { className: "bt-th-header", children: [
|
|
125
125
|
/* @__PURE__ */ r("span", { className: "bt-th-title", children: e.header }),
|
|
126
|
-
|
|
126
|
+
m()
|
|
127
127
|
] }),
|
|
128
|
-
e.filterable !== !1 &&
|
|
128
|
+
e.filterable !== !1 && f()
|
|
129
129
|
] })
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
133
|
+
const Je = B.memo(
|
|
134
|
+
qe
|
|
135
135
|
);
|
|
136
|
-
function
|
|
136
|
+
function _e() {
|
|
137
137
|
const {
|
|
138
138
|
columns: e,
|
|
139
|
-
selectable:
|
|
140
|
-
selectionMode:
|
|
139
|
+
selectable: a,
|
|
140
|
+
selectionMode: n,
|
|
141
141
|
rowActions: l,
|
|
142
|
-
isAllSelected:
|
|
142
|
+
isAllSelected: i,
|
|
143
143
|
isPartiallySelected: t,
|
|
144
|
-
selectAll:
|
|
145
|
-
deselectAll:
|
|
144
|
+
selectAll: s,
|
|
145
|
+
deselectAll: c,
|
|
146
146
|
locale: d,
|
|
147
147
|
stickyHeader: b
|
|
148
|
-
} =
|
|
149
|
-
|
|
148
|
+
} = x(), h = e.filter((u) => !u.hidden), m = l && l.length > 0, f = () => {
|
|
149
|
+
i ? c() : s();
|
|
150
150
|
};
|
|
151
|
-
return /* @__PURE__ */ r("thead", { className:
|
|
152
|
-
|
|
151
|
+
return /* @__PURE__ */ r("thead", { className: P("bt-thead", b && "bt-sticky"), children: /* @__PURE__ */ y("tr", { className: "bt-tr", children: [
|
|
152
|
+
a && /* @__PURE__ */ r("th", { className: "bt-th bt-checkbox-cell", children: n === "multiple" && /* @__PURE__ */ r(
|
|
153
153
|
"input",
|
|
154
154
|
{
|
|
155
155
|
type: "checkbox",
|
|
156
156
|
className: "bt-checkbox",
|
|
157
|
-
checked:
|
|
158
|
-
ref: (
|
|
159
|
-
|
|
157
|
+
checked: i,
|
|
158
|
+
ref: (u) => {
|
|
159
|
+
u && (u.indeterminate = t);
|
|
160
160
|
},
|
|
161
|
-
onChange:
|
|
162
|
-
"aria-label":
|
|
161
|
+
onChange: f,
|
|
162
|
+
"aria-label": i ? d.deselectAll : d.selectAll
|
|
163
163
|
}
|
|
164
164
|
) }),
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
h.map((u) => /* @__PURE__ */ r(Je, { column: u }, u.id)),
|
|
166
|
+
m && /* @__PURE__ */ r("th", { className: "bt-th bt-actions-cell", children: d.actions })
|
|
167
167
|
] }) });
|
|
168
168
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
171
|
-
if (!e || !
|
|
172
|
-
const
|
|
169
|
+
const Qe = _e;
|
|
170
|
+
function M(e, a) {
|
|
171
|
+
if (!e || !a) return;
|
|
172
|
+
const n = a.split(".");
|
|
173
173
|
let l = e;
|
|
174
|
-
for (const
|
|
174
|
+
for (const i of n) {
|
|
175
175
|
if (l == null)
|
|
176
176
|
return;
|
|
177
177
|
if (typeof l == "object")
|
|
178
|
-
l = l[
|
|
178
|
+
l = l[i];
|
|
179
179
|
else
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
182
|
return l;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
return [...e].sort((l,
|
|
186
|
-
const t =
|
|
184
|
+
function Ge(e, a, n) {
|
|
185
|
+
return [...e].sort((l, i) => {
|
|
186
|
+
const t = M(l, a), s = M(i, a);
|
|
187
187
|
if (t == null)
|
|
188
|
-
return
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
191
|
-
if (typeof t == "string" && typeof
|
|
192
|
-
const
|
|
188
|
+
return n === "asc" ? 1 : -1;
|
|
189
|
+
if (s == null)
|
|
190
|
+
return n === "asc" ? -1 : 1;
|
|
191
|
+
if (typeof t == "string" && typeof s == "string") {
|
|
192
|
+
const h = t.localeCompare(s, void 0, {
|
|
193
193
|
sensitivity: "base",
|
|
194
194
|
numeric: !0
|
|
195
195
|
});
|
|
196
|
-
return
|
|
196
|
+
return n === "asc" ? h : -h;
|
|
197
197
|
}
|
|
198
|
-
if (typeof t == "number" && typeof
|
|
199
|
-
return
|
|
200
|
-
if (typeof t == "boolean" && typeof
|
|
201
|
-
const
|
|
202
|
-
return
|
|
198
|
+
if (typeof t == "number" && typeof s == "number")
|
|
199
|
+
return n === "asc" ? t - s : s - t;
|
|
200
|
+
if (typeof t == "boolean" && typeof s == "boolean") {
|
|
201
|
+
const h = t === s ? 0 : t ? -1 : 1;
|
|
202
|
+
return n === "asc" ? h : -h;
|
|
203
203
|
}
|
|
204
|
-
if (t instanceof Date &&
|
|
205
|
-
const
|
|
206
|
-
return
|
|
204
|
+
if (t instanceof Date && s instanceof Date) {
|
|
205
|
+
const h = t.getTime() - s.getTime();
|
|
206
|
+
return n === "asc" ? h : -h;
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
return
|
|
208
|
+
const c = String(t), d = String(s), b = c.localeCompare(d);
|
|
209
|
+
return n === "asc" ? b : -b;
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
const l = Object.entries(
|
|
214
|
-
([,
|
|
212
|
+
function Ue(e, a, n) {
|
|
213
|
+
const l = Object.entries(a).filter(
|
|
214
|
+
([, i]) => i != null && i !== ""
|
|
215
215
|
);
|
|
216
|
-
return l.length === 0 ? e : e.filter((
|
|
217
|
-
const
|
|
218
|
-
if (!
|
|
219
|
-
const d =
|
|
220
|
-
|
|
221
|
-
String(
|
|
216
|
+
return l.length === 0 ? e : e.filter((i) => l.every(([t, s]) => {
|
|
217
|
+
const c = n.find((h) => h.id === t);
|
|
218
|
+
if (!c) return !0;
|
|
219
|
+
const d = M(
|
|
220
|
+
i,
|
|
221
|
+
String(c.accessor)
|
|
222
222
|
);
|
|
223
223
|
if (d == null)
|
|
224
224
|
return !1;
|
|
225
|
-
switch (
|
|
225
|
+
switch (c.type ?? "string") {
|
|
226
226
|
case "boolean":
|
|
227
|
-
return d ===
|
|
227
|
+
return d === s;
|
|
228
228
|
case "number":
|
|
229
|
-
return String(d) === String(
|
|
229
|
+
return String(d) === String(s);
|
|
230
230
|
case "date":
|
|
231
|
-
if (d instanceof Date &&
|
|
232
|
-
const
|
|
233
|
-
return d.toDateString() ===
|
|
231
|
+
if (d instanceof Date && s) {
|
|
232
|
+
const h = new Date(String(s));
|
|
233
|
+
return d.toDateString() === h.toDateString();
|
|
234
234
|
}
|
|
235
|
-
return String(d).includes(String(
|
|
236
|
-
case "string":
|
|
235
|
+
return String(d).includes(String(s));
|
|
237
236
|
default:
|
|
238
|
-
return String(d).toLowerCase().includes(String(
|
|
237
|
+
return String(d).toLowerCase().includes(String(s).toLowerCase());
|
|
239
238
|
}
|
|
240
239
|
}));
|
|
241
240
|
}
|
|
242
|
-
function
|
|
243
|
-
if (!
|
|
241
|
+
function We(e, a, n, l) {
|
|
242
|
+
if (!a.trim())
|
|
244
243
|
return e;
|
|
245
|
-
const
|
|
244
|
+
const i = a.toLowerCase().trim(), t = l ? n.filter((s) => l.includes(s.id)) : n.filter((s) => s.type !== "custom");
|
|
246
245
|
return e.filter(
|
|
247
|
-
(
|
|
248
|
-
const d =
|
|
249
|
-
|
|
250
|
-
String(
|
|
246
|
+
(s) => t.some((c) => {
|
|
247
|
+
const d = M(
|
|
248
|
+
s,
|
|
249
|
+
String(c.accessor)
|
|
251
250
|
);
|
|
252
|
-
return d == null ? !1 : String(d).toLowerCase().includes(
|
|
251
|
+
return d == null ? !1 : String(d).toLowerCase().includes(i);
|
|
253
252
|
})
|
|
254
253
|
);
|
|
255
254
|
}
|
|
256
|
-
function
|
|
255
|
+
function Xe({
|
|
257
256
|
row: e,
|
|
258
|
-
column:
|
|
259
|
-
rowIndex:
|
|
257
|
+
column: a,
|
|
258
|
+
rowIndex: n
|
|
260
259
|
}) {
|
|
261
|
-
const l =
|
|
260
|
+
const l = M(
|
|
262
261
|
e,
|
|
263
|
-
String(
|
|
262
|
+
String(a.accessor)
|
|
264
263
|
), t = (() => {
|
|
265
|
-
if (
|
|
266
|
-
return
|
|
264
|
+
if (a.cell)
|
|
265
|
+
return a.cell(l, e, n);
|
|
267
266
|
if (l == null)
|
|
268
267
|
return /* @__PURE__ */ r("span", { className: "bt-cell-empty", children: "—" });
|
|
269
|
-
switch (
|
|
268
|
+
switch (a.type) {
|
|
270
269
|
case "boolean":
|
|
271
270
|
return l ? "✅" : "❌";
|
|
272
271
|
case "date":
|
|
273
272
|
if (l instanceof Date)
|
|
274
273
|
return l.toLocaleDateString();
|
|
275
|
-
const
|
|
276
|
-
return isNaN(
|
|
274
|
+
const s = new Date(String(l));
|
|
275
|
+
return isNaN(s.getTime()) ? String(l) : s.toLocaleDateString();
|
|
277
276
|
case "number":
|
|
278
277
|
return typeof l == "number" ? l.toLocaleString() : l;
|
|
279
|
-
case "string":
|
|
280
278
|
default:
|
|
281
279
|
return String(l);
|
|
282
280
|
}
|
|
@@ -284,26 +282,26 @@ function Ye({
|
|
|
284
282
|
return /* @__PURE__ */ r(
|
|
285
283
|
"td",
|
|
286
284
|
{
|
|
287
|
-
className:
|
|
288
|
-
style: { width:
|
|
285
|
+
className: P("bt-td", a.align && `bt-align-${a.align}`),
|
|
286
|
+
style: { width: a.width },
|
|
289
287
|
children: t
|
|
290
288
|
}
|
|
291
289
|
);
|
|
292
290
|
}
|
|
293
|
-
const
|
|
294
|
-
function
|
|
291
|
+
const Ye = B.memo(Xe);
|
|
292
|
+
function Ze({
|
|
295
293
|
row: e,
|
|
296
|
-
rowIndex:
|
|
294
|
+
rowIndex: a
|
|
297
295
|
}) {
|
|
298
|
-
const { rowActions:
|
|
296
|
+
const { rowActions: n, openModal: l } = x(), i = g(
|
|
299
297
|
(t) => {
|
|
300
298
|
if (t.mode === "callback" && t.onClick)
|
|
301
|
-
t.onClick(e,
|
|
299
|
+
t.onClick(e, a);
|
|
302
300
|
else if (t.mode === "modal" && t.modalContent) {
|
|
303
|
-
const
|
|
301
|
+
const s = t.modalContent;
|
|
304
302
|
l(
|
|
305
303
|
/* @__PURE__ */ r(
|
|
306
|
-
|
|
304
|
+
s,
|
|
307
305
|
{
|
|
308
306
|
data: e,
|
|
309
307
|
onClose: () => {
|
|
@@ -312,25 +310,25 @@ function Fe({
|
|
|
312
310
|
)
|
|
313
311
|
);
|
|
314
312
|
} else if (t.mode === "link" && t.href) {
|
|
315
|
-
const
|
|
316
|
-
window.open(
|
|
313
|
+
const s = typeof t.href == "function" ? t.href(e) : t.href;
|
|
314
|
+
window.open(s, "_blank");
|
|
317
315
|
}
|
|
318
316
|
},
|
|
319
|
-
[e,
|
|
317
|
+
[e, a, l]
|
|
320
318
|
);
|
|
321
|
-
return !
|
|
319
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ r("td", { className: "bt-td bt-actions-cell", children: /* @__PURE__ */ r("div", { className: "bt-actions-wrapper", children: n.map((t) => {
|
|
322
320
|
if (t.visible && !t.visible(e))
|
|
323
321
|
return null;
|
|
324
|
-
const
|
|
322
|
+
const s = t.disabled ? t.disabled(e) : !1;
|
|
325
323
|
if (t.mode === "link" && t.href) {
|
|
326
|
-
const
|
|
324
|
+
const c = typeof t.href == "function" ? t.href(e) : t.href;
|
|
327
325
|
return /* @__PURE__ */ r(
|
|
328
326
|
"a",
|
|
329
327
|
{
|
|
330
|
-
href:
|
|
328
|
+
href: c,
|
|
331
329
|
target: "_blank",
|
|
332
330
|
rel: "noopener noreferrer",
|
|
333
|
-
className:
|
|
331
|
+
className: P(
|
|
334
332
|
"bt-action-btn",
|
|
335
333
|
t.variant && `bt-variant-${t.variant}`
|
|
336
334
|
),
|
|
@@ -343,12 +341,12 @@ function Fe({
|
|
|
343
341
|
return /* @__PURE__ */ r(
|
|
344
342
|
"button",
|
|
345
343
|
{
|
|
346
|
-
className:
|
|
344
|
+
className: P(
|
|
347
345
|
"bt-action-btn",
|
|
348
346
|
t.variant && `bt-variant-${t.variant}`
|
|
349
347
|
),
|
|
350
|
-
onClick: () =>
|
|
351
|
-
disabled:
|
|
348
|
+
onClick: () => i(t),
|
|
349
|
+
disabled: s,
|
|
352
350
|
"aria-label": t.label,
|
|
353
351
|
title: t.label,
|
|
354
352
|
type: "button",
|
|
@@ -359,146 +357,146 @@ function Fe({
|
|
|
359
357
|
}) }) });
|
|
360
358
|
}
|
|
361
359
|
const et = B.memo(
|
|
362
|
-
|
|
360
|
+
Ze
|
|
363
361
|
);
|
|
364
|
-
function tt({ row: e, rowIndex:
|
|
362
|
+
function tt({ row: e, rowIndex: a }) {
|
|
365
363
|
const {
|
|
366
|
-
columns:
|
|
364
|
+
columns: n,
|
|
367
365
|
selectable: l,
|
|
368
|
-
rowActions:
|
|
366
|
+
rowActions: i,
|
|
369
367
|
isSelected: t,
|
|
370
|
-
toggleRow:
|
|
371
|
-
striped:
|
|
368
|
+
toggleRow: s,
|
|
369
|
+
striped: c,
|
|
372
370
|
hoverable: d,
|
|
373
371
|
onRowClick: b,
|
|
374
|
-
onRowDoubleClick:
|
|
375
|
-
} =
|
|
376
|
-
b
|
|
377
|
-
}, [e,
|
|
378
|
-
|
|
379
|
-
}, [e,
|
|
380
|
-
|
|
381
|
-
}, [e,
|
|
382
|
-
(
|
|
383
|
-
|
|
372
|
+
onRowDoubleClick: h
|
|
373
|
+
} = x(), m = n.filter((N) => !N.hidden), f = i && i.length > 0, u = l && t(e, a), p = !!b, S = g(() => {
|
|
374
|
+
b?.(e, a);
|
|
375
|
+
}, [e, a, b]), D = g(() => {
|
|
376
|
+
h?.(e, a);
|
|
377
|
+
}, [e, a, h]), $ = g(() => {
|
|
378
|
+
s(e, a);
|
|
379
|
+
}, [e, a, s]), T = g(
|
|
380
|
+
(N) => {
|
|
381
|
+
N.key === "Enter" && b && S();
|
|
384
382
|
},
|
|
385
|
-
[
|
|
383
|
+
[S, b]
|
|
386
384
|
);
|
|
387
385
|
return /* @__PURE__ */ y(
|
|
388
386
|
"tr",
|
|
389
387
|
{
|
|
390
|
-
className:
|
|
388
|
+
className: P(
|
|
391
389
|
"bt-tr",
|
|
392
|
-
|
|
390
|
+
c && "bt-striped",
|
|
393
391
|
d && "bt-hoverable",
|
|
394
|
-
|
|
392
|
+
u && "bt-selected",
|
|
395
393
|
p && "bt-clickable"
|
|
396
394
|
),
|
|
397
|
-
onClick: p ?
|
|
398
|
-
onDoubleClick:
|
|
399
|
-
onKeyDown: p ?
|
|
395
|
+
onClick: p ? S : void 0,
|
|
396
|
+
onDoubleClick: h ? D : void 0,
|
|
397
|
+
onKeyDown: p ? T : void 0,
|
|
400
398
|
tabIndex: p ? 0 : void 0,
|
|
401
399
|
role: p ? "button" : void 0,
|
|
402
|
-
"aria-selected": l ?
|
|
400
|
+
"aria-selected": l ? u : void 0,
|
|
403
401
|
children: [
|
|
404
402
|
l && /* @__PURE__ */ r("td", { className: "bt-td bt-checkbox-cell", children: /* @__PURE__ */ r(
|
|
405
403
|
"input",
|
|
406
404
|
{
|
|
407
405
|
type: "checkbox",
|
|
408
406
|
className: "bt-checkbox",
|
|
409
|
-
checked:
|
|
407
|
+
checked: u,
|
|
410
408
|
onChange: $,
|
|
411
|
-
onClick: (
|
|
412
|
-
"aria-label": `Select row ${
|
|
409
|
+
onClick: (N) => N.stopPropagation(),
|
|
410
|
+
"aria-label": `Select row ${a + 1}`
|
|
413
411
|
}
|
|
414
412
|
) }),
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
m.map((N) => /* @__PURE__ */ r(
|
|
414
|
+
Ye,
|
|
417
415
|
{
|
|
418
416
|
row: e,
|
|
419
|
-
column:
|
|
420
|
-
rowIndex:
|
|
417
|
+
column: N,
|
|
418
|
+
rowIndex: a
|
|
421
419
|
},
|
|
422
|
-
|
|
420
|
+
N.id
|
|
423
421
|
)),
|
|
424
|
-
|
|
422
|
+
f && /* @__PURE__ */ r(et, { row: e, rowIndex: a })
|
|
425
423
|
]
|
|
426
424
|
}
|
|
427
425
|
);
|
|
428
426
|
}
|
|
429
427
|
const at = B.memo(tt);
|
|
430
|
-
function
|
|
431
|
-
const { processedData: e, rowKey:
|
|
432
|
-
if (typeof
|
|
433
|
-
return
|
|
434
|
-
const t = l[
|
|
435
|
-
return String(t !== void 0 ? t :
|
|
428
|
+
function nt() {
|
|
429
|
+
const { processedData: e, rowKey: a } = x(), n = (l, i) => {
|
|
430
|
+
if (typeof a == "function")
|
|
431
|
+
return a(l, i);
|
|
432
|
+
const t = l[a];
|
|
433
|
+
return String(t !== void 0 ? t : i);
|
|
436
434
|
};
|
|
437
|
-
return /* @__PURE__ */ r("tbody", { className: "bt-tbody", children: e.map((l,
|
|
435
|
+
return /* @__PURE__ */ r("tbody", { className: "bt-tbody", children: e.map((l, i) => /* @__PURE__ */ r(at, { row: l, rowIndex: i }, n(l, i))) });
|
|
438
436
|
}
|
|
439
|
-
const
|
|
440
|
-
function
|
|
437
|
+
const lt = nt;
|
|
438
|
+
function st() {
|
|
441
439
|
const {
|
|
442
440
|
page: e,
|
|
443
|
-
pageSize:
|
|
444
|
-
totalPages:
|
|
441
|
+
pageSize: a,
|
|
442
|
+
totalPages: n,
|
|
445
443
|
totalItems: l,
|
|
446
|
-
goToPage:
|
|
444
|
+
goToPage: i,
|
|
447
445
|
nextPage: t,
|
|
448
|
-
prevPage:
|
|
449
|
-
changePageSize:
|
|
446
|
+
prevPage: s,
|
|
447
|
+
changePageSize: c,
|
|
450
448
|
hasNextPage: d,
|
|
451
449
|
hasPrevPage: b,
|
|
452
|
-
startIndex:
|
|
453
|
-
endIndex:
|
|
454
|
-
paginationEnabled:
|
|
455
|
-
pageSizeOptions:
|
|
450
|
+
startIndex: h,
|
|
451
|
+
endIndex: m,
|
|
452
|
+
paginationEnabled: f,
|
|
453
|
+
pageSizeOptions: u,
|
|
456
454
|
showSizeChanger: p,
|
|
457
|
-
locale:
|
|
458
|
-
classNames:
|
|
459
|
-
} =
|
|
460
|
-
(
|
|
461
|
-
|
|
455
|
+
locale: S,
|
|
456
|
+
classNames: D
|
|
457
|
+
} = x(), $ = g(
|
|
458
|
+
(o) => {
|
|
459
|
+
c(Number(o.target.value));
|
|
462
460
|
},
|
|
463
|
-
[
|
|
464
|
-
),
|
|
465
|
-
(
|
|
466
|
-
if (
|
|
467
|
-
const v = parseInt(
|
|
468
|
-
!isNaN(v) && v >= 1 && v <=
|
|
461
|
+
[c]
|
|
462
|
+
), T = g(
|
|
463
|
+
(o) => {
|
|
464
|
+
if (o.key === "Enter") {
|
|
465
|
+
const v = parseInt(o.target.value, 10);
|
|
466
|
+
!isNaN(v) && v >= 1 && v <= n && i(v);
|
|
469
467
|
}
|
|
470
468
|
},
|
|
471
|
-
[
|
|
472
|
-
),
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
for (let
|
|
476
|
-
|
|
469
|
+
[i, n]
|
|
470
|
+
), N = A(() => {
|
|
471
|
+
const o = [];
|
|
472
|
+
if (n <= 5)
|
|
473
|
+
for (let C = 1; C <= n; C++)
|
|
474
|
+
o.push(C);
|
|
477
475
|
else {
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
for (let
|
|
481
|
-
|
|
482
|
-
e <
|
|
476
|
+
o.push(1), e > 3 && o.push("ellipsis");
|
|
477
|
+
const C = Math.max(2, e - 1), k = Math.min(n - 1, e + 1);
|
|
478
|
+
for (let w = C; w <= k; w++)
|
|
479
|
+
o.push(w);
|
|
480
|
+
e < n - 2 && o.push("ellipsis"), n > 1 && o.push(n);
|
|
483
481
|
}
|
|
484
|
-
return
|
|
485
|
-
}, [e,
|
|
486
|
-
return
|
|
487
|
-
/* @__PURE__ */ r("div", { className: "bt-pagination-info", children: l > 0 ? `${
|
|
482
|
+
return o;
|
|
483
|
+
}, [e, n]);
|
|
484
|
+
return f ? /* @__PURE__ */ y("div", { className: `bt-pagination ${D.pagination || ""}`, children: [
|
|
485
|
+
/* @__PURE__ */ r("div", { className: "bt-pagination-info", children: l > 0 ? `${h}-${m} ${S.of} ${l} ${S.items}` : `0 ${S.items}` }),
|
|
488
486
|
/* @__PURE__ */ y("div", { className: "bt-pagination-controls", children: [
|
|
489
487
|
p && /* @__PURE__ */ y("div", { className: "bt-page-size", children: [
|
|
490
488
|
/* @__PURE__ */ y("span", { className: "bt-page-size-label", children: [
|
|
491
|
-
|
|
489
|
+
S.rowsPerPage,
|
|
492
490
|
":"
|
|
493
491
|
] }),
|
|
494
492
|
/* @__PURE__ */ r(
|
|
495
493
|
"select",
|
|
496
494
|
{
|
|
497
495
|
className: "bt-page-size-select",
|
|
498
|
-
value:
|
|
496
|
+
value: a,
|
|
499
497
|
onChange: $,
|
|
500
|
-
"aria-label":
|
|
501
|
-
children:
|
|
498
|
+
"aria-label": S.rowsPerPage,
|
|
499
|
+
children: u.map((o) => /* @__PURE__ */ r("option", { value: o, children: o }, o))
|
|
502
500
|
}
|
|
503
501
|
)
|
|
504
502
|
] }),
|
|
@@ -506,24 +504,24 @@ function nt() {
|
|
|
506
504
|
"button",
|
|
507
505
|
{
|
|
508
506
|
className: "bt-pagination-btn",
|
|
509
|
-
onClick:
|
|
507
|
+
onClick: s,
|
|
510
508
|
disabled: !b,
|
|
511
509
|
"aria-label": "Previous page",
|
|
512
510
|
type: "button",
|
|
513
511
|
children: "←"
|
|
514
512
|
}
|
|
515
513
|
),
|
|
516
|
-
/* @__PURE__ */ r("div", { className: "bt-pagination-pages", children:
|
|
514
|
+
/* @__PURE__ */ r("div", { className: "bt-pagination-pages", children: N.map((o, v) => o === "ellipsis" ? /* @__PURE__ */ r("span", { className: "bt-pagination-ellipsis", children: "..." }, `ellipsis-${v}`) : /* @__PURE__ */ r(
|
|
517
515
|
"button",
|
|
518
516
|
{
|
|
519
|
-
className: `bt-pagination-btn ${e ===
|
|
520
|
-
onClick: () =>
|
|
521
|
-
"aria-label": `${
|
|
522
|
-
"aria-current": e ===
|
|
517
|
+
className: `bt-pagination-btn ${e === o ? "bt-active" : ""}`,
|
|
518
|
+
onClick: () => i(o),
|
|
519
|
+
"aria-label": `${S.page} ${o}`,
|
|
520
|
+
"aria-current": e === o ? "page" : void 0,
|
|
523
521
|
type: "button",
|
|
524
|
-
children:
|
|
522
|
+
children: o
|
|
525
523
|
},
|
|
526
|
-
|
|
524
|
+
o
|
|
527
525
|
)) }),
|
|
528
526
|
/* @__PURE__ */ r(
|
|
529
527
|
"button",
|
|
@@ -538,7 +536,7 @@ function nt() {
|
|
|
538
536
|
),
|
|
539
537
|
/* @__PURE__ */ y("div", { className: "bt-quick-jumper", children: [
|
|
540
538
|
/* @__PURE__ */ y("span", { className: "bt-quick-jumper-label", children: [
|
|
541
|
-
|
|
539
|
+
S.page,
|
|
542
540
|
":"
|
|
543
541
|
] }),
|
|
544
542
|
/* @__PURE__ */ r(
|
|
@@ -547,9 +545,9 @@ function nt() {
|
|
|
547
545
|
type: "number",
|
|
548
546
|
className: "bt-quick-jumper-input",
|
|
549
547
|
min: 1,
|
|
550
|
-
max:
|
|
548
|
+
max: n,
|
|
551
549
|
defaultValue: e,
|
|
552
|
-
onKeyDown:
|
|
550
|
+
onKeyDown: T,
|
|
553
551
|
"aria-label": "Jump to page"
|
|
554
552
|
}
|
|
555
553
|
)
|
|
@@ -560,24 +558,24 @@ function nt() {
|
|
|
560
558
|
function it() {
|
|
561
559
|
const {
|
|
562
560
|
searchable: e,
|
|
563
|
-
searchValue:
|
|
564
|
-
handleSearch:
|
|
561
|
+
searchValue: a,
|
|
562
|
+
handleSearch: n,
|
|
565
563
|
clearSearch: l,
|
|
566
|
-
globalActions:
|
|
564
|
+
globalActions: i,
|
|
567
565
|
selectedRows: t,
|
|
568
|
-
selectedCount:
|
|
569
|
-
deselectAll:
|
|
566
|
+
selectedCount: s,
|
|
567
|
+
deselectAll: c,
|
|
570
568
|
data: d,
|
|
571
569
|
locale: b,
|
|
572
|
-
classNames:
|
|
573
|
-
selectable:
|
|
574
|
-
} =
|
|
570
|
+
classNames: h,
|
|
571
|
+
selectable: m
|
|
572
|
+
} = x(), f = g(
|
|
575
573
|
(p) => {
|
|
576
|
-
|
|
574
|
+
n(p.target.value);
|
|
577
575
|
},
|
|
578
|
-
[
|
|
576
|
+
[n]
|
|
579
577
|
);
|
|
580
|
-
return e ||
|
|
578
|
+
return e || i && i.length > 0 || m && s > 0 ? /* @__PURE__ */ y("div", { className: `bt-toolbar ${h.toolbar || ""}`, children: [
|
|
581
579
|
/* @__PURE__ */ y("div", { className: "bt-toolbar-left", children: [
|
|
582
580
|
e && /* @__PURE__ */ y("div", { className: "bt-search", children: [
|
|
583
581
|
/* @__PURE__ */ r("span", { className: "bt-search-icon", children: "🔍" }),
|
|
@@ -587,12 +585,12 @@ function it() {
|
|
|
587
585
|
type: "text",
|
|
588
586
|
className: "bt-search-input",
|
|
589
587
|
placeholder: b.searchPlaceholder,
|
|
590
|
-
value:
|
|
591
|
-
onChange:
|
|
588
|
+
value: a,
|
|
589
|
+
onChange: f,
|
|
592
590
|
"aria-label": b.search
|
|
593
591
|
}
|
|
594
592
|
),
|
|
595
|
-
|
|
593
|
+
a && /* @__PURE__ */ r(
|
|
596
594
|
"button",
|
|
597
595
|
{
|
|
598
596
|
className: "bt-search-clear",
|
|
@@ -603,9 +601,9 @@ function it() {
|
|
|
603
601
|
}
|
|
604
602
|
)
|
|
605
603
|
] }),
|
|
606
|
-
|
|
604
|
+
m && s > 0 && /* @__PURE__ */ y("div", { className: "bt-selection-info", children: [
|
|
607
605
|
/* @__PURE__ */ y("span", { children: [
|
|
608
|
-
|
|
606
|
+
s,
|
|
609
607
|
" ",
|
|
610
608
|
b.selected
|
|
611
609
|
] }),
|
|
@@ -613,24 +611,24 @@ function it() {
|
|
|
613
611
|
"button",
|
|
614
612
|
{
|
|
615
613
|
className: "bt-selection-clear",
|
|
616
|
-
onClick:
|
|
614
|
+
onClick: c,
|
|
617
615
|
type: "button",
|
|
618
616
|
children: b.deselectAll
|
|
619
617
|
}
|
|
620
618
|
)
|
|
621
619
|
] })
|
|
622
620
|
] }),
|
|
623
|
-
|
|
624
|
-
const
|
|
621
|
+
i && i.length > 0 && /* @__PURE__ */ r("div", { className: "bt-toolbar-right", children: /* @__PURE__ */ r("div", { className: "bt-global-actions", children: i.map((p) => {
|
|
622
|
+
const S = p.requiresSelection && t.length === 0;
|
|
625
623
|
return /* @__PURE__ */ y(
|
|
626
624
|
"button",
|
|
627
625
|
{
|
|
628
|
-
className:
|
|
626
|
+
className: P(
|
|
629
627
|
"bt-global-btn",
|
|
630
628
|
p.variant && `bt-variant-${p.variant}`
|
|
631
629
|
),
|
|
632
630
|
onClick: () => p.onClick(t, d),
|
|
633
|
-
disabled:
|
|
631
|
+
disabled: S,
|
|
634
632
|
title: p.label,
|
|
635
633
|
type: "button",
|
|
636
634
|
children: [
|
|
@@ -644,35 +642,35 @@ function it() {
|
|
|
644
642
|
] }) : null;
|
|
645
643
|
}
|
|
646
644
|
const rt = it;
|
|
647
|
-
function
|
|
648
|
-
const { locale: e, emptyComponent:
|
|
649
|
-
return
|
|
645
|
+
function ot() {
|
|
646
|
+
const { locale: e, emptyComponent: a, columns: n, selectable: l, rowActions: i } = x(), t = n.filter((d) => !d.hidden), s = i && i.length > 0, c = t.length + (l ? 1 : 0) + (s ? 1 : 0);
|
|
647
|
+
return a ? /* @__PURE__ */ r("tbody", { className: "bt-tbody", children: /* @__PURE__ */ r("tr", { className: "bt-tr", children: /* @__PURE__ */ r("td", { className: "bt-td", colSpan: c, children: a }) }) }) : /* @__PURE__ */ r("tbody", { className: "bt-tbody", children: /* @__PURE__ */ r("tr", { className: "bt-tr", children: /* @__PURE__ */ r("td", { className: "bt-td", colSpan: c, children: /* @__PURE__ */ y("div", { className: "bt-empty", children: [
|
|
650
648
|
/* @__PURE__ */ r("div", { className: "bt-empty-icon", children: "📭" }),
|
|
651
649
|
/* @__PURE__ */ r("div", { className: "bt-empty-text", children: e.noData })
|
|
652
650
|
] }) }) }) });
|
|
653
651
|
}
|
|
654
|
-
function
|
|
655
|
-
const { loadingComponent:
|
|
656
|
-
return e ? /* @__PURE__ */ r("div", { className: "bt-loading-overlay", role: "status", "aria-live": "polite", children:
|
|
652
|
+
function ct({ show: e }) {
|
|
653
|
+
const { loadingComponent: a, locale: n } = x();
|
|
654
|
+
return e ? /* @__PURE__ */ r("div", { className: "bt-loading-overlay", role: "status", "aria-live": "polite", children: a || /* @__PURE__ */ y(Ke, { children: [
|
|
657
655
|
/* @__PURE__ */ r("div", { className: "bt-loading-spinner", "aria-hidden": "true" }),
|
|
658
|
-
/* @__PURE__ */ r("span", { className: "bt-loading-text", children:
|
|
656
|
+
/* @__PURE__ */ r("span", { className: "bt-loading-text", children: n.loading })
|
|
659
657
|
] }) }) : null;
|
|
660
658
|
}
|
|
661
659
|
function dt() {
|
|
662
|
-
const { isModalOpen: e, modalContent:
|
|
660
|
+
const { isModalOpen: e, modalContent: a, closeModal: n } = x(), l = g(
|
|
663
661
|
(t) => {
|
|
664
|
-
t.target === t.currentTarget &&
|
|
662
|
+
t.target === t.currentTarget && n();
|
|
665
663
|
},
|
|
666
|
-
[
|
|
667
|
-
),
|
|
664
|
+
[n]
|
|
665
|
+
), i = g(
|
|
668
666
|
(t) => {
|
|
669
|
-
t.key === "Escape" &&
|
|
667
|
+
t.key === "Escape" && n();
|
|
670
668
|
},
|
|
671
|
-
[
|
|
669
|
+
[n]
|
|
672
670
|
);
|
|
673
|
-
return
|
|
674
|
-
document.removeEventListener("keydown",
|
|
675
|
-
}), [e,
|
|
671
|
+
return Fe(() => (e && (document.addEventListener("keydown", i), document.body.style.overflow = "hidden"), () => {
|
|
672
|
+
document.removeEventListener("keydown", i), document.body.style.overflow = "";
|
|
673
|
+
}), [e, i]), !e || !a ? null : /* @__PURE__ */ r(
|
|
676
674
|
"div",
|
|
677
675
|
{
|
|
678
676
|
className: "bt-modal-backdrop",
|
|
@@ -686,497 +684,497 @@ function dt() {
|
|
|
686
684
|
"button",
|
|
687
685
|
{
|
|
688
686
|
className: "bt-modal-close",
|
|
689
|
-
onClick:
|
|
687
|
+
onClick: n,
|
|
690
688
|
"aria-label": "Close modal",
|
|
691
689
|
type: "button",
|
|
692
690
|
children: "✕"
|
|
693
691
|
}
|
|
694
692
|
)
|
|
695
693
|
] }),
|
|
696
|
-
/* @__PURE__ */ r("div", { className: "bt-modal-body", children:
|
|
694
|
+
/* @__PURE__ */ r("div", { className: "bt-modal-body", children: a })
|
|
697
695
|
] })
|
|
698
696
|
}
|
|
699
697
|
);
|
|
700
698
|
}
|
|
701
699
|
function bt({
|
|
702
700
|
data: e,
|
|
703
|
-
initialSort:
|
|
704
|
-
controlledSort:
|
|
701
|
+
initialSort: a,
|
|
702
|
+
controlledSort: n,
|
|
705
703
|
onSortChange: l
|
|
706
704
|
}) {
|
|
707
|
-
const [
|
|
708
|
-
|
|
709
|
-
),
|
|
710
|
-
(
|
|
711
|
-
const
|
|
712
|
-
columnId:
|
|
713
|
-
direction:
|
|
705
|
+
const [i, t] = I(
|
|
706
|
+
a ?? { columnId: null, direction: "asc" }
|
|
707
|
+
), s = n ?? i, c = g(
|
|
708
|
+
(h) => {
|
|
709
|
+
const m = {
|
|
710
|
+
columnId: h,
|
|
711
|
+
direction: s.columnId === h && s.direction === "asc" ? "desc" : "asc"
|
|
714
712
|
};
|
|
715
|
-
|
|
713
|
+
n || t(m), l?.(m);
|
|
716
714
|
},
|
|
717
|
-
[
|
|
718
|
-
), d =
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
}, [
|
|
722
|
-
return { sortedData:
|
|
715
|
+
[s, n, l]
|
|
716
|
+
), d = g(() => {
|
|
717
|
+
const h = { columnId: null, direction: "asc" };
|
|
718
|
+
n || t(h), l?.(h);
|
|
719
|
+
}, [n, l]);
|
|
720
|
+
return { sortedData: A(() => s.columnId ? Ge(e, s.columnId, s.direction) : e, [e, s]), sortState: s, handleSort: c, clearSort: d };
|
|
723
721
|
}
|
|
724
|
-
function
|
|
722
|
+
function ht({
|
|
725
723
|
data: e,
|
|
726
|
-
columns:
|
|
727
|
-
initialFilters:
|
|
724
|
+
columns: a,
|
|
725
|
+
initialFilters: n,
|
|
728
726
|
controlledFilters: l,
|
|
729
|
-
onFilterChange:
|
|
727
|
+
onFilterChange: i
|
|
730
728
|
}) {
|
|
731
|
-
const [t,
|
|
732
|
-
|
|
733
|
-
),
|
|
734
|
-
(
|
|
735
|
-
const p = { ...
|
|
736
|
-
|
|
729
|
+
const [t, s] = I(
|
|
730
|
+
n ?? {}
|
|
731
|
+
), c = l ?? t, d = g(
|
|
732
|
+
(f, u) => {
|
|
733
|
+
const p = { ...c };
|
|
734
|
+
u == null || u === "" ? delete p[f] : p[f] = u, l || s(p), i?.(p);
|
|
737
735
|
},
|
|
738
|
-
[
|
|
739
|
-
), b =
|
|
740
|
-
(
|
|
741
|
-
const
|
|
742
|
-
delete f
|
|
736
|
+
[c, l, i]
|
|
737
|
+
), b = g(
|
|
738
|
+
(f) => {
|
|
739
|
+
const u = { ...c };
|
|
740
|
+
delete u[f], l || s(u), i?.(u);
|
|
743
741
|
},
|
|
744
|
-
[
|
|
745
|
-
),
|
|
746
|
-
l ||
|
|
747
|
-
}, [l,
|
|
748
|
-
return { filteredData:
|
|
742
|
+
[c, l, i]
|
|
743
|
+
), h = g(() => {
|
|
744
|
+
l || s({}), i?.({});
|
|
745
|
+
}, [l, i]);
|
|
746
|
+
return { filteredData: A(() => Ue(e, c, a), [e, c, a]), filters: c, setFilter: d, clearFilters: h, clearFilter: b };
|
|
749
747
|
}
|
|
750
|
-
function
|
|
748
|
+
function ut({
|
|
751
749
|
data: e,
|
|
752
|
-
config:
|
|
753
|
-
onPageChange:
|
|
750
|
+
config: a,
|
|
751
|
+
onPageChange: n
|
|
754
752
|
}) {
|
|
755
|
-
const l =
|
|
756
|
-
(
|
|
757
|
-
const v = Math.max(1, Math.min(
|
|
758
|
-
d(v),
|
|
753
|
+
const l = a !== !1, i = a && typeof a == "object" ? a.page ?? 1 : 1, t = a && typeof a == "object" ? a.pageSize ?? 10 : 10, s = a && typeof a == "object" ? a.totalItems : void 0, [c, d] = I(i), [b, h] = I(t), m = s ?? e.length, f = Math.max(1, Math.ceil(m / b)), u = g(
|
|
754
|
+
(o) => {
|
|
755
|
+
const v = Math.max(1, Math.min(o, f));
|
|
756
|
+
d(v), n?.(v, b);
|
|
759
757
|
},
|
|
760
|
-
[
|
|
761
|
-
), p =
|
|
762
|
-
|
|
763
|
-
}, [
|
|
764
|
-
|
|
765
|
-
}, [
|
|
766
|
-
(
|
|
767
|
-
|
|
758
|
+
[f, b, n]
|
|
759
|
+
), p = g(() => {
|
|
760
|
+
c < f && u(c + 1);
|
|
761
|
+
}, [c, f, u]), S = g(() => {
|
|
762
|
+
c > 1 && u(c - 1);
|
|
763
|
+
}, [c, u]), D = g(
|
|
764
|
+
(o) => {
|
|
765
|
+
h(o), d(1), n?.(1, o);
|
|
768
766
|
},
|
|
769
|
-
[
|
|
770
|
-
), $ =
|
|
771
|
-
if (!l ||
|
|
767
|
+
[n]
|
|
768
|
+
), $ = A(() => {
|
|
769
|
+
if (!l || s !== void 0)
|
|
772
770
|
return e;
|
|
773
|
-
const
|
|
774
|
-
return e.slice(
|
|
775
|
-
}, [e,
|
|
771
|
+
const o = (c - 1) * b;
|
|
772
|
+
return e.slice(o, o + b);
|
|
773
|
+
}, [e, c, b, l, s]), T = (c - 1) * b + 1, N = Math.min(c * b, m);
|
|
776
774
|
return {
|
|
777
775
|
paginatedData: $,
|
|
778
|
-
page:
|
|
776
|
+
page: c,
|
|
779
777
|
pageSize: b,
|
|
780
|
-
totalPages:
|
|
781
|
-
totalItems:
|
|
782
|
-
goToPage:
|
|
778
|
+
totalPages: f,
|
|
779
|
+
totalItems: m,
|
|
780
|
+
goToPage: u,
|
|
783
781
|
nextPage: p,
|
|
784
|
-
prevPage:
|
|
785
|
-
changePageSize:
|
|
786
|
-
hasNextPage:
|
|
787
|
-
hasPrevPage:
|
|
788
|
-
startIndex:
|
|
789
|
-
endIndex:
|
|
782
|
+
prevPage: S,
|
|
783
|
+
changePageSize: D,
|
|
784
|
+
hasNextPage: c < f,
|
|
785
|
+
hasPrevPage: c > 1,
|
|
786
|
+
startIndex: T,
|
|
787
|
+
endIndex: N
|
|
790
788
|
};
|
|
791
789
|
}
|
|
792
|
-
function
|
|
790
|
+
function ft({
|
|
793
791
|
data: e,
|
|
794
|
-
rowKey:
|
|
795
|
-
mode:
|
|
792
|
+
rowKey: a,
|
|
793
|
+
mode: n = "multiple",
|
|
796
794
|
initialSelection: l,
|
|
797
|
-
controlledSelection:
|
|
795
|
+
controlledSelection: i,
|
|
798
796
|
onSelectionChange: t
|
|
799
797
|
}) {
|
|
800
|
-
const [
|
|
798
|
+
const [s, c] = I(
|
|
801
799
|
l ?? []
|
|
802
|
-
), d =
|
|
803
|
-
(
|
|
804
|
-
[
|
|
805
|
-
),
|
|
806
|
-
(
|
|
807
|
-
const
|
|
808
|
-
return
|
|
800
|
+
), d = i ?? s, b = g(
|
|
801
|
+
(o, v) => typeof a == "function" ? a(o, v) : String(o[a]),
|
|
802
|
+
[a]
|
|
803
|
+
), h = A(() => new Set(d.map((o, v) => b(o, v))), [d, b]), m = g(
|
|
804
|
+
(o, v) => {
|
|
805
|
+
const C = b(o, v);
|
|
806
|
+
return h.has(C);
|
|
809
807
|
},
|
|
810
|
-
[b,
|
|
811
|
-
),
|
|
812
|
-
(
|
|
813
|
-
|
|
808
|
+
[b, h]
|
|
809
|
+
), f = g(
|
|
810
|
+
(o) => {
|
|
811
|
+
i || c(o), t?.(o);
|
|
814
812
|
},
|
|
815
|
-
[
|
|
816
|
-
),
|
|
817
|
-
(
|
|
818
|
-
const
|
|
819
|
-
let
|
|
820
|
-
|
|
813
|
+
[i, t]
|
|
814
|
+
), u = g(
|
|
815
|
+
(o, v) => {
|
|
816
|
+
const C = b(o, v);
|
|
817
|
+
let k;
|
|
818
|
+
n === "single" ? k = h.has(C) ? [] : [o] : h.has(C) ? k = d.filter((w, R) => b(w, R) !== C) : k = [...d, o], f(k);
|
|
821
819
|
},
|
|
822
|
-
[
|
|
823
|
-
), p =
|
|
824
|
-
(
|
|
825
|
-
if (!
|
|
826
|
-
const
|
|
827
|
-
|
|
820
|
+
[n, h, d, b, f]
|
|
821
|
+
), p = g(
|
|
822
|
+
(o, v) => {
|
|
823
|
+
if (!m(o, v)) {
|
|
824
|
+
const C = n === "single" ? [o] : [...d, o];
|
|
825
|
+
f(C);
|
|
828
826
|
}
|
|
829
827
|
},
|
|
830
|
-
[
|
|
831
|
-
),
|
|
832
|
-
(
|
|
833
|
-
const
|
|
834
|
-
(
|
|
828
|
+
[m, n, d, f]
|
|
829
|
+
), S = g(
|
|
830
|
+
(o, v) => {
|
|
831
|
+
const C = b(o, v), k = d.filter(
|
|
832
|
+
(w, R) => b(w, R) !== C
|
|
835
833
|
);
|
|
836
|
-
|
|
834
|
+
f(k);
|
|
837
835
|
},
|
|
838
|
-
[d, b,
|
|
839
|
-
),
|
|
840
|
-
|
|
841
|
-
}, [e,
|
|
842
|
-
|
|
843
|
-
}, [
|
|
836
|
+
[d, b, f]
|
|
837
|
+
), D = g(() => {
|
|
838
|
+
n === "multiple" && f([...e]);
|
|
839
|
+
}, [e, n, f]), $ = g(() => {
|
|
840
|
+
f([]);
|
|
841
|
+
}, [f]), T = e.length > 0 && d.length === e.length, N = d.length > 0 && d.length < e.length;
|
|
844
842
|
return {
|
|
845
843
|
selectedRows: d,
|
|
846
|
-
isSelected:
|
|
847
|
-
toggleRow:
|
|
844
|
+
isSelected: m,
|
|
845
|
+
toggleRow: u,
|
|
848
846
|
selectRow: p,
|
|
849
|
-
deselectRow:
|
|
850
|
-
selectAll:
|
|
847
|
+
deselectRow: S,
|
|
848
|
+
selectAll: D,
|
|
851
849
|
deselectAll: $,
|
|
852
|
-
isAllSelected:
|
|
853
|
-
isPartiallySelected:
|
|
850
|
+
isAllSelected: T,
|
|
851
|
+
isPartiallySelected: N,
|
|
854
852
|
selectedCount: d.length
|
|
855
853
|
};
|
|
856
854
|
}
|
|
857
855
|
function pt({
|
|
858
856
|
data: e,
|
|
859
|
-
columns:
|
|
860
|
-
searchColumns:
|
|
857
|
+
columns: a,
|
|
858
|
+
searchColumns: n,
|
|
861
859
|
initialValue: l,
|
|
862
|
-
controlledValue:
|
|
860
|
+
controlledValue: i,
|
|
863
861
|
onSearchChange: t
|
|
864
862
|
}) {
|
|
865
|
-
const [
|
|
866
|
-
(
|
|
867
|
-
|
|
863
|
+
const [s, c] = I(l ?? ""), d = i ?? s, b = g(
|
|
864
|
+
(f) => {
|
|
865
|
+
i === void 0 && c(f), t?.(f);
|
|
868
866
|
},
|
|
869
|
-
[
|
|
870
|
-
),
|
|
871
|
-
|
|
872
|
-
}, [
|
|
873
|
-
return { searchedData:
|
|
867
|
+
[i, t]
|
|
868
|
+
), h = g(() => {
|
|
869
|
+
i === void 0 && c(""), t?.("");
|
|
870
|
+
}, [i, t]);
|
|
871
|
+
return { searchedData: A(() => We(e, d, a, n), [e, d, a, n]), searchValue: d, handleSearch: b, clearSearch: h };
|
|
874
872
|
}
|
|
875
|
-
function
|
|
873
|
+
function gt(e) {
|
|
876
874
|
const {
|
|
877
875
|
// Data
|
|
878
|
-
data:
|
|
879
|
-
columns:
|
|
876
|
+
data: a,
|
|
877
|
+
columns: n,
|
|
880
878
|
rowKey: l = "id",
|
|
881
879
|
// Actions
|
|
882
|
-
rowActions:
|
|
880
|
+
rowActions: i,
|
|
883
881
|
globalActions: t,
|
|
884
882
|
// Pagination
|
|
885
|
-
pagination:
|
|
886
|
-
onPageChange:
|
|
883
|
+
pagination: s = { pageSize: 10 },
|
|
884
|
+
onPageChange: c,
|
|
887
885
|
// Sort
|
|
888
886
|
sort: d,
|
|
889
887
|
onSortChange: b,
|
|
890
888
|
// Filter
|
|
891
|
-
filters:
|
|
892
|
-
onFilterChange:
|
|
889
|
+
filters: h,
|
|
890
|
+
onFilterChange: m,
|
|
893
891
|
// Search
|
|
894
|
-
searchable:
|
|
895
|
-
searchValue:
|
|
892
|
+
searchable: f = !1,
|
|
893
|
+
searchValue: u,
|
|
896
894
|
onSearchChange: p,
|
|
897
|
-
searchColumns:
|
|
895
|
+
searchColumns: S,
|
|
898
896
|
// Selection - now auto-inferred if not explicitly set
|
|
899
|
-
selectable:
|
|
897
|
+
selectable: D,
|
|
900
898
|
selectedRows: $,
|
|
901
|
-
onSelectionChange:
|
|
902
|
-
selectionMode:
|
|
899
|
+
onSelectionChange: T,
|
|
900
|
+
selectionMode: N = "multiple",
|
|
903
901
|
// States
|
|
904
|
-
loading:
|
|
902
|
+
loading: o = !1,
|
|
905
903
|
loadingComponent: v,
|
|
906
|
-
emptyComponent:
|
|
904
|
+
emptyComponent: C,
|
|
907
905
|
// Styling
|
|
908
|
-
classNames:
|
|
909
|
-
styles:
|
|
910
|
-
locale:
|
|
906
|
+
classNames: k = {},
|
|
907
|
+
styles: w = {},
|
|
908
|
+
locale: R,
|
|
911
909
|
stickyHeader: O = !1,
|
|
912
910
|
maxHeight: ze,
|
|
913
911
|
bordered: L = !1,
|
|
914
|
-
striped:
|
|
915
|
-
hoverable:
|
|
912
|
+
striped: F = !1,
|
|
913
|
+
hoverable: K = !0,
|
|
916
914
|
size: j = "medium",
|
|
917
915
|
// Callbacks
|
|
918
|
-
onRowClick:
|
|
919
|
-
onRowDoubleClick:
|
|
916
|
+
onRowClick: H,
|
|
917
|
+
onRowDoubleClick: V,
|
|
920
918
|
// Accessibility
|
|
921
919
|
ariaLabel: Ie,
|
|
922
|
-
ariaDescribedBy:
|
|
923
|
-
} = e,
|
|
920
|
+
ariaDescribedBy: Re
|
|
921
|
+
} = e, q = A(() => D !== void 0 ? D : t?.some(
|
|
924
922
|
(je) => je.requiresSelection
|
|
925
|
-
)
|
|
926
|
-
() => ({ ...
|
|
927
|
-
[
|
|
928
|
-
), [
|
|
929
|
-
|
|
930
|
-
}, []),
|
|
931
|
-
|
|
932
|
-
}, []), z =
|
|
923
|
+
) || T !== void 0, [D, t, T]), J = A(
|
|
924
|
+
() => ({ ...He, ...R }),
|
|
925
|
+
[R]
|
|
926
|
+
), [_, Q] = I(!1), [G, U] = I(null), W = g((Ae) => {
|
|
927
|
+
U(Ae), Q(!0);
|
|
928
|
+
}, []), X = g(() => {
|
|
929
|
+
Q(!1), U(null);
|
|
930
|
+
}, []), z = A(() => s === !1 ? !1 : {
|
|
933
931
|
pageSize: 10,
|
|
934
932
|
pageSizeOptions: [10, 20, 50, 100],
|
|
935
933
|
showSizeChanger: !1,
|
|
936
|
-
...
|
|
937
|
-
}, [
|
|
938
|
-
searchedData:
|
|
939
|
-
searchValue:
|
|
940
|
-
handleSearch:
|
|
934
|
+
...s
|
|
935
|
+
}, [s]), {
|
|
936
|
+
searchedData: Me,
|
|
937
|
+
searchValue: Y,
|
|
938
|
+
handleSearch: Z,
|
|
941
939
|
clearSearch: ee
|
|
942
940
|
} = pt({
|
|
943
|
-
data:
|
|
944
|
-
columns:
|
|
945
|
-
searchColumns:
|
|
946
|
-
controlledValue:
|
|
941
|
+
data: a,
|
|
942
|
+
columns: n,
|
|
943
|
+
searchColumns: S,
|
|
944
|
+
controlledValue: u,
|
|
947
945
|
onSearchChange: p
|
|
948
946
|
}), {
|
|
949
947
|
filteredData: Be,
|
|
950
948
|
filters: te,
|
|
951
949
|
setFilter: ae,
|
|
952
|
-
clearFilters:
|
|
953
|
-
} =
|
|
954
|
-
data:
|
|
955
|
-
columns:
|
|
956
|
-
controlledFilters:
|
|
957
|
-
onFilterChange:
|
|
958
|
-
}), { sortedData:
|
|
950
|
+
clearFilters: ne
|
|
951
|
+
} = ht({
|
|
952
|
+
data: Me,
|
|
953
|
+
columns: n,
|
|
954
|
+
controlledFilters: h,
|
|
955
|
+
onFilterChange: m
|
|
956
|
+
}), { sortedData: le, sortState: se, handleSort: ie } = bt({
|
|
959
957
|
data: Be,
|
|
960
958
|
controlledSort: d,
|
|
961
959
|
onSortChange: b
|
|
962
960
|
}), {
|
|
963
961
|
selectedRows: re,
|
|
964
|
-
isSelected:
|
|
965
|
-
toggleRow:
|
|
962
|
+
isSelected: oe,
|
|
963
|
+
toggleRow: ce,
|
|
966
964
|
selectAll: de,
|
|
967
965
|
deselectAll: be,
|
|
968
|
-
isAllSelected:
|
|
969
|
-
isPartiallySelected:
|
|
970
|
-
selectedCount:
|
|
971
|
-
} =
|
|
972
|
-
data:
|
|
966
|
+
isAllSelected: he,
|
|
967
|
+
isPartiallySelected: ue,
|
|
968
|
+
selectedCount: fe
|
|
969
|
+
} = ft({
|
|
970
|
+
data: le,
|
|
973
971
|
rowKey: l,
|
|
974
|
-
mode:
|
|
972
|
+
mode: N,
|
|
975
973
|
controlledSelection: $,
|
|
976
|
-
onSelectionChange:
|
|
974
|
+
onSelectionChange: T
|
|
977
975
|
}), {
|
|
978
976
|
paginatedData: E,
|
|
979
977
|
page: pe,
|
|
980
|
-
pageSize:
|
|
981
|
-
totalPages:
|
|
978
|
+
pageSize: ge,
|
|
979
|
+
totalPages: me,
|
|
982
980
|
totalItems: ve,
|
|
983
981
|
goToPage: ye,
|
|
984
|
-
nextPage:
|
|
985
|
-
prevPage:
|
|
986
|
-
changePageSize:
|
|
987
|
-
hasNextPage:
|
|
988
|
-
hasPrevPage:
|
|
989
|
-
startIndex:
|
|
990
|
-
endIndex:
|
|
991
|
-
} =
|
|
992
|
-
data:
|
|
982
|
+
nextPage: Se,
|
|
983
|
+
prevPage: Ne,
|
|
984
|
+
changePageSize: Ce,
|
|
985
|
+
hasNextPage: ke,
|
|
986
|
+
hasPrevPage: Pe,
|
|
987
|
+
startIndex: De,
|
|
988
|
+
endIndex: Te
|
|
989
|
+
} = ut({
|
|
990
|
+
data: le,
|
|
993
991
|
config: z,
|
|
994
|
-
onPageChange:
|
|
995
|
-
}), Le =
|
|
992
|
+
onPageChange: c
|
|
993
|
+
}), Le = A(
|
|
996
994
|
() => ({
|
|
997
995
|
// Data
|
|
998
|
-
data:
|
|
996
|
+
data: a,
|
|
999
997
|
processedData: E,
|
|
1000
|
-
columns:
|
|
998
|
+
columns: n,
|
|
1001
999
|
rowKey: l,
|
|
1002
1000
|
// Actions
|
|
1003
|
-
rowActions:
|
|
1001
|
+
rowActions: i,
|
|
1004
1002
|
globalActions: t,
|
|
1005
1003
|
// Sort
|
|
1006
|
-
sortState:
|
|
1004
|
+
sortState: se,
|
|
1007
1005
|
handleSort: ie,
|
|
1008
1006
|
// Filter
|
|
1009
1007
|
filters: te,
|
|
1010
1008
|
setFilter: ae,
|
|
1011
|
-
clearFilters:
|
|
1009
|
+
clearFilters: ne,
|
|
1012
1010
|
// Search
|
|
1013
|
-
searchValue:
|
|
1014
|
-
handleSearch:
|
|
1011
|
+
searchValue: Y,
|
|
1012
|
+
handleSearch: Z,
|
|
1015
1013
|
clearSearch: ee,
|
|
1016
|
-
searchable:
|
|
1014
|
+
searchable: f,
|
|
1017
1015
|
// Selection
|
|
1018
1016
|
selectedRows: re,
|
|
1019
|
-
isSelected:
|
|
1020
|
-
toggleRow:
|
|
1017
|
+
isSelected: oe,
|
|
1018
|
+
toggleRow: ce,
|
|
1021
1019
|
selectAll: de,
|
|
1022
1020
|
deselectAll: be,
|
|
1023
|
-
isAllSelected:
|
|
1024
|
-
isPartiallySelected:
|
|
1025
|
-
selectable:
|
|
1026
|
-
selectionMode:
|
|
1027
|
-
selectedCount:
|
|
1021
|
+
isAllSelected: he,
|
|
1022
|
+
isPartiallySelected: ue,
|
|
1023
|
+
selectable: q,
|
|
1024
|
+
selectionMode: N,
|
|
1025
|
+
selectedCount: fe,
|
|
1028
1026
|
// Pagination
|
|
1029
1027
|
page: pe,
|
|
1030
|
-
pageSize:
|
|
1031
|
-
totalPages:
|
|
1028
|
+
pageSize: ge,
|
|
1029
|
+
totalPages: me,
|
|
1032
1030
|
totalItems: ve,
|
|
1033
1031
|
goToPage: ye,
|
|
1034
|
-
nextPage:
|
|
1035
|
-
prevPage:
|
|
1036
|
-
changePageSize:
|
|
1037
|
-
hasNextPage:
|
|
1038
|
-
hasPrevPage:
|
|
1039
|
-
startIndex:
|
|
1040
|
-
endIndex:
|
|
1041
|
-
paginationEnabled:
|
|
1032
|
+
nextPage: Se,
|
|
1033
|
+
prevPage: Ne,
|
|
1034
|
+
changePageSize: Ce,
|
|
1035
|
+
hasNextPage: ke,
|
|
1036
|
+
hasPrevPage: Pe,
|
|
1037
|
+
startIndex: De,
|
|
1038
|
+
endIndex: Te,
|
|
1039
|
+
paginationEnabled: s !== !1,
|
|
1042
1040
|
pageSizeOptions: z && typeof z == "object" ? z.pageSizeOptions ?? [10, 20, 50, 100] : [10, 20, 50, 100],
|
|
1043
1041
|
showSizeChanger: z && typeof z == "object" ? z.showSizeChanger ?? !1 : !1,
|
|
1044
1042
|
// UI State
|
|
1045
|
-
loading:
|
|
1043
|
+
loading: o,
|
|
1046
1044
|
loadingComponent: v,
|
|
1047
|
-
emptyComponent:
|
|
1045
|
+
emptyComponent: C,
|
|
1048
1046
|
// Styling
|
|
1049
|
-
locale:
|
|
1050
|
-
classNames:
|
|
1047
|
+
locale: J,
|
|
1048
|
+
classNames: k,
|
|
1051
1049
|
size: j,
|
|
1052
1050
|
bordered: L,
|
|
1053
|
-
striped:
|
|
1054
|
-
hoverable:
|
|
1051
|
+
striped: F,
|
|
1052
|
+
hoverable: K,
|
|
1055
1053
|
stickyHeader: O,
|
|
1056
1054
|
// Callbacks
|
|
1057
|
-
onRowClick:
|
|
1058
|
-
onRowDoubleClick:
|
|
1055
|
+
onRowClick: H,
|
|
1056
|
+
onRowDoubleClick: V,
|
|
1059
1057
|
// Modal
|
|
1060
|
-
openModal:
|
|
1061
|
-
closeModal:
|
|
1062
|
-
modalContent:
|
|
1063
|
-
isModalOpen:
|
|
1058
|
+
openModal: W,
|
|
1059
|
+
closeModal: X,
|
|
1060
|
+
modalContent: G,
|
|
1061
|
+
isModalOpen: _
|
|
1064
1062
|
}),
|
|
1065
1063
|
[
|
|
1066
|
-
s,
|
|
1067
|
-
E,
|
|
1068
1064
|
a,
|
|
1069
|
-
|
|
1065
|
+
E,
|
|
1070
1066
|
n,
|
|
1067
|
+
l,
|
|
1068
|
+
i,
|
|
1071
1069
|
t,
|
|
1072
|
-
|
|
1070
|
+
se,
|
|
1073
1071
|
ie,
|
|
1074
1072
|
te,
|
|
1075
1073
|
ae,
|
|
1076
|
-
|
|
1074
|
+
ne,
|
|
1075
|
+
Y,
|
|
1077
1076
|
Z,
|
|
1078
|
-
F,
|
|
1079
1077
|
ee,
|
|
1080
|
-
|
|
1078
|
+
f,
|
|
1081
1079
|
re,
|
|
1082
|
-
ce,
|
|
1083
1080
|
oe,
|
|
1081
|
+
ce,
|
|
1084
1082
|
de,
|
|
1085
1083
|
be,
|
|
1084
|
+
he,
|
|
1086
1085
|
ue,
|
|
1086
|
+
q,
|
|
1087
|
+
N,
|
|
1087
1088
|
fe,
|
|
1088
|
-
J,
|
|
1089
|
-
S,
|
|
1090
|
-
he,
|
|
1091
1089
|
pe,
|
|
1092
|
-
me,
|
|
1093
1090
|
ge,
|
|
1091
|
+
me,
|
|
1094
1092
|
ve,
|
|
1095
1093
|
ye,
|
|
1096
|
-
Ne,
|
|
1097
1094
|
Se,
|
|
1095
|
+
Ne,
|
|
1096
|
+
Ce,
|
|
1098
1097
|
ke,
|
|
1098
|
+
Pe,
|
|
1099
1099
|
De,
|
|
1100
1100
|
Te,
|
|
1101
|
-
|
|
1102
|
-
we,
|
|
1103
|
-
i,
|
|
1101
|
+
s,
|
|
1104
1102
|
z,
|
|
1105
|
-
|
|
1103
|
+
o,
|
|
1106
1104
|
v,
|
|
1105
|
+
C,
|
|
1106
|
+
J,
|
|
1107
1107
|
k,
|
|
1108
|
-
_,
|
|
1109
|
-
D,
|
|
1110
1108
|
j,
|
|
1111
1109
|
L,
|
|
1110
|
+
F,
|
|
1112
1111
|
K,
|
|
1113
|
-
H,
|
|
1114
1112
|
O,
|
|
1113
|
+
H,
|
|
1115
1114
|
V,
|
|
1116
|
-
|
|
1115
|
+
W,
|
|
1117
1116
|
X,
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
Q
|
|
1117
|
+
G,
|
|
1118
|
+
_
|
|
1121
1119
|
]
|
|
1122
|
-
),
|
|
1123
|
-
return /* @__PURE__ */ r(
|
|
1120
|
+
), we = E.length > 0;
|
|
1121
|
+
return /* @__PURE__ */ r(Ve, { value: Le, children: /* @__PURE__ */ y(
|
|
1124
1122
|
"div",
|
|
1125
1123
|
{
|
|
1126
|
-
className:
|
|
1124
|
+
className: P(
|
|
1127
1125
|
"bt-container",
|
|
1128
1126
|
`bt-size-${j}`,
|
|
1129
|
-
|
|
1130
|
-
|
|
1127
|
+
o && "bt-container-loading",
|
|
1128
|
+
k.container
|
|
1131
1129
|
),
|
|
1132
|
-
style:
|
|
1130
|
+
style: w.container,
|
|
1133
1131
|
children: [
|
|
1134
1132
|
/* @__PURE__ */ r(rt, {}),
|
|
1135
1133
|
/* @__PURE__ */ y(
|
|
1136
1134
|
"div",
|
|
1137
1135
|
{
|
|
1138
|
-
className:
|
|
1136
|
+
className: P("bt-table-wrapper", L && "bt-bordered"),
|
|
1139
1137
|
style: { maxHeight: ze },
|
|
1140
1138
|
children: [
|
|
1141
1139
|
/* @__PURE__ */ y(
|
|
1142
1140
|
"table",
|
|
1143
1141
|
{
|
|
1144
|
-
className:
|
|
1145
|
-
style:
|
|
1142
|
+
className: P("bt-table", k.table),
|
|
1143
|
+
style: w.table,
|
|
1146
1144
|
role: "grid",
|
|
1147
1145
|
"aria-label": Ie,
|
|
1148
|
-
"aria-describedby":
|
|
1149
|
-
"aria-busy":
|
|
1146
|
+
"aria-describedby": Re,
|
|
1147
|
+
"aria-busy": o,
|
|
1150
1148
|
children: [
|
|
1151
|
-
/* @__PURE__ */ r(
|
|
1152
|
-
|
|
1149
|
+
/* @__PURE__ */ r(Qe, {}),
|
|
1150
|
+
we ? /* @__PURE__ */ r(lt, {}) : /* @__PURE__ */ r(ot, {})
|
|
1153
1151
|
]
|
|
1154
1152
|
}
|
|
1155
1153
|
),
|
|
1156
|
-
/* @__PURE__ */ r(
|
|
1154
|
+
/* @__PURE__ */ r(ct, { show: o && we })
|
|
1157
1155
|
]
|
|
1158
1156
|
}
|
|
1159
1157
|
),
|
|
1160
|
-
|
|
1158
|
+
s !== !1 && /* @__PURE__ */ r(st, {}),
|
|
1161
1159
|
/* @__PURE__ */ r(dt, {})
|
|
1162
1160
|
]
|
|
1163
1161
|
}
|
|
1164
1162
|
) });
|
|
1165
1163
|
}
|
|
1166
|
-
const
|
|
1164
|
+
const Nt = gt;
|
|
1167
1165
|
export {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1166
|
+
Nt as BetterTable,
|
|
1167
|
+
Ve as TableProvider,
|
|
1168
|
+
He as defaultLocale,
|
|
1169
|
+
Ue as filterData,
|
|
1170
|
+
M as getValueFromPath,
|
|
1171
|
+
We as searchData,
|
|
1172
|
+
Ge as sortData,
|
|
1173
|
+
x as useTableContext,
|
|
1174
|
+
ht as useTableFilter,
|
|
1175
|
+
ut as useTablePagination,
|
|
1178
1176
|
pt as useTableSearch,
|
|
1179
|
-
|
|
1177
|
+
ft as useTableSelection,
|
|
1180
1178
|
bt as useTableSort
|
|
1181
1179
|
};
|
|
1182
1180
|
//# sourceMappingURL=better-table.es.js.map
|