@elastic/eui 97.1.0 → 97.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 (79) hide show
  1. package/es/components/context_menu/context_menu_panel.js +17 -1
  2. package/es/components/datagrid/body/cell/data_grid_cell.js +31 -8
  3. package/es/components/datagrid/body/data_grid_body.js +8 -0
  4. package/es/components/datagrid/body/data_grid_body_custom.js +8 -1
  5. package/es/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  6. package/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  7. package/es/components/datagrid/controls/display_selector.js +277 -207
  8. package/es/components/datagrid/data_grid.stories.utils.js +28 -2
  9. package/es/components/datagrid/data_grid.styles.js +1 -1
  10. package/es/components/datagrid/utils/col_widths.js +7 -13
  11. package/es/components/datagrid/utils/grid_height_width.js +1 -1
  12. package/es/components/datagrid/utils/row_heights.js +29 -13
  13. package/es/components/header/header.styles.js +8 -1
  14. package/es/components/header/header_links/header_links.js +1 -1
  15. package/es/components/header/header_links/header_links.styles.js +1 -0
  16. package/es/services/hooks/useDeepEqual.js +18 -6
  17. package/eui.d.ts +40 -11
  18. package/i18ntokens.json +92 -110
  19. package/lib/components/context_menu/context_menu_panel.js +17 -1
  20. package/lib/components/datagrid/body/cell/data_grid_cell.js +31 -8
  21. package/lib/components/datagrid/body/data_grid_body.js +8 -0
  22. package/lib/components/datagrid/body/data_grid_body_custom.js +8 -1
  23. package/lib/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  24. package/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  25. package/lib/components/datagrid/controls/display_selector.js +275 -204
  26. package/lib/components/datagrid/data_grid.stories.utils.js +28 -2
  27. package/lib/components/datagrid/data_grid.styles.js +1 -1
  28. package/lib/components/datagrid/utils/col_widths.js +7 -13
  29. package/lib/components/datagrid/utils/grid_height_width.js +1 -1
  30. package/lib/components/datagrid/utils/row_heights.js +29 -13
  31. package/lib/components/header/header.styles.js +8 -1
  32. package/lib/components/header/header_links/header_links.js +1 -1
  33. package/lib/components/header/header_links/header_links.styles.js +1 -0
  34. package/lib/services/hooks/useDeepEqual.js +17 -7
  35. package/optimize/es/components/context_menu/context_menu_panel.js +11 -1
  36. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +15 -8
  37. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +0 -1
  38. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +0 -1
  39. package/optimize/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  40. package/optimize/es/components/datagrid/controls/display_selector.js +277 -207
  41. package/optimize/es/components/datagrid/data_grid.styles.js +1 -1
  42. package/optimize/es/components/datagrid/utils/col_widths.js +7 -13
  43. package/optimize/es/components/datagrid/utils/grid_height_width.js +1 -1
  44. package/optimize/es/components/datagrid/utils/row_heights.js +29 -13
  45. package/optimize/es/components/header/header.styles.js +8 -1
  46. package/optimize/es/components/header/header_links/header_links.js +1 -1
  47. package/optimize/es/components/header/header_links/header_links.styles.js +1 -0
  48. package/optimize/es/services/hooks/useDeepEqual.js +13 -6
  49. package/optimize/lib/components/context_menu/context_menu_panel.js +11 -1
  50. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +15 -8
  51. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +0 -1
  52. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +0 -1
  53. package/optimize/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  54. package/optimize/lib/components/datagrid/controls/display_selector.js +274 -204
  55. package/optimize/lib/components/datagrid/data_grid.styles.js +1 -1
  56. package/optimize/lib/components/datagrid/utils/col_widths.js +7 -13
  57. package/optimize/lib/components/datagrid/utils/grid_height_width.js +1 -1
  58. package/optimize/lib/components/datagrid/utils/row_heights.js +29 -13
  59. package/optimize/lib/components/header/header.styles.js +8 -1
  60. package/optimize/lib/components/header/header_links/header_links.js +1 -1
  61. package/optimize/lib/components/header/header_links/header_links.styles.js +1 -0
  62. package/optimize/lib/services/hooks/useDeepEqual.js +12 -5
  63. package/package.json +1 -1
  64. package/test-env/components/context_menu/context_menu_panel.js +17 -1
  65. package/test-env/components/datagrid/body/cell/data_grid_cell.js +31 -8
  66. package/test-env/components/datagrid/body/data_grid_body.js +8 -0
  67. package/test-env/components/datagrid/body/data_grid_body_custom.js +8 -1
  68. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  69. package/test-env/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  70. package/test-env/components/datagrid/controls/display_selector.js +274 -204
  71. package/test-env/components/datagrid/data_grid.stories.utils.js +28 -2
  72. package/test-env/components/datagrid/data_grid.styles.js +1 -1
  73. package/test-env/components/datagrid/utils/col_widths.js +7 -13
  74. package/test-env/components/datagrid/utils/grid_height_width.js +1 -1
  75. package/test-env/components/datagrid/utils/row_heights.js +29 -13
  76. package/test-env/components/header/header.styles.js +8 -1
  77. package/test-env/components/header/header_links/header_links.js +1 -1
  78. package/test-env/components/header/header_links/header_links.styles.js +1 -0
  79. package/test-env/services/hooks/useDeepEqual.js +12 -5
package/i18ntokens.json CHANGED
@@ -1031,14 +1031,14 @@
1031
1031
  "highlighting": "string",
1032
1032
  "loc": {
1033
1033
  "start": {
1034
- "line": 738,
1034
+ "line": 748,
1035
1035
  "column": 23,
1036
- "index": 23328
1036
+ "index": 23788
1037
1037
  },
1038
1038
  "end": {
1039
- "line": 742,
1039
+ "line": 752,
1040
1040
  "column": 3,
1041
- "index": 23475
1041
+ "index": 23935
1042
1042
  }
1043
1043
  },
1044
1044
  "filepath": "src/components/datagrid/body/cell/data_grid_cell.tsx"
@@ -1049,14 +1049,14 @@
1049
1049
  "highlighting": "string",
1050
1050
  "loc": {
1051
1051
  "start": {
1052
- "line": 743,
1052
+ "line": 753,
1053
1053
  "column": 25,
1054
- "index": 23502
1054
+ "index": 23962
1055
1055
  },
1056
1056
  "end": {
1057
- "line": 746,
1057
+ "line": 756,
1058
1058
  "column": 3,
1059
- "index": 23608
1059
+ "index": 24068
1060
1060
  }
1061
1061
  },
1062
1062
  "filepath": "src/components/datagrid/body/cell/data_grid_cell.tsx"
@@ -1710,199 +1710,181 @@
1710
1710
  "filepath": "src/components/datagrid/controls/data_grid_toolbar_control.tsx"
1711
1711
  },
1712
1712
  {
1713
- "token": "euiDisplaySelector.buttonText",
1714
- "defString": "Display options",
1715
- "highlighting": "string",
1716
- "loc": {
1717
- "start": {
1718
- "line": 228,
1719
- "column": 22,
1720
- "index": 7412
1721
- },
1722
- "end": {
1723
- "line": 231,
1724
- "column": 3,
1725
- "index": 7486
1726
- }
1727
- },
1728
- "filepath": "src/components/datagrid/controls/display_selector.tsx"
1729
- },
1730
- {
1731
- "token": "euiDisplaySelector.resetButtonText",
1732
- "defString": "Reset to default",
1713
+ "token": "euiDisplaySelector.densityLabel",
1714
+ "defString": "Density",
1733
1715
  "highlighting": "string",
1734
1716
  "loc": {
1735
1717
  "start": {
1736
- "line": 232,
1737
- "column": 27,
1738
- "index": 7515
1718
+ "line": 96,
1719
+ "column": 4,
1720
+ "index": 2610
1739
1721
  },
1740
1722
  "end": {
1741
- "line": 235,
1742
- "column": 3,
1743
- "index": 7595
1723
+ "line": 104,
1724
+ "column": 5,
1725
+ "index": 2883
1744
1726
  }
1745
1727
  },
1746
1728
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1747
1729
  },
1748
1730
  {
1749
- "token": "euiDisplaySelector.densityLabel",
1750
- "defString": "Density",
1731
+ "token": "euiDisplaySelector.labelCompact",
1732
+ "defString": "Compact",
1751
1733
  "highlighting": "string",
1752
1734
  "loc": {
1753
1735
  "start": {
1754
- "line": 272,
1755
- "column": 10,
1756
- "index": 8779
1736
+ "line": 96,
1737
+ "column": 4,
1738
+ "index": 2610
1757
1739
  },
1758
1740
  "end": {
1759
- "line": 280,
1760
- "column": 11,
1761
- "index": 9100
1741
+ "line": 104,
1742
+ "column": 5,
1743
+ "index": 2883
1762
1744
  }
1763
1745
  },
1764
1746
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1765
1747
  },
1766
1748
  {
1767
- "token": "euiDisplaySelector.labelCompact",
1768
- "defString": "Compact",
1749
+ "token": "euiDisplaySelector.labelNormal",
1750
+ "defString": "Normal",
1769
1751
  "highlighting": "string",
1770
1752
  "loc": {
1771
1753
  "start": {
1772
- "line": 272,
1773
- "column": 10,
1774
- "index": 8779
1754
+ "line": 96,
1755
+ "column": 4,
1756
+ "index": 2610
1775
1757
  },
1776
1758
  "end": {
1777
- "line": 280,
1778
- "column": 11,
1779
- "index": 9100
1759
+ "line": 104,
1760
+ "column": 5,
1761
+ "index": 2883
1780
1762
  }
1781
1763
  },
1782
1764
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1783
1765
  },
1784
1766
  {
1785
- "token": "euiDisplaySelector.labelNormal",
1786
- "defString": "Normal",
1767
+ "token": "euiDisplaySelector.labelExpanded",
1768
+ "defString": "Expanded",
1787
1769
  "highlighting": "string",
1788
1770
  "loc": {
1789
1771
  "start": {
1790
- "line": 272,
1791
- "column": 10,
1792
- "index": 8779
1772
+ "line": 96,
1773
+ "column": 4,
1774
+ "index": 2610
1793
1775
  },
1794
1776
  "end": {
1795
- "line": 280,
1796
- "column": 11,
1797
- "index": 9100
1777
+ "line": 104,
1778
+ "column": 5,
1779
+ "index": 2883
1798
1780
  }
1799
1781
  },
1800
1782
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1801
1783
  },
1802
1784
  {
1803
- "token": "euiDisplaySelector.labelExpanded",
1804
- "defString": "Expanded",
1785
+ "token": "euiDisplaySelector.rowHeightLabel",
1786
+ "defString": "Lines per row",
1805
1787
  "highlighting": "string",
1806
1788
  "loc": {
1807
1789
  "start": {
1808
- "line": 272,
1809
- "column": 10,
1810
- "index": 8779
1790
+ "line": 227,
1791
+ "column": 4,
1792
+ "index": 6476
1811
1793
  },
1812
1794
  "end": {
1813
- "line": 280,
1814
- "column": 11,
1815
- "index": 9100
1795
+ "line": 235,
1796
+ "column": 5,
1797
+ "index": 6741
1816
1798
  }
1817
1799
  },
1818
1800
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1819
1801
  },
1820
1802
  {
1821
- "token": "euiDisplaySelector.rowHeightLabel",
1822
- "defString": "Row height",
1803
+ "token": "euiDisplaySelector.labelAuto",
1804
+ "defString": "Auto",
1823
1805
  "highlighting": "string",
1824
1806
  "loc": {
1825
1807
  "start": {
1826
- "line": 315,
1827
- "column": 10,
1828
- "index": 10207
1808
+ "line": 227,
1809
+ "column": 4,
1810
+ "index": 6476
1829
1811
  },
1830
1812
  "end": {
1831
- "line": 330,
1832
- "column": 11,
1833
- "index": 10680
1813
+ "line": 235,
1814
+ "column": 5,
1815
+ "index": 6741
1834
1816
  }
1835
1817
  },
1836
1818
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1837
1819
  },
1838
1820
  {
1839
- "token": "euiDisplaySelector.labelSingle",
1840
- "defString": "Single",
1821
+ "token": "euiDisplaySelector.labelStatic",
1822
+ "defString": "Static",
1841
1823
  "highlighting": "string",
1842
1824
  "loc": {
1843
1825
  "start": {
1844
- "line": 315,
1845
- "column": 10,
1846
- "index": 10207
1826
+ "line": 227,
1827
+ "column": 4,
1828
+ "index": 6476
1847
1829
  },
1848
1830
  "end": {
1849
- "line": 330,
1850
- "column": 11,
1851
- "index": 10680
1831
+ "line": 235,
1832
+ "column": 5,
1833
+ "index": 6741
1852
1834
  }
1853
1835
  },
1854
1836
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1855
1837
  },
1856
1838
  {
1857
- "token": "euiDisplaySelector.labelAuto",
1858
- "defString": "Auto fit",
1839
+ "token": "euiDisplaySelector.labelMax",
1840
+ "defString": "Max",
1859
1841
  "highlighting": "string",
1860
1842
  "loc": {
1861
1843
  "start": {
1862
- "line": 315,
1863
- "column": 10,
1864
- "index": 10207
1844
+ "line": 227,
1845
+ "column": 4,
1846
+ "index": 6476
1865
1847
  },
1866
1848
  "end": {
1867
- "line": 330,
1868
- "column": 11,
1869
- "index": 10680
1849
+ "line": 235,
1850
+ "column": 5,
1851
+ "index": 6741
1870
1852
  }
1871
1853
  },
1872
1854
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1873
1855
  },
1874
1856
  {
1875
- "token": "euiDisplaySelector.labelCustom",
1876
- "defString": "Custom",
1857
+ "token": "euiDisplaySelector.buttonText",
1858
+ "defString": "Display options",
1877
1859
  "highlighting": "string",
1878
1860
  "loc": {
1879
1861
  "start": {
1880
- "line": 315,
1881
- "column": 10,
1882
- "index": 10207
1862
+ "line": 393,
1863
+ "column": 22,
1864
+ "index": 11825
1883
1865
  },
1884
1866
  "end": {
1885
- "line": 330,
1886
- "column": 11,
1887
- "index": 10680
1867
+ "line": 396,
1868
+ "column": 3,
1869
+ "index": 11899
1888
1870
  }
1889
1871
  },
1890
1872
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
1891
1873
  },
1892
1874
  {
1893
- "token": "euiDisplaySelector.lineCountLabel",
1894
- "defString": "Lines per row",
1875
+ "token": "euiDisplaySelector.resetButtonText",
1876
+ "defString": "Reset to default",
1895
1877
  "highlighting": "string",
1896
1878
  "loc": {
1897
1879
  "start": {
1898
- "line": 315,
1899
- "column": 10,
1900
- "index": 10207
1880
+ "line": 472,
1881
+ "column": 27,
1882
+ "index": 14023
1901
1883
  },
1902
1884
  "end": {
1903
- "line": 330,
1904
- "column": 11,
1905
- "index": 10680
1885
+ "line": 475,
1886
+ "column": 3,
1887
+ "index": 14103
1906
1888
  }
1907
1889
  },
1908
1890
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -5119,12 +5101,12 @@
5119
5101
  "start": {
5120
5102
  "line": 114,
5121
5103
  "column": 4,
5122
- "index": 3416
5104
+ "index": 3423
5123
5105
  },
5124
5106
  "end": {
5125
5107
  "line": 114,
5126
5108
  "column": 75,
5127
- "index": 3487
5109
+ "index": 3494
5128
5110
  }
5129
5111
  },
5130
5112
  "filepath": "src/components/header/header_links/header_links.tsx"
@@ -5137,12 +5119,12 @@
5137
5119
  "start": {
5138
5120
  "line": 131,
5139
5121
  "column": 4,
5140
- "index": 3915
5122
+ "index": 3922
5141
5123
  },
5142
5124
  "end": {
5143
5125
  "line": 131,
5144
5126
  "column": 69,
5145
- "index": 3980
5127
+ "index": 3987
5146
5128
  }
5147
5129
  },
5148
5130
  "filepath": "src/components/header/header_links/header_links.tsx"
@@ -171,7 +171,7 @@ var EuiContextMenuPanelClass = exports.EuiContextMenuPanelClass = /*#__PURE__*/f
171
171
  items: _this.props.items
172
172
  },
173
173
  menuItems: [],
174
- focusedItemIndex: props.onClose && props.initialFocusedItemIndex != null ? props.initialFocusedItemIndex + 1 // Account for panel title back button
174
+ focusedItemIndex: props.onClose && props.initialFocusedItemIndex != null && props.initialFocusedItemIndex !== -1 ? props.initialFocusedItemIndex + 1 // Account for panel title back button
175
175
  : props.initialFocusedItemIndex,
176
176
  currentHeight: undefined,
177
177
  waitingForInitialPopover: false,
@@ -214,6 +214,16 @@ var EuiContextMenuPanelClass = exports.EuiContextMenuPanelClass = /*#__PURE__*/f
214
214
  return;
215
215
  }
216
216
 
217
+ // `initialFocusedItemIndex={-1}` should only be used when preventing initial item focus is desired
218
+ if (_this2.state.focusedItemIndex === -1) {
219
+ // Resetting the focusedItemIndex to 0 allows keyboard up/down behavior to
220
+ // still work correctly later if the panel is manually tabbed into
221
+ return _this2.setState({
222
+ tookInitialFocus: true,
223
+ focusedItemIndex: 0
224
+ });
225
+ }
226
+
217
227
  // If an item should be focused, focus it (if it exists)
218
228
  if (_this2.state.focusedItemIndex != null && _this2.state.menuItems.length) {
219
229
  var focusedItem = _this2.state.menuItems[_this2.state.focusedItemIndex];
@@ -406,6 +416,12 @@ EuiContextMenuPanelClass.propTypes = {
406
416
  "aria-label": _propTypes.default.string,
407
417
  "data-test-subj": _propTypes.default.string,
408
418
  css: _propTypes.default.any,
419
+ /**
420
+ * Determines the initially focused menu item for keyboard and screen reader users.
421
+ *
422
+ * Can be set to `-1` to prevent autofocus (an uncommon case that must have
423
+ * keyboard accessibility accounted for manually if used)
424
+ */
409
425
  initialFocusedItemIndex: _propTypes.default.number,
410
426
  items: _propTypes.default.arrayOf(_propTypes.default.element.isRequired),
411
427
  onClose: _propTypes.default.func,
@@ -21,7 +21,7 @@ var _data_grid_cell_popover = require("./data_grid_cell_popover");
21
21
  var _focus_utils = require("./focus_utils");
22
22
  var _data_grid_cell = require("./data_grid_cell.styles");
23
23
  var _react2 = require("@emotion/react");
24
- var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeight", "rowHeightUtils", "isControlColumn"],
24
+ var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeightsOptions", "rowHeightUtils", "isControlColumn"],
25
25
  _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
26
26
  _excluded3 = ["isExpandable", "style", "className", "data-test-subj"],
27
27
  _excluded4 = ["columnId", "columnIndex", "rowIndex", "visibleRowIndex"];
@@ -66,15 +66,20 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
66
66
  setCellContentsRef = _ref.setCellContentsRef,
67
67
  rowIndex = _ref.rowIndex,
68
68
  colIndex = _ref.colIndex,
69
- rowHeight = _ref.rowHeight,
69
+ rowHeightsOptions = _ref.rowHeightsOptions,
70
70
  rowHeightUtils = _ref.rowHeightUtils,
71
71
  isControlColumn = _ref.isControlColumn,
72
72
  rest = _objectWithoutProperties(_ref, _excluded);
73
73
  // React is more permissive than the TS types indicate
74
74
  var CellElement = renderCellValue;
75
+
76
+ // Cell height type
77
+ var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
75
78
  var cellHeightType = (0, _react.useMemo)(function () {
76
- return (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
77
- }, [rowHeightUtils, rowHeight]);
79
+ return rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.isAutoBelowLineCount(rowHeightsOptions, rowHeight) ? 'autoBelowLineCount' : (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
80
+ }, [rowHeightUtils, rowHeight, rowHeightsOptions]);
81
+
82
+ // Classes and styles
78
83
  var classes = (0, _react.useMemo)(function () {
79
84
  return (0, _classnames.default)('euiDataGridRowCell__content', "euiDataGridRowCell__content--".concat(cellHeightType, "Height"), !isControlColumn && {
80
85
  'eui-textBreakWord': cellHeightType !== 'default',
@@ -85,9 +90,9 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
85
90
  var cssStyles = [styles.content.euiDataGridRowCell__content].concat(_toConsumableArray(isControlColumn ? [styles.content.controlColumn, styles.content.autoHeight] : [
86
91
  // Regular data cells should always inherit height from the row wrapper,
87
92
  // except for auto height
88
- cellHeightType === 'auto' ? styles.content.autoHeight : styles.content.defaultHeight]));
93
+ cellHeightType === 'auto' || cellHeightType === 'autoBelowLineCount' ? styles.content.autoHeight : styles.content.defaultHeight]));
89
94
  return (0, _react2.jsx)(RenderTruncatedCellContent, {
90
- hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
95
+ hasLineCountTruncation: (cellHeightType === 'lineCount' || cellHeightType === 'autoBelowLineCount') && !isControlColumn,
91
96
  rowHeight: rowHeight
92
97
  }, (0, _react2.jsx)("div", {
93
98
  ref: setCellContentsRef,
@@ -520,6 +525,14 @@ EuiDataGridCellContent.propTypes = {
520
525
  lineCount: _propTypes.default.number,
521
526
  height: _propTypes.default.number
522
527
  }).isRequired]),
528
+ /**
529
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
530
+ * *max* number of lines (instead of a set number of lines for all rows).
531
+ *
532
+ * This functionality is in beta and has performance implications;
533
+ * we do not yet fully recommend/support it for heavy production usage.
534
+ */
535
+ autoBelowLineCount: _propTypes.default.bool,
523
536
  /**
524
537
  * Defines the height for a specific row. It can be line count or just height.
525
538
  *
@@ -660,6 +673,9 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
660
673
  rowHeightsOptions = _this$props3.rowHeightsOptions,
661
674
  rowIndex = _this$props3.rowIndex;
662
675
  var rowHeightOption = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
676
+ if (rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.isAutoBelowLineCount(rowHeightsOptions, rowHeightOption)) {
677
+ return; // Using auto height instead
678
+ }
663
679
  var isSingleLine = rowHeightOption == null; // Undefined rowHeightsOptions default to a single line
664
680
  var lineCount = isSingleLine ? 1 : rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getLineCount(rowHeightOption);
665
681
  if (lineCount) {
@@ -964,7 +980,6 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
964
980
  // column width, can be undefined
965
981
  lineHeight: (_rowHeightsOptions$li = rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.lineHeight) !== null && _rowHeightsOptions$li !== void 0 ? _rowHeightsOptions$li : undefined
966
982
  }, cellPropsStyle);
967
- var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
968
983
  var row = rowManager && !_utils.IS_JEST_ENVIRONMENT ? rowManager.getRow({
969
984
  rowIndex: rowIndex,
970
985
  visibleRowIndex: visibleRowIndex,
@@ -996,7 +1011,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
996
1011
  isExpandable: isExpandable,
997
1012
  isExpanded: popoverIsOpen,
998
1013
  setCellContentsRef: this.setCellContentsRef,
999
- rowHeight: rowHeight,
1014
+ rowHeightsOptions: rowHeightsOptions,
1000
1015
  rowHeightUtils: rowHeightUtils,
1001
1016
  isControlColumn: isControlColumn,
1002
1017
  rowIndex: rowIndex,
@@ -1380,6 +1395,14 @@ EuiDataGridCell.propTypes = {
1380
1395
  lineCount: _propTypes.default.number,
1381
1396
  height: _propTypes.default.number
1382
1397
  }).isRequired]),
1398
+ /**
1399
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
1400
+ * *max* number of lines (instead of a set number of lines for all rows).
1401
+ *
1402
+ * This functionality is in beta and has performance implications;
1403
+ * we do not yet fully recommend/support it for heavy production usage.
1404
+ */
1405
+ autoBelowLineCount: _propTypes.default.bool,
1383
1406
  /**
1384
1407
  * Defines the height for a specific row. It can be line count or just height.
1385
1408
  *
@@ -579,6 +579,14 @@ EuiDataGridBody.propTypes = {
579
579
  lineCount: _propTypes.default.number,
580
580
  height: _propTypes.default.number
581
581
  }).isRequired]),
582
+ /**
583
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
584
+ * *max* number of lines (instead of a set number of lines for all rows).
585
+ *
586
+ * This functionality is in beta and has performance implications;
587
+ * we do not yet fully recommend/support it for heavy production usage.
588
+ */
589
+ autoBelowLineCount: _propTypes.default.bool,
582
590
  /**
583
591
  * Defines the height for a specific row. It can be line count or just height.
584
592
  *
@@ -90,7 +90,6 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PUR
90
90
  */
91
91
  var rowHeightUtils = (0, _row_heights.useRowHeightUtils)({
92
92
  rowHeightsOptions: rowHeightsOptions,
93
- gridStyles: gridStyles,
94
93
  columns: columns
95
94
  });
96
95
  var _useDefaultRowHeight = (0, _row_heights.useDefaultRowHeight)({
@@ -745,6 +744,14 @@ EuiDataGridBodyCustomRender.propTypes = {
745
744
  lineCount: _propTypes.default.number,
746
745
  height: _propTypes.default.number
747
746
  }).isRequired]),
747
+ /**
748
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
749
+ * *max* number of lines (instead of a set number of lines for all rows).
750
+ *
751
+ * This functionality is in beta and has performance implications;
752
+ * we do not yet fully recommend/support it for heavy production usage.
753
+ */
754
+ autoBelowLineCount: _propTypes.default.bool,
748
755
  /**
749
756
  * Defines the height for a specific row. It can be line count or just height.
750
757
  *
@@ -223,7 +223,6 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
223
223
  gridItemsRenderedRef: gridItemsRendered
224
224
  },
225
225
  rowHeightsOptions: rowHeightsOptions,
226
- gridStyles: gridStyles,
227
226
  columns: columns
228
227
  });
229
228
  var _useDefaultRowHeight = (0, _row_heights.useDefaultRowHeight)({
@@ -870,6 +869,14 @@ EuiDataGridBodyVirtualized.propTypes = {
870
869
  lineCount: _propTypes.default.number,
871
870
  height: _propTypes.default.number
872
871
  }).isRequired]),
872
+ /**
873
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
874
+ * *max* number of lines (instead of a set number of lines for all rows).
875
+ *
876
+ * This functionality is in beta and has performance implications;
877
+ * we do not yet fully recommend/support it for heavy production usage.
878
+ */
879
+ autoBelowLineCount: _propTypes.default.bool,
873
880
  /**
874
881
  * Defines the height for a specific row. It can be line count or just height.
875
882
  *
@@ -18,7 +18,7 @@ var euiDataGridToolbarStyles = exports.euiDataGridToolbarStyles = function euiDa
18
18
  var euiTheme = _ref.euiTheme;
19
19
  return {
20
20
  euiDataGrid__controls: /*#__PURE__*/(0, _react.css)("z-index:2;position:relative;display:flex;justify-content:space-between;align-items:center;gap:", euiTheme.size.base, ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xs), " background-color:", euiTheme.colors.emptyShade, ";;label:euiDataGrid__controls;"),
21
- euiDataGrid__rightControls: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:flex-end;flex-wrap:wrap;column-gap:", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.xs), "&:only-child{", (0, _global_styling.logicalCSS)('margin-left', 'auto'), ";};label:euiDataGrid__rightControls;"),
22
- euiDataGrid__leftControls: /*#__PURE__*/(0, _react.css)("display:flex;flex-wrap:wrap;gap:", euiTheme.size.xxs, ";;label:euiDataGrid__leftControls;")
21
+ euiDataGrid__rightControls: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;column-gap:", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.xs), "&:only-child{", (0, _global_styling.logicalCSS)('margin-left', 'auto'), ";};label:euiDataGrid__rightControls;"),
22
+ euiDataGrid__leftControls: /*#__PURE__*/(0, _react.css)("display:flex;flex-wrap:wrap;align-items:center;gap:", euiTheme.size.xxs, ";;label:euiDataGrid__leftControls;")
23
23
  };
24
24
  };