@jetbrains/ring-ui 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 (89) hide show
  1. package/components/alert/alert-actions.d.ts +4 -0
  2. package/components/alert/alert-actions.js +5 -0
  3. package/components/alert/alert-heading.d.ts +4 -0
  4. package/components/alert/alert-heading.js +6 -0
  5. package/components/alert/alert.css +63 -22
  6. package/components/alert/alert.d.ts +14 -1
  7. package/components/alert/alert.js +34 -19
  8. package/components/alert/container.css +1 -2
  9. package/components/alert-service/alert-service.d.ts +2 -1
  10. package/components/alert-service/alert-service.js +8 -4
  11. package/components/auth/auth-core.d.ts +5 -9
  12. package/components/auth/auth-core.js +56 -15
  13. package/components/button-group/button-group.css +5 -5
  14. package/components/checkbox/checkbox.d.ts +1 -1
  15. package/components/collapsible-group/collapsible-group.css +138 -0
  16. package/components/collapsible-group/collapsible-group.d.ts +20 -0
  17. package/components/collapsible-group/collapsible-group.js +73 -0
  18. package/components/date-picker/consts.d.ts +1 -0
  19. package/components/date-picker/date-input.js +6 -2
  20. package/components/editable-heading/editable-heading.js +14 -14
  21. package/components/expand/collapsible-group.css +23 -89
  22. package/components/expand/collapsible-group.d.ts +8 -20
  23. package/components/expand/collapsible-group.js +14 -73
  24. package/components/global/compose-refs.d.ts +2 -1
  25. package/components/global/compose-refs.js +24 -8
  26. package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
  27. package/components/global/focus-with-temporary-tabindex.js +21 -0
  28. package/components/global/intersection-observer-context.d.ts +29 -9
  29. package/components/global/intersection-observer-context.js +43 -24
  30. package/components/global/is-within-interactive-element.d.ts +6 -0
  31. package/components/global/is-within-interactive-element.js +26 -0
  32. package/components/global/is-within-navigable-element.d.ts +6 -0
  33. package/components/global/is-within-navigable-element.js +27 -0
  34. package/components/global/parse-css-duration.d.ts +5 -0
  35. package/components/global/parse-css-duration.js +13 -0
  36. package/components/global/schedule-with-cleanup.d.ts +12 -0
  37. package/components/global/schedule-with-cleanup.js +34 -0
  38. package/components/global/table-selection.js +1 -1
  39. package/components/header/header.css +3 -3
  40. package/components/http/http.d.ts +2 -2
  41. package/components/http/http.js +2 -2
  42. package/components/i18n/i18n.d.ts +1 -0
  43. package/components/i18n/messages.json +1 -0
  44. package/components/input/input.d.ts +1 -1
  45. package/components/legacy-table/row.d.ts +1 -1
  46. package/components/popup/popup.d.ts +2 -0
  47. package/components/popup/popup.js +2 -2
  48. package/components/select/select-popup.d.ts +1 -1
  49. package/components/select/select.d.ts +1 -1
  50. package/components/table/default-item-renderer.d.ts +29 -10
  51. package/components/table/default-item-renderer.js +53 -19
  52. package/components/table/internal/reorder-animation-context.d.ts +21 -0
  53. package/components/table/internal/reorder-animation-context.js +60 -0
  54. package/components/table/internal/reorder-handle.d.ts +9 -0
  55. package/components/table/internal/reorder-handle.js +334 -0
  56. package/components/table/internal/reorder-layout-context.d.ts +16 -0
  57. package/components/table/internal/reorder-layout-context.js +69 -0
  58. package/components/table/internal/table-header.d.ts +1 -0
  59. package/components/table/internal/table-header.js +143 -0
  60. package/components/table/internal/virtualization.d.ts +41 -0
  61. package/components/table/{table-virtualize.js → internal/virtualization.js} +74 -37
  62. package/components/table/item-virtualization.d.ts +37 -0
  63. package/components/table/item-virtualization.js +26 -0
  64. package/components/table/reorder-animation.d.ts +37 -0
  65. package/components/table/reorder-animation.js +11 -0
  66. package/components/table/reorder-item-layout.d.ts +32 -0
  67. package/components/table/reorder-item-layout.js +23 -0
  68. package/components/table/table-const.d.ts +8 -6
  69. package/components/table/table-const.js +7 -5
  70. package/components/table/table-primitives.d.ts +52 -16
  71. package/components/table/table-primitives.js +15 -60
  72. package/components/table/table-props.d.ts +304 -0
  73. package/components/table/table-props.js +1 -0
  74. package/components/table/table.css +179 -67
  75. package/components/table/table.d.ts +231 -209
  76. package/components/table/table.js +327 -2
  77. package/components/user-card/smart-user-card-tooltip.d.ts +1 -1
  78. package/components/util-stories.d.ts +26 -0
  79. package/components/util-stories.js +61 -0
  80. package/package.json +35 -36
  81. package/components/date-picker/use-intersection-observer.d.ts +0 -6
  82. package/components/date-picker/use-intersection-observer.js +0 -48
  83. package/components/global/composeRefs.d.ts +0 -6
  84. package/components/global/composeRefs.js +0 -7
  85. package/components/table/table-component.d.ts +0 -80
  86. package/components/table/table-component.js +0 -130
  87. package/components/table/table-row-focus.d.ts +0 -4
  88. package/components/table/table-row-focus.js +0 -42
  89. package/components/table/table-virtualize.d.ts +0 -32
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Focuses an element, temporarily adding `tabindex="0"` if necessary.
3
+ *
4
+ * If the element does not already have a `tabindex` attribute, one is
5
+ * added before focusing and automatically removed when the element loses
6
+ * focus.
7
+ *
8
+ * This is useful when implementing roving tabindex patterns on elements
9
+ * that are not normally focusable.
10
+ */
11
+ export function focusWithTemporaryTabIndex(element) {
12
+ if (!element.hasAttribute('tabindex')) {
13
+ element.tabIndex = 0;
14
+ function onBlur() {
15
+ element.removeAttribute('tabindex');
16
+ element.removeEventListener('blur', onBlur);
17
+ }
18
+ element.addEventListener('blur', onBlur);
19
+ }
20
+ element.focus();
21
+ }
@@ -1,5 +1,21 @@
1
1
  import { type RefObject } from 'react';
2
2
  /**
3
+ * Provides access to a shared `IntersectionObserver` instance
4
+ * via the {@link IntersectionObserverContext} context.
5
+ *
6
+ * @see IntersectionObserverContext
7
+ */
8
+ export interface IntersectionObserverHandle {
9
+ /**
10
+ * Starts observing an element.
11
+ *
12
+ * Returns a cleanup function that stops observing it.
13
+ */
14
+ observe(element: Element, isIntersecting: (isIntersecting: boolean) => void): () => void;
15
+ }
16
+ /**
17
+ * Multiple components can share a single `IntersectionObserver` instance through this context.
18
+ *
3
19
  * Usage:
4
20
  *
5
21
  * ```tsx
@@ -10,17 +26,21 @@ import { type RefObject } from 'react';
10
26
  * function YourComponent() {
11
27
  * // Contains the current isIntersecting value
12
28
  * const isIntersecting = useIsIntersecting(elementRef);
13
- * // Or, to get updates instead:
14
- * useIsIntersectingListener(elementRef, newIsIntersecting => {
15
- * // ...
29
+ *
30
+ * // Or, to manually work with the IntersectionObserverHandle:
31
+ * const handle = use(IntersectionObserverContext);
32
+ * useEffect(() => {
33
+ * return handle.observe(elementRef.current, isIntersecting => { ... })
16
34
  * })
17
35
  * }
18
36
  * ```
19
37
  */
20
- export declare const IntersectionObserverContext: import("react").Context<IntersectionObserverHandle | null>;
21
- export declare function useIntersectionObserverHandle(rootRef?: RefObject<HTMLElement | null>, rootMargin?: number, scrollMargin?: number): IntersectionObserverHandle | null;
22
- export interface IntersectionObserverHandle {
23
- observe(element: Element, setIsIntersecting: (isIntersecting: boolean) => void): () => void;
24
- }
38
+ export declare const IntersectionObserverContext: import("react").Context<IntersectionObserverHandle>;
39
+ /**
40
+ * Creates an IntersectionObserverHandle suitable for {@link IntersectionObserverContext}.
41
+ */
42
+ export declare function useIntersectionObserverHandle(rootRef?: RefObject<HTMLElement | null>, rootMargin?: number, scrollMargin?: number): IntersectionObserverHandle;
43
+ /**
44
+ * Returns whether the referenced element is currently intersecting.
45
+ */
25
46
  export declare function useIsIntersecting(elementRef: RefObject<Element | null>): boolean;
26
- export declare function useIsIntersectingListener(elementRef: RefObject<Element | null>, onChange: (isIntersecting: boolean) => void): void;
@@ -1,5 +1,13 @@
1
1
  import { createContext, use, useEffect, useState } from 'react';
2
2
  /**
3
+ * @internal
4
+ */
5
+ const noopIntersectionObserverHandle = {
6
+ observe: () => () => { },
7
+ };
8
+ /**
9
+ * Multiple components can share a single `IntersectionObserver` instance through this context.
10
+ *
3
11
  * Usage:
4
12
  *
5
13
  * ```tsx
@@ -10,23 +18,28 @@ import { createContext, use, useEffect, useState } from 'react';
10
18
  * function YourComponent() {
11
19
  * // Contains the current isIntersecting value
12
20
  * const isIntersecting = useIsIntersecting(elementRef);
13
- * // Or, to get updates instead:
14
- * useIsIntersectingListener(elementRef, newIsIntersecting => {
15
- * // ...
21
+ *
22
+ * // Or, to manually work with the IntersectionObserverHandle:
23
+ * const handle = use(IntersectionObserverContext);
24
+ * useEffect(() => {
25
+ * return handle.observe(elementRef.current, isIntersecting => { ... })
16
26
  * })
17
27
  * }
18
28
  * ```
19
29
  */
20
- export const IntersectionObserverContext = createContext(null);
30
+ export const IntersectionObserverContext = createContext(noopIntersectionObserverHandle);
31
+ /**
32
+ * Creates an IntersectionObserverHandle suitable for {@link IntersectionObserverContext}.
33
+ */
21
34
  export function useIntersectionObserverHandle(rootRef, rootMargin, scrollMargin) {
22
- const [handle, setHandle] = useState(null);
35
+ const [handle, setHandle] = useState(noopIntersectionObserverHandle);
23
36
  useEffect(() => {
24
37
  const root = rootRef?.current;
25
- const elementToOnChange = new Map();
38
+ const callbacksByElement = new Map();
26
39
  const observer = new IntersectionObserver(entries => {
27
40
  for (const entry of entries) {
28
- const onChange = elementToOnChange.get(entry.target);
29
- onChange?.(entry.isIntersecting);
41
+ const callbacks = callbacksByElement.get(entry.target);
42
+ callbacks?.forEach(cb => cb(entry.isIntersecting));
30
43
  }
31
44
  }, {
32
45
  root,
@@ -35,38 +48,44 @@ export function useIntersectionObserverHandle(rootRef, rootMargin, scrollMargin)
35
48
  });
36
49
  setHandle({
37
50
  observe(element, onChange) {
38
- elementToOnChange.set(element, onChange);
39
- observer.observe(element);
51
+ if (!callbacksByElement.has(element)) {
52
+ callbacksByElement.set(element, []);
53
+ observer.observe(element);
54
+ }
55
+ callbacksByElement.get(element).push(onChange);
40
56
  return () => {
41
- elementToOnChange.delete(element);
42
- observer.unobserve(element);
57
+ const callbacks = callbacksByElement.get(element);
58
+ if (!callbacks)
59
+ return;
60
+ const index = callbacks.indexOf(onChange);
61
+ if (index !== -1) {
62
+ callbacks.splice(index, 1);
63
+ }
64
+ if (!callbacks.length) {
65
+ callbacksByElement.delete(element);
66
+ observer.unobserve(element);
67
+ }
43
68
  };
44
69
  },
45
70
  });
46
71
  return () => {
47
72
  observer.disconnect();
48
- setHandle(null);
73
+ setHandle(noopIntersectionObserverHandle);
49
74
  };
50
75
  }, [rootRef, rootMargin, scrollMargin]);
51
76
  return handle;
52
77
  }
78
+ /**
79
+ * Returns whether the referenced element is currently intersecting.
80
+ */
53
81
  export function useIsIntersecting(elementRef) {
54
82
  const handle = use(IntersectionObserverContext);
55
83
  const [isIntersecting, setIsIntersecting] = useState(false);
56
84
  useEffect(() => {
57
85
  const element = elementRef.current;
58
- if (!element || !handle)
86
+ if (!element)
59
87
  return;
60
88
  return handle.observe(element, setIsIntersecting);
61
- }, [handle, elementRef, setIsIntersecting]);
89
+ }, [handle, elementRef]);
62
90
  return isIntersecting;
63
91
  }
64
- export function useIsIntersectingListener(elementRef, onChange) {
65
- const handle = use(IntersectionObserverContext);
66
- useEffect(() => {
67
- const element = elementRef.current;
68
- if (!element || !handle)
69
- return;
70
- return handle.observe(element, onChange);
71
- }, [handle, elementRef, onChange]);
72
- }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * If this function returns `false`, the event may be interpreted as a click
3
+ * or tap on a "empty space" rather than on an interactive element such as
4
+ * a button or a link.
5
+ */
6
+ export declare function isWithinInteractiveElement(target: EventTarget | null): boolean;
@@ -0,0 +1,26 @@
1
+ const interactiveSelector = [
2
+ 'a',
3
+ 'button',
4
+ 'details',
5
+ 'input',
6
+ 'label',
7
+ 'option',
8
+ 'select',
9
+ 'summary',
10
+ 'textarea',
11
+ '[contenteditable]',
12
+ '[role="button"]',
13
+ '[role="checkbox"]',
14
+ '[role="link"]',
15
+ '[role="radio"]',
16
+ '[role="switch"]',
17
+ '[role="tab"]',
18
+ ].join();
19
+ /**
20
+ * If this function returns `false`, the event may be interpreted as a click
21
+ * or tap on a "empty space" rather than on an interactive element such as
22
+ * a button or a link.
23
+ */
24
+ export function isWithinInteractiveElement(target) {
25
+ return target instanceof Element && target.closest(interactiveSelector) != null;
26
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Returns whether the event target is within an element that is expected to
3
+ * handle keyboard navigation itself, so container-level keyboard shortcuts
4
+ * should generally be ignored.
5
+ */
6
+ export declare function isWithinNavigableElement(target: EventTarget | null): boolean;
@@ -0,0 +1,27 @@
1
+ const navigableSelector = [
2
+ 'input:not([type="button"]):not([type="checkbox"]):not([type="color"]):not([type="file"]):not([type="hidden"]):not([type="image"]):not([type="reset"]):not([type="submit"])',
3
+ 'textarea',
4
+ 'select',
5
+ '[contenteditable]',
6
+ '[role="combobox"]',
7
+ '[role="grid"]',
8
+ '[role="listbox"]',
9
+ '[role="menu"]',
10
+ '[role="menubar"]',
11
+ '[role="radiogroup"]',
12
+ '[role="searchbox"]',
13
+ '[role="slider"]',
14
+ '[role="spinbutton"]',
15
+ '[role="tablist"]',
16
+ '[role="textbox"]',
17
+ '[role="tree"]',
18
+ '[role="treegrid"]',
19
+ ].join();
20
+ /**
21
+ * Returns whether the event target is within an element that is expected to
22
+ * handle keyboard navigation itself, so container-level keyboard shortcuts
23
+ * should generally be ignored.
24
+ */
25
+ export function isWithinNavigableElement(target) {
26
+ return target instanceof Element && target.closest(navigableSelector) != null;
27
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Parses a CSS duration string (e.g., "500ms", "2s") and returns the duration in milliseconds.
3
+ * Returns the `defaultVal` if the input string is not a valid CSS duration.
4
+ */
5
+ export declare function parseCssDuration(duration: string, defaultVal?: number): number;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Parses a CSS duration string (e.g., "500ms", "2s") and returns the duration in milliseconds.
3
+ * Returns the `defaultVal` if the input string is not a valid CSS duration.
4
+ */
5
+ export function parseCssDuration(duration, defaultVal = 0) {
6
+ const match = duration.match(/(\d+(\.\d+)?)(s|ms)/);
7
+ if (!match)
8
+ return defaultVal;
9
+ const value = parseFloat(match[1]);
10
+ const unit = match[3];
11
+ // eslint-disable-next-line no-magic-numbers
12
+ return unit === 's' ? value * 1000 : value;
13
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Schedules a timeout and returns a function that cancels it.
3
+ *
4
+ * Useful from React effects.
5
+ */
6
+ export declare function setTimeoutWithCleanup(callback: () => void, delay?: number): () => void;
7
+ /**
8
+ * Schedules an animation frame and returns a function that cancels it.
9
+ *
10
+ * Useful from React effects.
11
+ */
12
+ export declare function requestAnimationFrameWithCleanup(callback: () => void): () => void;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Schedules a timeout and returns a function that cancels it.
3
+ *
4
+ * Useful from React effects.
5
+ */
6
+ export function setTimeoutWithCleanup(callback, delay = 0) {
7
+ let timerId = window.setTimeout(() => {
8
+ callback();
9
+ timerId = null;
10
+ }, delay);
11
+ return () => {
12
+ if (timerId != null) {
13
+ window.clearTimeout(timerId);
14
+ timerId = null;
15
+ }
16
+ };
17
+ }
18
+ /**
19
+ * Schedules an animation frame and returns a function that cancels it.
20
+ *
21
+ * Useful from React effects.
22
+ */
23
+ export function requestAnimationFrameWithCleanup(callback) {
24
+ let rafId = requestAnimationFrame(() => {
25
+ callback();
26
+ rafId = null;
27
+ });
28
+ return () => {
29
+ if (rafId != null) {
30
+ cancelAnimationFrame(rafId);
31
+ rafId = null;
32
+ }
33
+ };
34
+ }
@@ -15,7 +15,7 @@ export default class TableSelection {
15
15
  return item.id;
16
16
  }
17
17
  // If there's no id provided on item and no getKey supplied, fail fast with a clear message
18
- throw new Error('Selection: getKey is required when items have no "id" property');
18
+ throw new Error('TableSelection: getKey is required when items have no "id" property');
19
19
  }, getChildren = () => [], isItemSelectable = () => true, } = {}) {
20
20
  this._rawData = data;
21
21
  this._getChildren = getChildren;
@@ -1,6 +1,6 @@
1
1
  @import '../global/variables.css';
2
2
 
3
- @value link, active from '../link/link.css';
3
+ @value link, active as linkActive from '../link/link.css';
4
4
 
5
5
  :root,
6
6
  :host {
@@ -41,7 +41,7 @@
41
41
  color: var(--ring-header-link-color);
42
42
  }
43
43
 
44
- & .active {
44
+ & .linkActive {
45
45
  color: var(--ring-active-text-color);
46
46
  }
47
47
  }
@@ -72,7 +72,7 @@
72
72
  color: var(--ring-header-link-color);
73
73
  }
74
74
 
75
- & .active {
75
+ & .linkActive {
76
76
  color: var(--ring-active-text-color);
77
77
  }
78
78
  }
@@ -20,7 +20,7 @@ export interface RequestParams<RawBody extends boolean = true | false> extends F
20
20
  export type RequestParamsWithoutMethod<RawBody extends boolean = boolean> = Omit<RequestParams<RawBody>, 'method'>;
21
21
  export interface HTTPAuth {
22
22
  requestToken(): Promise<string | null> | string | null;
23
- forceTokenUpdate(): Promise<string | null>;
23
+ forceTokenUpdate(failedToken?: string | null): Promise<string | null>;
24
24
  }
25
25
  export default class HTTP implements Partial<HTTPAuth> {
26
26
  baseUrl: string | null | undefined;
@@ -28,7 +28,7 @@ export default class HTTP implements Partial<HTTPAuth> {
28
28
  fetchConfig: RequestInit;
29
29
  requestToken?: () => Promise<string | null> | string | null;
30
30
  shouldRefreshToken?: (error: string) => boolean;
31
- forceTokenUpdate?: () => Promise<string | null>;
31
+ forceTokenUpdate?: (failedToken?: string | null) => Promise<string | null>;
32
32
  constructor(auth?: HTTPAuth, baseUrl?: string | null | undefined, fetchConfig?: RequestInit);
33
33
  setAuth: (auth: HTTPAuth) => void;
34
34
  setBaseUrl: (baseUrl: string | null | undefined) => void;
@@ -50,7 +50,7 @@ export default class HTTP {
50
50
  setAuth = (auth) => {
51
51
  this.requestToken = () => auth.requestToken();
52
52
  this.shouldRefreshToken = auth.constructor.shouldRefreshToken;
53
- this.forceTokenUpdate = () => auth.forceTokenUpdate();
53
+ this.forceTokenUpdate = failedToken => auth.forceTokenUpdate(failedToken);
54
54
  };
55
55
  setBaseUrl = (baseUrl) => {
56
56
  this.baseUrl = baseUrl;
@@ -141,7 +141,7 @@ export default class HTTP {
141
141
  }
142
142
  const shouldRefreshToken = typeof error.data.error === 'string' ? this.shouldRefreshToken?.(error.data.error) : false;
143
143
  if (shouldRefreshToken) {
144
- token = await this.forceTokenUpdate?.();
144
+ token = await this.forceTokenUpdate?.(token);
145
145
  response = await this._performRequest(url, token, params);
146
146
  return this._processResponse(response);
147
147
  }
@@ -23,6 +23,7 @@ export declare function getTranslations(): Partial<{
23
23
  addSecondDate: string;
24
24
  addTime: string;
25
25
  selectName: string;
26
+ selectDate: string;
26
27
  setDate: string;
27
28
  setDateTime: string;
28
29
  setPeriod: string;
@@ -19,6 +19,7 @@
19
19
  "addSecondDate": "Add second date",
20
20
  "addTime": "Add time",
21
21
  "selectName": "Select {{name}}",
22
+ "selectDate": "Select a date",
22
23
  "setDate": "Set a date",
23
24
  "setDateTime": "Set date and time",
24
25
  "setPeriod": "Set a period",
@@ -69,7 +69,7 @@ export declare class Input extends PureComponent<InputProps> {
69
69
  stretch(el: HTMLElement | null | undefined): void;
70
70
  adapt(): void;
71
71
  inputRef: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;
72
- composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value: T | null) => void>;
72
+ composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement | HTMLTextAreaElement> | undefined)[]) => (value: T | null) => () => void>;
73
73
  clear: (e: React.MouseEvent<HTMLButtonElement>) => void;
74
74
  handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
75
75
  handleTextareaChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
@@ -55,7 +55,7 @@ export default class Row<T extends object> extends PureComponent<RowProps<T>> {
55
55
  onDoubleClick: () => void;
56
56
  row?: HTMLElement | null;
57
57
  rowRef: (el: HTMLElement | null) => void;
58
- composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value: T_1 | null) => void>;
58
+ composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value: T_1 | null) => () => void>;
59
59
  render(): React.JSX.Element;
60
60
  }
61
61
  export type RowAttrs<T extends object> = React.JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
@@ -45,6 +45,8 @@ export interface BasePopupProps {
45
45
  onMouseUp?: ((e: React.MouseEvent<HTMLElement>) => void) | undefined;
46
46
  onMouseOver?: ((e: React.SyntheticEvent<HTMLElement>) => void) | undefined;
47
47
  onMouseOut?: ((e: React.SyntheticEvent<HTMLElement>) => void) | undefined;
48
+ onMouseEnter?: ((e: React.MouseEvent<HTMLElement>) => void) | undefined;
49
+ onMouseLeave?: ((e: React.MouseEvent<HTMLElement>) => void) | undefined;
48
50
  onContextMenu?: ((e: React.MouseEvent<HTMLElement>) => void) | undefined;
49
51
  onDirectionChange?: ((direction: Directions) => void) | null | undefined;
50
52
  onShow?: (() => void) | null | undefined;
@@ -282,7 +282,7 @@ export default class Popup extends PureComponent {
282
282
  esc: this._onEscPress,
283
283
  };
284
284
  render() {
285
- const { className, style, hidden, attached, keepMounted, client, onMouseDown, onMouseUp, onMouseOver, onMouseOut, onContextMenu, 'data-test': dataTest, largeBorderRadius, } = this.props;
285
+ const { className, style, hidden, attached, keepMounted, client, onMouseDown, onMouseUp, onMouseOver, onMouseOut, onMouseEnter, onMouseLeave, onContextMenu, 'data-test': dataTest, largeBorderRadius, } = this.props;
286
286
  const showing = this.state.display === Display.SHOWING;
287
287
  const direction = (this.state.direction || '').toLowerCase().replace(/[_]/g, '-');
288
288
  return (<ThemeContext.Consumer>
@@ -305,7 +305,7 @@ export default class Popup extends PureComponent {
305
305
 
306
306
  {client !== false &&
307
307
  (keepMounted || !hidden) &&
308
- createPortal(<PopupTarget id={this.uid} ref={this.containerRef} onMouseOver={onMouseOver} onFocus={onMouseOver} onMouseOut={onMouseOut} onBlur={onMouseOut} onContextMenu={onContextMenu}>
308
+ createPortal(<PopupTarget id={this.uid} ref={this.containerRef} onMouseOver={onMouseOver} onFocus={onMouseOver} onMouseOut={onMouseOut} onBlur={onMouseOut} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} onContextMenu={onContextMenu}>
309
309
  <div data-test={dataTests('ring-popup', dataTest)} data-test-shown={!hidden && !showing} data-test-direction={direction} ref={this.popupRef} className={classes} style={style} onMouseDown={onMouseDown} onMouseUp={onMouseUp}
310
310
  // mouse handlers are used to track clicking on inner elements
311
311
  role='presentation'>
@@ -127,7 +127,7 @@ export default class SelectPopup<T = unknown> extends PureComponent<SelectPopupP
127
127
  list?: List<T> | null;
128
128
  listRef: (el: List<T> | null) => void;
129
129
  filterRef: (el: HTMLInputElement | null) => void;
130
- composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T_1 | null) => void>;
130
+ composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T_1 | null) => () => void>;
131
131
  shortcutsScope: string;
132
132
  shortcutsMap: {
133
133
  tab: (event: Event) => void;
@@ -264,7 +264,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
264
264
  private _getAvatar;
265
265
  filter?: HTMLInputElement | null;
266
266
  filterRef: (el: HTMLInputElement | null) => void;
267
- composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T_1 | null) => void>;
267
+ composedFilterRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: T_1 | null) => () => void>;
268
268
  getShortcutsMap(): {
269
269
  enter: () => true | undefined;
270
270
  esc: (event: KeyboardEvent) => boolean | undefined;
@@ -5,13 +5,10 @@ export interface DefaultItemRendererProps {
5
5
  */
6
6
  index: number;
7
7
  /**
8
- * If true, the row will be focusable with up/down arrow keys.
8
+ * If `true`, the row will be focusable with up/down arrow keys.
9
9
  * Focus is implemented using the
10
10
  * ["roving tabindex"](https://developer.mozilla.org/en-US/docs/Web/Accessibility/Guides/Keyboard-navigable_JavaScript_widgets#technique_1_roving_tabindex)
11
11
  * technique, that is, only the focused row has `tabIndex={0}`.
12
- *
13
- * To focus the row on click or other user interaction, add e.g. `onClick()`
14
- * and invoke `focusRow(e.currentTarget)` imported from `table-row-focus.ts`.
15
12
  */
16
13
  keyboardFocusable?: boolean;
17
14
  /**
@@ -20,17 +17,39 @@ export interface DefaultItemRendererProps {
20
17
  */
21
18
  clickable?: boolean;
22
19
  /**
23
- * If true, the row is highlighted as selected, that is, with the
24
- * a different background color.
20
+ * If `true`, the row is highlighted as selected with a different background color.
25
21
  */
26
22
  selected?: boolean;
27
23
  /**
28
- * A level of a nested item. Results in an indent for columns with `indent: true`.
29
- * 0, negative values, and an unset value mean no indent.
24
+ * The nesting level of an item. Applies an indent for columns with
25
+ * `Column.indent` set to `true`. `0`, negative values, and an unset value
26
+ * mean no indent.
30
27
  */
31
28
  level?: number;
29
+ /**
30
+ * When set to `true`, does not control item virtualization.
31
+ * Useful when you include `DefaultItemRenderer` as a part of a custom row renderer,
32
+ * and track the visibility yourself.
33
+ */
34
+ noItemVirtualization?: boolean;
35
+ /**
36
+ * When set to `true`, does not report the item's boundaries to the reorder system.
37
+ * Useful when you include `DefaultItemRenderer` as a part of a custom row renderer
38
+ * that registers boundaries itself.
39
+ */
40
+ noReorderLayout?: boolean;
32
41
  }
33
42
  /**
34
- * @see TableProps.renderItem
43
+ * Standard component for rendering a table row.
44
+ *
45
+ * Renders an item using the table's column definitions and lets you
46
+ * configure item-scoped behavior such as selection, keyboard navigation,
47
+ * event handlers, `className`, and `ref`.
48
+ *
49
+ * Note that row-level click and keyboard handlers are not discoverable
50
+ * by assistive technologies. Make sure that any functionality relying on
51
+ * them (such as selection or expand/collapse) is also available through
52
+ * accessible controls, such as checkboxes or buttons with accessible
53
+ * labels.
35
54
  */
36
- export declare function DefaultItemRenderer<T>({ index, keyboardFocusable, clickable, selected, level, ref: userRef, className, ...restProps }: DefaultItemRendererProps & ComponentPropsWithRef<'tr'>): import("react").JSX.Element | null;
55
+ export declare function DefaultItemRenderer<T>({ index, keyboardFocusable, clickable, selected, level, noItemVirtualization, noReorderLayout, ref: userRef, className, ...restProps }: DefaultItemRendererProps & ComponentPropsWithRef<'tr'>): import("react").JSX.Element | null;