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

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 (120) hide show
  1. package/components/_helpers/alert.js +3 -0
  2. package/components/_helpers/caption.js +1 -1
  3. package/components/_helpers/header.js +1 -1
  4. package/components/_helpers/heading.js +2 -2
  5. package/components/_helpers/table.js +1 -1
  6. package/components/_helpers/theme.js +1 -1
  7. package/components/alert/alert-actions.d.ts +4 -0
  8. package/components/alert/alert-actions.js +51 -0
  9. package/components/alert/alert-heading.d.ts +4 -0
  10. package/components/alert/alert-heading.js +62 -0
  11. package/components/alert/alert.d.ts +14 -1
  12. package/components/alert/alert.js +44 -26
  13. package/components/alert-service/alert-service.d.ts +2 -1
  14. package/components/alert-service/alert-service.js +15 -5
  15. package/components/auth/auth-core.d.ts +5 -9
  16. package/components/auth/auth-core.js +71 -17
  17. package/components/auth/auth.js +7 -1
  18. package/components/auth/down-notification.js +7 -1
  19. package/components/auth/iframe-flow.js +1 -1
  20. package/components/auth/storage.js +7 -1
  21. package/components/checkbox/checkbox.d.ts +1 -1
  22. package/components/clipboard/clipboard.js +7 -1
  23. package/components/collapsible-group/collapsible-group.d.ts +20 -0
  24. package/components/collapsible-group/collapsible-group.js +382 -0
  25. package/components/components/util-stories.js +63 -1
  26. package/components/data-list/data-list.js +1 -1
  27. package/components/data-list/title.js +1 -1
  28. package/components/date-picker/consts.d.ts +1 -0
  29. package/components/date-picker/date-input.js +3 -2
  30. package/components/date-picker/date-popup.js +3 -3
  31. package/components/dropdown-menu/dropdown-menu.js +6 -6
  32. package/components/editable-heading/editable-heading.js +122 -109
  33. package/components/expand/collapsible-group.d.ts +8 -20
  34. package/components/expand/collapsible-group.js +34 -365
  35. package/components/global/compose-refs.d.ts +2 -1
  36. package/components/global/compose-refs.js +44 -8
  37. package/components/global/focus-sensor-hoc.js +1 -0
  38. package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
  39. package/components/global/focus-with-temporary-tabindex.js +23 -0
  40. package/components/global/intersection-observer-context.d.ts +29 -9
  41. package/components/global/intersection-observer-context.js +50 -52
  42. package/components/global/is-within-interactive-element.d.ts +6 -0
  43. package/components/global/is-within-interactive-element.js +11 -0
  44. package/components/global/is-within-navigable-element.d.ts +6 -0
  45. package/components/global/is-within-navigable-element.js +11 -0
  46. package/components/global/parse-css-duration.d.ts +5 -0
  47. package/components/global/parse-css-duration.js +14 -0
  48. package/components/global/rerender-hoc.js +1 -0
  49. package/components/global/schedule-with-cleanup.d.ts +12 -0
  50. package/components/global/schedule-with-cleanup.js +36 -0
  51. package/components/global/table-selection.js +1 -1
  52. package/components/global/theme.js +1 -1
  53. package/components/header/header.js +8 -2
  54. package/components/header/smart-profile.js +7 -1
  55. package/components/heading/heading.js +3 -3
  56. package/components/http/http.d.ts +2 -2
  57. package/components/http/http.js +2 -2
  58. package/components/i18n/i18n.d.ts +1 -0
  59. package/components/i18n/i18n.js +2 -0
  60. package/components/input/input.d.ts +1 -1
  61. package/components/internal/reorder-animation-context.js +159 -0
  62. package/components/internal/reorder-handle.js +750 -0
  63. package/components/internal/reorder-layout-context.js +141 -0
  64. package/components/internal/table-header.js +685 -0
  65. package/components/{table/table-virtualize.js → internal/virtualization.js} +123 -84
  66. package/components/legacy-table/header-cell.js +2 -2
  67. package/components/legacy-table/row-with-focus-sensor.js +1 -1
  68. package/components/legacy-table/row.d.ts +1 -1
  69. package/components/legacy-table/simple-table.js +1 -1
  70. package/components/legacy-table/smart-table.js +1 -1
  71. package/components/legacy-table/table.js +1 -1
  72. package/components/markdown/markdown.js +2 -2
  73. package/components/message/message.js +1 -1
  74. package/components/old-browsers-message/white-list.js +2 -2
  75. package/components/popup/popup.d.ts +2 -0
  76. package/components/popup/popup.js +5 -1
  77. package/components/select/select-popup.d.ts +1 -1
  78. package/components/select/select.d.ts +1 -1
  79. package/components/storage/storage-local.js +7 -1
  80. package/components/storage/storage.js +7 -1
  81. package/components/style.css +1 -1
  82. package/components/table/default-item-renderer.d.ts +29 -10
  83. package/components/table/default-item-renderer.js +151 -93
  84. package/components/table/internal/reorder-animation-context.d.ts +21 -0
  85. package/components/table/internal/reorder-handle.d.ts +9 -0
  86. package/components/table/internal/reorder-layout-context.d.ts +16 -0
  87. package/components/table/internal/table-header.d.ts +1 -0
  88. package/components/table/internal/virtualization.d.ts +41 -0
  89. package/components/table/item-virtualization.d.ts +37 -0
  90. package/components/table/item-virtualization.js +73 -0
  91. package/components/table/reorder-animation.d.ts +37 -0
  92. package/components/table/reorder-animation.js +18 -0
  93. package/components/table/reorder-item-layout.d.ts +32 -0
  94. package/components/table/reorder-item-layout.js +57 -0
  95. package/components/table/table-const.d.ts +8 -6
  96. package/components/table/table-const.js +8 -6
  97. package/components/table/table-primitives.d.ts +52 -16
  98. package/components/table/table-primitives.js +64 -207
  99. package/components/table/table-props.d.ts +304 -0
  100. package/components/table/table-props.js +1 -0
  101. package/components/table/table.d.ts +231 -209
  102. package/components/table/table.js +365 -17
  103. package/components/tooltip/tooltip.js +1 -1
  104. package/components/user-agreement/service.js +13 -7
  105. package/components/user-card/card.js +7 -1
  106. package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
  107. package/components/user-card/smart-user-card-tooltip.js +7 -1
  108. package/components/user-card/tooltip.js +7 -1
  109. package/components/user-card/user-card.js +7 -1
  110. package/components/util-stories.d.ts +26 -0
  111. package/package.json +3 -3
  112. package/components/date-picker/use-intersection-observer.d.ts +0 -6
  113. package/components/date-picker/use-intersection-observer.js +0 -93
  114. package/components/global/composeRefs.d.ts +0 -6
  115. package/components/global/composeRefs.js +0 -9
  116. package/components/table/table-component.d.ts +0 -80
  117. package/components/table/table-component.js +0 -290
  118. package/components/table/table-row-focus.d.ts +0 -4
  119. package/components/table/table-row-focus.js +0 -41
  120. package/components/table/table-virtualize.d.ts +0 -32
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Registers the physical boundaries of a custom-rendered item with the reorder
3
+ * system, so that the insertion indicator and insertion point calculation are
4
+ * correct for items that span multiple rows or have non-standard sizing.
5
+ *
6
+ * `DefaultItemRenderer` calls this automatically. Use this hook in a custom item
7
+ * renderer when the default boundary measurement is insufficient — for example,
8
+ * when the item spans multiple rows, or when you don't use
9
+ * the `DefaultItemRenderer` at all.
10
+ *
11
+ * If you include `DefaultItemRenderer` inside your custom renderer, set its
12
+ * `noReorderLayout` prop to `true` to prevent double registration.
13
+ */
14
+ export declare function useReorderItemLayout({ disabled, index, getBounds, }: {
15
+ /**
16
+ * When `true`, the item is not registered. Use to disable without violating
17
+ * the rules of hooks.
18
+ */
19
+ disabled?: boolean;
20
+ /**
21
+ * Index of the item in the `data` array.
22
+ */
23
+ index: number;
24
+ /**
25
+ * Returns the item's top and bottom client coordinates (in pixels, relative
26
+ * to the viewport).
27
+ */
28
+ getBounds: () => {
29
+ start: number;
30
+ end: number;
31
+ };
32
+ }): void;
@@ -0,0 +1,57 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { use, useEffect } from 'react';
3
+ import { ReorderLayoutContext } from '../internal/reorder-layout-context.js';
4
+
5
+ /**
6
+ * Registers the physical boundaries of a custom-rendered item with the reorder
7
+ * system, so that the insertion indicator and insertion point calculation are
8
+ * correct for items that span multiple rows or have non-standard sizing.
9
+ *
10
+ * `DefaultItemRenderer` calls this automatically. Use this hook in a custom item
11
+ * renderer when the default boundary measurement is insufficient — for example,
12
+ * when the item spans multiple rows, or when you don't use
13
+ * the `DefaultItemRenderer` at all.
14
+ *
15
+ * If you include `DefaultItemRenderer` inside your custom renderer, set its
16
+ * `noReorderLayout` prop to `true` to prevent double registration.
17
+ */
18
+ function useReorderItemLayout(t0) {
19
+ const $ = c(7);
20
+ if ($[0] !== "f6c2f22ac6ea5d08fd2648f9af507c996aa6e89216dff089c71921e1eb0bbd40") {
21
+ for (let $i = 0; $i < 7; $i += 1) {
22
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
23
+ }
24
+ $[0] = "f6c2f22ac6ea5d08fd2648f9af507c996aa6e89216dff089c71921e1eb0bbd40";
25
+ }
26
+ const {
27
+ disabled,
28
+ index,
29
+ getBounds
30
+ } = t0;
31
+ const {
32
+ registerReorderItem
33
+ } = use(ReorderLayoutContext);
34
+ let t1;
35
+ let t2;
36
+ if ($[1] !== disabled || $[2] !== getBounds || $[3] !== index || $[4] !== registerReorderItem) {
37
+ t1 = () => {
38
+ if (disabled) {
39
+ return;
40
+ }
41
+ return registerReorderItem(index, getBounds);
42
+ };
43
+ t2 = [index, getBounds, registerReorderItem, disabled];
44
+ $[1] = disabled;
45
+ $[2] = getBounds;
46
+ $[3] = index;
47
+ $[4] = registerReorderItem;
48
+ $[5] = t1;
49
+ $[6] = t2;
50
+ } else {
51
+ t1 = $[5];
52
+ t2 = $[6];
53
+ }
54
+ useEffect(t1, t2);
55
+ }
56
+
57
+ export { useReorderItemLayout };
@@ -1,8 +1,10 @@
1
- import type { TableProps } from './table';
1
+ import type { TableProps } from './table-props';
2
+ /**
3
+ * Use anywhere inside the table to get access to the props passed to it.
4
+ * Cast to `Context<TableProps<T>>` in usage place.
5
+ */
2
6
  export declare const TablePropsContext: import("react").Context<TableProps<unknown> | null>;
3
- export declare const ColumnIndexContext: import("react").Context<number>;
4
- export declare const CollapseItemIntoSpacerContext: import("react").Context<(height: number) => void>;
7
+ /**
8
+ * When a row only contains unformatted single-line text, it will be exactly of this height.
9
+ */
5
10
  export declare const defaultRowHeight = 37;
6
- export declare const defaultLookaheadPx = 400;
7
- export declare const defaultRetentionMarginPx = 450;
8
- export declare const defaultMinScrollAndResizeDeltaPx = 50;
@@ -1,11 +1,13 @@
1
1
  import { createContext } from 'react';
2
2
 
3
+ /**
4
+ * Use anywhere inside the table to get access to the props passed to it.
5
+ * Cast to `Context<TableProps<T>>` in usage place.
6
+ */
3
7
  const TablePropsContext = /*#__PURE__*/createContext(null);
4
- const ColumnIndexContext = /*#__PURE__*/createContext(-1);
5
- const CollapseItemIntoSpacerContext = /*#__PURE__*/createContext(() => {});
8
+ /**
9
+ * When a row only contains unformatted single-line text, it will be exactly of this height.
10
+ */
6
11
  const defaultRowHeight = 37;
7
- const defaultLookaheadPx = 400;
8
- const defaultRetentionMarginPx = 450;
9
- const defaultMinScrollAndResizeDeltaPx = 50;
10
12
 
11
- export { CollapseItemIntoSpacerContext, ColumnIndexContext, TablePropsContext, defaultLookaheadPx, defaultMinScrollAndResizeDeltaPx, defaultRetentionMarginPx, defaultRowHeight };
13
+ export { TablePropsContext, defaultRowHeight };
@@ -1,15 +1,4 @@
1
- import { type ComponentPropsWithRef } from 'react';
2
- /**
3
- * Include it in a column header to make the column sortable.
4
- * Handle clicks with {@link TableProps.onSort}.
5
- */
6
- export declare function SortButton<T>({ className, children, onClick, ...restProps }: ComponentPropsWithRef<'button'>): import("react").JSX.Element | null;
7
- /**
8
- * Include it in a column header to make the column deletable.
9
- * Beware that `column.name ?? String(column.key)` is used in the aria-label.
10
- * Handle clicks with {@link TableProps.onColumnDelete}.
11
- */
12
- export declare function DeleteColumnButton<T>({ className, onClick, ...restProps }: ComponentPropsWithRef<'button'>): import("react").JSX.Element | null;
1
+ import type { ComponentPropsWithRef } from 'react';
13
2
  export interface TableRowProps {
14
3
  /**
15
4
  * @see DefaultItemRendererProps.keyboardFocusable
@@ -17,12 +6,59 @@ export interface TableRowProps {
17
6
  keyboardFocusable?: boolean;
18
7
  }
19
8
  /**
20
- * A helper `<tr>` component for a custom {@link TableProps.renderItem} implementations.
21
- * Applies the standard row classnames.
9
+ * @internal
10
+ */
11
+ export declare const keyboardFocusableAttrName = "data-keyboard-focusable";
12
+ /**
13
+ * A helper `<tr>` component for custom {@link TableProps.renderItem} implementations.
14
+ * Applies the standard row class names.
22
15
  */
23
16
  export declare function TableRow(props: TableRowProps & ComponentPropsWithRef<'tr'>): import("react").JSX.Element;
24
17
  /**
25
- * A helper `<td>` component for a custom {@link TableProps.renderItem} implementations.
26
- * Applies the standard cell classnames, but not data-dependent `tdClassName`.
18
+ * A helper `<td>` component for custom {@link TableProps.renderItem} implementations.
19
+ * Applies the standard cell class names, but not data-dependent `tdClassName`.
27
20
  */
28
21
  export declare function TableCell(props: ComponentPropsWithRef<'td'>): import("react").JSX.Element;
22
+ /**
23
+ * - `'pointerdown'` means the user has pressed the mouse button or touched the handle.
24
+ * - `number` means the distance in pixels the user has dragged the handle along
25
+ * the Y axis.
26
+ * - `'cancelled'` means the reorder was aborted — e.g. the user pressed Escape,
27
+ * released the pointer outside the browser, or dropped the item at its original
28
+ * position. Use this phase to play a cancellation animation in your custom renderer.
29
+ * This state lasts 600 ms (matching the built-in cancel animation), after which
30
+ * `undefined` is sent.
31
+ * - `undefined` means the drag interaction is fully over. Sent after a successful
32
+ * reorder as well as after the `'cancelled'` phase, so you can always do cleanup
33
+ * here without managing your own timer.
34
+ */
35
+ export type DragState = 'pointerdown' | number | 'cancelled' | undefined;
36
+ export interface ItemReorderHandleProps {
37
+ /**
38
+ * The index of the item in the table data array.
39
+ */
40
+ index: number;
41
+ /**
42
+ * When `true`, the drag frame, indicating the currently dragged item,
43
+ * will not be rendered.
44
+ */
45
+ noDragFrame?: boolean;
46
+ /**
47
+ * When `true`, the drag handle stays fixed in place instead of following
48
+ * the pointer during drag.
49
+ */
50
+ noHandleTranslate?: boolean;
51
+ /**
52
+ * Callback that is called when the user drags the handle.
53
+ * Use it for custom drag indication.
54
+ * The `TableProps.onItemReorder` will be called after this callback.
55
+ * @param state The current drag state.
56
+ */
57
+ onUserDrag?: (state: DragState) => void;
58
+ }
59
+ /**
60
+ * A drag handle that allows the user to reorder the row. Place it anywhere
61
+ * inside a row renderer.
62
+ * Use {@link TableProps.canReorderItem} and {@link TableProps.onItemReorder}.
63
+ */
64
+ export declare function ItemReorderHandle({ index, ...restProps }: ItemReorderHandleProps & ComponentPropsWithRef<'button'>): import("react").JSX.Element;
@@ -1,220 +1,35 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { use } from 'react';
3
2
  import classNames from 'classnames';
4
- import unsortedIcon from '@jetbrains/icons/unsorted-12px';
5
- import arrowDownIcon from '@jetbrains/icons/arrow-12px-down';
6
- import arrowUpIcon from '@jetbrains/icons/arrow-12px-up';
7
- import trashIcon from '@jetbrains/icons/trash-12px';
8
- import Icon from '../icon/icon.js';
9
- import { TablePropsContext, ColumnIndexContext } from './table-const.js';
10
- import { keyboardFocusableAttrName } from './table-row-focus.js';
3
+ import { ReorderHandle } from '../internal/reorder-handle.js';
11
4
  import { s as styles } from '../_helpers/table.js';
12
- import { jsx, jsxs } from 'react/jsx-runtime';
5
+ import { jsx } from 'react/jsx-runtime';
6
+ import 'react';
7
+ import '@jetbrains/icons/drag-12px';
8
+ import './table-const.js';
9
+ import '../icon/icon.js';
13
10
  import 'util-deprecate';
14
11
  import '../icon/icon.constants.js';
15
12
  import '../_helpers/icon-svg.js';
16
13
  import '../global/memoize.js';
14
+ import '../global/compose-refs.js';
15
+ import 'memoize-one';
16
+ import '../global/parse-css-duration.js';
17
+ import '../internal/reorder-animation-context.js';
18
+ import '../global/schedule-with-cleanup.js';
19
+ import '../internal/reorder-layout-context.js';
17
20
 
18
- function SortButton(t0) {
19
- var _column$sortOrder;
20
- const $ = c(21);
21
- if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
22
- for (let $i = 0; $i < 21; $i += 1) {
23
- $[$i] = Symbol.for("react.memo_cache_sentinel");
24
- }
25
- $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
26
- }
27
- let children;
28
- let className;
29
- let onClick;
30
- let restProps;
31
- if ($[1] !== t0) {
32
- ({
33
- className,
34
- children,
35
- onClick,
36
- ...restProps
37
- } = t0);
38
- $[1] = t0;
39
- $[2] = children;
40
- $[3] = className;
41
- $[4] = onClick;
42
- $[5] = restProps;
43
- } else {
44
- children = $[2];
45
- className = $[3];
46
- onClick = $[4];
47
- restProps = $[5];
48
- }
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;
55
- if ($[6] !== columnIndex || $[7] !== onClick || $[8] !== sortOrder || $[9] !== tableProps) {
56
- t1 = e => {
57
- onClick?.(e);
58
- if (!e.defaultPrevented) {
59
- const sequence = ["none", "ascending", "descending"];
60
- const nextOrder = sequence[(sequence.indexOf(sortOrder) + 1) % sequence.length];
61
- tableProps.onSort?.(columnIndex, nextOrder, tableProps.columns);
62
- }
63
- };
64
- $[6] = columnIndex;
65
- $[7] = onClick;
66
- $[8] = sortOrder;
67
- $[9] = tableProps;
68
- $[10] = t1;
69
- } else {
70
- t1 = $[10];
71
- }
72
- const handleClick = t1;
73
- if (!tableProps || !column) {
74
- return null;
75
- }
76
- let t2;
77
- if ($[11] !== className) {
78
- t2 = classNames(styles.headerButton, className);
79
- $[11] = className;
80
- $[12] = t2;
81
- } else {
82
- t2 = $[12];
83
- }
84
- let t3;
85
- if ($[13] !== glyph) {
86
- t3 = /*#__PURE__*/jsx(Icon, {
87
- glyph: glyph,
88
- "aria-hidden": true
89
- });
90
- $[13] = glyph;
91
- $[14] = t3;
92
- } else {
93
- t3 = $[14];
94
- }
95
- let t4;
96
- if ($[15] !== children || $[16] !== handleClick || $[17] !== restProps || $[18] !== t2 || $[19] !== t3) {
97
- t4 = /*#__PURE__*/jsxs("button", {
98
- type: "button",
99
- className: t2,
100
- onClick: handleClick,
101
- ...restProps,
102
- children: [children, " ", t3]
103
- });
104
- $[15] = children;
105
- $[16] = handleClick;
106
- $[17] = restProps;
107
- $[18] = t2;
108
- $[19] = t3;
109
- $[20] = t4;
110
- } else {
111
- t4 = $[20];
112
- }
113
- return t4;
114
- }
115
- /**
116
- * Include it in a column header to make the column deletable.
117
- * Beware that `column.name ?? String(column.key)` is used in the aria-label.
118
- * Handle clicks with {@link TableProps.onColumnDelete}.
119
- */
120
- function DeleteColumnButton(t0) {
121
- var _column$name;
122
- const $ = c(17);
123
- if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
124
- for (let $i = 0; $i < 17; $i += 1) {
125
- $[$i] = Symbol.for("react.memo_cache_sentinel");
126
- }
127
- $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
128
- }
129
- let className;
130
- let onClick;
131
- let restProps;
132
- if ($[1] !== t0) {
133
- ({
134
- className,
135
- onClick,
136
- ...restProps
137
- } = t0);
138
- $[1] = t0;
139
- $[2] = className;
140
- $[3] = onClick;
141
- $[4] = restProps;
142
- } else {
143
- className = $[2];
144
- onClick = $[3];
145
- restProps = $[4];
146
- }
147
- const tableProps = use(TablePropsContext);
148
- const columnIndex = use(ColumnIndexContext);
149
- const column = tableProps?.columns[columnIndex];
150
- let t1;
151
- if ($[5] !== columnIndex || $[6] !== onClick || $[7] !== tableProps) {
152
- t1 = e => {
153
- onClick?.(e);
154
- if (!e.defaultPrevented) {
155
- tableProps.onColumnDelete?.(columnIndex, tableProps.columns);
156
- }
157
- };
158
- $[5] = columnIndex;
159
- $[6] = onClick;
160
- $[7] = tableProps;
161
- $[8] = t1;
162
- } else {
163
- t1 = $[8];
164
- }
165
- const handleClick = t1;
166
- if (!tableProps || !column) {
167
- return null;
168
- }
169
- let t2;
170
- if ($[9] !== className) {
171
- t2 = classNames(styles.headerButton, styles.deleteColumnButton, className);
172
- $[9] = className;
173
- $[10] = t2;
174
- } else {
175
- t2 = $[10];
176
- }
177
- const t3 = `Delete column ${(_column$name = column.name) !== null && _column$name !== void 0 ? _column$name : String(column.key)}`;
178
- let t4;
179
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
180
- t4 = /*#__PURE__*/jsx(Icon, {
181
- glyph: trashIcon
182
- });
183
- $[11] = t4;
184
- } else {
185
- t4 = $[11];
186
- }
187
- let t5;
188
- if ($[12] !== handleClick || $[13] !== restProps || $[14] !== t2 || $[15] !== t3) {
189
- t5 = /*#__PURE__*/jsx("button", {
190
- type: "button",
191
- className: t2,
192
- onClick: handleClick,
193
- "aria-label": t3,
194
- ...restProps,
195
- children: t4
196
- });
197
- $[12] = handleClick;
198
- $[13] = restProps;
199
- $[14] = t2;
200
- $[15] = t3;
201
- $[16] = t5;
202
- } else {
203
- t5 = $[16];
204
- }
205
- return t5;
206
- }
21
+ const keyboardFocusableAttrName = 'data-keyboard-focusable';
207
22
  /**
208
- * A helper `<tr>` component for a custom {@link TableProps.renderItem} implementations.
209
- * Applies the standard row classnames.
23
+ * A helper `<tr>` component for custom {@link TableProps.renderItem} implementations.
24
+ * Applies the standard row class names.
210
25
  */
211
26
  function TableRow(props) {
212
27
  const $ = c(13);
213
- if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
28
+ if ($[0] !== "93324b17cadcfd02a0d3ded987965c5c50fdfc14a72160047cf34b19f7c0c48d") {
214
29
  for (let $i = 0; $i < 13; $i += 1) {
215
30
  $[$i] = Symbol.for("react.memo_cache_sentinel");
216
31
  }
217
- $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
32
+ $[0] = "93324b17cadcfd02a0d3ded987965c5c50fdfc14a72160047cf34b19f7c0c48d";
218
33
  }
219
34
  let className;
220
35
  let keyboardFocusable;
@@ -271,16 +86,16 @@ function TableRow(props) {
271
86
  return t2;
272
87
  }
273
88
  /**
274
- * A helper `<td>` component for a custom {@link TableProps.renderItem} implementations.
275
- * Applies the standard cell classnames, but not data-dependent `tdClassName`.
89
+ * A helper `<td>` component for custom {@link TableProps.renderItem} implementations.
90
+ * Applies the standard cell class names, but not data-dependent `tdClassName`.
276
91
  */
277
92
  function TableCell(props) {
278
93
  const $ = c(9);
279
- if ($[0] !== "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6") {
94
+ if ($[0] !== "93324b17cadcfd02a0d3ded987965c5c50fdfc14a72160047cf34b19f7c0c48d") {
280
95
  for (let $i = 0; $i < 9; $i += 1) {
281
96
  $[$i] = Symbol.for("react.memo_cache_sentinel");
282
97
  }
283
- $[0] = "a3c4e3796f16ce90212b13068ef9cd73f05ae49747114b4d67f34019d7274ef6";
98
+ $[0] = "93324b17cadcfd02a0d3ded987965c5c50fdfc14a72160047cf34b19f7c0c48d";
284
99
  }
285
100
  let className;
286
101
  let restProps;
@@ -319,5 +134,47 @@ function TableCell(props) {
319
134
  }
320
135
  return t1;
321
136
  }
137
+ /**
138
+ * A drag handle that allows the user to reorder the row. Place it anywhere
139
+ * inside a row renderer.
140
+ * Use {@link TableProps.canReorderItem} and {@link TableProps.onItemReorder}.
141
+ */
142
+ function ItemReorderHandle(t0) {
143
+ const $ = c(7);
144
+ if ($[0] !== "93324b17cadcfd02a0d3ded987965c5c50fdfc14a72160047cf34b19f7c0c48d") {
145
+ for (let $i = 0; $i < 7; $i += 1) {
146
+ $[$i] = Symbol.for("react.memo_cache_sentinel");
147
+ }
148
+ $[0] = "93324b17cadcfd02a0d3ded987965c5c50fdfc14a72160047cf34b19f7c0c48d";
149
+ }
150
+ let index;
151
+ let restProps;
152
+ if ($[1] !== t0) {
153
+ ({
154
+ index,
155
+ ...restProps
156
+ } = t0);
157
+ $[1] = t0;
158
+ $[2] = index;
159
+ $[3] = restProps;
160
+ } else {
161
+ index = $[2];
162
+ restProps = $[3];
163
+ }
164
+ let t1;
165
+ if ($[4] !== index || $[5] !== restProps) {
166
+ t1 = /*#__PURE__*/jsx(ReorderHandle, {
167
+ direction: "items",
168
+ index: index,
169
+ ...restProps
170
+ });
171
+ $[4] = index;
172
+ $[5] = restProps;
173
+ $[6] = t1;
174
+ } else {
175
+ t1 = $[6];
176
+ }
177
+ return t1;
178
+ }
322
179
 
323
- export { DeleteColumnButton, SortButton, TableCell, TableRow };
180
+ export { ItemReorderHandle, TableCell, TableRow, keyboardFocusableAttrName };