@overdoser/react-toolkit 0.21.0 → 0.22.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 (161) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +35 -0
  3. package/components/Accordion/Accordion.js +48 -48
  4. package/components/ActionButton/ActionButton.js +23 -23
  5. package/components/ActionButton/CopyButton.js +5 -5
  6. package/components/Alert/Alert.js +13 -13
  7. package/components/Avatar/Avatar.js +12 -12
  8. package/components/Badge/Badge.js +6 -6
  9. package/components/Breadcrumbs/Breadcrumbs.js +15 -15
  10. package/components/Button/Button.js +14 -14
  11. package/components/Card/Card.js +26 -26
  12. package/components/Chart/AreaChart.js +103 -103
  13. package/components/Chart/Axis.js +7 -7
  14. package/components/Chart/BarChart.js +62 -62
  15. package/components/Chart/ChartContainer.js +11 -11
  16. package/components/Chart/ChartLegend.js +7 -7
  17. package/components/Chart/ChartTooltip.js +13 -13
  18. package/components/Chart/LineChart.js +88 -88
  19. package/components/Chart/PieChart.js +25 -25
  20. package/components/Chart/RadarChart.js +42 -42
  21. package/components/Chart/Sparkline.js +11 -11
  22. package/components/Chart/TradingChart.js +126 -126
  23. package/components/Chart/trading/period.js +3 -3
  24. package/components/Chip/Chip.js +24 -24
  25. package/components/CodeBlock/CodeBlock.js +31 -31
  26. package/components/CommandPalette/CommandPalette.js +166 -166
  27. package/components/ConfirmDialog/ConfirmDialog.js +60 -60
  28. package/components/Divider/Divider.js +10 -10
  29. package/components/Draggable/Draggable.js +29 -29
  30. package/components/Drawer/Drawer.js +53 -53
  31. package/components/Dropdown/Dropdown.js +66 -66
  32. package/components/Dropdown/DropdownItem.js +13 -13
  33. package/components/Dropdown/DropdownLabel.js +5 -5
  34. package/components/Dropdown/DropdownSeparator.js +5 -5
  35. package/components/Dropzone/Dropzone.js +15 -15
  36. package/components/EmptyState/EmptyState.js +11 -11
  37. package/components/Form/Form.js +17 -17
  38. package/components/Form/FormField.js +21 -21
  39. package/components/Form/FormRow.js +3 -3
  40. package/components/ImageViewer/ImageViewer.js +118 -118
  41. package/components/Kbd/Kbd.js +11 -11
  42. package/components/KeyValueList/KeyValueList.js +32 -32
  43. package/components/Link/Link.js +7 -7
  44. package/components/List/List.js +7 -7
  45. package/components/Loader/Loader.js +39 -39
  46. package/components/Modal/Modal.js +48 -48
  47. package/components/PageHeader/PageHeader.js +18 -18
  48. package/components/Pagination/Pagination.js +23 -23
  49. package/components/Popover/Popover.js +25 -25
  50. package/components/ProgressBar/ProgressBar.js +17 -17
  51. package/components/RelativeTime/RelativeTime.js +10 -10
  52. package/components/SegmentedControl/SegmentedControl.js +38 -38
  53. package/components/Skeleton/Skeleton.js +10 -10
  54. package/components/Spinner/Spinner.js +7 -7
  55. package/components/SplitButton/SplitButton.js +63 -63
  56. package/components/SplitPane/SplitPane.js +50 -50
  57. package/components/StatCard/StatCard.js +32 -32
  58. package/components/StatusDot/StatusDot.js +7 -7
  59. package/components/Table/Table.js +174 -174
  60. package/components/Tabs/Tabs.js +47 -47
  61. package/components/ThemeToggle/ThemeToggle.js +31 -31
  62. package/components/Timeline/GanttTimeline.js +213 -213
  63. package/components/Timeline/HistoryTimeline.js +306 -306
  64. package/components/Timeline/TimelineShared.js +103 -103
  65. package/components/Timeline/TraceEventDetails.js +103 -103
  66. package/components/Timeline/TraceTimeline.js +546 -546
  67. package/components/Timeline/historyLayout.js +2 -2
  68. package/components/Timer/Timer.js +39 -39
  69. package/components/Toast/Toast.js +59 -59
  70. package/components/ToggleIconButton/ToggleIconButton.js +9 -9
  71. package/components/Tooltip/Tooltip.js +16 -16
  72. package/components/Typography/Typography.js +5 -5
  73. package/components/inputs/Checkbox/Checkbox.js +11 -11
  74. package/components/inputs/Checkbox/CheckboxGroup.js +21 -21
  75. package/components/inputs/DatePicker/CalendarPanel.js +113 -113
  76. package/components/inputs/DatePicker/DatePicker.js +39 -39
  77. package/components/inputs/DateTimePicker/DateTimePicker.js +119 -119
  78. package/components/inputs/DateTimePicker/DateTimeSegments.js +40 -40
  79. package/components/inputs/DateTimePicker/TimeField.js +34 -34
  80. package/components/inputs/Input/Input.js +13 -13
  81. package/components/inputs/NumberInput/NumberInput.js +16 -16
  82. package/components/inputs/Radio/Radio.js +17 -17
  83. package/components/inputs/SearchInput/SearchInput.js +25 -25
  84. package/components/inputs/Select/Select.d.ts +55 -3
  85. package/components/inputs/Select/Select.js +485 -344
  86. package/components/inputs/Select/{Select.module.js → Select.module.scss.js} +15 -3
  87. package/components/inputs/Slider/Slider.js +21 -21
  88. package/components/inputs/Switch/Switch.js +4 -4
  89. package/components/inputs/Textarea/Textarea.js +8 -8
  90. package/hooks/usePortalPosition.d.ts +2 -1
  91. package/hooks/usePortalPosition.js +6 -3
  92. package/hooks/useResizable.js +1 -1
  93. package/hooks/useTheme.js +7 -7
  94. package/index.css +1 -1
  95. package/index.js +1 -1
  96. package/index.layered.css +1 -1
  97. package/llms.txt +25 -4
  98. package/manifest.json +33 -4
  99. package/package.json +1 -1
  100. /package/components/Accordion/{Accordion.module.js → Accordion.module.scss.js} +0 -0
  101. /package/components/ActionButton/{ActionButton.module.js → ActionButton.module.scss.js} +0 -0
  102. /package/components/Alert/{Alert.module.js → Alert.module.scss.js} +0 -0
  103. /package/components/Avatar/{Avatar.module.js → Avatar.module.scss.js} +0 -0
  104. /package/components/Badge/{Badge.module.js → Badge.module.scss.js} +0 -0
  105. /package/components/Breadcrumbs/{Breadcrumbs.module.js → Breadcrumbs.module.scss.js} +0 -0
  106. /package/components/Button/{Button.module.js → Button.module.scss.js} +0 -0
  107. /package/components/Card/{Card.module.js → Card.module.scss.js} +0 -0
  108. /package/components/Chart/{Chart.module.js → Chart.module.scss.js} +0 -0
  109. /package/components/Chip/{Chip.module.js → Chip.module.scss.js} +0 -0
  110. /package/components/CodeBlock/{CodeBlock.module.js → CodeBlock.module.scss.js} +0 -0
  111. /package/components/CommandPalette/{CommandPalette.module.js → CommandPalette.module.scss.js} +0 -0
  112. /package/components/ConfirmDialog/{ConfirmDialog.module.js → ConfirmDialog.module.scss.js} +0 -0
  113. /package/components/Divider/{Divider.module.js → Divider.module.scss.js} +0 -0
  114. /package/components/Draggable/{Draggable.module.js → Draggable.module.scss.js} +0 -0
  115. /package/components/Drawer/{Drawer.module.js → Drawer.module.scss.js} +0 -0
  116. /package/components/Dropdown/{Dropdown.module.js → Dropdown.module.scss.js} +0 -0
  117. /package/components/Dropzone/{Dropzone.module.js → Dropzone.module.scss.js} +0 -0
  118. /package/components/EmptyState/{EmptyState.module.js → EmptyState.module.scss.js} +0 -0
  119. /package/components/Form/{Form.module.js → Form.module.scss.js} +0 -0
  120. /package/components/ImageViewer/{ImageViewer.module.js → ImageViewer.module.scss.js} +0 -0
  121. /package/components/Kbd/{Kbd.module.js → Kbd.module.scss.js} +0 -0
  122. /package/components/KeyValueList/{KeyValueList.module.js → KeyValueList.module.scss.js} +0 -0
  123. /package/components/Link/{Link.module.js → Link.module.scss.js} +0 -0
  124. /package/components/List/{List.module.js → List.module.scss.js} +0 -0
  125. /package/components/Loader/{Loader.module.js → Loader.module.scss.js} +0 -0
  126. /package/components/Modal/{Modal.module.js → Modal.module.scss.js} +0 -0
  127. /package/components/PageHeader/{PageHeader.module.js → PageHeader.module.scss.js} +0 -0
  128. /package/components/Pagination/{Pagination.module.js → Pagination.module.scss.js} +0 -0
  129. /package/components/Popover/{Popover.module.js → Popover.module.scss.js} +0 -0
  130. /package/components/ProgressBar/{ProgressBar.module.js → ProgressBar.module.scss.js} +0 -0
  131. /package/components/RelativeTime/{RelativeTime.module.js → RelativeTime.module.scss.js} +0 -0
  132. /package/components/SegmentedControl/{SegmentedControl.module.js → SegmentedControl.module.scss.js} +0 -0
  133. /package/components/Skeleton/{Skeleton.module.js → Skeleton.module.scss.js} +0 -0
  134. /package/components/Spinner/{Spinner.module.js → Spinner.module.scss.js} +0 -0
  135. /package/components/SplitButton/{SplitButton.module.js → SplitButton.module.scss.js} +0 -0
  136. /package/components/SplitPane/{SplitPane.module.js → SplitPane.module.scss.js} +0 -0
  137. /package/components/StatCard/{StatCard.module.js → StatCard.module.scss.js} +0 -0
  138. /package/components/StatusDot/{StatusDot.module.js → StatusDot.module.scss.js} +0 -0
  139. /package/components/Table/{Table.module.js → Table.module.scss.js} +0 -0
  140. /package/components/Tabs/{Tabs.module.js → Tabs.module.scss.js} +0 -0
  141. /package/components/ThemeToggle/{ThemeToggle.module.js → ThemeToggle.module.scss.js} +0 -0
  142. /package/components/Timeline/{GanttTimeline.module.js → GanttTimeline.module.scss.js} +0 -0
  143. /package/components/Timeline/{HistoryTimeline.module.js → HistoryTimeline.module.scss.js} +0 -0
  144. /package/components/Timeline/{Timeline.module.js → Timeline.module.scss.js} +0 -0
  145. /package/components/Timeline/{TraceTimeline.module.js → TraceTimeline.module.scss.js} +0 -0
  146. /package/components/Timer/{Timer.module.js → Timer.module.scss.js} +0 -0
  147. /package/components/Toast/{Toast.module.js → Toast.module.scss.js} +0 -0
  148. /package/components/ToggleIconButton/{ToggleIconButton.module.js → ToggleIconButton.module.scss.js} +0 -0
  149. /package/components/Tooltip/{Tooltip.module.js → Tooltip.module.scss.js} +0 -0
  150. /package/components/Typography/{Typography.module.js → Typography.module.scss.js} +0 -0
  151. /package/components/inputs/Checkbox/{Checkbox.module.js → Checkbox.module.scss.js} +0 -0
  152. /package/components/inputs/Checkbox/{CheckboxGroup.module.js → CheckboxGroup.module.scss.js} +0 -0
  153. /package/components/inputs/DatePicker/{CalendarPanel.module.js → CalendarPanel.module.scss.js} +0 -0
  154. /package/components/inputs/DatePicker/{DatePicker.module.js → DatePicker.module.scss.js} +0 -0
  155. /package/components/inputs/DateTimePicker/{DateTimePicker.module.js → DateTimePicker.module.scss.js} +0 -0
  156. /package/components/inputs/Input/{Input.module.js → Input.module.scss.js} +0 -0
  157. /package/components/inputs/NumberInput/{NumberInput.module.js → NumberInput.module.scss.js} +0 -0
  158. /package/components/inputs/Radio/{Radio.module.js → Radio.module.scss.js} +0 -0
  159. /package/components/inputs/SearchInput/{SearchInput.module.js → SearchInput.module.scss.js} +0 -0
  160. /package/components/inputs/Slider/{Slider.module.js → Slider.module.scss.js} +0 -0
  161. /package/components/inputs/Textarea/{Textarea.module.js → Textarea.module.scss.js} +0 -0
@@ -1,10 +1,10 @@
1
- import e from "./Table.module.js";
2
- import { useTableSort as t } from "./useTableSort.js";
3
- import { Loader as n } from "../Loader/Loader.js";
4
- import { Skeleton as r } from "../Skeleton/Skeleton.js";
5
- import { Checkbox as i } from "../inputs/Checkbox/Checkbox.js";
6
- import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
7
- import u from "clsx";
1
+ import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import a from "clsx";
3
+ import o from "./Table.module.scss.js";
4
+ import { useTableSort as s } from "./useTableSort.js";
5
+ import { Loader as c } from "../Loader/Loader.js";
6
+ import { Skeleton as l } from "../Skeleton/Skeleton.js";
7
+ import { Checkbox as u } from "../inputs/Checkbox/Checkbox.js";
8
8
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
9
  // src/components/Table/Table.tsx
10
10
  function p(e) {
@@ -14,54 +14,54 @@ function m(e) {
14
14
  return p(e) ? e.key : e.id;
15
15
  }
16
16
  var ee = "button, a, input, select, textarea, label, [role=\"button\"], [role=\"checkbox\"], [role=\"menuitem\"], [contenteditable]";
17
- function te({ direction: t, sortIndex: n }) {
17
+ function te({ direction: e, sortIndex: t }) {
18
18
  return /* @__PURE__ */ f("span", {
19
- className: e.sortIndicator,
19
+ className: o.sortIndicator,
20
20
  "aria-hidden": "true",
21
21
  children: [
22
22
  /* @__PURE__ */ d("span", {
23
- className: u(e.sortArrow, t === "asc" && e.sortArrowActive),
23
+ className: a(o.sortArrow, e === "asc" && o.sortArrowActive),
24
24
  children: "▲"
25
25
  }),
26
26
  /* @__PURE__ */ d("span", {
27
- className: u(e.sortArrow, t === "desc" && e.sortArrowActive),
27
+ className: a(o.sortArrow, e === "desc" && o.sortArrowActive),
28
28
  children: "▼"
29
29
  }),
30
- n !== void 0 && n >= 0 && /* @__PURE__ */ d("span", {
31
- className: e.sortIndex,
32
- children: n + 1
30
+ t !== void 0 && t >= 0 && /* @__PURE__ */ d("span", {
31
+ className: o.sortIndex,
32
+ children: t + 1
33
33
  })
34
34
  ]
35
35
  });
36
36
  }
37
- function ne({ page: t, pageSize: n, totalRows: r, pageSizeOptions: i = [
37
+ function ne({ page: e, pageSize: t, totalRows: r, pageSizeOptions: i = [
38
38
  10,
39
39
  25,
40
40
  50,
41
41
  100
42
- ], onPageChange: a, paginatorClasses: o }) {
43
- let c = Math.max(1, Math.ceil(r / n)), l = (t - 1) * n + 1, p = Math.min(t * n, r), m = s(() => {
44
- let e = [];
45
- if (c <= 7) for (let t = 1; t <= c; t++) e.push(t);
42
+ ], onPageChange: s, paginatorClasses: c }) {
43
+ let l = Math.max(1, Math.ceil(r / t)), u = (e - 1) * t + 1, p = Math.min(e * t, r), m = n(() => {
44
+ let t = [];
45
+ if (l <= 7) for (let e = 1; e <= l; e++) t.push(e);
46
46
  else {
47
- e.push(1), t > 3 && e.push("ellipsis");
48
- for (let n = Math.max(2, t - 1); n <= Math.min(c - 1, t + 1); n++) e.push(n);
49
- t < c - 2 && e.push("ellipsis"), e.push(c);
47
+ t.push(1), e > 3 && t.push("ellipsis");
48
+ for (let n = Math.max(2, e - 1); n <= Math.min(l - 1, e + 1); n++) t.push(n);
49
+ e < l - 2 && t.push("ellipsis"), t.push(l);
50
50
  }
51
- return e;
52
- }, [t, c]);
51
+ return t;
52
+ }, [e, l]);
53
53
  return /* @__PURE__ */ f("nav", {
54
- className: u(e.paginator, o?.paginator),
54
+ className: a(o.paginator, c?.paginator),
55
55
  "aria-label": "Table pagination",
56
56
  children: [/* @__PURE__ */ f("div", {
57
- className: e.paginatorInfo,
57
+ className: o.paginatorInfo,
58
58
  children: [/* @__PURE__ */ d("span", {
59
- className: e.paginatorText,
60
- children: r > 0 ? `${l}–${p} of ${r}` : "No results"
59
+ className: o.paginatorText,
60
+ children: r > 0 ? `${u}–${p} of ${r}` : "No results"
61
61
  }), i.length > 1 && /* @__PURE__ */ d("select", {
62
- className: e.pageSizeSelect,
63
- value: n,
64
- onChange: (e) => a(1, Number(e.target.value)),
62
+ className: o.pageSizeSelect,
63
+ value: t,
64
+ onChange: (e) => s(1, Number(e.target.value)),
65
65
  "aria-label": "Rows per page",
66
66
  children: i.map((e) => /* @__PURE__ */ f("option", {
67
67
  value: e,
@@ -69,32 +69,32 @@ function ne({ page: t, pageSize: n, totalRows: r, pageSizeOptions: i = [
69
69
  }, e))
70
70
  })]
71
71
  }), /* @__PURE__ */ f("div", {
72
- className: e.paginatorNav,
72
+ className: o.paginatorNav,
73
73
  children: [
74
74
  /* @__PURE__ */ d("button", {
75
75
  type: "button",
76
- className: u(e.pageButton, o?.pageButton),
77
- disabled: t <= 1,
78
- onClick: () => a(t - 1, n),
76
+ className: a(o.pageButton, c?.pageButton),
77
+ disabled: e <= 1,
78
+ onClick: () => s(e - 1, t),
79
79
  "aria-label": "Previous page",
80
80
  children: "‹"
81
81
  }),
82
- m.map((r, i) => r === "ellipsis" ? /* @__PURE__ */ d("span", {
83
- className: e.pageEllipsis,
82
+ m.map((n, r) => n === "ellipsis" ? /* @__PURE__ */ d("span", {
83
+ className: o.pageEllipsis,
84
84
  children: "…"
85
- }, `ellipsis-${i}`) : /* @__PURE__ */ d("button", {
85
+ }, `ellipsis-${r}`) : /* @__PURE__ */ d("button", {
86
86
  type: "button",
87
- className: u(e.pageButton, r === t && e.pageButtonActive, o?.pageButton),
88
- onClick: () => a(r, n),
89
- "aria-label": `Page ${r}`,
90
- "aria-current": r === t ? "page" : void 0,
91
- children: r
92
- }, r)),
87
+ className: a(o.pageButton, n === e && o.pageButtonActive, c?.pageButton),
88
+ onClick: () => s(n, t),
89
+ "aria-label": `Page ${n}`,
90
+ "aria-current": n === e ? "page" : void 0,
91
+ children: n
92
+ }, n)),
93
93
  /* @__PURE__ */ d("button", {
94
94
  type: "button",
95
- className: u(e.pageButton, o?.pageButton),
96
- disabled: t >= c,
97
- onClick: () => a(t + 1, n),
95
+ className: a(o.pageButton, c?.pageButton),
96
+ disabled: e >= l,
97
+ onClick: () => s(e + 1, t),
98
98
  "aria-label": "Next page",
99
99
  children: "›"
100
100
  })
@@ -103,106 +103,106 @@ function ne({ page: t, pageSize: n, totalRows: r, pageSizeOptions: i = [
103
103
  });
104
104
  }
105
105
  function h({ data: h, columns: g, sortConfig: _, onSort: v, multiSort: y = !0, scrollable: re = !1, dragScroll: b = !1, striped: ie = !1, hoverable: ae = !1, compact: oe = !1, className: se, style: ce, rowKey: x, rowClassName: S, rowStyle: C, emptyMessage: le = "No data", pagination: w, loading: T = !1, loadingRows: ue = 3, onRowClick: E, selectable: D = !1, selectedKeys: O, defaultSelectedKeys: de, onSelectionChange: k, isRowSelectable: A, bulkActions: j, selectionLabel: fe, columnVisibility: M, layout: pe = "auto", classes: N }) {
106
- let P = v !== void 0, me = re || b, F = s(() => M ? g.filter((e) => M[m(e)] !== !1) : g, [g, M]), { sortedData: he, sortConfig: ge, requestSort: _e, requestMultiSort: ve } = t(h, _), I = P ? _ ?? [] : ge, L = P ? h : he, R = s(() => {
107
- if (!w || P) return L;
106
+ let P = v !== void 0, me = re || b, F = n(() => M ? g.filter((e) => M[m(e)] !== !1) : g, [g, M]), { sortedData: he, sortConfig: ge, requestSort: I, requestMultiSort: L } = s(h, _), R = P ? _ ?? [] : ge, z = P ? h : he, B = n(() => {
107
+ if (!w || P) return z;
108
108
  let e = (w.page - 1) * w.pageSize;
109
- return L.slice(e, e + w.pageSize);
109
+ return z.slice(e, e + w.pageSize);
110
110
  }, [
111
- L,
111
+ z,
112
112
  w,
113
113
  P
114
- ]), ye = w?.totalRows ?? L.length, z = a((e, t) => {
114
+ ]), _e = w?.totalRows ?? z.length, V = e((e, t) => {
115
115
  if (!x) return t;
116
116
  let n = e[x];
117
117
  return typeof n == "number" ? n : String(n);
118
118
  }, [x]);
119
- o(() => {
119
+ t(() => {
120
120
  D && !x && console.error("Table: `selectable` needs `rowKey` so selections survive sorting and paging; falling back to the row index.");
121
121
  }, [D, x]);
122
- let [be, xe] = l(() => de ?? []), B = O !== void 0, V = B ? O : be, H = s(() => new Set(V), [V]), U = c(null), W = a((e) => {
123
- if (B || xe(e), k) {
122
+ let [ve, ye] = i(() => de ?? []), H = O !== void 0, U = H ? O : ve, W = n(() => new Set(U), [U]), G = r(null), K = e((e) => {
123
+ if (H || ye(e), k) {
124
124
  let t = new Set(e);
125
- k(e, L.filter((e, n) => t.has(z(e, n))));
125
+ k(e, z.filter((e, n) => t.has(V(e, n))));
126
126
  }
127
127
  }, [
128
- B,
128
+ H,
129
129
  k,
130
- L,
131
- z
132
- ]), G = a((e) => !A || A(e) !== !1, [A]), K = s(() => {
130
+ z,
131
+ V
132
+ ]), q = e((e) => !A || A(e) !== !1, [A]), J = n(() => {
133
133
  if (!D) return [];
134
134
  let e = [];
135
- return R.forEach((t, n) => {
136
- G(t) && e.push(z(t, n));
135
+ return B.forEach((t, n) => {
136
+ q(t) && e.push(V(t, n));
137
137
  }), e;
138
138
  }, [
139
139
  D,
140
- R,
141
- G,
142
- z
143
- ]), q = K.filter((e) => H.has(e)).length, J = K.length > 0 && q === K.length, Se = q > 0 && !J, Ce = a(() => {
144
- if (J) {
145
- let e = new Set(K);
146
- W(V.filter((t) => !e.has(t)));
140
+ B,
141
+ q,
142
+ V
143
+ ]), be = J.filter((e) => W.has(e)).length, Y = J.length > 0 && be === J.length, xe = be > 0 && !Y, Se = e(() => {
144
+ if (Y) {
145
+ let e = new Set(J);
146
+ K(U.filter((t) => !e.has(t)));
147
147
  } else {
148
- let e = [...V], t = new Set(V);
149
- for (let n of K) t.has(n) || e.push(n);
150
- W(e);
148
+ let e = [...U], t = new Set(U);
149
+ for (let n of J) t.has(n) || e.push(n);
150
+ K(e);
151
151
  }
152
152
  }, [
153
+ Y,
153
154
  J,
154
- K,
155
- V,
156
- W
157
- ]), we = a((e, t, n) => {
158
- let r = z(e, t), i = n.target.checked, a = n.nativeEvent.shiftKey === !0, o = [r];
159
- if (a && U.current !== null) {
160
- let e = R.map((e, t) => z(e, t)), t = e.indexOf(U.current), n = e.indexOf(r);
155
+ U,
156
+ K
157
+ ]), Ce = e((e, t, n) => {
158
+ let r = V(e, t), i = n.target.checked, a = n.nativeEvent.shiftKey === !0, o = [r];
159
+ if (a && G.current !== null) {
160
+ let e = B.map((e, t) => V(e, t)), t = e.indexOf(G.current), n = e.indexOf(r);
161
161
  if (t >= 0 && n >= 0) {
162
162
  let [r, i] = t < n ? [t, n] : [n, t];
163
163
  o = [];
164
- for (let t = r; t <= i; t++) G(R[t]) && o.push(e[t]);
164
+ for (let t = r; t <= i; t++) q(B[t]) && o.push(e[t]);
165
165
  }
166
166
  }
167
- U.current = r;
167
+ G.current = r;
168
168
  let s = new Set(o);
169
169
  if (i) {
170
- let e = new Set(V), t = [...V];
170
+ let e = new Set(U), t = [...U];
171
171
  for (let n of o) e.has(n) || t.push(n);
172
- W(t);
173
- } else W(V.filter((e) => !s.has(e)));
172
+ K(t);
173
+ } else K(U.filter((e) => !s.has(e)));
174
174
  }, [
175
- z,
176
- R,
177
- G,
178
175
  V,
179
- W
180
- ]), Y = a(() => W([]), [W]), Te = s(() => D && V.length ? L.filter((e, t) => H.has(z(e, t))) : [], [
176
+ B,
177
+ q,
178
+ U,
179
+ K
180
+ ]), we = e(() => K([]), [K]), Te = n(() => D && U.length ? z.filter((e, t) => W.has(V(e, t))) : [], [
181
181
  D,
182
- V.length,
183
- L,
184
- H,
185
- z
186
- ]), Ee = a((e, t, n) => {
182
+ U.length,
183
+ z,
184
+ W,
185
+ V
186
+ ]), Ee = e((e, t, n) => {
187
187
  if (!E) return;
188
188
  let r = n.target?.closest?.(ee);
189
189
  r && r !== n.currentTarget && n.currentTarget.contains(r) || E(e, t, n);
190
- }, [E]), De = a((e, t, n) => {
190
+ }, [E]), De = e((e, t, n) => {
191
191
  E && n.target === n.currentTarget && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), E(e, t, n));
192
- }, [E]), Oe = a((e, t, n) => {
192
+ }, [E]), Oe = e((e, t, n) => {
193
193
  let r = y && (t.ctrlKey || t.metaKey || t.shiftKey), i = n === "asc" ? "desc" : "asc";
194
194
  if (P) {
195
195
  if (r) {
196
- let t = I.findIndex((t) => t.key === e), r;
197
- r = t === -1 ? [...I, {
196
+ let t = R.findIndex((t) => t.key === e), r;
197
+ r = t === -1 ? [...R, {
198
198
  key: e,
199
199
  direction: n
200
- }] : I[t].direction === n ? I.map((n, r) => r === t ? {
200
+ }] : R[t].direction === n ? R.map((n, r) => r === t ? {
201
201
  key: e,
202
202
  direction: i
203
- } : n) : I.filter((e, n) => n !== t), v(r);
203
+ } : n) : R.filter((e, n) => n !== t), v(r);
204
204
  } else {
205
- let t = I.find((t) => t.key === e);
205
+ let t = R.find((t) => t.key === e);
206
206
  t ? t.direction === n ? v([{
207
207
  key: e,
208
208
  direction: i
@@ -211,15 +211,15 @@ function h({ data: h, columns: g, sortConfig: _, onSort: v, multiSort: y = !0, s
211
211
  direction: n
212
212
  }]);
213
213
  }
214
- } else r ? ve(e, n) : _e(e, n);
214
+ } else r ? L(e, n) : I(e, n);
215
215
  }, [
216
216
  P,
217
217
  y,
218
- I,
218
+ R,
219
219
  v,
220
- _e,
221
- ve
222
- ]), X = c(null), Z = c(null), Q = c(!1), [ke, Ae] = l(!1), je = a((e) => {
220
+ I,
221
+ L
222
+ ]), X = r(null), Z = r(null), Q = r(!1), [ke, Ae] = i(!1), je = e((e) => {
223
223
  let t = X.current;
224
224
  t && (Q.current = !1, e.button !== 1 && e.button !== 2 || t.scrollWidth <= t.clientWidth || (e.button === 1 && e.preventDefault(), Z.current = {
225
225
  pointerId: e.pointerId,
@@ -229,7 +229,7 @@ function h({ data: h, columns: g, sortConfig: _, onSort: v, multiSort: y = !0, s
229
229
  downAt: performance.now(),
230
230
  dragging: !1
231
231
  }));
232
- }, []), Me = a((e) => {
232
+ }, []), Me = e((e) => {
233
233
  let t = Z.current, n = X.current;
234
234
  if (!t || !n || e.pointerId !== t.pointerId) return;
235
235
  let r = e.clientX - t.startX;
@@ -245,98 +245,98 @@ function h({ data: h, columns: g, sortConfig: _, onSort: v, multiSort: y = !0, s
245
245
  } catch {}
246
246
  }
247
247
  n.scrollLeft = t.startScrollLeft - r;
248
- }, []), Ne = a((e) => {
248
+ }, []), Ne = e((e) => {
249
249
  let t = Z.current;
250
250
  t && e.pointerId === t.pointerId && (Z.current = null, t.dragging && (t.button === 2 && (Q.current = !0), Ae(!1)));
251
- }, []), Pe = a((e) => {
251
+ }, []), Pe = e((e) => {
252
252
  (Z.current?.dragging || Q.current) && (Q.current = !1, e.preventDefault());
253
- }, []), $ = (e) => I.find((t) => t.key === e)?.direction, Fe = (e) => {
254
- if (I.length <= 1) return;
255
- let t = I.findIndex((t) => t.key === e);
253
+ }, []), $ = (e) => R.find((t) => t.key === e)?.direction, Fe = (e) => {
254
+ if (R.length <= 1) return;
255
+ let t = R.findIndex((t) => t.key === e);
256
256
  return t >= 0 ? t : void 0;
257
- }, Ie = c(!1);
257
+ }, Ie = r(!1);
258
258
  T && (Ie.current = !0);
259
- let Le = F.length + +!!D, Re = T && R.length === 0, ze = D && V.length > 0, Be = /* @__PURE__ */ f("table", {
260
- className: u(e.root, ie && e.striped, ae && e.hoverable, oe && e.compact, pe === "fixed" && e.layoutFixed, N?.root, se),
259
+ let Le = F.length + +!!D, Re = T && B.length === 0, ze = D && U.length > 0, Be = /* @__PURE__ */ f("table", {
260
+ className: a(o.root, ie && o.striped, ae && o.hoverable, oe && o.compact, pe === "fixed" && o.layoutFixed, N?.root, se),
261
261
  style: ce,
262
262
  "aria-busy": T || void 0,
263
263
  children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ f("tr", { children: [D && /* @__PURE__ */ d("th", {
264
- className: u(e.headerCell, e.selectHeaderCell, N?.headerCell, N?.selectHeaderCell),
265
- children: /* @__PURE__ */ d(i, {
264
+ className: a(o.headerCell, o.selectHeaderCell, N?.headerCell, N?.selectHeaderCell),
265
+ children: /* @__PURE__ */ d(u, {
266
266
  "aria-label": "Select all",
267
- checked: J,
268
- indeterminate: Se,
269
- disabled: K.length === 0,
270
- onChange: Ce
267
+ checked: Y,
268
+ indeterminate: xe,
269
+ disabled: J.length === 0,
270
+ onChange: Se
271
271
  })
272
- }), F.map((t) => /* @__PURE__ */ f("th", {
273
- className: u(e.headerCell, p(t) && t.sortable && e.headerCellSortable, t.sticky && e.headerCellSticky, N?.headerCell),
272
+ }), F.map((e) => /* @__PURE__ */ f("th", {
273
+ className: a(o.headerCell, p(e) && e.sortable && o.headerCellSortable, e.sticky && o.headerCellSticky, N?.headerCell),
274
274
  style: {
275
- width: t.width,
276
- textAlign: t.align
275
+ width: e.width,
276
+ textAlign: e.align
277
277
  },
278
- onClick: p(t) && t.sortable ? (e) => Oe(t.key, e, t.defaultSortDirection ?? "asc") : void 0,
279
- "aria-sort": p(t) && t.sortable ? $(m(t)) === "asc" ? "ascending" : $(m(t)) === "desc" ? "descending" : "none" : void 0,
280
- children: [t.header, p(t) && t.sortable && /* @__PURE__ */ d(te, {
281
- direction: $(m(t)),
282
- sortIndex: Fe(m(t))
278
+ onClick: p(e) && e.sortable ? (t) => Oe(e.key, t, e.defaultSortDirection ?? "asc") : void 0,
279
+ "aria-sort": p(e) && e.sortable ? $(m(e)) === "asc" ? "ascending" : $(m(e)) === "desc" ? "descending" : "none" : void 0,
280
+ children: [e.header, p(e) && e.sortable && /* @__PURE__ */ d(te, {
281
+ direction: $(m(e)),
282
+ sortIndex: Fe(m(e))
283
283
  })]
284
- }, m(t)))] }) }), /* @__PURE__ */ d("tbody", { children: Re ? Array.from({ length: Math.max(1, ue) }, (t, n) => /* @__PURE__ */ f("tr", {
285
- className: u(e.row, e.loadingRow, N?.row, N?.loadingRow),
284
+ }, m(e)))] }) }), /* @__PURE__ */ d("tbody", { children: Re ? Array.from({ length: Math.max(1, ue) }, (e, t) => /* @__PURE__ */ f("tr", {
285
+ className: a(o.row, o.loadingRow, N?.row, N?.loadingRow),
286
286
  "aria-hidden": "true",
287
- children: [D && /* @__PURE__ */ d("td", { className: u(e.cell, e.selectCell, N?.cell) }), F.map((t) => /* @__PURE__ */ d("td", {
288
- className: u(e.cell, N?.cell),
289
- children: /* @__PURE__ */ d(r, { variant: "text" })
290
- }, m(t)))]
291
- }, `loading-${n}`)) : R.length === 0 ? /* @__PURE__ */ d("tr", {
292
- className: e.emptyRow,
287
+ children: [D && /* @__PURE__ */ d("td", { className: a(o.cell, o.selectCell, N?.cell) }), F.map((e) => /* @__PURE__ */ d("td", {
288
+ className: a(o.cell, N?.cell),
289
+ children: /* @__PURE__ */ d(l, { variant: "text" })
290
+ }, m(e)))]
291
+ }, `loading-${t}`)) : B.length === 0 ? /* @__PURE__ */ d("tr", {
292
+ className: o.emptyRow,
293
293
  children: /* @__PURE__ */ d("td", {
294
- className: u(e.emptyCell, N?.emptyCell),
294
+ className: a(o.emptyCell, N?.emptyCell),
295
295
  colSpan: Le,
296
296
  children: le
297
297
  })
298
- }) : R.map((t, n) => {
299
- let r = x ? String(t[x]) : n, a = D ? z(t, n) : null, o = a !== null && H.has(a), s = typeof S == "function" ? S(t, n) : S, c = typeof C == "function" ? C(t, n) : C;
298
+ }) : B.map((e, t) => {
299
+ let n = x ? String(e[x]) : t, r = D ? V(e, t) : null, i = r !== null && W.has(r), s = typeof S == "function" ? S(e, t) : S, c = typeof C == "function" ? C(e, t) : C;
300
300
  return /* @__PURE__ */ f("tr", {
301
- className: u(e.row, E && e.rowClickable, o && e.rowSelected, N?.row, E && N?.rowClickable, o && N?.rowSelected, s),
301
+ className: a(o.row, E && o.rowClickable, i && o.rowSelected, N?.row, E && N?.rowClickable, i && N?.rowSelected, s),
302
302
  style: c,
303
303
  tabIndex: E ? 0 : void 0,
304
- onClick: E ? (e) => Ee(t, n, e) : void 0,
305
- onKeyDown: E ? (e) => De(t, n, e) : void 0,
306
- "aria-selected": D ? o : void 0,
304
+ onClick: E ? (n) => Ee(e, t, n) : void 0,
305
+ onKeyDown: E ? (n) => De(e, t, n) : void 0,
306
+ "aria-selected": D ? i : void 0,
307
307
  children: [D && /* @__PURE__ */ d("td", {
308
- className: u(e.cell, e.selectCell, N?.cell, N?.selectCell),
309
- children: /* @__PURE__ */ d(i, {
308
+ className: a(o.cell, o.selectCell, N?.cell, N?.selectCell),
309
+ children: /* @__PURE__ */ d(u, {
310
310
  "aria-label": "Select row",
311
- checked: o,
312
- disabled: !G(t),
313
- onChange: (e) => we(t, n, e)
311
+ checked: i,
312
+ disabled: !q(e),
313
+ onChange: (n) => Ce(e, t, n)
314
314
  })
315
- }), F.map((r) => {
316
- let i, a, o;
317
- if (p(r)) {
318
- let e = t[r.key];
319
- a = typeof r.cellClassName == "function" ? r.cellClassName(e, t, n) : r.cellClassName, o = typeof r.cellStyle == "function" ? r.cellStyle(e, t, n) : r.cellStyle, i = r.render ? r.render(e, t, n) : e;
320
- } else a = typeof r.cellClassName == "function" ? r.cellClassName(t, n) : r.cellClassName, o = typeof r.cellStyle == "function" ? r.cellStyle(t, n) : r.cellStyle, i = r.render(t, n);
315
+ }), F.map((n) => {
316
+ let r, i, s;
317
+ if (p(n)) {
318
+ let a = e[n.key];
319
+ i = typeof n.cellClassName == "function" ? n.cellClassName(a, e, t) : n.cellClassName, s = typeof n.cellStyle == "function" ? n.cellStyle(a, e, t) : n.cellStyle, r = n.render ? n.render(a, e, t) : a;
320
+ } else i = typeof n.cellClassName == "function" ? n.cellClassName(e, t) : n.cellClassName, s = typeof n.cellStyle == "function" ? n.cellStyle(e, t) : n.cellStyle, r = n.render(e, t);
321
321
  return /* @__PURE__ */ d("td", {
322
- className: u(e.cell, r.sticky && e.cellSticky, N?.cell, a),
322
+ className: a(o.cell, n.sticky && o.cellSticky, N?.cell, i),
323
323
  style: {
324
- textAlign: r.align,
325
- ...o
324
+ textAlign: n.align,
325
+ ...s
326
326
  },
327
- children: i
328
- }, m(r));
327
+ children: r
328
+ }, m(n));
329
329
  })]
330
- }, r);
330
+ }, n);
331
331
  }) })]
332
332
  }), Ve = {
333
- selectedKeys: V,
333
+ selectedKeys: U,
334
334
  selectedRows: Te,
335
- clear: Y
335
+ clear: we
336
336
  };
337
337
  return /* @__PURE__ */ f("div", {
338
338
  ref: X,
339
- className: u(e.wrapper, me && e.scrollable, ke && e.dragging, N?.wrapper),
339
+ className: a(o.wrapper, me && o.scrollable, ke && o.dragging, N?.wrapper),
340
340
  onPointerDown: b ? je : void 0,
341
341
  onPointerMove: b ? Me : void 0,
342
342
  onPointerUp: b ? Ne : void 0,
@@ -344,36 +344,36 @@ function h({ data: h, columns: g, sortConfig: _, onSort: v, multiSort: y = !0, s
344
344
  onContextMenu: b ? Pe : void 0,
345
345
  children: [
346
346
  ze && /* @__PURE__ */ f("div", {
347
- className: u(e.bulkBar, N?.bulkBar),
347
+ className: a(o.bulkBar, N?.bulkBar),
348
348
  role: "region",
349
349
  "aria-label": "Selected rows",
350
350
  children: [
351
351
  /* @__PURE__ */ d("span", {
352
- className: u(e.bulkLabel, N?.bulkLabel),
353
- children: fe ? fe(V.length) : `${V.length} selected`
352
+ className: a(o.bulkLabel, N?.bulkLabel),
353
+ children: fe ? fe(U.length) : `${U.length} selected`
354
354
  }),
355
355
  /* @__PURE__ */ d("button", {
356
356
  type: "button",
357
- className: u(e.bulkClear, N?.bulkClear),
358
- onClick: Y,
357
+ className: a(o.bulkClear, N?.bulkClear),
358
+ onClick: we,
359
359
  children: "Clear"
360
360
  }),
361
361
  j !== void 0 && /* @__PURE__ */ d("div", {
362
- className: u(e.bulkActions, N?.bulkActions),
362
+ className: a(o.bulkActions, N?.bulkActions),
363
363
  children: typeof j == "function" ? j(Ve) : j
364
364
  })
365
365
  ]
366
366
  }),
367
- T !== void 0 && (T || Ie.current) ? /* @__PURE__ */ d(n, {
367
+ T !== void 0 && (T || Ie.current) ? /* @__PURE__ */ d(c, {
368
368
  loading: T && !Re,
369
369
  delay: 150,
370
370
  backdrop: "dim",
371
- classes: { root: e.loaderWrap },
371
+ classes: { root: o.loaderWrap },
372
372
  children: Be
373
373
  }) : Be,
374
374
  w && /* @__PURE__ */ d(ne, {
375
375
  ...w,
376
- totalRows: ye,
376
+ totalRows: _e,
377
377
  paginatorClasses: {
378
378
  paginator: N?.paginator,
379
379
  pageButton: N?.pageButton