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