better-table 1.0.0 → 1.1.0

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