@elastic/eui 95.10.0 → 95.11.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_theme_dark.css +0 -923
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -923
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +4 -3
- package/es/components/basic_table/collapsed_item_actions.js +24 -31
- package/es/components/datagrid/body/cell/data_grid_cell.js +98 -86
- package/es/components/datagrid/body/cell/data_grid_cell.styles.js +107 -0
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +13 -3
- package/es/components/datagrid/body/cell/data_grid_cell_actions.styles.js +33 -0
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +21 -12
- package/es/components/datagrid/body/cell/data_grid_cell_popover.styles.js +19 -0
- package/es/components/datagrid/body/cell/focus_utils.js +18 -20
- package/es/components/datagrid/body/data_grid_body.js +20 -4
- package/es/components/datagrid/body/data_grid_body.styles.js +26 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +18 -6
- package/es/components/datagrid/body/data_grid_body_virtualized.js +18 -6
- package/es/components/datagrid/body/footer/data_grid_footer.styles.js +24 -0
- package/es/components/datagrid/body/footer/data_grid_footer_row.js +10 -5
- package/es/components/datagrid/body/header/column_actions.js +16 -4
- package/es/components/datagrid/body/header/data_grid_column_resizer.js +14 -7
- package/es/components/datagrid/body/header/data_grid_column_resizer.styles.js +36 -0
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +1 -3
- package/es/components/datagrid/body/header/data_grid_header_cell.js +40 -66
- package/es/components/datagrid/body/header/data_grid_header_cell.styles.js +29 -0
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +4 -1
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +27 -0
- package/es/components/datagrid/body/header/data_grid_header_row.js +8 -2
- package/es/components/datagrid/body/header/data_grid_header_row.styles.js +21 -0
- package/es/components/datagrid/controls/column_selector.js +17 -8
- package/es/components/datagrid/controls/column_selector.styles.js +22 -0
- package/es/components/datagrid/controls/column_sorting.js +7 -2
- package/es/components/datagrid/controls/column_sorting.styles.js +35 -0
- package/es/components/datagrid/controls/column_sorting_draggable.js +19 -14
- package/es/components/datagrid/controls/data_grid_toolbar.js +8 -1
- package/es/components/datagrid/controls/data_grid_toolbar.styles.js +18 -0
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +27 -27
- package/es/components/datagrid/controls/display_selector.js +14 -3
- package/es/components/datagrid/controls/fullscreen_selector.js +8 -5
- package/es/components/datagrid/controls/fullscreen_selector.styles.js +20 -0
- package/es/components/datagrid/controls/keyboard_shortcuts.js +7 -3
- package/es/components/datagrid/controls/keyboard_shortcuts.styles.js +18 -0
- package/es/components/datagrid/data_grid.a11y.js +1 -0
- package/es/components/datagrid/data_grid.js +16 -8
- package/es/components/datagrid/data_grid.stories.utils.js +1386 -0
- package/es/components/datagrid/data_grid.styles.js +88 -0
- package/es/components/datagrid/{utils → pagination}/data_grid_pagination.js +30 -30
- package/es/components/datagrid/pagination/data_grid_pagination.styles.js +16 -0
- package/es/components/datagrid/pagination/index.js +9 -0
- package/es/components/datagrid/utils/row_heights.js +13 -15
- package/es/components/datagrid/utils/scrolling.js +14 -7
- package/es/components/datagrid/utils/scrolling.styles.js +30 -0
- package/es/components/flyout/flyout_resizable.js +6 -2
- package/es/components/flyout/flyout_resizable.styles.js +34 -5
- package/es/components/popover/popover.js +1 -1
- package/es/components/text/text.js +25 -9
- package/es/components/text/text_align.js +19 -6
- package/es/components/text/text_color.js +14 -11
- package/es/components/text/types.js +1 -0
- package/eui.d.ts +581 -108
- package/i18ntokens.json +392 -356
- package/lib/components/basic_table/basic_table.js +4 -3
- package/lib/components/basic_table/collapsed_item_actions.js +23 -30
- package/lib/components/datagrid/body/cell/data_grid_cell.js +95 -83
- package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +111 -0
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +13 -3
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.styles.js +38 -0
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +20 -11
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.styles.js +24 -0
- package/lib/components/datagrid/body/cell/focus_utils.js +17 -19
- package/lib/components/datagrid/body/data_grid_body.js +20 -4
- package/lib/components/datagrid/body/data_grid_body.styles.js +30 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +18 -6
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +18 -6
- package/lib/components/datagrid/body/footer/data_grid_footer.styles.js +30 -0
- package/lib/components/datagrid/body/footer/data_grid_footer_row.js +11 -6
- package/lib/components/datagrid/body/header/column_actions.js +16 -4
- package/lib/components/datagrid/body/header/data_grid_column_resizer.js +14 -7
- package/lib/components/datagrid/body/header/data_grid_column_resizer.styles.js +39 -0
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +1 -3
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +47 -74
- package/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +34 -0
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -0
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +32 -0
- package/lib/components/datagrid/body/header/data_grid_header_row.js +8 -2
- package/lib/components/datagrid/body/header/data_grid_header_row.styles.js +27 -0
- package/lib/components/datagrid/controls/column_selector.js +17 -8
- package/lib/components/datagrid/controls/column_selector.styles.js +28 -0
- package/lib/components/datagrid/controls/column_sorting.js +7 -2
- package/lib/components/datagrid/controls/column_sorting.styles.js +41 -0
- package/lib/components/datagrid/controls/column_sorting_draggable.js +19 -14
- package/lib/components/datagrid/controls/data_grid_toolbar.js +8 -1
- package/lib/components/datagrid/controls/data_grid_toolbar.styles.js +24 -0
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +27 -27
- package/lib/components/datagrid/controls/display_selector.js +13 -2
- package/lib/components/datagrid/controls/fullscreen_selector.js +7 -4
- package/lib/components/datagrid/controls/fullscreen_selector.styles.js +26 -0
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +6 -2
- package/lib/components/datagrid/controls/keyboard_shortcuts.styles.js +24 -0
- package/lib/components/datagrid/data_grid.a11y.js +1 -0
- package/lib/components/datagrid/data_grid.js +15 -7
- package/lib/components/datagrid/data_grid.stories.utils.js +1391 -0
- package/lib/components/datagrid/data_grid.styles.js +94 -0
- package/lib/components/datagrid/{utils → pagination}/data_grid_pagination.js +30 -30
- package/lib/components/datagrid/pagination/data_grid_pagination.styles.js +22 -0
- package/lib/components/datagrid/pagination/index.js +18 -0
- package/lib/components/datagrid/utils/row_heights.js +13 -14
- package/lib/components/datagrid/utils/scrolling.js +14 -7
- package/lib/components/datagrid/utils/scrolling.styles.js +36 -0
- package/lib/components/flyout/flyout_resizable.js +6 -2
- package/lib/components/flyout/flyout_resizable.styles.js +34 -5
- package/lib/components/popover/popover.js +1 -1
- package/lib/components/text/text.js +25 -9
- package/lib/components/text/text_align.js +19 -6
- package/lib/components/text/text_color.js +14 -11
- package/lib/components/text/types.js +5 -0
- package/optimize/es/components/basic_table/basic_table.js +4 -3
- package/optimize/es/components/basic_table/collapsed_item_actions.js +24 -31
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +87 -81
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +107 -0
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +13 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.styles.js +33 -0
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +21 -12
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.styles.js +19 -0
- package/optimize/es/components/datagrid/body/cell/focus_utils.js +18 -20
- package/optimize/es/components/datagrid/body/data_grid_body.js +9 -2
- package/optimize/es/components/datagrid/body/data_grid_body.styles.js +26 -0
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +7 -4
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +7 -4
- package/optimize/es/components/datagrid/body/footer/data_grid_footer.styles.js +24 -0
- package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +10 -5
- package/optimize/es/components/datagrid/body/header/column_actions.js +16 -4
- package/optimize/es/components/datagrid/body/header/data_grid_column_resizer.js +14 -7
- package/optimize/es/components/datagrid/body/header/data_grid_column_resizer.styles.js +36 -0
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +1 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +40 -61
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.styles.js +29 -0
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +4 -1
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +27 -0
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +8 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.styles.js +21 -0
- package/optimize/es/components/datagrid/controls/column_selector.js +17 -8
- package/optimize/es/components/datagrid/controls/column_selector.styles.js +22 -0
- package/optimize/es/components/datagrid/controls/column_sorting.js +7 -2
- package/optimize/es/components/datagrid/controls/column_sorting.styles.js +35 -0
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +19 -14
- package/optimize/es/components/datagrid/controls/data_grid_toolbar.js +8 -1
- package/optimize/es/components/datagrid/controls/data_grid_toolbar.styles.js +18 -0
- package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +27 -27
- package/optimize/es/components/datagrid/controls/display_selector.js +14 -3
- package/optimize/es/components/datagrid/controls/fullscreen_selector.js +8 -5
- package/optimize/es/components/datagrid/controls/fullscreen_selector.styles.js +20 -0
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +7 -3
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.styles.js +18 -0
- package/optimize/es/components/datagrid/data_grid.a11y.js +1 -0
- package/optimize/es/components/datagrid/data_grid.js +16 -8
- package/optimize/es/components/datagrid/data_grid.stories.utils.js +333 -0
- package/optimize/es/components/datagrid/data_grid.styles.js +88 -0
- package/optimize/es/components/datagrid/{utils → pagination}/data_grid_pagination.js +30 -30
- package/optimize/es/components/datagrid/pagination/data_grid_pagination.styles.js +16 -0
- package/optimize/es/components/datagrid/pagination/index.js +9 -0
- package/optimize/es/components/datagrid/utils/row_heights.js +13 -15
- package/optimize/es/components/datagrid/utils/scrolling.js +14 -7
- package/optimize/es/components/datagrid/utils/scrolling.styles.js +30 -0
- package/optimize/es/components/flyout/flyout_resizable.js +6 -2
- package/optimize/es/components/flyout/flyout_resizable.styles.js +34 -5
- package/optimize/es/components/popover/popover.js +1 -1
- package/optimize/es/components/text/text.js +9 -4
- package/optimize/es/components/text/text_align.js +4 -2
- package/optimize/es/components/text/text_color.js +1 -2
- package/optimize/es/components/text/types.js +1 -0
- package/optimize/lib/components/basic_table/basic_table.js +4 -3
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +23 -30
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +84 -78
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +111 -0
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +13 -3
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.styles.js +39 -0
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +20 -11
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.styles.js +25 -0
- package/optimize/lib/components/datagrid/body/cell/focus_utils.js +17 -19
- package/optimize/lib/components/datagrid/body/data_grid_body.js +9 -2
- package/optimize/lib/components/datagrid/body/data_grid_body.styles.js +30 -0
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +7 -4
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -4
- package/optimize/lib/components/datagrid/body/footer/data_grid_footer.styles.js +30 -0
- package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +10 -5
- package/optimize/lib/components/datagrid/body/header/column_actions.js +16 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_column_resizer.js +14 -7
- package/optimize/lib/components/datagrid/body/header/data_grid_column_resizer.styles.js +39 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +1 -3
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +43 -63
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +34 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +32 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +8 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.styles.js +27 -0
- package/optimize/lib/components/datagrid/controls/column_selector.js +17 -8
- package/optimize/lib/components/datagrid/controls/column_selector.styles.js +28 -0
- package/optimize/lib/components/datagrid/controls/column_sorting.js +7 -2
- package/optimize/lib/components/datagrid/controls/column_sorting.styles.js +41 -0
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +19 -14
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar.js +8 -1
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar.styles.js +24 -0
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +27 -27
- package/optimize/lib/components/datagrid/controls/display_selector.js +13 -2
- package/optimize/lib/components/datagrid/controls/fullscreen_selector.js +7 -4
- package/optimize/lib/components/datagrid/controls/fullscreen_selector.styles.js +26 -0
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +6 -2
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.styles.js +24 -0
- package/optimize/lib/components/datagrid/data_grid.a11y.js +1 -0
- package/optimize/lib/components/datagrid/data_grid.js +15 -7
- package/optimize/lib/components/datagrid/data_grid.stories.utils.js +341 -0
- package/optimize/lib/components/datagrid/data_grid.styles.js +94 -0
- package/{test-env/components/datagrid/utils → optimize/lib/components/datagrid/pagination}/data_grid_pagination.js +29 -31
- package/optimize/lib/components/datagrid/pagination/data_grid_pagination.styles.js +22 -0
- package/optimize/lib/components/datagrid/pagination/index.js +18 -0
- package/optimize/lib/components/datagrid/utils/row_heights.js +13 -14
- package/optimize/lib/components/datagrid/utils/scrolling.js +14 -7
- package/optimize/lib/components/datagrid/utils/scrolling.styles.js +36 -0
- package/optimize/lib/components/flyout/flyout_resizable.js +6 -2
- package/optimize/lib/components/flyout/flyout_resizable.styles.js +34 -5
- package/optimize/lib/components/popover/popover.js +1 -1
- package/optimize/lib/components/text/text.js +9 -4
- package/optimize/lib/components/text/text_align.js +4 -2
- package/optimize/lib/components/text/text_color.js +1 -2
- package/optimize/lib/components/text/types.js +5 -0
- package/package.json +3 -3
- package/src/themes/amsterdam/theme_dark.scss +0 -7
- package/src/themes/amsterdam/theme_light.scss +0 -7
- package/test-env/components/basic_table/basic_table.js +4 -3
- package/test-env/components/basic_table/collapsed_item_actions.js +23 -30
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +90 -83
- package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +111 -0
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +13 -3
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.styles.js +39 -0
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +20 -11
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.styles.js +25 -0
- package/test-env/components/datagrid/body/cell/focus_utils.js +17 -19
- package/test-env/components/datagrid/body/data_grid_body.js +20 -4
- package/test-env/components/datagrid/body/data_grid_body.styles.js +30 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +18 -6
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +18 -6
- package/test-env/components/datagrid/body/footer/data_grid_footer.styles.js +30 -0
- package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +10 -5
- package/test-env/components/datagrid/body/header/column_actions.js +16 -4
- package/test-env/components/datagrid/body/header/data_grid_column_resizer.js +14 -7
- package/test-env/components/datagrid/body/header/data_grid_column_resizer.styles.js +39 -0
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +1 -3
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +43 -67
- package/test-env/components/datagrid/body/header/data_grid_header_cell.styles.js +34 -0
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -0
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +32 -0
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +8 -2
- package/test-env/components/datagrid/body/header/data_grid_header_row.styles.js +27 -0
- package/test-env/components/datagrid/controls/column_selector.js +17 -8
- package/test-env/components/datagrid/controls/column_selector.styles.js +28 -0
- package/test-env/components/datagrid/controls/column_sorting.js +7 -2
- package/test-env/components/datagrid/controls/column_sorting.styles.js +41 -0
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +19 -14
- package/test-env/components/datagrid/controls/data_grid_toolbar.js +8 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar.styles.js +24 -0
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +27 -27
- package/test-env/components/datagrid/controls/display_selector.js +13 -2
- package/test-env/components/datagrid/controls/fullscreen_selector.js +7 -4
- package/test-env/components/datagrid/controls/fullscreen_selector.styles.js +26 -0
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +6 -2
- package/test-env/components/datagrid/controls/keyboard_shortcuts.styles.js +24 -0
- package/test-env/components/datagrid/data_grid.a11y.js +1 -0
- package/test-env/components/datagrid/data_grid.js +15 -7
- package/test-env/components/datagrid/data_grid.stories.utils.js +1386 -0
- package/test-env/components/datagrid/data_grid.styles.js +94 -0
- package/{optimize/lib/components/datagrid/utils → test-env/components/datagrid/pagination}/data_grid_pagination.js +29 -31
- package/test-env/components/datagrid/pagination/data_grid_pagination.styles.js +22 -0
- package/test-env/components/datagrid/pagination/index.js +18 -0
- package/test-env/components/datagrid/utils/row_heights.js +13 -14
- package/test-env/components/datagrid/utils/scrolling.js +14 -7
- package/test-env/components/datagrid/utils/scrolling.styles.js +36 -0
- package/test-env/components/flyout/flyout_resizable.js +6 -2
- package/test-env/components/flyout/flyout_resizable.styles.js +34 -5
- package/test-env/components/popover/popover.js +1 -1
- package/test-env/components/text/text.js +25 -9
- package/test-env/components/text/text_align.js +19 -6
- package/test-env/components/text/text_color.js +14 -11
- package/test-env/components/text/types.js +5 -0
- package/src/components/datagrid/_data_grid.scss +0 -121
- package/src/components/datagrid/_data_grid_data_row.scss +0 -303
- package/src/components/datagrid/_index.scss +0 -12
- package/src/components/datagrid/_mixins.scss +0 -84
- package/src/components/datagrid/_variables.scss +0 -11
- package/src/components/datagrid/body/footer/_data_grid_footer_row.scss +0 -47
- package/src/components/datagrid/body/header/_data_grid_column_resizer.scss +0 -48
- package/src/components/datagrid/body/header/_data_grid_header_row.scss +0 -219
- package/src/components/datagrid/controls/_data_grid_column_selector.scss +0 -19
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +0 -43
- package/src/components/datagrid/controls/_data_grid_display.scss +0 -3
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +0 -11
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -55
- package/src/components/index.scss +0 -3
- package/src/themes/amsterdam/overrides/_data_grid.scss +0 -5
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
import { logicalCSS, mathWithUnits } from '../../../global_styling';
|
|
11
|
+
export var euiDataGridScrollBarStyles = function euiDataGridScrollBarStyles(euiThemeContext) {
|
|
12
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
13
|
+
|
|
14
|
+
// Note that 'borders' *must* be rendered with inset box-shadow, because actual
|
|
15
|
+
// `border` CSS will affect the relative position of the child scroll bar overlays
|
|
16
|
+
// and cause them to be off by the width of the border
|
|
17
|
+
var borderWidth = euiTheme.border.width.thin;
|
|
18
|
+
var borderColor = euiTheme.border.color;
|
|
19
|
+
return {
|
|
20
|
+
euiDataGrid__scrollOverlay: /*#__PURE__*/css("position:absolute;inset:0;", logicalCSS('top', "-".concat(borderWidth)), "pointer-events:none;box-shadow:inset 0 0 0 ", borderWidth, " ", borderColor, ";.euiDataGrid--bordersHorizontal &{box-shadow:inset 0 -", mathWithUnits(borderWidth, function (x) {
|
|
21
|
+
return x * 2;
|
|
22
|
+
}), " 0 -", borderWidth, " ", borderColor, ";};label:euiDataGrid__scrollOverlay;"),
|
|
23
|
+
// Ensure the horizontal scrollbar has a top border
|
|
24
|
+
euiDataGrid__scrollBarOverlayBottom: /*#__PURE__*/css("position:absolute;inset-inline:0;", logicalCSS('height', borderWidth), " background-color:", borderColor, ";;label:euiDataGrid__scrollBarOverlayBottom;"),
|
|
25
|
+
// Ensure the vertical scrollbar has a left border
|
|
26
|
+
euiDataGrid__scrollBarOverlayRight: /*#__PURE__*/css("position:absolute;", logicalCSS('width', borderWidth), " background-color:", borderColor, ";;label:euiDataGrid__scrollBarOverlayRight;")
|
|
27
|
+
// Note: Scroll bar border positions are set via JS inline style, since
|
|
28
|
+
// JS has access to the exact OS scrollbar width/height and CSS doesn't
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["size", "maxWidth", "minWidth", "onResize", "side", "type", "children"];
|
|
4
|
+
var _excluded = ["size", "maxWidth", "minWidth", "onResize", "side", "type", "ownFocus", "children"];
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -29,10 +29,13 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
29
29
|
side = _ref$side === void 0 ? 'right' : _ref$side,
|
|
30
30
|
_ref$type = _ref.type,
|
|
31
31
|
type = _ref$type === void 0 ? 'overlay' : _ref$type,
|
|
32
|
+
_ref$ownFocus = _ref.ownFocus,
|
|
33
|
+
ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
|
|
32
34
|
children = _ref.children,
|
|
33
35
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
var hasOverlay = type === 'overlay' && ownFocus;
|
|
34
37
|
var styles = useEuiMemoizedStyles(euiFlyoutResizableButtonStyles);
|
|
35
|
-
var cssStyles = [styles.euiFlyoutResizableButton, styles[type][side]];
|
|
38
|
+
var cssStyles = [styles.euiFlyoutResizableButton, styles[type][side], !hasOverlay && styles.noOverlay.noOverlay, !hasOverlay && styles.noOverlay[side]];
|
|
36
39
|
var getFlyoutMinMaxWidth = useCallback(function (width) {
|
|
37
40
|
return Math.min(Math.max(width, minWidth), maxWidth || Infinity, window.innerWidth - 20 // Leave some offset
|
|
38
41
|
);
|
|
@@ -136,6 +139,7 @@ export var EuiFlyoutResizable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
136
139
|
maxWidth: maxWidth,
|
|
137
140
|
side: side,
|
|
138
141
|
type: type,
|
|
142
|
+
ownFocus: ownFocus,
|
|
139
143
|
ref: setRefs
|
|
140
144
|
}), ___EmotionJSX(EuiResizableButton, {
|
|
141
145
|
isHorizontal: true,
|
|
@@ -10,6 +10,30 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalCSS } from '../../global_styling';
|
|
12
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
+
name: "1vfos8p-right",
|
|
14
|
+
styles: "justify-content:flex-start;label:right;"
|
|
15
|
+
} : {
|
|
16
|
+
name: "1vfos8p-right",
|
|
17
|
+
styles: "justify-content:flex-start;label:right;",
|
|
18
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
|
+
};
|
|
20
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "1ydooaf-left",
|
|
22
|
+
styles: "justify-content:flex-end;label:left;"
|
|
23
|
+
} : {
|
|
24
|
+
name: "1ydooaf-left",
|
|
25
|
+
styles: "justify-content:flex-end;label:left;",
|
|
26
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
|
+
};
|
|
28
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
29
|
+
name: "1cw850z-noOverlay",
|
|
30
|
+
styles: "margin-inline:0;label:noOverlay;"
|
|
31
|
+
} : {
|
|
32
|
+
name: "1cw850z-noOverlay",
|
|
33
|
+
styles: "margin-inline:0;label:noOverlay;",
|
|
34
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
|
+
};
|
|
36
|
+
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
13
37
|
name: "1gfwqnd-euiFlyoutResizableButton",
|
|
14
38
|
styles: "position:absolute;label:euiFlyoutResizableButton;"
|
|
15
39
|
} : {
|
|
@@ -17,17 +41,22 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
17
41
|
styles: "position:absolute;label:euiFlyoutResizableButton;",
|
|
18
42
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
43
|
};
|
|
20
|
-
export var euiFlyoutResizableButtonStyles = function euiFlyoutResizableButtonStyles(
|
|
21
|
-
var euiTheme =
|
|
44
|
+
export var euiFlyoutResizableButtonStyles = function euiFlyoutResizableButtonStyles(_ref5) {
|
|
45
|
+
var euiTheme = _ref5.euiTheme;
|
|
22
46
|
return {
|
|
23
|
-
euiFlyoutResizableButton:
|
|
47
|
+
euiFlyoutResizableButton: _ref4,
|
|
24
48
|
overlay: {
|
|
25
49
|
left: /*#__PURE__*/css(logicalCSS('right', 0), ";;label:left;"),
|
|
26
50
|
right: /*#__PURE__*/css(logicalCSS('left', 0), ";;label:right;")
|
|
27
51
|
},
|
|
28
52
|
push: {
|
|
29
|
-
left: /*#__PURE__*/css(logicalCSS('right', "-".concat(euiTheme.border.width.
|
|
30
|
-
right: /*#__PURE__*/css(logicalCSS('left', "-".concat(euiTheme.border.width.
|
|
53
|
+
left: /*#__PURE__*/css(logicalCSS('right', "-".concat(euiTheme.border.width.thick)), ";;label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css(logicalCSS('left', "-".concat(euiTheme.border.width.thick)), ";;label:right;")
|
|
55
|
+
},
|
|
56
|
+
noOverlay: {
|
|
57
|
+
noOverlay: _ref3,
|
|
58
|
+
left: _ref2,
|
|
59
|
+
right: _ref
|
|
31
60
|
}
|
|
32
61
|
};
|
|
33
62
|
};
|
|
@@ -421,7 +421,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
421
421
|
}), popoverScreenReaderText));
|
|
422
422
|
}
|
|
423
423
|
var returnFocus = this.state.isOpenStable ? returnFocusConfig : false;
|
|
424
|
-
panel = ___EmotionJSX(EuiPortal, {
|
|
424
|
+
panel = ___EmotionJSX(EuiPortal, insert && {
|
|
425
425
|
insert: insert
|
|
426
426
|
}, ___EmotionJSX(EuiFocusTrap, _extends({
|
|
427
427
|
clickOutsideDisables: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["size", "color", "grow", "textAlign", "children", "className"];
|
|
3
|
+
var _excluded = ["component", "size", "color", "grow", "textAlign", "children", "className"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -12,13 +12,15 @@ var _excluded = ["size", "color", "grow", "textAlign", "children", "className"];
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiMemoizedStyles } from '../../services';
|
|
15
|
-
import { euiTextStyles } from './text.styles';
|
|
16
15
|
import { EuiTextColor } from './text_color';
|
|
17
16
|
import { EuiTextAlign } from './text_align';
|
|
17
|
+
import { euiTextStyles } from './text.styles';
|
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
19
|
export var TEXT_SIZES = ['xs', 's', 'm', 'relative'];
|
|
20
20
|
export var EuiText = function EuiText(_ref) {
|
|
21
|
-
var _ref$
|
|
21
|
+
var _ref$component = _ref.component,
|
|
22
|
+
component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
23
|
+
_ref$size = _ref.size,
|
|
22
24
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
23
25
|
color = _ref.color,
|
|
24
26
|
_ref$grow = _ref.grow,
|
|
@@ -30,12 +32,14 @@ export var EuiText = function EuiText(_ref) {
|
|
|
30
32
|
var styles = useEuiMemoizedStyles(euiTextStyles);
|
|
31
33
|
var cssStyles = [styles.euiText, !grow ? styles.constrainedWidth : undefined, styles[size]];
|
|
32
34
|
var classes = classNames('euiText', className);
|
|
33
|
-
var
|
|
35
|
+
var Component = component;
|
|
36
|
+
var text = ___EmotionJSX(Component, _extends({
|
|
34
37
|
css: cssStyles,
|
|
35
38
|
className: classes
|
|
36
39
|
}, rest), children);
|
|
37
40
|
if (color) {
|
|
38
41
|
text = ___EmotionJSX(EuiTextColor, {
|
|
42
|
+
component: component,
|
|
39
43
|
color: color,
|
|
40
44
|
className: classes,
|
|
41
45
|
cloneElement: true
|
|
@@ -43,6 +47,7 @@ export var EuiText = function EuiText(_ref) {
|
|
|
43
47
|
}
|
|
44
48
|
if (textAlign) {
|
|
45
49
|
text = ___EmotionJSX(EuiTextAlign, {
|
|
50
|
+
component: component,
|
|
46
51
|
textAlign: textAlign,
|
|
47
52
|
className: classes,
|
|
48
53
|
cloneElement: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "textAlign", "cloneElement"];
|
|
3
|
+
var _excluded = ["children", "component", "textAlign", "cloneElement"];
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
/*
|
|
@@ -18,6 +18,8 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
18
18
|
export var ALIGNMENTS = ['left', 'right', 'center'];
|
|
19
19
|
export var EuiTextAlign = function EuiTextAlign(_ref) {
|
|
20
20
|
var children = _ref.children,
|
|
21
|
+
_ref$component = _ref.component,
|
|
22
|
+
Component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
21
23
|
_ref$textAlign = _ref.textAlign,
|
|
22
24
|
textAlign = _ref$textAlign === void 0 ? 'left' : _ref$textAlign,
|
|
23
25
|
_ref$cloneElement = _ref.cloneElement,
|
|
@@ -30,6 +32,6 @@ export var EuiTextAlign = function EuiTextAlign(_ref) {
|
|
|
30
32
|
if ( /*#__PURE__*/isValidElement(children) && cloneElement) {
|
|
31
33
|
return cloneElementWithCss(children, props);
|
|
32
34
|
} else {
|
|
33
|
-
return ___EmotionJSX(
|
|
35
|
+
return ___EmotionJSX(Component, props, children);
|
|
34
36
|
}
|
|
35
37
|
};
|
|
@@ -24,7 +24,7 @@ export var EuiTextColor = function EuiTextColor(_ref) {
|
|
|
24
24
|
_ref$color = _ref.color,
|
|
25
25
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
26
26
|
_ref$component = _ref.component,
|
|
27
|
-
|
|
27
|
+
Component = _ref$component === void 0 ? 'span' : _ref$component,
|
|
28
28
|
_ref$cloneElement = _ref.cloneElement,
|
|
29
29
|
cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
|
|
30
30
|
style = _ref.style,
|
|
@@ -49,7 +49,6 @@ export var EuiTextColor = function EuiTextColor(_ref) {
|
|
|
49
49
|
style: childrenStyle
|
|
50
50
|
}));
|
|
51
51
|
} else {
|
|
52
|
-
var Component = component;
|
|
53
52
|
return ___EmotionJSX(Component, props, children);
|
|
54
53
|
}
|
|
55
54
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -705,7 +705,7 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
705
705
|
var hasCustomActions = columnActions.some(function (action) {
|
|
706
706
|
return !!action.render;
|
|
707
707
|
});
|
|
708
|
-
cells.push(_this5.renderItemActionsCell(itemId, item, column, columnIndex, hasCustomActions));
|
|
708
|
+
cells.push(_this5.renderItemActionsCell(itemId, item, column, columnIndex, rowIndex, hasCustomActions));
|
|
709
709
|
// A table theoretically could have both custom and default action items
|
|
710
710
|
// If it has both, default action mobile row styles take precedence over custom
|
|
711
711
|
hasActions = !hasActions && hasCustomActions ? 'custom' : true;
|
|
@@ -794,7 +794,7 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
794
794
|
}
|
|
795
795
|
}, {
|
|
796
796
|
key: "renderItemActionsCell",
|
|
797
|
-
value: function renderItemActionsCell(itemId, item, column, columnIndex, hasCustomActions) {
|
|
797
|
+
value: function renderItemActionsCell(itemId, item, column, columnIndex, rowIndex, hasCustomActions) {
|
|
798
798
|
// Disable all actions if any row(s) are selected
|
|
799
799
|
var allDisabled = this.state.selection.length > 0;
|
|
800
800
|
var actualActions = column.actions.filter(function (action) {
|
|
@@ -831,7 +831,8 @@ var EuiBasicTable = exports.EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
831
831
|
actions: column.actions,
|
|
832
832
|
actionsDisabled: allDisabled,
|
|
833
833
|
itemId: itemId,
|
|
834
|
-
item: item
|
|
834
|
+
item: item,
|
|
835
|
+
displayedRowIndex: rowIndex
|
|
835
836
|
});
|
|
836
837
|
}
|
|
837
838
|
});
|
|
@@ -30,6 +30,7 @@ var CollapsedItemActions = exports.CollapsedItemActions = function CollapsedItem
|
|
|
30
30
|
itemId = _ref.itemId,
|
|
31
31
|
item = _ref.item,
|
|
32
32
|
actionsDisabled = _ref.actionsDisabled,
|
|
33
|
+
displayedRowIndex = _ref.displayedRowIndex,
|
|
33
34
|
className = _ref.className;
|
|
34
35
|
var _useState = (0, _react.useState)(false),
|
|
35
36
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -38,6 +39,11 @@ var CollapsedItemActions = exports.CollapsedItemActions = function CollapsedItem
|
|
|
38
39
|
var closePopover = (0, _react.useCallback)(function () {
|
|
39
40
|
return setPopoverOpen(false);
|
|
40
41
|
}, []);
|
|
42
|
+
var allActionsTooltip = (0, _i18n.useEuiI18n)('euiCollapsedItemActions.allActionsTooltip', 'All actions');
|
|
43
|
+
var allActionsButtonAriaLabel = (0, _i18n.useEuiI18n)('euiCollapsedItemActions.allActions', 'All actions, row {index}', {
|
|
44
|
+
index: displayedRowIndex + 1
|
|
45
|
+
});
|
|
46
|
+
var allActionsButtonDisabledAriaLabel = (0, _i18n.useEuiI18n)('euiCollapsedItemActions.allActionsDisabled', 'Individual item actions are disabled when rows are being selected.');
|
|
41
47
|
var controls = (0, _react.useMemo)(function () {
|
|
42
48
|
return actions.reduce(function (controls, action, index) {
|
|
43
49
|
var _action$available, _action$available2;
|
|
@@ -88,37 +94,24 @@ var CollapsedItemActions = exports.CollapsedItemActions = function CollapsedItem
|
|
|
88
94
|
return controls;
|
|
89
95
|
}, []);
|
|
90
96
|
}, [actions, actionsDisabled, item, closePopover]);
|
|
91
|
-
var popoverButton = (0, _react2.jsx)(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
isDisabled: actionsDisabled,
|
|
105
|
-
onClick: function onClick() {
|
|
106
|
-
return setPopoverOpen(function (isOpen) {
|
|
107
|
-
return !isOpen;
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
"data-test-subj": "euiCollapsedItemActionsButton"
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
var withTooltip = !actionsDisabled && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
114
|
-
token: "euiCollapsedItemActions.allActions",
|
|
115
|
-
default: "All actions"
|
|
116
|
-
}, function (allActions) {
|
|
117
|
-
return (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
118
|
-
content: allActions,
|
|
119
|
-
delay: "long"
|
|
120
|
-
}, popoverButton);
|
|
97
|
+
var popoverButton = (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
98
|
+
className: className,
|
|
99
|
+
"aria-label": actionsDisabled ? allActionsButtonDisabledAriaLabel : allActionsButtonAriaLabel,
|
|
100
|
+
title: actionsDisabled ? allActionsButtonDisabledAriaLabel : undefined,
|
|
101
|
+
iconType: "boxesHorizontal",
|
|
102
|
+
color: "text",
|
|
103
|
+
isDisabled: actionsDisabled,
|
|
104
|
+
onClick: function onClick() {
|
|
105
|
+
return setPopoverOpen(function (isOpen) {
|
|
106
|
+
return !isOpen;
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
"data-test-subj": "euiCollapsedItemActionsButton"
|
|
121
110
|
});
|
|
111
|
+
var withTooltip = !actionsDisabled && (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
112
|
+
content: allActionsTooltip,
|
|
113
|
+
delay: "long"
|
|
114
|
+
}, popoverButton);
|
|
122
115
|
return (0, _react2.jsx)(_popover.EuiPopover, {
|
|
123
116
|
className: className,
|
|
124
117
|
id: "".concat(itemId, "-actions"),
|
|
@@ -13,6 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
13
13
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
16
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
16
17
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -27,10 +28,12 @@ var _focus = require("../../utils/focus");
|
|
|
27
28
|
var _data_grid_cell_actions = require("./data_grid_cell_actions");
|
|
28
29
|
var _data_grid_cell_popover = require("./data_grid_cell_popover");
|
|
29
30
|
var _focus_utils = require("./focus_utils");
|
|
31
|
+
var _data_grid_cell = require("./data_grid_cell.styles");
|
|
30
32
|
var _react2 = require("@emotion/react");
|
|
31
|
-
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "
|
|
33
|
+
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeight", "rowHeightUtils", "isControlColumn"],
|
|
32
34
|
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
33
|
-
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"]
|
|
35
|
+
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"],
|
|
36
|
+
_excluded4 = ["columnId", "columnIndex", "rowIndex", "visibleRowIndex"];
|
|
34
37
|
/*
|
|
35
38
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
36
39
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -51,14 +54,9 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
51
54
|
setCellContentsRef = _ref.setCellContentsRef,
|
|
52
55
|
rowIndex = _ref.rowIndex,
|
|
53
56
|
colIndex = _ref.colIndex,
|
|
54
|
-
ariaRowIndex = _ref.ariaRowIndex,
|
|
55
57
|
rowHeight = _ref.rowHeight,
|
|
56
58
|
rowHeightUtils = _ref.rowHeightUtils,
|
|
57
59
|
isControlColumn = _ref.isControlColumn,
|
|
58
|
-
isFocused = _ref.isFocused,
|
|
59
|
-
showCellActions = _ref.showCellActions,
|
|
60
|
-
onExpandClick = _ref.onExpandClick,
|
|
61
|
-
popoverAnchorRef = _ref.popoverAnchorRef,
|
|
62
60
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
63
61
|
// React is more permissive than the TS types indicate
|
|
64
62
|
var CellElement = renderCellValue;
|
|
@@ -71,39 +69,29 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
71
69
|
'eui-textTruncate': cellHeightType === 'default'
|
|
72
70
|
});
|
|
73
71
|
}, [cellHeightType, isControlColumn]);
|
|
74
|
-
|
|
72
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_cell.euiDataGridRowCellStyles);
|
|
73
|
+
var cssStyles = [styles.content.euiDataGridRowCell__content].concat((0, _toConsumableArray2.default)(isControlColumn ? [
|
|
74
|
+
// Control column cells should not be vertically centered (defaultHeight) except
|
|
75
|
+
// on single rows. They should be top-aligned for auto and lineCount heights
|
|
76
|
+
styles.content.controlColumn, cellHeightType === 'default' ? styles.content.defaultHeight : styles.content.autoHeight] : [
|
|
77
|
+
// Regular data cells should always inherit height from the row wrapper,
|
|
78
|
+
// except for auto height
|
|
79
|
+
cellHeightType === 'auto' ? styles.content.autoHeight : styles.content.defaultHeight]));
|
|
80
|
+
return (0, _react2.jsx)(RenderTruncatedCellContent, {
|
|
75
81
|
hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
|
|
76
82
|
rowHeight: rowHeight
|
|
77
83
|
}, (0, _react2.jsx)("div", {
|
|
78
84
|
ref: setCellContentsRef,
|
|
79
85
|
"data-datagrid-cellcontent": true,
|
|
80
|
-
className: classes
|
|
86
|
+
className: classes,
|
|
87
|
+
css: cssStyles
|
|
81
88
|
}, (0, _react2.jsx)(CellElement, (0, _extends2.default)({
|
|
82
89
|
isDetails: false,
|
|
83
90
|
"data-test-subj": "cell-content",
|
|
84
91
|
rowIndex: rowIndex,
|
|
85
92
|
colIndex: colIndex,
|
|
86
93
|
schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
|
|
87
|
-
}, cellContext, rest))))
|
|
88
|
-
hidden: !isFocused
|
|
89
|
-
}, '- ', (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
90
|
-
token: "euiDataGridCell.position",
|
|
91
|
-
default: "{columnId}, column {col}, row {row}",
|
|
92
|
-
values: {
|
|
93
|
-
columnId: (column === null || column === void 0 ? void 0 : column.displayAsText) || rest.columnId,
|
|
94
|
-
col: colIndex + 1,
|
|
95
|
-
row: ariaRowIndex
|
|
96
|
-
}
|
|
97
|
-
}), showCellActions && (0, _react2.jsx)(_react.default.Fragment, null, '. ', (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
98
|
-
token: "euiDataGridCell.expansionEnterPrompt",
|
|
99
|
-
default: "Press the Enter key to expand this cell."
|
|
100
|
-
})))), showCellActions && (0, _react2.jsx)(_data_grid_cell_actions.EuiDataGridCellActions, {
|
|
101
|
-
rowIndex: rowIndex,
|
|
102
|
-
colIndex: colIndex,
|
|
103
|
-
column: column,
|
|
104
|
-
onExpandClick: onExpandClick,
|
|
105
|
-
popoverAnchorRef: popoverAnchorRef
|
|
106
|
-
}));
|
|
94
|
+
}, cellContext, rest))));
|
|
107
95
|
});
|
|
108
96
|
EuiDataGridCellContent.displayName = 'EuiDataGridCellContent';
|
|
109
97
|
var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
@@ -122,8 +110,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
122
110
|
(0, _defineProperty2.default)(_this, "state", {
|
|
123
111
|
cellProps: {},
|
|
124
112
|
isFocused: false,
|
|
125
|
-
isHovered: false
|
|
126
|
-
cellTextAlign: 'Left'
|
|
113
|
+
isHovered: false
|
|
127
114
|
});
|
|
128
115
|
(0, _defineProperty2.default)(_this, "unsubscribeCell", void 0);
|
|
129
116
|
(0, _defineProperty2.default)(_this, "style", null);
|
|
@@ -205,29 +192,6 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
205
192
|
} else if (_this.contentObserver) {
|
|
206
193
|
_this.contentObserver.disconnect();
|
|
207
194
|
}
|
|
208
|
-
_this.setCellTextAlign();
|
|
209
|
-
});
|
|
210
|
-
(0, _defineProperty2.default)(_this, "setCellTextAlign", function () {
|
|
211
|
-
if (_this.cellContentsRef) {
|
|
212
|
-
var columnType = _this.props.columnType;
|
|
213
|
-
if (!columnType) {
|
|
214
|
-
// If no schema was set, this is likely a left aligned column
|
|
215
|
-
_this.setState({
|
|
216
|
-
cellTextAlign: 'Left'
|
|
217
|
-
});
|
|
218
|
-
} else if (columnType === 'numeric' || columnType === 'currency') {
|
|
219
|
-
// Default EUI schemas that we know set right text align
|
|
220
|
-
_this.setState({
|
|
221
|
-
cellTextAlign: 'Right'
|
|
222
|
-
});
|
|
223
|
-
} else {
|
|
224
|
-
// If the consumer is using a custom schema, it may have custom text alignment
|
|
225
|
-
var textAlign = window.getComputedStyle(_this.cellContentsRef).getPropertyValue('text-align');
|
|
226
|
-
_this.setState({
|
|
227
|
-
cellTextAlign: textAlign === 'right' || textAlign === 'end' ? 'Right' : 'Left'
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
195
|
});
|
|
232
196
|
(0, _defineProperty2.default)(_this, "isExpandable", function () {
|
|
233
197
|
var _this$props$column, _this$state$cellProps;
|
|
@@ -256,7 +220,9 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
256
220
|
// Set popover anchor
|
|
257
221
|
var cellAnchorEl = _this.popoverAnchorRef.current;
|
|
258
222
|
setPopoverAnchor(cellAnchorEl);
|
|
259
|
-
|
|
223
|
+
// TODO: Potentially switch to `topLeft` based on occlusion with sticky header
|
|
224
|
+
// @see https://github.com/elastic/eui/issues/7828
|
|
225
|
+
setPopoverAnchorPosition('downLeft');
|
|
260
226
|
|
|
261
227
|
// Set popover contents with cell content
|
|
262
228
|
var _this$props5 = _this.props,
|
|
@@ -458,7 +424,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
458
424
|
var isExpandable = this.isExpandable();
|
|
459
425
|
var popoverIsOpen = this.isPopoverOpen();
|
|
460
426
|
var showCellActions = isExpandable && (popoverIsOpen || this.state.isFocused || this.state.isHovered);
|
|
461
|
-
var cellClasses = (0, _classnames.default)('euiDataGridRowCell',
|
|
427
|
+
var cellClasses = (0, _classnames.default)('euiDataGridRowCell', (0, _defineProperty2.default)((0, _defineProperty2.default)({}, "euiDataGridRowCell--".concat(columnType), columnType), 'euiDataGridRowCell--open', popoverIsOpen), className);
|
|
462
428
|
var ariaRowIndex = pagination ? visibleRowIndex + 1 + pagination.pageSize * pagination.pageIndex : visibleRowIndex + 1;
|
|
463
429
|
var _this$state$cellProps2 = this.state.cellProps,
|
|
464
430
|
_ = _this$state$cellProps2.isExpandable,
|
|
@@ -488,23 +454,14 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
488
454
|
}) : undefined;
|
|
489
455
|
return (0, _react2.jsx)(RenderCellInRow, {
|
|
490
456
|
row: row
|
|
491
|
-
}, (0, _react2.jsx)(
|
|
492
|
-
|
|
457
|
+
}, (0, _react2.jsx)(GridCellDiv, (0, _extends2.default)({}, cellProps, {
|
|
458
|
+
ref: this.cellRef,
|
|
459
|
+
columnId: this.props.columnId,
|
|
460
|
+
columnIndex: this.props.colIndex,
|
|
461
|
+
rowIndex: rowIndex,
|
|
462
|
+
visibleRowIndex: this.props.visibleRowIndex,
|
|
493
463
|
"aria-rowindex": ariaRowIndex,
|
|
494
464
|
tabIndex: this.state.isFocused ? 0 : -1,
|
|
495
|
-
ref: this.cellRef
|
|
496
|
-
}, cellProps, {
|
|
497
|
-
"data-test-subj": "dataGridRowCell"
|
|
498
|
-
// Data attributes to help target specific cells by either data or current cell location
|
|
499
|
-
,
|
|
500
|
-
"data-gridcell-column-id": this.props.columnId // Static column ID name, not affected by column order
|
|
501
|
-
,
|
|
502
|
-
"data-gridcell-column-index": this.props.colIndex // Affected by column reordering
|
|
503
|
-
,
|
|
504
|
-
"data-gridcell-row-index": this.props.rowIndex // Index from data, not affected by sorting or pagination
|
|
505
|
-
,
|
|
506
|
-
"data-gridcell-visible-row-index": this.props.visibleRowIndex // Affected by sorting & pagination
|
|
507
|
-
,
|
|
508
465
|
onKeyDown: this.handleCellKeyDown,
|
|
509
466
|
onMouseEnter: this.onMouseEnter,
|
|
510
467
|
onMouseLeave: this.onMouseLeave
|
|
@@ -518,18 +475,24 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
518
475
|
columnType: columnType,
|
|
519
476
|
isExpandable: isExpandable,
|
|
520
477
|
isExpanded: popoverIsOpen,
|
|
521
|
-
onExpandClick: this.handleCellExpansionClick,
|
|
522
|
-
popoverAnchorRef: this.popoverAnchorRef,
|
|
523
|
-
showCellActions: showCellActions,
|
|
524
|
-
isFocused: this.state.isFocused,
|
|
525
478
|
setCellContentsRef: this.setCellContentsRef,
|
|
526
479
|
rowHeight: rowHeight,
|
|
527
480
|
rowHeightUtils: rowHeightUtils,
|
|
528
481
|
isControlColumn: cellClasses.includes('euiDataGridRowCell--controlColumn'),
|
|
529
|
-
ariaRowIndex: ariaRowIndex,
|
|
530
482
|
rowIndex: rowIndex,
|
|
531
483
|
colIndex: colIndex
|
|
532
|
-
}))))
|
|
484
|
+
}))), this.state.isFocused && (0, _react2.jsx)(CellScreenReaderDescription, {
|
|
485
|
+
columnName: (column === null || column === void 0 ? void 0 : column.displayAsText) || this.props.columnId,
|
|
486
|
+
columnIndex: colIndex + 1,
|
|
487
|
+
rowIndex: ariaRowIndex,
|
|
488
|
+
canExpandCell: showCellActions
|
|
489
|
+
}), showCellActions && (0, _react2.jsx)(_data_grid_cell_actions.EuiDataGridCellActions, {
|
|
490
|
+
rowIndex: rowIndex,
|
|
491
|
+
colIndex: colIndex,
|
|
492
|
+
column: column,
|
|
493
|
+
onExpandClick: this.handleCellExpansionClick,
|
|
494
|
+
popoverAnchorRef: this.popoverAnchorRef
|
|
495
|
+
})));
|
|
533
496
|
}
|
|
534
497
|
}]);
|
|
535
498
|
}(_react.Component);
|
|
@@ -555,4 +518,47 @@ var RenderTruncatedCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref3)
|
|
|
555
518
|
cloneElement: true
|
|
556
519
|
}, children) : children;
|
|
557
520
|
});
|
|
558
|
-
RenderTruncatedCellContent.displayName = 'RenderTruncatedCellContent';
|
|
521
|
+
RenderTruncatedCellContent.displayName = 'RenderTruncatedCellContent';
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* Function component utilities for easier hook usage
|
|
525
|
+
*/
|
|
526
|
+
|
|
527
|
+
var GridCellDiv = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref4, ref) {
|
|
528
|
+
var columnId = _ref4.columnId,
|
|
529
|
+
columnIndex = _ref4.columnIndex,
|
|
530
|
+
rowIndex = _ref4.rowIndex,
|
|
531
|
+
visibleRowIndex = _ref4.visibleRowIndex,
|
|
532
|
+
props = (0, _objectWithoutProperties2.default)(_ref4, _excluded4);
|
|
533
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_cell.euiDataGridRowCellStyles);
|
|
534
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
535
|
+
ref: ref,
|
|
536
|
+
css: styles.euiDataGridRowCell
|
|
537
|
+
}, props, {
|
|
538
|
+
role: "gridcell"
|
|
539
|
+
// Data attributes to help target specific cells by either data or current cell location
|
|
540
|
+
,
|
|
541
|
+
"data-gridcell-column-id": columnId // Static column ID name, not affected by column order
|
|
542
|
+
,
|
|
543
|
+
"data-gridcell-column-index": columnIndex // Affected by column reordering
|
|
544
|
+
,
|
|
545
|
+
"data-gridcell-row-index": rowIndex // Index from data, not affected by sorting or pagination
|
|
546
|
+
,
|
|
547
|
+
"data-gridcell-visible-row-index": visibleRowIndex // Affected by sorting & pagination
|
|
548
|
+
}));
|
|
549
|
+
}));
|
|
550
|
+
GridCellDiv.displayName = 'GridCellDiv';
|
|
551
|
+
var CellScreenReaderDescription = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
552
|
+
var columnName = _ref5.columnName,
|
|
553
|
+
columnIndex = _ref5.columnIndex,
|
|
554
|
+
rowIndex = _ref5.rowIndex,
|
|
555
|
+
canExpandCell = _ref5.canExpandCell;
|
|
556
|
+
var cellPosition = (0, _i18n.useEuiI18n)('euiDataGridCell.position', '{columnName}, column {columnIndex}, row {rowIndex}', {
|
|
557
|
+
columnName: columnName,
|
|
558
|
+
columnIndex: columnIndex,
|
|
559
|
+
rowIndex: rowIndex
|
|
560
|
+
});
|
|
561
|
+
var enterKeyPrompt = (0, _i18n.useEuiI18n)('euiDataGridCell.expansionEnterPrompt', 'Press the Enter key to expand this cell.');
|
|
562
|
+
return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, " - ".concat(cellPosition).concat(canExpandCell ? ". ".concat(enterKeyPrompt) : '')));
|
|
563
|
+
});
|
|
564
|
+
CellScreenReaderDescription.displayName = 'CellScreenReaderDescription';
|