@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.
- package/es/components/context_menu/context_menu_panel.js +17 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +31 -8
- package/es/components/datagrid/body/data_grid_body.js +8 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +8 -1
- package/es/components/datagrid/body/data_grid_body_virtualized.js +8 -1
- package/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
- package/es/components/datagrid/controls/display_selector.js +277 -207
- package/es/components/datagrid/data_grid.stories.utils.js +28 -2
- package/es/components/datagrid/data_grid.styles.js +1 -1
- package/es/components/datagrid/utils/grid_height_width.js +1 -1
- package/es/components/datagrid/utils/row_heights.js +29 -13
- package/es/components/header/header.styles.js +8 -1
- package/es/services/hooks/useDeepEqual.js +18 -6
- package/eui.d.ts +38 -10
- package/i18ntokens.json +88 -106
- package/lib/components/context_menu/context_menu_panel.js +17 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +31 -8
- package/lib/components/datagrid/body/data_grid_body.js +8 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +8 -1
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +8 -1
- package/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
- package/lib/components/datagrid/controls/display_selector.js +275 -204
- package/lib/components/datagrid/data_grid.stories.utils.js +28 -2
- package/lib/components/datagrid/data_grid.styles.js +1 -1
- package/lib/components/datagrid/utils/grid_height_width.js +1 -1
- package/lib/components/datagrid/utils/row_heights.js +29 -13
- package/lib/components/header/header.styles.js +8 -1
- package/lib/services/hooks/useDeepEqual.js +17 -7
- package/optimize/es/components/context_menu/context_menu_panel.js +11 -1
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +15 -8
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +0 -1
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +0 -1
- package/optimize/es/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
- package/optimize/es/components/datagrid/controls/display_selector.js +277 -207
- package/optimize/es/components/datagrid/data_grid.styles.js +1 -1
- package/optimize/es/components/datagrid/utils/grid_height_width.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +29 -13
- package/optimize/es/components/header/header.styles.js +8 -1
- package/optimize/es/services/hooks/useDeepEqual.js +13 -6
- package/optimize/lib/components/context_menu/context_menu_panel.js +11 -1
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +15 -8
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +0 -1
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +0 -1
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
- package/optimize/lib/components/datagrid/controls/display_selector.js +274 -204
- package/optimize/lib/components/datagrid/data_grid.styles.js +1 -1
- package/optimize/lib/components/datagrid/utils/grid_height_width.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +29 -13
- package/optimize/lib/components/header/header.styles.js +8 -1
- package/optimize/lib/services/hooks/useDeepEqual.js +12 -5
- package/package.json +1 -1
- package/test-env/components/context_menu/context_menu_panel.js +17 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +31 -8
- package/test-env/components/datagrid/body/data_grid_body.js +8 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +8 -1
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +8 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar.styles.js +2 -2
- package/test-env/components/datagrid/controls/display_selector.js +274 -204
- package/test-env/components/datagrid/data_grid.stories.utils.js +28 -2
- package/test-env/components/datagrid/data_grid.styles.js +1 -1
- package/test-env/components/datagrid/utils/grid_height_width.js +1 -1
- package/test-env/components/datagrid/utils/row_heights.js +29 -13
- package/test-env/components/header/header.styles.js +8 -1
- package/test-env/services/hooks/useDeepEqual.js +12 -5
|
@@ -78,7 +78,7 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
|
|
|
78
78
|
}
|
|
79
79
|
}, {
|
|
80
80
|
key: "getCalculatedHeight",
|
|
81
|
-
value: function getCalculatedHeight(heightOption, defaultHeight, rowIndex,
|
|
81
|
+
value: function getCalculatedHeight(heightOption, defaultHeight, rowIndex, rowHeightsOptions) {
|
|
82
82
|
if ((0, _predicate.isObject)(heightOption) && heightOption.height) {
|
|
83
83
|
return Math.max(heightOption.height, defaultHeight);
|
|
84
84
|
}
|
|
@@ -86,8 +86,13 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
|
|
|
86
86
|
return Math.max(heightOption, defaultHeight);
|
|
87
87
|
}
|
|
88
88
|
if ((0, _predicate.isObject)(heightOption) && heightOption.lineCount) {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
var _ref = rowHeightsOptions || {},
|
|
90
|
+
autoBelowLineCount = _ref.autoBelowLineCount; // uses auto height cache
|
|
91
|
+
var isRowHeightOverride =
|
|
92
|
+
// lineCount overrides are stored in the heights cache
|
|
93
|
+
rowIndex != null && this.isRowHeightOverride(rowIndex, rowHeightsOptions);
|
|
94
|
+
if (autoBelowLineCount || isRowHeightOverride) {
|
|
95
|
+
return this.getRowHeight(rowIndex) || defaultHeight;
|
|
91
96
|
} else {
|
|
92
97
|
return defaultHeight; // default lineCount height is set in minRowHeight state in grid_row_body
|
|
93
98
|
}
|
|
@@ -118,6 +123,14 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
|
|
|
118
123
|
// Assumes both padding-top and bottom are the same
|
|
119
124
|
return contentHeight + padding * 2;
|
|
120
125
|
}
|
|
126
|
+
}, {
|
|
127
|
+
key: "isAutoBelowLineCount",
|
|
128
|
+
value: function isAutoBelowLineCount(options, option) {
|
|
129
|
+
var _this$getLineCount;
|
|
130
|
+
if (!(options !== null && options !== void 0 && options.autoBelowLineCount)) return false;
|
|
131
|
+
if (((_this$getLineCount = this.getLineCount(option)) !== null && _this$getLineCount !== void 0 ? _this$getLineCount : 0) > 1) return true;
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
121
134
|
|
|
122
135
|
/**
|
|
123
136
|
* Auto height utils
|
|
@@ -129,6 +142,9 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
|
|
|
129
142
|
if (height === AUTO_HEIGHT) {
|
|
130
143
|
return true;
|
|
131
144
|
}
|
|
145
|
+
if (this.isAutoBelowLineCount(rowHeightsOptions, height)) {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
132
148
|
return false;
|
|
133
149
|
}
|
|
134
150
|
}, {
|
|
@@ -158,8 +174,8 @@ var RowHeightUtils = exports.RowHeightUtils = /*#__PURE__*/function () {
|
|
|
158
174
|
}, {
|
|
159
175
|
key: "pruneHiddenColumnHeights",
|
|
160
176
|
value: function pruneHiddenColumnHeights(visibleColumns) {
|
|
161
|
-
var visibleColumnIds = new Set(visibleColumns.map(function (
|
|
162
|
-
var id =
|
|
177
|
+
var visibleColumnIds = new Set(visibleColumns.map(function (_ref2) {
|
|
178
|
+
var id = _ref2.id;
|
|
163
179
|
return id;
|
|
164
180
|
}));
|
|
165
181
|
var didModify = false;
|
|
@@ -269,10 +285,10 @@ var RowHeightVirtualizationUtils = exports.RowHeightVirtualizationUtils = /*#__P
|
|
|
269
285
|
* Hook for instantiating RowHeightUtils, setting internal class vars,
|
|
270
286
|
* and setting up various row-height-related side effects
|
|
271
287
|
*/
|
|
272
|
-
var useRowHeightUtils = exports.useRowHeightUtils = function useRowHeightUtils(
|
|
273
|
-
var virtualization =
|
|
274
|
-
rowHeightsOptions =
|
|
275
|
-
columns =
|
|
288
|
+
var useRowHeightUtils = exports.useRowHeightUtils = function useRowHeightUtils(_ref3) {
|
|
289
|
+
var virtualization = _ref3.virtualization,
|
|
290
|
+
rowHeightsOptions = _ref3.rowHeightsOptions,
|
|
291
|
+
columns = _ref3.columns;
|
|
276
292
|
var forceRenderRef = (0, _services.useLatest)((0, _services.useForceRender)());
|
|
277
293
|
var _useState = (0, _react.useState)(function () {
|
|
278
294
|
if (virtualization) {
|
|
@@ -305,9 +321,9 @@ var useRowHeightUtils = exports.useRowHeightUtils = function useRowHeightUtils(_
|
|
|
305
321
|
}, [rowHeightUtils, columns]);
|
|
306
322
|
return rowHeightUtils;
|
|
307
323
|
};
|
|
308
|
-
var useDefaultRowHeight = exports.useDefaultRowHeight = function useDefaultRowHeight(
|
|
309
|
-
var rowHeightsOptions =
|
|
310
|
-
rowHeightUtils =
|
|
324
|
+
var useDefaultRowHeight = exports.useDefaultRowHeight = function useDefaultRowHeight(_ref4) {
|
|
325
|
+
var rowHeightsOptions = _ref4.rowHeightsOptions,
|
|
326
|
+
rowHeightUtils = _ref4.rowHeightUtils;
|
|
311
327
|
var _useContext = (0, _react.useContext)(_sorting.DataGridSortedContext),
|
|
312
328
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
313
329
|
|
|
@@ -331,7 +347,7 @@ var useDefaultRowHeight = exports.useDefaultRowHeight = function useDefaultRowHe
|
|
|
331
347
|
// Account for row-specific height overrides
|
|
332
348
|
var rowHeightOption = rowHeightUtils.getRowHeightOption(correctRowIndex, rowHeightsOptions);
|
|
333
349
|
if (rowHeightOption) {
|
|
334
|
-
rowHeight = rowHeightUtils.getCalculatedHeight(rowHeightOption, minRowHeight, correctRowIndex,
|
|
350
|
+
rowHeight = rowHeightUtils.getCalculatedHeight(rowHeightOption, minRowHeight, correctRowIndex, rowHeightsOptions);
|
|
335
351
|
}
|
|
336
352
|
|
|
337
353
|
// 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
|
-
|
|
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
|
};
|
|
@@ -6,24 +6,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useDeepEqual = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
9
|
+
var _useUpdateEffect = require("./useUpdateEffect");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
|
|
11
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
18
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
13
19
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
14
20
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
21
|
* Side Public License, v 1.
|
|
16
22
|
*/
|
|
17
|
-
|
|
18
23
|
/**
|
|
19
24
|
* This hook is mostly a performance concern for third-party objs/arrays that EUI
|
|
20
25
|
* has no control over and may not be correctly memoized (i.e., will create a new
|
|
21
26
|
* reference on every rerender unless passed through this hook).
|
|
22
27
|
*/
|
|
23
28
|
var useDeepEqual = exports.useDeepEqual = function useDeepEqual(object) {
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
var _useState = (0, _react.useState)(object),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
memoizedObject = _useState2[0],
|
|
32
|
+
setMemoizedObject = _useState2[1];
|
|
33
|
+
(0, _useUpdateEffect.useUpdateEffect)(function () {
|
|
34
|
+
if (!(0, _isEqual.default)(object, memoizedObject)) {
|
|
35
|
+
setMemoizedObject(object);
|
|
36
|
+
}
|
|
37
|
+
}, [object]);
|
|
38
|
+
return memoizedObject;
|
|
29
39
|
};
|
|
@@ -156,7 +156,7 @@ export var EuiContextMenuPanelClass = /*#__PURE__*/function (_Component) {
|
|
|
156
156
|
items: _this.props.items
|
|
157
157
|
},
|
|
158
158
|
menuItems: [],
|
|
159
|
-
focusedItemIndex: props.onClose && props.initialFocusedItemIndex != null ? props.initialFocusedItemIndex + 1 // Account for panel title back button
|
|
159
|
+
focusedItemIndex: props.onClose && props.initialFocusedItemIndex != null && props.initialFocusedItemIndex !== -1 ? props.initialFocusedItemIndex + 1 // Account for panel title back button
|
|
160
160
|
: props.initialFocusedItemIndex,
|
|
161
161
|
currentHeight: undefined,
|
|
162
162
|
waitingForInitialPopover: false,
|
|
@@ -199,6 +199,16 @@ export var EuiContextMenuPanelClass = /*#__PURE__*/function (_Component) {
|
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
// `initialFocusedItemIndex={-1}` should only be used when preventing initial item focus is desired
|
|
203
|
+
if (_this2.state.focusedItemIndex === -1) {
|
|
204
|
+
// Resetting the focusedItemIndex to 0 allows keyboard up/down behavior to
|
|
205
|
+
// still work correctly later if the panel is manually tabbed into
|
|
206
|
+
return _this2.setState({
|
|
207
|
+
tookInitialFocus: true,
|
|
208
|
+
focusedItemIndex: 0
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
202
212
|
// If an item should be focused, focus it (if it exists)
|
|
203
213
|
if (_this2.state.focusedItemIndex != null && _this2.state.menuItems.length) {
|
|
204
214
|
var focusedItem = _this2.state.menuItems[_this2.state.focusedItemIndex];
|
|
@@ -7,7 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
7
7
|
import _extends from "@babel/runtime/helpers/extends";
|
|
8
8
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "
|
|
10
|
+
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeightsOptions", "rowHeightUtils", "isControlColumn"],
|
|
11
11
|
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
12
12
|
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"],
|
|
13
13
|
_excluded4 = ["columnId", "columnIndex", "rowIndex", "visibleRowIndex"];
|
|
@@ -45,15 +45,20 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
45
45
|
setCellContentsRef = _ref.setCellContentsRef,
|
|
46
46
|
rowIndex = _ref.rowIndex,
|
|
47
47
|
colIndex = _ref.colIndex,
|
|
48
|
-
|
|
48
|
+
rowHeightsOptions = _ref.rowHeightsOptions,
|
|
49
49
|
rowHeightUtils = _ref.rowHeightUtils,
|
|
50
50
|
isControlColumn = _ref.isControlColumn,
|
|
51
51
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
52
52
|
// React is more permissive than the TS types indicate
|
|
53
53
|
var CellElement = renderCellValue;
|
|
54
|
+
|
|
55
|
+
// Cell height type
|
|
56
|
+
var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
|
|
54
57
|
var cellHeightType = useMemo(function () {
|
|
55
|
-
return (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
|
|
56
|
-
}, [rowHeightUtils, rowHeight]);
|
|
58
|
+
return rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.isAutoBelowLineCount(rowHeightsOptions, rowHeight) ? 'autoBelowLineCount' : (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
|
|
59
|
+
}, [rowHeightUtils, rowHeight, rowHeightsOptions]);
|
|
60
|
+
|
|
61
|
+
// Classes and styles
|
|
57
62
|
var classes = useMemo(function () {
|
|
58
63
|
return classNames('euiDataGridRowCell__content', "euiDataGridRowCell__content--".concat(cellHeightType, "Height"), !isControlColumn && {
|
|
59
64
|
'eui-textBreakWord': cellHeightType !== 'default',
|
|
@@ -64,9 +69,9 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
69
|
var cssStyles = [styles.content.euiDataGridRowCell__content].concat(_toConsumableArray(isControlColumn ? [styles.content.controlColumn, styles.content.autoHeight] : [
|
|
65
70
|
// Regular data cells should always inherit height from the row wrapper,
|
|
66
71
|
// except for auto height
|
|
67
|
-
cellHeightType === 'auto' ? styles.content.autoHeight : styles.content.defaultHeight]));
|
|
72
|
+
cellHeightType === 'auto' || cellHeightType === 'autoBelowLineCount' ? styles.content.autoHeight : styles.content.defaultHeight]));
|
|
68
73
|
return ___EmotionJSX(RenderTruncatedCellContent, {
|
|
69
|
-
hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
|
|
74
|
+
hasLineCountTruncation: (cellHeightType === 'lineCount' || cellHeightType === 'autoBelowLineCount') && !isControlColumn,
|
|
70
75
|
rowHeight: rowHeight
|
|
71
76
|
}, ___EmotionJSX("div", {
|
|
72
77
|
ref: setCellContentsRef,
|
|
@@ -135,6 +140,9 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
135
140
|
rowHeightsOptions = _this$props3.rowHeightsOptions,
|
|
136
141
|
rowIndex = _this$props3.rowIndex;
|
|
137
142
|
var rowHeightOption = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
|
|
143
|
+
if (rowHeightUtils !== null && rowHeightUtils !== void 0 && rowHeightUtils.isAutoBelowLineCount(rowHeightsOptions, rowHeightOption)) {
|
|
144
|
+
return; // Using auto height instead
|
|
145
|
+
}
|
|
138
146
|
var isSingleLine = rowHeightOption == null; // Undefined rowHeightsOptions default to a single line
|
|
139
147
|
var lineCount = isSingleLine ? 1 : rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getLineCount(rowHeightOption);
|
|
140
148
|
if (lineCount) {
|
|
@@ -439,7 +447,6 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
439
447
|
// column width, can be undefined
|
|
440
448
|
lineHeight: (_rowHeightsOptions$li = rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.lineHeight) !== null && _rowHeightsOptions$li !== void 0 ? _rowHeightsOptions$li : undefined
|
|
441
449
|
}, cellPropsStyle);
|
|
442
|
-
var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
|
|
443
450
|
var row = rowManager && !IS_JEST_ENVIRONMENT ? rowManager.getRow({
|
|
444
451
|
rowIndex: rowIndex,
|
|
445
452
|
visibleRowIndex: visibleRowIndex,
|
|
@@ -471,7 +478,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
471
478
|
isExpandable: isExpandable,
|
|
472
479
|
isExpanded: popoverIsOpen,
|
|
473
480
|
setCellContentsRef: this.setCellContentsRef,
|
|
474
|
-
|
|
481
|
+
rowHeightsOptions: rowHeightsOptions,
|
|
475
482
|
rowHeightUtils: rowHeightUtils,
|
|
476
483
|
isControlColumn: isControlColumn,
|
|
477
484
|
rowIndex: rowIndex,
|
|
@@ -70,7 +70,6 @@ export var EuiDataGridBodyCustomRender = /*#__PURE__*/memo(function (_ref) {
|
|
|
70
70
|
*/
|
|
71
71
|
var rowHeightUtils = useRowHeightUtils({
|
|
72
72
|
rowHeightsOptions: rowHeightsOptions,
|
|
73
|
-
gridStyles: gridStyles,
|
|
74
73
|
columns: columns
|
|
75
74
|
});
|
|
76
75
|
var _useDefaultRowHeight = useDefaultRowHeight({
|
|
@@ -211,7 +211,6 @@ export var EuiDataGridBodyVirtualized = /*#__PURE__*/memo(function (_ref3) {
|
|
|
211
211
|
gridItemsRenderedRef: gridItemsRendered
|
|
212
212
|
},
|
|
213
213
|
rowHeightsOptions: rowHeightsOptions,
|
|
214
|
-
gridStyles: gridStyles,
|
|
215
214
|
columns: columns
|
|
216
215
|
});
|
|
217
216
|
var _useDefaultRowHeight = useDefaultRowHeight({
|
|
@@ -12,7 +12,7 @@ export var euiDataGridToolbarStyles = function euiDataGridToolbarStyles(_ref) {
|
|
|
12
12
|
var euiTheme = _ref.euiTheme;
|
|
13
13
|
return {
|
|
14
14
|
euiDataGrid__controls: /*#__PURE__*/css("z-index:2;position:relative;display:flex;justify-content:space-between;align-items:center;gap:", euiTheme.size.base, ";", logicalCSS('padding-vertical', euiTheme.size.xs), " background-color:", euiTheme.colors.emptyShade, ";;label:euiDataGrid__controls;"),
|
|
15
|
-
euiDataGrid__rightControls: /*#__PURE__*/css("display:flex;justify-content:flex-end;flex-wrap:wrap;column-gap:", euiTheme.size.s, ";", logicalCSS('padding-right', euiTheme.size.xs), "&:only-child{", logicalCSS('margin-left', 'auto'), ";};label:euiDataGrid__rightControls;"),
|
|
16
|
-
euiDataGrid__leftControls: /*#__PURE__*/css("display:flex;flex-wrap:wrap;gap:", euiTheme.size.xxs, ";;label:euiDataGrid__leftControls;")
|
|
15
|
+
euiDataGrid__rightControls: /*#__PURE__*/css("display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;column-gap:", euiTheme.size.s, ";", logicalCSS('padding-right', euiTheme.size.xs), "&:only-child{", logicalCSS('margin-left', 'auto'), ";};label:euiDataGrid__rightControls;"),
|
|
16
|
+
euiDataGrid__leftControls: /*#__PURE__*/css("display:flex;flex-wrap:wrap;align-items:center;gap:", euiTheme.size.xxs, ";;label:euiDataGrid__leftControls;")
|
|
17
17
|
};
|
|
18
18
|
};
|