@elastic/eui 60.2.0 → 60.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/es/components/accordion/accordion.js +10 -5
  2. package/es/components/context_menu/context_menu.js +1 -1
  3. package/es/components/datagrid/body/data_grid_body.js +6 -3
  4. package/es/components/datagrid/body/data_grid_cell.js +78 -10
  5. package/es/components/datagrid/data_grid.js +2 -0
  6. package/es/components/datagrid/utils/ref.js +24 -3
  7. package/es/components/selectable/selectable.js +2 -0
  8. package/eui.d.ts +19 -5
  9. package/i18ntokens.json +27 -27
  10. package/lib/components/accordion/accordion.js +10 -5
  11. package/lib/components/context_menu/context_menu.js +1 -1
  12. package/lib/components/datagrid/body/data_grid_body.js +6 -3
  13. package/lib/components/datagrid/body/data_grid_cell.js +77 -9
  14. package/lib/components/datagrid/data_grid.js +2 -0
  15. package/lib/components/datagrid/utils/ref.js +24 -3
  16. package/lib/components/selectable/selectable.js +2 -0
  17. package/optimize/es/components/accordion/accordion.js +10 -5
  18. package/optimize/es/components/datagrid/body/data_grid_body.js +6 -3
  19. package/optimize/es/components/datagrid/body/data_grid_cell.js +18 -9
  20. package/optimize/es/components/datagrid/data_grid.js +2 -0
  21. package/optimize/es/components/datagrid/utils/ref.js +24 -3
  22. package/optimize/es/components/selectable/selectable.js +2 -0
  23. package/optimize/lib/components/accordion/accordion.js +8 -5
  24. package/optimize/lib/components/datagrid/body/data_grid_body.js +6 -3
  25. package/optimize/lib/components/datagrid/body/data_grid_cell.js +17 -8
  26. package/optimize/lib/components/datagrid/data_grid.js +2 -0
  27. package/optimize/lib/components/datagrid/utils/ref.js +24 -3
  28. package/optimize/lib/components/selectable/selectable.js +2 -0
  29. package/package.json +3 -3
  30. package/test-env/components/accordion/accordion.js +8 -5
  31. package/test-env/components/context_menu/context_menu.js +1 -1
  32. package/test-env/components/datagrid/body/data_grid_body.js +6 -3
  33. package/test-env/components/datagrid/body/data_grid_cell.js +77 -9
  34. package/test-env/components/datagrid/data_grid.js +2 -0
  35. package/test-env/components/datagrid/utils/ref.js +24 -3
  36. package/test-env/components/selectable/selectable.js +2 -0
@@ -116,6 +116,14 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
116
116
 
117
117
  _defineProperty(_assertThisInitialized(_this), "generatedId", htmlIdGenerator()());
118
118
 
119
+ _defineProperty(_assertThisInitialized(_this), "resizeRef", function () {});
120
+
121
+ _defineProperty(_assertThisInitialized(_this), "observerRef", function (ref) {
122
+ _this.setChildContentRef(ref);
123
+
124
+ _this.resizeRef(ref);
125
+ });
126
+
119
127
  return _this;
120
128
  }
121
129
 
@@ -266,12 +274,9 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
266
274
  }, ___EmotionJSX(EuiResizeObserver, {
267
275
  onResize: this.setChildContentHeight
268
276
  }, function (resizeRef) {
277
+ _this2.resizeRef = resizeRef;
269
278
  return ___EmotionJSX("div", {
270
- ref: function ref(_ref) {
271
- _this2.setChildContentRef(_ref);
272
-
273
- resizeRef(_ref);
274
- }
279
+ ref: _this2.observerRef
275
280
  }, ___EmotionJSX("div", {
276
281
  className: childrenClasses,
277
282
  css: cssChildrenStyles
@@ -404,7 +404,7 @@ EuiContextMenu.propTypes = {
404
404
  "data-test-subj": PropTypes.string
405
405
  }).isRequired),
406
406
  content: PropTypes.node,
407
- width: PropTypes.number,
407
+ width: PropTypes.any,
408
408
  initialFocusedItemIndex: PropTypes.number,
409
409
 
410
410
  /**
@@ -70,7 +70,8 @@ export var Cell = function Cell(_ref) {
70
70
  schemaDetectors = data.schemaDetectors,
71
71
  rowHeightsOptions = data.rowHeightsOptions,
72
72
  rowHeightUtils = data.rowHeightUtils,
73
- rowManager = data.rowManager;
73
+ rowManager = data.rowManager,
74
+ pagination = data.pagination;
74
75
  var popoverContext = useContext(DataGridCellPopoverContext);
75
76
 
76
77
  var _useContext = useContext(DataGridWrapperRowsContext),
@@ -109,7 +110,8 @@ export var Cell = function Cell(_ref) {
109
110
  rowHeightUtils: rowHeightUtils,
110
111
  setRowHeight: isFirstColumn ? setRowHeight : undefined,
111
112
  rowManager: rowManager,
112
- popoverContext: popoverContext
113
+ popoverContext: popoverContext,
114
+ pagination: pagination
113
115
  };
114
116
 
115
117
  if (isLeadingControlColumn) {
@@ -438,7 +440,8 @@ export var EuiDataGridBody = function EuiDataGridBody(props) {
438
440
  interactiveCellId: interactiveCellId,
439
441
  rowHeightsOptions: rowHeightsOptions,
440
442
  rowHeightUtils: rowHeightUtils,
441
- rowManager: rowManager
443
+ rowManager: rowManager,
444
+ pagination: pagination
442
445
  },
443
446
  rowCount: IS_JEST_ENVIRONMENT || headerRowHeight > 0 ? visibleRowCount : 0
444
447
  }), Cell), scrollBorderOverlay) : null;
@@ -1,7 +1,7 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
2
 
3
- var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowHeightsOptions", "rowIndex", "colIndex", "rowHeightUtils", "isDefinedHeight"],
4
- _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager"],
3
+ var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowHeightsOptions", "rowIndex", "colIndex", "ariaRowIndex", "rowHeightUtils", "isDefinedHeight"],
4
+ _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
5
5
  _excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
6
6
 
7
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -51,7 +51,7 @@ import { tabbable } from 'tabbable';
51
51
  import { keys } from '../../../services';
52
52
  import { EuiScreenReaderOnly } from '../../accessibility';
53
53
  import { EuiFocusTrap } from '../../focus_trap';
54
- import { useEuiI18n } from '../../i18n';
54
+ import { EuiI18n } from '../../i18n';
55
55
  import { hasResizeObserver } from '../../observer/resize_observer/resize_observer';
56
56
  import { DataGridFocusContext } from '../utils/focus';
57
57
  import { EuiDataGridCellActions, EuiDataGridCellPopoverActions } from './data_grid_cell_actions';
@@ -65,16 +65,13 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
65
65
  rowHeightsOptions = _ref.rowHeightsOptions,
66
66
  rowIndex = _ref.rowIndex,
67
67
  colIndex = _ref.colIndex,
68
+ ariaRowIndex = _ref.ariaRowIndex,
68
69
  rowHeightUtils = _ref.rowHeightUtils,
69
70
  isDefinedHeight = _ref.isDefinedHeight,
70
71
  rest = _objectWithoutProperties(_ref, _excluded);
71
72
 
72
73
  // React is more permissible than the TS types indicate
73
74
  var CellElement = renderCellValue;
74
- var positionText = useEuiI18n('euiDataGridCell.position', 'Row: {row}; Column: {col}', {
75
- row: rowIndex + 1,
76
- col: colIndex + 1
77
- });
78
75
  return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", {
79
76
  ref: setCellContentsRef,
80
77
  "data-datagrid-cellcontent": true,
@@ -86,7 +83,15 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
86
83
  rowIndex: rowIndex,
87
84
  colIndex: colIndex,
88
85
  schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
89
- }, rest))), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", null, positionText)));
86
+ }, rest))), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", null, '- ', ___EmotionJSX(EuiI18n, {
87
+ token: "euiDataGridCell.position",
88
+ default: "{columnId}, column {col}, row {row}",
89
+ values: {
90
+ columnId: (column === null || column === void 0 ? void 0 : column.displayAsText) || rest.columnId,
91
+ col: colIndex + 1,
92
+ row: ariaRowIndex
93
+ }
94
+ }))));
90
95
  });
91
96
  EuiDataGridCellContent.propTypes = {
92
97
  rowIndex: PropTypes.number.isRequired,
@@ -542,10 +547,40 @@ EuiDataGridCellContent.propTypes = {
542
547
  onChange: PropTypes.func
543
548
  }),
544
549
  rowHeightUtils: PropTypes.any,
550
+ pagination: PropTypes.shape({
551
+ /**
552
+ * The index of the current page, starts at 0 for the first page
553
+ */
554
+ pageIndex: PropTypes.number.isRequired,
555
+
556
+ /**
557
+ * How many rows should initially be shown per page.
558
+ * Pass `0` to display the selected "Show all" option and hide the pagination.
559
+ */
560
+ pageSize: PropTypes.number.isRequired,
561
+
562
+ /**
563
+ * An array of page sizes the user can select from.
564
+ * Pass `0` as one of the options to create a "Show all" option.
565
+ * Leave this prop undefined or use an empty array to hide "Rows per page" select button.
566
+ */
567
+ pageSizeOptions: PropTypes.arrayOf(PropTypes.number.isRequired),
568
+
569
+ /**
570
+ * A callback for when the user changes the page size selection
571
+ */
572
+ onChangeItemsPerPage: PropTypes.func.isRequired,
573
+
574
+ /**
575
+ * A callback for when the current page index changes
576
+ */
577
+ onChangePage: PropTypes.func.isRequired
578
+ }),
545
579
  setCellProps: PropTypes.func.isRequired,
546
580
  setCellContentsRef: PropTypes.any.isRequired,
547
581
  isExpanded: PropTypes.bool.isRequired,
548
- isDefinedHeight: PropTypes.bool.isRequired
582
+ isDefinedHeight: PropTypes.bool.isRequired,
583
+ ariaRowIndex: PropTypes.number.isRequired
549
584
  };
550
585
  export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
551
586
  _inherits(EuiDataGridCell, _Component);
@@ -950,6 +985,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
950
985
  rowHeightUtils = _this$props8.rowHeightUtils,
951
986
  rowHeightsOptions = _this$props8.rowHeightsOptions,
952
987
  rowManager = _this$props8.rowManager,
988
+ pagination = _this$props8.pagination,
953
989
  rest = _objectWithoutProperties(_this$props8, _excluded2);
954
990
 
955
991
  var rowIndex = rest.rowIndex,
@@ -959,6 +995,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
959
995
  var popoverIsOpen = this.isPopoverOpen();
960
996
  var showCellActions = this.state.isFocused || this.state.isEntered || this.state.enableInteractions || popoverIsOpen;
961
997
  var cellClasses = classNames('euiDataGridRowCell', (_classNames = {}, _defineProperty(_classNames, "euiDataGridRowCell--".concat(columnType), columnType), _defineProperty(_classNames, 'euiDataGridRowCell--open', popoverIsOpen), _classNames), className);
998
+ var ariaRowIndex = pagination ? visibleRowIndex + 1 + pagination.pageSize * pagination.pageIndex : visibleRowIndex + 1;
962
999
 
963
1000
  var _this$state$cellProps2 = this.state.cellProps,
964
1001
  _ = _this$state$cellProps2.isExpandable,
@@ -1067,7 +1104,8 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
1067
1104
  setCellContentsRef: this.setCellContentsRef,
1068
1105
  rowHeightsOptions: rowHeightsOptions,
1069
1106
  rowHeightUtils: rowHeightUtils,
1070
- isDefinedHeight: isDefinedHeight
1107
+ isDefinedHeight: isDefinedHeight,
1108
+ ariaRowIndex: ariaRowIndex
1071
1109
  });
1072
1110
 
1073
1111
  var anchorClass = 'euiDataGridRowCell__expandFlex';
@@ -1114,6 +1152,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
1114
1152
 
1115
1153
  var content = ___EmotionJSX("div", _extends({
1116
1154
  role: "gridcell",
1155
+ "aria-rowindex": ariaRowIndex,
1117
1156
  tabIndex: this.state.isFocused && !this.state.disableCellTabIndex ? 0 : -1,
1118
1157
  ref: this.cellRef
1119
1158
  }, cellProps, {
@@ -1538,5 +1577,34 @@ EuiDataGridCell.propTypes = {
1538
1577
  rowHeightUtils: PropTypes.any,
1539
1578
  rowManager: PropTypes.shape({
1540
1579
  getRow: PropTypes.func.isRequired
1580
+ }),
1581
+ pagination: PropTypes.shape({
1582
+ /**
1583
+ * The index of the current page, starts at 0 for the first page
1584
+ */
1585
+ pageIndex: PropTypes.number.isRequired,
1586
+
1587
+ /**
1588
+ * How many rows should initially be shown per page.
1589
+ * Pass `0` to display the selected "Show all" option and hide the pagination.
1590
+ */
1591
+ pageSize: PropTypes.number.isRequired,
1592
+
1593
+ /**
1594
+ * An array of page sizes the user can select from.
1595
+ * Pass `0` as one of the options to create a "Show all" option.
1596
+ * Leave this prop undefined or use an empty array to hide "Rows per page" select button.
1597
+ */
1598
+ pageSizeOptions: PropTypes.arrayOf(PropTypes.number.isRequired),
1599
+
1600
+ /**
1601
+ * A callback for when the user changes the page size selection
1602
+ */
1603
+ onChangeItemsPerPage: PropTypes.func.isRequired,
1604
+
1605
+ /**
1606
+ * A callback for when the current page index changes
1607
+ */
1608
+ onChangePage: PropTypes.func.isRequired
1541
1609
  })
1542
1610
  };
@@ -257,6 +257,7 @@ export var EuiDataGrid = /*#__PURE__*/forwardRef(function (props, ref) {
257
257
 
258
258
  useImperativeGridRef({
259
259
  ref: ref,
260
+ gridRef: gridRef,
260
261
  setIsFullScreen: setIsFullScreen,
261
262
  focusContext: focusContext,
262
263
  cellPopoverContext: cellPopoverContext,
@@ -360,6 +361,7 @@ export var EuiDataGrid = /*#__PURE__*/forwardRef(function (props, ref) {
360
361
  "data-test-subj": "euiDataGridBody",
361
362
  className: "euiDataGrid__content",
362
363
  role: "grid",
364
+ "aria-rowcount": rowCount,
363
365
  id: gridId
364
366
  }, wrappingDivFocusProps, gridAriaProps), ___EmotionJSX(EuiDataGridBody, {
365
367
  columns: orderedVisibleColumns,
@@ -8,6 +8,7 @@
8
8
  import { useImperativeHandle, useCallback } from 'react';
9
9
  export var useImperativeGridRef = function useImperativeGridRef(_ref) {
10
10
  var ref = _ref.ref,
11
+ gridRef = _ref.gridRef,
11
12
  setIsFullScreen = _ref.setIsFullScreen,
12
13
  focusContext = _ref.focusContext,
13
14
  cellPopoverContext = _ref.cellPopoverContext,
@@ -62,16 +63,36 @@ export var useImperativeGridRef = function useImperativeGridRef(_ref) {
62
63
  rowIndex: visibleRowIndex,
63
64
  colIndex: colIndex
64
65
  });
65
- }, [_openCellPopover, checkCellExists, findVisibleRowIndex]); // Set the ref APIs
66
+ }, [_openCellPopover, checkCellExists, findVisibleRowIndex]);
67
+ var scrollTo = useCallback(function () {
68
+ var _gridRef$current;
69
+
70
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
71
+ args[_key] = arguments[_key];
72
+ }
73
+
74
+ return (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.scrollTo.apply(_gridRef$current, args);
75
+ }, [gridRef]);
76
+ var scrollToItem = useCallback(function () {
77
+ var _gridRef$current2;
78
+
79
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
80
+ args[_key2] = arguments[_key2];
81
+ }
82
+
83
+ return (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.scrollToItem.apply(_gridRef$current2, args);
84
+ }, [gridRef]); // Set the ref APIs
66
85
 
67
86
  useImperativeHandle(ref, function () {
68
87
  return {
69
88
  setIsFullScreen: setIsFullScreen,
70
89
  setFocusedCell: setFocusedCell,
71
90
  openCellPopover: openCellPopover,
72
- closeCellPopover: closeCellPopover
91
+ closeCellPopover: closeCellPopover,
92
+ scrollTo: scrollTo,
93
+ scrollToItem: scrollToItem
73
94
  };
74
- }, [setIsFullScreen, setFocusedCell, openCellPopover, closeCellPopover]);
95
+ }, [setIsFullScreen, setFocusedCell, openCellPopover, closeCellPopover, scrollTo, scrollToItem]);
75
96
  };
76
97
  /**
77
98
  * Throw a digestible error if the consumer attempts to focus into an invalid
@@ -181,6 +181,8 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
181
181
  event.stopPropagation();
182
182
 
183
183
  if (_this.state.activeOptionIndex != null && optionsList) {
184
+ event.persist(); // NOTE: This is needed for React v16 backwards compatibility
185
+
184
186
  optionsList.onAddOrRemoveOption(_this.state.visibleOptions[_this.state.activeOptionIndex], event);
185
187
  }
186
188
 
package/eui.d.ts CHANGED
@@ -6024,7 +6024,7 @@ declare module '@elastic/eui/src/components/horizontal_rule' {
6024
6024
 
6025
6025
  }
6026
6026
  declare module '@elastic/eui/src/components/context_menu/context_menu' {
6027
- import React, { Component, HTMLAttributes, ReactElement, ReactNode } from 'react';
6027
+ import React, { Component, HTMLAttributes, CSSProperties, ReactElement, ReactNode } from 'react';
6028
6028
  import { CommonProps, ExclusiveUnion } from '@elastic/eui/src/components/common';
6029
6029
  import { EuiContextMenuPanelTransitionDirection, EuiContextMenuPanelTransitionType } from '@elastic/eui/src/components/context_menu/context_menu_panel';
6030
6030
  import { EuiContextMenuItemProps } from '@elastic/eui/src/components/context_menu/context_menu_item';
@@ -6045,7 +6045,7 @@ declare module '@elastic/eui/src/components/context_menu/context_menu' {
6045
6045
  title?: ReactNode;
6046
6046
  items?: EuiContextMenuPanelItemDescriptor[];
6047
6047
  content?: ReactNode;
6048
- width?: number;
6048
+ width?: CSSProperties['width'];
6049
6049
  initialFocusedItemIndex?: number;
6050
6050
  /**
6051
6051
  * Alters the size of the items and the title
@@ -7178,6 +7178,8 @@ declare module '@elastic/eui/src/components/accordion/accordion' {
7178
7178
  onToggle: () => void;
7179
7179
  setChildContentRef: (node: HTMLDivElement | null) => void;
7180
7180
  generatedId: string;
7181
+ resizeRef: (e: HTMLElement | null) => void;
7182
+ observerRef: (ref: HTMLDivElement) => void;
7181
7183
  render(): JSX.Element;
7182
7184
  }
7183
7185
  export const EuiAccordion: React.ForwardRefExoticComponent<Omit<EuiAccordionProps, "theme"> & React.RefAttributes<Omit<EuiAccordionProps, "theme">>>;
@@ -9614,7 +9616,7 @@ declare module '@elastic/eui/src/components/token' {
9614
9616
 
9615
9617
  }
9616
9618
  declare module '@elastic/eui/src/components/datagrid/data_grid_types' {
9617
- import { ComponentType, JSXElementConstructor, ReactNode, HTMLAttributes, CSSProperties, ReactElement, AriaAttributes, MutableRefObject } from 'react';
9619
+ import { ComponentType, JSXElementConstructor, ReactNode, HTMLAttributes, CSSProperties, ReactElement, AriaAttributes, MutableRefObject, Component } from 'react';
9618
9620
  import { VariableSizeGridProps, VariableSizeGrid as Grid, GridOnItemsRenderedProps } from 'react-window';
9619
9621
  import { EuiListGroupItemProps } from '@elastic/eui/src/components/list_group';
9620
9622
  import { EuiButtonEmpty, EuiButtonIcon } from '@elastic/eui/src/components/button';
@@ -9622,6 +9624,7 @@ declare module '@elastic/eui/src/components/datagrid/data_grid_types' {
9622
9624
  import { RowHeightUtils } from '@elastic/eui/src/components/datagrid/utils/row_heights';
9623
9625
  import { IconType } from '@elastic/eui/src/components/icon';
9624
9626
  import { EuiTokenProps } from '@elastic/eui/src/components/token';
9627
+ export type ImperativeGridApi = Omit<Grid, keyof Component>;
9625
9628
  export interface EuiDataGridToolbarProps {
9626
9629
  gridWidth: number;
9627
9630
  minSizeForControls?: number;
@@ -9913,6 +9916,14 @@ declare module '@elastic/eui/src/components/datagrid/data_grid_types' {
9913
9916
  * Closes any currently open popovers in the data grid.
9914
9917
  */
9915
9918
  closeCellPopover: () => void;
9919
+ /**
9920
+ * Scrolls to a specified top and left offset.
9921
+ */
9922
+ scrollTo?: ImperativeGridApi['scrollTo'];
9923
+ /**
9924
+ * Scrolls to a specified rowIndex.
9925
+ */
9926
+ scrollToItem?: ImperativeGridApi['scrollToItem'];
9916
9927
  }
9917
9928
  export interface EuiDataGridColumnResizerProps {
9918
9929
  columnId: string;
@@ -10052,6 +10063,7 @@ declare module '@elastic/eui/src/components/datagrid/data_grid_types' {
10052
10063
  rowHeightsOptions?: EuiDataGridRowHeightsOptions;
10053
10064
  rowHeightUtils?: RowHeightUtils;
10054
10065
  rowManager?: EuiDataGridRowManager;
10066
+ pagination?: EuiDataGridPaginationProps;
10055
10067
  }
10056
10068
  export interface EuiDataGridCellState {
10057
10069
  cellProps: EuiDataGridSetCellProps;
@@ -11136,10 +11148,12 @@ declare module '@elastic/eui/src/components/datagrid/utils/data_grid_pagination'
11136
11148
 
11137
11149
  }
11138
11150
  declare module '@elastic/eui/src/components/datagrid/utils/ref' {
11139
- import { Ref } from 'react';
11151
+ import { Ref, RefObject } from 'react';
11152
+ import type { VariableSizeGrid } from 'react-window';
11140
11153
  import { EuiDataGridRefProps, EuiDataGridProps, DataGridFocusContextShape, DataGridCellPopoverContextShape, DataGridSortingContextShape } from '@elastic/eui/src/components/datagrid/data_grid_types';
11141
11154
  interface Dependencies {
11142
11155
  ref: Ref<unknown>;
11156
+ gridRef: RefObject<VariableSizeGrid>;
11143
11157
  setIsFullScreen: EuiDataGridRefProps['setIsFullScreen'];
11144
11158
  focusContext: DataGridFocusContextShape;
11145
11159
  cellPopoverContext: DataGridCellPopoverContextShape;
@@ -11148,7 +11162,7 @@ declare module '@elastic/eui/src/components/datagrid/utils/ref' {
11148
11162
  rowCount: number;
11149
11163
  visibleColCount: number;
11150
11164
  }
11151
- export const useImperativeGridRef: ({ ref, setIsFullScreen, focusContext, cellPopoverContext, sortingContext: { sortedRowMap }, pagination, rowCount, visibleColCount, }: Dependencies) => void;
11165
+ export const useImperativeGridRef: ({ ref, gridRef, setIsFullScreen, focusContext, cellPopoverContext, sortingContext: { sortedRowMap }, pagination, rowCount, visibleColCount, }: Dependencies) => void;
11152
11166
  /**
11153
11167
  * Throw a digestible error if the consumer attempts to focus into an invalid
11154
11168
  * cell range, which should also stop the APIs from continuing
package/i18ntokens.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "highlighting": "string",
6
6
  "loc": {
7
7
  "start": {
8
- "line": 338,
8
+ "line": 346,
9
9
  "column": 16
10
10
  },
11
11
  "end": {
12
- "line": 338,
12
+ "line": 346,
13
13
  "column": 76
14
14
  }
15
15
  },
@@ -849,16 +849,16 @@
849
849
  },
850
850
  {
851
851
  "token": "euiDataGridCell.position",
852
- "defString": "Row: {row}; Column: {col}",
852
+ "defString": "{columnId}, column {col}, row {row}",
853
853
  "highlighting": "string",
854
854
  "loc": {
855
855
  "start": {
856
- "line": 67,
857
- "column": 25
856
+ "line": 97,
857
+ "column": 12
858
858
  },
859
859
  "end": {
860
- "line": 71,
861
- "column": 5
860
+ "line": 105,
861
+ "column": 14
862
862
  }
863
863
  },
864
864
  "filepath": "src/components/datagrid/body/data_grid_cell.tsx"
@@ -1493,11 +1493,11 @@
1493
1493
  "highlighting": "string",
1494
1494
  "loc": {
1495
1495
  "start": {
1496
- "line": 337,
1496
+ "line": 338,
1497
1497
  "column": 22
1498
1498
  },
1499
1499
  "end": {
1500
- "line": 341,
1500
+ "line": 342,
1501
1501
  "column": 5
1502
1502
  }
1503
1503
  },
@@ -1509,11 +1509,11 @@
1509
1509
  "highlighting": "string",
1510
1510
  "loc": {
1511
1511
  "start": {
1512
- "line": 342,
1512
+ "line": 343,
1513
1513
  "column": 27
1514
1514
  },
1515
1515
  "end": {
1516
- "line": 346,
1516
+ "line": 347,
1517
1517
  "column": 5
1518
1518
  }
1519
1519
  },
@@ -1525,11 +1525,11 @@
1525
1525
  "highlighting": "string",
1526
1526
  "loc": {
1527
1527
  "start": {
1528
- "line": 470,
1528
+ "line": 472,
1529
1529
  "column": 18
1530
1530
  },
1531
1531
  "end": {
1532
- "line": 473,
1532
+ "line": 475,
1533
1533
  "column": 20
1534
1534
  }
1535
1535
  },
@@ -4821,11 +4821,11 @@
4821
4821
  "highlighting": "string",
4822
4822
  "loc": {
4823
4823
  "start": {
4824
- "line": 568,
4824
+ "line": 569,
4825
4825
  "column": 16
4826
4826
  },
4827
4827
  "end": {
4828
- "line": 571,
4828
+ "line": 572,
4829
4829
  "column": 18
4830
4830
  }
4831
4831
  },
@@ -4837,11 +4837,11 @@
4837
4837
  "highlighting": "string",
4838
4838
  "loc": {
4839
4839
  "start": {
4840
- "line": 590,
4840
+ "line": 591,
4841
4841
  "column": 14
4842
4842
  },
4843
4843
  "end": {
4844
- "line": 594,
4844
+ "line": 595,
4845
4845
  "column": 16
4846
4846
  }
4847
4847
  },
@@ -4853,11 +4853,11 @@
4853
4853
  "highlighting": "string",
4854
4854
  "loc": {
4855
4855
  "start": {
4856
- "line": 609,
4856
+ "line": 610,
4857
4857
  "column": 14
4858
4858
  },
4859
4859
  "end": {
4860
- "line": 612,
4860
+ "line": 613,
4861
4861
  "column": 16
4862
4862
  }
4863
4863
  },
@@ -4869,11 +4869,11 @@
4869
4869
  "highlighting": "string",
4870
4870
  "loc": {
4871
4871
  "start": {
4872
- "line": 674,
4872
+ "line": 675,
4873
4873
  "column": 6
4874
4874
  },
4875
4875
  "end": {
4876
- "line": 674,
4876
+ "line": 675,
4877
4877
  "column": 78
4878
4878
  }
4879
4879
  },
@@ -4885,11 +4885,11 @@
4885
4885
  "highlighting": "code",
4886
4886
  "loc": {
4887
4887
  "start": {
4888
- "line": 701,
4888
+ "line": 702,
4889
4889
  "column": 6
4890
4890
  },
4891
4891
  "end": {
4892
- "line": 707,
4892
+ "line": 708,
4893
4893
  "column": 8
4894
4894
  }
4895
4895
  },
@@ -4901,11 +4901,11 @@
4901
4901
  "highlighting": "string",
4902
4902
  "loc": {
4903
4903
  "start": {
4904
- "line": 719,
4904
+ "line": 720,
4905
4905
  "column": 6
4906
4906
  },
4907
4907
  "end": {
4908
- "line": 728,
4908
+ "line": 729,
4909
4909
  "column": 7
4910
4910
  }
4911
4911
  },
@@ -4917,11 +4917,11 @@
4917
4917
  "highlighting": "string",
4918
4918
  "loc": {
4919
4919
  "start": {
4920
- "line": 719,
4920
+ "line": 720,
4921
4921
  "column": 6
4922
4922
  },
4923
4923
  "end": {
4924
- "line": 728,
4924
+ "line": 729,
4925
4925
  "column": 7
4926
4926
  }
4927
4927
  },
@@ -136,6 +136,14 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
136
136
 
137
137
  _defineProperty(_assertThisInitialized(_this), "generatedId", (0, _services.htmlIdGenerator)()());
138
138
 
139
+ _defineProperty(_assertThisInitialized(_this), "resizeRef", function () {});
140
+
141
+ _defineProperty(_assertThisInitialized(_this), "observerRef", function (ref) {
142
+ _this.setChildContentRef(ref);
143
+
144
+ _this.resizeRef(ref);
145
+ });
146
+
139
147
  return _this;
140
148
  }
141
149
 
@@ -285,12 +293,9 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
285
293
  }, (0, _react2.jsx)(_resize_observer.EuiResizeObserver, {
286
294
  onResize: this.setChildContentHeight
287
295
  }, function (resizeRef) {
296
+ _this2.resizeRef = resizeRef;
288
297
  return (0, _react2.jsx)("div", {
289
- ref: function ref(_ref) {
290
- _this2.setChildContentRef(_ref);
291
-
292
- resizeRef(_ref);
293
- }
298
+ ref: _this2.observerRef
294
299
  }, (0, _react2.jsx)("div", {
295
300
  className: childrenClasses,
296
301
  css: cssChildrenStyles
@@ -421,7 +421,7 @@ EuiContextMenu.propTypes = {
421
421
  "data-test-subj": _propTypes.default.string
422
422
  }).isRequired),
423
423
  content: _propTypes.default.node,
424
- width: _propTypes.default.number,
424
+ width: _propTypes.default.any,
425
425
  initialFocusedItemIndex: _propTypes.default.number,
426
426
 
427
427
  /**
@@ -96,7 +96,8 @@ var Cell = function Cell(_ref) {
96
96
  schemaDetectors = data.schemaDetectors,
97
97
  rowHeightsOptions = data.rowHeightsOptions,
98
98
  rowHeightUtils = data.rowHeightUtils,
99
- rowManager = data.rowManager;
99
+ rowManager = data.rowManager,
100
+ pagination = data.pagination;
100
101
  var popoverContext = (0, _react.useContext)(_data_grid_cell_popover.DataGridCellPopoverContext);
101
102
 
102
103
  var _useContext = (0, _react.useContext)(DataGridWrapperRowsContext),
@@ -135,7 +136,8 @@ var Cell = function Cell(_ref) {
135
136
  rowHeightUtils: rowHeightUtils,
136
137
  setRowHeight: isFirstColumn ? setRowHeight : undefined,
137
138
  rowManager: rowManager,
138
- popoverContext: popoverContext
139
+ popoverContext: popoverContext,
140
+ pagination: pagination
139
141
  };
140
142
 
141
143
  if (isLeadingControlColumn) {
@@ -468,7 +470,8 @@ var EuiDataGridBody = function EuiDataGridBody(props) {
468
470
  interactiveCellId: interactiveCellId,
469
471
  rowHeightsOptions: rowHeightsOptions,
470
472
  rowHeightUtils: rowHeightUtils,
471
- rowManager: rowManager
473
+ rowManager: rowManager,
474
+ pagination: pagination
472
475
  },
473
476
  rowCount: _utils.IS_JEST_ENVIRONMENT || headerRowHeight > 0 ? visibleRowCount : 0
474
477
  }), Cell), scrollBorderOverlay) : null;