@chumsinc/sortable-tables 3.0.2 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +3 -3
  3. package/dist/ContainedDataTable.d.ts +6 -0
  4. package/dist/ContainedDataTableRow.d.ts +6 -0
  5. package/dist/ContainedSortableTable.d.ts +6 -0
  6. package/dist/DataTable.d.ts +2 -2
  7. package/dist/DataTableCell.d.ts +173 -173
  8. package/dist/DataTableContext.d.ts +2 -2
  9. package/dist/DataTableHead.d.ts +1 -1
  10. package/dist/DataTableProvider.d.ts +2 -2
  11. package/dist/DataTableRow.d.ts +2 -2
  12. package/dist/DataTableTBody.d.ts +1 -1
  13. package/dist/DataTableTH.d.ts +1 -1
  14. package/dist/RowsPerPage.d.ts +1 -1
  15. package/dist/SortHelper.d.ts +5 -0
  16. package/dist/SortableTable.d.ts +2 -2
  17. package/dist/SortableTableHead.d.ts +1 -1
  18. package/dist/SortableTableHeadWrapper.d.ts +1 -1
  19. package/dist/SortableTableTH.d.ts +1 -1
  20. package/dist/Table.d.ts +2 -2
  21. package/dist/TablePagination.d.ts +1 -1
  22. package/dist/index.cjs.js +3 -3
  23. package/dist/index.cjs.js.map +1 -1
  24. package/dist/index.d.ts +5 -6
  25. package/dist/index.es.js +127 -127
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/types.d.ts +3 -2
  28. package/dist/useField.d.ts +1 -1
  29. package/dist/useTableContext.d.ts +1 -1
  30. package/dist/useTableFields.d.ts +1 -1
  31. package/dist/useTableSort.d.ts +1 -1
  32. package/{eslint.config.mjs → eslint.config.js} +2 -2
  33. package/package.json +9 -12
  34. package/src/ContainedDataTable.tsx +41 -0
  35. package/src/ContainedDataTableRow.tsx +39 -0
  36. package/src/ContainedSortableTable.tsx +42 -0
  37. package/src/DataTable.tsx +9 -34
  38. package/src/DataTableHead.tsx +1 -1
  39. package/src/DataTableRow.tsx +10 -12
  40. package/src/DataTableTBody.tsx +4 -5
  41. package/src/DataTableTH.tsx +0 -1
  42. package/src/RowsPerPage.tsx +1 -1
  43. package/src/{StandaloneSortHelper.tsx → SortHelper.tsx} +1 -1
  44. package/src/SortableTable.tsx +12 -35
  45. package/src/SortableTableHead.tsx +0 -1
  46. package/src/SortableTableTH.tsx +0 -1
  47. package/src/Table.tsx +1 -1
  48. package/src/TablePagination.tsx +0 -1
  49. package/src/index.tsx +5 -6
  50. package/src/types.ts +2 -1
  51. package/test/TableColumnsHandler.tsx +3 -3
  52. package/test/TestTable.tsx +5 -5
  53. package/test/tableFields.tsx +0 -1
  54. package/tsconfig-dts.json +8 -0
  55. package/tsconfig.json +1 -1
  56. package/vite.config.ts +3 -2
  57. package/dist/StandaloneDataTable.d.ts +0 -6
  58. package/dist/StandaloneDataTableRow.d.ts +0 -9
  59. package/dist/StandaloneSortHelper.d.ts +0 -5
  60. package/dist/StandaloneSortableTable.d.ts +0 -6
  61. package/src/StandaloneDataTable.tsx +0 -16
  62. package/src/StandaloneDataTableRow.tsx +0 -42
  63. package/src/StandaloneSortableTable.tsx +0 -21
package/dist/index.es.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { jsx as l, jsxs as h } from "react/jsx-runtime";
2
- import { createContext as I, useState as w, useCallback as g, useMemo as J, useContext as S, createElement as L, useEffect as q, useId as K } from "react";
2
+ import { createContext as I, useState as w, useCallback as g, useMemo as J, useContext as C, createElement as L, useEffect as q, useId as K } from "react";
3
3
  import R from "@emotion/styled";
4
- const y = I(null);
4
+ const T = I(null);
5
5
  function x({
6
6
  children: t,
7
- initialFields: a = [],
8
- initialSort: e = null
7
+ initialFields: e = [],
8
+ initialSort: a = null
9
9
  }) {
10
- const [n, s] = w(a), [r, c] = w(e), u = g(
10
+ const [n, s] = w(e), [r, c] = w(a), u = g(
11
11
  (p) => {
12
12
  s(p);
13
13
  },
@@ -18,7 +18,7 @@ function x({
18
18
  },
19
19
  []
20
20
  ), d = g((p, f) => {
21
- const N = n.map((T) => T.id === p ? { ...T, ...f } : T);
21
+ const N = n.map((y) => y.id === p ? { ...y, ...f } : y);
22
22
  s(N);
23
23
  }, [n]), o = g((p) => n.find((f) => f.id === p), [n]), b = J(
24
24
  () => ({
@@ -31,20 +31,20 @@ function x({
31
31
  }),
32
32
  [n, u, r, i, d, o]
33
33
  );
34
- return /* @__PURE__ */ l(y.Provider, { value: b, children: t });
34
+ return /* @__PURE__ */ l(T.Provider, { value: b, children: t });
35
35
  }
36
36
  x.displayName = "DataTableProvider";
37
37
  function E(t) {
38
- var a, e, n = "";
38
+ var e, a, n = "";
39
39
  if (typeof t == "string" || typeof t == "number") n += t;
40
40
  else if (typeof t == "object") if (Array.isArray(t)) {
41
41
  var s = t.length;
42
- for (a = 0; a < s; a++) t[a] && (e = E(t[a])) && (n && (n += " "), n += e);
43
- } else for (e in t) t[e] && (n && (n += " "), n += e);
42
+ for (e = 0; e < s; e++) t[e] && (a = E(t[e])) && (n && (n += " "), n += a);
43
+ } else for (a in t) t[a] && (n && (n += " "), n += a);
44
44
  return n;
45
45
  }
46
46
  function m() {
47
- for (var t, a, e = 0, n = "", s = arguments.length; e < s; e++) (t = arguments[e]) && (a = E(t)) && (n && (n += " "), n += a);
47
+ for (var t, e, a = 0, n = "", s = arguments.length; a < s; a++) (t = arguments[a]) && (e = E(t)) && (n && (n += " "), n += e);
48
48
  return n;
49
49
  }
50
50
  const F = R.table`
@@ -62,35 +62,35 @@ const F = R.table`
62
62
  `;
63
63
  function P({
64
64
  sticky: t,
65
- responsive: a,
66
- children: e,
65
+ responsive: e,
66
+ children: a,
67
67
  className: n,
68
68
  ref: s,
69
69
  ...r
70
70
  }) {
71
- if (a) {
71
+ if (e) {
72
72
  const c = m(n, {
73
- "table-responsive": a === !0,
74
- [`table-responsive-${a}`]: a !== !0
73
+ "table-responsive": e === !0,
74
+ [`table-responsive-${e}`]: e !== !0
75
75
  });
76
- return /* @__PURE__ */ l("div", { className: c, children: /* @__PURE__ */ l(F, { ref: s, ...r, children: e }) });
76
+ return /* @__PURE__ */ l("div", { className: c, children: /* @__PURE__ */ l(F, { ref: s, ...r, children: a }) });
77
77
  }
78
- return /* @__PURE__ */ l(F, { className: n, sticky: t, ref: s, ...r, children: e });
78
+ return /* @__PURE__ */ l(F, { className: n, sticky: t, ref: s, ...r, children: a });
79
79
  }
80
- function C({
80
+ function S({
81
81
  field: t,
82
- className: a,
83
- children: e,
82
+ className: e,
83
+ children: a,
84
84
  ...n
85
85
  }) {
86
86
  if (t.visible === !1)
87
87
  return null;
88
- const s = m({ [`text-${t.align}`]: !!t.align }, a);
89
- return /* @__PURE__ */ l("th", { className: s, scope: "col", ...n, children: e ?? t.title });
88
+ const s = m({ [`text-${t.align}`]: !!t.align }, e);
89
+ return /* @__PURE__ */ l("th", { className: s, scope: "col", ...n, children: a ?? t.title });
90
90
  }
91
- C.displayName = "DataTableTH";
91
+ S.displayName = "DataTableTH";
92
92
  function v() {
93
- const t = S(y);
93
+ const t = C(T);
94
94
  if (!t)
95
95
  throw new Error("useTableContext must be used within a DataTableProvider");
96
96
  return [
@@ -99,24 +99,24 @@ function v() {
99
99
  ];
100
100
  }
101
101
  function j({ ...t }) {
102
- const [a] = v();
103
- return /* @__PURE__ */ l("thead", { ...t, children: /* @__PURE__ */ l("tr", { children: a.map((e, n) => /* @__PURE__ */ l(
104
- C,
102
+ const [e] = v();
103
+ return /* @__PURE__ */ l("thead", { ...t, children: /* @__PURE__ */ l("tr", { children: e.map((a, n) => /* @__PURE__ */ l(
104
+ S,
105
105
  {
106
- ...e.thProps,
107
- field: e,
106
+ ...a.thProps,
107
+ field: a,
108
108
  className: m(
109
- typeof e.className == "function" ? { [`text-${e.align}`]: !!e.align } : e.className
109
+ typeof a.className == "function" ? { [`text-${a.align}`]: !!a.align } : a.className
110
110
  )
111
111
  },
112
- String(e.id ?? n)
112
+ String(a.id ?? n)
113
113
  )) }) });
114
114
  }
115
115
  j.displayName = "DataTableHead";
116
116
  function _({
117
117
  className: t,
118
- size: a,
119
- responsive: e,
118
+ size: e,
119
+ responsive: a,
120
120
  sticky: n,
121
121
  data: s,
122
122
  keyField: r,
@@ -130,9 +130,9 @@ function _({
130
130
  ...f
131
131
  }) {
132
132
  const N = m("table", t, {
133
- [`table-${a}`]: !!a
133
+ [`table-${e}`]: !!e
134
134
  });
135
- return /* @__PURE__ */ h(P, { sticky: n, responsive: e, className: N, ...f, children: [
135
+ return /* @__PURE__ */ h(P, { sticky: n, responsive: a, className: N, ...f, children: [
136
136
  /* @__PURE__ */ l(H, {}),
137
137
  /* @__PURE__ */ l(j, { ...o }),
138
138
  !!s.length && /* @__PURE__ */ l(
@@ -150,21 +150,21 @@ function _({
150
150
  p
151
151
  ] });
152
152
  }
153
- _.displayName = "DataTable";
153
+ _.displayName = "ContainedDataTable";
154
154
  function O({
155
155
  fields: t,
156
- ...a
156
+ ...e
157
157
  }) {
158
- return /* @__PURE__ */ l(x, { initialFields: t, children: /* @__PURE__ */ l(_, { ...a }) });
158
+ return /* @__PURE__ */ l(x, { initialFields: t, children: /* @__PURE__ */ l(_, { ...e }) });
159
159
  }
160
- O.displayName = "StandaloneDataTable";
161
- function D({ field: t, row: a, className: e, as: n, ...s }) {
160
+ O.displayName = "DataTable";
161
+ function D({ field: t, row: e, className: a, as: n, ...s }) {
162
162
  if (t.visible === !1)
163
163
  return null;
164
164
  const r = m(
165
165
  { [`text-${t.align}`]: !!t.align },
166
- e,
167
- typeof t.className == "function" ? t.className(a) : t.className
166
+ a,
167
+ typeof t.className == "function" ? t.className(e) : t.className
168
168
  );
169
169
  return L(
170
170
  n ?? t.as ?? "td",
@@ -175,14 +175,14 @@ function D({ field: t, row: a, className: e, as: n, ...s }) {
175
175
  ...t.cellProps,
176
176
  ...s
177
177
  },
178
- a[t.field] === void 0 && !t.render ? null : typeof t.render == "function" ? t.render(a) : a[t.field]
178
+ e[t.field] === void 0 && !t.render ? null : typeof t.render == "function" ? t.render(e) : e[t.field]
179
179
  );
180
180
  }
181
181
  D.displayName = "DataTableCell";
182
182
  function M({
183
183
  className: t,
184
- rowClassName: a,
185
- selected: e,
184
+ rowClassName: e,
185
+ selected: a,
186
186
  row: n,
187
187
  trRef: s,
188
188
  onClick: r,
@@ -190,23 +190,23 @@ function M({
190
190
  }) {
191
191
  const [u] = v(), i = (o) => {
192
192
  r?.(n, o);
193
- }, d = typeof a == "function" ? a(n) : a;
193
+ }, d = typeof e == "function" ? e(n) : e;
194
194
  return n ? /* @__PURE__ */ l(
195
195
  "tr",
196
196
  {
197
197
  ref: s,
198
- className: m({ "table-active": e }, t, d),
198
+ className: m({ "table-active": a }, t, d),
199
199
  onClick: i,
200
200
  ...c,
201
201
  children: u.map((o, b) => /* @__PURE__ */ l(D, { field: o, row: n }, String(o?.id ?? b)))
202
202
  }
203
203
  ) : null;
204
204
  }
205
- M.displayName = "DataTableRow";
205
+ M.displayName = "ContainedDataTableRow";
206
206
  function Q({
207
207
  fields: t,
208
- className: a,
209
- rowClassName: e,
208
+ className: e,
209
+ rowClassName: a,
210
210
  selected: n,
211
211
  row: s,
212
212
  trRef: r,
@@ -215,23 +215,23 @@ function Q({
215
215
  }) {
216
216
  const i = (o) => {
217
217
  c?.(s, o);
218
- }, d = typeof e == "function" ? e(s) : e;
218
+ }, d = typeof a == "function" ? a(s) : a;
219
219
  return s ? /* @__PURE__ */ l(
220
220
  "tr",
221
221
  {
222
222
  ref: r,
223
- className: m({ "table-active": n }, a, d),
223
+ className: m({ "table-active": n }, e, d),
224
224
  onClick: i,
225
225
  ...u,
226
226
  children: t.map((o, b) => /* @__PURE__ */ l(D, { field: o, row: s }, String(o?.id ?? b)))
227
227
  }
228
228
  ) : null;
229
229
  }
230
- Q.displayName = "StandaloneDataTableRow";
230
+ Q.displayName = "DataTableRow";
231
231
  function k({
232
232
  data: t,
233
- keyField: a,
234
- rowClassName: e,
233
+ keyField: e,
234
+ rowClassName: a,
235
235
  renderRow: n,
236
236
  onSelectRow: s,
237
237
  selected: r = "",
@@ -240,12 +240,12 @@ function k({
240
240
  }) {
241
241
  return /* @__PURE__ */ h("tbody", { ...u, children: [
242
242
  t.map((i) => {
243
- const d = String(typeof a == "function" ? a(i) : i[a]), o = typeof r == "function" ? r(i) : d === r;
243
+ const d = String(typeof e == "function" ? e(i) : i[e]), o = typeof r == "function" ? r(i) : d === r;
244
244
  return n ? n(i) : /* @__PURE__ */ l(
245
245
  M,
246
246
  {
247
247
  onClick: s,
248
- rowClassName: e,
248
+ rowClassName: a,
249
249
  row: i,
250
250
  selected: o
251
251
  },
@@ -257,7 +257,7 @@ function k({
257
257
  }
258
258
  k.displayName = "DataTableTBody";
259
259
  function $() {
260
- const t = S(y);
260
+ const t = C(T);
261
261
  if (!t)
262
262
  throw new Error("useTableSort must be used within a DataTableProvider");
263
263
  return [
@@ -282,43 +282,43 @@ const U = (t) => t ? t === "end" ? "flex-end" : "center" : "flex-start", X = R.d
282
282
  transition: opacity 0.2s;
283
283
  }
284
284
  `;
285
- function W({
285
+ function A({
286
286
  field: t,
287
- sorted: a,
288
- ascending: e,
287
+ sorted: e,
288
+ ascending: a,
289
289
  className: n,
290
290
  onClick: s
291
291
  }) {
292
292
  if (t.visible === !1)
293
293
  return null;
294
294
  if (!t.sortable)
295
- return /* @__PURE__ */ l(C, { field: t, className: n });
295
+ return /* @__PURE__ */ l(S, { field: t, className: n });
296
296
  const { className: r, ...c } = t.thProps ?? {}, u = m(
297
297
  n,
298
298
  r,
299
299
  { [`text-${t.align}`]: !!t.align }
300
300
  ), i = () => {
301
- s({ field: t.field, ascending: a ? !e : !0 });
301
+ s({ field: t.field, ascending: e ? !a : !0 });
302
302
  }, d = {
303
- "bi-arrow-down": e,
304
- "bi-arrow-up": !e
303
+ "bi-arrow-down": a,
304
+ "bi-arrow-up": !a
305
305
  };
306
- return /* @__PURE__ */ l("th", { ...c, className: m("sortable", u), scope: "col", onClick: i, children: /* @__PURE__ */ h(X, { sorted: a, align: t.align, children: [
306
+ return /* @__PURE__ */ l("th", { ...c, className: m("sortable", u), scope: "col", onClick: i, children: /* @__PURE__ */ h(X, { sorted: e, align: t.align, children: [
307
307
  /* @__PURE__ */ l("div", { className: "field-title", children: t.title }),
308
308
  /* @__PURE__ */ l("div", { className: m("me-1 sort-icon", d) })
309
309
  ] }) });
310
310
  }
311
- W.displayName = "SortableTableTH";
312
- function A({
311
+ A.displayName = "SortableTableTH";
312
+ function B({
313
313
  onChangeSort: t
314
314
  }) {
315
- const [a] = v(), [e] = $();
316
- return /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: a.map((n, s) => /* @__PURE__ */ l(
317
- W,
315
+ const [e] = v(), [a] = $();
316
+ return /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((n, s) => /* @__PURE__ */ l(
317
+ A,
318
318
  {
319
319
  field: n,
320
- sorted: e?.field === n.field,
321
- ascending: e?.ascending,
320
+ sorted: a?.field === n.field,
321
+ ascending: a?.ascending,
322
322
  className: m(
323
323
  typeof n.className == "function" ? { [`text-${n.align}`]: !!n.align } : n.className
324
324
  ),
@@ -327,18 +327,18 @@ function A({
327
327
  s
328
328
  )) }) });
329
329
  }
330
- A.displayName = "SortableTableHead";
331
- function B({
330
+ B.displayName = "SortableTableHead";
331
+ function V({
332
332
  onChangeSort: t
333
333
  }) {
334
- const [a] = v(), [e] = $();
335
- return /* @__PURE__ */ l(A, { fields: a, currentSort: e, onChangeSort: t });
334
+ const [e] = v(), [a] = $();
335
+ return /* @__PURE__ */ l(B, { fields: e, currentSort: a, onChangeSort: t });
336
336
  }
337
- B.displayName = "SortableTableHeadWrapper";
338
- function V({
337
+ V.displayName = "SortableTableHeadWrapper";
338
+ function W({
339
339
  className: t,
340
- size: a,
341
- responsive: e,
340
+ size: e,
341
+ responsive: a,
342
342
  sticky: n,
343
343
  data: s,
344
344
  keyField: r,
@@ -352,12 +352,12 @@ function V({
352
352
  onChangeSort: f,
353
353
  ...N
354
354
  }) {
355
- const T = m("table", t, {
356
- [`table-${a}`]: !!a
355
+ const y = m("table", t, {
356
+ [`table-${e}`]: !!e
357
357
  });
358
- return /* @__PURE__ */ h(P, { className: T, responsive: e, sticky: n, ...N, children: [
358
+ return /* @__PURE__ */ h(P, { className: y, responsive: a, sticky: n, ...N, children: [
359
359
  /* @__PURE__ */ l(H, {}),
360
- /* @__PURE__ */ l(B, { onChangeSort: f, ...o }),
360
+ /* @__PURE__ */ l(V, { onChangeSort: f, ...o }),
361
361
  !!s.length && /* @__PURE__ */ l(
362
362
  k,
363
363
  {
@@ -373,36 +373,36 @@ function V({
373
373
  p
374
374
  ] });
375
375
  }
376
- V.displayName = "SortableTable";
376
+ W.displayName = "ContainedSortableTable";
377
377
  function Y({ nextSort: t }) {
378
- const [, a] = $();
378
+ const [, e] = $();
379
379
  return q(() => {
380
- console.log("setNextSort", t), a(t);
381
- }, [t, a]), null;
380
+ console.log("setNextSort", t), e(t);
381
+ }, [t, e]), null;
382
382
  }
383
383
  function Z({
384
384
  fields: t,
385
- currentSort: a,
386
- ...e
385
+ currentSort: e,
386
+ ...a
387
387
  }) {
388
- return /* @__PURE__ */ h(x, { initialFields: t, initialSort: a, children: [
389
- /* @__PURE__ */ l(Y, { nextSort: a }),
390
- /* @__PURE__ */ l(V, { ...e })
388
+ return /* @__PURE__ */ h(x, { initialFields: t, initialSort: e, children: [
389
+ /* @__PURE__ */ l(Y, { nextSort: e }),
390
+ /* @__PURE__ */ l(W, { ...a })
391
391
  ] });
392
392
  }
393
- Z.displayName = "StandaloneSortableTable";
393
+ Z.displayName = "SortableTable";
394
394
  const z = [10, 25, 50, 100, 250, 500, 1e3];
395
395
  function G({
396
396
  value: t,
397
- pageValues: a = z,
398
- size: e,
397
+ pageValues: e = z,
398
+ size: a,
399
399
  label: n,
400
400
  className: s,
401
401
  onChange: r,
402
402
  ...c
403
403
  }) {
404
- const u = K(), i = (b) => r(Number(b.target.value)), d = s ?? m("form-select", { [`form-select-${e}`]: !!e }), o = m("input-group", {
405
- [`input-group-${e}`]: !!e
404
+ const u = K(), i = (b) => r(Number(b.target.value)), d = s ?? m("form-select", { [`form-select-${a}`]: !!a }), o = m("input-group", {
405
+ [`input-group-${a}`]: !!a
406
406
  });
407
407
  return /* @__PURE__ */ h("div", { className: o, children: [
408
408
  /* @__PURE__ */ l("label", { className: "input-group-text", htmlFor: u, children: n ?? "Rows" }),
@@ -414,7 +414,7 @@ function G({
414
414
  value: t,
415
415
  onChange: i,
416
416
  ...c,
417
- children: a.map((b) => /* @__PURE__ */ l("option", { value: b, children: b }, b))
417
+ children: e.map((b) => /* @__PURE__ */ l("option", { value: b, children: b }, b))
418
418
  }
419
419
  )
420
420
  ] }, t);
@@ -422,8 +422,8 @@ function G({
422
422
  G.displayName = "RowsPerPage";
423
423
  function tt({
424
424
  page: t,
425
- rowsPerPage: a,
426
- onChangePage: e,
425
+ rowsPerPage: e,
426
+ onChangePage: a,
427
427
  count: n,
428
428
  size: s,
429
429
  showFirst: r,
@@ -432,9 +432,9 @@ function tt({
432
432
  rowsPerPageProps: i,
433
433
  ...d
434
434
  }) {
435
- const o = n === 0 ? 0 : t * a + 1, b = Math.min(t * a + a, n), p = a === 0 ? 0 : Math.floor((n - 1) / a), f = m("btn btn-link", { [`btn-${s}`]: !!s });
435
+ const o = n === 0 ? 0 : t * e + 1, b = Math.min(t * e + e, n), p = e === 0 ? 0 : Math.floor((n - 1) / e), f = m("btn btn-link", { [`btn-${s}`]: !!s });
436
436
  return /* @__PURE__ */ h("div", { className: m("row g-3 justify-content-end", u), ...d, children: [
437
- !!i && /* @__PURE__ */ l("div", { className: "col-auto", children: /* @__PURE__ */ l(G, { ...i, value: a, size: s }) }),
437
+ !!i && /* @__PURE__ */ l("div", { className: "col-auto", children: /* @__PURE__ */ l(G, { ...i, value: e, size: s }) }),
438
438
  /* @__PURE__ */ l("div", { className: "col-auto", children: /* @__PURE__ */ h("div", { className: "row g-3 flex-nowrap align-items-baseline", children: [
439
439
  /* @__PURE__ */ h("div", { className: "col-auto", children: [
440
440
  o,
@@ -448,7 +448,7 @@ function tt({
448
448
  {
449
449
  className: f,
450
450
  disabled: t === 0,
451
- onClick: () => e(0),
451
+ onClick: () => a(0),
452
452
  "aria-label": "First page",
453
453
  children: /* @__PURE__ */ l("span", { className: "bi-chevron-bar-left", "aria-hidden": "true" })
454
454
  }
@@ -458,7 +458,7 @@ function tt({
458
458
  {
459
459
  className: f,
460
460
  disabled: t === 0,
461
- onClick: () => e(t - 1),
461
+ onClick: () => a(t - 1),
462
462
  "aria-label": "Previous page",
463
463
  children: /* @__PURE__ */ l("span", { className: "bi-chevron-left", "aria-hidden": "true" })
464
464
  }
@@ -468,7 +468,7 @@ function tt({
468
468
  {
469
469
  className: f,
470
470
  disabled: t >= p,
471
- onClick: () => e(t + 1),
471
+ onClick: () => a(t + 1),
472
472
  "aria-label": "Next page",
473
473
  children: /* @__PURE__ */ l("span", { className: "bi-chevron-right", "aria-hidden": "true" })
474
474
  }
@@ -478,7 +478,7 @@ function tt({
478
478
  {
479
479
  className: f,
480
480
  disabled: t >= p,
481
- onClick: () => e(p),
481
+ onClick: () => a(p),
482
482
  "aria-label": "Last page",
483
483
  children: /* @__PURE__ */ l("span", { className: "bi-chevron-bar-right", "aria-hidden": "true" })
484
484
  }
@@ -489,46 +489,46 @@ function tt({
489
489
  tt.displayname = "TablePagination";
490
490
  function H() {
491
491
  const [t] = v();
492
- return /* @__PURE__ */ l("colgroup", { children: t.filter((a) => a.visible !== !1).map((a, e) => /* @__PURE__ */ l(
492
+ return /* @__PURE__ */ l("colgroup", { children: t.filter((e) => e.visible !== !1).map((e, a) => /* @__PURE__ */ l(
493
493
  "col",
494
494
  {
495
- className: a.colClassName,
496
- span: a.colSpan ?? 1
495
+ className: e.colClassName,
496
+ span: e.colSpan ?? 1
497
497
  },
498
- e
498
+ a
499
499
  )) });
500
500
  }
501
501
  H.displayName = "DataTableCols";
502
502
  function lt(t) {
503
- const a = S(y);
504
- if (!a)
503
+ const e = C(T);
504
+ if (!e)
505
505
  throw new Error("useField must be used within a DataTableProvider");
506
506
  return [
507
- a.fields.find((e) => e.id === t) ?? null,
508
- a.updateField
507
+ e.fields.find((a) => a.id === t) ?? null,
508
+ e.updateField
509
509
  ];
510
510
  }
511
511
  function st() {
512
- const t = S(y);
512
+ const t = C(T);
513
513
  if (!t)
514
514
  throw new Error("useTableContext must be used within a DataTableProvider");
515
515
  return t;
516
516
  }
517
517
  export {
518
+ _ as ContainedDataTable,
519
+ M as ContainedDataTableRow,
520
+ W as ContainedSortableTable,
518
521
  O as DataTable,
519
522
  H as DataTableCols,
520
- y as DataTableContext,
523
+ T as DataTableContext,
521
524
  x as DataTableProvider,
522
- M as DataTableRow,
525
+ Q as DataTableRow,
523
526
  k as DataTableTBody,
524
- C as DataTableTH,
525
- _ as DataTableWithContext,
527
+ S as DataTableTH,
526
528
  G as RowsPerPage,
527
- V as SortableTable,
528
- A as SortableTableHead,
529
- W as SortableTableTH,
530
- Q as StandaloneDataTableRow,
531
- Z as StandaloneSortableTable,
529
+ Z as SortableTable,
530
+ B as SortableTableHead,
531
+ A as SortableTableTH,
532
532
  tt as TablePagination,
533
533
  lt as useField,
534
534
  st as useTableContext,