@elastic/eui 93.3.0 → 93.4.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/dist/eui_charts_theme.d.ts +9 -0
- package/dist/eui_charts_theme.js +56 -14
- package/dist/eui_charts_theme.js.map +1 -1
- package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/es/components/breadcrumbs/breadcrumb.js +10 -327
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/es/components/breadcrumbs/types.js +1 -0
- package/es/components/button/button_group/button_group.js +16 -2
- package/es/components/button/button_group/button_group.styles.js +1 -1
- package/es/components/button/button_group/button_group_button.js +59 -5
- package/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +97 -58
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/es/components/datagrid/body/cell/index.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +13 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +52 -36
- package/es/components/datagrid/body/data_grid_body_virtualized.js +84 -56
- package/es/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
- package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
- package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/es/components/datagrid/controls/column_selector.js +126 -123
- package/es/components/datagrid/controls/column_sorting.js +605 -103
- package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/es/components/datagrid/controls/display_selector.js +109 -107
- package/es/components/datagrid/data_grid.a11y.js +13 -12
- package/es/components/datagrid/data_grid.js +45 -22
- package/es/components/datagrid/utils/col_widths.js +12 -8
- package/es/components/datagrid/utils/focus.js +10 -8
- package/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/es/components/datagrid/utils/ref.js +1 -1
- package/es/components/datagrid/utils/row_heights.js +2 -2
- package/es/components/datagrid/utils/sorting.js +29 -27
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/es/components/flex/flex_grid.js +22 -8
- package/es/components/flex/flex_grid.styles.js +13 -6
- package/es/components/flex/flex_group.js +10 -11
- package/es/components/flex/flex_item.js +9 -11
- package/es/components/flex/flex_item.styles.js +107 -122
- package/es/components/flyout/flyout.js +16 -18
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/es/components/modal/confirm_modal.js +2 -1
- package/es/components/modal/modal.js +12 -3
- package/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/es/components/spacer/spacer.js +2 -3
- package/es/components/toast/global_toast_list.js +70 -73
- package/es/components/toast/toast.js +27 -42
- package/es/components/toast/toast.styles.js +2 -17
- package/es/services/color/eui_palettes.js +21 -13
- package/es/services/color/index.js +1 -1
- package/es/services/hooks/index.js +1 -0
- package/es/services/hooks/useDeepEqual.js +23 -0
- package/es/services/index.js +1 -1
- package/eui.d.ts +2442 -2337
- package/i18ntokens.json +259 -259
- package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/lib/components/breadcrumbs/breadcrumb.js +11 -331
- package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/lib/components/breadcrumbs/types.js +5 -0
- package/lib/components/button/button_group/button_group.js +16 -2
- package/lib/components/button/button_group/button_group.styles.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +59 -5
- package/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/lib/components/datagrid/body/cell/data_grid_cell.js +95 -57
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/lib/components/datagrid/body/cell/index.js +2 -2
- package/lib/components/datagrid/body/data_grid_body.js +13 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +51 -35
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +83 -55
- package/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/lib/components/datagrid/controls/column_selector.js +126 -123
- package/lib/components/datagrid/controls/column_sorting.js +615 -110
- package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/lib/components/datagrid/controls/display_selector.js +109 -107
- package/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/lib/components/datagrid/data_grid.js +43 -20
- package/lib/components/datagrid/utils/col_widths.js +12 -8
- package/lib/components/datagrid/utils/focus.js +10 -8
- package/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/lib/components/datagrid/utils/ref.js +1 -1
- package/lib/components/datagrid/utils/row_heights.js +1 -1
- package/lib/components/datagrid/utils/sorting.js +31 -29
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/lib/components/flex/flex_grid.js +23 -7
- package/lib/components/flex/flex_grid.styles.js +13 -6
- package/lib/components/flex/flex_group.js +10 -10
- package/lib/components/flex/flex_item.js +13 -13
- package/lib/components/flex/flex_item.styles.js +107 -122
- package/lib/components/flyout/flyout.js +16 -18
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/lib/components/modal/confirm_modal.js +2 -1
- package/lib/components/modal/modal.js +12 -3
- package/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/lib/components/spacer/spacer.js +1 -2
- package/lib/components/toast/global_toast_list.js +68 -71
- package/lib/components/toast/toast.js +25 -40
- package/lib/components/toast/toast.styles.js +11 -25
- package/lib/services/color/eui_palettes.js +24 -14
- package/lib/services/color/index.js +14 -0
- package/lib/services/hooks/index.js +11 -0
- package/lib/services/hooks/useDeepEqual.js +30 -0
- package/lib/services/index.js +15 -1
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -110
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/optimize/es/components/breadcrumbs/types.js +1 -0
- package/optimize/es/components/button/button_group/button_group.js +2 -2
- package/optimize/es/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.js +36 -4
- package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +80 -55
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/optimize/es/components/datagrid/body/cell/index.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +39 -36
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +69 -49
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/es/components/datagrid/data_grid.js +45 -22
- package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/es/components/datagrid/utils/focus.js +10 -8
- package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/optimize/es/components/datagrid/utils/ref.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
- package/optimize/es/components/datagrid/utils/sorting.js +29 -27
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/es/components/flex/flex_grid.js +19 -8
- package/optimize/es/components/flex/flex_grid.styles.js +13 -6
- package/optimize/es/components/flex/flex_group.js +9 -10
- package/optimize/es/components/flex/flex_item.js +9 -11
- package/optimize/es/components/flex/flex_item.styles.js +107 -122
- package/optimize/es/components/flyout/flyout.js +16 -18
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/es/components/modal/confirm_modal.js +2 -1
- package/optimize/es/components/modal/modal.js +6 -2
- package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/es/components/spacer/spacer.js +2 -3
- package/optimize/es/components/toast/global_toast_list.js +70 -73
- package/optimize/es/components/toast/toast.js +27 -42
- package/optimize/es/components/toast/toast.styles.js +2 -17
- package/optimize/es/services/color/eui_palettes.js +21 -13
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/hooks/index.js +1 -0
- package/optimize/es/services/hooks/useDeepEqual.js +23 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -113
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/optimize/lib/components/breadcrumbs/types.js +5 -0
- package/optimize/lib/components/button/button_group/button_group.js +2 -2
- package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +78 -54
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +38 -35
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +70 -50
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/lib/components/datagrid/data_grid.js +43 -20
- package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/lib/components/datagrid/utils/focus.js +10 -8
- package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/optimize/lib/components/datagrid/utils/ref.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/lib/components/flex/flex_grid.js +21 -7
- package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
- package/optimize/lib/components/flex/flex_group.js +9 -9
- package/optimize/lib/components/flex/flex_item.js +13 -13
- package/optimize/lib/components/flex/flex_item.styles.js +107 -122
- package/optimize/lib/components/flyout/flyout.js +16 -18
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/lib/components/modal/confirm_modal.js +2 -1
- package/optimize/lib/components/modal/modal.js +6 -2
- package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/lib/components/spacer/spacer.js +1 -2
- package/optimize/lib/components/toast/global_toast_list.js +68 -71
- package/optimize/lib/components/toast/toast.js +25 -40
- package/optimize/lib/components/toast/toast.styles.js +11 -25
- package/optimize/lib/services/color/eui_palettes.js +24 -14
- package/optimize/lib/services/color/index.js +14 -0
- package/optimize/lib/services/hooks/index.js +11 -0
- package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
- package/optimize/lib/services/index.js +15 -1
- package/package.json +2 -2
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +11 -326
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/test-env/components/breadcrumbs/breadcrumbs.js +3 -3
- package/test-env/components/breadcrumbs/types.js +5 -0
- package/test-env/components/button/button_group/button_group.js +16 -2
- package/test-env/components/button/button_group/button_group.styles.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +56 -5
- package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +95 -57
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/test-env/components/datagrid/body/cell/index.js +2 -2
- package/test-env/components/datagrid/body/data_grid_body.js +13 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +51 -35
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +83 -55
- package/test-env/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/test-env/components/datagrid/controls/column_selector.js +126 -123
- package/test-env/components/datagrid/controls/column_sorting.js +607 -106
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/test-env/components/datagrid/controls/display_selector.js +109 -107
- package/test-env/components/datagrid/data_grid.a11y.js +13 -12
- package/test-env/components/datagrid/data_grid.js +43 -20
- package/test-env/components/datagrid/utils/col_widths.js +9 -5
- package/test-env/components/datagrid/utils/focus.js +10 -8
- package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
- package/test-env/components/datagrid/utils/ref.js +1 -1
- package/test-env/components/datagrid/utils/row_heights.js +1 -1
- package/test-env/components/datagrid/utils/sorting.js +31 -29
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/test-env/components/flex/flex_grid.js +21 -7
- package/test-env/components/flex/flex_grid.styles.js +13 -6
- package/test-env/components/flex/flex_group.js +10 -10
- package/test-env/components/flex/flex_item.js +13 -13
- package/test-env/components/flex/flex_item.styles.js +107 -122
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/test-env/components/modal/confirm_modal.js +2 -1
- package/test-env/components/modal/modal.js +12 -3
- package/test-env/components/spacer/spacer.js +1 -2
- package/test-env/components/toast/global_toast_list.js +68 -71
- package/test-env/components/toast/toast.js +25 -40
- package/test-env/components/toast/toast.styles.js +11 -25
- package/test-env/services/color/eui_palettes.js +24 -14
- package/test-env/services/color/index.js +14 -0
- package/test-env/services/hooks/index.js +11 -0
- package/test-env/services/hooks/useDeepEqual.js +30 -0
- package/test-env/services/index.js +15 -1
- package/src/themes/charts/theme.scss +0 -5
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _extends from "@babel/runtime/helpers/extends";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
|
-
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "
|
|
10
|
+
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "showCellActions", "onExpandClick", "popoverAnchorRef"],
|
|
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
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import classNames from 'classnames';
|
|
26
|
-
import React, { Component, createRef, memo } from 'react';
|
|
26
|
+
import React, { Component, createRef, memo, useMemo } from 'react';
|
|
27
27
|
import { createPortal } from 'react-dom';
|
|
28
28
|
import { IS_JEST_ENVIRONMENT } from '../../../../utils';
|
|
29
29
|
import { keys } from '../../../../services';
|
|
@@ -48,16 +48,25 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
48
48
|
rowHeightUtils = _ref.rowHeightUtils,
|
|
49
49
|
isControlColumn = _ref.isControlColumn,
|
|
50
50
|
isFocused = _ref.isFocused,
|
|
51
|
-
|
|
51
|
+
showCellActions = _ref.showCellActions,
|
|
52
|
+
onExpandClick = _ref.onExpandClick,
|
|
53
|
+
popoverAnchorRef = _ref.popoverAnchorRef,
|
|
52
54
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
53
|
-
// React is more
|
|
55
|
+
// React is more permissive than the TS types indicate
|
|
54
56
|
var CellElement = renderCellValue;
|
|
55
|
-
var cellHeightType = (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
var cellHeightType = useMemo(function () {
|
|
58
|
+
return (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
|
|
59
|
+
}, [rowHeightUtils, rowHeight]);
|
|
60
|
+
var classes = useMemo(function () {
|
|
61
|
+
return classNames('euiDataGridRowCell__content', "euiDataGridRowCell__content--".concat(cellHeightType, "Height"), !isControlColumn && {
|
|
62
|
+
'eui-textBreakWord': cellHeightType !== 'default',
|
|
63
|
+
'eui-textTruncate': cellHeightType === 'default'
|
|
64
|
+
});
|
|
65
|
+
}, [cellHeightType, isControlColumn]);
|
|
66
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(RenderTruncatedCellContent, {
|
|
67
|
+
hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
|
|
68
|
+
rowHeight: rowHeight
|
|
69
|
+
}, ___EmotionJSX("div", {
|
|
61
70
|
ref: setCellContentsRef,
|
|
62
71
|
"data-datagrid-cellcontent": true,
|
|
63
72
|
className: classes
|
|
@@ -67,15 +76,7 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
67
76
|
rowIndex: rowIndex,
|
|
68
77
|
colIndex: colIndex,
|
|
69
78
|
schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
|
|
70
|
-
}, cellContext, rest)))
|
|
71
|
-
if (cellHeightType === 'lineCount' && !isControlColumn) {
|
|
72
|
-
var lines = rowHeightUtils.getLineCount(rowHeight);
|
|
73
|
-
cellContent = ___EmotionJSX(EuiTextBlockTruncate, {
|
|
74
|
-
lines: lines,
|
|
75
|
-
cloneElement: true
|
|
76
|
-
}, cellContent);
|
|
77
|
-
}
|
|
78
|
-
var screenReaderText = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
79
|
+
}, cellContext, rest)))), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
79
80
|
hidden: !isFocused
|
|
80
81
|
}, '- ', ___EmotionJSX(EuiI18n, {
|
|
81
82
|
token: "euiDataGridCell.position",
|
|
@@ -85,11 +86,16 @@ var EuiDataGridCellContent = /*#__PURE__*/memo(function (_ref) {
|
|
|
85
86
|
col: colIndex + 1,
|
|
86
87
|
row: ariaRowIndex
|
|
87
88
|
}
|
|
88
|
-
}),
|
|
89
|
+
}), showCellActions && ___EmotionJSX(React.Fragment, null, '. ', ___EmotionJSX(EuiI18n, {
|
|
89
90
|
token: "euiDataGridCell.expansionEnterPrompt",
|
|
90
91
|
default: "Press the Enter key to expand this cell."
|
|
91
|
-
}))))
|
|
92
|
-
|
|
92
|
+
})))), showCellActions && ___EmotionJSX(EuiDataGridCellActions, {
|
|
93
|
+
rowIndex: rowIndex,
|
|
94
|
+
colIndex: colIndex,
|
|
95
|
+
column: column,
|
|
96
|
+
onExpandClick: onExpandClick,
|
|
97
|
+
popoverAnchorRef: popoverAnchorRef
|
|
98
|
+
}));
|
|
93
99
|
});
|
|
94
100
|
EuiDataGridCellContent.displayName = 'EuiDataGridCellContent';
|
|
95
101
|
export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
@@ -416,6 +422,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
416
422
|
if (nextProps.style.height !== this.props.style.height) return true;
|
|
417
423
|
if (nextProps.style.width !== this.props.style.width) return true;
|
|
418
424
|
}
|
|
425
|
+
if (nextProps.cellContext !== this.props.cellContext) return true;
|
|
419
426
|
if (nextState.cellProps !== this.state.cellProps) return true;
|
|
420
427
|
if (nextState.isFocused !== this.state.isFocused) return true;
|
|
421
428
|
if (nextState.isHovered !== this.state.isHovered) return true;
|
|
@@ -465,21 +472,16 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
465
472
|
lineHeight: (_rowHeightsOptions$li = rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.lineHeight) !== null && _rowHeightsOptions$li !== void 0 ? _rowHeightsOptions$li : undefined
|
|
466
473
|
}, cellPropsStyle);
|
|
467
474
|
var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
|
|
468
|
-
var
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
rowHeightUtils: rowHeightUtils,
|
|
479
|
-
isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
|
|
480
|
-
ariaRowIndex: ariaRowIndex
|
|
481
|
-
});
|
|
482
|
-
var cell = ___EmotionJSX("div", _extends({
|
|
475
|
+
var row = rowManager && !IS_JEST_ENVIRONMENT ? rowManager.getRow({
|
|
476
|
+
rowIndex: rowIndex,
|
|
477
|
+
visibleRowIndex: visibleRowIndex,
|
|
478
|
+
top: style.top,
|
|
479
|
+
// comes in as a `{float}px` string from react-window
|
|
480
|
+
height: style.height // comes in as an integer from react-window
|
|
481
|
+
}) : undefined;
|
|
482
|
+
return ___EmotionJSX(RenderCellInRow, {
|
|
483
|
+
row: row
|
|
484
|
+
}, ___EmotionJSX("div", _extends({
|
|
483
485
|
role: "gridcell",
|
|
484
486
|
"aria-rowindex": ariaRowIndex,
|
|
485
487
|
tabIndex: this.state.isFocused ? 0 : -1,
|
|
@@ -503,26 +505,49 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
503
505
|
cellEl: this.cellRef.current,
|
|
504
506
|
updateCellFocusContext: this.updateCellFocusContext,
|
|
505
507
|
renderFocusTrap: !isExpandable
|
|
506
|
-
}, ___EmotionJSX(EuiDataGridCellContent, _extends({},
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
508
|
+
}, ___EmotionJSX(EuiDataGridCellContent, _extends({}, rest, {
|
|
509
|
+
setCellProps: this.setCellProps,
|
|
510
|
+
column: column,
|
|
511
|
+
columnType: columnType,
|
|
512
|
+
isExpandable: isExpandable,
|
|
513
|
+
isExpanded: popoverIsOpen,
|
|
514
|
+
onExpandClick: this.handleCellExpansionClick,
|
|
515
|
+
popoverAnchorRef: this.popoverAnchorRef,
|
|
516
|
+
showCellActions: showCellActions,
|
|
517
|
+
isFocused: this.state.isFocused,
|
|
518
|
+
setCellContentsRef: this.setCellContentsRef,
|
|
519
|
+
rowHeight: rowHeight,
|
|
520
|
+
rowHeightUtils: rowHeightUtils,
|
|
521
|
+
isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
|
|
522
|
+
ariaRowIndex: ariaRowIndex,
|
|
518
523
|
rowIndex: rowIndex,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
// comes in as a `{float}px` string from react-window
|
|
522
|
-
height: style.height // comes in as an integer from react-window
|
|
523
|
-
})) : cell;
|
|
524
|
+
colIndex: colIndex
|
|
525
|
+
})))));
|
|
524
526
|
}
|
|
525
527
|
}]);
|
|
526
528
|
return EuiDataGridCell;
|
|
527
529
|
}(Component);
|
|
528
|
-
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Function component utilities for conditional rendering.
|
|
533
|
+
* Used for DRYness and performance
|
|
534
|
+
*/
|
|
535
|
+
_defineProperty(EuiDataGridCell, "contextType", DataGridFocusContext);
|
|
536
|
+
var RenderCellInRow = /*#__PURE__*/memo(function (_ref2) {
|
|
537
|
+
var row = _ref2.row,
|
|
538
|
+
children = _ref2.children;
|
|
539
|
+
return row ? /*#__PURE__*/createPortal(children, row) : children;
|
|
540
|
+
});
|
|
541
|
+
RenderCellInRow.displayName = 'RenderCellInRow';
|
|
542
|
+
var RenderTruncatedCellContent = /*#__PURE__*/memo(function (_ref3) {
|
|
543
|
+
var children = _ref3.children,
|
|
544
|
+
hasLineCountTruncation = _ref3.hasLineCountTruncation,
|
|
545
|
+
rowHeight = _ref3.rowHeight;
|
|
546
|
+
// If `hasLineCountTruncation` is true, we can rely on rowHeight being the correct type
|
|
547
|
+
var lines = hasLineCountTruncation ? rowHeight.lineCount : undefined;
|
|
548
|
+
return lines ? ___EmotionJSX(EuiTextBlockTruncate, {
|
|
549
|
+
lines: lines,
|
|
550
|
+
cloneElement: true
|
|
551
|
+
}, children) : children;
|
|
552
|
+
});
|
|
553
|
+
RenderTruncatedCellContent.displayName = 'RenderTruncatedCellContent';
|
|
@@ -18,6 +18,7 @@ import { EuiPopoverFooter } from '../../../popover';
|
|
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
19
|
export var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
20
20
|
var onExpandClick = _ref.onExpandClick,
|
|
21
|
+
popoverAnchorRef = _ref.popoverAnchorRef,
|
|
21
22
|
column = _ref.column,
|
|
22
23
|
rowIndex = _ref.rowIndex,
|
|
23
24
|
colIndex = _ref.colIndex;
|
|
@@ -25,23 +26,25 @@ export var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
|
25
26
|
// column.cellActions is present (regardless of column.isExpandable).
|
|
26
27
|
// This is because cell actions are not otherwise accessible to keyboard
|
|
27
28
|
// or screen reader users
|
|
28
|
-
var expandButton =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
var expandButton = useMemo(function () {
|
|
30
|
+
return ___EmotionJSX(EuiI18n, {
|
|
31
|
+
key: 'expand',
|
|
32
|
+
token: "euiDataGridCellActions.expandButtonTitle",
|
|
33
|
+
default: "Click or hit enter to interact with cell content"
|
|
34
|
+
}, function (expandButtonTitle) {
|
|
35
|
+
return ___EmotionJSX(EuiButtonIcon, {
|
|
36
|
+
className: "euiDataGridRowCell__actionButtonIcon euiDataGridRowCell__expandCell",
|
|
37
|
+
"data-test-subj": "euiDataGridCellExpandButton",
|
|
38
|
+
display: "fill",
|
|
39
|
+
color: "primary",
|
|
40
|
+
iconSize: "m",
|
|
41
|
+
iconType: "expandMini",
|
|
42
|
+
"aria-hidden": true,
|
|
43
|
+
onClick: onExpandClick,
|
|
44
|
+
title: expandButtonTitle
|
|
45
|
+
});
|
|
43
46
|
});
|
|
44
|
-
});
|
|
47
|
+
}, [onExpandClick]);
|
|
45
48
|
var additionalButtons = useMemo(function () {
|
|
46
49
|
if (!column || !Array.isArray(column === null || column === void 0 ? void 0 : column.cellActions)) return [];
|
|
47
50
|
var ButtonComponent = function ButtonComponent(props) {
|
|
@@ -72,9 +75,12 @@ export var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
|
72
75
|
});
|
|
73
76
|
});
|
|
74
77
|
}, [column, colIndex, rowIndex]);
|
|
75
|
-
return ___EmotionJSX("div", {
|
|
78
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", {
|
|
76
79
|
className: "euiDataGridRowCell__actions"
|
|
77
|
-
}, [].concat(_toConsumableArray(additionalButtons), [expandButton]))
|
|
80
|
+
}, [].concat(_toConsumableArray(additionalButtons), [expandButton])), ___EmotionJSX("div", {
|
|
81
|
+
ref: popoverAnchorRef,
|
|
82
|
+
"data-test-subject": "cellPopoverAnchor"
|
|
83
|
+
}));
|
|
78
84
|
};
|
|
79
85
|
export var EuiDataGridCellPopoverActions = function EuiDataGridCellPopoverActions(_ref2) {
|
|
80
86
|
var rowIndex = _ref2.rowIndex,
|
|
@@ -11,7 +11,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
11
|
* Side Public License, v 1.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import React, { createContext, useState, useCallback } from 'react';
|
|
14
|
+
import React, { createContext, useState, useCallback, useMemo } from 'react';
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import { keys } from '../../../../services';
|
|
17
17
|
import { EuiWrappingPopover } from '../../../popover';
|
|
@@ -29,7 +29,6 @@ export var DataGridCellPopoverContext = /*#__PURE__*/createContext({
|
|
|
29
29
|
setCellPopoverProps: function setCellPopoverProps() {}
|
|
30
30
|
});
|
|
31
31
|
export var useCellPopover = function useCellPopover() {
|
|
32
|
-
var _cellPopoverProps$pan;
|
|
33
32
|
// Current open state & cell location are handled here
|
|
34
33
|
var _useState = useState(false),
|
|
35
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -80,16 +79,6 @@ export var useCellPopover = function useCellPopover() {
|
|
|
80
79
|
});
|
|
81
80
|
setPopoverIsOpen(true);
|
|
82
81
|
}, [popoverIsOpen, cellLocation]);
|
|
83
|
-
var cellPopoverContext = {
|
|
84
|
-
popoverIsOpen: popoverIsOpen,
|
|
85
|
-
closeCellPopover: closeCellPopover,
|
|
86
|
-
openCellPopover: openCellPopover,
|
|
87
|
-
cellLocation: cellLocation,
|
|
88
|
-
setPopoverAnchor: setPopoverAnchor,
|
|
89
|
-
setPopoverAnchorPosition: setPopoverAnchorPosition,
|
|
90
|
-
setPopoverContent: setPopoverContent,
|
|
91
|
-
setCellPopoverProps: setCellPopoverProps
|
|
92
|
-
};
|
|
93
82
|
|
|
94
83
|
// Override the default EuiPopover `onClickOutside` behavior, since the toggling
|
|
95
84
|
// popover button isn't actually the DOM node we pass to `button`. Otherwise,
|
|
@@ -101,52 +90,71 @@ export var useCellPopover = function useCellPopover() {
|
|
|
101
90
|
closeCellPopover();
|
|
102
91
|
}
|
|
103
92
|
}, [popoverAnchor, closeCellPopover]);
|
|
93
|
+
var onKeyDown = useCallback(function (event) {
|
|
94
|
+
if (event.key === keys.F2 || event.key === keys.ESCAPE) {
|
|
95
|
+
var _popoverAnchor$parent3, _popoverAnchor$parent4;
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
event.stopPropagation();
|
|
98
|
+
closeCellPopover();
|
|
99
|
+
var cell = popoverAnchor === null || popoverAnchor === void 0 ? void 0 : (_popoverAnchor$parent3 = popoverAnchor.parentElement) === null || _popoverAnchor$parent3 === void 0 ? void 0 : (_popoverAnchor$parent4 = _popoverAnchor$parent3.parentElement) === null || _popoverAnchor$parent4 === void 0 ? void 0 : _popoverAnchor$parent4.parentElement;
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
event.preventDefault();
|
|
130
|
-
event.stopPropagation();
|
|
131
|
-
closeCellPopover();
|
|
132
|
-
var cell = (_popoverAnchor$parent3 = popoverAnchor.parentElement) === null || _popoverAnchor$parent3 === void 0 ? void 0 : (_popoverAnchor$parent4 = _popoverAnchor$parent3.parentElement) === null || _popoverAnchor$parent4 === void 0 ? void 0 : _popoverAnchor$parent4.parentElement;
|
|
101
|
+
// Prevent cell animation flash while focus is being shifted between popover and cell
|
|
102
|
+
cell === null || cell === void 0 ? void 0 : cell.setAttribute('data-keyboard-closing', 'true');
|
|
103
|
+
// Ensure focus is returned to the parent cell, and remove animation stopgap
|
|
104
|
+
requestAnimationFrame(function () {
|
|
105
|
+
popoverAnchor === null || popoverAnchor === void 0 ? void 0 : popoverAnchor.parentElement.focus();
|
|
106
|
+
cell === null || cell === void 0 ? void 0 : cell.removeAttribute('data-keyboard-closing');
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, [popoverAnchor, closeCellPopover]);
|
|
110
|
+
var cellPopoverContext = useMemo(function () {
|
|
111
|
+
return {
|
|
112
|
+
popoverIsOpen: popoverIsOpen,
|
|
113
|
+
closeCellPopover: closeCellPopover,
|
|
114
|
+
openCellPopover: openCellPopover,
|
|
115
|
+
cellLocation: cellLocation,
|
|
116
|
+
setPopoverAnchorPosition: setPopoverAnchorPosition,
|
|
117
|
+
setPopoverAnchor: setPopoverAnchor,
|
|
118
|
+
setPopoverContent: setPopoverContent,
|
|
119
|
+
setCellPopoverProps: setCellPopoverProps
|
|
120
|
+
};
|
|
121
|
+
}, [popoverIsOpen, closeCellPopover, openCellPopover, cellLocation]);
|
|
122
|
+
var cellPopover = useMemo(function () {
|
|
123
|
+
var _cellPopoverProps$pan;
|
|
124
|
+
if (!popoverIsOpen || !popoverAnchor) return null;
|
|
133
125
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
126
|
+
// Note that this popover is rendered once at the top grid level, rather than one popover per cell
|
|
127
|
+
return ___EmotionJSX(EuiWrappingPopover, _extends({
|
|
128
|
+
isOpen: popoverIsOpen,
|
|
129
|
+
display: "block",
|
|
130
|
+
hasArrow: false,
|
|
131
|
+
panelPaddingSize: "s",
|
|
132
|
+
anchorPosition: popoverAnchorPosition,
|
|
133
|
+
repositionToCrossAxis: false
|
|
134
|
+
}, cellPopoverProps, {
|
|
135
|
+
focusTrapProps: {
|
|
136
|
+
onClickOutside: onClickOutside,
|
|
137
|
+
clickOutsideDisables: false
|
|
138
|
+
},
|
|
139
|
+
panelProps: _objectSpread({
|
|
140
|
+
'data-test-subj': 'euiDataGridExpansionPopover'
|
|
141
|
+
}, cellPopoverProps.panelProps || {}),
|
|
142
|
+
panelClassName: classNames('euiDataGridRowCell__popover', cellPopoverProps.panelClassName, (_cellPopoverProps$pan = cellPopoverProps.panelProps) === null || _cellPopoverProps$pan === void 0 ? void 0 : _cellPopoverProps$pan.className),
|
|
143
|
+
panelStyle: {
|
|
144
|
+
maxInlineSize: "min(75vw, max(".concat(popoverAnchor.parentElement.offsetWidth, "px, 400px))"),
|
|
145
|
+
maxBlockSize: '50vh'
|
|
146
|
+
},
|
|
147
|
+
onKeyDown: onKeyDown,
|
|
148
|
+
button: popoverAnchor,
|
|
149
|
+
closePopover: closeCellPopover
|
|
150
|
+
}), popoverContent);
|
|
151
|
+
}, [popoverIsOpen, popoverAnchor, popoverContent, cellPopoverProps, closeCellPopover, onClickOutside, onKeyDown, popoverAnchorPosition]);
|
|
152
|
+
return useMemo(function () {
|
|
153
|
+
return {
|
|
154
|
+
cellPopoverContext: cellPopoverContext,
|
|
155
|
+
cellPopover: cellPopover
|
|
156
|
+
};
|
|
157
|
+
}, [cellPopoverContext, cellPopover]);
|
|
150
158
|
};
|
|
151
159
|
|
|
152
160
|
/**
|
|
@@ -10,9 +10,9 @@ var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetect
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import React, { useContext, useMemo } from 'react';
|
|
13
|
+
import React, { useContext, useMemo, memo } from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
-
import {
|
|
15
|
+
import { DataGridSortedContext } from '../../utils/sorting';
|
|
16
16
|
import { DataGridCellPopoverContext } from './data_grid_cell_popover';
|
|
17
17
|
import { EuiDataGridCell } from './data_grid_cell';
|
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -21,7 +21,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
21
21
|
* It grabs context, determines the type of cell being rendered
|
|
22
22
|
* (e.g. control vs data cell), & sets shared props between all cells
|
|
23
23
|
*/
|
|
24
|
-
export var
|
|
24
|
+
export var CellWrapper = /*#__PURE__*/memo(function (_ref) {
|
|
25
25
|
var colIndex = _ref.colIndex,
|
|
26
26
|
visibleRowIndex = _ref.visibleRowIndex,
|
|
27
27
|
style = _ref.style,
|
|
@@ -44,9 +44,8 @@ export var Cell = function Cell(_ref) {
|
|
|
44
44
|
rowManager = _ref.rowManager,
|
|
45
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
46
|
var popoverContext = useContext(DataGridCellPopoverContext);
|
|
47
|
-
var _useContext = useContext(
|
|
47
|
+
var _useContext = useContext(DataGridSortedContext),
|
|
48
48
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
49
|
-
var cellContent;
|
|
50
49
|
var isFirstColumn = colIndex === 0;
|
|
51
50
|
var isLastColumn = colIndex === visibleColCount - 1;
|
|
52
51
|
var isLeadingControlColumn = colIndex < leadingControlColumns.length;
|
|
@@ -60,31 +59,33 @@ export var Cell = function Cell(_ref) {
|
|
|
60
59
|
return column !== null && column !== void 0 && column.schema ? (column === null || column === void 0 ? void 0 : column.schema) === row.type : columnId === row.type;
|
|
61
60
|
})[0]) === null || _schemaDetectors$filt === void 0 ? void 0 : _schemaDetectors$filt.textTransform;
|
|
62
61
|
}, [columnId, column === null || column === void 0 ? void 0 : column.schema, schemaDetectors]);
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
62
|
+
var sharedCellProps = useMemo(function () {
|
|
63
|
+
var classes = classNames(_defineProperty({
|
|
64
|
+
'euiDataGridRowCell--firstColumn': isFirstColumn,
|
|
65
|
+
'euiDataGridRowCell--lastColumn': isLastColumn,
|
|
66
|
+
'euiDataGridRowCell--controlColumn': isLeadingControlColumn || isTrailingControlColumn
|
|
67
|
+
}, "euiDataGridRowCell--".concat(textTransform), textTransform));
|
|
68
|
+
return {
|
|
69
|
+
rowIndex: getCorrectRowIndex(visibleRowIndex),
|
|
70
|
+
visibleRowIndex: visibleRowIndex,
|
|
71
|
+
colIndex: colIndex,
|
|
72
|
+
interactiveCellId: interactiveCellId,
|
|
73
|
+
className: classes,
|
|
74
|
+
style: style,
|
|
75
|
+
rowHeightsOptions: rowHeightsOptions,
|
|
76
|
+
rowHeightUtils: rowHeightUtils,
|
|
77
|
+
setRowHeight: isFirstColumn ? setRowHeight : undefined,
|
|
78
|
+
rowManager: rowManager,
|
|
79
|
+
popoverContext: popoverContext,
|
|
80
|
+
pagination: pagination,
|
|
81
|
+
cellContext: cellContext
|
|
82
|
+
};
|
|
83
|
+
}, [colIndex, setRowHeight, visibleRowIndex, getCorrectRowIndex, interactiveCellId, style, rowHeightsOptions, rowHeightUtils, rowManager, popoverContext, pagination, cellContext, isFirstColumn, isLastColumn, isLeadingControlColumn, isTrailingControlColumn, textTransform]);
|
|
83
84
|
if (isLeadingControlColumn) {
|
|
84
85
|
var leadingColumn = leadingControlColumns[colIndex];
|
|
85
86
|
var id = leadingColumn.id,
|
|
86
87
|
rowCellRender = leadingColumn.rowCellRender;
|
|
87
|
-
|
|
88
|
+
return ___EmotionJSX(EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
88
89
|
columnId: id,
|
|
89
90
|
width: leadingColumn.width,
|
|
90
91
|
renderCellValue: rowCellRender,
|
|
@@ -96,7 +97,7 @@ export var Cell = function Cell(_ref) {
|
|
|
96
97
|
var trailingColumn = trailingControlColumns[trailingcolIndex];
|
|
97
98
|
var _id = trailingColumn.id,
|
|
98
99
|
_rowCellRender = trailingColumn.rowCellRender;
|
|
99
|
-
|
|
100
|
+
return ___EmotionJSX(EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
100
101
|
columnId: _id,
|
|
101
102
|
width: trailingColumn.width,
|
|
102
103
|
renderCellValue: _rowCellRender,
|
|
@@ -105,9 +106,9 @@ export var Cell = function Cell(_ref) {
|
|
|
105
106
|
} else {
|
|
106
107
|
// this is a normal data cell
|
|
107
108
|
var columnType = schema[columnId] ? schema[columnId].columnType : null;
|
|
108
|
-
var isExpandable = column.isExpandable !== undefined ? column.isExpandable : true;
|
|
109
|
+
var isExpandable = (column === null || column === void 0 ? void 0 : column.isExpandable) !== undefined ? column === null || column === void 0 ? void 0 : column.isExpandable : true;
|
|
109
110
|
var width = columnWidths[columnId] || defaultColumnWidth;
|
|
110
|
-
|
|
111
|
+
return ___EmotionJSX(EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
111
112
|
columnId: columnId,
|
|
112
113
|
column: column,
|
|
113
114
|
columnType: columnType,
|
|
@@ -118,5 +119,5 @@ export var Cell = function Cell(_ref) {
|
|
|
118
119
|
isExpandable: isExpandable
|
|
119
120
|
}, rest));
|
|
120
121
|
}
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
});
|
|
123
|
+
CellWrapper.displayName = 'CellWrapper';
|