better-table 1.1.0 → 1.2.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 +217 -18
- package/dist/better-table.cjs.js +1 -1
- package/dist/better-table.cjs.js.map +1 -1
- package/dist/better-table.css +1 -1
- package/dist/better-table.es.js +1855 -922
- package/dist/better-table.es.js.map +1 -1
- package/dist/components/BetterTable/__tests__/helpers/test-data.d.ts +125 -0
- package/dist/components/BetterTable/components/TableActionOverflow.d.ts +16 -0
- package/dist/components/BetterTable/components/TableColumnVisibility.d.ts +4 -0
- package/dist/components/BetterTable/components/TableFilterPanel.d.ts +7 -0
- package/dist/components/BetterTable/components/TableFloatingFilter.d.ts +8 -0
- package/dist/components/BetterTable/components/index.d.ts +4 -0
- package/dist/components/BetterTable/context/TableContext.d.ts +17 -2
- package/dist/components/BetterTable/hooks/index.d.ts +2 -0
- package/dist/components/BetterTable/hooks/useColumnVisibility.d.ts +24 -0
- package/dist/components/BetterTable/hooks/useMediaQuery.d.ts +8 -0
- package/dist/components/BetterTable/hooks/useTableFilter.d.ts +2 -2
- package/dist/components/BetterTable/hooks/useTableSearch.d.ts +1 -1
- package/dist/components/BetterTable/hooks/useTableSort.d.ts +12 -2
- package/dist/components/BetterTable/index.d.ts +3 -2
- package/dist/components/BetterTable/types.d.ts +120 -5
- package/dist/components/BetterTable/utils/sortData.d.ts +8 -1
- package/dist/index.d.ts +3 -2
- package/package.json +6 -2
package/dist/better-table.es.js
CHANGED
|
@@ -1,1335 +1,2268 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsx as
|
|
1
|
+
import R, { useContext as yt, createContext as wt, useCallback as w, useMemo as I, useState as M, useRef as V, useEffect as B } from "react";
|
|
2
|
+
import { jsx as n, jsxs as g, Fragment as Ct } from "react/jsx-runtime";
|
|
3
|
+
import { createPortal as kt } from "react-dom";
|
|
3
4
|
import "./styles.js";
|
|
4
|
-
const
|
|
5
|
-
search: "
|
|
6
|
-
searchPlaceholder: "
|
|
7
|
-
noData: "No
|
|
8
|
-
loading: "
|
|
9
|
-
page: "
|
|
10
|
-
of: "
|
|
11
|
-
items: "
|
|
12
|
-
selected: "
|
|
13
|
-
rowsPerPage: "
|
|
14
|
-
actions: "
|
|
15
|
-
sortAsc: "
|
|
16
|
-
sortDesc: "
|
|
17
|
-
filterBy: "
|
|
18
|
-
clearFilters: "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
const it = {
|
|
6
|
+
search: "Search",
|
|
7
|
+
searchPlaceholder: "Search...",
|
|
8
|
+
noData: "No data",
|
|
9
|
+
loading: "Loading...",
|
|
10
|
+
page: "Page",
|
|
11
|
+
of: "of",
|
|
12
|
+
items: "items",
|
|
13
|
+
selected: "selected",
|
|
14
|
+
rowsPerPage: "Rows per page",
|
|
15
|
+
actions: "Actions",
|
|
16
|
+
sortAsc: "Sort ascending",
|
|
17
|
+
sortDesc: "Sort descending",
|
|
18
|
+
filterBy: "Filter by",
|
|
19
|
+
clearFilters: "Clear filters",
|
|
20
|
+
dateFrom: "From",
|
|
21
|
+
dateTo: "To",
|
|
22
|
+
selectAll: "Select all",
|
|
23
|
+
deselectAll: "Deselect all",
|
|
24
|
+
moreActions: "More actions",
|
|
25
|
+
clearSearch: "Clear search",
|
|
26
|
+
closeModal: "Close",
|
|
27
|
+
previousPage: "Previous page",
|
|
28
|
+
nextPage: "Next page",
|
|
29
|
+
jumpToPage: "Go to page",
|
|
30
|
+
details: "Details",
|
|
31
|
+
columns: "Columns",
|
|
32
|
+
showAllColumns: "Show all",
|
|
33
|
+
hideColumn: "Hide column",
|
|
34
|
+
sortPriority: "Sort priority",
|
|
35
|
+
clearSort: "Clear sort"
|
|
36
|
+
}, Nt = {
|
|
37
|
+
en: it,
|
|
38
|
+
es: {
|
|
39
|
+
search: "Buscar",
|
|
40
|
+
searchPlaceholder: "Buscar...",
|
|
41
|
+
noData: "No hay datos",
|
|
42
|
+
loading: "Cargando...",
|
|
43
|
+
page: "Página",
|
|
44
|
+
of: "de",
|
|
45
|
+
items: "elementos",
|
|
46
|
+
selected: "seleccionados",
|
|
47
|
+
rowsPerPage: "Filas por página",
|
|
48
|
+
actions: "Acciones",
|
|
49
|
+
sortAsc: "Ordenar ascendente",
|
|
50
|
+
sortDesc: "Ordenar descendente",
|
|
51
|
+
filterBy: "Filtrar por",
|
|
52
|
+
clearFilters: "Limpiar filtros",
|
|
53
|
+
dateFrom: "Desde",
|
|
54
|
+
dateTo: "Hasta",
|
|
55
|
+
selectAll: "Seleccionar todo",
|
|
56
|
+
deselectAll: "Deseleccionar todo",
|
|
57
|
+
moreActions: "Más acciones",
|
|
58
|
+
clearSearch: "Limpiar búsqueda",
|
|
59
|
+
closeModal: "Cerrar",
|
|
60
|
+
previousPage: "Página anterior",
|
|
61
|
+
nextPage: "Página siguiente",
|
|
62
|
+
jumpToPage: "Ir a página",
|
|
63
|
+
details: "Detalles",
|
|
64
|
+
columns: "Columnas",
|
|
65
|
+
showAllColumns: "Mostrar todas",
|
|
66
|
+
hideColumn: "Ocultar columna",
|
|
67
|
+
sortPriority: "Prioridad de orden",
|
|
68
|
+
clearSort: "Quitar orden"
|
|
69
|
+
},
|
|
70
|
+
pt: {
|
|
71
|
+
search: "Pesquisar",
|
|
72
|
+
searchPlaceholder: "Pesquisar...",
|
|
73
|
+
noData: "Sem dados",
|
|
74
|
+
loading: "Carregando...",
|
|
75
|
+
page: "Página",
|
|
76
|
+
of: "de",
|
|
77
|
+
items: "itens",
|
|
78
|
+
selected: "selecionados",
|
|
79
|
+
rowsPerPage: "Linhas por página",
|
|
80
|
+
actions: "Ações",
|
|
81
|
+
sortAsc: "Ordenar ascendente",
|
|
82
|
+
sortDesc: "Ordenar descendente",
|
|
83
|
+
filterBy: "Filtrar por",
|
|
84
|
+
clearFilters: "Limpar filtros",
|
|
85
|
+
dateFrom: "De",
|
|
86
|
+
dateTo: "Até",
|
|
87
|
+
selectAll: "Selecionar tudo",
|
|
88
|
+
deselectAll: "Desselecionar tudo",
|
|
89
|
+
moreActions: "Mais ações",
|
|
90
|
+
clearSearch: "Limpar pesquisa",
|
|
91
|
+
closeModal: "Fechar",
|
|
92
|
+
previousPage: "Página anterior",
|
|
93
|
+
nextPage: "Próxima página",
|
|
94
|
+
jumpToPage: "Ir para página",
|
|
95
|
+
details: "Detalhes",
|
|
96
|
+
columns: "Colunas",
|
|
97
|
+
showAllColumns: "Mostrar todas",
|
|
98
|
+
hideColumn: "Ocultar coluna",
|
|
99
|
+
sortPriority: "Prioridade de ordem",
|
|
100
|
+
clearSort: "Remover ordem"
|
|
101
|
+
}
|
|
102
|
+
}, lt = wt(null);
|
|
103
|
+
function $() {
|
|
104
|
+
const e = yt(lt);
|
|
24
105
|
if (!e)
|
|
25
106
|
throw new Error("useTableContext must be used within a TableProvider");
|
|
26
107
|
return e;
|
|
27
108
|
}
|
|
28
|
-
function
|
|
109
|
+
function St({
|
|
29
110
|
value: e,
|
|
30
111
|
children: t
|
|
31
112
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
113
|
+
return /* @__PURE__ */ n(lt.Provider, { value: e, children: t });
|
|
33
114
|
}
|
|
34
|
-
function
|
|
35
|
-
var t, l,
|
|
36
|
-
if (typeof e == "string" || typeof e == "number")
|
|
115
|
+
function rt(e) {
|
|
116
|
+
var t, l, i = "";
|
|
117
|
+
if (typeof e == "string" || typeof e == "number") i += e;
|
|
37
118
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
38
|
-
var
|
|
39
|
-
for (t = 0; t <
|
|
40
|
-
} else for (l in e) e[l] && (
|
|
41
|
-
return
|
|
119
|
+
var a = e.length;
|
|
120
|
+
for (t = 0; t < a; t++) e[t] && (l = rt(e[t])) && (i && (i += " "), i += l);
|
|
121
|
+
} else for (l in e) e[l] && (i && (i += " "), i += l);
|
|
122
|
+
return i;
|
|
123
|
+
}
|
|
124
|
+
function x() {
|
|
125
|
+
for (var e, t, l = 0, i = "", a = arguments.length; l < a; l++) (e = arguments[l]) && (t = rt(e)) && (i && (i += " "), i += t);
|
|
126
|
+
return i;
|
|
127
|
+
}
|
|
128
|
+
function Pt() {
|
|
129
|
+
return /* @__PURE__ */ g("svg", { className: "bt-sort-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
130
|
+
/* @__PURE__ */ n("path", { d: "M7 2.5L10 5.5H4L7 2.5Z", fill: "currentColor", opacity: "0.4" }),
|
|
131
|
+
/* @__PURE__ */ n("path", { d: "M7 11.5L4 8.5H10L7 11.5Z", fill: "currentColor", opacity: "0.4" })
|
|
132
|
+
] });
|
|
42
133
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
134
|
+
function xt() {
|
|
135
|
+
return /* @__PURE__ */ g("svg", { className: "bt-sort-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
136
|
+
/* @__PURE__ */ n("path", { d: "M7 2.5L10 5.5H4L7 2.5Z", fill: "currentColor" }),
|
|
137
|
+
/* @__PURE__ */ n("path", { d: "M7 11.5L4 8.5H10L7 11.5Z", fill: "currentColor", opacity: "0.2" })
|
|
138
|
+
] });
|
|
46
139
|
}
|
|
47
|
-
function
|
|
140
|
+
function At() {
|
|
141
|
+
return /* @__PURE__ */ g("svg", { className: "bt-sort-icon", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
142
|
+
/* @__PURE__ */ n("path", { d: "M7 2.5L10 5.5H4L7 2.5Z", fill: "currentColor", opacity: "0.2" }),
|
|
143
|
+
/* @__PURE__ */ n("path", { d: "M7 11.5L4 8.5H10L7 11.5Z", fill: "currentColor" })
|
|
144
|
+
] });
|
|
145
|
+
}
|
|
146
|
+
function Lt({
|
|
48
147
|
column: e
|
|
49
148
|
}) {
|
|
50
149
|
const {
|
|
51
150
|
sortState: t,
|
|
52
151
|
handleSort: l,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} =
|
|
152
|
+
locale: i,
|
|
153
|
+
multiSortState: a,
|
|
154
|
+
isMultiSort: o
|
|
155
|
+
} = $(), s = t.columnId === e.id, d = o ? a.findIndex((k) => k.columnId === e.id) : -1, c = d >= 0, r = c ? a[d].direction : null, h = o && a.length > 1 && c, b = o ? c : s, u = o ? r : s ? t.direction : null, m = w(() => {
|
|
57
156
|
e.sortable !== !1 && l(e.id);
|
|
58
|
-
}, [e.id, e.sortable, l]),
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
e.type === "boolean" ? v === "" ? s(e.id, null) : s(e.id, v === "true") : s(e.id, v || null);
|
|
62
|
-
},
|
|
63
|
-
[e.id, e.type, s]
|
|
64
|
-
), f = m(
|
|
65
|
-
(u) => {
|
|
66
|
-
u.key === "Enter" && e.sortable !== !1 && l(e.id);
|
|
157
|
+
}, [e.id, e.sortable, l]), v = w(
|
|
158
|
+
(k) => {
|
|
159
|
+
k.key === "Enter" && e.sortable !== !1 && l(e.id);
|
|
67
160
|
},
|
|
68
161
|
[e.id, e.sortable, l]
|
|
69
|
-
),
|
|
70
|
-
"
|
|
71
|
-
{
|
|
72
|
-
className: P("bt-sort-btn", r && "bt-active"),
|
|
73
|
-
onClick: o,
|
|
74
|
-
"aria-label": b === "asc" ? a.sortDesc : a.sortAsc,
|
|
75
|
-
type: "button",
|
|
76
|
-
children: r ? b === "asc" ? "↑" : "↓" : "⇅"
|
|
77
|
-
}
|
|
78
|
-
), p = () => {
|
|
79
|
-
if (e.filterable === !1 || e.type === "custom")
|
|
162
|
+
), N = () => {
|
|
163
|
+
if (e.sortable === !1 || e.type === "custom")
|
|
80
164
|
return null;
|
|
81
|
-
const
|
|
82
|
-
return
|
|
83
|
-
"
|
|
165
|
+
const k = b ? u === "asc" ? xt : At : Pt;
|
|
166
|
+
return /* @__PURE__ */ g(
|
|
167
|
+
"button",
|
|
84
168
|
{
|
|
85
|
-
className: "bt-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
169
|
+
className: x("bt-sort-btn", b && "bt-active"),
|
|
170
|
+
onClick: m,
|
|
171
|
+
"aria-label": u === "asc" ? i.sortDesc : i.sortAsc,
|
|
172
|
+
type: "button",
|
|
89
173
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */ i("option", { value: "false", children: "❌" })
|
|
174
|
+
/* @__PURE__ */ n(k, {}),
|
|
175
|
+
h && /* @__PURE__ */ n("span", { className: "bt-sort-priority", "aria-label": `${i.sortPriority} ${d + 1}`, children: d + 1 })
|
|
93
176
|
]
|
|
94
177
|
}
|
|
95
|
-
) : /* @__PURE__ */ i(
|
|
96
|
-
"input",
|
|
97
|
-
{
|
|
98
|
-
type: e.type === "number" ? "number" : "text",
|
|
99
|
-
className: "bt-filter-input",
|
|
100
|
-
placeholder: `${a.filterBy}...`,
|
|
101
|
-
value: u != null ? String(u) : "",
|
|
102
|
-
onChange: h,
|
|
103
|
-
"aria-label": `${a.filterBy} ${e.header}`
|
|
104
|
-
}
|
|
105
178
|
);
|
|
106
179
|
};
|
|
107
|
-
return e.headerCell ? /* @__PURE__ */
|
|
180
|
+
return e.headerCell ? /* @__PURE__ */ n(
|
|
108
181
|
"th",
|
|
109
182
|
{
|
|
110
|
-
className:
|
|
183
|
+
className: x("bt-th", e.align && `bt-align-${e.align}`),
|
|
111
184
|
style: { width: e.width },
|
|
112
185
|
children: e.headerCell(e)
|
|
113
186
|
}
|
|
114
|
-
) : /* @__PURE__ */
|
|
187
|
+
) : /* @__PURE__ */ n(
|
|
115
188
|
"th",
|
|
116
189
|
{
|
|
117
|
-
className:
|
|
190
|
+
className: x("bt-th", e.align && `bt-align-${e.align}`, b && "bt-sorted"),
|
|
118
191
|
style: { width: e.width },
|
|
119
192
|
role: "columnheader",
|
|
120
|
-
"aria-sort":
|
|
193
|
+
"aria-sort": b ? u === "asc" ? "ascending" : "descending" : void 0,
|
|
121
194
|
tabIndex: e.sortable !== !1 ? 0 : void 0,
|
|
122
|
-
onKeyDown: e.sortable !== !1 ?
|
|
123
|
-
children: /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
] }),
|
|
128
|
-
e.filterable !== !1 && p()
|
|
129
|
-
] })
|
|
195
|
+
onKeyDown: e.sortable !== !1 ? v : void 0,
|
|
196
|
+
children: /* @__PURE__ */ n("div", { className: "bt-th-content", children: /* @__PURE__ */ g("div", { className: "bt-th-header", children: [
|
|
197
|
+
/* @__PURE__ */ n("span", { className: "bt-th-title", children: e.header }),
|
|
198
|
+
N()
|
|
199
|
+
] }) })
|
|
130
200
|
}
|
|
131
201
|
);
|
|
132
202
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
203
|
+
const Dt = R.memo(
|
|
204
|
+
Lt
|
|
205
|
+
), Ye = () => /* @__PURE__ */ n(
|
|
206
|
+
"svg",
|
|
207
|
+
{
|
|
208
|
+
className: "bt-ff-icon",
|
|
209
|
+
width: "12",
|
|
210
|
+
height: "12",
|
|
211
|
+
viewBox: "0 0 16 16",
|
|
212
|
+
fill: "none",
|
|
213
|
+
stroke: "currentColor",
|
|
214
|
+
strokeWidth: "1.5",
|
|
215
|
+
strokeLinecap: "round",
|
|
216
|
+
strokeLinejoin: "round",
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
children: /* @__PURE__ */ n("path", { d: "M1.5 2h13L9.5 8.5V14l-3-1.5V8.5z" })
|
|
219
|
+
}
|
|
135
220
|
);
|
|
136
|
-
function
|
|
221
|
+
function Tt() {
|
|
137
222
|
const {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
223
|
+
visibleColumns: e,
|
|
224
|
+
filters: t,
|
|
225
|
+
setFilter: l,
|
|
226
|
+
selectable: i,
|
|
227
|
+
selectionMode: a,
|
|
228
|
+
rowActions: o,
|
|
229
|
+
locale: s,
|
|
230
|
+
stickyHeader: d
|
|
231
|
+
} = $(), c = o && o.length > 0;
|
|
232
|
+
return e.some(
|
|
233
|
+
(h) => h.filterable !== !1 && h.type !== "custom"
|
|
234
|
+
) ? /* @__PURE__ */ g("tr", { className: x("bt-tr", "bt-floating-filter-row", d && "bt-sticky-filter"), children: [
|
|
235
|
+
i && a === "multiple" && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-checkbox-cell" }),
|
|
236
|
+
i && a === "single" && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-checkbox-cell" }),
|
|
237
|
+
e.map((h) => /* @__PURE__ */ n(
|
|
238
|
+
"th",
|
|
239
|
+
{
|
|
240
|
+
className: x(
|
|
241
|
+
"bt-th",
|
|
242
|
+
"bt-floating-filter-cell",
|
|
243
|
+
h.align && `bt-align-${h.align}`
|
|
244
|
+
),
|
|
245
|
+
style: { width: h.width },
|
|
246
|
+
children: h.filterable !== !1 && h.type !== "custom" ? /* @__PURE__ */ n(
|
|
247
|
+
It,
|
|
248
|
+
{
|
|
249
|
+
column: h,
|
|
250
|
+
value: t[h.id],
|
|
251
|
+
setFilter: l,
|
|
252
|
+
locale: s
|
|
253
|
+
}
|
|
254
|
+
) : null
|
|
255
|
+
},
|
|
256
|
+
h.id
|
|
257
|
+
)),
|
|
258
|
+
c && /* @__PURE__ */ n("th", { className: "bt-th bt-floating-filter-cell bt-actions-cell" })
|
|
259
|
+
] }) : null;
|
|
260
|
+
}
|
|
261
|
+
function Mt({
|
|
262
|
+
column: e,
|
|
263
|
+
value: t,
|
|
264
|
+
setFilter: l,
|
|
265
|
+
locale: i
|
|
266
|
+
}) {
|
|
267
|
+
const a = w(
|
|
268
|
+
(c) => {
|
|
269
|
+
const r = c.target.value;
|
|
270
|
+
e.type === "boolean" ? r === "" ? l(e.id, null) : l(e.id, r === "true") : l(e.id, r || null);
|
|
271
|
+
},
|
|
272
|
+
[e.id, e.type, l]
|
|
273
|
+
), o = w(
|
|
274
|
+
(c, r) => {
|
|
275
|
+
const b = { ...t ?? {}, [c]: r || void 0 };
|
|
276
|
+
l(e.id, b);
|
|
277
|
+
},
|
|
278
|
+
[e.id, t, l]
|
|
279
|
+
), s = `bt-ff-${e.id}`, d = I(() => {
|
|
280
|
+
if (t == null) return !1;
|
|
281
|
+
if (typeof t == "object") {
|
|
282
|
+
const c = t;
|
|
283
|
+
return !!(c.from || c.to);
|
|
284
|
+
}
|
|
285
|
+
return t !== "";
|
|
286
|
+
}, [t]);
|
|
287
|
+
if (e.type === "boolean")
|
|
288
|
+
return /* @__PURE__ */ g("div", { className: x("bt-ff-wrapper", d && "bt-ff-active"), children: [
|
|
289
|
+
/* @__PURE__ */ n(Ye, {}),
|
|
290
|
+
/* @__PURE__ */ g(
|
|
291
|
+
"select",
|
|
292
|
+
{
|
|
293
|
+
id: s,
|
|
294
|
+
name: s,
|
|
295
|
+
className: "bt-floating-filter-select",
|
|
296
|
+
value: t == null ? "" : String(t),
|
|
297
|
+
onChange: a,
|
|
298
|
+
"aria-label": `${i.filterBy} ${e.header}`,
|
|
299
|
+
children: [
|
|
300
|
+
/* @__PURE__ */ n("option", { value: "", children: "—" }),
|
|
301
|
+
/* @__PURE__ */ n("option", { value: "true", children: "✅" }),
|
|
302
|
+
/* @__PURE__ */ n("option", { value: "false", children: "❌" })
|
|
303
|
+
]
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] });
|
|
307
|
+
if (e.type === "date") {
|
|
308
|
+
const c = t ?? {};
|
|
309
|
+
return /* @__PURE__ */ g("div", { className: x("bt-floating-filter-dates", d && "bt-ff-active"), children: [
|
|
310
|
+
/* @__PURE__ */ n(
|
|
311
|
+
"input",
|
|
312
|
+
{
|
|
313
|
+
id: `${s}-from`,
|
|
314
|
+
name: `${s}-from`,
|
|
315
|
+
type: "date",
|
|
316
|
+
className: "bt-floating-filter-input",
|
|
317
|
+
value: c.from ?? "",
|
|
318
|
+
onChange: (r) => o("from", r.target.value),
|
|
319
|
+
"aria-label": `${i.dateFrom} ${e.header}`,
|
|
320
|
+
title: i.dateFrom
|
|
321
|
+
}
|
|
322
|
+
),
|
|
323
|
+
/* @__PURE__ */ n("span", { className: "bt-ff-date-sep", children: "–" }),
|
|
324
|
+
/* @__PURE__ */ n(
|
|
325
|
+
"input",
|
|
326
|
+
{
|
|
327
|
+
id: `${s}-to`,
|
|
328
|
+
name: `${s}-to`,
|
|
329
|
+
type: "date",
|
|
330
|
+
className: "bt-floating-filter-input",
|
|
331
|
+
value: c.to ?? "",
|
|
332
|
+
onChange: (r) => o("to", r.target.value),
|
|
333
|
+
"aria-label": `${i.dateTo} ${e.header}`,
|
|
334
|
+
title: i.dateTo
|
|
335
|
+
}
|
|
336
|
+
)
|
|
337
|
+
] });
|
|
338
|
+
}
|
|
339
|
+
return /* @__PURE__ */ g("div", { className: x("bt-ff-wrapper", d && "bt-ff-active"), children: [
|
|
340
|
+
/* @__PURE__ */ n(Ye, {}),
|
|
341
|
+
/* @__PURE__ */ n(
|
|
153
342
|
"input",
|
|
154
343
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
onChange:
|
|
162
|
-
"aria-label":
|
|
344
|
+
id: s,
|
|
345
|
+
name: s,
|
|
346
|
+
type: e.type === "number" ? "number" : "text",
|
|
347
|
+
className: "bt-floating-filter-input",
|
|
348
|
+
placeholder: "...",
|
|
349
|
+
value: t != null ? String(t) : "",
|
|
350
|
+
onChange: a,
|
|
351
|
+
"aria-label": `${i.filterBy} ${e.header}`
|
|
163
352
|
}
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
353
|
+
)
|
|
354
|
+
] });
|
|
355
|
+
}
|
|
356
|
+
const It = R.memo(Mt), $t = R.memo(
|
|
357
|
+
Tt
|
|
358
|
+
);
|
|
359
|
+
function Ft() {
|
|
360
|
+
const {
|
|
361
|
+
visibleColumns: e,
|
|
362
|
+
selectable: t,
|
|
363
|
+
selectionMode: l,
|
|
364
|
+
rowActions: i,
|
|
365
|
+
isAllSelected: a,
|
|
366
|
+
isPartiallySelected: o,
|
|
367
|
+
selectAll: s,
|
|
368
|
+
deselectAll: d,
|
|
369
|
+
locale: c,
|
|
370
|
+
stickyHeader: r,
|
|
371
|
+
filterMode: h
|
|
372
|
+
} = $(), b = i && i.length > 0, u = h === "floating" || h === "both", m = () => {
|
|
373
|
+
a ? d() : s();
|
|
374
|
+
};
|
|
375
|
+
return /* @__PURE__ */ g("thead", { className: x("bt-thead", r && "bt-sticky"), children: [
|
|
376
|
+
/* @__PURE__ */ g("tr", { className: "bt-tr", children: [
|
|
377
|
+
t && /* @__PURE__ */ n("th", { className: "bt-th bt-checkbox-cell", children: l === "multiple" && /* @__PURE__ */ n(
|
|
378
|
+
"input",
|
|
379
|
+
{
|
|
380
|
+
id: "bt-select-all",
|
|
381
|
+
name: "bt-select-all",
|
|
382
|
+
type: "checkbox",
|
|
383
|
+
className: "bt-checkbox",
|
|
384
|
+
checked: a,
|
|
385
|
+
ref: (v) => {
|
|
386
|
+
v && (v.indeterminate = o);
|
|
387
|
+
},
|
|
388
|
+
onChange: m,
|
|
389
|
+
"aria-label": a ? c.deselectAll : c.selectAll
|
|
390
|
+
}
|
|
391
|
+
) }),
|
|
392
|
+
e.map((v) => /* @__PURE__ */ n(Dt, { column: v }, v.id)),
|
|
393
|
+
b && /* @__PURE__ */ n("th", { className: "bt-th bt-actions-cell", children: c.actions })
|
|
394
|
+
] }),
|
|
395
|
+
u && /* @__PURE__ */ n($t, {})
|
|
396
|
+
] });
|
|
168
397
|
}
|
|
169
|
-
const
|
|
170
|
-
function
|
|
398
|
+
const Rt = Ft;
|
|
399
|
+
function j(e, t) {
|
|
171
400
|
if (!e || !t) return;
|
|
172
401
|
const l = t.split(".");
|
|
173
|
-
let
|
|
174
|
-
for (const
|
|
175
|
-
if (
|
|
402
|
+
let i = e;
|
|
403
|
+
for (const a of l) {
|
|
404
|
+
if (i == null)
|
|
176
405
|
return;
|
|
177
|
-
if (typeof
|
|
178
|
-
|
|
406
|
+
if (typeof i == "object")
|
|
407
|
+
i = i[a];
|
|
179
408
|
else
|
|
180
409
|
return;
|
|
181
410
|
}
|
|
182
|
-
return
|
|
411
|
+
return i;
|
|
183
412
|
}
|
|
184
|
-
function
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
413
|
+
function at(e, t, l) {
|
|
414
|
+
if (e == null)
|
|
415
|
+
return l === "asc" ? 1 : -1;
|
|
416
|
+
if (t == null)
|
|
417
|
+
return l === "asc" ? -1 : 1;
|
|
418
|
+
if (typeof e == "string" && typeof t == "string") {
|
|
419
|
+
const s = e.localeCompare(t, void 0, {
|
|
420
|
+
sensitivity: "base",
|
|
421
|
+
numeric: !0
|
|
422
|
+
});
|
|
423
|
+
return l === "asc" ? s : -s;
|
|
424
|
+
}
|
|
425
|
+
if (typeof e == "number" && typeof t == "number")
|
|
426
|
+
return l === "asc" ? e - t : t - e;
|
|
427
|
+
if (typeof e == "boolean" && typeof t == "boolean") {
|
|
428
|
+
const s = e === t ? 0 : e ? -1 : 1;
|
|
429
|
+
return l === "asc" ? s : -s;
|
|
430
|
+
}
|
|
431
|
+
if (e instanceof Date && t instanceof Date) {
|
|
432
|
+
const s = e.getTime() - t.getTime();
|
|
433
|
+
return l === "asc" ? s : -s;
|
|
434
|
+
}
|
|
435
|
+
const i = String(e), a = String(t), o = i.localeCompare(a);
|
|
436
|
+
return l === "asc" ? o : -o;
|
|
437
|
+
}
|
|
438
|
+
function Et(e, t, l) {
|
|
439
|
+
return [...e].sort((i, a) => {
|
|
440
|
+
const o = j(i, t), s = j(a, t);
|
|
441
|
+
return at(o, s, l);
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
function jt(e, t) {
|
|
445
|
+
const l = t.filter((i) => i.columnId !== null);
|
|
446
|
+
return l.length === 0 ? e : [...e].sort((i, a) => {
|
|
447
|
+
for (const o of l) {
|
|
448
|
+
const s = j(
|
|
449
|
+
i,
|
|
450
|
+
o.columnId
|
|
451
|
+
), d = j(
|
|
452
|
+
a,
|
|
453
|
+
o.columnId
|
|
454
|
+
), c = at(s, d, o.direction);
|
|
455
|
+
if (c !== 0) return c;
|
|
207
456
|
}
|
|
208
|
-
|
|
209
|
-
return l === "asc" ? h : -h;
|
|
457
|
+
return 0;
|
|
210
458
|
});
|
|
211
459
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
460
|
+
function _(e) {
|
|
461
|
+
if (e instanceof Date) return e;
|
|
462
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
463
|
+
const t = new Date(e);
|
|
464
|
+
return isNaN(t.getTime()) ? null : t;
|
|
465
|
+
}
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
function Ot(e, t, l) {
|
|
469
|
+
const i = Object.entries(t).filter(
|
|
470
|
+
([, a]) => a != null && a !== ""
|
|
215
471
|
);
|
|
216
|
-
return
|
|
217
|
-
const
|
|
218
|
-
if (!
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
String(
|
|
472
|
+
return i.length === 0 ? e : e.filter((a) => i.every(([o, s]) => {
|
|
473
|
+
const d = l.find((h) => h.id === o);
|
|
474
|
+
if (!d) return !0;
|
|
475
|
+
const c = j(
|
|
476
|
+
a,
|
|
477
|
+
String(d.accessor)
|
|
222
478
|
);
|
|
223
|
-
if (
|
|
479
|
+
if (c == null)
|
|
224
480
|
return !1;
|
|
225
|
-
switch (
|
|
481
|
+
switch (d.type ?? "string") {
|
|
226
482
|
case "boolean":
|
|
227
|
-
return
|
|
483
|
+
return c === s;
|
|
228
484
|
case "number":
|
|
229
|
-
return String(
|
|
230
|
-
case "date":
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
485
|
+
return String(c) === String(s);
|
|
486
|
+
case "date": {
|
|
487
|
+
const h = _(c);
|
|
488
|
+
if (!h) return !1;
|
|
489
|
+
if (s && typeof s == "object" && ("from" in s || "to" in s)) {
|
|
490
|
+
const u = s;
|
|
491
|
+
if (u.from) {
|
|
492
|
+
const m = _(u.from);
|
|
493
|
+
if (m && h < m) return !1;
|
|
494
|
+
}
|
|
495
|
+
if (u.to) {
|
|
496
|
+
const m = _(u.to);
|
|
497
|
+
if (m) {
|
|
498
|
+
const v = new Date(m);
|
|
499
|
+
if (v.setHours(23, 59, 59, 999), h > v) return !1;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return !0;
|
|
234
503
|
}
|
|
235
|
-
|
|
504
|
+
const b = _(s);
|
|
505
|
+
return b ? h.toDateString() === b.toDateString() : String(c).includes(String(s));
|
|
506
|
+
}
|
|
236
507
|
default:
|
|
237
|
-
return String(
|
|
508
|
+
return String(c).toLowerCase().includes(String(s).toLowerCase());
|
|
238
509
|
}
|
|
239
510
|
}));
|
|
240
511
|
}
|
|
241
|
-
function
|
|
512
|
+
function Bt(e, t, l, i) {
|
|
242
513
|
if (!t.trim())
|
|
243
514
|
return e;
|
|
244
|
-
const
|
|
515
|
+
const a = t.toLowerCase().trim(), o = i ? l.filter(
|
|
516
|
+
(s) => i.includes(s.id) || i.includes(String(s.accessor))
|
|
517
|
+
) : l.filter((s) => s.type !== "custom");
|
|
245
518
|
return e.filter(
|
|
246
|
-
(
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
String(
|
|
519
|
+
(s) => o.some((d) => {
|
|
520
|
+
const c = j(
|
|
521
|
+
s,
|
|
522
|
+
String(d.accessor)
|
|
250
523
|
);
|
|
251
|
-
return
|
|
524
|
+
return c == null ? !1 : String(c).toLowerCase().includes(a);
|
|
252
525
|
})
|
|
253
526
|
);
|
|
254
527
|
}
|
|
255
|
-
function
|
|
528
|
+
function zt({
|
|
256
529
|
row: e,
|
|
257
530
|
column: t,
|
|
258
531
|
rowIndex: l
|
|
259
532
|
}) {
|
|
260
|
-
const
|
|
533
|
+
const i = j(
|
|
261
534
|
e,
|
|
262
535
|
String(t.accessor)
|
|
263
|
-
),
|
|
536
|
+
), o = (() => {
|
|
264
537
|
if (t.cell)
|
|
265
|
-
return t.cell(
|
|
266
|
-
if (
|
|
267
|
-
return /* @__PURE__ */
|
|
538
|
+
return t.cell(i, e, l);
|
|
539
|
+
if (i == null)
|
|
540
|
+
return /* @__PURE__ */ n("span", { className: "bt-cell-empty", children: "—" });
|
|
268
541
|
switch (t.type) {
|
|
269
542
|
case "boolean":
|
|
270
|
-
return
|
|
543
|
+
return i ? "✅" : "❌";
|
|
271
544
|
case "date":
|
|
272
|
-
if (
|
|
273
|
-
return
|
|
274
|
-
const
|
|
275
|
-
return isNaN(
|
|
545
|
+
if (i instanceof Date)
|
|
546
|
+
return i.toLocaleDateString();
|
|
547
|
+
const s = new Date(String(i));
|
|
548
|
+
return isNaN(s.getTime()) ? String(i) : s.toLocaleDateString();
|
|
276
549
|
case "number":
|
|
277
|
-
return typeof
|
|
550
|
+
return typeof i == "number" ? i.toLocaleString() : i;
|
|
278
551
|
default:
|
|
279
|
-
return String(
|
|
552
|
+
return String(i);
|
|
280
553
|
}
|
|
281
554
|
})();
|
|
282
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ n(
|
|
283
556
|
"td",
|
|
284
557
|
{
|
|
285
|
-
className:
|
|
558
|
+
className: x("bt-td", t.align && `bt-align-${t.align}`),
|
|
286
559
|
style: { width: t.width },
|
|
287
|
-
children:
|
|
560
|
+
children: o
|
|
288
561
|
}
|
|
289
562
|
);
|
|
290
563
|
}
|
|
291
|
-
const
|
|
292
|
-
function
|
|
564
|
+
const Vt = R.memo(zt), Ht = "📦";
|
|
565
|
+
function Wt({
|
|
566
|
+
actions: e,
|
|
567
|
+
row: t,
|
|
568
|
+
rowIndex: l,
|
|
569
|
+
onActionClick: i,
|
|
570
|
+
direction: a = "down"
|
|
571
|
+
}) {
|
|
572
|
+
const { locale: o } = $(), [s, d] = M(!1), [c, r] = M({ top: 0, left: 0, openUp: !1 }), h = V(null), b = V(null), u = w((y) => {
|
|
573
|
+
y.stopPropagation(), d((f) => {
|
|
574
|
+
if (!f && h.current) {
|
|
575
|
+
const C = h.current.getBoundingClientRect(), A = window.innerHeight - C.bottom, D = a === "up" || A < 200;
|
|
576
|
+
r({
|
|
577
|
+
top: D ? C.top : C.bottom,
|
|
578
|
+
left: C.right,
|
|
579
|
+
openUp: D
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
return !f;
|
|
583
|
+
});
|
|
584
|
+
}, [a]);
|
|
585
|
+
B(() => {
|
|
586
|
+
if (!s) return;
|
|
587
|
+
const y = (f) => {
|
|
588
|
+
const C = f.target;
|
|
589
|
+
h.current && !h.current.contains(C) && b.current && !b.current.contains(C) && d(!1);
|
|
590
|
+
};
|
|
591
|
+
return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
|
|
592
|
+
}, [s]), B(() => {
|
|
593
|
+
if (!s) return;
|
|
594
|
+
const y = (f) => {
|
|
595
|
+
f.key === "Escape" && d(!1);
|
|
596
|
+
};
|
|
597
|
+
return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
|
|
598
|
+
}, [s]), B(() => {
|
|
599
|
+
if (!s) return;
|
|
600
|
+
const y = () => d(!1);
|
|
601
|
+
return window.addEventListener("scroll", y, !0), () => window.removeEventListener("scroll", y, !0);
|
|
602
|
+
}, [s]);
|
|
603
|
+
const m = e.filter((y) => y.variant !== "danger"), v = e.filter((y) => y.variant === "danger"), N = [...m, ...v], k = m.length > 0 && v.length > 0, L = m.length, S = c.openUp ? { position: "fixed", bottom: window.innerHeight - c.top, right: window.innerWidth - c.left } : { position: "fixed", top: c.top, right: window.innerWidth - c.left };
|
|
604
|
+
return /* @__PURE__ */ g("div", { className: "bt-overflow-container", children: [
|
|
605
|
+
/* @__PURE__ */ n(
|
|
606
|
+
"button",
|
|
607
|
+
{
|
|
608
|
+
ref: h,
|
|
609
|
+
className: "bt-action-btn bt-overflow-trigger",
|
|
610
|
+
onClick: u,
|
|
611
|
+
"aria-label": o.moreActions,
|
|
612
|
+
"aria-expanded": s,
|
|
613
|
+
"aria-haspopup": "menu",
|
|
614
|
+
title: o.moreActions,
|
|
615
|
+
type: "button",
|
|
616
|
+
children: /* @__PURE__ */ n("span", { className: "bt-overflow-icon", children: /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
617
|
+
/* @__PURE__ */ n("circle", { cx: "3", cy: "8", r: "1.5" }),
|
|
618
|
+
/* @__PURE__ */ n("circle", { cx: "8", cy: "8", r: "1.5" }),
|
|
619
|
+
/* @__PURE__ */ n("circle", { cx: "13", cy: "8", r: "1.5" })
|
|
620
|
+
] }) })
|
|
621
|
+
}
|
|
622
|
+
),
|
|
623
|
+
s && kt(
|
|
624
|
+
/* @__PURE__ */ n(
|
|
625
|
+
"div",
|
|
626
|
+
{
|
|
627
|
+
ref: b,
|
|
628
|
+
className: x(
|
|
629
|
+
"bt-overflow-menu",
|
|
630
|
+
c.openUp && "bt-overflow-menu-up"
|
|
631
|
+
),
|
|
632
|
+
style: S,
|
|
633
|
+
role: "menu",
|
|
634
|
+
children: N.map((y, f) => {
|
|
635
|
+
if (y.visible && !y.visible(t))
|
|
636
|
+
return null;
|
|
637
|
+
const C = y.disabled ? y.disabled(t) : !1, A = y.icon ?? Ht, D = k && f === L;
|
|
638
|
+
return /* @__PURE__ */ g(R.Fragment, { children: [
|
|
639
|
+
D && /* @__PURE__ */ n("div", { className: "bt-overflow-separator", role: "separator" }),
|
|
640
|
+
y.mode === "link" && y.href ? /* @__PURE__ */ g(
|
|
641
|
+
"a",
|
|
642
|
+
{
|
|
643
|
+
href: typeof y.href == "function" ? y.href(t) : y.href,
|
|
644
|
+
target: "_blank",
|
|
645
|
+
rel: "noopener noreferrer",
|
|
646
|
+
className: x(
|
|
647
|
+
"bt-overflow-item",
|
|
648
|
+
y.variant === "danger" && "bt-overflow-item-danger"
|
|
649
|
+
),
|
|
650
|
+
role: "menuitem",
|
|
651
|
+
onClick: (p) => {
|
|
652
|
+
p.stopPropagation(), d(!1);
|
|
653
|
+
},
|
|
654
|
+
children: [
|
|
655
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-icon", children: A }),
|
|
656
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-label", children: y.label })
|
|
657
|
+
]
|
|
658
|
+
}
|
|
659
|
+
) : /* @__PURE__ */ g(
|
|
660
|
+
"button",
|
|
661
|
+
{
|
|
662
|
+
className: x(
|
|
663
|
+
"bt-overflow-item",
|
|
664
|
+
y.variant === "danger" && "bt-overflow-item-danger"
|
|
665
|
+
),
|
|
666
|
+
role: "menuitem",
|
|
667
|
+
disabled: C,
|
|
668
|
+
onClick: (p) => {
|
|
669
|
+
p.stopPropagation(), i(y), d(!1);
|
|
670
|
+
},
|
|
671
|
+
type: "button",
|
|
672
|
+
children: [
|
|
673
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-icon", children: A }),
|
|
674
|
+
/* @__PURE__ */ n("span", { className: "bt-overflow-item-label", children: y.label })
|
|
675
|
+
]
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
] }, y.id);
|
|
679
|
+
})
|
|
680
|
+
}
|
|
681
|
+
),
|
|
682
|
+
document.body
|
|
683
|
+
)
|
|
684
|
+
] });
|
|
685
|
+
}
|
|
686
|
+
const st = R.memo(
|
|
687
|
+
Wt
|
|
688
|
+
), qt = "📦";
|
|
689
|
+
function Kt({
|
|
293
690
|
row: e,
|
|
294
691
|
rowIndex: t
|
|
295
692
|
}) {
|
|
296
|
-
const { rowActions: l, openModal:
|
|
297
|
-
(
|
|
298
|
-
if (
|
|
299
|
-
|
|
300
|
-
else if (
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
693
|
+
const { rowActions: l, openModal: i, closeModal: a, maxVisibleActions: o } = $(), s = w(
|
|
694
|
+
(r) => {
|
|
695
|
+
if (r.mode === "callback" && r.onClick)
|
|
696
|
+
r.onClick(e, t);
|
|
697
|
+
else if (r.mode === "modal" && r.modalContent) {
|
|
698
|
+
const h = r.modalContent;
|
|
699
|
+
i(
|
|
700
|
+
/* @__PURE__ */ n(
|
|
701
|
+
h,
|
|
305
702
|
{
|
|
306
703
|
data: e,
|
|
307
|
-
onClose:
|
|
308
|
-
}
|
|
704
|
+
onClose: a
|
|
309
705
|
}
|
|
310
706
|
)
|
|
311
707
|
);
|
|
312
|
-
} else if (
|
|
313
|
-
const
|
|
314
|
-
window.open(
|
|
708
|
+
} else if (r.mode === "link" && r.href) {
|
|
709
|
+
const h = typeof r.href == "function" ? r.href(e) : r.href;
|
|
710
|
+
window.open(h, "_blank");
|
|
315
711
|
}
|
|
316
712
|
},
|
|
317
|
-
[e, t,
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
713
|
+
[e, t, i, a]
|
|
714
|
+
), { inlineActions: d, overflowActions: c } = I(() => {
|
|
715
|
+
if (!l) return { inlineActions: [], overflowActions: [] };
|
|
716
|
+
const r = l.filter(
|
|
717
|
+
(b) => !b.visible || b.visible(e)
|
|
718
|
+
);
|
|
719
|
+
if (r.length <= o)
|
|
720
|
+
return { inlineActions: r, overflowActions: [] };
|
|
721
|
+
const h = o - 1;
|
|
722
|
+
return {
|
|
723
|
+
inlineActions: r.slice(0, h),
|
|
724
|
+
overflowActions: r.slice(h)
|
|
725
|
+
};
|
|
726
|
+
}, [l, o, e]);
|
|
727
|
+
return !l || l.length === 0 ? null : /* @__PURE__ */ n("td", { className: "bt-td bt-actions-cell", children: /* @__PURE__ */ g("div", { className: "bt-actions-wrapper", children: [
|
|
728
|
+
d.map((r) => {
|
|
729
|
+
const h = r.disabled ? r.disabled(e) : !1, b = r.icon ?? qt;
|
|
730
|
+
if (r.mode === "link" && r.href) {
|
|
731
|
+
const u = typeof r.href == "function" ? r.href(e) : r.href;
|
|
732
|
+
return /* @__PURE__ */ n(
|
|
733
|
+
"a",
|
|
734
|
+
{
|
|
735
|
+
href: u,
|
|
736
|
+
target: "_blank",
|
|
737
|
+
rel: "noopener noreferrer",
|
|
738
|
+
className: x(
|
|
739
|
+
"bt-action-btn bt-action-icon-only",
|
|
740
|
+
r.variant && `bt-variant-${r.variant}`
|
|
741
|
+
),
|
|
742
|
+
"aria-label": r.label,
|
|
743
|
+
title: r.label,
|
|
744
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: b })
|
|
745
|
+
},
|
|
746
|
+
r.id
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
return /* @__PURE__ */ n(
|
|
750
|
+
"button",
|
|
327
751
|
{
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
className: P(
|
|
332
|
-
"bt-action-btn",
|
|
333
|
-
a.variant && `bt-variant-${a.variant}`
|
|
752
|
+
className: x(
|
|
753
|
+
"bt-action-btn bt-action-icon-only",
|
|
754
|
+
r.variant && `bt-variant-${r.variant}`
|
|
334
755
|
),
|
|
335
|
-
|
|
336
|
-
|
|
756
|
+
onClick: () => s(r),
|
|
757
|
+
disabled: h,
|
|
758
|
+
"aria-label": r.label,
|
|
759
|
+
title: r.label,
|
|
760
|
+
type: "button",
|
|
761
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: b })
|
|
337
762
|
},
|
|
338
|
-
|
|
763
|
+
r.id
|
|
339
764
|
);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
765
|
+
}),
|
|
766
|
+
c.length > 0 && /* @__PURE__ */ n(
|
|
767
|
+
st,
|
|
343
768
|
{
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
type: "button",
|
|
353
|
-
children: a.icon && /* @__PURE__ */ i("span", { className: "bt-action-icon", children: a.icon })
|
|
354
|
-
},
|
|
355
|
-
a.id
|
|
356
|
-
);
|
|
357
|
-
}) }) });
|
|
769
|
+
actions: c,
|
|
770
|
+
row: e,
|
|
771
|
+
rowIndex: t,
|
|
772
|
+
onActionClick: s,
|
|
773
|
+
direction: "down"
|
|
774
|
+
}
|
|
775
|
+
)
|
|
776
|
+
] }) });
|
|
358
777
|
}
|
|
359
|
-
const
|
|
360
|
-
|
|
778
|
+
const _t = R.memo(
|
|
779
|
+
Kt
|
|
361
780
|
);
|
|
362
|
-
function
|
|
781
|
+
function Ut({ row: e, rowIndex: t }) {
|
|
363
782
|
const {
|
|
364
|
-
|
|
365
|
-
selectable:
|
|
366
|
-
rowActions:
|
|
367
|
-
isSelected:
|
|
368
|
-
toggleRow:
|
|
369
|
-
striped:
|
|
370
|
-
hoverable:
|
|
371
|
-
onRowClick:
|
|
372
|
-
onRowDoubleClick:
|
|
373
|
-
} =
|
|
783
|
+
visibleColumns: l,
|
|
784
|
+
selectable: i,
|
|
785
|
+
rowActions: a,
|
|
786
|
+
isSelected: o,
|
|
787
|
+
toggleRow: s,
|
|
788
|
+
striped: d,
|
|
789
|
+
hoverable: c,
|
|
790
|
+
onRowClick: r,
|
|
791
|
+
onRowDoubleClick: h
|
|
792
|
+
} = $(), b = a && a.length > 0, u = i && o(e, t), m = !!r, v = w(() => {
|
|
793
|
+
r?.(e, t);
|
|
794
|
+
}, [e, t, r]), N = w(() => {
|
|
374
795
|
h?.(e, t);
|
|
375
|
-
}, [e, t, h]),
|
|
376
|
-
|
|
377
|
-
}, [e, t,
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
(k) => {
|
|
381
|
-
k.key === "Enter" && h && N();
|
|
796
|
+
}, [e, t, h]), k = w(() => {
|
|
797
|
+
s(e, t);
|
|
798
|
+
}, [e, t, s]), L = w(
|
|
799
|
+
(S) => {
|
|
800
|
+
S.key === "Enter" && r && v();
|
|
382
801
|
},
|
|
383
|
-
[
|
|
802
|
+
[v, r]
|
|
384
803
|
);
|
|
385
|
-
return /* @__PURE__ */
|
|
804
|
+
return /* @__PURE__ */ g(
|
|
386
805
|
"tr",
|
|
387
806
|
{
|
|
388
|
-
className:
|
|
807
|
+
className: x(
|
|
389
808
|
"bt-tr",
|
|
390
|
-
|
|
391
|
-
|
|
809
|
+
d && "bt-striped",
|
|
810
|
+
c && "bt-hoverable",
|
|
392
811
|
u && "bt-selected",
|
|
393
|
-
|
|
812
|
+
m && "bt-clickable"
|
|
394
813
|
),
|
|
395
|
-
onClick:
|
|
396
|
-
onDoubleClick:
|
|
397
|
-
onKeyDown:
|
|
398
|
-
tabIndex:
|
|
399
|
-
role:
|
|
400
|
-
"aria-selected":
|
|
814
|
+
onClick: m ? v : void 0,
|
|
815
|
+
onDoubleClick: h ? N : void 0,
|
|
816
|
+
onKeyDown: m ? L : void 0,
|
|
817
|
+
tabIndex: m ? 0 : void 0,
|
|
818
|
+
role: m ? "button" : void 0,
|
|
819
|
+
"aria-selected": i ? u : void 0,
|
|
401
820
|
children: [
|
|
402
|
-
|
|
821
|
+
i && /* @__PURE__ */ n("td", { className: "bt-td bt-checkbox-cell", children: /* @__PURE__ */ n(
|
|
403
822
|
"input",
|
|
404
823
|
{
|
|
824
|
+
id: `bt-row-select-${t}`,
|
|
825
|
+
name: `bt-row-select-${t}`,
|
|
405
826
|
type: "checkbox",
|
|
406
827
|
className: "bt-checkbox",
|
|
407
828
|
checked: u,
|
|
408
|
-
onChange:
|
|
409
|
-
onClick: (
|
|
829
|
+
onChange: k,
|
|
830
|
+
onClick: (S) => S.stopPropagation(),
|
|
410
831
|
"aria-label": `Select row ${t + 1}`
|
|
411
832
|
}
|
|
412
833
|
) }),
|
|
413
|
-
|
|
414
|
-
|
|
834
|
+
l.map((S) => /* @__PURE__ */ n(
|
|
835
|
+
Vt,
|
|
415
836
|
{
|
|
416
837
|
row: e,
|
|
417
|
-
column:
|
|
838
|
+
column: S,
|
|
418
839
|
rowIndex: t
|
|
419
840
|
},
|
|
420
|
-
|
|
841
|
+
S.id
|
|
421
842
|
)),
|
|
422
|
-
|
|
843
|
+
b && /* @__PURE__ */ n(_t, { row: e, rowIndex: t })
|
|
423
844
|
]
|
|
424
845
|
}
|
|
425
846
|
);
|
|
426
847
|
}
|
|
427
|
-
const
|
|
428
|
-
function
|
|
429
|
-
const { processedData: e, rowKey: t } =
|
|
848
|
+
const Zt = R.memo(Ut);
|
|
849
|
+
function Qt() {
|
|
850
|
+
const { processedData: e, rowKey: t } = $(), l = (i, a) => {
|
|
430
851
|
if (typeof t == "function")
|
|
431
|
-
return t(
|
|
432
|
-
const
|
|
433
|
-
return String(
|
|
852
|
+
return t(i, a);
|
|
853
|
+
const o = i[t];
|
|
854
|
+
return String(o !== void 0 ? o : a);
|
|
434
855
|
};
|
|
435
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ n("tbody", { className: "bt-tbody", children: e.map((i, a) => /* @__PURE__ */ n(Zt, { row: i, rowIndex: a }, l(i, a))) });
|
|
436
857
|
}
|
|
437
|
-
const
|
|
438
|
-
function
|
|
858
|
+
const Gt = Qt, Jt = "📦";
|
|
859
|
+
function Xt({ row: e, rowIndex: t }) {
|
|
439
860
|
const {
|
|
440
|
-
|
|
441
|
-
selectable:
|
|
442
|
-
rowActions:
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
},
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
861
|
+
visibleColumns: l,
|
|
862
|
+
selectable: i,
|
|
863
|
+
rowActions: a,
|
|
864
|
+
maxVisibleActions: o,
|
|
865
|
+
isSelected: s,
|
|
866
|
+
toggleRow: d,
|
|
867
|
+
hoverable: c,
|
|
868
|
+
onRowClick: r,
|
|
869
|
+
openModal: h,
|
|
870
|
+
closeModal: b
|
|
871
|
+
} = $(), u = a && a.length > 0, m = i && s(e, t), v = l[0], N = l.slice(1), { inlineActions: k, overflowActions: L } = I(() => {
|
|
872
|
+
if (!a) return { inlineActions: [], overflowActions: [] };
|
|
873
|
+
const p = a.filter(
|
|
874
|
+
(F) => !F.visible || F.visible(e)
|
|
875
|
+
);
|
|
876
|
+
if (p.length <= o)
|
|
877
|
+
return { inlineActions: p, overflowActions: [] };
|
|
878
|
+
const P = o - 1;
|
|
879
|
+
return {
|
|
880
|
+
inlineActions: p.slice(0, P),
|
|
881
|
+
overflowActions: p.slice(P)
|
|
882
|
+
};
|
|
883
|
+
}, [a, o, e]), S = w(() => {
|
|
884
|
+
d(e, t);
|
|
885
|
+
}, [e, t, d]), y = w(() => {
|
|
886
|
+
r?.(e, t);
|
|
887
|
+
}, [e, t, r]), f = w(
|
|
888
|
+
(p) => {
|
|
889
|
+
p.key === "Enter" && r && y();
|
|
455
890
|
},
|
|
456
|
-
[
|
|
457
|
-
),
|
|
458
|
-
(
|
|
459
|
-
if (
|
|
460
|
-
|
|
461
|
-
else if (
|
|
462
|
-
const
|
|
463
|
-
h(/* @__PURE__ */
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
window.open(g, "_blank");
|
|
891
|
+
[y, r]
|
|
892
|
+
), C = w(
|
|
893
|
+
(p) => {
|
|
894
|
+
if (p.mode === "callback" && p.onClick)
|
|
895
|
+
p.onClick(e, t);
|
|
896
|
+
else if (p.mode === "modal" && p.modalContent) {
|
|
897
|
+
const P = p.modalContent;
|
|
898
|
+
h(/* @__PURE__ */ n(P, { data: e, onClose: b }));
|
|
899
|
+
} else if (p.mode === "link" && p.href) {
|
|
900
|
+
const P = typeof p.href == "function" ? p.href(e) : p.href;
|
|
901
|
+
window.open(P, "_blank");
|
|
468
902
|
}
|
|
469
903
|
},
|
|
470
|
-
[e, t, h]
|
|
471
|
-
),
|
|
472
|
-
if (
|
|
473
|
-
return
|
|
474
|
-
if (
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
switch (
|
|
904
|
+
[e, t, h, b]
|
|
905
|
+
), A = (p, P) => {
|
|
906
|
+
if (p.cell)
|
|
907
|
+
return p.cell(P, e, t);
|
|
908
|
+
if (P == null)
|
|
909
|
+
return /* @__PURE__ */ n("span", { className: "bt-card-value-empty", children: "—" });
|
|
910
|
+
switch (p.type) {
|
|
477
911
|
case "boolean":
|
|
478
|
-
return
|
|
912
|
+
return P ? "✅" : "❌";
|
|
479
913
|
case "date":
|
|
480
|
-
if (
|
|
481
|
-
return
|
|
482
|
-
const
|
|
483
|
-
return isNaN(
|
|
914
|
+
if (P instanceof Date)
|
|
915
|
+
return P.toLocaleDateString();
|
|
916
|
+
const F = new Date(String(P));
|
|
917
|
+
return isNaN(F.getTime()) ? String(P) : F.toLocaleDateString();
|
|
484
918
|
case "number":
|
|
485
|
-
return typeof
|
|
919
|
+
return typeof P == "number" ? P.toLocaleString() : String(P);
|
|
486
920
|
default:
|
|
487
|
-
return String(
|
|
921
|
+
return String(P);
|
|
488
922
|
}
|
|
489
|
-
},
|
|
490
|
-
return /* @__PURE__ */
|
|
923
|
+
}, D = v ? j(e, String(v.accessor)) : "";
|
|
924
|
+
return /* @__PURE__ */ g(
|
|
491
925
|
"div",
|
|
492
926
|
{
|
|
493
|
-
className:
|
|
927
|
+
className: x(
|
|
494
928
|
"bt-card",
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
929
|
+
c && "bt-hoverable",
|
|
930
|
+
m && "bt-selected",
|
|
931
|
+
r && "bt-clickable"
|
|
498
932
|
),
|
|
499
|
-
onClick:
|
|
500
|
-
onKeyDown:
|
|
501
|
-
tabIndex:
|
|
502
|
-
role:
|
|
503
|
-
"aria-selected":
|
|
933
|
+
onClick: r ? y : void 0,
|
|
934
|
+
onKeyDown: r ? f : void 0,
|
|
935
|
+
tabIndex: r ? 0 : void 0,
|
|
936
|
+
role: r ? "button" : void 0,
|
|
937
|
+
"aria-selected": i ? m : void 0,
|
|
504
938
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
|
|
939
|
+
/* @__PURE__ */ g("div", { className: "bt-card-header", children: [
|
|
940
|
+
i && /* @__PURE__ */ n(
|
|
507
941
|
"input",
|
|
508
942
|
{
|
|
943
|
+
id: `bt-card-select-${t}`,
|
|
944
|
+
name: `bt-card-select-${t}`,
|
|
509
945
|
type: "checkbox",
|
|
510
946
|
className: "bt-checkbox",
|
|
511
|
-
checked:
|
|
512
|
-
onChange:
|
|
513
|
-
onClick: (
|
|
947
|
+
checked: m,
|
|
948
|
+
onChange: S,
|
|
949
|
+
onClick: (p) => p.stopPropagation(),
|
|
514
950
|
"aria-label": `Select row ${t + 1}`
|
|
515
951
|
}
|
|
516
952
|
),
|
|
517
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ n("span", { className: "bt-card-title", children: v ? A(v, D) : `Item ${t + 1}` })
|
|
518
954
|
] }),
|
|
519
|
-
|
|
520
|
-
const
|
|
955
|
+
N.map((p) => {
|
|
956
|
+
const P = j(
|
|
521
957
|
e,
|
|
522
|
-
String(
|
|
523
|
-
),
|
|
524
|
-
return /* @__PURE__ */
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
] },
|
|
958
|
+
String(p.accessor)
|
|
959
|
+
), F = A(p, P);
|
|
960
|
+
return /* @__PURE__ */ g("div", { className: "bt-card-row", children: [
|
|
961
|
+
/* @__PURE__ */ n("span", { className: "bt-card-label", children: p.header }),
|
|
962
|
+
/* @__PURE__ */ n("span", { className: "bt-card-value", children: F })
|
|
963
|
+
] }, p.id);
|
|
528
964
|
}),
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
965
|
+
u && /* @__PURE__ */ g("div", { className: "bt-card-actions", children: [
|
|
966
|
+
k.map((p) => {
|
|
967
|
+
const P = p.disabled ? p.disabled(e) : !1, F = p.icon ?? Jt;
|
|
968
|
+
if (p.mode === "link" && p.href) {
|
|
969
|
+
const z = typeof p.href == "function" ? p.href(e) : p.href;
|
|
970
|
+
return /* @__PURE__ */ n(
|
|
971
|
+
"a",
|
|
972
|
+
{
|
|
973
|
+
href: z,
|
|
974
|
+
target: "_blank",
|
|
975
|
+
rel: "noopener noreferrer",
|
|
976
|
+
className: x(
|
|
977
|
+
"bt-action-btn bt-action-icon-only",
|
|
978
|
+
p.variant && `bt-variant-${p.variant}`
|
|
979
|
+
),
|
|
980
|
+
"aria-label": p.label,
|
|
981
|
+
title: p.label,
|
|
982
|
+
onClick: (H) => H.stopPropagation(),
|
|
983
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: F })
|
|
984
|
+
},
|
|
985
|
+
p.id
|
|
986
|
+
);
|
|
987
|
+
}
|
|
988
|
+
return /* @__PURE__ */ n(
|
|
989
|
+
"button",
|
|
537
990
|
{
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
className: P(
|
|
542
|
-
"bt-action-btn",
|
|
543
|
-
c.variant && `bt-variant-${c.variant}`
|
|
991
|
+
className: x(
|
|
992
|
+
"bt-action-btn bt-action-icon-only",
|
|
993
|
+
p.variant && `bt-variant-${p.variant}`
|
|
544
994
|
),
|
|
545
|
-
onClick: (
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
995
|
+
onClick: (z) => {
|
|
996
|
+
z.stopPropagation(), C(p);
|
|
997
|
+
},
|
|
998
|
+
disabled: P,
|
|
999
|
+
"aria-label": p.label,
|
|
1000
|
+
title: p.label,
|
|
1001
|
+
type: "button",
|
|
1002
|
+
children: /* @__PURE__ */ n("span", { className: "bt-action-icon", children: F })
|
|
550
1003
|
},
|
|
551
|
-
|
|
1004
|
+
p.id
|
|
552
1005
|
);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
|
|
1006
|
+
}),
|
|
1007
|
+
L.length > 0 && /* @__PURE__ */ n(
|
|
1008
|
+
st,
|
|
556
1009
|
{
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
type: "button",
|
|
566
|
-
children: [
|
|
567
|
-
c.icon && /* @__PURE__ */ i("span", { className: "bt-action-icon", children: c.icon }),
|
|
568
|
-
/* @__PURE__ */ i("span", { children: c.label })
|
|
569
|
-
]
|
|
570
|
-
},
|
|
571
|
-
c.id
|
|
572
|
-
);
|
|
573
|
-
}) })
|
|
1010
|
+
actions: L,
|
|
1011
|
+
row: e,
|
|
1012
|
+
rowIndex: t,
|
|
1013
|
+
onActionClick: C,
|
|
1014
|
+
direction: "up"
|
|
1015
|
+
}
|
|
1016
|
+
)
|
|
1017
|
+
] })
|
|
574
1018
|
]
|
|
575
1019
|
}
|
|
576
1020
|
);
|
|
577
1021
|
}
|
|
578
|
-
const
|
|
579
|
-
function
|
|
580
|
-
const { processedData: e, rowKey: t } =
|
|
1022
|
+
const Yt = R.memo(Xt);
|
|
1023
|
+
function en() {
|
|
1024
|
+
const { processedData: e, rowKey: t } = $(), l = (i, a) => {
|
|
581
1025
|
if (typeof t == "function")
|
|
582
|
-
return t(
|
|
583
|
-
const
|
|
584
|
-
return String(
|
|
1026
|
+
return t(i, a);
|
|
1027
|
+
const o = i[t];
|
|
1028
|
+
return String(o !== void 0 ? o : a);
|
|
585
1029
|
};
|
|
586
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ n("div", { className: "bt-cards", children: e.map((i, a) => /* @__PURE__ */ n(Yt, { row: i, rowIndex: a }, l(i, a))) });
|
|
1031
|
+
}
|
|
1032
|
+
const tn = en;
|
|
1033
|
+
function et() {
|
|
1034
|
+
return /* @__PURE__ */ n("svg", { className: "bt-fp-icon", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M1.5 2H10.5L7 5.87V9.5L5 8.5V5.87L1.5 2Z", stroke: "currentColor", strokeWidth: "1.2", strokeLinejoin: "round" }) });
|
|
587
1035
|
}
|
|
588
|
-
|
|
589
|
-
|
|
1036
|
+
function nn({
|
|
1037
|
+
open: e
|
|
1038
|
+
}) {
|
|
1039
|
+
const { columns: t, filters: l, setFilter: i, clearFilter: a, clearFilters: o, locale: s } = $(), d = t.filter(
|
|
1040
|
+
(r) => r.filterable !== !1 && r.type !== "custom" && !r.hidden
|
|
1041
|
+
);
|
|
1042
|
+
if (!e || d.length === 0)
|
|
1043
|
+
return null;
|
|
1044
|
+
const c = Object.keys(l).length;
|
|
1045
|
+
return /* @__PURE__ */ g("div", { className: "bt-filter-panel", role: "region", "aria-label": s.filterBy, children: [
|
|
1046
|
+
/* @__PURE__ */ n("div", { className: "bt-filter-panel-grid", children: d.map((r) => /* @__PURE__ */ n(
|
|
1047
|
+
rn,
|
|
1048
|
+
{
|
|
1049
|
+
column: r,
|
|
1050
|
+
value: l[r.id],
|
|
1051
|
+
setFilter: i,
|
|
1052
|
+
clearFilter: a,
|
|
1053
|
+
locale: s
|
|
1054
|
+
},
|
|
1055
|
+
r.id
|
|
1056
|
+
)) }),
|
|
1057
|
+
c > 0 && /* @__PURE__ */ n("div", { className: "bt-filter-panel-footer", children: /* @__PURE__ */ n(
|
|
1058
|
+
"button",
|
|
1059
|
+
{
|
|
1060
|
+
className: "bt-filter-panel-clear",
|
|
1061
|
+
onClick: o,
|
|
1062
|
+
type: "button",
|
|
1063
|
+
children: s.clearFilters
|
|
1064
|
+
}
|
|
1065
|
+
) })
|
|
1066
|
+
] });
|
|
1067
|
+
}
|
|
1068
|
+
function ln({
|
|
1069
|
+
column: e,
|
|
1070
|
+
value: t,
|
|
1071
|
+
setFilter: l,
|
|
1072
|
+
locale: i
|
|
1073
|
+
}) {
|
|
1074
|
+
const a = w(
|
|
1075
|
+
(h) => {
|
|
1076
|
+
const b = h.target.value;
|
|
1077
|
+
e.type === "boolean" ? b === "" ? l(e.id, null) : l(e.id, b === "true") : l(e.id, b || null);
|
|
1078
|
+
},
|
|
1079
|
+
[e.id, e.type, l]
|
|
1080
|
+
), o = w(
|
|
1081
|
+
(h, b) => {
|
|
1082
|
+
const m = { ...t ?? {}, [h]: b || void 0 };
|
|
1083
|
+
l(e.id, m);
|
|
1084
|
+
},
|
|
1085
|
+
[e.id, t, l]
|
|
1086
|
+
), s = t != null && t !== "", d = s && typeof t == "object" && ("from" in t || "to" in t) && !!(t.from || t.to), c = e.type === "date" ? d : s, r = () => {
|
|
1087
|
+
const h = `bt-filter-${e.id}`;
|
|
1088
|
+
if (e.type === "boolean")
|
|
1089
|
+
return /* @__PURE__ */ g("div", { className: x("bt-fp-wrapper", c && "bt-fp-active"), children: [
|
|
1090
|
+
/* @__PURE__ */ n(et, {}),
|
|
1091
|
+
/* @__PURE__ */ g(
|
|
1092
|
+
"select",
|
|
1093
|
+
{
|
|
1094
|
+
id: h,
|
|
1095
|
+
name: h,
|
|
1096
|
+
className: "bt-filter-select",
|
|
1097
|
+
value: t == null ? "" : String(t),
|
|
1098
|
+
onChange: a,
|
|
1099
|
+
"aria-label": `${i.filterBy} ${e.header}`,
|
|
1100
|
+
children: [
|
|
1101
|
+
/* @__PURE__ */ n("option", { value: "", children: "—" }),
|
|
1102
|
+
/* @__PURE__ */ n("option", { value: "true", children: "✅" }),
|
|
1103
|
+
/* @__PURE__ */ n("option", { value: "false", children: "❌" })
|
|
1104
|
+
]
|
|
1105
|
+
}
|
|
1106
|
+
)
|
|
1107
|
+
] });
|
|
1108
|
+
if (e.type === "date") {
|
|
1109
|
+
const b = t ?? {};
|
|
1110
|
+
return /* @__PURE__ */ g("div", { className: x("bt-fp-wrapper bt-filter-field-dates", c && "bt-fp-active"), children: [
|
|
1111
|
+
/* @__PURE__ */ n(
|
|
1112
|
+
"input",
|
|
1113
|
+
{
|
|
1114
|
+
id: `${h}-from`,
|
|
1115
|
+
name: `${h}-from`,
|
|
1116
|
+
type: "date",
|
|
1117
|
+
className: "bt-filter-input",
|
|
1118
|
+
value: b.from ?? "",
|
|
1119
|
+
onChange: (u) => o("from", u.target.value),
|
|
1120
|
+
"aria-label": `${i.dateFrom} ${e.header}`,
|
|
1121
|
+
placeholder: i.dateFrom
|
|
1122
|
+
}
|
|
1123
|
+
),
|
|
1124
|
+
/* @__PURE__ */ n("span", { className: "bt-filter-field-separator", children: "–" }),
|
|
1125
|
+
/* @__PURE__ */ n(
|
|
1126
|
+
"input",
|
|
1127
|
+
{
|
|
1128
|
+
id: `${h}-to`,
|
|
1129
|
+
name: `${h}-to`,
|
|
1130
|
+
type: "date",
|
|
1131
|
+
className: "bt-filter-input",
|
|
1132
|
+
value: b.to ?? "",
|
|
1133
|
+
onChange: (u) => o("to", u.target.value),
|
|
1134
|
+
"aria-label": `${i.dateTo} ${e.header}`,
|
|
1135
|
+
placeholder: i.dateTo
|
|
1136
|
+
}
|
|
1137
|
+
)
|
|
1138
|
+
] });
|
|
1139
|
+
}
|
|
1140
|
+
return /* @__PURE__ */ g("div", { className: x("bt-fp-wrapper", c && "bt-fp-active"), children: [
|
|
1141
|
+
/* @__PURE__ */ n(et, {}),
|
|
1142
|
+
/* @__PURE__ */ n(
|
|
1143
|
+
"input",
|
|
1144
|
+
{
|
|
1145
|
+
id: h,
|
|
1146
|
+
name: h,
|
|
1147
|
+
type: e.type === "number" ? "number" : "text",
|
|
1148
|
+
className: "bt-filter-input",
|
|
1149
|
+
placeholder: "...",
|
|
1150
|
+
value: t != null ? String(t) : "",
|
|
1151
|
+
onChange: a,
|
|
1152
|
+
"aria-label": `${i.filterBy} ${e.header}`
|
|
1153
|
+
}
|
|
1154
|
+
)
|
|
1155
|
+
] });
|
|
1156
|
+
};
|
|
1157
|
+
return /* @__PURE__ */ g("div", { className: x("bt-filter-field", c && "bt-filter-field-active"), children: [
|
|
1158
|
+
/* @__PURE__ */ n("label", { className: "bt-filter-field-label", htmlFor: `bt-filter-${e.id}`, children: e.header }),
|
|
1159
|
+
r()
|
|
1160
|
+
] });
|
|
1161
|
+
}
|
|
1162
|
+
const rn = R.memo(ln), an = R.memo(
|
|
1163
|
+
nn
|
|
1164
|
+
);
|
|
1165
|
+
function sn() {
|
|
1166
|
+
return /* @__PURE__ */ g("svg", { className: "bt-columns-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1167
|
+
/* @__PURE__ */ n("rect", { x: "1.5", y: "2", width: "4", height: "10", rx: "1", stroke: "currentColor", strokeWidth: "1.3" }),
|
|
1168
|
+
/* @__PURE__ */ n("rect", { x: "8.5", y: "2", width: "4", height: "10", rx: "1", stroke: "currentColor", strokeWidth: "1.3" })
|
|
1169
|
+
] });
|
|
1170
|
+
}
|
|
1171
|
+
function on() {
|
|
1172
|
+
return /* @__PURE__ */ n("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1173
|
+
}
|
|
1174
|
+
function cn() {
|
|
1175
|
+
const {
|
|
1176
|
+
columns: e,
|
|
1177
|
+
hiddenColumnIds: t,
|
|
1178
|
+
toggleColumn: l,
|
|
1179
|
+
showAllColumns: i,
|
|
1180
|
+
isColumnVisible: a,
|
|
1181
|
+
locale: o,
|
|
1182
|
+
columnVisibilityEnabled: s
|
|
1183
|
+
} = $(), [d, c] = M(!1), r = V(null), h = V(null), b = t.size;
|
|
1184
|
+
B(() => {
|
|
1185
|
+
if (!d) return;
|
|
1186
|
+
const v = (k) => {
|
|
1187
|
+
r.current && !r.current.contains(k.target) && c(!1);
|
|
1188
|
+
}, N = (k) => {
|
|
1189
|
+
k.key === "Escape" && (c(!1), h.current?.focus());
|
|
1190
|
+
};
|
|
1191
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", N), () => {
|
|
1192
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", N);
|
|
1193
|
+
};
|
|
1194
|
+
}, [d]);
|
|
1195
|
+
const u = w(() => {
|
|
1196
|
+
c((v) => !v);
|
|
1197
|
+
}, []);
|
|
1198
|
+
if (!s) return null;
|
|
1199
|
+
const m = e.filter((v) => v.type !== "custom");
|
|
1200
|
+
return /* @__PURE__ */ g("div", { className: "bt-column-visibility", ref: r, children: [
|
|
1201
|
+
/* @__PURE__ */ g(
|
|
1202
|
+
"button",
|
|
1203
|
+
{
|
|
1204
|
+
ref: h,
|
|
1205
|
+
className: x("bt-column-visibility-btn", d && "bt-column-visibility-btn-active"),
|
|
1206
|
+
onClick: u,
|
|
1207
|
+
"aria-expanded": d,
|
|
1208
|
+
"aria-haspopup": "true",
|
|
1209
|
+
"aria-label": o.columns,
|
|
1210
|
+
title: o.columns,
|
|
1211
|
+
type: "button",
|
|
1212
|
+
children: [
|
|
1213
|
+
/* @__PURE__ */ n(sn, {}),
|
|
1214
|
+
/* @__PURE__ */ n("span", { className: "bt-column-visibility-label", children: o.columns }),
|
|
1215
|
+
b > 0 && /* @__PURE__ */ n("span", { className: "bt-column-visibility-badge", children: b })
|
|
1216
|
+
]
|
|
1217
|
+
}
|
|
1218
|
+
),
|
|
1219
|
+
d && /* @__PURE__ */ g("div", { className: "bt-column-visibility-dropdown", role: "menu", children: [
|
|
1220
|
+
/* @__PURE__ */ g("div", { className: "bt-column-visibility-header", children: [
|
|
1221
|
+
/* @__PURE__ */ n("span", { className: "bt-column-visibility-title", children: o.columns }),
|
|
1222
|
+
b > 0 && /* @__PURE__ */ n(
|
|
1223
|
+
"button",
|
|
1224
|
+
{
|
|
1225
|
+
className: "bt-column-visibility-show-all",
|
|
1226
|
+
onClick: i,
|
|
1227
|
+
type: "button",
|
|
1228
|
+
children: o.showAllColumns
|
|
1229
|
+
}
|
|
1230
|
+
)
|
|
1231
|
+
] }),
|
|
1232
|
+
/* @__PURE__ */ n("div", { className: "bt-column-visibility-list", children: m.map((v) => {
|
|
1233
|
+
const N = a(v.id);
|
|
1234
|
+
return /* @__PURE__ */ g(
|
|
1235
|
+
"button",
|
|
1236
|
+
{
|
|
1237
|
+
className: x(
|
|
1238
|
+
"bt-column-visibility-item",
|
|
1239
|
+
!N && "bt-column-visibility-item-hidden"
|
|
1240
|
+
),
|
|
1241
|
+
onClick: () => l(v.id),
|
|
1242
|
+
role: "menuitemcheckbox",
|
|
1243
|
+
"aria-checked": N,
|
|
1244
|
+
type: "button",
|
|
1245
|
+
children: [
|
|
1246
|
+
/* @__PURE__ */ n("span", { className: x("bt-column-visibility-check", N && "bt-column-visibility-check-active"), children: N && /* @__PURE__ */ n(on, {}) }),
|
|
1247
|
+
/* @__PURE__ */ n("span", { className: "bt-column-visibility-item-label", children: v.header })
|
|
1248
|
+
]
|
|
1249
|
+
},
|
|
1250
|
+
v.id
|
|
1251
|
+
);
|
|
1252
|
+
}) })
|
|
1253
|
+
] })
|
|
1254
|
+
] });
|
|
1255
|
+
}
|
|
1256
|
+
const dn = cn;
|
|
1257
|
+
function hn() {
|
|
1258
|
+
return /* @__PURE__ */ n("svg", { className: "bt-pagination-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M9 3L5 7L9 11", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1259
|
+
}
|
|
1260
|
+
function bn() {
|
|
1261
|
+
return /* @__PURE__ */ n("svg", { className: "bt-pagination-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M5 3L9 7L5 11", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1262
|
+
}
|
|
1263
|
+
function un() {
|
|
590
1264
|
const {
|
|
591
1265
|
page: e,
|
|
592
1266
|
pageSize: t,
|
|
593
1267
|
totalPages: l,
|
|
594
|
-
totalItems:
|
|
595
|
-
goToPage:
|
|
596
|
-
nextPage:
|
|
597
|
-
prevPage:
|
|
598
|
-
changePageSize:
|
|
599
|
-
hasNextPage:
|
|
600
|
-
hasPrevPage:
|
|
601
|
-
startIndex:
|
|
602
|
-
endIndex:
|
|
603
|
-
paginationEnabled:
|
|
604
|
-
pageSizeOptions:
|
|
1268
|
+
totalItems: i,
|
|
1269
|
+
goToPage: a,
|
|
1270
|
+
nextPage: o,
|
|
1271
|
+
prevPage: s,
|
|
1272
|
+
changePageSize: d,
|
|
1273
|
+
hasNextPage: c,
|
|
1274
|
+
hasPrevPage: r,
|
|
1275
|
+
startIndex: h,
|
|
1276
|
+
endIndex: b,
|
|
1277
|
+
paginationEnabled: u,
|
|
1278
|
+
pageSizeOptions: m,
|
|
605
1279
|
showSizeChanger: v,
|
|
606
1280
|
locale: N,
|
|
607
|
-
classNames:
|
|
608
|
-
} =
|
|
609
|
-
(
|
|
610
|
-
|
|
1281
|
+
classNames: k
|
|
1282
|
+
} = $(), L = w(
|
|
1283
|
+
(f) => {
|
|
1284
|
+
d(Number(f.target.value));
|
|
611
1285
|
},
|
|
612
|
-
[
|
|
613
|
-
),
|
|
614
|
-
(
|
|
615
|
-
if (
|
|
616
|
-
const
|
|
617
|
-
!isNaN(
|
|
1286
|
+
[d]
|
|
1287
|
+
), S = w(
|
|
1288
|
+
(f) => {
|
|
1289
|
+
if (f.key === "Enter") {
|
|
1290
|
+
const C = parseInt(f.target.value, 10);
|
|
1291
|
+
!isNaN(C) && C >= 1 && C <= l && a(C);
|
|
618
1292
|
}
|
|
619
1293
|
},
|
|
620
|
-
[
|
|
621
|
-
),
|
|
622
|
-
const
|
|
1294
|
+
[a, l]
|
|
1295
|
+
), y = I(() => {
|
|
1296
|
+
const f = [];
|
|
623
1297
|
if (l <= 5)
|
|
624
|
-
for (let
|
|
625
|
-
|
|
1298
|
+
for (let A = 1; A <= l; A++)
|
|
1299
|
+
f.push(A);
|
|
626
1300
|
else {
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
for (let
|
|
630
|
-
|
|
631
|
-
e < l - 2 &&
|
|
1301
|
+
f.push(1), e > 3 && f.push("ellipsis");
|
|
1302
|
+
const A = Math.max(2, e - 1), D = Math.min(l - 1, e + 1);
|
|
1303
|
+
for (let p = A; p <= D; p++)
|
|
1304
|
+
f.push(p);
|
|
1305
|
+
e < l - 2 && f.push("ellipsis"), l > 1 && f.push(l);
|
|
632
1306
|
}
|
|
633
|
-
return
|
|
1307
|
+
return f;
|
|
634
1308
|
}, [e, l]);
|
|
635
|
-
return
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
-
v && /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
1309
|
+
return u ? /* @__PURE__ */ g("div", { className: `bt-pagination ${k.pagination || ""}`, children: [
|
|
1310
|
+
/* @__PURE__ */ n("div", { className: "bt-pagination-info", children: i > 0 ? `${h}-${b} ${N.of} ${i} ${N.items}` : `0 ${N.items}` }),
|
|
1311
|
+
/* @__PURE__ */ g("div", { className: "bt-pagination-controls", children: [
|
|
1312
|
+
v && /* @__PURE__ */ g("div", { className: "bt-page-size", children: [
|
|
1313
|
+
/* @__PURE__ */ g("label", { className: "bt-page-size-label", htmlFor: "bt-page-size", children: [
|
|
640
1314
|
N.rowsPerPage,
|
|
641
1315
|
":"
|
|
642
1316
|
] }),
|
|
643
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ n(
|
|
644
1318
|
"select",
|
|
645
1319
|
{
|
|
1320
|
+
id: "bt-page-size",
|
|
1321
|
+
name: "bt-page-size",
|
|
646
1322
|
className: "bt-page-size-select",
|
|
647
1323
|
value: t,
|
|
648
|
-
onChange:
|
|
1324
|
+
onChange: L,
|
|
649
1325
|
"aria-label": N.rowsPerPage,
|
|
650
|
-
children:
|
|
1326
|
+
children: m.map((f) => /* @__PURE__ */ n("option", { value: f, children: f }, f))
|
|
651
1327
|
}
|
|
652
1328
|
)
|
|
653
1329
|
] }),
|
|
654
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ n(
|
|
655
1331
|
"button",
|
|
656
1332
|
{
|
|
657
1333
|
className: "bt-pagination-btn",
|
|
658
|
-
onClick:
|
|
659
|
-
disabled: !
|
|
660
|
-
"aria-label":
|
|
1334
|
+
onClick: s,
|
|
1335
|
+
disabled: !r,
|
|
1336
|
+
"aria-label": N.previousPage,
|
|
661
1337
|
type: "button",
|
|
662
|
-
children:
|
|
1338
|
+
children: /* @__PURE__ */ n(hn, {})
|
|
663
1339
|
}
|
|
664
1340
|
),
|
|
665
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ n("div", { className: "bt-pagination-pages", children: y.map((f, C) => f === "ellipsis" ? /* @__PURE__ */ n("span", { className: "bt-pagination-ellipsis", children: "..." }, `ellipsis-${C}`) : /* @__PURE__ */ n(
|
|
666
1342
|
"button",
|
|
667
1343
|
{
|
|
668
|
-
className: `bt-pagination-btn ${e ===
|
|
669
|
-
onClick: () =>
|
|
670
|
-
"aria-label": `${N.page} ${
|
|
671
|
-
"aria-current": e ===
|
|
1344
|
+
className: `bt-pagination-btn ${e === f ? "bt-active" : ""}`,
|
|
1345
|
+
onClick: () => a(f),
|
|
1346
|
+
"aria-label": `${N.page} ${f}`,
|
|
1347
|
+
"aria-current": e === f ? "page" : void 0,
|
|
672
1348
|
type: "button",
|
|
673
|
-
children:
|
|
1349
|
+
children: f
|
|
674
1350
|
},
|
|
675
|
-
|
|
1351
|
+
f
|
|
676
1352
|
)) }),
|
|
677
|
-
/* @__PURE__ */
|
|
1353
|
+
/* @__PURE__ */ n(
|
|
678
1354
|
"button",
|
|
679
1355
|
{
|
|
680
1356
|
className: "bt-pagination-btn",
|
|
681
|
-
onClick:
|
|
682
|
-
disabled: !
|
|
683
|
-
"aria-label":
|
|
1357
|
+
onClick: o,
|
|
1358
|
+
disabled: !c,
|
|
1359
|
+
"aria-label": N.nextPage,
|
|
684
1360
|
type: "button",
|
|
685
|
-
children:
|
|
1361
|
+
children: /* @__PURE__ */ n(bn, {})
|
|
686
1362
|
}
|
|
687
1363
|
),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ g("div", { className: "bt-quick-jumper", children: [
|
|
1365
|
+
/* @__PURE__ */ g("label", { className: "bt-quick-jumper-label", htmlFor: "bt-quick-jumper", children: [
|
|
690
1366
|
N.page,
|
|
691
1367
|
":"
|
|
692
1368
|
] }),
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
1369
|
+
/* @__PURE__ */ g("div", { className: "bt-qj-wrapper", children: [
|
|
1370
|
+
/* @__PURE__ */ n(
|
|
1371
|
+
"input",
|
|
1372
|
+
{
|
|
1373
|
+
id: "bt-quick-jumper",
|
|
1374
|
+
name: "bt-quick-jumper",
|
|
1375
|
+
type: "number",
|
|
1376
|
+
className: "bt-quick-jumper-input",
|
|
1377
|
+
min: 1,
|
|
1378
|
+
max: l,
|
|
1379
|
+
defaultValue: e,
|
|
1380
|
+
onKeyDown: S,
|
|
1381
|
+
"aria-label": N.jumpToPage
|
|
1382
|
+
},
|
|
1383
|
+
e
|
|
1384
|
+
),
|
|
1385
|
+
/* @__PURE__ */ n("span", { className: "bt-qj-hint", "aria-hidden": "true", children: "↵" })
|
|
1386
|
+
] })
|
|
705
1387
|
] })
|
|
706
1388
|
] })
|
|
707
1389
|
] }) : null;
|
|
708
1390
|
}
|
|
709
|
-
function
|
|
1391
|
+
function ot(e) {
|
|
1392
|
+
const [t, l] = M(() => typeof window > "u" ? !1 : window.matchMedia(e).matches);
|
|
1393
|
+
return B(() => {
|
|
1394
|
+
if (typeof window > "u") return;
|
|
1395
|
+
const i = window.matchMedia(e);
|
|
1396
|
+
l(i.matches);
|
|
1397
|
+
const a = (o) => l(o.matches);
|
|
1398
|
+
return i.addEventListener("change", a), () => i.removeEventListener("change", a);
|
|
1399
|
+
}, [e]), t;
|
|
1400
|
+
}
|
|
1401
|
+
function tt() {
|
|
1402
|
+
return /* @__PURE__ */ g("svg", { className: "bt-search-svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1403
|
+
/* @__PURE__ */ n("circle", { cx: "6", cy: "6", r: "4.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1404
|
+
/* @__PURE__ */ n("path", { d: "M9.5 9.5L13 13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1405
|
+
] });
|
|
1406
|
+
}
|
|
1407
|
+
function nt() {
|
|
1408
|
+
return /* @__PURE__ */ n("svg", { className: "bt-clear-svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M3 3L9 9M9 3L3 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
|
|
1409
|
+
}
|
|
1410
|
+
function fn() {
|
|
1411
|
+
return /* @__PURE__ */ n("svg", { className: "bt-check-svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1412
|
+
}
|
|
1413
|
+
function pn() {
|
|
1414
|
+
return /* @__PURE__ */ n("svg", { className: "bt-filter-toggle-svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M1 2.5H11L7.5 6.5V10L4.5 9V6.5L1 2.5Z", stroke: "currentColor", strokeWidth: "1.2", strokeLinejoin: "round" }) });
|
|
1415
|
+
}
|
|
1416
|
+
function mn() {
|
|
710
1417
|
const {
|
|
711
1418
|
searchable: e,
|
|
712
1419
|
searchValue: t,
|
|
713
1420
|
handleSearch: l,
|
|
714
|
-
clearSearch:
|
|
715
|
-
globalActions:
|
|
716
|
-
selectedRows:
|
|
717
|
-
selectedCount:
|
|
718
|
-
deselectAll:
|
|
719
|
-
data:
|
|
720
|
-
locale:
|
|
721
|
-
classNames:
|
|
722
|
-
selectable:
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
1421
|
+
clearSearch: i,
|
|
1422
|
+
globalActions: a,
|
|
1423
|
+
selectedRows: o,
|
|
1424
|
+
selectedCount: s,
|
|
1425
|
+
deselectAll: d,
|
|
1426
|
+
data: c,
|
|
1427
|
+
locale: r,
|
|
1428
|
+
classNames: h,
|
|
1429
|
+
selectable: b,
|
|
1430
|
+
filters: u,
|
|
1431
|
+
filterPanelOpen: m,
|
|
1432
|
+
toggleFilterPanel: v,
|
|
1433
|
+
hasFilterableColumns: N,
|
|
1434
|
+
filterMode: k,
|
|
1435
|
+
columnVisibilityEnabled: L
|
|
1436
|
+
} = $(), S = ot("(max-width: 640px)"), [y, f] = M(!1), C = V(null), A = Object.keys(u).length, D = w(
|
|
1437
|
+
(T) => {
|
|
1438
|
+
l(T.target.value);
|
|
726
1439
|
},
|
|
727
1440
|
[l]
|
|
728
|
-
)
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1441
|
+
), p = w(() => {
|
|
1442
|
+
f((T) => (T ? t && i() : setTimeout(() => C.current?.focus(), 50), !T));
|
|
1443
|
+
}, [t, i]);
|
|
1444
|
+
B(() => {
|
|
1445
|
+
t && !y && f(!0);
|
|
1446
|
+
}, [t, y]);
|
|
1447
|
+
const P = N && (k === "panel" || k === "both");
|
|
1448
|
+
if (!(e || P || L || a && a.length > 0 || b && s > 0))
|
|
1449
|
+
return null;
|
|
1450
|
+
const z = S && e && !y, H = e && (!S || y);
|
|
1451
|
+
return /* @__PURE__ */ g("div", { className: x("bt-toolbar", h.toolbar), children: [
|
|
1452
|
+
/* @__PURE__ */ g("div", { className: "bt-toolbar-left", children: [
|
|
1453
|
+
z && /* @__PURE__ */ n(
|
|
1454
|
+
"button",
|
|
1455
|
+
{
|
|
1456
|
+
className: "bt-search-toggle",
|
|
1457
|
+
onClick: p,
|
|
1458
|
+
"aria-label": r.search,
|
|
1459
|
+
title: r.search,
|
|
1460
|
+
type: "button",
|
|
1461
|
+
children: /* @__PURE__ */ n(tt, {})
|
|
1462
|
+
}
|
|
1463
|
+
),
|
|
1464
|
+
H && /* @__PURE__ */ g("div", { className: x("bt-search", S && "bt-search-mobile"), children: [
|
|
1465
|
+
/* @__PURE__ */ n("span", { className: "bt-search-icon", children: /* @__PURE__ */ n(tt, {}) }),
|
|
1466
|
+
/* @__PURE__ */ n(
|
|
734
1467
|
"input",
|
|
735
1468
|
{
|
|
1469
|
+
id: "bt-search",
|
|
1470
|
+
name: "bt-search",
|
|
1471
|
+
ref: C,
|
|
736
1472
|
type: "text",
|
|
737
1473
|
className: "bt-search-input",
|
|
738
|
-
placeholder:
|
|
1474
|
+
placeholder: r.searchPlaceholder,
|
|
739
1475
|
value: t,
|
|
740
|
-
onChange:
|
|
741
|
-
"aria-label":
|
|
1476
|
+
onChange: D,
|
|
1477
|
+
"aria-label": r.search
|
|
742
1478
|
}
|
|
743
1479
|
),
|
|
744
|
-
t && /* @__PURE__ */
|
|
1480
|
+
(t || S) && /* @__PURE__ */ n(
|
|
745
1481
|
"button",
|
|
746
1482
|
{
|
|
747
1483
|
className: "bt-search-clear",
|
|
748
|
-
onClick:
|
|
749
|
-
"aria-label":
|
|
1484
|
+
onClick: S ? p : i,
|
|
1485
|
+
"aria-label": r.clearSearch,
|
|
750
1486
|
type: "button",
|
|
751
|
-
children:
|
|
1487
|
+
children: /* @__PURE__ */ n(nt, {})
|
|
752
1488
|
}
|
|
753
1489
|
)
|
|
754
1490
|
] }),
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
1491
|
+
P && /* @__PURE__ */ g(
|
|
1492
|
+
"button",
|
|
1493
|
+
{
|
|
1494
|
+
className: x(
|
|
1495
|
+
"bt-filter-toggle",
|
|
1496
|
+
m && "bt-filter-toggle-active"
|
|
1497
|
+
),
|
|
1498
|
+
onClick: v,
|
|
1499
|
+
"aria-expanded": m,
|
|
1500
|
+
"aria-label": r.filterBy,
|
|
1501
|
+
title: r.filterBy,
|
|
1502
|
+
type: "button",
|
|
1503
|
+
children: [
|
|
1504
|
+
/* @__PURE__ */ n("span", { className: "bt-filter-toggle-icon", children: /* @__PURE__ */ n(pn, {}) }),
|
|
1505
|
+
!S && /* @__PURE__ */ n("span", { children: r.filterBy }),
|
|
1506
|
+
A > 0 && /* @__PURE__ */ n("span", { className: "bt-filter-toggle-badge", children: A })
|
|
1507
|
+
]
|
|
1508
|
+
}
|
|
1509
|
+
),
|
|
1510
|
+
/* @__PURE__ */ n(dn, {}),
|
|
1511
|
+
b && s > 0 && /* @__PURE__ */ g("div", { className: "bt-selection-info", children: [
|
|
1512
|
+
/* @__PURE__ */ n(fn, {}),
|
|
1513
|
+
/* @__PURE__ */ g("span", { className: "bt-selection-count", children: [
|
|
1514
|
+
s,
|
|
758
1515
|
" ",
|
|
759
|
-
|
|
1516
|
+
S ? "sel." : r.selected
|
|
760
1517
|
] }),
|
|
761
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ n(
|
|
762
1519
|
"button",
|
|
763
1520
|
{
|
|
764
1521
|
className: "bt-selection-clear",
|
|
765
|
-
onClick:
|
|
1522
|
+
onClick: d,
|
|
766
1523
|
type: "button",
|
|
767
|
-
children:
|
|
1524
|
+
children: S ? /* @__PURE__ */ n(nt, {}) : r.deselectAll
|
|
768
1525
|
}
|
|
769
1526
|
)
|
|
770
1527
|
] })
|
|
771
1528
|
] }),
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
return /* @__PURE__ */
|
|
1529
|
+
a && a.length > 0 && /* @__PURE__ */ n("div", { className: "bt-toolbar-right", children: /* @__PURE__ */ n("div", { className: "bt-global-actions", children: a.map((T) => {
|
|
1530
|
+
const q = T.requiresSelection && o.length === 0;
|
|
1531
|
+
return /* @__PURE__ */ g(
|
|
775
1532
|
"button",
|
|
776
1533
|
{
|
|
777
|
-
className:
|
|
1534
|
+
className: x(
|
|
778
1535
|
"bt-global-btn",
|
|
779
|
-
|
|
1536
|
+
T.variant && `bt-variant-${T.variant}`,
|
|
1537
|
+
S && "bt-global-btn-mobile"
|
|
780
1538
|
),
|
|
781
|
-
onClick: () =>
|
|
782
|
-
disabled:
|
|
783
|
-
title:
|
|
1539
|
+
onClick: () => T.onClick(o, c),
|
|
1540
|
+
disabled: q,
|
|
1541
|
+
title: T.label,
|
|
1542
|
+
"aria-label": T.label,
|
|
784
1543
|
type: "button",
|
|
785
1544
|
children: [
|
|
786
|
-
|
|
787
|
-
/* @__PURE__ */
|
|
1545
|
+
T.icon && /* @__PURE__ */ n("span", { className: "bt-global-icon", children: T.icon }),
|
|
1546
|
+
!S && /* @__PURE__ */ n("span", { children: T.label })
|
|
788
1547
|
]
|
|
789
1548
|
},
|
|
790
|
-
|
|
1549
|
+
T.id
|
|
791
1550
|
);
|
|
792
1551
|
}) }) })
|
|
793
|
-
] })
|
|
1552
|
+
] });
|
|
1553
|
+
}
|
|
1554
|
+
const gn = mn;
|
|
1555
|
+
function vn() {
|
|
1556
|
+
return /* @__PURE__ */ g("svg", { className: "bt-empty-svg", width: "64", height: "64", viewBox: "0 0 64 64", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
1557
|
+
/* @__PURE__ */ n("rect", { x: "12", y: "18", width: "40", height: "32", rx: "3", stroke: "currentColor", strokeWidth: "2", opacity: "0.3" }),
|
|
1558
|
+
/* @__PURE__ */ n("path", { d: "M12 28H52", stroke: "currentColor", strokeWidth: "2", opacity: "0.2" }),
|
|
1559
|
+
/* @__PURE__ */ n("path", { d: "M24 38H40", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", opacity: "0.4" }),
|
|
1560
|
+
/* @__PURE__ */ n("path", { d: "M28 44H36", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", opacity: "0.25" }),
|
|
1561
|
+
/* @__PURE__ */ n("circle", { cx: "32", cy: "12", r: "4", stroke: "currentColor", strokeWidth: "2", opacity: "0.2" })
|
|
1562
|
+
] });
|
|
794
1563
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */ i("div", { className: "bt-empty-text", children: e.noData })
|
|
1564
|
+
function yn() {
|
|
1565
|
+
const { locale: e, emptyComponent: t, visibleColumns: l, selectable: i, rowActions: a } = $(), o = a && a.length > 0, s = l.length + (i ? 1 : 0) + (o ? 1 : 0);
|
|
1566
|
+
return t ? /* @__PURE__ */ n("tbody", { className: "bt-tbody", children: /* @__PURE__ */ n("tr", { className: "bt-tr", children: /* @__PURE__ */ n("td", { className: "bt-td", colSpan: s, children: t }) }) }) : /* @__PURE__ */ n("tbody", { className: "bt-tbody", children: /* @__PURE__ */ n("tr", { className: "bt-tr", children: /* @__PURE__ */ n("td", { className: "bt-td", colSpan: s, children: /* @__PURE__ */ g("div", { className: "bt-empty", children: [
|
|
1567
|
+
/* @__PURE__ */ n("div", { className: "bt-empty-icon", children: /* @__PURE__ */ n(vn, {}) }),
|
|
1568
|
+
/* @__PURE__ */ n("div", { className: "bt-empty-text", children: e.noData })
|
|
801
1569
|
] }) }) }) });
|
|
802
1570
|
}
|
|
803
|
-
function
|
|
804
|
-
const { loadingComponent: t, locale: l } =
|
|
805
|
-
return e ? /* @__PURE__ */
|
|
806
|
-
/* @__PURE__ */
|
|
807
|
-
/* @__PURE__ */
|
|
1571
|
+
function wn({ show: e }) {
|
|
1572
|
+
const { loadingComponent: t, locale: l } = $();
|
|
1573
|
+
return e ? /* @__PURE__ */ n("div", { className: "bt-loading-overlay", role: "status", "aria-live": "polite", children: t || /* @__PURE__ */ g(Ct, { children: [
|
|
1574
|
+
/* @__PURE__ */ n("div", { className: "bt-loading-spinner", "aria-hidden": "true" }),
|
|
1575
|
+
/* @__PURE__ */ n("span", { className: "bt-loading-text", children: l.loading })
|
|
808
1576
|
] }) }) : null;
|
|
809
1577
|
}
|
|
810
|
-
function
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
1578
|
+
function Cn() {
|
|
1579
|
+
return /* @__PURE__ */ n("svg", { className: "bt-modal-close-svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "M4 4L12 12M12 4L4 12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) });
|
|
1580
|
+
}
|
|
1581
|
+
function kn() {
|
|
1582
|
+
const { isModalOpen: e, modalContent: t, closeModal: l, locale: i } = $(), a = w(
|
|
1583
|
+
(s) => {
|
|
1584
|
+
s.target === s.currentTarget && l();
|
|
814
1585
|
},
|
|
815
1586
|
[l]
|
|
816
|
-
),
|
|
817
|
-
(
|
|
818
|
-
|
|
1587
|
+
), o = w(
|
|
1588
|
+
(s) => {
|
|
1589
|
+
s.key === "Escape" && l();
|
|
819
1590
|
},
|
|
820
1591
|
[l]
|
|
821
1592
|
);
|
|
822
|
-
return
|
|
823
|
-
document.removeEventListener("keydown",
|
|
824
|
-
}), [e,
|
|
1593
|
+
return B(() => (e && (document.addEventListener("keydown", o), document.body.style.overflow = "hidden"), () => {
|
|
1594
|
+
document.removeEventListener("keydown", o), document.body.style.overflow = "";
|
|
1595
|
+
}), [e, o]), !e || !t ? null : /* @__PURE__ */ n(
|
|
825
1596
|
"div",
|
|
826
1597
|
{
|
|
827
1598
|
className: "bt-modal-backdrop",
|
|
828
|
-
onClick:
|
|
1599
|
+
onClick: a,
|
|
829
1600
|
role: "dialog",
|
|
830
1601
|
"aria-modal": "true",
|
|
831
|
-
children: /* @__PURE__ */
|
|
832
|
-
/* @__PURE__ */
|
|
833
|
-
/* @__PURE__ */
|
|
834
|
-
/* @__PURE__ */
|
|
1602
|
+
children: /* @__PURE__ */ g("div", { className: "bt-modal bt-modal-md", children: [
|
|
1603
|
+
/* @__PURE__ */ g("div", { className: "bt-modal-header", children: [
|
|
1604
|
+
/* @__PURE__ */ n("h2", { className: "bt-modal-title", children: i.details }),
|
|
1605
|
+
/* @__PURE__ */ n(
|
|
835
1606
|
"button",
|
|
836
1607
|
{
|
|
837
1608
|
className: "bt-modal-close",
|
|
838
1609
|
onClick: l,
|
|
839
|
-
"aria-label":
|
|
1610
|
+
"aria-label": i.closeModal,
|
|
840
1611
|
type: "button",
|
|
841
|
-
children:
|
|
1612
|
+
children: /* @__PURE__ */ n(Cn, {})
|
|
842
1613
|
}
|
|
843
1614
|
)
|
|
844
1615
|
] }),
|
|
845
|
-
/* @__PURE__ */
|
|
1616
|
+
/* @__PURE__ */ n("div", { className: "bt-modal-body", children: t })
|
|
846
1617
|
] })
|
|
847
1618
|
}
|
|
848
1619
|
);
|
|
849
1620
|
}
|
|
850
|
-
function
|
|
1621
|
+
function Nn({
|
|
851
1622
|
data: e,
|
|
852
1623
|
initialSort: t,
|
|
853
1624
|
controlledSort: l,
|
|
854
|
-
onSortChange:
|
|
1625
|
+
onSortChange: i,
|
|
1626
|
+
multiSort: a = !1,
|
|
1627
|
+
controlledMultiSort: o,
|
|
1628
|
+
onMultiSortChange: s
|
|
855
1629
|
}) {
|
|
856
|
-
const [
|
|
1630
|
+
const [d, c] = M(
|
|
857
1631
|
t ?? { columnId: null, direction: "asc" }
|
|
858
|
-
), r
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
1632
|
+
), [r, h] = M(
|
|
1633
|
+
[]
|
|
1634
|
+
), b = l ?? d, u = o ?? r, m = w(
|
|
1635
|
+
(k) => {
|
|
1636
|
+
if (a) {
|
|
1637
|
+
const L = u.findIndex(
|
|
1638
|
+
(C) => C.columnId === k
|
|
1639
|
+
);
|
|
1640
|
+
let S;
|
|
1641
|
+
L >= 0 ? u[L].direction === "asc" ? (S = [...u], S[L] = {
|
|
1642
|
+
columnId: k,
|
|
1643
|
+
direction: "desc"
|
|
1644
|
+
}) : S = u.filter((A, D) => D !== L) : S = [...u, { columnId: k, direction: "asc" }], o || h(S), s?.(S);
|
|
1645
|
+
const y = S[0], f = y ? { columnId: y.columnId, direction: y.direction } : { columnId: null, direction: "asc" };
|
|
1646
|
+
l || c(f), i?.(f);
|
|
1647
|
+
} else {
|
|
1648
|
+
let L;
|
|
1649
|
+
b.columnId !== k ? L = { columnId: k, direction: "asc" } : b.direction === "asc" ? L = { columnId: k, direction: "desc" } : L = { columnId: null, direction: "asc" }, l || c(L), i?.(L);
|
|
1650
|
+
}
|
|
865
1651
|
},
|
|
866
|
-
[
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
1652
|
+
[
|
|
1653
|
+
b,
|
|
1654
|
+
u,
|
|
1655
|
+
l,
|
|
1656
|
+
o,
|
|
1657
|
+
i,
|
|
1658
|
+
s,
|
|
1659
|
+
a
|
|
1660
|
+
]
|
|
1661
|
+
), v = w(() => {
|
|
1662
|
+
const k = { columnId: null, direction: "asc" };
|
|
1663
|
+
l || c(k), i?.(k), a && (o || h([]), s?.([]));
|
|
1664
|
+
}, [
|
|
1665
|
+
l,
|
|
1666
|
+
o,
|
|
1667
|
+
i,
|
|
1668
|
+
s,
|
|
1669
|
+
a
|
|
1670
|
+
]);
|
|
1671
|
+
return {
|
|
1672
|
+
sortedData: I(() => a && u.length > 0 ? jt(e, u) : b.columnId ? Et(e, b.columnId, b.direction) : e, [e, b, u, a]),
|
|
1673
|
+
sortState: b,
|
|
1674
|
+
handleSort: m,
|
|
1675
|
+
clearSort: v,
|
|
1676
|
+
multiSortState: u,
|
|
1677
|
+
isMultiSort: a
|
|
1678
|
+
};
|
|
872
1679
|
}
|
|
873
|
-
function
|
|
1680
|
+
function Sn({
|
|
874
1681
|
data: e,
|
|
875
1682
|
columns: t,
|
|
876
1683
|
initialFilters: l,
|
|
877
|
-
controlledFilters:
|
|
878
|
-
onFilterChange:
|
|
1684
|
+
controlledFilters: i,
|
|
1685
|
+
onFilterChange: a
|
|
879
1686
|
}) {
|
|
880
|
-
const [
|
|
1687
|
+
const [o, s] = M(
|
|
881
1688
|
l ?? {}
|
|
882
|
-
),
|
|
883
|
-
(
|
|
884
|
-
const v = { ...
|
|
885
|
-
|
|
1689
|
+
), d = i ?? o, c = w(
|
|
1690
|
+
(u, m) => {
|
|
1691
|
+
const v = { ...d };
|
|
1692
|
+
if (m !== null && typeof m == "object" && "from" in m) {
|
|
1693
|
+
const N = m;
|
|
1694
|
+
!N.from && !N.to ? delete v[u] : v[u] = m;
|
|
1695
|
+
} else m == null || m === "" ? delete v[u] : v[u] = m;
|
|
1696
|
+
i || s(v), a?.(v);
|
|
886
1697
|
},
|
|
887
|
-
[
|
|
888
|
-
),
|
|
889
|
-
(
|
|
890
|
-
const
|
|
891
|
-
delete u
|
|
1698
|
+
[d, i, a]
|
|
1699
|
+
), r = w(
|
|
1700
|
+
(u) => {
|
|
1701
|
+
const m = { ...d };
|
|
1702
|
+
delete m[u], i || s(m), a?.(m);
|
|
892
1703
|
},
|
|
893
|
-
[
|
|
894
|
-
),
|
|
895
|
-
|
|
896
|
-
}, [
|
|
897
|
-
return { filteredData:
|
|
1704
|
+
[d, i, a]
|
|
1705
|
+
), h = w(() => {
|
|
1706
|
+
i || s({}), a?.({});
|
|
1707
|
+
}, [i, a]);
|
|
1708
|
+
return { filteredData: I(() => Ot(e, d, t), [e, d, t]), filters: d, setFilter: c, clearFilters: h, clearFilter: r };
|
|
898
1709
|
}
|
|
899
|
-
function
|
|
1710
|
+
function Pn({
|
|
900
1711
|
data: e,
|
|
901
1712
|
config: t,
|
|
902
1713
|
onPageChange: l
|
|
903
1714
|
}) {
|
|
904
|
-
const
|
|
905
|
-
(
|
|
906
|
-
const
|
|
907
|
-
|
|
1715
|
+
const i = t !== !1, a = t && typeof t == "object" ? t.page ?? 1 : 1, o = t && typeof t == "object" ? t.pageSize ?? 10 : 10, s = t && typeof t == "object" ? t.totalItems : void 0, [d, c] = M(a), [r, h] = M(o), b = s ?? e.length, u = Math.max(1, Math.ceil(b / r)), m = w(
|
|
1716
|
+
(f) => {
|
|
1717
|
+
const C = Math.max(1, Math.min(f, u));
|
|
1718
|
+
c(C), l?.(C, r);
|
|
908
1719
|
},
|
|
909
|
-
[
|
|
910
|
-
), v =
|
|
911
|
-
|
|
912
|
-
}, [
|
|
913
|
-
|
|
914
|
-
}, [
|
|
915
|
-
(
|
|
916
|
-
f
|
|
1720
|
+
[u, r, l]
|
|
1721
|
+
), v = w(() => {
|
|
1722
|
+
d < u && m(d + 1);
|
|
1723
|
+
}, [d, u, m]), N = w(() => {
|
|
1724
|
+
d > 1 && m(d - 1);
|
|
1725
|
+
}, [d, m]), k = w(
|
|
1726
|
+
(f) => {
|
|
1727
|
+
h(f), c(1), l?.(1, f);
|
|
917
1728
|
},
|
|
918
1729
|
[l]
|
|
919
|
-
),
|
|
920
|
-
if (!
|
|
1730
|
+
), L = I(() => {
|
|
1731
|
+
if (!i || s !== void 0)
|
|
921
1732
|
return e;
|
|
922
|
-
const
|
|
923
|
-
return e.slice(
|
|
924
|
-
}, [e,
|
|
1733
|
+
const f = (d - 1) * r;
|
|
1734
|
+
return e.slice(f, f + r);
|
|
1735
|
+
}, [e, d, r, i, s]), S = (d - 1) * r + 1, y = Math.min(d * r, b);
|
|
925
1736
|
return {
|
|
926
|
-
paginatedData:
|
|
927
|
-
page:
|
|
928
|
-
pageSize:
|
|
929
|
-
totalPages:
|
|
930
|
-
totalItems:
|
|
931
|
-
goToPage:
|
|
1737
|
+
paginatedData: L,
|
|
1738
|
+
page: d,
|
|
1739
|
+
pageSize: r,
|
|
1740
|
+
totalPages: u,
|
|
1741
|
+
totalItems: b,
|
|
1742
|
+
goToPage: m,
|
|
932
1743
|
nextPage: v,
|
|
933
1744
|
prevPage: N,
|
|
934
|
-
changePageSize:
|
|
935
|
-
hasNextPage:
|
|
936
|
-
hasPrevPage:
|
|
937
|
-
startIndex:
|
|
938
|
-
endIndex:
|
|
1745
|
+
changePageSize: k,
|
|
1746
|
+
hasNextPage: d < u,
|
|
1747
|
+
hasPrevPage: d > 1,
|
|
1748
|
+
startIndex: S,
|
|
1749
|
+
endIndex: y
|
|
939
1750
|
};
|
|
940
1751
|
}
|
|
941
|
-
function
|
|
1752
|
+
function xn({
|
|
942
1753
|
data: e,
|
|
943
1754
|
rowKey: t,
|
|
944
1755
|
mode: l = "multiple",
|
|
945
|
-
initialSelection:
|
|
946
|
-
controlledSelection:
|
|
947
|
-
onSelectionChange:
|
|
1756
|
+
initialSelection: i,
|
|
1757
|
+
controlledSelection: a,
|
|
1758
|
+
onSelectionChange: o
|
|
948
1759
|
}) {
|
|
949
|
-
const [
|
|
950
|
-
|
|
951
|
-
),
|
|
952
|
-
(
|
|
1760
|
+
const [s, d] = M(
|
|
1761
|
+
i ?? []
|
|
1762
|
+
), c = a ?? s, r = w(
|
|
1763
|
+
(f, C) => typeof t == "function" ? t(f, C) : String(f[t]),
|
|
953
1764
|
[t]
|
|
954
|
-
),
|
|
955
|
-
(
|
|
956
|
-
const
|
|
957
|
-
return
|
|
1765
|
+
), h = I(() => new Set(c.map((f, C) => r(f, C))), [c, r]), b = w(
|
|
1766
|
+
(f, C) => {
|
|
1767
|
+
const A = r(f, C);
|
|
1768
|
+
return h.has(A);
|
|
958
1769
|
},
|
|
959
|
-
[
|
|
960
|
-
),
|
|
961
|
-
(
|
|
962
|
-
|
|
1770
|
+
[r, h]
|
|
1771
|
+
), u = w(
|
|
1772
|
+
(f) => {
|
|
1773
|
+
a || d(f), o?.(f);
|
|
963
1774
|
},
|
|
964
|
-
[
|
|
965
|
-
),
|
|
966
|
-
(
|
|
967
|
-
const
|
|
968
|
-
let
|
|
969
|
-
l === "single" ?
|
|
1775
|
+
[a, o]
|
|
1776
|
+
), m = w(
|
|
1777
|
+
(f, C) => {
|
|
1778
|
+
const A = r(f, C);
|
|
1779
|
+
let D;
|
|
1780
|
+
l === "single" ? D = h.has(A) ? [] : [f] : h.has(A) ? D = c.filter((p, P) => r(p, P) !== A) : D = [...c, f], u(D);
|
|
970
1781
|
},
|
|
971
|
-
[l,
|
|
972
|
-
), v =
|
|
973
|
-
(
|
|
974
|
-
if (!
|
|
975
|
-
const
|
|
976
|
-
|
|
1782
|
+
[l, h, c, r, u]
|
|
1783
|
+
), v = w(
|
|
1784
|
+
(f, C) => {
|
|
1785
|
+
if (!b(f, C)) {
|
|
1786
|
+
const A = l === "single" ? [f] : [...c, f];
|
|
1787
|
+
u(A);
|
|
977
1788
|
}
|
|
978
1789
|
},
|
|
979
|
-
[
|
|
980
|
-
), N =
|
|
981
|
-
(
|
|
982
|
-
const
|
|
983
|
-
(
|
|
1790
|
+
[b, l, c, u]
|
|
1791
|
+
), N = w(
|
|
1792
|
+
(f, C) => {
|
|
1793
|
+
const A = r(f, C), D = c.filter(
|
|
1794
|
+
(p, P) => r(p, P) !== A
|
|
984
1795
|
);
|
|
985
|
-
|
|
1796
|
+
u(D);
|
|
986
1797
|
},
|
|
987
|
-
[
|
|
988
|
-
),
|
|
989
|
-
l === "multiple" &&
|
|
990
|
-
}, [e, l,
|
|
991
|
-
|
|
992
|
-
}, [
|
|
1798
|
+
[c, r, u]
|
|
1799
|
+
), k = w(() => {
|
|
1800
|
+
l === "multiple" && u([...e]);
|
|
1801
|
+
}, [e, l, u]), L = w(() => {
|
|
1802
|
+
u([]);
|
|
1803
|
+
}, [u]), S = e.length > 0 && c.length === e.length, y = c.length > 0 && c.length < e.length;
|
|
993
1804
|
return {
|
|
994
|
-
selectedRows:
|
|
995
|
-
isSelected:
|
|
996
|
-
toggleRow:
|
|
1805
|
+
selectedRows: c,
|
|
1806
|
+
isSelected: b,
|
|
1807
|
+
toggleRow: m,
|
|
997
1808
|
selectRow: v,
|
|
998
1809
|
deselectRow: N,
|
|
999
|
-
selectAll:
|
|
1000
|
-
deselectAll:
|
|
1001
|
-
isAllSelected:
|
|
1002
|
-
isPartiallySelected:
|
|
1003
|
-
selectedCount:
|
|
1810
|
+
selectAll: k,
|
|
1811
|
+
deselectAll: L,
|
|
1812
|
+
isAllSelected: S,
|
|
1813
|
+
isPartiallySelected: y,
|
|
1814
|
+
selectedCount: c.length
|
|
1004
1815
|
};
|
|
1005
1816
|
}
|
|
1006
|
-
function
|
|
1817
|
+
function An({
|
|
1007
1818
|
data: e,
|
|
1008
1819
|
columns: t,
|
|
1009
1820
|
searchColumns: l,
|
|
1010
|
-
initialValue:
|
|
1011
|
-
controlledValue:
|
|
1012
|
-
onSearchChange:
|
|
1821
|
+
initialValue: i,
|
|
1822
|
+
controlledValue: a,
|
|
1823
|
+
onSearchChange: o,
|
|
1824
|
+
debounceMs: s = 0
|
|
1013
1825
|
}) {
|
|
1014
|
-
const [
|
|
1015
|
-
|
|
1016
|
-
|
|
1826
|
+
const [d, c] = M(i ?? ""), [r, h] = M(i ?? ""), b = V(null), u = a ?? d;
|
|
1827
|
+
B(() => {
|
|
1828
|
+
if (s <= 0) {
|
|
1829
|
+
h(u);
|
|
1830
|
+
return;
|
|
1831
|
+
}
|
|
1832
|
+
return b.current = setTimeout(() => {
|
|
1833
|
+
h(u);
|
|
1834
|
+
}, s), () => {
|
|
1835
|
+
b.current && clearTimeout(b.current);
|
|
1836
|
+
};
|
|
1837
|
+
}, [u, s]);
|
|
1838
|
+
const m = w(
|
|
1839
|
+
(k) => {
|
|
1840
|
+
a === void 0 && c(k), o?.(k);
|
|
1017
1841
|
},
|
|
1018
|
-
[
|
|
1019
|
-
),
|
|
1020
|
-
|
|
1021
|
-
}, [
|
|
1022
|
-
return { searchedData:
|
|
1842
|
+
[a, o]
|
|
1843
|
+
), v = w(() => {
|
|
1844
|
+
a === void 0 && c(""), b.current && clearTimeout(b.current), h(""), o?.("");
|
|
1845
|
+
}, [a, o]);
|
|
1846
|
+
return { searchedData: I(() => Bt(e, r, t, l), [e, r, t, l]), searchValue: u, handleSearch: m, clearSearch: v };
|
|
1847
|
+
}
|
|
1848
|
+
function Ln({
|
|
1849
|
+
columns: e,
|
|
1850
|
+
controlledHiddenColumns: t,
|
|
1851
|
+
onColumnVisibilityChange: l
|
|
1852
|
+
}) {
|
|
1853
|
+
const [i, a] = M(
|
|
1854
|
+
() => e.filter((b) => b.hidden).map((b) => b.id)
|
|
1855
|
+
), o = t ?? i, s = I(
|
|
1856
|
+
() => new Set(o),
|
|
1857
|
+
[o]
|
|
1858
|
+
), d = w(
|
|
1859
|
+
(b) => {
|
|
1860
|
+
const u = s.has(b) ? o.filter((m) => m !== b) : [...o, b];
|
|
1861
|
+
t || a(u), l?.(u);
|
|
1862
|
+
},
|
|
1863
|
+
[
|
|
1864
|
+
o,
|
|
1865
|
+
s,
|
|
1866
|
+
t,
|
|
1867
|
+
l
|
|
1868
|
+
]
|
|
1869
|
+
), c = w(() => {
|
|
1870
|
+
t || a([]), l?.([]);
|
|
1871
|
+
}, [t, l]), r = w(
|
|
1872
|
+
(b) => !s.has(b),
|
|
1873
|
+
[s]
|
|
1874
|
+
);
|
|
1875
|
+
return {
|
|
1876
|
+
visibleColumns: I(
|
|
1877
|
+
() => e.filter((b) => !s.has(b.id)),
|
|
1878
|
+
[e, s]
|
|
1879
|
+
),
|
|
1880
|
+
hiddenColumnIds: s,
|
|
1881
|
+
toggleColumn: d,
|
|
1882
|
+
showAllColumns: c,
|
|
1883
|
+
isColumnVisible: r,
|
|
1884
|
+
hiddenColumns: o
|
|
1885
|
+
};
|
|
1023
1886
|
}
|
|
1024
|
-
function
|
|
1887
|
+
function Dn(e) {
|
|
1025
1888
|
const {
|
|
1026
1889
|
// Data
|
|
1027
1890
|
data: t,
|
|
1028
1891
|
columns: l,
|
|
1029
|
-
rowKey:
|
|
1892
|
+
rowKey: i = "id",
|
|
1030
1893
|
// Actions
|
|
1031
|
-
rowActions:
|
|
1032
|
-
globalActions:
|
|
1894
|
+
rowActions: a,
|
|
1895
|
+
globalActions: o,
|
|
1896
|
+
maxVisibleActions: s = 3,
|
|
1033
1897
|
// Pagination
|
|
1034
|
-
pagination:
|
|
1035
|
-
onPageChange:
|
|
1898
|
+
pagination: d = { pageSize: 10 },
|
|
1899
|
+
onPageChange: c,
|
|
1036
1900
|
// Sort
|
|
1037
|
-
sort:
|
|
1901
|
+
sort: r,
|
|
1038
1902
|
onSortChange: h,
|
|
1903
|
+
multiSort: b = !1,
|
|
1904
|
+
multiSortState: u,
|
|
1905
|
+
onMultiSortChange: m,
|
|
1039
1906
|
// Filter
|
|
1040
|
-
filters:
|
|
1041
|
-
onFilterChange:
|
|
1907
|
+
filters: v,
|
|
1908
|
+
onFilterChange: N,
|
|
1909
|
+
filterMode: k = "floating",
|
|
1042
1910
|
// Search
|
|
1043
|
-
searchable:
|
|
1044
|
-
searchValue:
|
|
1045
|
-
onSearchChange:
|
|
1046
|
-
searchColumns:
|
|
1911
|
+
searchable: L = !1,
|
|
1912
|
+
searchValue: S,
|
|
1913
|
+
onSearchChange: y,
|
|
1914
|
+
searchColumns: f,
|
|
1915
|
+
searchDebounceMs: C = 300,
|
|
1047
1916
|
// Selection - now auto-inferred if not explicitly set
|
|
1048
|
-
selectable:
|
|
1049
|
-
selectedRows:
|
|
1050
|
-
onSelectionChange:
|
|
1051
|
-
selectionMode:
|
|
1917
|
+
selectable: A,
|
|
1918
|
+
selectedRows: D,
|
|
1919
|
+
onSelectionChange: p,
|
|
1920
|
+
selectionMode: P = "multiple",
|
|
1921
|
+
// Column Visibility
|
|
1922
|
+
columnVisibility: F = !1,
|
|
1923
|
+
hiddenColumns: z,
|
|
1924
|
+
onColumnVisibilityChange: H,
|
|
1052
1925
|
// States
|
|
1053
|
-
loading:
|
|
1054
|
-
loadingComponent:
|
|
1055
|
-
emptyComponent:
|
|
1926
|
+
loading: T = !1,
|
|
1927
|
+
loadingComponent: q,
|
|
1928
|
+
emptyComponent: ee,
|
|
1056
1929
|
// Styling
|
|
1057
|
-
classNames:
|
|
1058
|
-
styles:
|
|
1059
|
-
locale:
|
|
1060
|
-
stickyHeader:
|
|
1061
|
-
maxHeight:
|
|
1062
|
-
bordered:
|
|
1063
|
-
striped:
|
|
1064
|
-
hoverable:
|
|
1065
|
-
size:
|
|
1930
|
+
classNames: K = {},
|
|
1931
|
+
styles: te = {},
|
|
1932
|
+
locale: W,
|
|
1933
|
+
stickyHeader: ne = !1,
|
|
1934
|
+
maxHeight: ct,
|
|
1935
|
+
bordered: U = !1,
|
|
1936
|
+
striped: Z = !1,
|
|
1937
|
+
hoverable: Q = !0,
|
|
1938
|
+
size: G = "medium",
|
|
1066
1939
|
// Callbacks
|
|
1067
|
-
onRowClick:
|
|
1068
|
-
onRowDoubleClick:
|
|
1940
|
+
onRowClick: ie,
|
|
1941
|
+
onRowDoubleClick: le,
|
|
1069
1942
|
// Accessibility
|
|
1070
|
-
ariaLabel:
|
|
1071
|
-
ariaDescribedBy:
|
|
1072
|
-
} = e,
|
|
1073
|
-
(
|
|
1074
|
-
) ||
|
|
1075
|
-
() => ({ ...
|
|
1076
|
-
[
|
|
1077
|
-
), [
|
|
1078
|
-
|
|
1079
|
-
}, []),
|
|
1080
|
-
|
|
1081
|
-
|
|
1943
|
+
ariaLabel: dt,
|
|
1944
|
+
ariaDescribedBy: ht
|
|
1945
|
+
} = e, re = I(() => A !== void 0 ? A : o?.some(
|
|
1946
|
+
(vt) => vt.requiresSelection
|
|
1947
|
+
) || p !== void 0, [A, o, p]), ae = I(
|
|
1948
|
+
() => ({ ...typeof W == "string" ? Nt[W] : it, ...typeof W == "object" ? W : {} }),
|
|
1949
|
+
[W]
|
|
1950
|
+
), [se, oe] = M(!1), [ce, de] = M(null), [J, bt] = M(!1), he = w(() => {
|
|
1951
|
+
bt((E) => !E);
|
|
1952
|
+
}, []), be = I(
|
|
1953
|
+
() => l.some((E) => E.filterable !== !1 && E.type !== "custom" && !E.hidden),
|
|
1954
|
+
[l]
|
|
1955
|
+
), ue = w((E) => {
|
|
1956
|
+
de(E), oe(!0);
|
|
1957
|
+
}, []), fe = w(() => {
|
|
1958
|
+
oe(!1), de(null);
|
|
1959
|
+
}, []), O = I(() => d === !1 ? !1 : {
|
|
1082
1960
|
pageSize: 10,
|
|
1083
1961
|
pageSizeOptions: [10, 20, 50, 100],
|
|
1084
1962
|
showSizeChanger: !1,
|
|
1085
|
-
...
|
|
1086
|
-
}, [
|
|
1087
|
-
searchedData:
|
|
1088
|
-
searchValue:
|
|
1089
|
-
handleSearch:
|
|
1090
|
-
clearSearch:
|
|
1091
|
-
} =
|
|
1963
|
+
...d
|
|
1964
|
+
}, [d]), {
|
|
1965
|
+
searchedData: ut,
|
|
1966
|
+
searchValue: pe,
|
|
1967
|
+
handleSearch: me,
|
|
1968
|
+
clearSearch: ge
|
|
1969
|
+
} = An({
|
|
1092
1970
|
data: t,
|
|
1093
1971
|
columns: l,
|
|
1094
|
-
searchColumns:
|
|
1095
|
-
controlledValue:
|
|
1096
|
-
onSearchChange:
|
|
1972
|
+
searchColumns: f,
|
|
1973
|
+
controlledValue: S,
|
|
1974
|
+
onSearchChange: y,
|
|
1975
|
+
debounceMs: C
|
|
1976
|
+
}), {
|
|
1977
|
+
filteredData: ft,
|
|
1978
|
+
filters: ve,
|
|
1979
|
+
setFilter: ye,
|
|
1980
|
+
clearFilter: we,
|
|
1981
|
+
clearFilters: Ce
|
|
1982
|
+
} = Sn({
|
|
1983
|
+
data: ut,
|
|
1984
|
+
columns: l,
|
|
1985
|
+
controlledFilters: v,
|
|
1986
|
+
onFilterChange: N
|
|
1987
|
+
}), { sortedData: ke, sortState: Ne, handleSort: Se, clearSort: Pe, multiSortState: xe, isMultiSort: Ae } = Nn({
|
|
1988
|
+
data: ft,
|
|
1989
|
+
controlledSort: r,
|
|
1990
|
+
onSortChange: h,
|
|
1991
|
+
multiSort: b,
|
|
1992
|
+
controlledMultiSort: u,
|
|
1993
|
+
onMultiSortChange: m
|
|
1097
1994
|
}), {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1995
|
+
visibleColumns: Le,
|
|
1996
|
+
hiddenColumnIds: De,
|
|
1997
|
+
toggleColumn: Te,
|
|
1998
|
+
showAllColumns: Me,
|
|
1999
|
+
isColumnVisible: Ie
|
|
2000
|
+
} = Ln({
|
|
1104
2001
|
columns: l,
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
}), { sortedData: se, sortState: re, handleSort: ie } = pt({
|
|
1108
|
-
data: Ie,
|
|
1109
|
-
controlledSort: o,
|
|
1110
|
-
onSortChange: h
|
|
2002
|
+
controlledHiddenColumns: z,
|
|
2003
|
+
onColumnVisibilityChange: H
|
|
1111
2004
|
}), {
|
|
1112
|
-
selectedRows:
|
|
1113
|
-
isSelected:
|
|
1114
|
-
toggleRow:
|
|
1115
|
-
selectAll:
|
|
1116
|
-
deselectAll:
|
|
1117
|
-
isAllSelected:
|
|
1118
|
-
isPartiallySelected:
|
|
1119
|
-
selectedCount:
|
|
1120
|
-
} =
|
|
1121
|
-
data:
|
|
1122
|
-
rowKey:
|
|
1123
|
-
mode:
|
|
1124
|
-
controlledSelection:
|
|
1125
|
-
onSelectionChange:
|
|
2005
|
+
selectedRows: $e,
|
|
2006
|
+
isSelected: Fe,
|
|
2007
|
+
toggleRow: Re,
|
|
2008
|
+
selectAll: Ee,
|
|
2009
|
+
deselectAll: je,
|
|
2010
|
+
isAllSelected: Oe,
|
|
2011
|
+
isPartiallySelected: Be,
|
|
2012
|
+
selectedCount: ze
|
|
2013
|
+
} = xn({
|
|
2014
|
+
data: ke,
|
|
2015
|
+
rowKey: i,
|
|
2016
|
+
mode: P,
|
|
2017
|
+
controlledSelection: D,
|
|
2018
|
+
onSelectionChange: p
|
|
1126
2019
|
}), {
|
|
1127
|
-
paginatedData:
|
|
1128
|
-
page:
|
|
1129
|
-
pageSize:
|
|
1130
|
-
totalPages:
|
|
1131
|
-
totalItems:
|
|
1132
|
-
goToPage:
|
|
1133
|
-
nextPage:
|
|
1134
|
-
prevPage:
|
|
1135
|
-
changePageSize:
|
|
1136
|
-
hasNextPage:
|
|
1137
|
-
hasPrevPage:
|
|
1138
|
-
startIndex:
|
|
1139
|
-
endIndex:
|
|
1140
|
-
} =
|
|
1141
|
-
data:
|
|
1142
|
-
config:
|
|
1143
|
-
onPageChange:
|
|
1144
|
-
}),
|
|
2020
|
+
paginatedData: X,
|
|
2021
|
+
page: Ve,
|
|
2022
|
+
pageSize: He,
|
|
2023
|
+
totalPages: We,
|
|
2024
|
+
totalItems: qe,
|
|
2025
|
+
goToPage: Ke,
|
|
2026
|
+
nextPage: _e,
|
|
2027
|
+
prevPage: Ue,
|
|
2028
|
+
changePageSize: Ze,
|
|
2029
|
+
hasNextPage: Qe,
|
|
2030
|
+
hasPrevPage: Ge,
|
|
2031
|
+
startIndex: Je,
|
|
2032
|
+
endIndex: Xe
|
|
2033
|
+
} = Pn({
|
|
2034
|
+
data: ke,
|
|
2035
|
+
config: O,
|
|
2036
|
+
onPageChange: c
|
|
2037
|
+
}), pt = I(
|
|
1145
2038
|
() => ({
|
|
1146
2039
|
// Data
|
|
1147
2040
|
data: t,
|
|
1148
|
-
processedData:
|
|
2041
|
+
processedData: X,
|
|
1149
2042
|
columns: l,
|
|
1150
|
-
|
|
2043
|
+
visibleColumns: Le,
|
|
2044
|
+
rowKey: i,
|
|
1151
2045
|
// Actions
|
|
1152
|
-
rowActions:
|
|
1153
|
-
globalActions:
|
|
2046
|
+
rowActions: a,
|
|
2047
|
+
globalActions: o,
|
|
2048
|
+
maxVisibleActions: s,
|
|
1154
2049
|
// Sort
|
|
1155
|
-
sortState:
|
|
1156
|
-
handleSort:
|
|
2050
|
+
sortState: Ne,
|
|
2051
|
+
handleSort: Se,
|
|
2052
|
+
multiSortState: xe,
|
|
2053
|
+
isMultiSort: Ae,
|
|
2054
|
+
clearSort: Pe,
|
|
2055
|
+
// Column Visibility
|
|
2056
|
+
columnVisibilityEnabled: F,
|
|
2057
|
+
hiddenColumnIds: De,
|
|
2058
|
+
toggleColumn: Te,
|
|
2059
|
+
showAllColumns: Me,
|
|
2060
|
+
isColumnVisible: Ie,
|
|
1157
2061
|
// Filter
|
|
1158
|
-
filters:
|
|
1159
|
-
setFilter:
|
|
1160
|
-
|
|
2062
|
+
filters: ve,
|
|
2063
|
+
setFilter: ye,
|
|
2064
|
+
clearFilter: we,
|
|
2065
|
+
clearFilters: Ce,
|
|
1161
2066
|
// Search
|
|
1162
|
-
searchValue:
|
|
1163
|
-
handleSearch:
|
|
1164
|
-
clearSearch:
|
|
1165
|
-
searchable:
|
|
2067
|
+
searchValue: pe,
|
|
2068
|
+
handleSearch: me,
|
|
2069
|
+
clearSearch: ge,
|
|
2070
|
+
searchable: L,
|
|
1166
2071
|
// Selection
|
|
1167
|
-
selectedRows:
|
|
1168
|
-
isSelected:
|
|
1169
|
-
toggleRow:
|
|
1170
|
-
selectAll:
|
|
1171
|
-
deselectAll:
|
|
1172
|
-
isAllSelected:
|
|
1173
|
-
isPartiallySelected:
|
|
1174
|
-
selectable:
|
|
1175
|
-
selectionMode:
|
|
1176
|
-
selectedCount:
|
|
2072
|
+
selectedRows: $e,
|
|
2073
|
+
isSelected: Fe,
|
|
2074
|
+
toggleRow: Re,
|
|
2075
|
+
selectAll: Ee,
|
|
2076
|
+
deselectAll: je,
|
|
2077
|
+
isAllSelected: Oe,
|
|
2078
|
+
isPartiallySelected: Be,
|
|
2079
|
+
selectable: re,
|
|
2080
|
+
selectionMode: P,
|
|
2081
|
+
selectedCount: ze,
|
|
1177
2082
|
// Pagination
|
|
1178
|
-
page:
|
|
1179
|
-
pageSize:
|
|
1180
|
-
totalPages:
|
|
1181
|
-
totalItems:
|
|
1182
|
-
goToPage:
|
|
1183
|
-
nextPage:
|
|
1184
|
-
prevPage:
|
|
1185
|
-
changePageSize:
|
|
1186
|
-
hasNextPage:
|
|
1187
|
-
hasPrevPage:
|
|
1188
|
-
startIndex:
|
|
1189
|
-
endIndex:
|
|
1190
|
-
paginationEnabled:
|
|
1191
|
-
pageSizeOptions:
|
|
1192
|
-
showSizeChanger:
|
|
2083
|
+
page: Ve,
|
|
2084
|
+
pageSize: He,
|
|
2085
|
+
totalPages: We,
|
|
2086
|
+
totalItems: qe,
|
|
2087
|
+
goToPage: Ke,
|
|
2088
|
+
nextPage: _e,
|
|
2089
|
+
prevPage: Ue,
|
|
2090
|
+
changePageSize: Ze,
|
|
2091
|
+
hasNextPage: Qe,
|
|
2092
|
+
hasPrevPage: Ge,
|
|
2093
|
+
startIndex: Je,
|
|
2094
|
+
endIndex: Xe,
|
|
2095
|
+
paginationEnabled: d !== !1,
|
|
2096
|
+
pageSizeOptions: O && typeof O == "object" ? O.pageSizeOptions ?? [10, 20, 50, 100] : [10, 20, 50, 100],
|
|
2097
|
+
showSizeChanger: O && typeof O == "object" ? O.showSizeChanger ?? !1 : !1,
|
|
1193
2098
|
// UI State
|
|
1194
|
-
loading:
|
|
1195
|
-
loadingComponent:
|
|
1196
|
-
emptyComponent:
|
|
2099
|
+
loading: T,
|
|
2100
|
+
loadingComponent: q,
|
|
2101
|
+
emptyComponent: ee,
|
|
1197
2102
|
// Styling
|
|
1198
|
-
locale:
|
|
1199
|
-
classNames:
|
|
1200
|
-
size:
|
|
1201
|
-
bordered:
|
|
1202
|
-
striped:
|
|
1203
|
-
hoverable:
|
|
1204
|
-
stickyHeader:
|
|
2103
|
+
locale: ae,
|
|
2104
|
+
classNames: K,
|
|
2105
|
+
size: G,
|
|
2106
|
+
bordered: U,
|
|
2107
|
+
striped: Z,
|
|
2108
|
+
hoverable: Q,
|
|
2109
|
+
stickyHeader: ne,
|
|
1205
2110
|
// Callbacks
|
|
1206
|
-
onRowClick:
|
|
1207
|
-
onRowDoubleClick:
|
|
2111
|
+
onRowClick: ie,
|
|
2112
|
+
onRowDoubleClick: le,
|
|
1208
2113
|
// Modal
|
|
1209
|
-
openModal:
|
|
1210
|
-
closeModal:
|
|
1211
|
-
modalContent:
|
|
1212
|
-
isModalOpen:
|
|
2114
|
+
openModal: ue,
|
|
2115
|
+
closeModal: fe,
|
|
2116
|
+
modalContent: ce,
|
|
2117
|
+
isModalOpen: se,
|
|
2118
|
+
// Filter panel
|
|
2119
|
+
filterPanelOpen: J,
|
|
2120
|
+
toggleFilterPanel: he,
|
|
2121
|
+
hasFilterableColumns: be,
|
|
2122
|
+
filterMode: k
|
|
1213
2123
|
}),
|
|
1214
2124
|
[
|
|
1215
2125
|
t,
|
|
1216
|
-
|
|
2126
|
+
X,
|
|
1217
2127
|
l,
|
|
1218
|
-
|
|
1219
|
-
|
|
2128
|
+
Le,
|
|
2129
|
+
i,
|
|
1220
2130
|
a,
|
|
2131
|
+
o,
|
|
2132
|
+
s,
|
|
2133
|
+
Ne,
|
|
2134
|
+
Se,
|
|
2135
|
+
xe,
|
|
2136
|
+
Ae,
|
|
2137
|
+
Pe,
|
|
2138
|
+
F,
|
|
2139
|
+
De,
|
|
2140
|
+
Te,
|
|
2141
|
+
Me,
|
|
2142
|
+
Ie,
|
|
2143
|
+
ve,
|
|
2144
|
+
ye,
|
|
2145
|
+
we,
|
|
2146
|
+
Ce,
|
|
2147
|
+
pe,
|
|
2148
|
+
me,
|
|
2149
|
+
ge,
|
|
2150
|
+
L,
|
|
2151
|
+
$e,
|
|
2152
|
+
Fe,
|
|
2153
|
+
Re,
|
|
2154
|
+
Ee,
|
|
2155
|
+
je,
|
|
2156
|
+
Oe,
|
|
2157
|
+
Be,
|
|
1221
2158
|
re,
|
|
1222
|
-
|
|
2159
|
+
P,
|
|
2160
|
+
ze,
|
|
2161
|
+
Ve,
|
|
2162
|
+
He,
|
|
2163
|
+
We,
|
|
2164
|
+
qe,
|
|
2165
|
+
Ke,
|
|
2166
|
+
_e,
|
|
2167
|
+
Ue,
|
|
2168
|
+
Ze,
|
|
2169
|
+
Qe,
|
|
2170
|
+
Ge,
|
|
2171
|
+
Je,
|
|
2172
|
+
Xe,
|
|
2173
|
+
d,
|
|
2174
|
+
O,
|
|
2175
|
+
T,
|
|
2176
|
+
q,
|
|
2177
|
+
ee,
|
|
1223
2178
|
ae,
|
|
2179
|
+
K,
|
|
2180
|
+
G,
|
|
2181
|
+
U,
|
|
2182
|
+
Z,
|
|
2183
|
+
Q,
|
|
1224
2184
|
ne,
|
|
2185
|
+
ie,
|
|
1225
2186
|
le,
|
|
1226
|
-
Z,
|
|
1227
|
-
ee,
|
|
1228
|
-
te,
|
|
1229
|
-
p,
|
|
1230
|
-
ce,
|
|
1231
|
-
oe,
|
|
1232
|
-
de,
|
|
1233
|
-
be,
|
|
1234
|
-
he,
|
|
1235
2187
|
ue,
|
|
1236
2188
|
fe,
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
pe,
|
|
1240
|
-
ge,
|
|
1241
|
-
me,
|
|
1242
|
-
ve,
|
|
1243
|
-
ye,
|
|
1244
|
-
Se,
|
|
1245
|
-
Ce,
|
|
1246
|
-
Ne,
|
|
1247
|
-
ke,
|
|
1248
|
-
De,
|
|
1249
|
-
Pe,
|
|
1250
|
-
Te,
|
|
1251
|
-
Ae,
|
|
1252
|
-
r,
|
|
1253
|
-
R,
|
|
1254
|
-
d,
|
|
1255
|
-
c,
|
|
1256
|
-
g,
|
|
2189
|
+
ce,
|
|
2190
|
+
se,
|
|
1257
2191
|
J,
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
j,
|
|
1262
|
-
E,
|
|
1263
|
-
V,
|
|
1264
|
-
H,
|
|
1265
|
-
q,
|
|
1266
|
-
X,
|
|
1267
|
-
Y,
|
|
1268
|
-
U,
|
|
1269
|
-
Q
|
|
2192
|
+
he,
|
|
2193
|
+
be,
|
|
2194
|
+
k
|
|
1270
2195
|
]
|
|
1271
|
-
),
|
|
1272
|
-
return /* @__PURE__ */
|
|
2196
|
+
), Y = X.length > 0, mt = ot("(max-width: 640px)");
|
|
2197
|
+
return /* @__PURE__ */ n(St, { value: pt, children: /* @__PURE__ */ g(
|
|
1273
2198
|
"div",
|
|
1274
2199
|
{
|
|
1275
|
-
className:
|
|
2200
|
+
className: x(
|
|
1276
2201
|
"bt-container",
|
|
1277
|
-
`bt-size-${
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
2202
|
+
`bt-size-${G}`,
|
|
2203
|
+
Z && "bt-striped",
|
|
2204
|
+
U && "bt-bordered",
|
|
2205
|
+
Q && "bt-hoverable",
|
|
2206
|
+
T && "bt-container-loading",
|
|
2207
|
+
K.container
|
|
1283
2208
|
),
|
|
1284
|
-
style:
|
|
2209
|
+
style: te.container,
|
|
1285
2210
|
children: [
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ n(gn, {}),
|
|
2212
|
+
(k === "panel" || k === "both") && /* @__PURE__ */ n(an, { open: J }),
|
|
2213
|
+
/* @__PURE__ */ g(
|
|
1288
2214
|
"div",
|
|
1289
2215
|
{
|
|
1290
2216
|
className: "bt-table-wrapper",
|
|
1291
|
-
style: { maxHeight:
|
|
2217
|
+
style: { maxHeight: ct },
|
|
1292
2218
|
children: [
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
{
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
"
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
2219
|
+
mt ? (
|
|
2220
|
+
/* Cards (móvil) */
|
|
2221
|
+
Y && /* @__PURE__ */ n(tn, {})
|
|
2222
|
+
) : (
|
|
2223
|
+
/* Tabla tradicional (desktop/tablet) */
|
|
2224
|
+
/* @__PURE__ */ g(
|
|
2225
|
+
"table",
|
|
2226
|
+
{
|
|
2227
|
+
className: x("bt-table", K.table),
|
|
2228
|
+
style: te.table,
|
|
2229
|
+
role: "grid",
|
|
2230
|
+
"aria-label": dt,
|
|
2231
|
+
"aria-describedby": ht,
|
|
2232
|
+
"aria-busy": T,
|
|
2233
|
+
children: [
|
|
2234
|
+
/* @__PURE__ */ n(Rt, {}),
|
|
2235
|
+
Y ? /* @__PURE__ */ n(Gt, {}) : /* @__PURE__ */ n(yn, {})
|
|
2236
|
+
]
|
|
2237
|
+
}
|
|
2238
|
+
)
|
|
1307
2239
|
),
|
|
1308
|
-
|
|
1309
|
-
/* @__PURE__ */ i(ut, { show: d && F })
|
|
2240
|
+
/* @__PURE__ */ n(wn, { show: T && Y })
|
|
1310
2241
|
]
|
|
1311
2242
|
}
|
|
1312
2243
|
),
|
|
1313
|
-
|
|
1314
|
-
/* @__PURE__ */
|
|
2244
|
+
d !== !1 && /* @__PURE__ */ n(un, {}),
|
|
2245
|
+
/* @__PURE__ */ n(kn, {})
|
|
1315
2246
|
]
|
|
1316
2247
|
}
|
|
1317
2248
|
) });
|
|
1318
2249
|
}
|
|
1319
|
-
const
|
|
2250
|
+
const Fn = Dn;
|
|
1320
2251
|
export {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
2252
|
+
Fn as BetterTable,
|
|
2253
|
+
St as TableProvider,
|
|
2254
|
+
it as defaultLocale,
|
|
2255
|
+
Ot as filterData,
|
|
2256
|
+
j as getValueFromPath,
|
|
2257
|
+
Nt as locales,
|
|
2258
|
+
Bt as searchData,
|
|
2259
|
+
Et as sortData,
|
|
2260
|
+
Ln as useColumnVisibility,
|
|
2261
|
+
$ as useTableContext,
|
|
2262
|
+
Sn as useTableFilter,
|
|
2263
|
+
Pn as useTablePagination,
|
|
2264
|
+
An as useTableSearch,
|
|
2265
|
+
xn as useTableSelection,
|
|
2266
|
+
Nn as useTableSort
|
|
1334
2267
|
};
|
|
1335
2268
|
//# sourceMappingURL=better-table.es.js.map
|