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