@cascivo/react 0.16.0 → 0.17.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 (99) hide show
  1. package/README.md +6 -1
  2. package/dist/accordion/accordion.js +5 -4
  3. package/dist/app-shell/app-shell.css +1 -1
  4. package/dist/app-shell/app-shell.js +28 -26
  5. package/dist/app-shell/app-shell.module.js +8 -8
  6. package/dist/badge/badge.js +1 -1
  7. package/dist/button/button.css +1 -1
  8. package/dist/button/button.js +4 -1
  9. package/dist/button/button.module.js +4 -1
  10. package/dist/calendar/calendar.js +67 -63
  11. package/dist/card/card.css +1 -1
  12. package/dist/card/card.module.js +8 -8
  13. package/dist/checkbox/checkbox.css +1 -1
  14. package/dist/checkbox/checkbox.module.js +4 -4
  15. package/dist/combobox/combobox.js +55 -54
  16. package/dist/context-menu/context-menu.js +42 -38
  17. package/dist/data-table/data-table.css +1 -1
  18. package/dist/data-table/data-table.js +155 -160
  19. package/dist/data-table/data-table.module.js +29 -29
  20. package/dist/date-picker/date-picker.js +90 -89
  21. package/dist/field/field.css +1 -1
  22. package/dist/field/field.module.js +3 -3
  23. package/dist/index.d.ts +307 -145
  24. package/dist/infinite-scroll/infinite-scroll.css +1 -0
  25. package/dist/infinite-scroll/infinite-scroll.js +49 -0
  26. package/dist/infinite-scroll/infinite-scroll.module.js +8 -0
  27. package/dist/large-title-header/large-title-header.css +1 -0
  28. package/dist/large-title-header/large-title-header.js +38 -0
  29. package/dist/large-title-header/large-title-header.module.js +13 -0
  30. package/dist/layouts/src/grid/grid.css +1 -1
  31. package/dist/layouts/src/grid/grid.module.js +3 -3
  32. package/dist/link/link.css +1 -1
  33. package/dist/link/link.module.js +1 -1
  34. package/dist/menu/menu.js +47 -43
  35. package/dist/node/accordion/accordion.js +5 -4
  36. package/dist/node/app-shell/app-shell.js +28 -26
  37. package/dist/node/app-shell/app-shell.module.js +8 -8
  38. package/dist/node/badge/badge.js +1 -1
  39. package/dist/node/button/button.js +4 -1
  40. package/dist/node/button/button.module.js +4 -1
  41. package/dist/node/calendar/calendar.js +67 -63
  42. package/dist/node/card/card.module.js +8 -8
  43. package/dist/node/checkbox/checkbox.module.js +4 -4
  44. package/dist/node/combobox/combobox.js +55 -54
  45. package/dist/node/context-menu/context-menu.js +42 -38
  46. package/dist/node/data-table/data-table.js +155 -160
  47. package/dist/node/data-table/data-table.module.js +29 -29
  48. package/dist/node/date-picker/date-picker.js +90 -89
  49. package/dist/node/field/field.module.js +3 -3
  50. package/dist/node/infinite-scroll/infinite-scroll.js +49 -0
  51. package/dist/node/infinite-scroll/infinite-scroll.module.js +7 -0
  52. package/dist/node/large-title-header/large-title-header.js +38 -0
  53. package/dist/node/large-title-header/large-title-header.module.js +12 -0
  54. package/dist/node/layouts/src/grid/grid.module.js +3 -3
  55. package/dist/node/link/link.module.js +1 -1
  56. package/dist/node/menu/menu.js +47 -43
  57. package/dist/node/react/src/index.js +27 -23
  58. package/dist/node/reorder-list/reorder-list.js +143 -0
  59. package/dist/node/reorder-list/reorder-list.module.js +11 -0
  60. package/dist/node/search/search.js +5 -4
  61. package/dist/node/side-nav/side-nav.js +90 -89
  62. package/dist/node/skip-nav/skip-nav.js +1 -0
  63. package/dist/node/swap/swap.js +2 -3
  64. package/dist/node/switcher/switcher.js +1 -1
  65. package/dist/node/tabs/tabs.js +41 -40
  66. package/dist/node/tag/tag.module.js +2 -2
  67. package/dist/node/toc/toc.js +5 -4
  68. package/dist/node/virtual-list/virtual-list.js +40 -0
  69. package/dist/node/virtual-list/virtual-list.module.js +7 -0
  70. package/dist/node/wheel-picker/wheel-picker.js +84 -0
  71. package/dist/node/wheel-picker/wheel-picker.module.js +8 -0
  72. package/dist/react/src/index.js +27 -23
  73. package/dist/reorder-list/reorder-list.css +1 -0
  74. package/dist/reorder-list/reorder-list.js +143 -0
  75. package/dist/reorder-list/reorder-list.module.js +12 -0
  76. package/dist/search/search.js +5 -4
  77. package/dist/side-nav/side-nav.js +90 -89
  78. package/dist/skip-nav/skip-nav.js +1 -0
  79. package/dist/styles.css +48 -11
  80. package/dist/swap/swap.js +2 -3
  81. package/dist/switcher/switcher.js +1 -1
  82. package/dist/tabs/tabs.js +41 -40
  83. package/dist/tag/tag.css +1 -1
  84. package/dist/tag/tag.module.js +2 -2
  85. package/dist/toc/toc.js +5 -4
  86. package/dist/virtual-list/virtual-list.css +1 -0
  87. package/dist/virtual-list/virtual-list.js +40 -0
  88. package/dist/virtual-list/virtual-list.module.js +8 -0
  89. package/dist/wheel-picker/wheel-picker.css +1 -0
  90. package/dist/wheel-picker/wheel-picker.js +84 -0
  91. package/dist/wheel-picker/wheel-picker.module.js +9 -0
  92. package/package.json +4 -4
  93. package/readme.body.md +6 -1
  94. package/dist/node/react/src/theme.js +0 -78
  95. package/dist/node/storage/src/drivers.js +0 -34
  96. package/dist/node/storage/src/persisted-signal.js +0 -41
  97. package/dist/react/src/theme.js +0 -78
  98. package/dist/storage/src/drivers.js +0 -34
  99. package/dist/storage/src/persisted-signal.js +0 -41
@@ -4,70 +4,67 @@ import { Button as e } from "../button/button.js";
4
4
  import { Checkbox as t } from "../checkbox/checkbox.js";
5
5
  import n from "./data-table.module.js";
6
6
  import { Fragment as r, useId as i, useRef as a } from "react";
7
- import { batch as o, cn as s, useComputed as c, useSignal as l, useSignalEffect as ee, useSignals as te } from "@cascivo/core";
8
- import { builtin as u, t as d } from "@cascivo/i18n";
9
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { batch as o, cn as s, useComputed as c, useControllableSignal as l, useSignal as u, useSignalEffect as ee, useSignals as te } from "@cascivo/core";
8
+ import { builtin as d, t as f } from "@cascivo/i18n";
9
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
10
  import { flushSync as ne } from "react-dom";
11
11
  //#region ../components/src/data-table/data-table.tsx
12
- function m(e, t) {
12
+ function h(e, t) {
13
13
  return e[t];
14
14
  }
15
15
  function re(e, t) {
16
16
  return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
17
17
  }
18
- function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMode: ae = "client", onSortChange: oe, searchable: se = !1, pagination: y, selection: b, batchActions: x, renderExpandedRow: S, density: ce = "normal", zebra: le = !1, stickyHeader: ue = !1, loading: C = !1, emptyState: de, title: w, description: T, labels: E, className: fe, virtualized: D = !1, rowHeight: O = 40, windowSize: pe = 20, overscan: me = 3 }) {
18
+ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortMode: se = "client", onSortChange: ce, searchable: v = !1, pagination: y, selection: b, batchActions: x, renderExpandedRow: S, density: le = "normal", zebra: ue = !1, stickyHeader: de = !1, loading: C = !1, emptyState: fe, title: w, description: T, labels: E, className: pe, virtualized: D = !1, rowHeight: O = 40, windowSize: me = 20, overscan: he = 3 }) {
19
19
  te();
20
- let he = i(), k = {
21
- search: E?.search ?? d(u.dataTable.search),
22
- empty: E?.empty ?? d(u.dataTable.empty),
23
- selectAll: E?.selectAll ?? d(u.dataTable.selectAll),
24
- selectRow: E?.selectRow ?? d(u.dataTable.selectRow),
25
- itemsSelected: (e) => E?.itemsSelected?.(e) ?? d(u.dataTable.itemsSelected, { count: e }),
26
- expandRow: E?.expandRow ?? d(u.dataTable.expandRow),
27
- previousPage: E?.previousPage ?? d(u.dataTable.previousPage),
28
- nextPage: E?.nextPage ?? d(u.dataTable.nextPage)
29
- }, ge = l(g);
30
- ge.value = g;
31
- let _e = l(h);
32
- _e.value = h;
33
- let A = l(v ?? ie);
34
- v !== void 0 && (A.value = v);
35
- let j = l(b?.selected ?? []);
36
- b?.selected !== void 0 && (j.value = b.selected);
37
- let M = l(""), N = l(1), P = l(y?.pageSize ?? 0), F = l(/* @__PURE__ */ new Set()), I = a(null), L = l(0);
20
+ let k = i(), A = {
21
+ search: E?.search ?? f(d.dataTable.search),
22
+ empty: E?.empty ?? f(d.dataTable.empty),
23
+ selectAll: E?.selectAll ?? f(d.dataTable.selectAll),
24
+ selectRow: E?.selectRow ?? f(d.dataTable.selectRow),
25
+ itemsSelected: (e) => E?.itemsSelected?.(e) ?? f(d.dataTable.itemsSelected, { count: e }),
26
+ expandRow: E?.expandRow ?? f(d.dataTable.expandRow),
27
+ previousPage: E?.previousPage ?? f(d.dataTable.previousPage),
28
+ nextPage: E?.nextPage ?? f(d.dataTable.nextPage)
29
+ }, [ge] = l({ value: ie }), [_e] = l({ value: g }), [j, ve] = l({
30
+ value: ae,
31
+ defaultValue: oe
32
+ }), M = u([]), N = b?.selected ?? M.value, P = (e) => {
33
+ b?.selected === void 0 && (M.value = e), b?.onChange?.(e);
34
+ }, F = u(""), I = u(1), L = u(y?.pageSize ?? 0), R = u(/* @__PURE__ */ new Set()), z = a(null), B = u(0);
38
35
  ee(() => {
39
36
  if (!D) return;
40
- let e = I.current;
37
+ let e = z.current;
41
38
  if (!e) return;
42
39
  let t = () => {
43
40
  ne(() => {
44
- L.value = e.scrollTop;
41
+ B.value = e.scrollTop;
45
42
  });
46
43
  };
47
44
  return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
48
45
  });
49
- let R = c(() => ge.value.map((e, t) => ({
46
+ let V = c(() => ge.value.map((e, t) => ({
50
47
  row: e,
51
48
  id: _ ? _(e) : String(t)
52
- }))), z = c(() => {
53
- let e = M.value.trim().toLowerCase();
54
- if (!e) return R.value;
49
+ }))), H = c(() => {
50
+ let e = F.value.trim().toLowerCase();
51
+ if (!e) return V.value;
55
52
  let t = _e.value;
56
- return R.value.filter((n) => t.some((t) => String(m(n.row, t.key) ?? "").toLowerCase().includes(e)));
57
- }), B = c(() => {
58
- let e = A.value;
59
- if (!e || ae === "server") return z.value;
60
- let t = z.value.map((e, t) => [e, t]);
53
+ return V.value.filter((n) => t.some((t) => String(h(n.row, t.key) ?? "").toLowerCase().includes(e)));
54
+ }), U = c(() => {
55
+ let e = j.value;
56
+ if (!e || se === "server") return H.value;
57
+ let t = H.value.map((e, t) => [e, t]);
61
58
  return t.sort((t, n) => {
62
- let r = re(m(t[0].row, e.key), m(n[0].row, e.key));
59
+ let r = re(h(t[0].row, e.key), h(n[0].row, e.key));
63
60
  return e.direction === "desc" && (r = -r), r === 0 ? t[1] - n[1] : r;
64
61
  }), t.map(([e]) => e);
65
- }), ve = c(() => y ? Math.max(1, Math.ceil(z.value.length / P.value)) : 1), V = c(() => Math.min(N.value, ve.value)), H = c(() => {
66
- if (!y) return B.value;
67
- let e = (V.value - 1) * P.value;
68
- return B.value.slice(e, e + P.value);
69
- }), U = c(() => D ? Math.floor(L.value / O) : 0), ye = c(() => D ? Math.min(U.value + pe + me * 2, H.value.length) : H.value.length), be = c(() => D ? H.value.slice(U.value, ye.value) : H.value), xe = (e) => {
70
- let t = A.value, n;
62
+ }), ye = c(() => y ? Math.max(1, Math.ceil(H.value.length / L.value)) : 1), W = c(() => Math.min(I.value, ye.value)), G = c(() => {
63
+ if (!y) return U.value;
64
+ let e = (W.value - 1) * L.value;
65
+ return U.value.slice(e, e + L.value);
66
+ }), K = c(() => D ? Math.floor(B.value / O) : 0), be = c(() => D ? Math.min(K.value + me + he * 2, G.value.length) : G.value.length), xe = c(() => D ? G.value.slice(K.value, be.value) : G.value), Se = (e) => {
67
+ let t = j.value, n;
71
68
  n = !t || t.key !== e ? {
72
69
  key: e,
73
70
  direction: "asc"
@@ -75,9 +72,9 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
75
72
  key: e,
76
73
  direction: "desc"
77
74
  } : void 0, o(() => {
78
- v === void 0 && (A.value = n), N.value = 1;
79
- }), oe?.(n);
80
- }, Se = (e) => {
75
+ ve(n), I.value = 1;
76
+ }), ce?.(n);
77
+ }, Ce = (e) => {
81
78
  if (![
82
79
  "ArrowUp",
83
80
  "ArrowDown",
@@ -99,194 +96,192 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
99
96
  }
100
97
  }
101
98
  a?.focus();
102
- }, W = (e) => {
103
- b?.selected === void 0 && (j.value = e), b?.onChange?.(e);
104
- }, Ce = (e) => {
105
- let t = j.value;
106
- b?.mode === "single" ? W(t.includes(e) ? [] : [e]) : W(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
107
99
  }, we = (e) => {
108
- let t = new Set(F.value);
109
- t.has(e) ? t.delete(e) : t.add(e), F.value = t;
110
- }, G = H.value, K = j.value, Te = F.value, q = G.length > 0 && G.every((e) => K.includes(e.id)), Ee = G.some((e) => K.includes(e.id)), J = be.value, Y = U.value, X = ye.value, De = () => {
111
- let e = G.map((e) => e.id);
112
- W(q ? K.filter((t) => !e.includes(t)) : [...new Set([...K, ...e])]);
113
- }, Z = h.length + +!!b + +!!S, Oe = y && !D && J.length > 0 ? Math.max(0, P.value - J.length) : 0, ke = `${he}-title`, Ae = `${he}-description`, Q = z.value.length, $ = Q === 0 ? 0 : (V.value - 1) * P.value + 1, je = Q === 0 ? 0 : $ + G.length - 1, Me = !!x && x.length > 0 && K.length > 0;
114
- return /* @__PURE__ */ p("div", {
115
- className: s(n.root, fe),
116
- "data-density": ce,
117
- "data-zebra": le || void 0,
118
- "data-sticky-header": ue || void 0,
100
+ let t = N;
101
+ b?.mode === "single" ? P(t.includes(e) ? [] : [e]) : P(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
102
+ }, Te = (e) => {
103
+ let t = new Set(R.value);
104
+ t.has(e) ? t.delete(e) : t.add(e), R.value = t;
105
+ }, q = G.value, Ee = R.value, J = q.length > 0 && q.every((e) => N.includes(e.id)), De = q.some((e) => N.includes(e.id)), Y = xe.value, X = K.value, Oe = be.value, ke = () => {
106
+ let e = q.map((e) => e.id);
107
+ P(J ? N.filter((t) => !e.includes(t)) : [...new Set([...N, ...e])]);
108
+ }, Z = g.length + +!!b + +!!S, Ae = y && !D && Y.length > 0 ? Math.max(0, L.value - Y.length) : 0, je = `${k}-title`, Me = `${k}-description`, Q = H.value.length, $ = Q === 0 ? 0 : (W.value - 1) * L.value + 1, Ne = Q === 0 ? 0 : $ + q.length - 1, Pe = !!x && x.length > 0 && N.length > 0;
109
+ return /* @__PURE__ */ m("div", {
110
+ className: s(n.root, pe),
111
+ "data-density": le,
112
+ "data-zebra": ue || void 0,
113
+ "data-sticky-header": de || void 0,
119
114
  "data-paginated": y ? !0 : void 0,
120
- "data-fixed-layout": h.every((e) => e.width !== void 0) || void 0,
115
+ "data-fixed-layout": g.every((e) => e.width !== void 0) || void 0,
121
116
  children: [
122
- /* @__PURE__ */ f("span", {
117
+ /* @__PURE__ */ p("span", {
123
118
  "aria-live": "polite",
124
119
  className: n.srOnly,
125
- children: j.value.length > 0 ? k.itemsSelected(j.value.length) : ""
120
+ children: N.length > 0 ? A.itemsSelected(N.length) : ""
126
121
  }),
127
- (w !== void 0 || T !== void 0 || se) && /* @__PURE__ */ p("div", {
122
+ (w !== void 0 || T !== void 0 || v) && /* @__PURE__ */ m("div", {
128
123
  className: n.toolbar,
129
- children: [(w !== void 0 || T !== void 0) && /* @__PURE__ */ p("div", {
124
+ children: [(w !== void 0 || T !== void 0) && /* @__PURE__ */ m("div", {
130
125
  className: n.heading,
131
- children: [w !== void 0 && /* @__PURE__ */ f("div", {
132
- id: ke,
126
+ children: [w !== void 0 && /* @__PURE__ */ p("div", {
127
+ id: je,
133
128
  className: n.title,
134
129
  children: w
135
- }), T !== void 0 && /* @__PURE__ */ f("div", {
136
- id: Ae,
130
+ }), T !== void 0 && /* @__PURE__ */ p("div", {
131
+ id: Me,
137
132
  className: n.description,
138
133
  children: T
139
134
  })]
140
- }), se && /* @__PURE__ */ f("input", {
135
+ }), v && /* @__PURE__ */ p("input", {
141
136
  type: "search",
142
137
  className: n.search,
143
- "aria-label": k.search,
144
- placeholder: k.search,
145
- value: M.value,
138
+ "aria-label": A.search,
139
+ placeholder: A.search,
140
+ value: F.value,
146
141
  onChange: (e) => {
147
- M.value = e.target.value, N.value = 1;
142
+ F.value = e.target.value, I.value = 1;
148
143
  }
149
144
  })]
150
145
  }),
151
- Me && /* @__PURE__ */ p("div", {
146
+ Pe && /* @__PURE__ */ m("div", {
152
147
  className: n.batchBar,
153
- children: [/* @__PURE__ */ f("span", {
148
+ children: [/* @__PURE__ */ p("span", {
154
149
  className: n.batchCount,
155
- children: k.itemsSelected(K.length)
156
- }), /* @__PURE__ */ f("div", {
150
+ children: A.itemsSelected(N.length)
151
+ }), /* @__PURE__ */ p("div", {
157
152
  className: n.batchActions,
158
- children: x.map((t, n) => /* @__PURE__ */ f(e, {
153
+ children: x.map((t, n) => /* @__PURE__ */ p(e, {
159
154
  size: "sm",
160
155
  variant: "secondary",
161
- onClick: () => t.onClick(K),
156
+ onClick: () => t.onClick(N),
162
157
  children: t.label
163
158
  }, t.id ?? `${n}-${t.label}`))
164
159
  })]
165
160
  }),
166
- /* @__PURE__ */ f("div", {
167
- ref: D ? I : void 0,
161
+ /* @__PURE__ */ p("div", {
162
+ ref: D ? z : void 0,
168
163
  className: s(n.scroller, D && n.scrollerVirtualized),
169
- children: /* @__PURE__ */ p("table", {
164
+ children: /* @__PURE__ */ m("table", {
170
165
  className: n.table,
171
- "aria-labelledby": w === void 0 ? void 0 : ke,
172
- "aria-describedby": T === void 0 ? void 0 : Ae,
166
+ "aria-labelledby": w === void 0 ? void 0 : je,
167
+ "aria-describedby": T === void 0 ? void 0 : Me,
173
168
  "aria-busy": C || void 0,
174
- "aria-rowcount": D ? G.length : void 0,
175
- onKeyDown: Se,
169
+ "aria-rowcount": D ? q.length : void 0,
170
+ onKeyDown: Ce,
176
171
  children: [
177
- /* @__PURE__ */ p("colgroup", { children: [
178
- S && /* @__PURE__ */ f("col", { className: n.controlCol }),
179
- b && /* @__PURE__ */ f("col", { className: n.controlCol }),
180
- h.map((e) => /* @__PURE__ */ f("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
172
+ /* @__PURE__ */ m("colgroup", { children: [
173
+ S && /* @__PURE__ */ p("col", { className: n.controlCol }),
174
+ b && /* @__PURE__ */ p("col", { className: n.controlCol }),
175
+ g.map((e) => /* @__PURE__ */ p("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
181
176
  ...e.width === void 0 ? {} : { width: e.width },
182
177
  ...e.minWidth === void 0 ? {} : { minWidth: e.minWidth }
183
178
  } : void 0 }, e.key))
184
179
  ] }),
185
- /* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
186
- S && /* @__PURE__ */ f("th", {
180
+ /* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [
181
+ S && /* @__PURE__ */ p("th", {
187
182
  scope: "col",
188
183
  className: n.controlCell,
189
- children: /* @__PURE__ */ f("span", {
184
+ children: /* @__PURE__ */ p("span", {
190
185
  className: n.srOnly,
191
- children: k.expandRow
186
+ children: A.expandRow
192
187
  })
193
188
  }),
194
- b && /* @__PURE__ */ f("th", {
189
+ b && /* @__PURE__ */ p("th", {
195
190
  scope: "col",
196
191
  className: n.controlCell,
197
- children: b.mode === "multi" ? /* @__PURE__ */ f(t, {
198
- "aria-label": k.selectAll,
199
- checked: q,
200
- indeterminate: Ee && !q,
201
- onChange: De
202
- }) : /* @__PURE__ */ f("span", {
192
+ children: b.mode === "multi" ? /* @__PURE__ */ p(t, {
193
+ "aria-label": A.selectAll,
194
+ checked: J,
195
+ indeterminate: De && !J,
196
+ onChange: ke
197
+ }) : /* @__PURE__ */ p("span", {
203
198
  className: n.srOnly,
204
- children: k.selectRow
199
+ children: A.selectRow
205
200
  })
206
201
  }),
207
- h.map((e) => {
208
- let t = A.value?.key === e.key ? A.value.direction : void 0, r = t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
209
- return /* @__PURE__ */ f("th", {
202
+ g.map((e) => {
203
+ let t = j.value?.key === e.key ? j.value.direction : void 0, r = t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
204
+ return /* @__PURE__ */ p("th", {
210
205
  scope: "col",
211
206
  "data-align": e.align ?? "start",
212
207
  "data-sized": e.width !== void 0 || void 0,
213
208
  "aria-sort": e.sortable ? r : void 0,
214
- children: e.sortable ? /* @__PURE__ */ f("button", {
209
+ children: e.sortable ? /* @__PURE__ */ p("button", {
215
210
  type: "button",
216
211
  className: n.sortButton,
217
212
  "data-state": r,
218
- onClick: () => xe(e.key),
213
+ onClick: () => Se(e.key),
219
214
  children: e.header
220
215
  }) : e.header
221
216
  }, e.key);
222
217
  })
223
218
  ] }) }),
224
- /* @__PURE__ */ p("tbody", { children: [
225
- C && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ f("tr", {
219
+ /* @__PURE__ */ m("tbody", { children: [
220
+ C && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ p("tr", {
226
221
  className: n.row,
227
- children: Array.from({ length: Z }, (e, t) => /* @__PURE__ */ f("td", { children: /* @__PURE__ */ f("span", {
222
+ children: Array.from({ length: Z }, (e, t) => /* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("span", {
228
223
  className: n.shimmer,
229
224
  "aria-hidden": "true"
230
225
  }) }, t))
231
226
  }, t)),
232
- !C && G.length === 0 && /* @__PURE__ */ f("tr", {
227
+ !C && q.length === 0 && /* @__PURE__ */ p("tr", {
233
228
  "data-empty-row": !0,
234
- children: /* @__PURE__ */ f("td", {
229
+ children: /* @__PURE__ */ p("td", {
235
230
  colSpan: Z,
236
231
  className: n.emptyCell,
237
- children: de ?? k.empty
232
+ children: fe ?? A.empty
238
233
  })
239
234
  }),
240
- !C && D && Y > 0 && /* @__PURE__ */ f("tr", {
235
+ !C && D && X > 0 && /* @__PURE__ */ p("tr", {
241
236
  "aria-hidden": "true",
242
- style: { height: Y * O }
237
+ style: { height: X * O }
243
238
  }),
244
- !C && J.map((e, i) => {
245
- let a = D ? Y + i : i, o = K.includes(e.id), s = Te.has(e.id);
246
- return /* @__PURE__ */ p(r, { children: [/* @__PURE__ */ p("tr", {
239
+ !C && Y.map((e, i) => {
240
+ let a = D ? X + i : i, o = N.includes(e.id), s = Ee.has(e.id);
241
+ return /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ m("tr", {
247
242
  className: n.row,
248
243
  "data-parity": a % 2 == 0 ? "even" : "odd",
249
244
  "data-state": o ? "selected" : void 0,
250
- "aria-rowindex": D ? Y + i + 1 : void 0,
245
+ "aria-rowindex": D ? X + i + 1 : void 0,
251
246
  children: [
252
- S && /* @__PURE__ */ f("td", {
247
+ S && /* @__PURE__ */ p("td", {
253
248
  className: n.controlCell,
254
- children: /* @__PURE__ */ f("button", {
249
+ children: /* @__PURE__ */ p("button", {
255
250
  type: "button",
256
251
  className: n.expandButton,
257
252
  "aria-expanded": s,
258
- "aria-label": k.expandRow,
253
+ "aria-label": A.expandRow,
259
254
  "data-state": s ? "open" : "closed",
260
- onClick: () => we(e.id),
261
- children: /* @__PURE__ */ f("span", {
255
+ onClick: () => Te(e.id),
256
+ children: /* @__PURE__ */ p("span", {
262
257
  className: n.chevron,
263
258
  "aria-hidden": "true"
264
259
  })
265
260
  })
266
261
  }),
267
- b && /* @__PURE__ */ f("td", {
262
+ b && /* @__PURE__ */ p("td", {
268
263
  className: n.controlCell,
269
- children: /* @__PURE__ */ f(t, {
270
- "aria-label": k.selectRow,
264
+ children: /* @__PURE__ */ p(t, {
265
+ "aria-label": A.selectRow,
271
266
  checked: o,
272
- onChange: () => Ce(e.id)
267
+ onChange: () => we(e.id)
273
268
  })
274
269
  }),
275
- h.map((t) => /* @__PURE__ */ f("td", {
270
+ g.map((t) => /* @__PURE__ */ p("td", {
276
271
  "data-align": t.align ?? "start",
277
272
  "data-sized": t.width !== void 0 || void 0,
278
- children: t.render ? t.render(e.row) : String(m(e.row, t.key) ?? "")
273
+ children: t.render ? t.render(e.row) : String(h(e.row, t.key) ?? "")
279
274
  }, t.key))
280
275
  ]
281
- }), S && /* @__PURE__ */ f("tr", {
276
+ }), S && /* @__PURE__ */ p("tr", {
282
277
  className: n.expansionRow,
283
278
  "data-state": s ? "open" : "closed",
284
- children: /* @__PURE__ */ f("td", {
279
+ children: /* @__PURE__ */ p("td", {
285
280
  colSpan: Z,
286
- children: /* @__PURE__ */ f("div", {
281
+ children: /* @__PURE__ */ p("div", {
287
282
  className: n.expansionGrid,
288
283
  "data-state": s ? "open" : "closed",
289
- children: /* @__PURE__ */ f("div", {
284
+ children: /* @__PURE__ */ p("div", {
290
285
  className: n.expansionInner,
291
286
  children: S(e.row)
292
287
  })
@@ -294,17 +289,17 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
294
289
  })
295
290
  })] }, e.id);
296
291
  }),
297
- !C && D && X < G.length && /* @__PURE__ */ f("tr", {
292
+ !C && D && Oe < q.length && /* @__PURE__ */ p("tr", {
298
293
  "aria-hidden": "true",
299
- style: { height: (G.length - X) * O }
294
+ style: { height: (q.length - Oe) * O }
300
295
  }),
301
- Oe > 0 && /* @__PURE__ */ f("tr", {
296
+ Ae > 0 && /* @__PURE__ */ p("tr", {
302
297
  "aria-hidden": "true",
303
298
  "data-filler-row": !0,
304
- children: /* @__PURE__ */ f("td", {
299
+ children: /* @__PURE__ */ p("td", {
305
300
  colSpan: Z,
306
301
  style: {
307
- blockSize: `calc(var(--_row-height) * ${Oe})`,
302
+ blockSize: `calc(var(--_row-height) * ${Ae})`,
308
303
  padding: 0
309
304
  }
310
305
  })
@@ -313,55 +308,55 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
313
308
  ]
314
309
  })
315
310
  }),
316
- y && /* @__PURE__ */ p("div", {
311
+ y && /* @__PURE__ */ m("div", {
317
312
  className: n.footer,
318
313
  children: [
319
- y.pageSizeOptions && /* @__PURE__ */ p("label", {
314
+ y.pageSizeOptions && /* @__PURE__ */ m("label", {
320
315
  className: n.pageSize,
321
- children: [/* @__PURE__ */ f("span", { children: "Rows per page" }), /* @__PURE__ */ f("select", {
322
- value: P.value,
316
+ children: [/* @__PURE__ */ p("span", { children: "Rows per page" }), /* @__PURE__ */ p("select", {
317
+ value: L.value,
323
318
  onChange: (e) => {
324
- P.value = Number(e.target.value), N.value = 1;
319
+ L.value = Number(e.target.value), I.value = 1;
325
320
  },
326
- children: y.pageSizeOptions.map((e) => /* @__PURE__ */ f("option", {
321
+ children: y.pageSizeOptions.map((e) => /* @__PURE__ */ p("option", {
327
322
  value: e,
328
323
  children: e
329
324
  }, e))
330
325
  })]
331
326
  }),
332
- /* @__PURE__ */ p("span", {
327
+ /* @__PURE__ */ m("span", {
333
328
  className: n.range,
334
329
  children: [
335
330
  $,
336
331
  "–",
337
- je,
332
+ Ne,
338
333
  " of ",
339
334
  Q
340
335
  ]
341
336
  }),
342
- /* @__PURE__ */ p("div", {
337
+ /* @__PURE__ */ m("div", {
343
338
  className: n.pageButtons,
344
- children: [/* @__PURE__ */ f("button", {
339
+ children: [/* @__PURE__ */ p("button", {
345
340
  type: "button",
346
341
  className: n.pageButton,
347
- "aria-label": k.previousPage,
348
- disabled: V.value <= 1,
342
+ "aria-label": A.previousPage,
343
+ disabled: W.value <= 1,
349
344
  onClick: () => {
350
- N.value = V.value - 1;
345
+ I.value = W.value - 1;
351
346
  },
352
- children: /* @__PURE__ */ f("span", {
347
+ children: /* @__PURE__ */ p("span", {
353
348
  "aria-hidden": "true",
354
349
  children: "‹"
355
350
  })
356
- }), /* @__PURE__ */ f("button", {
351
+ }), /* @__PURE__ */ p("button", {
357
352
  type: "button",
358
353
  className: n.pageButton,
359
- "aria-label": k.nextPage,
360
- disabled: V.value >= ve.value,
354
+ "aria-label": A.nextPage,
355
+ disabled: W.value >= ye.value,
361
356
  onClick: () => {
362
- N.value = V.value + 1;
357
+ I.value = W.value + 1;
363
358
  },
364
- children: /* @__PURE__ */ f("span", {
359
+ children: /* @__PURE__ */ p("span", {
365
360
  "aria-hidden": "true",
366
361
  children: "›"
367
362
  })
@@ -373,4 +368,4 @@ function h({ columns: h, rows: g, getRowId: _, sort: v, defaultSort: ie, sortMod
373
368
  });
374
369
  }
375
370
  //#endregion
376
- export { h as DataTable };
371
+ export { g as DataTable };
@@ -1,34 +1,34 @@
1
1
  import './data-table.css';
2
2
  var e = {
3
- root: "_root_1wd65_2",
4
- toolbar: "_toolbar_1wd65_26",
5
- heading: "_heading_1wd65_35",
6
- title: "_title_1wd65_41",
7
- description: "_description_1wd65_47",
8
- search: "_search_1wd65_52",
9
- batchBar: "_batchBar_1wd65_79",
10
- batchCount: "_batchCount_1wd65_89",
11
- batchActions: "_batchActions_1wd65_95",
12
- scroller: "_scroller_1wd65_101",
13
- scrollerVirtualized: "_scrollerVirtualized_1wd65_111",
14
- table: "_table_1wd65_117",
15
- row: "_row_1wd65_199",
16
- controlCol: "_controlCol_1wd65_205",
17
- controlCell: "_controlCell_1wd65_209",
18
- sortButton: "_sortButton_1wd65_215",
19
- emptyCell: "_emptyCell_1wd65_263",
20
- expansionRow: "_expansionRow_1wd65_270",
21
- expansionGrid: "_expansionGrid_1wd65_276",
22
- expansionInner: "_expansionInner_1wd65_280",
23
- expandButton: "_expandButton_1wd65_285",
24
- chevron: "_chevron_1wd65_308",
25
- shimmer: "_shimmer_1wd65_323",
26
- footer: "_footer_1wd65_350",
27
- pageSize: "_pageSize_1wd65_360",
28
- range: "_range_1wd65_386",
29
- pageButtons: "_pageButtons_1wd65_391",
30
- pageButton: "_pageButton_1wd65_391",
31
- srOnly: "_srOnly_1wd65_432"
3
+ root: "_root_bwapn_2",
4
+ toolbar: "_toolbar_bwapn_26",
5
+ heading: "_heading_bwapn_35",
6
+ title: "_title_bwapn_41",
7
+ description: "_description_bwapn_47",
8
+ search: "_search_bwapn_52",
9
+ batchBar: "_batchBar_bwapn_79",
10
+ batchCount: "_batchCount_bwapn_89",
11
+ batchActions: "_batchActions_bwapn_95",
12
+ scroller: "_scroller_bwapn_101",
13
+ scrollerVirtualized: "_scrollerVirtualized_bwapn_111",
14
+ table: "_table_bwapn_117",
15
+ row: "_row_bwapn_199",
16
+ controlCol: "_controlCol_bwapn_219",
17
+ controlCell: "_controlCell_bwapn_223",
18
+ sortButton: "_sortButton_bwapn_229",
19
+ emptyCell: "_emptyCell_bwapn_277",
20
+ expansionRow: "_expansionRow_bwapn_284",
21
+ expansionGrid: "_expansionGrid_bwapn_290",
22
+ expansionInner: "_expansionInner_bwapn_294",
23
+ expandButton: "_expandButton_bwapn_299",
24
+ chevron: "_chevron_bwapn_322",
25
+ shimmer: "_shimmer_bwapn_337",
26
+ footer: "_footer_bwapn_364",
27
+ pageSize: "_pageSize_bwapn_374",
28
+ range: "_range_bwapn_400",
29
+ pageButtons: "_pageButtons_bwapn_405",
30
+ pageButton: "_pageButton_bwapn_405",
31
+ srOnly: "_srOnly_bwapn_446"
32
32
  };
33
33
  //#endregion
34
34
  export { e as default };