@cascivo/react 0.18.0 → 1.0.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 (101) hide show
  1. package/README.md +4 -3
  2. package/dist/action-sheet/action-sheet.js +1 -1
  3. package/dist/breadcrumb/breadcrumb.js +7 -7
  4. package/dist/checkbox/checkbox.js +11 -10
  5. package/dist/color-picker/color-picker.js +81 -77
  6. package/dist/combobox/combobox.js +81 -76
  7. package/dist/command-menu/command-menu.js +104 -104
  8. package/dist/comparison/comparison.js +18 -18
  9. package/dist/data-table/data-table.css +1 -1
  10. package/dist/data-table/data-table.js +148 -121
  11. package/dist/data-table/data-table.module.js +29 -29
  12. package/dist/date-picker/date-picker.js +98 -93
  13. package/dist/date-range-picker/date-range-picker.js +1 -1
  14. package/dist/dock/dock.js +2 -2
  15. package/dist/dropdown/dropdown.js +43 -40
  16. package/dist/editable/editable.js +29 -20
  17. package/dist/fab/fab.js +37 -37
  18. package/dist/field/field.js +24 -17
  19. package/dist/file-uploader/file-uploader.js +24 -23
  20. package/dist/filter/filter.js +11 -11
  21. package/dist/index.d.ts +1302 -85
  22. package/dist/input/input.js +14 -13
  23. package/dist/navigation-menu/navigation-menu.js +9 -9
  24. package/dist/node/action-sheet/action-sheet.js +1 -1
  25. package/dist/node/breadcrumb/breadcrumb.js +7 -7
  26. package/dist/node/checkbox/checkbox.js +11 -10
  27. package/dist/node/color-picker/color-picker.js +81 -77
  28. package/dist/node/combobox/combobox.js +81 -76
  29. package/dist/node/command-menu/command-menu.js +104 -104
  30. package/dist/node/comparison/comparison.js +18 -18
  31. package/dist/node/data-table/data-table.js +148 -121
  32. package/dist/node/data-table/data-table.module.js +29 -29
  33. package/dist/node/date-picker/date-picker.js +98 -93
  34. package/dist/node/date-range-picker/date-range-picker.js +1 -1
  35. package/dist/node/dock/dock.js +2 -2
  36. package/dist/node/dropdown/dropdown.js +43 -40
  37. package/dist/node/editable/editable.js +29 -20
  38. package/dist/node/fab/fab.js +37 -37
  39. package/dist/node/field/field.js +24 -17
  40. package/dist/node/file-uploader/file-uploader.js +24 -23
  41. package/dist/node/filter/filter.js +11 -11
  42. package/dist/node/input/input.js +14 -13
  43. package/dist/node/navigation-menu/navigation-menu.js +9 -9
  44. package/dist/node/number-input/number-input.js +28 -27
  45. package/dist/node/overflow-menu/overflow-menu.js +7 -7
  46. package/dist/node/progress/progress.js +3 -3
  47. package/dist/node/progress-circle/progress-circle.js +8 -8
  48. package/dist/node/progress-indicator/progress-indicator.js +1 -1
  49. package/dist/node/qr-code/qr-code.js +11 -11
  50. package/dist/node/radial-progress/radial-progress.js +9 -9
  51. package/dist/node/radio/radio.js +10 -9
  52. package/dist/node/react/src/index.js +93 -93
  53. package/dist/node/resizable/resizable.js +24 -24
  54. package/dist/node/search/search.js +35 -31
  55. package/dist/node/select/select.js +15 -14
  56. package/dist/node/side-nav/side-nav.js +35 -35
  57. package/dist/node/side-nav/side-nav.module.js +27 -27
  58. package/dist/node/slider/slider.js +13 -12
  59. package/dist/node/spinner/spinner.js +4 -4
  60. package/dist/node/steps/steps.js +10 -10
  61. package/dist/node/structured-list/structured-list.js +14 -14
  62. package/dist/node/swap/swap.js +5 -5
  63. package/dist/node/switcher/switcher.js +5 -5
  64. package/dist/node/tags-input/tags-input.js +20 -16
  65. package/dist/node/textarea/textarea.js +14 -13
  66. package/dist/node/time-picker/time-picker.js +21 -20
  67. package/dist/node/toggle/toggle.js +8 -7
  68. package/dist/node/tree-view/tree-view.js +43 -43
  69. package/dist/node/virtual-list/virtual-list.js +10 -10
  70. package/dist/node/wheel-picker/wheel-picker.js +36 -36
  71. package/dist/number-input/number-input.js +28 -27
  72. package/dist/overflow-menu/overflow-menu.js +7 -7
  73. package/dist/progress/progress.js +3 -3
  74. package/dist/progress-circle/progress-circle.js +8 -8
  75. package/dist/progress-indicator/progress-indicator.js +1 -1
  76. package/dist/qr-code/qr-code.js +11 -11
  77. package/dist/radial-progress/radial-progress.js +9 -9
  78. package/dist/radio/radio.js +10 -9
  79. package/dist/react/src/index.js +93 -93
  80. package/dist/resizable/resizable.js +24 -24
  81. package/dist/search/search.js +35 -31
  82. package/dist/select/select.js +15 -14
  83. package/dist/side-nav/side-nav.css +1 -1
  84. package/dist/side-nav/side-nav.js +35 -35
  85. package/dist/side-nav/side-nav.module.js +27 -27
  86. package/dist/slider/slider.js +13 -12
  87. package/dist/spinner/spinner.js +4 -4
  88. package/dist/steps/steps.js +10 -10
  89. package/dist/structured-list/structured-list.js +14 -14
  90. package/dist/styles.css +2 -2
  91. package/dist/swap/swap.js +5 -5
  92. package/dist/switcher/switcher.js +5 -5
  93. package/dist/tags-input/tags-input.js +20 -16
  94. package/dist/textarea/textarea.js +14 -13
  95. package/dist/time-picker/time-picker.js +21 -20
  96. package/dist/toggle/toggle.js +8 -7
  97. package/dist/tree-view/tree-view.js +43 -43
  98. package/dist/virtual-list/virtual-list.js +10 -10
  99. package/dist/wheel-picker/wheel-picker.js +36 -36
  100. package/package.json +4 -4
  101. package/readme.body.md +4 -3
@@ -9,31 +9,55 @@ import { builtin as d, t as f } from "@cascivo/i18n";
9
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 h(e, t) {
12
+ var h = /* @__PURE__ */ new Set();
13
+ function g() {
14
+ return globalThis.process?.env?.NODE_ENV !== "production";
15
+ }
16
+ var _ = /* @__PURE__ */ new Set();
17
+ function re(e, t, n) {
18
+ if (!g()) return;
19
+ let r = e.scrollWidth - e.clientWidth;
20
+ if (r <= 1) return;
21
+ let i = `${n}:${e.clientWidth}`;
22
+ _.has(i) || (_.add(i), console.warn(`cascivo DataTable: the table overflows its container (scrollWidth ${e.scrollWidth}px > clientWidth ${e.clientWidth}px, by ${r}px), so the last column is cut off. ` + (t.length > 0 ? `Drop a \`width\` from one of the sized columns (${t.join(", ")}), or lower the \`minWidth\` on the free-form one.` : "Lower the `minWidth` on the widest column.")));
23
+ }
24
+ function ie(e, t, n) {
25
+ g() && (e !== void 0 || t !== void 0 || h.has(n) || (h.add(n), console.warn(`cascivo DataTable: this table has no accessible name (columns: ${n}). Pass \`title\` for a visible caption, or \`ariaLabel\` for a name only screen readers hear.`)));
26
+ }
27
+ function v(e, t) {
13
28
  return e[t];
14
29
  }
15
- function re(e, t) {
30
+ function ae(e, t) {
16
31
  return typeof e == "number" && typeof t == "number" ? e - t : String(e ?? "").localeCompare(String(t ?? ""));
17
32
  }
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 }) {
33
+ function y({ columns: h, rows: g, getRowId: _, sort: y, defaultSort: oe, sortMode: se = "client", onSortChange: ce, searchable: le = !1, pagination: b, selection: x, batchActions: S, renderExpandedRow: C, density: ue = "normal", zebra: de = !1, stickyHeader: fe = !1, loading: w = !1, emptyState: pe, title: T, ariaLabel: me, description: E, labels: D, className: he, virtualized: O = !1, rowHeight: k = 40, windowSize: ge = 20, overscan: _e = 3 }) {
19
34
  te();
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,
35
+ let A = i(), j = {
36
+ search: D?.search ?? f(d.dataTable.search),
37
+ empty: D?.empty ?? f(d.dataTable.empty),
38
+ selectAll: D?.selectAll ?? f(d.dataTable.selectAll),
39
+ selectRow: D?.selectRow ?? f(d.dataTable.selectRow),
40
+ itemsSelected: (e) => D?.itemsSelected?.(e) ?? f(d.dataTable.itemsSelected, { count: e }),
41
+ expandRow: D?.expandRow ?? f(d.dataTable.expandRow),
42
+ previousPage: D?.previousPage ?? f(d.dataTable.previousPage),
43
+ nextPage: D?.nextPage ?? f(d.dataTable.nextPage)
44
+ }, [ve] = l({ value: g }), [ye] = l({ value: h }), [M, be] = l({
45
+ value: y,
31
46
  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);
47
+ }), xe = u([]), N = x?.selected ?? xe.value, P = (e) => {
48
+ x?.selected === void 0 && (xe.value = e), x?.onChange?.(e);
49
+ }, F = u(""), I = u(1), L = u(b?.pageSize ?? 0), R = u(/* @__PURE__ */ new Set()), z = a(null), B = u(0);
35
50
  ee(() => {
36
- if (!D) return;
51
+ let e = z.current;
52
+ if (!e || typeof ResizeObserver > "u") return;
53
+ let t = h.filter((e) => e.width !== void 0).map((e) => e.key), n = h.map((e) => e.key).join(","), r = 0, i = new ResizeObserver(() => {
54
+ cancelAnimationFrame(r), r = requestAnimationFrame(() => re(e, t, n));
55
+ });
56
+ return i.observe(e), () => {
57
+ cancelAnimationFrame(r), i.disconnect();
58
+ };
59
+ }), ee(() => {
60
+ if (!O) return;
37
61
  let e = z.current;
38
62
  if (!e) return;
39
63
  let t = () => {
@@ -43,28 +67,28 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
43
67
  };
44
68
  return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
45
69
  });
46
- let V = c(() => ge.value.map((e, t) => ({
70
+ let Se = c(() => ve.value.map((e, t) => ({
47
71
  row: e,
48
72
  id: _ ? _(e) : String(t)
49
- }))), H = c(() => {
73
+ }))), V = c(() => {
50
74
  let e = F.value.trim().toLowerCase();
51
- if (!e) return V.value;
52
- let t = _e.value;
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]);
75
+ if (!e) return Se.value;
76
+ let t = ye.value;
77
+ return Se.value.filter((n) => t.some((t) => String(v(n.row, t.key) ?? "").toLowerCase().includes(e)));
78
+ }), H = c(() => {
79
+ let e = M.value;
80
+ if (!e || se === "server") return V.value;
81
+ let t = V.value.map((e, t) => [e, t]);
58
82
  return t.sort((t, n) => {
59
- let r = re(h(t[0].row, e.key), h(n[0].row, e.key));
83
+ let r = ae(v(t[0].row, e.key), v(n[0].row, e.key));
60
84
  return e.direction === "desc" && (r = -r), r === 0 ? t[1] - n[1] : r;
61
85
  }), t.map(([e]) => e);
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;
86
+ }), U = c(() => b ? Math.max(1, Math.ceil(V.value.length / L.value)) : 1), W = c(() => Math.min(I.value, U.value)), G = c(() => {
87
+ if (!b) return H.value;
64
88
  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;
89
+ return H.value.slice(e, e + L.value);
90
+ }), K = c(() => O ? Math.floor(B.value / k) : 0), q = c(() => O ? Math.min(K.value + ge + _e * 2, G.value.length) : G.value.length), Ce = c(() => O ? G.value.slice(K.value, q.value) : G.value), we = (e) => {
91
+ let t = M.value, n;
68
92
  n = !t || t.key !== e ? {
69
93
  key: e,
70
94
  direction: "asc"
@@ -72,9 +96,9 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
72
96
  key: e,
73
97
  direction: "desc"
74
98
  } : void 0, o(() => {
75
- ve(n), I.value = 1;
99
+ be(n), I.value = 1;
76
100
  }), ce?.(n);
77
- }, Ce = (e) => {
101
+ }, Te = (e) => {
78
102
  if (![
79
103
  "ArrowUp",
80
104
  "ArrowDown",
@@ -96,61 +120,63 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
96
120
  }
97
121
  }
98
122
  a?.focus();
99
- }, we = (e) => {
123
+ }, Ee = (e) => {
100
124
  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) => {
125
+ x?.mode === "single" ? P(t.includes(e) ? [] : [e]) : P(t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
126
+ }, De = (e) => {
103
127
  let t = new Set(R.value);
104
128
  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;
129
+ }, J = G.value, Oe = R.value, Y = J.length > 0 && J.every((e) => N.includes(e.id)), ke = J.some((e) => N.includes(e.id)), X = Ce.value, Z = K.value, Ae = q.value, je = () => {
130
+ let e = J.map((e) => e.id);
131
+ P(Y ? N.filter((t) => !e.includes(t)) : [...new Set([...N, ...e])]);
132
+ }, Q = h.length + +!!x + +!!C, Me = b && !O && X.length > 0 ? Math.max(0, L.value - X.length) : 0;
133
+ ie(T, me, h.map((e) => e.key).join(","));
134
+ let Ne = `${A}-title`, Pe = `${A}-description`, $ = V.value.length, Fe = $ === 0 ? 0 : (W.value - 1) * L.value + 1, Ie = $ === 0 ? 0 : Fe + J.length - 1, Le = !!S && S.length > 0 && N.length > 0;
109
135
  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,
114
- "data-paginated": y ? !0 : void 0,
115
- "data-fixed-layout": g.every((e) => e.width !== void 0) || void 0,
136
+ className: s(n.root, he),
137
+ "data-density": ue,
138
+ "data-zebra": de || void 0,
139
+ "data-sticky-header": fe || void 0,
140
+ "data-paginated": b ? !0 : void 0,
141
+ "data-fixed-layout": h.every((e) => e.width !== void 0) || void 0,
116
142
  children: [
117
143
  /* @__PURE__ */ p("span", {
118
144
  "aria-live": "polite",
119
145
  className: n.srOnly,
120
- children: N.length > 0 ? A.itemsSelected(N.length) : ""
146
+ children: N.length > 0 ? j.itemsSelected(N.length) : ""
121
147
  }),
122
- (w !== void 0 || T !== void 0 || v) && /* @__PURE__ */ m("div", {
148
+ (T !== void 0 || E !== void 0 || le) && /* @__PURE__ */ m("div", {
123
149
  className: n.toolbar,
124
- children: [(w !== void 0 || T !== void 0) && /* @__PURE__ */ m("div", {
150
+ children: [(T !== void 0 || E !== void 0) && /* @__PURE__ */ m("div", {
125
151
  className: n.heading,
126
- children: [w !== void 0 && /* @__PURE__ */ p("div", {
127
- id: je,
152
+ children: [T !== void 0 && /* @__PURE__ */ p("div", {
153
+ id: Ne,
128
154
  className: n.title,
129
- children: w
130
- }), T !== void 0 && /* @__PURE__ */ p("div", {
131
- id: Me,
132
- className: n.description,
133
155
  children: T
156
+ }), E !== void 0 && /* @__PURE__ */ p("div", {
157
+ id: Pe,
158
+ className: n.description,
159
+ children: E
134
160
  })]
135
- }), v && /* @__PURE__ */ p("input", {
161
+ }), le && /* @__PURE__ */ p("input", {
136
162
  type: "search",
137
163
  className: n.search,
138
- "aria-label": A.search,
139
- placeholder: A.search,
164
+ "aria-label": j.search,
165
+ placeholder: j.search,
140
166
  value: F.value,
141
167
  onChange: (e) => {
142
168
  F.value = e.target.value, I.value = 1;
143
169
  }
144
170
  })]
145
171
  }),
146
- Pe && /* @__PURE__ */ m("div", {
172
+ Le && /* @__PURE__ */ m("div", {
147
173
  className: n.batchBar,
148
174
  children: [/* @__PURE__ */ p("span", {
149
175
  className: n.batchCount,
150
- children: A.itemsSelected(N.length)
176
+ children: j.itemsSelected(N.length)
151
177
  }), /* @__PURE__ */ p("div", {
152
178
  className: n.batchActions,
153
- children: x.map((t, n) => /* @__PURE__ */ p(e, {
179
+ children: S.map((t, n) => /* @__PURE__ */ p(e, {
154
180
  size: "sm",
155
181
  variant: "secondary",
156
182
  onClick: () => t.onClick(N),
@@ -159,48 +185,49 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
159
185
  })]
160
186
  }),
161
187
  /* @__PURE__ */ p("div", {
162
- ref: D ? z : void 0,
163
- className: s(n.scroller, D && n.scrollerVirtualized),
188
+ ref: z,
189
+ className: s(n.scroller, O && n.scrollerVirtualized),
164
190
  children: /* @__PURE__ */ m("table", {
165
191
  className: n.table,
166
- "aria-labelledby": w === void 0 ? void 0 : je,
167
- "aria-describedby": T === void 0 ? void 0 : Me,
168
- "aria-busy": C || void 0,
169
- "aria-rowcount": D ? q.length : void 0,
170
- onKeyDown: Ce,
192
+ "aria-labelledby": T === void 0 ? void 0 : Ne,
193
+ "aria-label": T === void 0 ? me : void 0,
194
+ "aria-describedby": E === void 0 ? void 0 : Pe,
195
+ "aria-busy": w || void 0,
196
+ "aria-rowcount": O ? J.length : void 0,
197
+ onKeyDown: Te,
171
198
  children: [
172
199
  /* @__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 ? {
200
+ C && /* @__PURE__ */ p("col", { className: n.controlCol }),
201
+ x && /* @__PURE__ */ p("col", { className: n.controlCol }),
202
+ h.map((e) => /* @__PURE__ */ p("col", { style: e.width !== void 0 || e.minWidth !== void 0 ? {
176
203
  ...e.width === void 0 ? {} : { width: e.width },
177
204
  ...e.minWidth === void 0 ? {} : { minWidth: e.minWidth }
178
205
  } : void 0 }, e.key))
179
206
  ] }),
180
207
  /* @__PURE__ */ p("thead", { children: /* @__PURE__ */ m("tr", { children: [
181
- S && /* @__PURE__ */ p("th", {
208
+ C && /* @__PURE__ */ p("th", {
182
209
  scope: "col",
183
210
  className: n.controlCell,
184
211
  children: /* @__PURE__ */ p("span", {
185
212
  className: n.srOnly,
186
- children: A.expandRow
213
+ children: j.expandRow
187
214
  })
188
215
  }),
189
- b && /* @__PURE__ */ p("th", {
216
+ x && /* @__PURE__ */ p("th", {
190
217
  scope: "col",
191
218
  className: n.controlCell,
192
- children: b.mode === "multi" ? /* @__PURE__ */ p(t, {
193
- "aria-label": A.selectAll,
194
- checked: J,
195
- indeterminate: De && !J,
196
- onChange: ke
219
+ children: x.mode === "multi" ? /* @__PURE__ */ p(t, {
220
+ "aria-label": j.selectAll,
221
+ checked: Y,
222
+ indeterminate: ke && !Y,
223
+ onChange: je
197
224
  }) : /* @__PURE__ */ p("span", {
198
225
  className: n.srOnly,
199
- children: A.selectRow
226
+ children: j.selectRow
200
227
  })
201
228
  }),
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";
229
+ h.map((e) => {
230
+ let t = M.value?.key === e.key ? M.value.direction : void 0, r = t === "asc" ? "ascending" : t === "desc" ? "descending" : "none";
204
231
  return /* @__PURE__ */ p("th", {
205
232
  scope: "col",
206
233
  "data-align": e.align ?? "start",
@@ -210,96 +237,96 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
210
237
  type: "button",
211
238
  className: n.sortButton,
212
239
  "data-state": r,
213
- onClick: () => Se(e.key),
240
+ onClick: () => we(e.key),
214
241
  children: e.header
215
242
  }) : e.header
216
243
  }, e.key);
217
244
  })
218
245
  ] }) }),
219
246
  /* @__PURE__ */ m("tbody", { children: [
220
- C && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ p("tr", {
247
+ w && Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ p("tr", {
221
248
  className: n.row,
222
- children: Array.from({ length: Z }, (e, t) => /* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("span", {
249
+ children: Array.from({ length: Q }, (e, t) => /* @__PURE__ */ p("td", { children: /* @__PURE__ */ p("span", {
223
250
  className: n.shimmer,
224
251
  "aria-hidden": "true"
225
252
  }) }, t))
226
253
  }, t)),
227
- !C && q.length === 0 && /* @__PURE__ */ p("tr", {
254
+ !w && J.length === 0 && /* @__PURE__ */ p("tr", {
228
255
  "data-empty-row": !0,
229
256
  children: /* @__PURE__ */ p("td", {
230
- colSpan: Z,
257
+ colSpan: Q,
231
258
  className: n.emptyCell,
232
- children: fe ?? A.empty
259
+ children: pe ?? j.empty
233
260
  })
234
261
  }),
235
- !C && D && X > 0 && /* @__PURE__ */ p("tr", {
262
+ !w && O && Z > 0 && /* @__PURE__ */ p("tr", {
236
263
  "aria-hidden": "true",
237
- style: { height: X * O }
264
+ style: { height: Z * k }
238
265
  }),
239
- !C && Y.map((e, i) => {
240
- let a = D ? X + i : i, o = N.includes(e.id), s = Ee.has(e.id);
266
+ !w && X.map((e, i) => {
267
+ let a = O ? Z + i : i, o = N.includes(e.id), s = Oe.has(e.id);
241
268
  return /* @__PURE__ */ m(r, { children: [/* @__PURE__ */ m("tr", {
242
269
  className: n.row,
243
270
  "data-parity": a % 2 == 0 ? "even" : "odd",
244
271
  "data-state": o ? "selected" : void 0,
245
- "aria-rowindex": D ? X + i + 1 : void 0,
272
+ "aria-rowindex": O ? Z + i + 1 : void 0,
246
273
  children: [
247
- S && /* @__PURE__ */ p("td", {
274
+ C && /* @__PURE__ */ p("td", {
248
275
  className: n.controlCell,
249
276
  children: /* @__PURE__ */ p("button", {
250
277
  type: "button",
251
278
  className: n.expandButton,
252
279
  "aria-expanded": s,
253
- "aria-label": A.expandRow,
280
+ "aria-label": j.expandRow,
254
281
  "data-state": s ? "open" : "closed",
255
- onClick: () => Te(e.id),
282
+ onClick: () => De(e.id),
256
283
  children: /* @__PURE__ */ p("span", {
257
284
  className: n.chevron,
258
285
  "aria-hidden": "true"
259
286
  })
260
287
  })
261
288
  }),
262
- b && /* @__PURE__ */ p("td", {
289
+ x && /* @__PURE__ */ p("td", {
263
290
  className: n.controlCell,
264
291
  children: /* @__PURE__ */ p(t, {
265
- "aria-label": A.selectRow,
292
+ "aria-label": j.selectRow,
266
293
  checked: o,
267
- onChange: () => we(e.id)
294
+ onChange: () => Ee(e.id)
268
295
  })
269
296
  }),
270
- g.map((t) => /* @__PURE__ */ p("td", {
297
+ h.map((t) => /* @__PURE__ */ p("td", {
271
298
  "data-align": t.align ?? "start",
272
299
  "data-sized": t.width !== void 0 || void 0,
273
- children: t.render ? t.render(e.row) : String(h(e.row, t.key) ?? "")
300
+ children: t.render ? t.render(e.row) : String(v(e.row, t.key) ?? "")
274
301
  }, t.key))
275
302
  ]
276
- }), S && /* @__PURE__ */ p("tr", {
303
+ }), C && /* @__PURE__ */ p("tr", {
277
304
  className: n.expansionRow,
278
305
  "data-state": s ? "open" : "closed",
279
306
  children: /* @__PURE__ */ p("td", {
280
- colSpan: Z,
307
+ colSpan: Q,
281
308
  children: /* @__PURE__ */ p("div", {
282
309
  className: n.expansionGrid,
283
310
  "data-state": s ? "open" : "closed",
284
311
  children: /* @__PURE__ */ p("div", {
285
312
  className: n.expansionInner,
286
- children: S(e.row)
313
+ children: C(e.row)
287
314
  })
288
315
  })
289
316
  })
290
317
  })] }, e.id);
291
318
  }),
292
- !C && D && Oe < q.length && /* @__PURE__ */ p("tr", {
319
+ !w && O && Ae < J.length && /* @__PURE__ */ p("tr", {
293
320
  "aria-hidden": "true",
294
- style: { height: (q.length - Oe) * O }
321
+ style: { height: (J.length - Ae) * k }
295
322
  }),
296
- Ae > 0 && /* @__PURE__ */ p("tr", {
323
+ Me > 0 && /* @__PURE__ */ p("tr", {
297
324
  "aria-hidden": "true",
298
325
  "data-filler-row": !0,
299
326
  children: /* @__PURE__ */ p("td", {
300
- colSpan: Z,
327
+ colSpan: Q,
301
328
  style: {
302
- blockSize: `calc(var(--_row-height) * ${Ae})`,
329
+ blockSize: `calc(var(--_row-height) * ${Me})`,
303
330
  padding: 0
304
331
  }
305
332
  })
@@ -308,17 +335,17 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
308
335
  ]
309
336
  })
310
337
  }),
311
- y && /* @__PURE__ */ m("div", {
338
+ b && /* @__PURE__ */ m("div", {
312
339
  className: n.footer,
313
340
  children: [
314
- y.pageSizeOptions && /* @__PURE__ */ m("label", {
341
+ b.pageSizeOptions && /* @__PURE__ */ m("label", {
315
342
  className: n.pageSize,
316
343
  children: [/* @__PURE__ */ p("span", { children: "Rows per page" }), /* @__PURE__ */ p("select", {
317
344
  value: L.value,
318
345
  onChange: (e) => {
319
346
  L.value = Number(e.target.value), I.value = 1;
320
347
  },
321
- children: y.pageSizeOptions.map((e) => /* @__PURE__ */ p("option", {
348
+ children: b.pageSizeOptions.map((e) => /* @__PURE__ */ p("option", {
322
349
  value: e,
323
350
  children: e
324
351
  }, e))
@@ -327,11 +354,11 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
327
354
  /* @__PURE__ */ m("span", {
328
355
  className: n.range,
329
356
  children: [
330
- $,
357
+ Fe,
331
358
  "–",
332
- Ne,
359
+ Ie,
333
360
  " of ",
334
- Q
361
+ $
335
362
  ]
336
363
  }),
337
364
  /* @__PURE__ */ m("div", {
@@ -339,7 +366,7 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
339
366
  children: [/* @__PURE__ */ p("button", {
340
367
  type: "button",
341
368
  className: n.pageButton,
342
- "aria-label": A.previousPage,
369
+ "aria-label": j.previousPage,
343
370
  disabled: W.value <= 1,
344
371
  onClick: () => {
345
372
  I.value = W.value - 1;
@@ -351,8 +378,8 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
351
378
  }), /* @__PURE__ */ p("button", {
352
379
  type: "button",
353
380
  className: n.pageButton,
354
- "aria-label": A.nextPage,
355
- disabled: W.value >= ye.value,
381
+ "aria-label": j.nextPage,
382
+ disabled: W.value >= U.value,
356
383
  onClick: () => {
357
384
  I.value = W.value + 1;
358
385
  },
@@ -368,4 +395,4 @@ function g({ columns: g, rows: ie, getRowId: _, sort: ae, defaultSort: oe, sortM
368
395
  });
369
396
  }
370
397
  //#endregion
371
- export { g as DataTable };
398
+ export { y as DataTable };
@@ -1,34 +1,34 @@
1
1
  import './data-table.css';
2
2
  var e = {
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"
3
+ root: "_root_1bz3s_2",
4
+ toolbar: "_toolbar_1bz3s_26",
5
+ heading: "_heading_1bz3s_35",
6
+ title: "_title_1bz3s_41",
7
+ description: "_description_1bz3s_47",
8
+ search: "_search_1bz3s_52",
9
+ batchBar: "_batchBar_1bz3s_79",
10
+ batchCount: "_batchCount_1bz3s_89",
11
+ batchActions: "_batchActions_1bz3s_95",
12
+ scroller: "_scroller_1bz3s_101",
13
+ scrollerVirtualized: "_scrollerVirtualized_1bz3s_137",
14
+ table: "_table_1bz3s_143",
15
+ row: "_row_1bz3s_225",
16
+ controlCol: "_controlCol_1bz3s_245",
17
+ controlCell: "_controlCell_1bz3s_249",
18
+ sortButton: "_sortButton_1bz3s_255",
19
+ emptyCell: "_emptyCell_1bz3s_303",
20
+ expansionRow: "_expansionRow_1bz3s_310",
21
+ expansionGrid: "_expansionGrid_1bz3s_316",
22
+ expansionInner: "_expansionInner_1bz3s_320",
23
+ expandButton: "_expandButton_1bz3s_325",
24
+ chevron: "_chevron_1bz3s_348",
25
+ shimmer: "_shimmer_1bz3s_363",
26
+ footer: "_footer_1bz3s_390",
27
+ pageSize: "_pageSize_1bz3s_400",
28
+ range: "_range_1bz3s_426",
29
+ pageButtons: "_pageButtons_1bz3s_431",
30
+ pageButton: "_pageButton_1bz3s_431",
31
+ srOnly: "_srOnly_1bz3s_472"
32
32
  };
33
33
  //#endregion
34
34
  export { e as default };