@elastic/eui 97.2.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 (64) 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/grid_height_width.js +1 -1
  11. package/es/components/datagrid/utils/row_heights.js +29 -13
  12. package/es/components/header/header.styles.js +8 -1
  13. package/es/services/hooks/useDeepEqual.js +18 -6
  14. package/eui.d.ts +38 -10
  15. package/i18ntokens.json +88 -106
  16. package/lib/components/context_menu/context_menu_panel.js +17 -1
  17. package/lib/components/datagrid/body/cell/data_grid_cell.js +31 -8
  18. package/lib/components/datagrid/body/data_grid_body.js +8 -0
  19. package/lib/components/datagrid/body/data_grid_body_custom.js +8 -1
  20. package/lib/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  21. package/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  22. package/lib/components/datagrid/controls/display_selector.js +275 -204
  23. package/lib/components/datagrid/data_grid.stories.utils.js +28 -2
  24. package/lib/components/datagrid/data_grid.styles.js +1 -1
  25. package/lib/components/datagrid/utils/grid_height_width.js +1 -1
  26. package/lib/components/datagrid/utils/row_heights.js +29 -13
  27. package/lib/components/header/header.styles.js +8 -1
  28. package/lib/services/hooks/useDeepEqual.js +17 -7
  29. package/optimize/es/components/context_menu/context_menu_panel.js +11 -1
  30. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +15 -8
  31. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +0 -1
  32. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +0 -1
  33. package/optimize/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  34. package/optimize/es/components/datagrid/controls/display_selector.js +277 -207
  35. package/optimize/es/components/datagrid/data_grid.styles.js +1 -1
  36. package/optimize/es/components/datagrid/utils/grid_height_width.js +1 -1
  37. package/optimize/es/components/datagrid/utils/row_heights.js +29 -13
  38. package/optimize/es/components/header/header.styles.js +8 -1
  39. package/optimize/es/services/hooks/useDeepEqual.js +13 -6
  40. package/optimize/lib/components/context_menu/context_menu_panel.js +11 -1
  41. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +15 -8
  42. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +0 -1
  43. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +0 -1
  44. package/optimize/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  45. package/optimize/lib/components/datagrid/controls/display_selector.js +274 -204
  46. package/optimize/lib/components/datagrid/data_grid.styles.js +1 -1
  47. package/optimize/lib/components/datagrid/utils/grid_height_width.js +1 -1
  48. package/optimize/lib/components/datagrid/utils/row_heights.js +29 -13
  49. package/optimize/lib/components/header/header.styles.js +8 -1
  50. package/optimize/lib/services/hooks/useDeepEqual.js +12 -5
  51. package/package.json +1 -1
  52. package/test-env/components/context_menu/context_menu_panel.js +17 -1
  53. package/test-env/components/datagrid/body/cell/data_grid_cell.js +31 -8
  54. package/test-env/components/datagrid/body/data_grid_body.js +8 -0
  55. package/test-env/components/datagrid/body/data_grid_body_custom.js +8 -1
  56. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +8 -1
  57. package/test-env/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
  58. package/test-env/components/datagrid/controls/display_selector.js +274 -204
  59. package/test-env/components/datagrid/data_grid.stories.utils.js +28 -2
  60. package/test-env/components/datagrid/data_grid.styles.js +1 -1
  61. package/test-env/components/datagrid/utils/grid_height_width.js +1 -1
  62. package/test-env/components/datagrid/utils/row_heights.js +29 -13
  63. package/test-env/components/header/header.styles.js +8 -1
  64. package/test-env/services/hooks/useDeepEqual.js +12 -5
@@ -67,7 +67,7 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
67
67
  }
68
68
  }, {
69
69
  key: "getCalculatedHeight",
70
- value: function getCalculatedHeight(heightOption, defaultHeight, rowIndex, isRowHeightOverride) {
70
+ value: function getCalculatedHeight(heightOption, defaultHeight, rowIndex, rowHeightsOptions) {
71
71
  if ((0, _predicate.isObject)(heightOption) && heightOption.height) {
72
72
  return Math.max(heightOption.height, defaultHeight);
73
73
  }
@@ -75,8 +75,13 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
75
75
  return Math.max(heightOption, defaultHeight);
76
76
  }
77
77
  if ((0, _predicate.isObject)(heightOption) && heightOption.lineCount) {
78
- if (isRowHeightOverride) {
79
- return this.getRowHeight(rowIndex) || defaultHeight; // lineCount overrides are stored in the heights cache
78
+ var _ref = rowHeightsOptions || {},
79
+ autoBelowLineCount = _ref.autoBelowLineCount; // uses auto height cache
80
+ var isRowHeightOverride =
81
+ // lineCount overrides are stored in the heights cache
82
+ rowIndex != null && this.isRowHeightOverride(rowIndex, rowHeightsOptions);
83
+ if (autoBelowLineCount || isRowHeightOverride) {
84
+ return this.getRowHeight(rowIndex) || defaultHeight;
80
85
  } else {
81
86
  return defaultHeight; // default lineCount height is set in minRowHeight state in grid_row_body
82
87
  }
@@ -107,6 +112,14 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
107
112
  // Assumes both padding-top and bottom are the same
108
113
  return contentHeight + padding * 2;
109
114
  }
115
+ }, {
116
+ key: "isAutoBelowLineCount",
117
+ value: function isAutoBelowLineCount(options, option) {
118
+ var _this$getLineCount;
119
+ if (!(options !== null && options !== void 0 && options.autoBelowLineCount)) return false;
120
+ if (((_this$getLineCount = this.getLineCount(option)) !== null && _this$getLineCount !== void 0 ? _this$getLineCount : 0) > 1) return true;
121
+ return false;
122
+ }
110
123
 
111
124
  /**
112
125
  * Auto height utils
@@ -118,6 +131,9 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
118
131
  if (height === AUTO_HEIGHT) {
119
132
  return true;
120
133
  }
134
+ if (this.isAutoBelowLineCount(rowHeightsOptions, height)) {
135
+ return true;
136
+ }
121
137
  return false;
122
138
  }
123
139
  }, {
@@ -147,8 +163,8 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
147
163
  }, {
148
164
  key: "pruneHiddenColumnHeights",
149
165
  value: function pruneHiddenColumnHeights(visibleColumns) {
150
- var visibleColumnIds = new Set(visibleColumns.map(function (_ref) {
151
- var id = _ref.id;
166
+ var visibleColumnIds = new Set(visibleColumns.map(function (_ref2) {
167
+ var id = _ref2.id;
152
168
  return id;
153
169
  }));
154
170
  var didModify = false;
@@ -258,10 +274,10 @@ var RowHeightVirtualizationUtils = exports.RowHeightVirtualizationUtils = /*#__P
258
274
  * Hook for instantiating RowHeightUtils, setting internal class vars,
259
275
  * and setting up various row-height-related side effects
260
276
  */
261
- var useRowHeightUtils = exports.useRowHeightUtils = function useRowHeightUtils(_ref2) {
262
- var virtualization = _ref2.virtualization,
263
- rowHeightsOptions = _ref2.rowHeightsOptions,
264
- columns = _ref2.columns;
277
+ var useRowHeightUtils = exports.useRowHeightUtils = function useRowHeightUtils(_ref3) {
278
+ var virtualization = _ref3.virtualization,
279
+ rowHeightsOptions = _ref3.rowHeightsOptions,
280
+ columns = _ref3.columns;
265
281
  var forceRenderRef = (0, _services.useLatest)((0, _services.useForceRender)());
266
282
  var _useState = (0, _react.useState)(function () {
267
283
  if (virtualization) {
@@ -294,9 +310,9 @@ var useRowHeightUtils = exports.useRowHeightUtils = function useRowHeightUtils(_
294
310
  }, [rowHeightUtils, columns]);
295
311
  return rowHeightUtils;
296
312
  };
297
- var useDefaultRowHeight = exports.useDefaultRowHeight = function useDefaultRowHeight(_ref3) {
298
- var rowHeightsOptions = _ref3.rowHeightsOptions,
299
- rowHeightUtils = _ref3.rowHeightUtils;
313
+ var useDefaultRowHeight = exports.useDefaultRowHeight = function useDefaultRowHeight(_ref4) {
314
+ var rowHeightsOptions = _ref4.rowHeightsOptions,
315
+ rowHeightUtils = _ref4.rowHeightUtils;
300
316
  var _useContext = (0, _react.useContext)(_sorting.DataGridSortedContext),
301
317
  getCorrectRowIndex = _useContext.getCorrectRowIndex;
302
318
 
@@ -320,7 +336,7 @@ var useDefaultRowHeight = exports.useDefaultRowHeight = function useDefaultRowHe
320
336
  // Account for row-specific height overrides
321
337
  var rowHeightOption = rowHeightUtils.getRowHeightOption(correctRowIndex, rowHeightsOptions);
322
338
  if (rowHeightOption) {
323
- rowHeight = rowHeightUtils.getCalculatedHeight(rowHeightOption, minRowHeight, correctRowIndex, rowHeightUtils.isRowHeightOverride(correctRowIndex, rowHeightsOptions));
339
+ rowHeight = rowHeightUtils.getCalculatedHeight(rowHeightOption, minRowHeight, correctRowIndex, rowHeightsOptions);
324
340
  }
325
341
 
326
342
  // Use the row-specific height if it exists, if not, fall back to the default
@@ -57,5 +57,12 @@ var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
57
57
  var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
58
58
  controlPlaceholderText = _euiFormVariables.controlPlaceholderText;
59
59
  var backgroundColor = colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.lightestShade, 0.5) : (0, _services.shade)(euiTheme.colors.darkestShade, 0.28);
60
- return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat((0, _services.makeHighContrastColor)(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat((0, _services.shade)(euiTheme.colors.primary, 0.5), ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n &--group {\n border-color: ").concat((0, _services.transparentize)(euiTheme.colors.ghost, 0.3), ";\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(euiTheme.colors.ghost, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat((0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor), ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
60
+
61
+ // Specific color overrides for EuiSelectableTemplateSitewide
62
+ var selectableSitewide = {
63
+ color: euiTheme.colors.ghost,
64
+ borderColor: (0, _services.transparentize)(euiTheme.colors.ghost, 0.3),
65
+ placeholderColor: (0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor)
66
+ };
67
+ return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat((0, _services.makeHighContrastColor)(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat((0, _services.shade)(euiTheme.colors.primary, 0.5), ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n input {\n box-shadow: inset 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(selectableSitewide.borderColor, ";\n }\n\n &--group {\n border-color: ").concat(selectableSitewide.borderColor, ";\n\n input {\n box-shadow: none;\n }\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(selectableSitewide.color, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat(selectableSitewide.placeholderColor, ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
61
68
  };
@@ -5,8 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.useDeepEqual = void 0;
8
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
8
9
  var _react = require("react");
9
10
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
11
+ var _useUpdateEffect = require("./useUpdateEffect");
10
12
  /*
11
13
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
14
  * or more contributor license agreements. Licensed under the Elastic License
@@ -21,9 +23,14 @@ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
21
23
  * reference on every rerender unless passed through this hook).
22
24
  */
23
25
  var useDeepEqual = exports.useDeepEqual = function useDeepEqual(object) {
24
- var ref = (0, _react.useRef)(object);
25
- if (!(0, _isEqual.default)(object, ref.current)) {
26
- ref.current = object;
27
- }
28
- return ref.current;
26
+ var _useState = (0, _react.useState)(object),
27
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
28
+ memoizedObject = _useState2[0],
29
+ setMemoizedObject = _useState2[1];
30
+ (0, _useUpdateEffect.useUpdateEffect)(function () {
31
+ if (!(0, _isEqual.default)(object, memoizedObject)) {
32
+ setMemoizedObject(object);
33
+ }
34
+ }, [object]);
35
+ return memoizedObject;
29
36
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "97.2.0",
4
+ "version": "97.3.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -165,7 +165,7 @@ var EuiContextMenuPanelClass = exports.EuiContextMenuPanelClass = /*#__PURE__*/f
165
165
  items: _this.props.items
166
166
  },
167
167
  menuItems: [],
168
- focusedItemIndex: props.onClose && props.initialFocusedItemIndex != null ? props.initialFocusedItemIndex + 1 // Account for panel title back button
168
+ focusedItemIndex: props.onClose && props.initialFocusedItemIndex != null && props.initialFocusedItemIndex !== -1 ? props.initialFocusedItemIndex + 1 // Account for panel title back button
169
169
  : props.initialFocusedItemIndex,
170
170
  currentHeight: undefined,
171
171
  waitingForInitialPopover: false,
@@ -208,6 +208,16 @@ var EuiContextMenuPanelClass = exports.EuiContextMenuPanelClass = /*#__PURE__*/f
208
208
  return;
209
209
  }
210
210
 
211
+ // `initialFocusedItemIndex={-1}` should only be used when preventing initial item focus is desired
212
+ if (_this2.state.focusedItemIndex === -1) {
213
+ // Resetting the focusedItemIndex to 0 allows keyboard up/down behavior to
214
+ // still work correctly later if the panel is manually tabbed into
215
+ return _this2.setState({
216
+ tookInitialFocus: true,
217
+ focusedItemIndex: 0
218
+ });
219
+ }
220
+
211
221
  // If an item should be focused, focus it (if it exists)
212
222
  if (_this2.state.focusedItemIndex != null && _this2.state.menuItems.length) {
213
223
  var focusedItem = _this2.state.menuItems[_this2.state.focusedItemIndex];
@@ -400,6 +410,12 @@ EuiContextMenuPanelClass.propTypes = {
400
410
  "aria-label": _propTypes.default.string,
401
411
  "data-test-subj": _propTypes.default.string,
402
412
  css: _propTypes.default.any,
413
+ /**
414
+ * Determines the initially focused menu item for keyboard and screen reader users.
415
+ *
416
+ * Can be set to `-1` to prevent autofocus (an uncommon case that must have
417
+ * keyboard accessibility accounted for manually if used)
418
+ */
403
419
  initialFocusedItemIndex: _propTypes.default.number,
404
420
  items: _propTypes.default.arrayOf(_propTypes.default.element.isRequired),
405
421
  onClose: _propTypes.default.func,
@@ -31,7 +31,7 @@ var _data_grid_cell_popover = require("./data_grid_cell_popover");
31
31
  var _focus_utils = require("./focus_utils");
32
32
  var _data_grid_cell = require("./data_grid_cell.styles");
33
33
  var _react2 = require("@emotion/react");
34
- var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeight", "rowHeightUtils", "isControlColumn"],
34
+ var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeightsOptions", "rowHeightUtils", "isControlColumn"],
35
35
  _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
36
36
  _excluded3 = ["isExpandable", "style", "className", "data-test-subj"],
37
37
  _excluded4 = ["columnId", "columnIndex", "rowIndex", "visibleRowIndex"];
@@ -55,15 +55,20 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
55
55
  setCellContentsRef = _ref.setCellContentsRef,
56
56
  rowIndex = _ref.rowIndex,
57
57
  colIndex = _ref.colIndex,
58
- rowHeight = _ref.rowHeight,
58
+ rowHeightsOptions = _ref.rowHeightsOptions,
59
59
  rowHeightUtils = _ref.rowHeightUtils,
60
60
  isControlColumn = _ref.isControlColumn,
61
61
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
62
62
  // React is more permissive than the TS types indicate
63
63
  var CellElement = renderCellValue;
64
+
65
+ // Cell height type
66
+ var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
64
67
  var cellHeightType = (0, _react.useMemo)(function () {
65
- return (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
66
- }, [rowHeightUtils, rowHeight]);
68
+ return rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.isAutoBelowLineCount(rowHeightsOptions, rowHeight) ? 'autoBelowLineCount' : (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
69
+ }, [rowHeightUtils, rowHeight, rowHeightsOptions]);
70
+
71
+ // Classes and styles
67
72
  var classes = (0, _react.useMemo)(function () {
68
73
  return (0, _classnames.default)('euiDataGridRowCell__content', "euiDataGridRowCell__content--".concat(cellHeightType, "Height"), !isControlColumn && {
69
74
  'eui-textBreakWord': cellHeightType !== 'default',
@@ -74,9 +79,9 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
74
79
  var cssStyles = [styles.content.euiDataGridRowCell__content].concat((0, _toConsumableArray2.default)(isControlColumn ? [styles.content.controlColumn, styles.content.autoHeight] : [
75
80
  // Regular data cells should always inherit height from the row wrapper,
76
81
  // except for auto height
77
- cellHeightType === 'auto' ? styles.content.autoHeight : styles.content.defaultHeight]));
82
+ cellHeightType === 'auto' || cellHeightType === 'autoBelowLineCount' ? styles.content.autoHeight : styles.content.defaultHeight]));
78
83
  return (0, _react2.jsx)(RenderTruncatedCellContent, {
79
- hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
84
+ hasLineCountTruncation: (cellHeightType === 'lineCount' || cellHeightType === 'autoBelowLineCount') && !isControlColumn,
80
85
  rowHeight: rowHeight
81
86
  }, (0, _react2.jsx)("div", {
82
87
  ref: setCellContentsRef,
@@ -509,6 +514,14 @@ EuiDataGridCellContent.propTypes = {
509
514
  lineCount: _propTypes.default.number,
510
515
  height: _propTypes.default.number
511
516
  }).isRequired]),
517
+ /**
518
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
519
+ * *max* number of lines (instead of a set number of lines for all rows).
520
+ *
521
+ * This functionality is in beta and has performance implications;
522
+ * we do not yet fully recommend/support it for heavy production usage.
523
+ */
524
+ autoBelowLineCount: _propTypes.default.bool,
512
525
  /**
513
526
  * Defines the height for a specific row. It can be line count or just height.
514
527
  *
@@ -649,6 +662,9 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
649
662
  rowHeightsOptions = _this$props3.rowHeightsOptions,
650
663
  rowIndex = _this$props3.rowIndex;
651
664
  var rowHeightOption = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
665
+ if (rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.isAutoBelowLineCount(rowHeightsOptions, rowHeightOption)) {
666
+ return; // Using auto height instead
667
+ }
652
668
  var isSingleLine = rowHeightOption == null; // Undefined rowHeightsOptions default to a single line
653
669
  var lineCount = isSingleLine ? 1 : rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getLineCount(rowHeightOption);
654
670
  if (lineCount) {
@@ -953,7 +969,6 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
953
969
  // column width, can be undefined
954
970
  lineHeight: (_rowHeightsOptions$li = rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.lineHeight) !== null && _rowHeightsOptions$li !== void 0 ? _rowHeightsOptions$li : undefined
955
971
  }, cellPropsStyle);
956
- var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
957
972
  var row = rowManager && !_utils.IS_JEST_ENVIRONMENT ? rowManager.getRow({
958
973
  rowIndex: rowIndex,
959
974
  visibleRowIndex: visibleRowIndex,
@@ -985,7 +1000,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
985
1000
  isExpandable: isExpandable,
986
1001
  isExpanded: popoverIsOpen,
987
1002
  setCellContentsRef: this.setCellContentsRef,
988
- rowHeight: rowHeight,
1003
+ rowHeightsOptions: rowHeightsOptions,
989
1004
  rowHeightUtils: rowHeightUtils,
990
1005
  isControlColumn: isControlColumn,
991
1006
  rowIndex: rowIndex,
@@ -1369,6 +1384,14 @@ EuiDataGridCell.propTypes = {
1369
1384
  lineCount: _propTypes.default.number,
1370
1385
  height: _propTypes.default.number
1371
1386
  }).isRequired]),
1387
+ /**
1388
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
1389
+ * *max* number of lines (instead of a set number of lines for all rows).
1390
+ *
1391
+ * This functionality is in beta and has performance implications;
1392
+ * we do not yet fully recommend/support it for heavy production usage.
1393
+ */
1394
+ autoBelowLineCount: _propTypes.default.bool,
1372
1395
  /**
1373
1396
  * Defines the height for a specific row. It can be line count or just height.
1374
1397
  *
@@ -578,6 +578,14 @@ EuiDataGridBody.propTypes = {
578
578
  lineCount: _propTypes.default.number,
579
579
  height: _propTypes.default.number
580
580
  }).isRequired]),
581
+ /**
582
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
583
+ * *max* number of lines (instead of a set number of lines for all rows).
584
+ *
585
+ * This functionality is in beta and has performance implications;
586
+ * we do not yet fully recommend/support it for heavy production usage.
587
+ */
588
+ autoBelowLineCount: _propTypes.default.bool,
581
589
  /**
582
590
  * Defines the height for a specific row. It can be line count or just height.
583
591
  *
@@ -80,7 +80,6 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PUR
80
80
  */
81
81
  var rowHeightUtils = (0, _row_heights.useRowHeightUtils)({
82
82
  rowHeightsOptions: rowHeightsOptions,
83
- gridStyles: gridStyles,
84
83
  columns: columns
85
84
  });
86
85
  var _useDefaultRowHeight = (0, _row_heights.useDefaultRowHeight)({
@@ -735,6 +734,14 @@ EuiDataGridBodyCustomRender.propTypes = {
735
734
  lineCount: _propTypes.default.number,
736
735
  height: _propTypes.default.number
737
736
  }).isRequired]),
737
+ /**
738
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
739
+ * *max* number of lines (instead of a set number of lines for all rows).
740
+ *
741
+ * This functionality is in beta and has performance implications;
742
+ * we do not yet fully recommend/support it for heavy production usage.
743
+ */
744
+ autoBelowLineCount: _propTypes.default.bool,
738
745
  /**
739
746
  * Defines the height for a specific row. It can be line count or just height.
740
747
  *
@@ -220,7 +220,6 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
220
220
  gridItemsRenderedRef: gridItemsRendered
221
221
  },
222
222
  rowHeightsOptions: rowHeightsOptions,
223
- gridStyles: gridStyles,
224
223
  columns: columns
225
224
  });
226
225
  var _useDefaultRowHeight = (0, _row_heights.useDefaultRowHeight)({
@@ -867,6 +866,14 @@ EuiDataGridBodyVirtualized.propTypes = {
867
866
  lineCount: _propTypes.default.number,
868
867
  height: _propTypes.default.number
869
868
  }).isRequired]),
869
+ /**
870
+ * Feature flag for custom `lineCount` behavior, where `lineCount` acts like a
871
+ * *max* number of lines (instead of a set number of lines for all rows).
872
+ *
873
+ * This functionality is in beta and has performance implications;
874
+ * we do not yet fully recommend/support it for heavy production usage.
875
+ */
876
+ autoBelowLineCount: _propTypes.default.bool,
870
877
  /**
871
878
  * Defines the height for a specific row. It can be line count or just height.
872
879
  *
@@ -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
  };