@jetbrains/ring-ui-built 8.0.0-beta.2 → 8.0.0-beta.3

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 (174) hide show
  1. package/components/_helpers/anchor.js +1 -1
  2. package/components/_helpers/avatar-info.js +1 -1
  3. package/components/_helpers/icon-svg.js +1 -1
  4. package/components/_helpers/legacy-table.js +3 -0
  5. package/components/_helpers/tab-link.js +1 -1
  6. package/components/_helpers/theme.js +49 -37
  7. package/components/alert/alert.js +1 -1
  8. package/components/alert-service/alert-service.js +1 -1
  9. package/components/auth/auth-core.js +1 -1
  10. package/components/auth/auth.js +1 -1
  11. package/components/auth/down-notification.js +1 -1
  12. package/components/auth/iframe-flow.js +1 -1
  13. package/components/auth/storage.js +1 -1
  14. package/components/auth-dialog/auth-dialog.js +1 -1
  15. package/components/auth-dialog-service/auth-dialog-service.js +2 -2
  16. package/components/avatar/avatar-info.js +1 -1
  17. package/components/avatar/avatar.js +1 -1
  18. package/components/avatar/fallback-avatar.js +1 -1
  19. package/components/avatar-stack/avatar-stack.js +1 -1
  20. package/components/banner/banner.js +1 -1
  21. package/components/button/button.js +1 -1
  22. package/components/button-group/button-group.js +1 -1
  23. package/components/checkbox/checkbox.js +1 -1
  24. package/components/clipboard/clipboard.js +1 -1
  25. package/components/collapse/collapse-content.js +5 -5
  26. package/components/collapse/collapse-control.js +5 -5
  27. package/components/collapse/collapse.js +4 -4
  28. package/components/confirm/confirm.js +1 -1
  29. package/components/confirm-service/confirm-service.js +2 -2
  30. package/components/contenteditable/contenteditable.js +1 -1
  31. package/components/control-help/control-help.js +1 -1
  32. package/components/control-label/control-label.js +1 -1
  33. package/components/data-list/data-list.d.ts +1 -1
  34. package/components/data-list/data-list.js +1 -1
  35. package/components/data-list/data-list.mock.d.ts +1 -1
  36. package/components/data-list/data-list.mock.js +1 -1
  37. package/components/data-list/item.d.ts +1 -1
  38. package/components/data-list/item.js +1 -1
  39. package/components/data-list/selection.d.ts +1 -1
  40. package/components/data-list/selection.js +2 -2
  41. package/components/data-list/title.js +1 -1
  42. package/components/date-picker/date-input.js +1 -1
  43. package/components/date-picker/date-picker.js +1 -2
  44. package/components/date-picker/date-popup.js +1 -2
  45. package/components/date-picker/month-names.js +1 -1
  46. package/components/date-picker/month-slider.js +1 -1
  47. package/components/date-picker/month.js +1 -1
  48. package/components/date-picker/months.js +4 -5
  49. package/components/date-picker/use-intersection-observer.js +1 -1
  50. package/components/date-picker/use-scroll-behavior.js +45 -44
  51. package/components/date-picker/weekdays.js +1 -1
  52. package/components/date-picker/years.js +6 -7
  53. package/components/dialog/dialog.d.ts +2 -2
  54. package/components/dialog/dialog.js +3 -3
  55. package/components/dropdown/anchor.js +1 -1
  56. package/components/dropdown/dropdown.js +1 -1
  57. package/components/dropdown-menu/dropdown-menu.d.ts +4 -4
  58. package/components/dropdown-menu/dropdown-menu.js +62 -57
  59. package/components/editable-heading/editable-heading.d.ts +1 -2
  60. package/components/editable-heading/editable-heading.js +13 -12
  61. package/components/error-bubble/error-bubble.js +1 -1
  62. package/components/error-message/error-message.js +1 -1
  63. package/components/expand/collapsible-group.d.ts +5 -1
  64. package/components/expand/collapsible-group.js +15 -14
  65. package/components/footer/footer.js +1 -1
  66. package/components/global/create-stateful-context.js +11 -11
  67. package/components/global/intersection-observer-context.d.ts +2 -2
  68. package/components/global/intersection-observer-context.js +12 -12
  69. package/components/global/rerender-hoc.d.ts +4 -2
  70. package/components/global/rerender-hoc.js +10 -24
  71. package/components/{legacy-table/selection.d.ts → global/table-selection.d.ts} +14 -14
  72. package/components/{legacy-table/selection.js → global/table-selection.js} +3 -3
  73. package/components/global/theme.d.ts +4 -3
  74. package/components/global/theme.js +1 -1
  75. package/components/header/header-icon.js +1 -1
  76. package/components/header/header.js +1 -1
  77. package/components/header/links.js +1 -1
  78. package/components/header/logo.js +1 -1
  79. package/components/header/profile.js +1 -1
  80. package/components/header/services.js +1 -1
  81. package/components/header/smart-profile.js +1 -1
  82. package/components/header/smart-services.js +1 -1
  83. package/components/heading/heading.js +1 -1
  84. package/components/i18n/i18n-context.js +4 -4
  85. package/components/icon/icon-svg.js +1 -1
  86. package/components/icon/icon.js +1 -1
  87. package/components/icon/index.js +1 -1
  88. package/components/input/input.js +1 -1
  89. package/components/island/adaptive-island-hoc.js +3 -3
  90. package/components/island/content.d.ts +7 -2
  91. package/components/island/content.js +27 -18
  92. package/components/island/header.js +1 -1
  93. package/components/island/island.js +1 -1
  94. package/components/legacy-table/cell.js +1 -1
  95. package/components/legacy-table/header-cell.js +2 -2
  96. package/components/legacy-table/header.js +2 -2
  97. package/components/legacy-table/multitable.d.ts +1 -1
  98. package/components/legacy-table/row-with-focus-sensor.js +2 -2
  99. package/components/legacy-table/row.js +4 -4
  100. package/components/legacy-table/selection-adapter.d.ts +3 -3
  101. package/components/legacy-table/selection-shortcuts-hoc.d.ts +5 -5
  102. package/components/legacy-table/simple-table.d.ts +2 -2
  103. package/components/legacy-table/simple-table.js +4 -4
  104. package/components/legacy-table/smart-table.d.ts +5 -5
  105. package/components/legacy-table/smart-table.js +5 -5
  106. package/components/legacy-table/table.js +2 -2
  107. package/components/list/list-item.js +1 -1
  108. package/components/list/list-users-groups-source.js +1 -1
  109. package/components/list/list.js +1 -1
  110. package/components/login-dialog/login-dialog.js +1 -1
  111. package/components/login-dialog/service.js +2 -2
  112. package/components/message/message.js +1 -1
  113. package/components/pager/pager.js +1 -1
  114. package/components/popup/popup.js +1 -1
  115. package/components/popup/popup.target.d.ts +3 -2
  116. package/components/popup/popup.target.js +32 -28
  117. package/components/popup-menu/popup-menu.js +1 -1
  118. package/components/query-assist/query-assist-suggestions.js +1 -1
  119. package/components/query-assist/query-assist.d.ts +3 -1
  120. package/components/query-assist/query-assist.js +2 -2
  121. package/components/radio/radio-item.d.ts +3 -3
  122. package/components/radio/radio-item.js +32 -18
  123. package/components/radio/radio.d.ts +2 -2
  124. package/components/radio/radio.js +2 -2
  125. package/components/scrollable-section/scrollable-section.js +1 -1
  126. package/components/select/chevron-button.js +1 -1
  127. package/components/select/select-filter.js +1 -1
  128. package/components/select/select-popup.js +1 -1
  129. package/components/select/select.d.ts +3 -1
  130. package/components/select/select.js +1 -1
  131. package/components/slider/slider.js +100 -96
  132. package/components/storage/storage-local.js +1 -1
  133. package/components/storage/storage.js +1 -1
  134. package/components/style.css +1 -1
  135. package/components/tab-trap/tab-trap.d.ts +3 -3
  136. package/components/tab-trap/tab-trap.js +83 -80
  137. package/components/table/default-item-renderer.d.ts +20 -9
  138. package/components/table/default-item-renderer.js +83 -142
  139. package/components/table/table-component.d.ts +43 -16
  140. package/components/table/table-component.js +162 -188
  141. package/components/table/table-primitives.d.ts +28 -0
  142. package/components/table/{table-base.js → table-primitives.js} +110 -98
  143. package/components/table/table-row-focus.d.ts +4 -0
  144. package/components/table/table-row-focus.js +41 -0
  145. package/components/table/table-virtualize.d.ts +3 -3
  146. package/components/table/table-virtualize.js +111 -112
  147. package/components/table/table.d.ts +9 -24
  148. package/components/table/table.js +4 -3
  149. package/components/tabs/collapsible-more.js +1 -1
  150. package/components/tabs/collapsible-tab.js +1 -1
  151. package/components/tabs/collapsible-tabs.js +1 -1
  152. package/components/tabs/dumb-tabs.js +1 -1
  153. package/components/tabs/smart-tabs.js +1 -1
  154. package/components/tabs/tab-link.js +1 -1
  155. package/components/tabs/tabs.js +1 -1
  156. package/components/tag/tag.js +1 -1
  157. package/components/tags-input/tags-input.d.ts +3 -1
  158. package/components/tags-input/tags-input.js +1 -1
  159. package/components/tags-list/tags-list.js +1 -1
  160. package/components/toggle/toggle.js +1 -1
  161. package/components/tooltip/tooltip.js +2 -2
  162. package/components/upload/upload.d.ts +4 -3
  163. package/components/upload/upload.js +7 -29
  164. package/components/user-agreement/service.js +2 -2
  165. package/components/user-agreement/user-agreement.js +1 -1
  166. package/components/user-card/card.js +1 -1
  167. package/components/user-card/smart-user-card-tooltip.js +1 -1
  168. package/components/user-card/tooltip.js +1 -1
  169. package/components/user-card/user-card.js +1 -1
  170. package/package.json +6 -6
  171. package/components/_helpers/table2.js +0 -3
  172. package/components/global/use-event-callback.d.ts +0 -1
  173. package/components/global/use-event-callback.js +0 -44
  174. package/components/table/table-base.d.ts +0 -24
@@ -1,5 +1,5 @@
1
- import { c } from 'react-compiler-runtime';
2
- import { useContext } from 'react';
1
+ import { c } from 'react/compiler-runtime';
2
+ import { use } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import unsortedIcon from '@jetbrains/icons/unsorted-12px';
5
5
  import arrowDownIcon from '@jetbrains/icons/arrow-12px-down';
@@ -7,6 +7,7 @@ import arrowUpIcon from '@jetbrains/icons/arrow-12px-up';
7
7
  import trashIcon from '@jetbrains/icons/trash-12px';
8
8
  import Icon from '../icon/icon.js';
9
9
  import { TablePropsContext, ColumnIndexContext } from './table-const.js';
10
+ import { keyboardFocusableAttrName } from './table-row-focus.js';
10
11
  import { s as styles } from '../_helpers/table.js';
11
12
  import { jsx, jsxs } from 'react/jsx-runtime';
12
13
  import 'util-deprecate';
@@ -14,35 +15,27 @@ import '../icon/icon.constants.js';
14
15
  import '../_helpers/icon-svg.js';
15
16
  import '../global/memoize.js';
16
17
 
17
- function SortButton(props) {
18
+ function SortButton(t0) {
18
19
  var _column$sortOrder;
19
20
  const $ = c(21);
20
- if ($[0] !== "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369") {
21
+ if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
21
22
  for (let $i = 0; $i < 21; $i += 1) {
22
23
  $[$i] = Symbol.for("react.memo_cache_sentinel");
23
24
  }
24
- $[0] = "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369";
25
+ $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
25
26
  }
26
- const tableProps = useContext(TablePropsContext);
27
- const columnIndex = useContext(ColumnIndexContext);
28
- const column = tableProps?.columns[columnIndex];
29
- if (!tableProps || !column) {
30
- return null;
31
- }
32
- const sortOrder = (_column$sortOrder = column.sortOrder) !== null && _column$sortOrder !== void 0 ? _column$sortOrder : "none";
33
- const glyph = sortOrder === "none" ? unsortedIcon : sortOrder === "ascending" ? arrowUpIcon : arrowDownIcon;
34
27
  let children;
35
28
  let className;
36
29
  let onClick;
37
30
  let restProps;
38
- if ($[1] !== props) {
31
+ if ($[1] !== t0) {
39
32
  ({
40
33
  className,
41
34
  children,
42
35
  onClick,
43
36
  ...restProps
44
- } = props);
45
- $[1] = props;
37
+ } = t0);
38
+ $[1] = t0;
46
39
  $[2] = children;
47
40
  $[3] = className;
48
41
  $[4] = onClick;
@@ -53,94 +46,96 @@ function SortButton(props) {
53
46
  onClick = $[4];
54
47
  restProps = $[5];
55
48
  }
56
- let t0;
49
+ const tableProps = use(TablePropsContext);
50
+ const columnIndex = use(ColumnIndexContext);
51
+ const column = tableProps?.columns[columnIndex];
52
+ const sortOrder = (_column$sortOrder = column?.sortOrder) !== null && _column$sortOrder !== void 0 ? _column$sortOrder : "none";
53
+ const glyph = sortOrder === "none" ? unsortedIcon : sortOrder === "ascending" ? arrowUpIcon : arrowDownIcon;
54
+ let t1;
57
55
  if ($[6] !== columnIndex || $[7] !== onClick || $[8] !== sortOrder || $[9] !== tableProps) {
58
- t0 = function handleClick(e) {
56
+ t1 = e => {
59
57
  onClick?.(e);
60
58
  if (!e.defaultPrevented) {
61
59
  const sequence = ["none", "ascending", "descending"];
62
60
  const nextOrder = sequence[(sequence.indexOf(sortOrder) + 1) % sequence.length];
63
- tableProps.onSort?.(columnIndex, nextOrder);
61
+ tableProps.onSort?.(columnIndex, nextOrder, tableProps.columns);
64
62
  }
65
63
  };
66
64
  $[6] = columnIndex;
67
65
  $[7] = onClick;
68
66
  $[8] = sortOrder;
69
67
  $[9] = tableProps;
70
- $[10] = t0;
68
+ $[10] = t1;
71
69
  } else {
72
- t0 = $[10];
70
+ t1 = $[10];
73
71
  }
74
- const handleClick = t0;
75
- let t1;
72
+ const handleClick = t1;
73
+ if (!tableProps || !column) {
74
+ return null;
75
+ }
76
+ let t2;
76
77
  if ($[11] !== className) {
77
- t1 = classNames(styles.headerButton, className);
78
+ t2 = classNames(styles.headerButton, className);
78
79
  $[11] = className;
79
- $[12] = t1;
80
+ $[12] = t2;
80
81
  } else {
81
- t1 = $[12];
82
+ t2 = $[12];
82
83
  }
83
- let t2;
84
+ let t3;
84
85
  if ($[13] !== glyph) {
85
- t2 = /*#__PURE__*/jsx(Icon, {
86
+ t3 = /*#__PURE__*/jsx(Icon, {
86
87
  glyph: glyph,
87
88
  "aria-hidden": true
88
89
  });
89
90
  $[13] = glyph;
90
- $[14] = t2;
91
+ $[14] = t3;
91
92
  } else {
92
- t2 = $[14];
93
+ t3 = $[14];
93
94
  }
94
- let t3;
95
- if ($[15] !== children || $[16] !== handleClick || $[17] !== restProps || $[18] !== t1 || $[19] !== t2) {
96
- t3 = /*#__PURE__*/jsxs("button", {
95
+ let t4;
96
+ if ($[15] !== children || $[16] !== handleClick || $[17] !== restProps || $[18] !== t2 || $[19] !== t3) {
97
+ t4 = /*#__PURE__*/jsxs("button", {
97
98
  type: "button",
98
- className: t1,
99
+ className: t2,
99
100
  onClick: handleClick,
100
101
  ...restProps,
101
- children: [children, " ", t2]
102
+ children: [children, " ", t3]
102
103
  });
103
104
  $[15] = children;
104
105
  $[16] = handleClick;
105
106
  $[17] = restProps;
106
- $[18] = t1;
107
- $[19] = t2;
108
- $[20] = t3;
107
+ $[18] = t2;
108
+ $[19] = t3;
109
+ $[20] = t4;
109
110
  } else {
110
- t3 = $[20];
111
+ t4 = $[20];
111
112
  }
112
- return t3;
113
+ return t4;
113
114
  }
114
115
  /**
115
116
  * Include it in a column header to make the column deletable.
116
117
  * Beware that `column.name ?? String(column.key)` is used in the aria-label.
117
118
  * Handle clicks with {@link TableProps.onColumnDelete}.
118
119
  */
119
- function DeleteColumnButton(props) {
120
+ function DeleteColumnButton(t0) {
120
121
  var _column$name;
121
122
  const $ = c(17);
122
- if ($[0] !== "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369") {
123
+ if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
123
124
  for (let $i = 0; $i < 17; $i += 1) {
124
125
  $[$i] = Symbol.for("react.memo_cache_sentinel");
125
126
  }
126
- $[0] = "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369";
127
- }
128
- const tableProps = useContext(TablePropsContext);
129
- const columnIndex = useContext(ColumnIndexContext);
130
- const column = tableProps?.columns[columnIndex];
131
- if (!tableProps || !column) {
132
- return null;
127
+ $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
133
128
  }
134
129
  let className;
135
130
  let onClick;
136
131
  let restProps;
137
- if ($[1] !== props) {
132
+ if ($[1] !== t0) {
138
133
  ({
139
134
  className,
140
135
  onClick,
141
136
  ...restProps
142
- } = props);
143
- $[1] = props;
137
+ } = t0);
138
+ $[1] = t0;
144
139
  $[2] = className;
145
140
  $[3] = onClick;
146
141
  $[4] = restProps;
@@ -149,88 +144,94 @@ function DeleteColumnButton(props) {
149
144
  onClick = $[3];
150
145
  restProps = $[4];
151
146
  }
152
- let t0;
147
+ const tableProps = use(TablePropsContext);
148
+ const columnIndex = use(ColumnIndexContext);
149
+ const column = tableProps?.columns[columnIndex];
150
+ let t1;
153
151
  if ($[5] !== columnIndex || $[6] !== onClick || $[7] !== tableProps) {
154
- t0 = function handleClick(e) {
152
+ t1 = e => {
155
153
  onClick?.(e);
156
154
  if (!e.defaultPrevented) {
157
- tableProps.onColumnDelete?.(columnIndex);
155
+ tableProps.onColumnDelete?.(columnIndex, tableProps.columns);
158
156
  }
159
157
  };
160
158
  $[5] = columnIndex;
161
159
  $[6] = onClick;
162
160
  $[7] = tableProps;
163
- $[8] = t0;
161
+ $[8] = t1;
164
162
  } else {
165
- t0 = $[8];
163
+ t1 = $[8];
166
164
  }
167
- const handleClick = t0;
168
- let t1;
165
+ const handleClick = t1;
166
+ if (!tableProps || !column) {
167
+ return null;
168
+ }
169
+ let t2;
169
170
  if ($[9] !== className) {
170
- t1 = classNames(styles.headerButton, styles.deleteColumnButton, className);
171
+ t2 = classNames(styles.headerButton, styles.deleteColumnButton, className);
171
172
  $[9] = className;
172
- $[10] = t1;
173
+ $[10] = t2;
173
174
  } else {
174
- t1 = $[10];
175
+ t2 = $[10];
175
176
  }
176
- const t2 = `Delete column ${(_column$name = column.name) !== null && _column$name !== void 0 ? _column$name : String(column.key)}`;
177
- let t3;
177
+ const t3 = `Delete column ${(_column$name = column.name) !== null && _column$name !== void 0 ? _column$name : String(column.key)}`;
178
+ let t4;
178
179
  if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
179
- t3 = /*#__PURE__*/jsx(Icon, {
180
+ t4 = /*#__PURE__*/jsx(Icon, {
180
181
  glyph: trashIcon
181
182
  });
182
- $[11] = t3;
183
+ $[11] = t4;
183
184
  } else {
184
- t3 = $[11];
185
+ t4 = $[11];
185
186
  }
186
- let t4;
187
- if ($[12] !== handleClick || $[13] !== restProps || $[14] !== t1 || $[15] !== t2) {
188
- t4 = /*#__PURE__*/jsx("button", {
187
+ let t5;
188
+ if ($[12] !== handleClick || $[13] !== restProps || $[14] !== t2 || $[15] !== t3) {
189
+ t5 = /*#__PURE__*/jsx("button", {
189
190
  type: "button",
190
- className: t1,
191
+ className: t2,
191
192
  onClick: handleClick,
192
- "aria-label": t2,
193
+ "aria-label": t3,
193
194
  ...restProps,
194
- children: t3
195
+ children: t4
195
196
  });
196
197
  $[12] = handleClick;
197
198
  $[13] = restProps;
198
- $[14] = t1;
199
- $[15] = t2;
200
- $[16] = t4;
199
+ $[14] = t2;
200
+ $[15] = t3;
201
+ $[16] = t5;
201
202
  } else {
202
- t4 = $[16];
203
+ t5 = $[16];
203
204
  }
204
- return t4;
205
+ return t5;
205
206
  }
206
207
  /**
207
208
  * A helper `<tr>` component for a custom {@link TableProps.renderItem} implementations.
208
209
  * Applies the standard row classnames.
209
210
  */
210
211
  function TableRow(props) {
211
- const $ = c(11);
212
- if ($[0] !== "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369") {
213
- for (let $i = 0; $i < 11; $i += 1) {
212
+ const $ = c(13);
213
+ if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
214
+ for (let $i = 0; $i < 13; $i += 1) {
214
215
  $[$i] = Symbol.for("react.memo_cache_sentinel");
215
216
  }
216
- $[0] = "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369";
217
+ $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
217
218
  }
218
219
  let className;
219
- let ref;
220
+ let keyboardFocusable;
220
221
  let restProps;
221
222
  if ($[1] !== props) {
222
223
  ({
223
- ref,
224
+ keyboardFocusable,
224
225
  className,
225
226
  ...restProps
226
227
  } = props);
227
228
  $[1] = props;
228
229
  $[2] = className;
229
- $[3] = ref;
230
+ $[3] = keyboardFocusable;
230
231
  $[4] = restProps;
231
232
  } else {
232
233
  className = $[2];
233
- ref = $[3];
234
+ keyboardFocusable = $[3];
234
235
  restProps = $[4];
235
236
  }
236
237
  let t0;
@@ -243,20 +244,31 @@ function TableRow(props) {
243
244
  }
244
245
  const classes = t0;
245
246
  let t1;
246
- if ($[7] !== classes || $[8] !== ref || $[9] !== restProps) {
247
- t1 = /*#__PURE__*/jsx("tr", {
248
- ref: ref,
249
- className: classes,
247
+ if ($[7] !== keyboardFocusable || $[8] !== restProps) {
248
+ t1 = keyboardFocusable ? {
249
+ [keyboardFocusableAttrName]: "",
250
250
  ...restProps
251
+ } : restProps;
252
+ $[7] = keyboardFocusable;
253
+ $[8] = restProps;
254
+ $[9] = t1;
255
+ } else {
256
+ t1 = $[9];
257
+ }
258
+ const trRestProps = t1;
259
+ let t2;
260
+ if ($[10] !== classes || $[11] !== trRestProps) {
261
+ t2 = /*#__PURE__*/jsx("tr", {
262
+ className: classes,
263
+ ...trRestProps
251
264
  });
252
- $[7] = classes;
253
- $[8] = ref;
254
- $[9] = restProps;
255
- $[10] = t1;
265
+ $[10] = classes;
266
+ $[11] = trRestProps;
267
+ $[12] = t2;
256
268
  } else {
257
- t1 = $[10];
269
+ t2 = $[12];
258
270
  }
259
- return t1;
271
+ return t2;
260
272
  }
261
273
  /**
262
274
  * A helper `<td>` component for a custom {@link TableProps.renderItem} implementations.
@@ -264,11 +276,11 @@ function TableRow(props) {
264
276
  */
265
277
  function TableCell(props) {
266
278
  const $ = c(9);
267
- if ($[0] !== "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369") {
279
+ if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
268
280
  for (let $i = 0; $i < 9; $i += 1) {
269
281
  $[$i] = Symbol.for("react.memo_cache_sentinel");
270
282
  }
271
- $[0] = "41002a734705c9c4f3ba11120213f00b7457aedaa8304bff045a817c65d54369";
283
+ $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
272
284
  }
273
285
  let className;
274
286
  let restProps;
@@ -0,0 +1,4 @@
1
+ export declare const keyboardFocusableAttrName = "data-keyboard-focusable";
2
+ export declare function focusRow(row: HTMLTableRowElement): void;
3
+ export declare function onKeyDownTbody(e: React.KeyboardEvent<HTMLTableSectionElement>): void;
4
+ export declare function onBlurCaptureTbody(e: React.FocusEvent<HTMLTableSectionElement>): void;
@@ -0,0 +1,41 @@
1
+ const keyboardFocusableAttrName = 'data-keyboard-focusable';
2
+ const temporaryTabIndexAttrName = 'data-temporary-tabindex';
3
+ function focusRow(row) {
4
+ if (!row.hasAttribute('tabindex')) {
5
+ row.tabIndex = 0;
6
+ row.setAttribute(temporaryTabIndexAttrName, '');
7
+ }
8
+ row.focus();
9
+ }
10
+ function onKeyDownTbody(e) {
11
+ if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown') {
12
+ return;
13
+ }
14
+ const tbody = e.currentTarget;
15
+ const currentRow = e.target.closest('tr');
16
+ if (!(currentRow instanceof HTMLTableRowElement) || currentRow.parentElement !== tbody) {
17
+ return;
18
+ }
19
+ let candidate = currentRow;
20
+ while (candidate) {
21
+ candidate = e.key === 'ArrowUp' ? candidate.previousElementSibling : candidate.nextElementSibling;
22
+ if (candidate?.hasAttribute(keyboardFocusableAttrName)) {
23
+ focusRow(candidate);
24
+ e.preventDefault();
25
+ return;
26
+ }
27
+ }
28
+ }
29
+ function onBlurCaptureTbody(e) {
30
+ const tbody = e.currentTarget;
31
+ if (!(e.target instanceof HTMLTableRowElement) || e.target.parentElement !== tbody) {
32
+ return;
33
+ }
34
+ const row = e.target;
35
+ if (row.hasAttribute(temporaryTabIndexAttrName)) {
36
+ row.removeAttribute('tabindex');
37
+ row.removeAttribute(temporaryTabIndexAttrName);
38
+ }
39
+ }
40
+
41
+ export { focusRow, keyboardFocusableAttrName, onBlurCaptureTbody, onKeyDownTbody };
@@ -11,12 +11,12 @@ interface Spacer {
11
11
  height: number;
12
12
  key: string;
13
13
  }
14
- export declare function useTableVirtualize({ enabled, length, scrollerRef, tableRef, estimateHeight, lookaheadPx, retentionMarginPx, minScrollAndResizeDeltaPx, }: {
14
+ export declare function useTableVirtualize<T>({ enabled, data, data: { length }, scrollerRef, tableRef, estimateHeight, lookaheadPx, retentionMarginPx, minScrollAndResizeDeltaPx, }: {
15
15
  enabled: boolean;
16
- length: number;
16
+ data: T[];
17
17
  scrollerRef: RefObject<HTMLElement | null> | undefined;
18
18
  tableRef: RefObject<HTMLTableElement | null>;
19
- estimateHeight: (index: number) => number;
19
+ estimateHeight: (item: T, index: number, items: T[]) => number;
20
20
  lookaheadPx: number;
21
21
  retentionMarginPx: number;
22
22
  minScrollAndResizeDeltaPx: number;