@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
|
@@ -48,7 +48,6 @@ var DataGridCellPopoverContext = /*#__PURE__*/(0, _react.createContext)({
|
|
|
48
48
|
});
|
|
49
49
|
exports.DataGridCellPopoverContext = DataGridCellPopoverContext;
|
|
50
50
|
var useCellPopover = function useCellPopover() {
|
|
51
|
-
var _cellPopoverProps$pan;
|
|
52
51
|
// Current open state & cell location are handled here
|
|
53
52
|
var _useState = (0, _react.useState)(false),
|
|
54
53
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -99,16 +98,6 @@ var useCellPopover = function useCellPopover() {
|
|
|
99
98
|
});
|
|
100
99
|
setPopoverIsOpen(true);
|
|
101
100
|
}, [popoverIsOpen, cellLocation]);
|
|
102
|
-
var cellPopoverContext = {
|
|
103
|
-
popoverIsOpen: popoverIsOpen,
|
|
104
|
-
closeCellPopover: closeCellPopover,
|
|
105
|
-
openCellPopover: openCellPopover,
|
|
106
|
-
cellLocation: cellLocation,
|
|
107
|
-
setPopoverAnchor: setPopoverAnchor,
|
|
108
|
-
setPopoverAnchorPosition: setPopoverAnchorPosition,
|
|
109
|
-
setPopoverContent: setPopoverContent,
|
|
110
|
-
setCellPopoverProps: setCellPopoverProps
|
|
111
|
-
};
|
|
112
101
|
|
|
113
102
|
// Override the default EuiPopover `onClickOutside` behavior, since the toggling
|
|
114
103
|
// popover button isn't actually the DOM node we pass to `button`. Otherwise,
|
|
@@ -120,52 +109,71 @@ var useCellPopover = function useCellPopover() {
|
|
|
120
109
|
closeCellPopover();
|
|
121
110
|
}
|
|
122
111
|
}, [popoverAnchor, closeCellPopover]);
|
|
112
|
+
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
113
|
+
if (event.key === _services.keys.F2 || event.key === _services.keys.ESCAPE) {
|
|
114
|
+
var _popoverAnchor$parent3, _popoverAnchor$parent4;
|
|
115
|
+
event.preventDefault();
|
|
116
|
+
event.stopPropagation();
|
|
117
|
+
closeCellPopover();
|
|
118
|
+
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;
|
|
123
119
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
event.preventDefault();
|
|
149
|
-
event.stopPropagation();
|
|
150
|
-
closeCellPopover();
|
|
151
|
-
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;
|
|
120
|
+
// Prevent cell animation flash while focus is being shifted between popover and cell
|
|
121
|
+
cell === null || cell === void 0 ? void 0 : cell.setAttribute('data-keyboard-closing', 'true');
|
|
122
|
+
// Ensure focus is returned to the parent cell, and remove animation stopgap
|
|
123
|
+
requestAnimationFrame(function () {
|
|
124
|
+
popoverAnchor === null || popoverAnchor === void 0 ? void 0 : popoverAnchor.parentElement.focus();
|
|
125
|
+
cell === null || cell === void 0 ? void 0 : cell.removeAttribute('data-keyboard-closing');
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}, [popoverAnchor, closeCellPopover]);
|
|
129
|
+
var cellPopoverContext = (0, _react.useMemo)(function () {
|
|
130
|
+
return {
|
|
131
|
+
popoverIsOpen: popoverIsOpen,
|
|
132
|
+
closeCellPopover: closeCellPopover,
|
|
133
|
+
openCellPopover: openCellPopover,
|
|
134
|
+
cellLocation: cellLocation,
|
|
135
|
+
setPopoverAnchorPosition: setPopoverAnchorPosition,
|
|
136
|
+
setPopoverAnchor: setPopoverAnchor,
|
|
137
|
+
setPopoverContent: setPopoverContent,
|
|
138
|
+
setCellPopoverProps: setCellPopoverProps
|
|
139
|
+
};
|
|
140
|
+
}, [popoverIsOpen, closeCellPopover, openCellPopover, cellLocation]);
|
|
141
|
+
var cellPopover = (0, _react.useMemo)(function () {
|
|
142
|
+
var _cellPopoverProps$pan;
|
|
143
|
+
if (!popoverIsOpen || !popoverAnchor) return null;
|
|
152
144
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
145
|
+
// Note that this popover is rendered once at the top grid level, rather than one popover per cell
|
|
146
|
+
return (0, _react2.jsx)(_popover.EuiWrappingPopover, _extends({
|
|
147
|
+
isOpen: popoverIsOpen,
|
|
148
|
+
display: "block",
|
|
149
|
+
hasArrow: false,
|
|
150
|
+
panelPaddingSize: "s",
|
|
151
|
+
anchorPosition: popoverAnchorPosition,
|
|
152
|
+
repositionToCrossAxis: false
|
|
153
|
+
}, cellPopoverProps, {
|
|
154
|
+
focusTrapProps: {
|
|
155
|
+
onClickOutside: onClickOutside,
|
|
156
|
+
clickOutsideDisables: false
|
|
157
|
+
},
|
|
158
|
+
panelProps: _objectSpread({
|
|
159
|
+
'data-test-subj': 'euiDataGridExpansionPopover'
|
|
160
|
+
}, cellPopoverProps.panelProps || {}),
|
|
161
|
+
panelClassName: (0, _classnames.default)('euiDataGridRowCell__popover', cellPopoverProps.panelClassName, (_cellPopoverProps$pan = cellPopoverProps.panelProps) === null || _cellPopoverProps$pan === void 0 ? void 0 : _cellPopoverProps$pan.className),
|
|
162
|
+
panelStyle: {
|
|
163
|
+
maxInlineSize: "min(75vw, max(".concat(popoverAnchor.parentElement.offsetWidth, "px, 400px))"),
|
|
164
|
+
maxBlockSize: '50vh'
|
|
165
|
+
},
|
|
166
|
+
onKeyDown: onKeyDown,
|
|
167
|
+
button: popoverAnchor,
|
|
168
|
+
closePopover: closeCellPopover
|
|
169
|
+
}), popoverContent);
|
|
170
|
+
}, [popoverIsOpen, popoverAnchor, popoverContent, cellPopoverProps, closeCellPopover, onClickOutside, onKeyDown, popoverAnchorPosition]);
|
|
171
|
+
return (0, _react.useMemo)(function () {
|
|
172
|
+
return {
|
|
173
|
+
cellPopoverContext: cellPopoverContext,
|
|
174
|
+
cellPopover: cellPopover
|
|
175
|
+
};
|
|
176
|
+
}, [cellPopoverContext, cellPopover]);
|
|
169
177
|
};
|
|
170
178
|
|
|
171
179
|
/**
|
|
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.CellWrapper = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _sorting = require("../../utils/sorting");
|
|
@@ -33,7 +33,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
33
33
|
* It grabs context, determines the type of cell being rendered
|
|
34
34
|
* (e.g. control vs data cell), & sets shared props between all cells
|
|
35
35
|
*/
|
|
36
|
-
var
|
|
36
|
+
var CellWrapper = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
37
37
|
var colIndex = _ref.colIndex,
|
|
38
38
|
visibleRowIndex = _ref.visibleRowIndex,
|
|
39
39
|
style = _ref.style,
|
|
@@ -56,9 +56,8 @@ var Cell = function Cell(_ref) {
|
|
|
56
56
|
rowManager = _ref.rowManager,
|
|
57
57
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
58
58
|
var popoverContext = (0, _react.useContext)(_data_grid_cell_popover.DataGridCellPopoverContext);
|
|
59
|
-
var _useContext = (0, _react.useContext)(_sorting.
|
|
59
|
+
var _useContext = (0, _react.useContext)(_sorting.DataGridSortedContext),
|
|
60
60
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
61
|
-
var cellContent;
|
|
62
61
|
var isFirstColumn = colIndex === 0;
|
|
63
62
|
var isLastColumn = colIndex === visibleColCount - 1;
|
|
64
63
|
var isLeadingControlColumn = colIndex < leadingControlColumns.length;
|
|
@@ -72,31 +71,33 @@ var Cell = function Cell(_ref) {
|
|
|
72
71
|
return column !== null && column !== void 0 && column.schema ? (column === null || column === void 0 ? void 0 : column.schema) === row.type : columnId === row.type;
|
|
73
72
|
})[0]) === null || _schemaDetectors$filt === void 0 ? void 0 : _schemaDetectors$filt.textTransform;
|
|
74
73
|
}, [columnId, column === null || column === void 0 ? void 0 : column.schema, schemaDetectors]);
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
74
|
+
var sharedCellProps = (0, _react.useMemo)(function () {
|
|
75
|
+
var classes = (0, _classnames.default)(_defineProperty({
|
|
76
|
+
'euiDataGridRowCell--firstColumn': isFirstColumn,
|
|
77
|
+
'euiDataGridRowCell--lastColumn': isLastColumn,
|
|
78
|
+
'euiDataGridRowCell--controlColumn': isLeadingControlColumn || isTrailingControlColumn
|
|
79
|
+
}, "euiDataGridRowCell--".concat(textTransform), textTransform));
|
|
80
|
+
return {
|
|
81
|
+
rowIndex: getCorrectRowIndex(visibleRowIndex),
|
|
82
|
+
visibleRowIndex: visibleRowIndex,
|
|
83
|
+
colIndex: colIndex,
|
|
84
|
+
interactiveCellId: interactiveCellId,
|
|
85
|
+
className: classes,
|
|
86
|
+
style: style,
|
|
87
|
+
rowHeightsOptions: rowHeightsOptions,
|
|
88
|
+
rowHeightUtils: rowHeightUtils,
|
|
89
|
+
setRowHeight: isFirstColumn ? setRowHeight : undefined,
|
|
90
|
+
rowManager: rowManager,
|
|
91
|
+
popoverContext: popoverContext,
|
|
92
|
+
pagination: pagination,
|
|
93
|
+
cellContext: cellContext
|
|
94
|
+
};
|
|
95
|
+
}, [colIndex, setRowHeight, visibleRowIndex, getCorrectRowIndex, interactiveCellId, style, rowHeightsOptions, rowHeightUtils, rowManager, popoverContext, pagination, cellContext, isFirstColumn, isLastColumn, isLeadingControlColumn, isTrailingControlColumn, textTransform]);
|
|
95
96
|
if (isLeadingControlColumn) {
|
|
96
97
|
var leadingColumn = leadingControlColumns[colIndex];
|
|
97
98
|
var id = leadingColumn.id,
|
|
98
99
|
rowCellRender = leadingColumn.rowCellRender;
|
|
99
|
-
|
|
100
|
+
return (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
100
101
|
columnId: id,
|
|
101
102
|
width: leadingColumn.width,
|
|
102
103
|
renderCellValue: rowCellRender,
|
|
@@ -108,7 +109,7 @@ var Cell = function Cell(_ref) {
|
|
|
108
109
|
var trailingColumn = trailingControlColumns[trailingcolIndex];
|
|
109
110
|
var _id = trailingColumn.id,
|
|
110
111
|
_rowCellRender = trailingColumn.rowCellRender;
|
|
111
|
-
|
|
112
|
+
return (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
112
113
|
columnId: _id,
|
|
113
114
|
width: trailingColumn.width,
|
|
114
115
|
renderCellValue: _rowCellRender,
|
|
@@ -117,9 +118,9 @@ var Cell = function Cell(_ref) {
|
|
|
117
118
|
} else {
|
|
118
119
|
// this is a normal data cell
|
|
119
120
|
var columnType = schema[columnId] ? schema[columnId].columnType : null;
|
|
120
|
-
var isExpandable = column.isExpandable !== undefined ? column.isExpandable : true;
|
|
121
|
+
var isExpandable = (column === null || column === void 0 ? void 0 : column.isExpandable) !== undefined ? column === null || column === void 0 ? void 0 : column.isExpandable : true;
|
|
121
122
|
var width = columnWidths[columnId] || defaultColumnWidth;
|
|
122
|
-
|
|
123
|
+
return (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, _extends({}, sharedCellProps, {
|
|
123
124
|
columnId: columnId,
|
|
124
125
|
column: column,
|
|
125
126
|
columnType: columnType,
|
|
@@ -130,6 +131,6 @@ var Cell = function Cell(_ref) {
|
|
|
130
131
|
isExpandable: isExpandable
|
|
131
132
|
}, rest));
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
});
|
|
135
|
+
exports.CellWrapper = CellWrapper;
|
|
136
|
+
CellWrapper.displayName = 'CellWrapper';
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "CellWrapper", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _data_grid_cell_wrapper.
|
|
9
|
+
return _data_grid_cell_wrapper.CellWrapper;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "DataGridCellPopoverContext", {
|
|
@@ -574,6 +574,19 @@ EuiDataGridBody.propTypes = {
|
|
|
574
574
|
renderFooterCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]),
|
|
575
575
|
renderCustomGridBody: _propTypes.default.func,
|
|
576
576
|
interactiveCellId: _propTypes.default.string.isRequired,
|
|
577
|
+
sorting: _propTypes.default.shape({
|
|
578
|
+
/**
|
|
579
|
+
* A function that receives updated column sort details in response to user interactions in the toolbar controls
|
|
580
|
+
*/
|
|
581
|
+
onSort: _propTypes.default.func.isRequired,
|
|
582
|
+
/**
|
|
583
|
+
* An array of the column ids currently being sorted and their sort direction. The array order determines the sort order. `{ id: 'A'; direction: 'asc' }`
|
|
584
|
+
*/
|
|
585
|
+
columns: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
586
|
+
id: _propTypes.default.string.isRequired,
|
|
587
|
+
direction: _propTypes.default.oneOf(["asc", "desc"]).isRequired
|
|
588
|
+
}).isRequired).isRequired
|
|
589
|
+
}),
|
|
577
590
|
pagination: _propTypes.default.any,
|
|
578
591
|
setVisibleColumns: _propTypes.default.func.isRequired,
|
|
579
592
|
switchColumnPos: _propTypes.default.func.isRequired,
|
|
@@ -44,25 +44,26 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
44
44
|
*/
|
|
45
45
|
var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
|
|
46
46
|
var renderCustomGridBody = _ref.renderCustomGridBody,
|
|
47
|
-
leadingControlColumns = _ref.leadingControlColumns,
|
|
48
|
-
trailingControlColumns = _ref.trailingControlColumns,
|
|
49
|
-
columns = _ref.columns,
|
|
50
|
-
visibleColCount = _ref.visibleColCount,
|
|
51
|
-
schema = _ref.schema,
|
|
52
|
-
schemaDetectors = _ref.schemaDetectors,
|
|
53
|
-
visibleRows = _ref.visibleRows,
|
|
54
47
|
renderCellValue = _ref.renderCellValue,
|
|
55
48
|
cellContext = _ref.cellContext,
|
|
56
49
|
renderCellPopover = _ref.renderCellPopover,
|
|
57
50
|
renderFooterCellValue = _ref.renderFooterCellValue,
|
|
58
51
|
interactiveCellId = _ref.interactiveCellId,
|
|
52
|
+
visibleRows = _ref.visibleRows,
|
|
53
|
+
visibleColCount = _ref.visibleColCount,
|
|
54
|
+
leadingControlColumns = _ref.leadingControlColumns,
|
|
55
|
+
trailingControlColumns = _ref.trailingControlColumns,
|
|
56
|
+
columns = _ref.columns,
|
|
59
57
|
setVisibleColumns = _ref.setVisibleColumns,
|
|
60
58
|
switchColumnPos = _ref.switchColumnPos,
|
|
61
59
|
onColumnResize = _ref.onColumnResize,
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
schema = _ref.schema,
|
|
61
|
+
schemaDetectors = _ref.schemaDetectors,
|
|
62
|
+
sorting = _ref.sorting,
|
|
64
63
|
pagination = _ref.pagination,
|
|
65
|
-
rowHeightsOptions = _ref.rowHeightsOptions
|
|
64
|
+
rowHeightsOptions = _ref.rowHeightsOptions,
|
|
65
|
+
gridWidth = _ref.gridWidth,
|
|
66
|
+
gridStyles = _ref.gridStyles;
|
|
66
67
|
/**
|
|
67
68
|
* Columns & widths
|
|
68
69
|
*/
|
|
@@ -101,14 +102,15 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
|
|
|
101
102
|
* Header & footer
|
|
102
103
|
*/
|
|
103
104
|
var _useDataGridHeader = (0, _header.useDataGridHeader)({
|
|
104
|
-
switchColumnPos: switchColumnPos,
|
|
105
|
-
setVisibleColumns: setVisibleColumns,
|
|
106
105
|
leadingControlColumns: leadingControlColumns,
|
|
107
106
|
trailingControlColumns: trailingControlColumns,
|
|
108
107
|
columns: columns,
|
|
109
108
|
columnWidths: columnWidths,
|
|
110
109
|
defaultColumnWidth: defaultColumnWidth,
|
|
111
110
|
setColumnWidth: setColumnWidth,
|
|
111
|
+
setVisibleColumns: setVisibleColumns,
|
|
112
|
+
switchColumnPos: switchColumnPos,
|
|
113
|
+
sorting: sorting,
|
|
112
114
|
schema: schema,
|
|
113
115
|
schemaDetectors: schemaDetectors
|
|
114
116
|
}),
|
|
@@ -131,25 +133,27 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
|
|
|
131
133
|
/**
|
|
132
134
|
* Cell render fn
|
|
133
135
|
*/
|
|
134
|
-
var cellProps = {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
136
|
+
var cellProps = (0, _react.useMemo)(function () {
|
|
137
|
+
return {
|
|
138
|
+
schema: schema,
|
|
139
|
+
schemaDetectors: schemaDetectors,
|
|
140
|
+
pagination: pagination,
|
|
141
|
+
columns: columns,
|
|
142
|
+
leadingControlColumns: leadingControlColumns,
|
|
143
|
+
trailingControlColumns: trailingControlColumns,
|
|
144
|
+
visibleColCount: visibleColCount,
|
|
145
|
+
columnWidths: columnWidths,
|
|
146
|
+
defaultColumnWidth: defaultColumnWidth,
|
|
147
|
+
renderCellValue: renderCellValue,
|
|
148
|
+
cellContext: cellContext,
|
|
149
|
+
renderCellPopover: renderCellPopover,
|
|
150
|
+
interactiveCellId: interactiveCellId,
|
|
151
|
+
setRowHeight: setRowHeight,
|
|
152
|
+
rowHeightsOptions: rowHeightsOptions,
|
|
153
|
+
rowHeightUtils: rowHeightUtils
|
|
154
|
+
};
|
|
155
|
+
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils]);
|
|
156
|
+
var Cell = (0, _react.useCallback)(function (_ref2) {
|
|
153
157
|
var colIndex = _ref2.colIndex,
|
|
154
158
|
visibleRowIndex = _ref2.visibleRowIndex,
|
|
155
159
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -161,9 +165,8 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
|
|
|
161
165
|
visibleRowIndex: visibleRowIndex,
|
|
162
166
|
style: style
|
|
163
167
|
}, cellProps);
|
|
164
|
-
return (0, _react2.jsx)(_cell.
|
|
165
|
-
}, [
|
|
166
|
-
);
|
|
168
|
+
return (0, _react2.jsx)(_cell.CellWrapper, _extends({}, props, rest));
|
|
169
|
+
}, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
|
|
167
170
|
|
|
168
171
|
// Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
|
|
169
172
|
var _useState = (0, _react.useState)({}),
|
|
@@ -175,7 +178,7 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
|
|
|
175
178
|
}), headerRow, renderCustomGridBody({
|
|
176
179
|
visibleColumns: visibleColumns,
|
|
177
180
|
visibleRowData: visibleRows,
|
|
178
|
-
Cell:
|
|
181
|
+
Cell: Cell,
|
|
179
182
|
setCustomGridBodyProps: setCustomGridBodyProps
|
|
180
183
|
}), footerRow);
|
|
181
184
|
};
|
|
@@ -720,6 +723,19 @@ EuiDataGridBodyCustomRender.propTypes = {
|
|
|
720
723
|
renderFooterCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]),
|
|
721
724
|
renderCustomGridBody: _propTypes.default.func,
|
|
722
725
|
interactiveCellId: _propTypes.default.string.isRequired,
|
|
726
|
+
sorting: _propTypes.default.shape({
|
|
727
|
+
/**
|
|
728
|
+
* A function that receives updated column sort details in response to user interactions in the toolbar controls
|
|
729
|
+
*/
|
|
730
|
+
onSort: _propTypes.default.func.isRequired,
|
|
731
|
+
/**
|
|
732
|
+
* An array of the column ids currently being sorted and their sort direction. The array order determines the sort order. `{ id: 'A'; direction: 'asc' }`
|
|
733
|
+
*/
|
|
734
|
+
columns: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
735
|
+
id: _propTypes.default.string.isRequired,
|
|
736
|
+
direction: _propTypes.default.oneOf(["asc", "desc"]).isRequired
|
|
737
|
+
}).isRequired).isRequired
|
|
738
|
+
}),
|
|
723
739
|
pagination: _propTypes.default.any,
|
|
724
740
|
setVisibleColumns: _propTypes.default.func.isRequired,
|
|
725
741
|
switchColumnPos: _propTypes.default.func.isRequired,
|