@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
|
@@ -10,14 +10,29 @@ var _global_styling = require("../../../global_styling");
|
|
|
10
10
|
var _button = require("../../../themes/amsterdam/global_styling/mixins/button");
|
|
11
11
|
var _accessibility = require("../../accessibility");
|
|
12
12
|
var _form = require("../../form/form.styles");
|
|
13
|
-
/*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "nwv4a2-tooltipWrapper",
|
|
22
|
+
styles: "overflow:hidden;label:tooltipWrapper;"
|
|
23
|
+
} : {
|
|
24
|
+
name: "nwv4a2-tooltipWrapper",
|
|
25
|
+
styles: "overflow:hidden;label:tooltipWrapper;",
|
|
26
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
|
+
};
|
|
28
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
29
|
+
name: "1u3o7zy-hasToolTip",
|
|
30
|
+
styles: "border-radius:inherit;label:hasToolTip;"
|
|
31
|
+
} : {
|
|
32
|
+
name: "1u3o7zy-hasToolTip",
|
|
33
|
+
styles: "border-radius:inherit;label:hasToolTip;",
|
|
34
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
|
+
};
|
|
21
36
|
var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeContext) {
|
|
22
37
|
var euiTheme = euiThemeContext.euiTheme;
|
|
23
38
|
var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
|
|
@@ -34,9 +49,26 @@ var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeCon
|
|
|
34
49
|
euiButtonGroupButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', 0), " flex-shrink:1;flex-grow:0;", _global_styling.euiCanAnimate, "{transition:background-color ", euiTheme.animation.normal, " ease-in-out,color ", euiTheme.animation.normal, " ease-in-out;};label:euiButtonGroupButton;"),
|
|
35
50
|
iconOnly: /*#__PURE__*/(0, _react.css)("padding-inline:", euiTheme.size.s, ";;label:iconOnly;"),
|
|
36
51
|
// Sizes
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
uncompressed: {
|
|
53
|
+
uncompressed: /*#__PURE__*/(0, _react.css)("&:is(.euiButtonGroupButton-isSelected){font-weight:", euiTheme.font.weight.bold, ";};label:uncompressed;"),
|
|
54
|
+
get borders() {
|
|
55
|
+
var selectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
|
|
56
|
+
var selectedColor = (0, _services.transparentize)(euiTheme.colors.emptyShade, 0.2);
|
|
57
|
+
var unselectedColor = (0, _services.transparentize)(euiTheme.colors.fullShade, 0.1);
|
|
58
|
+
var borderWidth = euiTheme.border.width.thin;
|
|
59
|
+
|
|
60
|
+
// "Borders" between buttons should be present between two of the same colored buttons,
|
|
61
|
+
// and absent between selected vs non-selected buttons (different colors)
|
|
62
|
+
return "\n &:not(".concat(selectors, ") + *:not(").concat(selectors, ") {\n box-shadow: -").concat(borderWidth, " 0 0 0 ").concat(unselectedColor, ";\n }\n &:is(").concat(selectors, ") + *:is(").concat(selectors, ") {\n box-shadow: -").concat(borderWidth, " 0 0 0 ").concat(selectedColor, ";\n }\n ");
|
|
63
|
+
},
|
|
64
|
+
get s() {
|
|
65
|
+
return /*#__PURE__*/(0, _react.css)(this.borders, " ", uncompressedBorderRadii(euiTheme.border.radius.small), ";;label:s;");
|
|
66
|
+
},
|
|
67
|
+
get m() {
|
|
68
|
+
return /*#__PURE__*/(0, _react.css)(this.borders, " ", uncompressedBorderRadii(euiTheme.border.radius.medium), ";;label:m;");
|
|
69
|
+
},
|
|
70
|
+
hasToolTip: _ref2
|
|
71
|
+
},
|
|
40
72
|
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";padding:", (0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
41
73
|
return x * 2;
|
|
42
74
|
}), ";background-clip:content-box;border-radius:", (0, _global_styling.mathWithUnits)([controlCompressedBorderRadius, euiTheme.border.width.thin], function (x, y) {
|
|
@@ -44,6 +76,8 @@ var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeCon
|
|
|
44
76
|
}), ";font-weight:", euiTheme.font.weight.regular, ";&:is(.euiButtonGroupButton-isSelected){font-weight:", euiTheme.font.weight.semiBold, ";};label:compressed;"),
|
|
45
77
|
// States
|
|
46
78
|
disabledAndSelected: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeDisabledContrastColor)(euiTheme.colors.disabledText)(euiTheme.colors.disabled), ";background-color:", euiTheme.colors.disabled, ";;label:disabledAndSelected;"),
|
|
79
|
+
// Tooltip anchor wrapper
|
|
80
|
+
tooltipWrapper: _ref,
|
|
47
81
|
// Content wrapper
|
|
48
82
|
content: {
|
|
49
83
|
euiButtonGroupButton__content: /*#__PURE__*/(0, _react.css)(";label:euiButtonGroupButton__content;"),
|
|
@@ -30,7 +30,7 @@ var _data_grid_cell_actions = require("./data_grid_cell_actions");
|
|
|
30
30
|
var _data_grid_cell_popover = require("./data_grid_cell_popover");
|
|
31
31
|
var _focus_utils = require("./focus_utils");
|
|
32
32
|
var _react2 = require("@emotion/react");
|
|
33
|
-
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "
|
|
33
|
+
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "showCellActions", "onExpandClick", "popoverAnchorRef"],
|
|
34
34
|
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
35
35
|
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
|
|
36
36
|
/*
|
|
@@ -58,16 +58,25 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
58
58
|
rowHeightUtils = _ref.rowHeightUtils,
|
|
59
59
|
isControlColumn = _ref.isControlColumn,
|
|
60
60
|
isFocused = _ref.isFocused,
|
|
61
|
-
|
|
61
|
+
showCellActions = _ref.showCellActions,
|
|
62
|
+
onExpandClick = _ref.onExpandClick,
|
|
63
|
+
popoverAnchorRef = _ref.popoverAnchorRef,
|
|
62
64
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
63
|
-
// React is more
|
|
65
|
+
// React is more permissive than the TS types indicate
|
|
64
66
|
var CellElement = renderCellValue;
|
|
65
|
-
var cellHeightType = (
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
var cellHeightType = (0, _react.useMemo)(function () {
|
|
68
|
+
return (rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getHeightType(rowHeight)) || 'default';
|
|
69
|
+
}, [rowHeightUtils, rowHeight]);
|
|
70
|
+
var classes = (0, _react.useMemo)(function () {
|
|
71
|
+
return (0, _classnames.default)('euiDataGridRowCell__content', "euiDataGridRowCell__content--".concat(cellHeightType, "Height"), !isControlColumn && {
|
|
72
|
+
'eui-textBreakWord': cellHeightType !== 'default',
|
|
73
|
+
'eui-textTruncate': cellHeightType === 'default'
|
|
74
|
+
});
|
|
75
|
+
}, [cellHeightType, isControlColumn]);
|
|
76
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(RenderTruncatedCellContent, {
|
|
77
|
+
hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
|
|
78
|
+
rowHeight: rowHeight
|
|
79
|
+
}, (0, _react2.jsx)("div", {
|
|
71
80
|
ref: setCellContentsRef,
|
|
72
81
|
"data-datagrid-cellcontent": true,
|
|
73
82
|
className: classes
|
|
@@ -77,15 +86,7 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
77
86
|
rowIndex: rowIndex,
|
|
78
87
|
colIndex: colIndex,
|
|
79
88
|
schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
|
|
80
|
-
}, cellContext, rest)))
|
|
81
|
-
if (cellHeightType === 'lineCount' && !isControlColumn) {
|
|
82
|
-
var lines = rowHeightUtils.getLineCount(rowHeight);
|
|
83
|
-
cellContent = (0, _react2.jsx)(_text_truncate.EuiTextBlockTruncate, {
|
|
84
|
-
lines: lines,
|
|
85
|
-
cloneElement: true
|
|
86
|
-
}, cellContent);
|
|
87
|
-
}
|
|
88
|
-
var screenReaderText = (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
89
|
+
}, cellContext, rest)))), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
89
90
|
hidden: !isFocused
|
|
90
91
|
}, '- ', (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
91
92
|
token: "euiDataGridCell.position",
|
|
@@ -95,11 +96,16 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
95
96
|
col: colIndex + 1,
|
|
96
97
|
row: ariaRowIndex
|
|
97
98
|
}
|
|
98
|
-
}),
|
|
99
|
+
}), showCellActions && (0, _react2.jsx)(_react.default.Fragment, null, '. ', (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
99
100
|
token: "euiDataGridCell.expansionEnterPrompt",
|
|
100
101
|
default: "Press the Enter key to expand this cell."
|
|
101
|
-
}))))
|
|
102
|
-
|
|
102
|
+
})))), showCellActions && (0, _react2.jsx)(_data_grid_cell_actions.EuiDataGridCellActions, {
|
|
103
|
+
rowIndex: rowIndex,
|
|
104
|
+
colIndex: colIndex,
|
|
105
|
+
column: column,
|
|
106
|
+
onExpandClick: onExpandClick,
|
|
107
|
+
popoverAnchorRef: popoverAnchorRef
|
|
108
|
+
}));
|
|
103
109
|
});
|
|
104
110
|
EuiDataGridCellContent.propTypes = {
|
|
105
111
|
rowIndex: _propTypes.default.number.isRequired,
|
|
@@ -573,16 +579,18 @@ EuiDataGridCellContent.propTypes = {
|
|
|
573
579
|
rowHeightUtils: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
|
|
574
580
|
pagination: _propTypes.default.any,
|
|
575
581
|
setCellProps: _propTypes.default.func.isRequired,
|
|
576
|
-
setCellContentsRef: _propTypes.default.
|
|
582
|
+
setCellContentsRef: _propTypes.default.func.isRequired,
|
|
583
|
+
showCellActions: _propTypes.default.bool.isRequired,
|
|
577
584
|
isExpanded: _propTypes.default.bool.isRequired,
|
|
585
|
+
onExpandClick: _propTypes.default.func.isRequired,
|
|
586
|
+
popoverAnchorRef: _propTypes.default.any.isRequired,
|
|
578
587
|
isControlColumn: _propTypes.default.bool.isRequired,
|
|
579
588
|
isFocused: _propTypes.default.bool.isRequired,
|
|
580
589
|
ariaRowIndex: _propTypes.default.number.isRequired,
|
|
581
590
|
rowHeight: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.oneOf(["auto"]), _propTypes.default.shape({
|
|
582
591
|
lineCount: _propTypes.default.number,
|
|
583
592
|
height: _propTypes.default.number
|
|
584
|
-
}).isRequired])
|
|
585
|
-
cellActions: _propTypes.default.node
|
|
593
|
+
}).isRequired])
|
|
586
594
|
};
|
|
587
595
|
EuiDataGridCellContent.displayName = 'EuiDataGridCellContent';
|
|
588
596
|
var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
@@ -909,6 +917,7 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
909
917
|
if (nextProps.style.height !== this.props.style.height) return true;
|
|
910
918
|
if (nextProps.style.width !== this.props.style.width) return true;
|
|
911
919
|
}
|
|
920
|
+
if (nextProps.cellContext !== this.props.cellContext) return true;
|
|
912
921
|
if (nextState.cellProps !== this.state.cellProps) return true;
|
|
913
922
|
if (nextState.isFocused !== this.state.isFocused) return true;
|
|
914
923
|
if (nextState.isHovered !== this.state.isHovered) return true;
|
|
@@ -958,21 +967,16 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
958
967
|
lineHeight: (_rowHeightsOptions$li = rowHeightsOptions === null || rowHeightsOptions === void 0 ? void 0 : rowHeightsOptions.lineHeight) !== null && _rowHeightsOptions$li !== void 0 ? _rowHeightsOptions$li : undefined
|
|
959
968
|
}, cellPropsStyle);
|
|
960
969
|
var rowHeight = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getRowHeightOption(rowIndex, rowHeightsOptions);
|
|
961
|
-
var
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
rowHeightUtils: rowHeightUtils,
|
|
972
|
-
isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
|
|
973
|
-
ariaRowIndex: ariaRowIndex
|
|
974
|
-
});
|
|
975
|
-
var cell = (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
970
|
+
var row = rowManager && !_utils.IS_JEST_ENVIRONMENT ? rowManager.getRow({
|
|
971
|
+
rowIndex: rowIndex,
|
|
972
|
+
visibleRowIndex: visibleRowIndex,
|
|
973
|
+
top: style.top,
|
|
974
|
+
// comes in as a `{float}px` string from react-window
|
|
975
|
+
height: style.height // comes in as an integer from react-window
|
|
976
|
+
}) : undefined;
|
|
977
|
+
return (0, _react2.jsx)(RenderCellInRow, {
|
|
978
|
+
row: row
|
|
979
|
+
}, (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
976
980
|
role: "gridcell",
|
|
977
981
|
"aria-rowindex": ariaRowIndex,
|
|
978
982
|
tabIndex: this.state.isFocused ? 0 : -1,
|
|
@@ -996,28 +1000,32 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
996
1000
|
cellEl: this.cellRef.current,
|
|
997
1001
|
updateCellFocusContext: this.updateCellFocusContext,
|
|
998
1002
|
renderFocusTrap: !isExpandable
|
|
999
|
-
}, (0, _react2.jsx)(EuiDataGridCellContent, (0, _extends2.default)({},
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1003
|
+
}, (0, _react2.jsx)(EuiDataGridCellContent, (0, _extends2.default)({}, rest, {
|
|
1004
|
+
setCellProps: this.setCellProps,
|
|
1005
|
+
column: column,
|
|
1006
|
+
columnType: columnType,
|
|
1007
|
+
isExpandable: isExpandable,
|
|
1008
|
+
isExpanded: popoverIsOpen,
|
|
1009
|
+
onExpandClick: this.handleCellExpansionClick,
|
|
1010
|
+
popoverAnchorRef: this.popoverAnchorRef,
|
|
1011
|
+
showCellActions: showCellActions,
|
|
1012
|
+
isFocused: this.state.isFocused,
|
|
1013
|
+
setCellContentsRef: this.setCellContentsRef,
|
|
1014
|
+
rowHeight: rowHeight,
|
|
1015
|
+
rowHeightUtils: rowHeightUtils,
|
|
1016
|
+
isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
|
|
1017
|
+
ariaRowIndex: ariaRowIndex,
|
|
1011
1018
|
rowIndex: rowIndex,
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
// comes in as a `{float}px` string from react-window
|
|
1015
|
-
height: style.height // comes in as an integer from react-window
|
|
1016
|
-
})) : cell;
|
|
1019
|
+
colIndex: colIndex
|
|
1020
|
+
})))));
|
|
1017
1021
|
}
|
|
1018
1022
|
}]);
|
|
1019
1023
|
return EuiDataGridCell;
|
|
1020
1024
|
}(_react.Component);
|
|
1025
|
+
/**
|
|
1026
|
+
* Function component utilities for conditional rendering.
|
|
1027
|
+
* Used for DRYness and performance
|
|
1028
|
+
*/
|
|
1021
1029
|
exports.EuiDataGridCell = EuiDataGridCell;
|
|
1022
1030
|
(0, _defineProperty2.default)(EuiDataGridCell, "contextType", _focus.DataGridFocusContext);
|
|
1023
1031
|
EuiDataGridCell.propTypes = {
|
|
@@ -1425,4 +1433,34 @@ EuiDataGridCell.propTypes = {
|
|
|
1425
1433
|
getRow: _propTypes.default.func.isRequired
|
|
1426
1434
|
}),
|
|
1427
1435
|
pagination: _propTypes.default.any
|
|
1428
|
-
};
|
|
1436
|
+
};
|
|
1437
|
+
var RenderCellInRow = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
|
1438
|
+
var row = _ref2.row,
|
|
1439
|
+
children = _ref2.children;
|
|
1440
|
+
return row ? /*#__PURE__*/(0, _reactDom.createPortal)(children, row) : children;
|
|
1441
|
+
});
|
|
1442
|
+
RenderCellInRow.propTypes = {
|
|
1443
|
+
children: _propTypes.default.element.isRequired,
|
|
1444
|
+
row: _propTypes.default.any
|
|
1445
|
+
};
|
|
1446
|
+
RenderCellInRow.displayName = 'RenderCellInRow';
|
|
1447
|
+
var RenderTruncatedCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref3) {
|
|
1448
|
+
var children = _ref3.children,
|
|
1449
|
+
hasLineCountTruncation = _ref3.hasLineCountTruncation,
|
|
1450
|
+
rowHeight = _ref3.rowHeight;
|
|
1451
|
+
// If `hasLineCountTruncation` is true, we can rely on rowHeight being the correct type
|
|
1452
|
+
var lines = hasLineCountTruncation ? rowHeight.lineCount : undefined;
|
|
1453
|
+
return lines ? (0, _react2.jsx)(_text_truncate.EuiTextBlockTruncate, {
|
|
1454
|
+
lines: lines,
|
|
1455
|
+
cloneElement: true
|
|
1456
|
+
}, children) : children;
|
|
1457
|
+
});
|
|
1458
|
+
RenderTruncatedCellContent.propTypes = {
|
|
1459
|
+
children: _propTypes.default.element.isRequired,
|
|
1460
|
+
hasLineCountTruncation: _propTypes.default.bool.isRequired,
|
|
1461
|
+
rowHeight: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.oneOf(["auto"]), _propTypes.default.shape({
|
|
1462
|
+
lineCount: _propTypes.default.number,
|
|
1463
|
+
height: _propTypes.default.number
|
|
1464
|
+
}).isRequired])
|
|
1465
|
+
};
|
|
1466
|
+
RenderTruncatedCellContent.displayName = 'RenderTruncatedCellContent';
|
|
@@ -28,6 +28,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
28
28
|
|
|
29
29
|
var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
30
30
|
var onExpandClick = _ref.onExpandClick,
|
|
31
|
+
popoverAnchorRef = _ref.popoverAnchorRef,
|
|
31
32
|
column = _ref.column,
|
|
32
33
|
rowIndex = _ref.rowIndex,
|
|
33
34
|
colIndex = _ref.colIndex;
|
|
@@ -35,23 +36,25 @@ var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
|
35
36
|
// column.cellActions is present (regardless of column.isExpandable).
|
|
36
37
|
// This is because cell actions are not otherwise accessible to keyboard
|
|
37
38
|
// or screen reader users
|
|
38
|
-
var expandButton = (0,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
var expandButton = (0, _react.useMemo)(function () {
|
|
40
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
41
|
+
key: 'expand',
|
|
42
|
+
token: "euiDataGridCellActions.expandButtonTitle",
|
|
43
|
+
default: "Click or hit enter to interact with cell content"
|
|
44
|
+
}, function (expandButtonTitle) {
|
|
45
|
+
return (0, _react2.jsx)(_button_icon.EuiButtonIcon, {
|
|
46
|
+
className: "euiDataGridRowCell__actionButtonIcon euiDataGridRowCell__expandCell",
|
|
47
|
+
"data-test-subj": "euiDataGridCellExpandButton",
|
|
48
|
+
display: "fill",
|
|
49
|
+
color: "primary",
|
|
50
|
+
iconSize: "m",
|
|
51
|
+
iconType: "expandMini",
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
onClick: onExpandClick,
|
|
54
|
+
title: expandButtonTitle
|
|
55
|
+
});
|
|
53
56
|
});
|
|
54
|
-
});
|
|
57
|
+
}, [onExpandClick]);
|
|
55
58
|
var additionalButtons = (0, _react.useMemo)(function () {
|
|
56
59
|
if (!column || !Array.isArray(column === null || column === void 0 ? void 0 : column.cellActions)) return [];
|
|
57
60
|
var ButtonComponent = function ButtonComponent(props) {
|
|
@@ -82,9 +85,12 @@ var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
|
|
|
82
85
|
});
|
|
83
86
|
});
|
|
84
87
|
}, [column, colIndex, rowIndex]);
|
|
85
|
-
return (0, _react2.jsx)("div", {
|
|
88
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", {
|
|
86
89
|
className: "euiDataGridRowCell__actions"
|
|
87
|
-
}, [].concat((0, _toConsumableArray2.default)(additionalButtons), [expandButton]))
|
|
90
|
+
}, [].concat((0, _toConsumableArray2.default)(additionalButtons), [expandButton])), (0, _react2.jsx)("div", {
|
|
91
|
+
ref: popoverAnchorRef,
|
|
92
|
+
"data-test-subject": "cellPopoverAnchor"
|
|
93
|
+
}));
|
|
88
94
|
};
|
|
89
95
|
exports.EuiDataGridCellActions = EuiDataGridCellActions;
|
|
90
96
|
var EuiDataGridCellPopoverActions = function EuiDataGridCellPopoverActions(_ref2) {
|
|
@@ -41,7 +41,6 @@ var DataGridCellPopoverContext = /*#__PURE__*/(0, _react.createContext)({
|
|
|
41
41
|
});
|
|
42
42
|
exports.DataGridCellPopoverContext = DataGridCellPopoverContext;
|
|
43
43
|
var useCellPopover = function useCellPopover() {
|
|
44
|
-
var _cellPopoverProps$pan;
|
|
45
44
|
// Current open state & cell location are handled here
|
|
46
45
|
var _useState = (0, _react.useState)(false),
|
|
47
46
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -92,16 +91,6 @@ var useCellPopover = function useCellPopover() {
|
|
|
92
91
|
});
|
|
93
92
|
setPopoverIsOpen(true);
|
|
94
93
|
}, [popoverIsOpen, cellLocation]);
|
|
95
|
-
var cellPopoverContext = {
|
|
96
|
-
popoverIsOpen: popoverIsOpen,
|
|
97
|
-
closeCellPopover: closeCellPopover,
|
|
98
|
-
openCellPopover: openCellPopover,
|
|
99
|
-
cellLocation: cellLocation,
|
|
100
|
-
setPopoverAnchor: setPopoverAnchor,
|
|
101
|
-
setPopoverAnchorPosition: setPopoverAnchorPosition,
|
|
102
|
-
setPopoverContent: setPopoverContent,
|
|
103
|
-
setCellPopoverProps: setCellPopoverProps
|
|
104
|
-
};
|
|
105
94
|
|
|
106
95
|
// Override the default EuiPopover `onClickOutside` behavior, since the toggling
|
|
107
96
|
// popover button isn't actually the DOM node we pass to `button`. Otherwise,
|
|
@@ -113,52 +102,71 @@ var useCellPopover = function useCellPopover() {
|
|
|
113
102
|
closeCellPopover();
|
|
114
103
|
}
|
|
115
104
|
}, [popoverAnchor, closeCellPopover]);
|
|
105
|
+
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
106
|
+
if (event.key === _services.keys.F2 || event.key === _services.keys.ESCAPE) {
|
|
107
|
+
var _popoverAnchor$parent3, _popoverAnchor$parent4;
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
event.stopPropagation();
|
|
110
|
+
closeCellPopover();
|
|
111
|
+
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;
|
|
116
112
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
event.stopPropagation();
|
|
143
|
-
closeCellPopover();
|
|
144
|
-
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;
|
|
113
|
+
// Prevent cell animation flash while focus is being shifted between popover and cell
|
|
114
|
+
cell === null || cell === void 0 ? void 0 : cell.setAttribute('data-keyboard-closing', 'true');
|
|
115
|
+
// Ensure focus is returned to the parent cell, and remove animation stopgap
|
|
116
|
+
requestAnimationFrame(function () {
|
|
117
|
+
popoverAnchor === null || popoverAnchor === void 0 ? void 0 : popoverAnchor.parentElement.focus();
|
|
118
|
+
cell === null || cell === void 0 ? void 0 : cell.removeAttribute('data-keyboard-closing');
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, [popoverAnchor, closeCellPopover]);
|
|
122
|
+
var cellPopoverContext = (0, _react.useMemo)(function () {
|
|
123
|
+
return {
|
|
124
|
+
popoverIsOpen: popoverIsOpen,
|
|
125
|
+
closeCellPopover: closeCellPopover,
|
|
126
|
+
openCellPopover: openCellPopover,
|
|
127
|
+
cellLocation: cellLocation,
|
|
128
|
+
setPopoverAnchorPosition: setPopoverAnchorPosition,
|
|
129
|
+
setPopoverAnchor: setPopoverAnchor,
|
|
130
|
+
setPopoverContent: setPopoverContent,
|
|
131
|
+
setCellPopoverProps: setCellPopoverProps
|
|
132
|
+
};
|
|
133
|
+
}, [popoverIsOpen, closeCellPopover, openCellPopover, cellLocation]);
|
|
134
|
+
var cellPopover = (0, _react.useMemo)(function () {
|
|
135
|
+
var _cellPopoverProps$pan;
|
|
136
|
+
if (!popoverIsOpen || !popoverAnchor) return null;
|
|
145
137
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
138
|
+
// Note that this popover is rendered once at the top grid level, rather than one popover per cell
|
|
139
|
+
return (0, _react2.jsx)(_popover.EuiWrappingPopover, (0, _extends2.default)({
|
|
140
|
+
isOpen: popoverIsOpen,
|
|
141
|
+
display: "block",
|
|
142
|
+
hasArrow: false,
|
|
143
|
+
panelPaddingSize: "s",
|
|
144
|
+
anchorPosition: popoverAnchorPosition,
|
|
145
|
+
repositionToCrossAxis: false
|
|
146
|
+
}, cellPopoverProps, {
|
|
147
|
+
focusTrapProps: {
|
|
148
|
+
onClickOutside: onClickOutside,
|
|
149
|
+
clickOutsideDisables: false
|
|
150
|
+
},
|
|
151
|
+
panelProps: _objectSpread({
|
|
152
|
+
'data-test-subj': 'euiDataGridExpansionPopover'
|
|
153
|
+
}, cellPopoverProps.panelProps || {}),
|
|
154
|
+
panelClassName: (0, _classnames.default)('euiDataGridRowCell__popover', cellPopoverProps.panelClassName, (_cellPopoverProps$pan = cellPopoverProps.panelProps) === null || _cellPopoverProps$pan === void 0 ? void 0 : _cellPopoverProps$pan.className),
|
|
155
|
+
panelStyle: {
|
|
156
|
+
maxInlineSize: "min(75vw, max(".concat(popoverAnchor.parentElement.offsetWidth, "px, 400px))"),
|
|
157
|
+
maxBlockSize: '50vh'
|
|
158
|
+
},
|
|
159
|
+
onKeyDown: onKeyDown,
|
|
160
|
+
button: popoverAnchor,
|
|
161
|
+
closePopover: closeCellPopover
|
|
162
|
+
}), popoverContent);
|
|
163
|
+
}, [popoverIsOpen, popoverAnchor, popoverContent, cellPopoverProps, closeCellPopover, onClickOutside, onKeyDown, popoverAnchorPosition]);
|
|
164
|
+
return (0, _react.useMemo)(function () {
|
|
165
|
+
return {
|
|
166
|
+
cellPopoverContext: cellPopoverContext,
|
|
167
|
+
cellPopover: cellPopover
|
|
168
|
+
};
|
|
169
|
+
}, [cellPopoverContext, cellPopover]);
|
|
162
170
|
};
|
|
163
171
|
|
|
164
172
|
/**
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.CellWrapper = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -30,7 +30,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
30
30
|
* It grabs context, determines the type of cell being rendered
|
|
31
31
|
* (e.g. control vs data cell), & sets shared props between all cells
|
|
32
32
|
*/
|
|
33
|
-
var
|
|
33
|
+
var CellWrapper = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
34
34
|
var colIndex = _ref.colIndex,
|
|
35
35
|
visibleRowIndex = _ref.visibleRowIndex,
|
|
36
36
|
style = _ref.style,
|
|
@@ -53,9 +53,8 @@ var Cell = function Cell(_ref) {
|
|
|
53
53
|
rowManager = _ref.rowManager,
|
|
54
54
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
55
55
|
var popoverContext = (0, _react.useContext)(_data_grid_cell_popover.DataGridCellPopoverContext);
|
|
56
|
-
var _useContext = (0, _react.useContext)(_sorting.
|
|
56
|
+
var _useContext = (0, _react.useContext)(_sorting.DataGridSortedContext),
|
|
57
57
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
58
|
-
var cellContent;
|
|
59
58
|
var isFirstColumn = colIndex === 0;
|
|
60
59
|
var isLastColumn = colIndex === visibleColCount - 1;
|
|
61
60
|
var isLeadingControlColumn = colIndex < leadingControlColumns.length;
|
|
@@ -69,31 +68,33 @@ var Cell = function Cell(_ref) {
|
|
|
69
68
|
return column !== null && column !== void 0 && column.schema ? (column === null || column === void 0 ? void 0 : column.schema) === row.type : columnId === row.type;
|
|
70
69
|
})[0]) === null || _schemaDetectors$filt === void 0 ? void 0 : _schemaDetectors$filt.textTransform;
|
|
71
70
|
}, [columnId, column === null || column === void 0 ? void 0 : column.schema, schemaDetectors]);
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
71
|
+
var sharedCellProps = (0, _react.useMemo)(function () {
|
|
72
|
+
var classes = (0, _classnames.default)((0, _defineProperty2.default)({
|
|
73
|
+
'euiDataGridRowCell--firstColumn': isFirstColumn,
|
|
74
|
+
'euiDataGridRowCell--lastColumn': isLastColumn,
|
|
75
|
+
'euiDataGridRowCell--controlColumn': isLeadingControlColumn || isTrailingControlColumn
|
|
76
|
+
}, "euiDataGridRowCell--".concat(textTransform), textTransform));
|
|
77
|
+
return {
|
|
78
|
+
rowIndex: getCorrectRowIndex(visibleRowIndex),
|
|
79
|
+
visibleRowIndex: visibleRowIndex,
|
|
80
|
+
colIndex: colIndex,
|
|
81
|
+
interactiveCellId: interactiveCellId,
|
|
82
|
+
className: classes,
|
|
83
|
+
style: style,
|
|
84
|
+
rowHeightsOptions: rowHeightsOptions,
|
|
85
|
+
rowHeightUtils: rowHeightUtils,
|
|
86
|
+
setRowHeight: isFirstColumn ? setRowHeight : undefined,
|
|
87
|
+
rowManager: rowManager,
|
|
88
|
+
popoverContext: popoverContext,
|
|
89
|
+
pagination: pagination,
|
|
90
|
+
cellContext: cellContext
|
|
91
|
+
};
|
|
92
|
+
}, [colIndex, setRowHeight, visibleRowIndex, getCorrectRowIndex, interactiveCellId, style, rowHeightsOptions, rowHeightUtils, rowManager, popoverContext, pagination, cellContext, isFirstColumn, isLastColumn, isLeadingControlColumn, isTrailingControlColumn, textTransform]);
|
|
92
93
|
if (isLeadingControlColumn) {
|
|
93
94
|
var leadingColumn = leadingControlColumns[colIndex];
|
|
94
95
|
var id = leadingColumn.id,
|
|
95
96
|
rowCellRender = leadingColumn.rowCellRender;
|
|
96
|
-
|
|
97
|
+
return (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, (0, _extends2.default)({}, sharedCellProps, {
|
|
97
98
|
columnId: id,
|
|
98
99
|
width: leadingColumn.width,
|
|
99
100
|
renderCellValue: rowCellRender,
|
|
@@ -105,7 +106,7 @@ var Cell = function Cell(_ref) {
|
|
|
105
106
|
var trailingColumn = trailingControlColumns[trailingcolIndex];
|
|
106
107
|
var _id = trailingColumn.id,
|
|
107
108
|
_rowCellRender = trailingColumn.rowCellRender;
|
|
108
|
-
|
|
109
|
+
return (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, (0, _extends2.default)({}, sharedCellProps, {
|
|
109
110
|
columnId: _id,
|
|
110
111
|
width: trailingColumn.width,
|
|
111
112
|
renderCellValue: _rowCellRender,
|
|
@@ -114,9 +115,9 @@ var Cell = function Cell(_ref) {
|
|
|
114
115
|
} else {
|
|
115
116
|
// this is a normal data cell
|
|
116
117
|
var columnType = schema[columnId] ? schema[columnId].columnType : null;
|
|
117
|
-
var isExpandable = column.isExpandable !== undefined ? column.isExpandable : true;
|
|
118
|
+
var isExpandable = (column === null || column === void 0 ? void 0 : column.isExpandable) !== undefined ? column === null || column === void 0 ? void 0 : column.isExpandable : true;
|
|
118
119
|
var width = columnWidths[columnId] || defaultColumnWidth;
|
|
119
|
-
|
|
120
|
+
return (0, _react2.jsx)(_data_grid_cell.EuiDataGridCell, (0, _extends2.default)({}, sharedCellProps, {
|
|
120
121
|
columnId: columnId,
|
|
121
122
|
column: column,
|
|
122
123
|
columnType: columnType,
|
|
@@ -127,6 +128,6 @@ var Cell = function Cell(_ref) {
|
|
|
127
128
|
isExpandable: isExpandable
|
|
128
129
|
}, rest));
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
});
|
|
132
|
+
exports.CellWrapper = CellWrapper;
|
|
133
|
+
CellWrapper.displayName = 'CellWrapper';
|