@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
|
@@ -20,29 +20,30 @@ import { useDefaultColumnWidth, useColumnWidths } from '../utils/col_widths';
|
|
|
20
20
|
import { useRowHeightUtils, useDefaultRowHeight } from '../utils/row_heights';
|
|
21
21
|
import { useDataGridHeader } from './header';
|
|
22
22
|
import { useDataGridFooter } from './footer';
|
|
23
|
-
import {
|
|
23
|
+
import { CellWrapper } from './cell';
|
|
24
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
25
|
export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
|
|
26
26
|
var renderCustomGridBody = _ref.renderCustomGridBody,
|
|
27
|
-
leadingControlColumns = _ref.leadingControlColumns,
|
|
28
|
-
trailingControlColumns = _ref.trailingControlColumns,
|
|
29
|
-
columns = _ref.columns,
|
|
30
|
-
visibleColCount = _ref.visibleColCount,
|
|
31
|
-
schema = _ref.schema,
|
|
32
|
-
schemaDetectors = _ref.schemaDetectors,
|
|
33
|
-
visibleRows = _ref.visibleRows,
|
|
34
27
|
renderCellValue = _ref.renderCellValue,
|
|
35
28
|
cellContext = _ref.cellContext,
|
|
36
29
|
renderCellPopover = _ref.renderCellPopover,
|
|
37
30
|
renderFooterCellValue = _ref.renderFooterCellValue,
|
|
38
31
|
interactiveCellId = _ref.interactiveCellId,
|
|
32
|
+
visibleRows = _ref.visibleRows,
|
|
33
|
+
visibleColCount = _ref.visibleColCount,
|
|
34
|
+
leadingControlColumns = _ref.leadingControlColumns,
|
|
35
|
+
trailingControlColumns = _ref.trailingControlColumns,
|
|
36
|
+
columns = _ref.columns,
|
|
39
37
|
setVisibleColumns = _ref.setVisibleColumns,
|
|
40
38
|
switchColumnPos = _ref.switchColumnPos,
|
|
41
39
|
onColumnResize = _ref.onColumnResize,
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
schema = _ref.schema,
|
|
41
|
+
schemaDetectors = _ref.schemaDetectors,
|
|
42
|
+
sorting = _ref.sorting,
|
|
44
43
|
pagination = _ref.pagination,
|
|
45
|
-
rowHeightsOptions = _ref.rowHeightsOptions
|
|
44
|
+
rowHeightsOptions = _ref.rowHeightsOptions,
|
|
45
|
+
gridWidth = _ref.gridWidth,
|
|
46
|
+
gridStyles = _ref.gridStyles;
|
|
46
47
|
/**
|
|
47
48
|
* Columns & widths
|
|
48
49
|
*/
|
|
@@ -81,14 +82,15 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
81
82
|
* Header & footer
|
|
82
83
|
*/
|
|
83
84
|
var _useDataGridHeader = useDataGridHeader({
|
|
84
|
-
switchColumnPos: switchColumnPos,
|
|
85
|
-
setVisibleColumns: setVisibleColumns,
|
|
86
85
|
leadingControlColumns: leadingControlColumns,
|
|
87
86
|
trailingControlColumns: trailingControlColumns,
|
|
88
87
|
columns: columns,
|
|
89
88
|
columnWidths: columnWidths,
|
|
90
89
|
defaultColumnWidth: defaultColumnWidth,
|
|
91
90
|
setColumnWidth: setColumnWidth,
|
|
91
|
+
setVisibleColumns: setVisibleColumns,
|
|
92
|
+
switchColumnPos: switchColumnPos,
|
|
93
|
+
sorting: sorting,
|
|
92
94
|
schema: schema,
|
|
93
95
|
schemaDetectors: schemaDetectors
|
|
94
96
|
}),
|
|
@@ -111,25 +113,27 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
111
113
|
/**
|
|
112
114
|
* Cell render fn
|
|
113
115
|
*/
|
|
114
|
-
var cellProps = {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
116
|
+
var cellProps = useMemo(function () {
|
|
117
|
+
return {
|
|
118
|
+
schema: schema,
|
|
119
|
+
schemaDetectors: schemaDetectors,
|
|
120
|
+
pagination: pagination,
|
|
121
|
+
columns: columns,
|
|
122
|
+
leadingControlColumns: leadingControlColumns,
|
|
123
|
+
trailingControlColumns: trailingControlColumns,
|
|
124
|
+
visibleColCount: visibleColCount,
|
|
125
|
+
columnWidths: columnWidths,
|
|
126
|
+
defaultColumnWidth: defaultColumnWidth,
|
|
127
|
+
renderCellValue: renderCellValue,
|
|
128
|
+
cellContext: cellContext,
|
|
129
|
+
renderCellPopover: renderCellPopover,
|
|
130
|
+
interactiveCellId: interactiveCellId,
|
|
131
|
+
setRowHeight: setRowHeight,
|
|
132
|
+
rowHeightsOptions: rowHeightsOptions,
|
|
133
|
+
rowHeightUtils: rowHeightUtils
|
|
134
|
+
};
|
|
135
|
+
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils]);
|
|
136
|
+
var Cell = useCallback(function (_ref2) {
|
|
133
137
|
var colIndex = _ref2.colIndex,
|
|
134
138
|
visibleRowIndex = _ref2.visibleRowIndex,
|
|
135
139
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -141,9 +145,8 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
141
145
|
visibleRowIndex: visibleRowIndex,
|
|
142
146
|
style: style
|
|
143
147
|
}, cellProps);
|
|
144
|
-
return ___EmotionJSX(
|
|
145
|
-
}, [
|
|
146
|
-
);
|
|
148
|
+
return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
|
|
149
|
+
}, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
|
|
147
150
|
|
|
148
151
|
// Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
|
|
149
152
|
var _useState = useState({}),
|
|
@@ -155,7 +158,7 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
155
158
|
}), headerRow, renderCustomGridBody({
|
|
156
159
|
visibleColumns: visibleColumns,
|
|
157
160
|
visibleRowData: visibleRows,
|
|
158
|
-
Cell:
|
|
161
|
+
Cell: Cell,
|
|
159
162
|
setCustomGridBodyProps: setCustomGridBodyProps
|
|
160
163
|
}), footerRow);
|
|
161
164
|
};
|
|
@@ -13,12 +13,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import classNames from 'classnames';
|
|
16
|
-
import React, { forwardRef, createContext, useContext, useEffect, useRef } from 'react';
|
|
16
|
+
import React, { forwardRef, createContext, useCallback, useContext, useEffect, useRef, useMemo, memo } from 'react';
|
|
17
17
|
import { VariableSizeGrid as Grid } from 'react-window';
|
|
18
|
+
import { useDeepEqual } from '../../../services';
|
|
18
19
|
import { useResizeObserver } from '../../observer/resize_observer';
|
|
19
20
|
import { useDataGridHeader } from './header';
|
|
20
21
|
import { useDataGridFooter } from './footer';
|
|
21
|
-
import {
|
|
22
|
+
import { CellWrapper } from './cell';
|
|
22
23
|
import { useRowManager } from './data_grid_row_manager';
|
|
23
24
|
import { useFinalGridDimensions, useUnconstrainedHeight, useVirtualizeContainerWidth } from '../utils/grid_height_width';
|
|
24
25
|
import { useDefaultColumnWidth, useColumnWidths } from '../utils/col_widths';
|
|
@@ -26,21 +27,25 @@ import { useRowHeightUtils, useDefaultRowHeight } from '../utils/row_heights';
|
|
|
26
27
|
import { useScrollBars, useScroll } from '../utils/scrolling';
|
|
27
28
|
import { IS_JEST_ENVIRONMENT } from '../../../utils';
|
|
28
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
|
-
export var
|
|
30
|
+
export var Cell = /*#__PURE__*/memo(function (_ref) {
|
|
30
31
|
var columnIndex = _ref.columnIndex,
|
|
31
32
|
rowIndex = _ref.rowIndex,
|
|
32
33
|
style = _ref.style,
|
|
33
34
|
data = _ref.data;
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
var memoizedStyles = useDeepEqual(style);
|
|
36
|
+
var cellStyles = useMemo(function () {
|
|
37
|
+
var headerRowHeight = data.headerRowHeight;
|
|
38
|
+
return _objectSpread(_objectSpread({}, memoizedStyles), {}, {
|
|
39
|
+
top: "".concat(parseFloat(memoizedStyles.top) + headerRowHeight, "px")
|
|
40
|
+
});
|
|
41
|
+
}, [memoizedStyles, data]);
|
|
42
|
+
return ___EmotionJSX(CellWrapper, _extends({
|
|
37
43
|
colIndex: columnIndex,
|
|
38
44
|
visibleRowIndex: rowIndex,
|
|
39
|
-
style:
|
|
40
|
-
top: "".concat(parseFloat(style.top) + headerRowHeight, "px")
|
|
41
|
-
})
|
|
45
|
+
style: cellStyles
|
|
42
46
|
}, data));
|
|
43
|
-
};
|
|
47
|
+
});
|
|
48
|
+
Cell.displayName = 'Cell';
|
|
44
49
|
|
|
45
50
|
// Context is required to pass props to react-window's innerElementType
|
|
46
51
|
// @see https://github.com/bvaughn/react-window/issues/404
|
|
@@ -49,23 +54,27 @@ export var DataGridWrapperRowsContext = /*#__PURE__*/createContext({
|
|
|
49
54
|
headerRowHeight: 0,
|
|
50
55
|
footerRow: null
|
|
51
56
|
});
|
|
52
|
-
var InnerElement = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
57
|
+
var InnerElement = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
53
58
|
var children = _ref2.children,
|
|
54
59
|
style = _ref2.style,
|
|
55
60
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
56
|
-
var
|
|
57
|
-
headerRowHeight =
|
|
58
|
-
headerRow =
|
|
59
|
-
footerRow =
|
|
61
|
+
var _useContext = useContext(DataGridWrapperRowsContext),
|
|
62
|
+
headerRowHeight = _useContext.headerRowHeight,
|
|
63
|
+
headerRow = _useContext.headerRow,
|
|
64
|
+
footerRow = _useContext.footerRow;
|
|
65
|
+
var memoizedStyles = useDeepEqual(style);
|
|
66
|
+
var innerElementStyles = useMemo(function () {
|
|
67
|
+
return _objectSpread(_objectSpread({}, memoizedStyles), {}, {
|
|
68
|
+
height: memoizedStyles.height + headerRowHeight
|
|
69
|
+
});
|
|
70
|
+
}, [memoizedStyles, headerRowHeight]);
|
|
60
71
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", _extends({
|
|
61
72
|
ref: ref,
|
|
62
|
-
style:
|
|
63
|
-
height: style.height + headerRowHeight
|
|
64
|
-
})
|
|
73
|
+
style: innerElementStyles
|
|
65
74
|
}, rest), headerRow, children), footerRow);
|
|
66
|
-
});
|
|
75
|
+
}));
|
|
67
76
|
InnerElement.displayName = 'EuiDataGridInnerElement';
|
|
68
|
-
export var EuiDataGridBodyVirtualized = function
|
|
77
|
+
export var EuiDataGridBodyVirtualized = /*#__PURE__*/memo(function (_ref3) {
|
|
69
78
|
var leadingControlColumns = _ref3.leadingControlColumns,
|
|
70
79
|
trailingControlColumns = _ref3.trailingControlColumns,
|
|
71
80
|
columns = _ref3.columns,
|
|
@@ -83,6 +92,7 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
83
92
|
renderFooterCellValue = _ref3.renderFooterCellValue,
|
|
84
93
|
interactiveCellId = _ref3.interactiveCellId,
|
|
85
94
|
pagination = _ref3.pagination,
|
|
95
|
+
sorting = _ref3.sorting,
|
|
86
96
|
setVisibleColumns = _ref3.setVisibleColumns,
|
|
87
97
|
switchColumnPos = _ref3.switchColumnPos,
|
|
88
98
|
onColumnResize = _ref3.onColumnResize,
|
|
@@ -132,14 +142,15 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
132
142
|
* Header & footer
|
|
133
143
|
*/
|
|
134
144
|
var _useDataGridHeader = useDataGridHeader({
|
|
135
|
-
switchColumnPos: switchColumnPos,
|
|
136
|
-
setVisibleColumns: setVisibleColumns,
|
|
137
145
|
leadingControlColumns: leadingControlColumns,
|
|
138
146
|
trailingControlColumns: trailingControlColumns,
|
|
139
147
|
columns: columns,
|
|
140
148
|
columnWidths: columnWidths,
|
|
141
149
|
defaultColumnWidth: defaultColumnWidth,
|
|
142
150
|
setColumnWidth: setColumnWidth,
|
|
151
|
+
setVisibleColumns: setVisibleColumns,
|
|
152
|
+
switchColumnPos: switchColumnPos,
|
|
153
|
+
sorting: sorting,
|
|
143
154
|
schema: schema,
|
|
144
155
|
schemaDetectors: schemaDetectors
|
|
145
156
|
}),
|
|
@@ -247,29 +258,13 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
247
258
|
gridRef.current.resetAfterRowIndex(0);
|
|
248
259
|
}
|
|
249
260
|
}, [gridRef, getRowHeight]);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
ref: gridRef,
|
|
258
|
-
className: classNames('euiDataGrid__virtualized', virtualizationOptions === null || virtualizationOptions === void 0 ? void 0 : virtualizationOptions.className),
|
|
259
|
-
onItemsRendered: function onItemsRendered(itemsRendered) {
|
|
260
|
-
var _virtualizationOption;
|
|
261
|
-
gridItemsRendered.current = itemsRendered;
|
|
262
|
-
virtualizationOptions === null || virtualizationOptions === void 0 ? void 0 : (_virtualizationOption = virtualizationOptions.onItemsRendered) === null || _virtualizationOption === void 0 ? void 0 : _virtualizationOption.call(virtualizationOptions, itemsRendered);
|
|
263
|
-
},
|
|
264
|
-
innerElementType: InnerElement,
|
|
265
|
-
outerRef: outerGridRef,
|
|
266
|
-
innerRef: innerGridRef,
|
|
267
|
-
columnCount: visibleColCount,
|
|
268
|
-
width: finalWidth,
|
|
269
|
-
columnWidth: getColumnWidth,
|
|
270
|
-
height: finalHeight,
|
|
271
|
-
rowHeight: getRowHeight,
|
|
272
|
-
itemData: {
|
|
261
|
+
var onItemsRendered = useCallback(function (itemsRendered) {
|
|
262
|
+
var _virtualizationOption;
|
|
263
|
+
gridItemsRendered.current = itemsRendered;
|
|
264
|
+
virtualizationOptions === null || virtualizationOptions === void 0 ? void 0 : (_virtualizationOption = virtualizationOptions.onItemsRendered) === null || _virtualizationOption === void 0 ? void 0 : _virtualizationOption.call(virtualizationOptions, itemsRendered);
|
|
265
|
+
}, [gridItemsRendered, virtualizationOptions]);
|
|
266
|
+
var itemData = useMemo(function () {
|
|
267
|
+
return {
|
|
273
268
|
schemaDetectors: schemaDetectors,
|
|
274
269
|
setRowHeight: setRowHeight,
|
|
275
270
|
leadingControlColumns: leadingControlColumns,
|
|
@@ -286,8 +281,33 @@ export var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref
|
|
|
286
281
|
rowHeightsOptions: rowHeightsOptions,
|
|
287
282
|
rowHeightUtils: rowHeightUtils,
|
|
288
283
|
rowManager: rowManager,
|
|
289
|
-
pagination: pagination
|
|
290
|
-
|
|
284
|
+
pagination: pagination,
|
|
285
|
+
headerRowHeight: headerRowHeight
|
|
286
|
+
};
|
|
287
|
+
}, [schemaDetectors, setRowHeight, leadingControlColumns, trailingControlColumns, columns, visibleColCount, schema, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, rowHeightsOptions, rowHeightUtils, rowManager, pagination, headerRowHeight]);
|
|
288
|
+
var rowWrapperContextValue = useMemo(function () {
|
|
289
|
+
return {
|
|
290
|
+
headerRowHeight: headerRowHeight,
|
|
291
|
+
headerRow: headerRow,
|
|
292
|
+
footerRow: footerRow
|
|
293
|
+
};
|
|
294
|
+
}, [headerRowHeight, headerRow, footerRow]);
|
|
295
|
+
return IS_JEST_ENVIRONMENT || finalWidth > 0 ? ___EmotionJSX(DataGridWrapperRowsContext.Provider, {
|
|
296
|
+
value: rowWrapperContextValue
|
|
297
|
+
}, ___EmotionJSX(Grid, _extends({}, virtualizationOptions, {
|
|
298
|
+
ref: gridRef,
|
|
299
|
+
className: classNames('euiDataGrid__virtualized', virtualizationOptions === null || virtualizationOptions === void 0 ? void 0 : virtualizationOptions.className),
|
|
300
|
+
onItemsRendered: onItemsRendered,
|
|
301
|
+
innerElementType: InnerElement,
|
|
302
|
+
outerRef: outerGridRef,
|
|
303
|
+
innerRef: innerGridRef,
|
|
304
|
+
columnCount: visibleColCount,
|
|
305
|
+
width: finalWidth,
|
|
306
|
+
columnWidth: getColumnWidth,
|
|
307
|
+
height: finalHeight,
|
|
308
|
+
rowHeight: getRowHeight,
|
|
309
|
+
itemData: itemData,
|
|
291
310
|
rowCount: IS_JEST_ENVIRONMENT || headerRowHeight > 0 ? visibleRowCount : 0
|
|
292
|
-
}),
|
|
293
|
-
};
|
|
311
|
+
}), Cell), scrollBorderOverlay) : null;
|
|
312
|
+
});
|
|
313
|
+
EuiDataGridBodyVirtualized.displayName = 'EuiDataGridBodyVirtualized';
|
|
@@ -7,7 +7,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { useRef, useCallback } from 'react';
|
|
10
|
+
import { useRef, useCallback, useMemo } from 'react';
|
|
11
11
|
import { useUpdateEffect } from '../../../services';
|
|
12
12
|
export var useRowManager = function useRowManager(_ref) {
|
|
13
13
|
var innerGridRef = _ref.innerGridRef,
|
|
@@ -88,7 +88,9 @@ export var useRowManager = function useRowManager(_ref) {
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
}, [rowClasses]);
|
|
91
|
-
return {
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
return useMemo(function () {
|
|
92
|
+
return {
|
|
93
|
+
getRow: getRow
|
|
94
|
+
};
|
|
95
|
+
}, [getRow]);
|
|
94
96
|
};
|
|
@@ -32,8 +32,7 @@ export var useDataGridFooter = function useDataGridFooter(props) {
|
|
|
32
32
|
ref: setFooterRowRef,
|
|
33
33
|
renderCellValue: renderFooterCellValue
|
|
34
34
|
}, footerProps));
|
|
35
|
-
},
|
|
36
|
-
|
|
35
|
+
}, [props]);
|
|
37
36
|
return {
|
|
38
37
|
footerRow: footerRow,
|
|
39
38
|
footerRowHeight: footerRowHeight
|
|
@@ -7,11 +7,11 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
7
7
|
* Side Public License, v 1.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import React from 'react';
|
|
10
|
+
import React, { memo } from 'react';
|
|
11
11
|
import classNames from 'classnames';
|
|
12
12
|
import { EuiDataGridHeaderCellWrapper } from './data_grid_header_cell_wrapper';
|
|
13
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
-
export var EuiDataGridControlHeaderCell = function
|
|
14
|
+
export var EuiDataGridControlHeaderCell = /*#__PURE__*/memo(function (_ref) {
|
|
15
15
|
var controlColumn = _ref.controlColumn,
|
|
16
16
|
index = _ref.index;
|
|
17
17
|
var HeaderCellRender = controlColumn.headerCellRender,
|
|
@@ -26,4 +26,5 @@ export var EuiDataGridControlHeaderCell = function EuiDataGridControlHeaderCell(
|
|
|
26
26
|
}), ___EmotionJSX("div", {
|
|
27
27
|
className: "euiDataGridHeaderCell__content"
|
|
28
28
|
}, ___EmotionJSX(HeaderCellRender, null)));
|
|
29
|
-
};
|
|
29
|
+
});
|
|
30
|
+
EuiDataGridControlHeaderCell.displayName = 'EuiDataGridControlHeaderCell';
|
|
@@ -11,7 +11,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import classnames from 'classnames';
|
|
14
|
-
import React, { useContext, useState, useRef, useCallback, useMemo } from 'react';
|
|
14
|
+
import React, { useContext, useState, useRef, useCallback, useMemo, memo } from 'react';
|
|
15
15
|
import { tabbable } from 'tabbable';
|
|
16
16
|
import { keys } from '../../../../services';
|
|
17
17
|
import { useGeneratedHtmlId } from '../../../../services/accessibility';
|
|
@@ -20,13 +20,21 @@ import { EuiI18n } from '../../../i18n';
|
|
|
20
20
|
import { EuiIcon } from '../../../icon';
|
|
21
21
|
import { EuiListGroup } from '../../../list_group';
|
|
22
22
|
import { EuiPopover } from '../../../popover';
|
|
23
|
-
import { DataGridSortingContext } from '../../utils/sorting';
|
|
24
23
|
import { DataGridFocusContext } from '../../utils/focus';
|
|
25
24
|
import { getColumnActions } from './column_actions';
|
|
26
25
|
import { EuiDataGridColumnResizer } from './data_grid_column_resizer';
|
|
27
26
|
import { EuiDataGridHeaderCellWrapper } from './data_grid_header_cell_wrapper';
|
|
28
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
|
-
var
|
|
28
|
+
var CellContent = function CellContent(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
title = _ref.title,
|
|
31
|
+
arrow = _ref.arrow;
|
|
32
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", {
|
|
33
|
+
title: title,
|
|
34
|
+
className: "euiDataGridHeaderCell__content"
|
|
35
|
+
}, children), arrow);
|
|
36
|
+
};
|
|
37
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
30
38
|
name: "mc0thx-EuiDataGridHeaderCell",
|
|
31
39
|
styles: "margin-inline-start:auto;label:EuiDataGridHeaderCell;"
|
|
32
40
|
} : {
|
|
@@ -34,18 +42,19 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
34
42
|
styles: "margin-inline-start:auto;label:EuiDataGridHeaderCell;",
|
|
35
43
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
36
44
|
};
|
|
37
|
-
export var EuiDataGridHeaderCell = function
|
|
45
|
+
export var EuiDataGridHeaderCell = /*#__PURE__*/memo(function (_ref2) {
|
|
38
46
|
var _classnames;
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
columns =
|
|
42
|
-
columnWidths =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
var index = _ref2.index,
|
|
48
|
+
column = _ref2.column,
|
|
49
|
+
columns = _ref2.columns,
|
|
50
|
+
columnWidths = _ref2.columnWidths,
|
|
51
|
+
defaultColumnWidth = _ref2.defaultColumnWidth,
|
|
52
|
+
setColumnWidth = _ref2.setColumnWidth,
|
|
53
|
+
setVisibleColumns = _ref2.setVisibleColumns,
|
|
54
|
+
switchColumnPos = _ref2.switchColumnPos,
|
|
55
|
+
sorting = _ref2.sorting,
|
|
56
|
+
schema = _ref2.schema,
|
|
57
|
+
schemaDetectors = _ref2.schemaDetectors;
|
|
49
58
|
var id = column.id,
|
|
50
59
|
display = column.display,
|
|
51
60
|
displayAsText = column.displayAsText,
|
|
@@ -55,25 +64,25 @@ export var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
|
|
|
55
64
|
var _useContext = useContext(DataGridFocusContext),
|
|
56
65
|
setFocusedCell = _useContext.setFocusedCell,
|
|
57
66
|
focusFirstVisibleInteractiveCell = _useContext.focusFirstVisibleInteractiveCell;
|
|
58
|
-
var _useContext2 = useContext(DataGridSortingContext),
|
|
59
|
-
sorting = _useContext2.sorting;
|
|
60
67
|
var _useState = useState(false),
|
|
61
68
|
_useState2 = _slicedToArray(_useState, 2),
|
|
62
69
|
isPopoverOpen = _useState2[0],
|
|
63
70
|
setIsPopoverOpen = _useState2[1];
|
|
64
71
|
var popoverArrowNavigationProps = usePopoverArrowNavigation();
|
|
65
|
-
var columnActions =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
var columnActions = useMemo(function () {
|
|
73
|
+
return getColumnActions({
|
|
74
|
+
column: column,
|
|
75
|
+
columns: columns,
|
|
76
|
+
schema: schema,
|
|
77
|
+
schemaDetectors: schemaDetectors,
|
|
78
|
+
setVisibleColumns: setVisibleColumns,
|
|
79
|
+
focusFirstVisibleInteractiveCell: focusFirstVisibleInteractiveCell,
|
|
80
|
+
setIsPopoverOpen: setIsPopoverOpen,
|
|
81
|
+
sorting: sorting,
|
|
82
|
+
switchColumnPos: switchColumnPos,
|
|
83
|
+
setFocusedCell: setFocusedCell
|
|
84
|
+
});
|
|
85
|
+
}, [column, columns, schema, schemaDetectors, setVisibleColumns, focusFirstVisibleInteractiveCell, setIsPopoverOpen, sorting, switchColumnPos, setFocusedCell]);
|
|
77
86
|
var showColumnActions = columnActions && columnActions.length > 0;
|
|
78
87
|
var actionsButtonRef = useRef(null);
|
|
79
88
|
var focusActionsButton = useCallback(function () {
|
|
@@ -100,11 +109,9 @@ export var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
|
|
|
100
109
|
prefix: 'euiDataGridCellHeader',
|
|
101
110
|
suffix: 'actions'
|
|
102
111
|
});
|
|
103
|
-
var cellContent = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", {
|
|
104
|
-
title: displayAsText || id,
|
|
105
|
-
className: "euiDataGridHeaderCell__content"
|
|
106
|
-
}, display || displayAsText || id), sortingArrow);
|
|
107
112
|
var classes = classnames((_classnames = {}, _defineProperty(_classnames, "euiDataGridHeaderCell--".concat(columnType), columnType), _defineProperty(_classnames, 'euiDataGridHeaderCell--hasColumnActions', showColumnActions), _defineProperty(_classnames, 'euiDataGridHeaderCell--isActionsPopoverOpen', isPopoverOpen), _classnames), displayHeaderCellProps === null || displayHeaderCellProps === void 0 ? void 0 : displayHeaderCellProps.className);
|
|
113
|
+
var title = displayAsText || id;
|
|
114
|
+
var children = display || displayAsText || id;
|
|
108
115
|
return ___EmotionJSX(EuiDataGridHeaderCellWrapper, _extends({}, displayHeaderCellProps, {
|
|
109
116
|
className: classes,
|
|
110
117
|
id: id,
|
|
@@ -118,7 +125,10 @@ export var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
|
|
|
118
125
|
columnId: id,
|
|
119
126
|
columnWidth: width,
|
|
120
127
|
setColumnWidth: setColumnWidth
|
|
121
|
-
}) : null, !showColumnActions ? ___EmotionJSX(React.Fragment, null,
|
|
128
|
+
}) : null, !showColumnActions ? ___EmotionJSX(React.Fragment, null, ___EmotionJSX(CellContent, {
|
|
129
|
+
title: title,
|
|
130
|
+
arrow: sortingArrow
|
|
131
|
+
}, children), sortingScreenReaderText && ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", null, sortingScreenReaderText))) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX("button", {
|
|
122
132
|
className: "euiDataGridHeaderCell__button",
|
|
123
133
|
onClick: function onClick() {
|
|
124
134
|
return setIsPopoverOpen(function (isPopoverOpen) {
|
|
@@ -134,12 +144,15 @@ export var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
|
|
|
134
144
|
"aria-describedby": "".concat(sortingAriaId, " ").concat(actionsAriaId),
|
|
135
145
|
ref: actionsButtonRef,
|
|
136
146
|
"data-test-subj": "dataGridHeaderCellActionButton-".concat(id)
|
|
137
|
-
},
|
|
147
|
+
}, ___EmotionJSX(CellContent, {
|
|
148
|
+
title: title,
|
|
149
|
+
arrow: sortingArrow
|
|
150
|
+
}, children), ___EmotionJSX(EuiPopover, _extends({
|
|
138
151
|
display: "block",
|
|
139
152
|
panelPaddingSize: "none",
|
|
140
153
|
offset: 7,
|
|
141
154
|
anchorPosition: "downRight",
|
|
142
|
-
css:
|
|
155
|
+
css: _ref3 // Align to right
|
|
143
156
|
,
|
|
144
157
|
focusTrapProps: {
|
|
145
158
|
// We need to override the default EuiPopover `onClickOutside` since the anchor is separate from the actual button
|
|
@@ -175,16 +188,17 @@ export var EuiDataGridHeaderCell = function EuiDataGridHeaderCell(_ref) {
|
|
|
175
188
|
token: "euiDataGridHeaderCell.headerActions",
|
|
176
189
|
default: "Click to view column header actions"
|
|
177
190
|
}))));
|
|
178
|
-
};
|
|
191
|
+
});
|
|
192
|
+
EuiDataGridHeaderCell.displayName = 'EuiDataGridHeaderCell';
|
|
179
193
|
|
|
180
194
|
/**
|
|
181
195
|
* Column sorting utility helpers
|
|
182
196
|
*/
|
|
183
|
-
export var useSortingUtils = function useSortingUtils(
|
|
197
|
+
export var useSortingUtils = function useSortingUtils(_ref4) {
|
|
184
198
|
var _sorting$columns;
|
|
185
|
-
var sorting =
|
|
186
|
-
id =
|
|
187
|
-
showColumnActions =
|
|
199
|
+
var sorting = _ref4.sorting,
|
|
200
|
+
id = _ref4.id,
|
|
201
|
+
showColumnActions = _ref4.showColumnActions;
|
|
188
202
|
var sortedColumn = useMemo(function () {
|
|
189
203
|
return sorting === null || sorting === void 0 ? void 0 : sorting.columns.find(function (col) {
|
|
190
204
|
return col.id === id;
|
|
@@ -196,12 +210,14 @@ export var useSortingUtils = function useSortingUtils(_ref3) {
|
|
|
196
210
|
/**
|
|
197
211
|
* Arrow icon
|
|
198
212
|
*/
|
|
199
|
-
var sortingArrow =
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
213
|
+
var sortingArrow = useMemo(function () {
|
|
214
|
+
return isColumnSorted ? ___EmotionJSX(EuiIcon, {
|
|
215
|
+
type: sortedColumn.direction === 'asc' ? 'sortUp' : 'sortDown',
|
|
216
|
+
color: "text",
|
|
217
|
+
className: "euiDataGridHeaderCell__sortingArrow",
|
|
218
|
+
"data-test-subj": "dataGridHeaderCellSortingIcon-".concat(id)
|
|
219
|
+
}) : null;
|
|
220
|
+
}, [id, isColumnSorted, sortedColumn]);
|
|
205
221
|
|
|
206
222
|
/**
|
|
207
223
|
* aria-sort attribute - should only be used when a single column is being sorted
|
|
@@ -218,9 +234,9 @@ export var useSortingUtils = function useSortingUtils(_ref3) {
|
|
|
218
234
|
var _sorting$columns2;
|
|
219
235
|
if (!isColumnSorted) return null;
|
|
220
236
|
if (!showColumnActions && hasOnlyOneSort) return null; // in this scenario, the `aria-sort` attribute will be used by screen readers
|
|
221
|
-
return ___EmotionJSX(React.Fragment, null, sorting === null || sorting === void 0 ? void 0 : (_sorting$columns2 = sorting.columns) === null || _sorting$columns2 === void 0 ? void 0 : _sorting$columns2.map(function (
|
|
222
|
-
var columnId =
|
|
223
|
-
direction =
|
|
237
|
+
return ___EmotionJSX(React.Fragment, null, sorting === null || sorting === void 0 ? void 0 : (_sorting$columns2 = sorting.columns) === null || _sorting$columns2 === void 0 ? void 0 : _sorting$columns2.map(function (_ref5, index) {
|
|
238
|
+
var columnId = _ref5.id,
|
|
239
|
+
direction = _ref5.direction;
|
|
224
240
|
if (hasOnlyOneSort) {
|
|
225
241
|
if (direction === 'asc') {
|
|
226
242
|
return ___EmotionJSX(EuiI18n, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["className", "data-test-subj", "leadingControlColumns", "trailingControlColumns", "columns", "columnWidths", "defaultColumnWidth", "setColumnWidth", "setVisibleColumns", "switchColumnPos", "sorting", "schema", "schemaDetectors"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -10,26 +10,27 @@ var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import classnames from 'classnames';
|
|
13
|
-
import React, { forwardRef } from 'react';
|
|
13
|
+
import React, { forwardRef, memo } from 'react';
|
|
14
14
|
import { EuiDataGridControlHeaderCell } from './data_grid_control_header_cell';
|
|
15
15
|
import { EuiDataGridHeaderCell } from './data_grid_header_cell';
|
|
16
16
|
import { emptyControlColumns } from '../../data_grid_types';
|
|
17
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
|
-
var EuiDataGridHeaderRow = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
|
-
var
|
|
18
|
+
var EuiDataGridHeaderRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
19
|
+
var className = props.className,
|
|
20
|
+
_dataTestSubj = props['data-test-subj'],
|
|
21
|
+
_props$leadingControl = props.leadingControlColumns,
|
|
20
22
|
leadingControlColumns = _props$leadingControl === void 0 ? emptyControlColumns : _props$leadingControl,
|
|
21
23
|
_props$trailingContro = props.trailingControlColumns,
|
|
22
24
|
trailingControlColumns = _props$trailingContro === void 0 ? emptyControlColumns : _props$trailingContro,
|
|
23
25
|
columns = props.columns,
|
|
24
|
-
schema = props.schema,
|
|
25
|
-
schemaDetectors = props.schemaDetectors,
|
|
26
26
|
columnWidths = props.columnWidths,
|
|
27
27
|
defaultColumnWidth = props.defaultColumnWidth,
|
|
28
|
-
className = props.className,
|
|
29
28
|
setColumnWidth = props.setColumnWidth,
|
|
30
29
|
setVisibleColumns = props.setVisibleColumns,
|
|
31
30
|
switchColumnPos = props.switchColumnPos,
|
|
32
|
-
|
|
31
|
+
sorting = props.sorting,
|
|
32
|
+
schema = props.schema,
|
|
33
|
+
schemaDetectors = props.schemaDetectors,
|
|
33
34
|
rest = _objectWithoutProperties(props, _excluded);
|
|
34
35
|
var classes = classnames('euiDataGridHeader', className);
|
|
35
36
|
var dataTestSubj = classnames('dataGridHeader', _dataTestSubj);
|
|
@@ -47,16 +48,17 @@ var EuiDataGridHeaderRow = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
47
48
|
}), columns.map(function (column, index) {
|
|
48
49
|
return ___EmotionJSX(EuiDataGridHeaderCell, {
|
|
49
50
|
key: column.id,
|
|
51
|
+
index: index + leadingControlColumns.length,
|
|
50
52
|
column: column,
|
|
51
53
|
columns: columns,
|
|
52
|
-
index: index + leadingControlColumns.length,
|
|
53
54
|
columnWidths: columnWidths,
|
|
54
|
-
|
|
55
|
-
schemaDetectors: schemaDetectors,
|
|
55
|
+
defaultColumnWidth: defaultColumnWidth,
|
|
56
56
|
setColumnWidth: setColumnWidth,
|
|
57
57
|
setVisibleColumns: setVisibleColumns,
|
|
58
58
|
switchColumnPos: switchColumnPos,
|
|
59
|
-
|
|
59
|
+
sorting: sorting,
|
|
60
|
+
schema: schema,
|
|
61
|
+
schemaDetectors: schemaDetectors
|
|
60
62
|
});
|
|
61
63
|
}), trailingControlColumns.map(function (controlColumn, index) {
|
|
62
64
|
return ___EmotionJSX(EuiDataGridControlHeaderCell, {
|
|
@@ -65,6 +67,6 @@ var EuiDataGridHeaderRow = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
65
67
|
controlColumn: controlColumn
|
|
66
68
|
});
|
|
67
69
|
}));
|
|
68
|
-
});
|
|
70
|
+
}));
|
|
69
71
|
EuiDataGridHeaderRow.displayName = 'EuiDataGridHeaderRow';
|
|
70
72
|
export { EuiDataGridHeaderRow };
|