@elastic/eui 95.10.1 → 95.12.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/README.md +1 -69
- package/dist/eui_theme_dark.css +0 -924
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -924
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +43 -35
- package/es/components/basic_table/collapsed_item_actions.js +24 -31
- package/es/components/datagrid/body/cell/data_grid_cell.js +212 -94
- package/es/components/datagrid/body/cell/data_grid_cell.styles.js +110 -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 +23 -8
- package/es/components/datagrid/body/data_grid_body_virtualized.js +23 -8
- package/es/components/datagrid/body/footer/data_grid_footer.styles.js +24 -0
- package/es/components/datagrid/body/footer/data_grid_footer_row.js +24 -11
- 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 +6 -5
- package/es/components/datagrid/body/header/data_grid_header_cell.js +42 -66
- package/es/components/datagrid/body/header/data_grid_header_cell.styles.js +27 -0
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
- 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 +12 -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 +17 -9
- package/es/components/datagrid/data_grid.stories.utils.js +1422 -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 +10 -36
- package/es/components/datagrid/utils/scrolling.js +14 -7
- package/es/components/datagrid/utils/scrolling.styles.js +30 -0
- package/es/components/date_picker/date_picker.js +1 -1
- 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/provider/provider.js +16 -13
- package/es/components/provider/system_color_mode/index.js +9 -0
- package/es/components/provider/system_color_mode/system_color_mode_provider.js +49 -0
- package/es/components/resizable_container/resizable_button.js +9 -2
- package/es/components/resizable_container/resizable_button.styles.js +19 -6
- package/es/components/table/table_header_cell.js +10 -3
- package/es/components/table/table_header_cell_checkbox.js +5 -3
- package/es/components/table/table_row_cell.js +10 -3
- package/es/components/table/table_row_cell_checkbox.js +5 -3
- 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/es/services/copy/index.js +10 -0
- package/es/services/copy/tabular_copy.js +103 -0
- package/es/services/index.js +1 -1
- package/eui.d.ts +692 -124
- package/i18ntokens.json +432 -396
- package/lib/components/basic_table/basic_table.js +42 -34
- package/lib/components/basic_table/collapsed_item_actions.js +23 -30
- package/lib/components/datagrid/body/cell/data_grid_cell.js +209 -91
- package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +114 -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 +23 -8
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +23 -8
- package/lib/components/datagrid/body/footer/data_grid_footer.styles.js +30 -0
- package/lib/components/datagrid/body/footer/data_grid_footer_row.js +23 -10
- 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 +6 -5
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +49 -74
- package/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +32 -0
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +8 -2
- 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 +12 -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 +16 -8
- package/lib/components/datagrid/data_grid.stories.utils.js +1426 -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 +11 -36
- package/lib/components/datagrid/utils/scrolling.js +14 -7
- package/lib/components/datagrid/utils/scrolling.styles.js +36 -0
- package/lib/components/date_picker/date_picker.js +1 -1
- 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/provider/provider.js +16 -13
- package/lib/components/provider/system_color_mode/index.js +12 -0
- package/lib/components/provider/system_color_mode/system_color_mode_provider.js +54 -0
- package/lib/components/resizable_container/resizable_button.js +9 -2
- package/lib/components/resizable_container/resizable_button.styles.js +19 -6
- package/lib/components/table/table_header_cell.js +10 -3
- package/lib/components/table/table_header_cell_checkbox.js +5 -3
- package/lib/components/table/table_row_cell.js +10 -3
- package/lib/components/table/table_row_cell_checkbox.js +5 -3
- 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/lib/services/copy/index.js +25 -0
- package/lib/services/copy/tabular_copy.js +111 -0
- package/lib/services/index.js +12 -8
- package/optimize/es/components/basic_table/basic_table.js +43 -35
- package/optimize/es/components/basic_table/collapsed_item_actions.js +24 -31
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +98 -88
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +110 -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 +12 -6
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +12 -6
- 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 +24 -11
- 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 +5 -5
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +42 -61
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.styles.js +27 -0
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +8 -3
- 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 +12 -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 +17 -9
- package/optimize/es/components/datagrid/data_grid.stories.utils.js +369 -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 +10 -36
- 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/date_picker/date_picker.js +1 -1
- 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/provider/provider.js +16 -13
- package/optimize/es/components/provider/system_color_mode/index.js +9 -0
- package/optimize/es/components/provider/system_color_mode/system_color_mode_provider.js +40 -0
- package/optimize/es/components/resizable_container/resizable_button.js +3 -2
- package/optimize/es/components/resizable_container/resizable_button.styles.js +19 -6
- package/optimize/es/components/table/table_header_cell.js +3 -2
- package/optimize/es/components/table/table_header_cell_checkbox.js +3 -2
- package/optimize/es/components/table/table_row_cell.js +4 -3
- package/optimize/es/components/table/table_row_cell_checkbox.js +3 -2
- 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/es/services/copy/index.js +10 -0
- package/optimize/es/services/copy/tabular_copy.js +103 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +42 -34
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +23 -30
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +95 -85
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +114 -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 +12 -6
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +12 -6
- 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 +22 -9
- 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 +5 -5
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +45 -63
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +32 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -2
- 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 +12 -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 +16 -8
- package/optimize/lib/components/datagrid/data_grid.stories.utils.js +374 -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 +11 -36
- 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/date_picker/date_picker.js +1 -1
- 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/provider/provider.js +16 -13
- package/optimize/lib/components/provider/system_color_mode/index.js +12 -0
- package/optimize/lib/components/provider/system_color_mode/system_color_mode_provider.js +47 -0
- package/optimize/lib/components/resizable_container/resizable_button.js +3 -2
- package/optimize/lib/components/resizable_container/resizable_button.styles.js +19 -6
- package/optimize/lib/components/table/table_header_cell.js +3 -2
- package/optimize/lib/components/table/table_header_cell_checkbox.js +3 -2
- package/optimize/lib/components/table/table_row_cell.js +4 -3
- package/optimize/lib/components/table/table_row_cell_checkbox.js +3 -2
- 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/optimize/lib/services/copy/index.js +25 -0
- package/optimize/lib/services/copy/tabular_copy.js +111 -0
- package/optimize/lib/services/index.js +12 -8
- 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 +42 -34
- package/test-env/components/basic_table/collapsed_item_actions.js +23 -30
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +204 -91
- package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +114 -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 +23 -8
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +23 -8
- 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 +22 -9
- 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 +6 -5
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +45 -67
- package/test-env/components/datagrid/body/header/data_grid_header_cell.styles.js +32 -0
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +8 -2
- 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 +12 -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 +16 -8
- package/test-env/components/datagrid/data_grid.stories.utils.js +1419 -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 +11 -36
- 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/date_picker/date_picker.js +1 -1
- 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/provider/provider.js +16 -13
- package/test-env/components/provider/system_color_mode/index.js +12 -0
- package/test-env/components/provider/system_color_mode/system_color_mode_provider.js +51 -0
- package/test-env/components/resizable_container/resizable_button.js +9 -2
- package/test-env/components/resizable_container/resizable_button.styles.js +19 -6
- package/test-env/components/table/table_header_cell.js +10 -3
- package/test-env/components/table/table_header_cell_checkbox.js +5 -3
- package/test-env/components/table/table_row_cell.js +10 -3
- package/test-env/components/table/table_row_cell_checkbox.js +5 -3
- 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/test-env/services/copy/index.js +25 -0
- package/test-env/services/copy/tabular_copy.js +30 -0
- package/test-env/services/index.js +12 -8
- 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 -221
- 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
- /package/es/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/lib/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/optimize/es/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/optimize/lib/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/test-env/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
|
@@ -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,26 @@ 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 ? [styles.content.controlColumn, styles.content.autoHeight] : [
|
|
74
|
+
// Regular data cells should always inherit height from the row wrapper,
|
|
75
|
+
// except for auto height
|
|
76
|
+
cellHeightType === 'auto' ? styles.content.autoHeight : styles.content.defaultHeight]));
|
|
77
|
+
return (0, _react2.jsx)(RenderTruncatedCellContent, {
|
|
75
78
|
hasLineCountTruncation: cellHeightType === 'lineCount' && !isControlColumn,
|
|
76
79
|
rowHeight: rowHeight
|
|
77
80
|
}, (0, _react2.jsx)("div", {
|
|
78
81
|
ref: setCellContentsRef,
|
|
79
82
|
"data-datagrid-cellcontent": true,
|
|
80
|
-
className: classes
|
|
83
|
+
className: classes,
|
|
84
|
+
css: cssStyles
|
|
81
85
|
}, (0, _react2.jsx)(CellElement, (0, _extends2.default)({
|
|
82
86
|
isDetails: false,
|
|
83
87
|
"data-test-subj": "cell-content",
|
|
84
88
|
rowIndex: rowIndex,
|
|
85
89
|
colIndex: colIndex,
|
|
86
90
|
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
|
-
}));
|
|
91
|
+
}, cellContext, rest))));
|
|
107
92
|
});
|
|
108
93
|
EuiDataGridCellContent.displayName = 'EuiDataGridCellContent';
|
|
109
94
|
var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
@@ -122,8 +107,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
122
107
|
(0, _defineProperty2.default)(_this, "state", {
|
|
123
108
|
cellProps: {},
|
|
124
109
|
isFocused: false,
|
|
125
|
-
isHovered: false
|
|
126
|
-
cellTextAlign: 'Left'
|
|
110
|
+
isHovered: false
|
|
127
111
|
});
|
|
128
112
|
(0, _defineProperty2.default)(_this, "unsubscribeCell", void 0);
|
|
129
113
|
(0, _defineProperty2.default)(_this, "style", null);
|
|
@@ -164,7 +148,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
164
148
|
var lineCount = isSingleLine ? 1 : rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getLineCount(rowHeightOption);
|
|
165
149
|
if (lineCount) {
|
|
166
150
|
var shouldUseHeightsCache = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.isRowHeightOverride(rowIndex, rowHeightsOptions);
|
|
167
|
-
var height = rowHeightUtils.calculateHeightForLineCount(_this.cellContentsRef, lineCount
|
|
151
|
+
var height = rowHeightUtils.calculateHeightForLineCount(_this.cellContentsRef, lineCount);
|
|
168
152
|
if (shouldUseHeightsCache) {
|
|
169
153
|
var _this$props4 = _this.props,
|
|
170
154
|
columnId = _this$props4.columnId,
|
|
@@ -205,29 +189,6 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
205
189
|
} else if (_this.contentObserver) {
|
|
206
190
|
_this.contentObserver.disconnect();
|
|
207
191
|
}
|
|
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
192
|
});
|
|
232
193
|
(0, _defineProperty2.default)(_this, "isExpandable", function () {
|
|
233
194
|
var _this$props$column, _this$state$cellProps;
|
|
@@ -256,7 +217,9 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
256
217
|
// Set popover anchor
|
|
257
218
|
var cellAnchorEl = _this.popoverAnchorRef.current;
|
|
258
219
|
setPopoverAnchor(cellAnchorEl);
|
|
259
|
-
|
|
220
|
+
// TODO: Potentially switch to `topLeft` based on occlusion with sticky header
|
|
221
|
+
// @see https://github.com/elastic/eui/issues/7828
|
|
222
|
+
setPopoverAnchorPosition('downLeft');
|
|
260
223
|
|
|
261
224
|
// Set popover contents with cell content
|
|
262
225
|
var _this$props5 = _this.props,
|
|
@@ -377,12 +340,12 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
377
340
|
}, {
|
|
378
341
|
key: "componentDidUpdate",
|
|
379
342
|
value: function componentDidUpdate(prevProps) {
|
|
380
|
-
var _this$props$rowHeight, _prevProps$rowHeights, _this$props$rowHeight2, _this$props$rowHeight3, _this$props$style, _prevProps$style;
|
|
343
|
+
var _this$props$rowHeight, _prevProps$rowHeights, _this$props$rowHeight2, _prevProps$rowHeights2, _this$props$rowHeight3, _prevProps$rowHeights3, _this$props$gridStyle, _prevProps$gridStyles, _this$props$gridStyle2, _prevProps$gridStyles2, _this$props$rowHeight4, _this$props$rowHeight5, _this$props$style, _prevProps$style;
|
|
381
344
|
this.recalculateAutoHeight();
|
|
382
|
-
if (((_this$props$rowHeight = this.props.rowHeightsOptions) === null || _this$props$rowHeight === void 0 ? void 0 : _this$props$rowHeight.defaultHeight) !== ((_prevProps$rowHeights = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights === void 0 ? void 0 : _prevProps$rowHeights.defaultHeight)) {
|
|
345
|
+
if (((_this$props$rowHeight = this.props.rowHeightsOptions) === null || _this$props$rowHeight === void 0 ? void 0 : _this$props$rowHeight.defaultHeight) !== ((_prevProps$rowHeights = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights === void 0 ? void 0 : _prevProps$rowHeights.defaultHeight) || ((_this$props$rowHeight2 = this.props.rowHeightsOptions) === null || _this$props$rowHeight2 === void 0 || (_this$props$rowHeight2 = _this$props$rowHeight2.rowHeights) === null || _this$props$rowHeight2 === void 0 ? void 0 : _this$props$rowHeight2[this.props.rowIndex]) !== ((_prevProps$rowHeights2 = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights2 === void 0 || (_prevProps$rowHeights2 = _prevProps$rowHeights2.rowHeights) === null || _prevProps$rowHeights2 === void 0 ? void 0 : _prevProps$rowHeights2[prevProps.rowIndex]) || ((_this$props$rowHeight3 = this.props.rowHeightsOptions) === null || _this$props$rowHeight3 === void 0 ? void 0 : _this$props$rowHeight3.lineHeight) !== ((_prevProps$rowHeights3 = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights3 === void 0 ? void 0 : _prevProps$rowHeights3.lineHeight) || ((_this$props$gridStyle = this.props.gridStyles) === null || _this$props$gridStyle === void 0 ? void 0 : _this$props$gridStyle.fontSize) !== ((_prevProps$gridStyles = prevProps.gridStyles) === null || _prevProps$gridStyles === void 0 ? void 0 : _prevProps$gridStyles.fontSize) || ((_this$props$gridStyle2 = this.props.gridStyles) === null || _this$props$gridStyle2 === void 0 ? void 0 : _this$props$gridStyle2.cellPadding) !== ((_prevProps$gridStyles2 = prevProps.gridStyles) === null || _prevProps$gridStyles2 === void 0 ? void 0 : _prevProps$gridStyles2.cellPadding)) {
|
|
383
346
|
this.recalculateLineHeight();
|
|
384
347
|
}
|
|
385
|
-
if ((_this$props$
|
|
348
|
+
if ((_this$props$rowHeight4 = this.props.rowHeightUtils) !== null && _this$props$rowHeight4 !== void 0 && _this$props$rowHeight4.compensateForLayoutShift && (_this$props$rowHeight5 = this.props.rowHeightsOptions) !== null && _this$props$rowHeight5 !== void 0 && _this$props$rowHeight5.scrollAnchorRow && this.props.colIndex === 0 &&
|
|
386
349
|
// once per row
|
|
387
350
|
this.props.columnId === prevProps.columnId &&
|
|
388
351
|
// if this is still the same column
|
|
@@ -390,12 +353,12 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
390
353
|
// if this is still the same row
|
|
391
354
|
((_this$props$style = this.props.style) === null || _this$props$style === void 0 ? void 0 : _this$props$style.top) !== ((_prevProps$style = prevProps.style) === null || _prevProps$style === void 0 ? void 0 : _prevProps$style.top) // if the top position has changed
|
|
392
355
|
) {
|
|
393
|
-
var _prevProps$style2, _this$props$style2, _this$props$
|
|
356
|
+
var _prevProps$style2, _this$props$style2, _this$props$rowHeight6;
|
|
394
357
|
var previousTop = parseFloat((_prevProps$style2 = prevProps.style) === null || _prevProps$style2 === void 0 ? void 0 : _prevProps$style2.top);
|
|
395
358
|
var currentTop = parseFloat((_this$props$style2 = this.props.style) === null || _this$props$style2 === void 0 ? void 0 : _this$props$style2.top);
|
|
396
359
|
|
|
397
360
|
// @ts-ignore We've already checked that this virtualization util is available above
|
|
398
|
-
this.props.rowHeightUtils.compensateForLayoutShift(this.props.rowIndex, currentTop - previousTop, (_this$props$
|
|
361
|
+
this.props.rowHeightUtils.compensateForLayoutShift(this.props.rowIndex, currentTop - previousTop, (_this$props$rowHeight6 = this.props.rowHeightsOptions) === null || _this$props$rowHeight6 === void 0 ? void 0 : _this$props$rowHeight6.scrollAnchorRow);
|
|
399
362
|
}
|
|
400
363
|
if (this.props.popoverContext.popoverIsOpen !== prevProps.popoverContext.popoverIsOpen || this.props.popoverContext.cellLocation !== prevProps.popoverContext.cellLocation || this.props.renderCellPopover !== prevProps.renderCellPopover) {
|
|
401
364
|
this.handleCellPopover();
|
|
@@ -407,6 +370,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
407
370
|
}, {
|
|
408
371
|
key: "shouldComponentUpdate",
|
|
409
372
|
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
373
|
+
var _nextProps$gridStyles, _this$props$gridStyle3, _nextProps$gridStyles2, _this$props$gridStyle4;
|
|
410
374
|
if (nextProps.rowIndex !== this.props.rowIndex) return true;
|
|
411
375
|
if (nextProps.visibleRowIndex !== this.props.visibleRowIndex) return true;
|
|
412
376
|
if (nextProps.colIndex !== this.props.colIndex) return true;
|
|
@@ -414,6 +378,8 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
414
378
|
if (nextProps.columnType !== this.props.columnType) return true;
|
|
415
379
|
if (nextProps.width !== this.props.width) return true;
|
|
416
380
|
if (nextProps.rowHeightsOptions !== this.props.rowHeightsOptions) return true;
|
|
381
|
+
if (((_nextProps$gridStyles = nextProps.gridStyles) === null || _nextProps$gridStyles === void 0 ? void 0 : _nextProps$gridStyles.fontSize) !== ((_this$props$gridStyle3 = this.props.gridStyles) === null || _this$props$gridStyle3 === void 0 ? void 0 : _this$props$gridStyle3.fontSize)) return true;
|
|
382
|
+
if (((_nextProps$gridStyles2 = nextProps.gridStyles) === null || _nextProps$gridStyles2 === void 0 ? void 0 : _nextProps$gridStyles2.cellPadding) !== ((_this$props$gridStyle4 = this.props.gridStyles) === null || _this$props$gridStyle4 === void 0 ? void 0 : _this$props$gridStyle4.cellPadding)) return true;
|
|
417
383
|
if (nextProps.renderCellValue !== this.props.renderCellValue) return true;
|
|
418
384
|
if (nextProps.renderCellPopover !== this.props.renderCellPopover) return true;
|
|
419
385
|
if (nextProps.interactiveCellId !== this.props.interactiveCellId) return true;
|
|
@@ -458,7 +424,11 @@ 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);
|
|
428
|
+
|
|
429
|
+
// classNames set by EuiDataGridCellWrapper
|
|
430
|
+
var isControlColumn = cellClasses.includes('euiDataGridRowCell--controlColumn');
|
|
431
|
+
var isLastColumn = cellClasses.includes('euiDataGridRowCell--lastColumn');
|
|
462
432
|
var ariaRowIndex = pagination ? visibleRowIndex + 1 + pagination.pageSize * pagination.pageIndex : visibleRowIndex + 1;
|
|
463
433
|
var _this$state$cellProps2 = this.state.cellProps,
|
|
464
434
|
_ = _this$state$cellProps2.isExpandable,
|
|
@@ -488,23 +458,14 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
488
458
|
}) : undefined;
|
|
489
459
|
return (0, _react2.jsx)(RenderCellInRow, {
|
|
490
460
|
row: row
|
|
491
|
-
}, (0, _react2.jsx)(
|
|
492
|
-
|
|
461
|
+
}, (0, _react2.jsx)(GridCellDiv, (0, _extends2.default)({}, cellProps, {
|
|
462
|
+
ref: this.cellRef,
|
|
463
|
+
columnId: this.props.columnId,
|
|
464
|
+
columnIndex: this.props.colIndex,
|
|
465
|
+
rowIndex: rowIndex,
|
|
466
|
+
visibleRowIndex: this.props.visibleRowIndex,
|
|
493
467
|
"aria-rowindex": ariaRowIndex,
|
|
494
468
|
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
469
|
onKeyDown: this.handleCellKeyDown,
|
|
509
470
|
onMouseEnter: this.onMouseEnter,
|
|
510
471
|
onMouseLeave: this.onMouseLeave
|
|
@@ -518,18 +479,24 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
518
479
|
columnType: columnType,
|
|
519
480
|
isExpandable: isExpandable,
|
|
520
481
|
isExpanded: popoverIsOpen,
|
|
521
|
-
onExpandClick: this.handleCellExpansionClick,
|
|
522
|
-
popoverAnchorRef: this.popoverAnchorRef,
|
|
523
|
-
showCellActions: showCellActions,
|
|
524
|
-
isFocused: this.state.isFocused,
|
|
525
482
|
setCellContentsRef: this.setCellContentsRef,
|
|
526
483
|
rowHeight: rowHeight,
|
|
527
484
|
rowHeightUtils: rowHeightUtils,
|
|
528
|
-
isControlColumn:
|
|
529
|
-
ariaRowIndex: ariaRowIndex,
|
|
485
|
+
isControlColumn: isControlColumn,
|
|
530
486
|
rowIndex: rowIndex,
|
|
531
487
|
colIndex: colIndex
|
|
532
|
-
}))))
|
|
488
|
+
}))), isLastColumn ? _services.tabularCopyMarkers.hiddenNewline : _services.tabularCopyMarkers.hiddenTab, this.state.isFocused && (0, _react2.jsx)(CellScreenReaderDescription, {
|
|
489
|
+
columnName: (column === null || column === void 0 ? void 0 : column.displayAsText) || this.props.columnId,
|
|
490
|
+
columnIndex: colIndex + 1,
|
|
491
|
+
rowIndex: ariaRowIndex,
|
|
492
|
+
canExpandCell: showCellActions
|
|
493
|
+
}), showCellActions && (0, _react2.jsx)(_data_grid_cell_actions.EuiDataGridCellActions, {
|
|
494
|
+
rowIndex: rowIndex,
|
|
495
|
+
colIndex: colIndex,
|
|
496
|
+
column: column,
|
|
497
|
+
onExpandClick: this.handleCellExpansionClick,
|
|
498
|
+
popoverAnchorRef: this.popoverAnchorRef
|
|
499
|
+
})));
|
|
533
500
|
}
|
|
534
501
|
}]);
|
|
535
502
|
}(_react.Component);
|
|
@@ -555,4 +522,47 @@ var RenderTruncatedCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref3)
|
|
|
555
522
|
cloneElement: true
|
|
556
523
|
}, children) : children;
|
|
557
524
|
});
|
|
558
|
-
RenderTruncatedCellContent.displayName = 'RenderTruncatedCellContent';
|
|
525
|
+
RenderTruncatedCellContent.displayName = 'RenderTruncatedCellContent';
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Function component utilities for easier hook usage
|
|
529
|
+
*/
|
|
530
|
+
|
|
531
|
+
var GridCellDiv = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardRef)(function (_ref4, ref) {
|
|
532
|
+
var columnId = _ref4.columnId,
|
|
533
|
+
columnIndex = _ref4.columnIndex,
|
|
534
|
+
rowIndex = _ref4.rowIndex,
|
|
535
|
+
visibleRowIndex = _ref4.visibleRowIndex,
|
|
536
|
+
props = (0, _objectWithoutProperties2.default)(_ref4, _excluded4);
|
|
537
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_cell.euiDataGridRowCellStyles);
|
|
538
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
539
|
+
ref: ref,
|
|
540
|
+
css: styles.euiDataGridRowCell
|
|
541
|
+
}, props, {
|
|
542
|
+
role: "gridcell"
|
|
543
|
+
// Data attributes to help target specific cells by either data or current cell location
|
|
544
|
+
,
|
|
545
|
+
"data-gridcell-column-id": columnId // Static column ID name, not affected by column order
|
|
546
|
+
,
|
|
547
|
+
"data-gridcell-column-index": columnIndex // Affected by column reordering
|
|
548
|
+
,
|
|
549
|
+
"data-gridcell-row-index": rowIndex // Index from data, not affected by sorting or pagination
|
|
550
|
+
,
|
|
551
|
+
"data-gridcell-visible-row-index": visibleRowIndex // Affected by sorting & pagination
|
|
552
|
+
}));
|
|
553
|
+
}));
|
|
554
|
+
GridCellDiv.displayName = 'GridCellDiv';
|
|
555
|
+
var CellScreenReaderDescription = /*#__PURE__*/(0, _react.memo)(function (_ref5) {
|
|
556
|
+
var columnName = _ref5.columnName,
|
|
557
|
+
columnIndex = _ref5.columnIndex,
|
|
558
|
+
rowIndex = _ref5.rowIndex,
|
|
559
|
+
canExpandCell = _ref5.canExpandCell;
|
|
560
|
+
var cellPosition = (0, _i18n.useEuiI18n)('euiDataGridCell.position', '{columnName}, column {columnIndex}, row {rowIndex}', {
|
|
561
|
+
columnName: columnName,
|
|
562
|
+
columnIndex: columnIndex,
|
|
563
|
+
rowIndex: rowIndex
|
|
564
|
+
});
|
|
565
|
+
var enterKeyPrompt = (0, _i18n.useEuiI18n)('euiDataGridCell.expansionEnterPrompt', 'Press the Enter key to expand this cell.');
|
|
566
|
+
return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, _services.tabularCopyMarkers.hiddenNoCopyBoundary, " - ".concat(cellPosition).concat(canExpandCell ? ". ".concat(enterKeyPrompt) : ''), _services.tabularCopyMarkers.hiddenNoCopyBoundary));
|
|
567
|
+
});
|
|
568
|
+
CellScreenReaderDescription.displayName = 'CellScreenReaderDescription';
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiDataGridRowCellStyles = exports.euiDataGridCellOutlineStyles = exports.euiDataGridCellOutlineSelectors = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _global_styling = require("../../../../global_styling");
|
|
9
|
+
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)."; } /*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
var euiDataGridCellOutlineStyles = exports.euiDataGridCellOutlineStyles = function euiDataGridCellOutlineStyles(_ref2) {
|
|
17
|
+
var euiTheme = _ref2.euiTheme;
|
|
18
|
+
var focusColor = euiTheme.colors.primary;
|
|
19
|
+
var hoverColor = euiTheme.colors.darkShade;
|
|
20
|
+
var outlineWidth = euiTheme.border.width.thick;
|
|
21
|
+
var borderRadius = (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
|
|
22
|
+
return x / 2;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Note: We use a pseudo element for the 'outline' over any other CSS approaches
|
|
26
|
+
// (outline, border, box-shadow) because it gives us the most control and reduces
|
|
27
|
+
// overlap with other cells or inner elements
|
|
28
|
+
return {
|
|
29
|
+
borderRadius: borderRadius,
|
|
30
|
+
focusColor: focusColor,
|
|
31
|
+
focusStyles: "\n /* Remove outline as we're handling it manually. Needed to override global styles */\n &:focus-visible {\n outline: none;\n }\n\n &::after {\n content: '';\n /* We want this to be visually on top of cell content but not interactive */\n z-index: 2;\n pointer-events: none;\n position: absolute;\n inset: 0;\n border: ".concat(outlineWidth, " solid ").concat(focusColor, ";\n border-radius: ").concat(borderRadius, ";\n }\n "),
|
|
32
|
+
hoverColor: hoverColor,
|
|
33
|
+
hoverStyles: "\n &::after {\n border-color: ".concat(hoverColor, ";\n }\n ")
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
var euiDataGridCellOutlineSelectors = exports.euiDataGridCellOutlineSelectors = function euiDataGridCellOutlineSelectors() {
|
|
37
|
+
var parentSelector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '&';
|
|
38
|
+
// Focus selectors
|
|
39
|
+
var focus = ':focus'; // cell has been clicked or keyboard navigated to
|
|
40
|
+
var isOpen = '.euiDataGridRowCell--open'; // always show when the cell expansion popover is open
|
|
41
|
+
var isClosing = '[data-keyboard-closing]'; // prevents the animation from replaying when keyboard focus is moved from the popover back to the cell
|
|
42
|
+
var isEntered = ':has([data-focus-lock-disabled="false"])'; // cell focus trap has been entered - ideally show the outline still, but grayed out
|
|
43
|
+
|
|
44
|
+
// Hover selectors
|
|
45
|
+
var hover = ':hover'; // hover styles should not supercede focus styles
|
|
46
|
+
var focusWithin = ':focus-within'; // used by :hover:not() to prevent flash of gray when mouse users are opening/closing the expansion popover via cell action click
|
|
47
|
+
|
|
48
|
+
// Cell header specific selectors
|
|
49
|
+
var headerActionsOpen = '.euiDataGridHeaderCell--isActionsPopoverOpen';
|
|
50
|
+
|
|
51
|
+
// Utils
|
|
52
|
+
var selectors = function selectors() {
|
|
53
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
54
|
+
args[_key] = arguments[_key];
|
|
55
|
+
}
|
|
56
|
+
return [].concat(args).join(', ');
|
|
57
|
+
};
|
|
58
|
+
var is = function is(selectors) {
|
|
59
|
+
return "".concat(parentSelector, ":is(").concat(selectors, ")");
|
|
60
|
+
};
|
|
61
|
+
var not = function not(selectors) {
|
|
62
|
+
return "".concat(parentSelector, ":not(").concat(selectors, ")");
|
|
63
|
+
};
|
|
64
|
+
var hoverNot = function hoverNot(selectors) {
|
|
65
|
+
return "".concat(parentSelector, ":hover:not(").concat(selectors, ")");
|
|
66
|
+
};
|
|
67
|
+
var _ = function _(selectors) {
|
|
68
|
+
return "".concat(parentSelector).concat(selectors);
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
outline: {
|
|
72
|
+
show: is(selectors(hover, focus, isOpen, isEntered)),
|
|
73
|
+
hover: hoverNot(selectors(focus, focusWithin, isOpen)),
|
|
74
|
+
focusTrapped: _(isEntered)
|
|
75
|
+
},
|
|
76
|
+
actions: {
|
|
77
|
+
hoverZone: hoverNot(selectors(focus, isOpen)),
|
|
78
|
+
hoverColor: hoverNot(selectors(focus, focusWithin, isOpen)),
|
|
79
|
+
showAnimation: is(selectors(hover, focus, isOpen, isClosing)),
|
|
80
|
+
hoverAnimation: hoverNot(selectors(focus, isOpen, isClosing))
|
|
81
|
+
},
|
|
82
|
+
header: {
|
|
83
|
+
focus: is(selectors(focus, focusWithin, headerActionsOpen)),
|
|
84
|
+
// :focus-within here is primarily intended for when the column actions button has been clicked twice
|
|
85
|
+
focusTrapped: _(isEntered),
|
|
86
|
+
hideActions: not(selectors(hover, focusWithin, headerActionsOpen))
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
91
|
+
name: "12y9ria-euiDataGridRowCell__content",
|
|
92
|
+
styles: "overflow:hidden;label:euiDataGridRowCell__content;"
|
|
93
|
+
} : {
|
|
94
|
+
name: "12y9ria-euiDataGridRowCell__content",
|
|
95
|
+
styles: "overflow:hidden;label:euiDataGridRowCell__content;",
|
|
96
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
97
|
+
};
|
|
98
|
+
var euiDataGridRowCellStyles = exports.euiDataGridRowCellStyles = function euiDataGridRowCellStyles(euiThemeContext) {
|
|
99
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
100
|
+
var cellOutline = euiDataGridCellOutlineStyles(euiThemeContext);
|
|
101
|
+
var _euiDataGridCellOutli = euiDataGridCellOutlineSelectors(),
|
|
102
|
+
outlineSelectors = _euiDataGridCellOutli.outline;
|
|
103
|
+
return {
|
|
104
|
+
euiDataGridRowCell: /*#__PURE__*/(0, _react.css)("position:relative;", outlineSelectors.show, "{", cellOutline.focusStyles, ";}", outlineSelectors.hover, "{", cellOutline.hoverStyles, ";}", outlineSelectors.focusTrapped, "{", cellOutline.hoverStyles, ";}&>[data-focus-lock-disabled]{", (0, _global_styling.logicalCSS)('height', '100%'), ";}&:where(.euiDataGridRowCell--numeric, .euiDataGridRowCell--currency){", (0, _global_styling.logicalTextAlignCSS)('right'), ";}&:where(.euiDataGridRowCell--uppercase){text-transform:uppercase;}&:where(.euiDataGridRowCell--lowercase){text-transform:lowercase;}&:where(.euiDataGridRowCell--capitalize){text-transform:capitalize;};label:euiDataGridRowCell;"),
|
|
105
|
+
content: {
|
|
106
|
+
euiDataGridRowCell__content: _ref,
|
|
107
|
+
autoHeight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), ";;label:autoHeight;"),
|
|
108
|
+
defaultHeight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";;label:defaultHeight;"),
|
|
109
|
+
// Control columns should be vertically centered with the *first line* of text
|
|
110
|
+
// for both single and multi-line heights (see https://github.com/elastic/eui/issues/7897)
|
|
111
|
+
controlColumn: /*#__PURE__*/(0, _react.css)("display:inline-flex;align-items:start;gap:", euiTheme.size.xxs, ";vertical-align:-webkit-baseline-middle;vertical-align:-moz-middle-with-baseline;.euiDataGrid--fontSizeSmall &:where(.euiDataGridRowCell__content--defaultHeight){", (0, _global_styling.logicalCSS)('height', '100%'), " align-items:center;}.euiCheckbox:not(:has(label)){display:inline;.euiCheckbox__square{display:inline-flex;vertical-align:text-bottom;@supports (vertical-align: -moz-middle-with-baseline){vertical-align:sub;}}};label:controlColumn;")
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
};
|
|
@@ -10,11 +10,13 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _services = require("../../../../services");
|
|
13
14
|
var _i18n = require("../../../i18n");
|
|
14
15
|
var _button_icon = require("../../../button/button_icon");
|
|
15
16
|
var _button_empty = require("../../../button/button_empty");
|
|
16
17
|
var _flex = require("../../../flex");
|
|
17
18
|
var _popover = require("../../../popover");
|
|
19
|
+
var _data_grid_cell_actions = require("./data_grid_cell_actions.styles");
|
|
18
20
|
var _react2 = require("@emotion/react");
|
|
19
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -32,6 +34,8 @@ var EuiDataGridCellActions = exports.EuiDataGridCellActions = function EuiDataGr
|
|
|
32
34
|
column = _ref.column,
|
|
33
35
|
rowIndex = _ref.rowIndex,
|
|
34
36
|
colIndex = _ref.colIndex;
|
|
37
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_cell_actions.euiDataGridCellActionsStyles);
|
|
38
|
+
|
|
35
39
|
// Note: The cell expand button/expansion popover is *always* rendered if
|
|
36
40
|
// column.cellActions is present (regardless of column.isExpandable).
|
|
37
41
|
// This is because cell actions are not otherwise accessible to keyboard
|
|
@@ -43,6 +47,7 @@ var EuiDataGridCellActions = exports.EuiDataGridCellActions = function EuiDataGr
|
|
|
43
47
|
default: "Click or hit enter to interact with cell content"
|
|
44
48
|
}, function (expandButtonTitle) {
|
|
45
49
|
return (0, _react2.jsx)(_button_icon.EuiButtonIcon, {
|
|
50
|
+
css: styles.euiDataGridRowCell__actionButtonIcon,
|
|
46
51
|
className: "euiDataGridRowCell__actionButtonIcon euiDataGridRowCell__expandCell",
|
|
47
52
|
"data-test-subj": "euiDataGridCellExpandButton",
|
|
48
53
|
display: "fill",
|
|
@@ -54,12 +59,13 @@ var EuiDataGridCellActions = exports.EuiDataGridCellActions = function EuiDataGr
|
|
|
54
59
|
title: expandButtonTitle
|
|
55
60
|
});
|
|
56
61
|
});
|
|
57
|
-
}, [onExpandClick]);
|
|
62
|
+
}, [onExpandClick, styles]);
|
|
58
63
|
var additionalButtons = (0, _react.useMemo)(function () {
|
|
59
64
|
if (!column || !Array.isArray(column === null || column === void 0 ? void 0 : column.cellActions)) return [];
|
|
60
65
|
var ButtonComponent = function ButtonComponent(props) {
|
|
61
66
|
return (0, _react2.jsx)(_button_icon.EuiButtonIcon, (0, _extends2.default)({}, props, {
|
|
62
67
|
"aria-hidden": true,
|
|
68
|
+
css: styles.euiDataGridRowCell__actionButtonIcon,
|
|
63
69
|
className: "euiDataGridRowCell__actionButtonIcon"
|
|
64
70
|
// Don't allow consumers to override sizes or colors for cell actions on hover/focus
|
|
65
71
|
,
|
|
@@ -84,8 +90,12 @@ var EuiDataGridCellActions = exports.EuiDataGridCellActions = function EuiDataGr
|
|
|
84
90
|
isExpanded: false
|
|
85
91
|
});
|
|
86
92
|
});
|
|
87
|
-
}, [column, colIndex, rowIndex]);
|
|
88
|
-
return (0, _react2.jsx)(
|
|
93
|
+
}, [column, colIndex, rowIndex, styles]);
|
|
94
|
+
return (0, _react2.jsx)("div", {
|
|
95
|
+
css: styles.euiDataGridRowCell__actionsWrapper,
|
|
96
|
+
className: "euiDataGridRowCell__actionsWrapper"
|
|
97
|
+
}, (0, _react2.jsx)("div", {
|
|
98
|
+
css: styles.euiDataGridRowCell__actions,
|
|
89
99
|
className: "euiDataGridRowCell__actions"
|
|
90
100
|
}, [].concat((0, _toConsumableArray2.default)(additionalButtons), [expandButton])), (0, _react2.jsx)("div", {
|
|
91
101
|
ref: popoverAnchorRef,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.euiDataGridCellActionsStyles = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _global_styling = require("../../../../global_styling");
|
|
11
|
+
var _data_grid = require("../../data_grid.styles");
|
|
12
|
+
var _data_grid_cell = require("./data_grid_cell.styles");
|
|
13
|
+
var _templateObject;
|
|
14
|
+
/*
|
|
15
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
16
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
17
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
18
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
19
|
+
* Side Public License, v 1.
|
|
20
|
+
*/
|
|
21
|
+
var euiDataGridCellActionsStyles = exports.euiDataGridCellActionsStyles = function euiDataGridCellActionsStyles(euiThemeContext) {
|
|
22
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
23
|
+
var _euiDataGridVariables = (0, _data_grid.euiDataGridVariables)(euiThemeContext),
|
|
24
|
+
levels = _euiDataGridVariables.levels;
|
|
25
|
+
var borderWidth = euiTheme.border.width.thin;
|
|
26
|
+
var cellOutline = (0, _data_grid_cell.euiDataGridCellOutlineStyles)(euiThemeContext);
|
|
27
|
+
var _euiDataGridCellOutli = (0, _data_grid_cell.euiDataGridCellOutlineSelectors)('.euiDataGridRowCell'),
|
|
28
|
+
cellSelectors = _euiDataGridCellOutli.actions;
|
|
29
|
+
return {
|
|
30
|
+
euiDataGridRowCell__actionsWrapper: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('bottom', '100%'), "z-index:", levels.stickyHeader - 1, ";.euiDataGridRowCell[data-gridcell-visible-row-index='0']>&{z-index:", levels.stickyHeader + 1, ";}", cellSelectors.hoverZone, " &{", (0, _global_styling.logicalCSS)('min-width', '50%'), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";};label:euiDataGridRowCell__actionsWrapper;"),
|
|
31
|
+
euiDataGridRowCell__actions: /*#__PURE__*/(0, _react.css)("position:relative;display:flex;gap:", euiTheme.size.xxs, ";", (0, _global_styling.logicalCSS)('width', 'fit-content'), " padding-inline:", euiTheme.size.xxs, ";", (0, _global_styling.logicalCSS)('margin-bottom', "-".concat(borderWidth)), " background-color:", cellOutline.focusColor, ";color:", euiTheme.colors.emptyShade, ";border:", borderWidth, " solid ", cellOutline.focusColor, ";border-radius:", cellOutline.borderRadius, ";", (0, _global_styling.logicalCSS)('border-bottom-left-radius', 0), "&::after{content:'';position:absolute;", (0, _global_styling.logicalCSS)('top', '100%'), " ", (0, _global_styling.logicalCSS)('left', "-".concat(borderWidth)), " ", (0, _global_styling.logicalSizeCSS)((0, _global_styling.mathWithUnits)(borderWidth, function (x) {
|
|
32
|
+
return x * 2;
|
|
33
|
+
})), " background-color:inherit;}", cellSelectors.hoverColor, " &{background-color:", cellOutline.hoverColor, ";border-color:", cellOutline.hoverColor, ";}", _global_styling.euiCanAnimate, "{transform:scaleY(0);transform-origin:bottom;", cellSelectors.showAnimation, " &{animation-duration:", euiTheme.animation.fast, ";animation-name:", slideUp, ";animation-iteration-count:1;animation-fill-mode:forwards;}", cellSelectors.hoverAnimation, " &{animation-delay:", euiTheme.animation.slow, ";}};label:euiDataGridRowCell__actions;"),
|
|
34
|
+
euiDataGridRowCell__actionButtonIcon: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('height', (0, _global_styling.mathWithUnits)([euiTheme.size.base, euiTheme.size.xs], function (x, y) {
|
|
35
|
+
return x + y;
|
|
36
|
+
})), " border-radius:0;&,svg{background-color:transparent!important;color:currentColor!important;fill:currentColor!important;}&.euiDataGridRowCell__expandCell .euiIcon{", (0, _global_styling.logicalCSS)('width', '120%'), " ", (0, _global_styling.logicalCSS)('height', '100%'), ";};label:euiDataGridRowCell__actionButtonIcon;")
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
var slideUp = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from { transform: scaleY(0); }\n to { transform: scaleY(1); }\n"])));
|
|
@@ -13,6 +13,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _services = require("../../../../services");
|
|
15
15
|
var _popover = require("../../../popover");
|
|
16
|
+
var _data_grid = require("../../data_grid.styles");
|
|
17
|
+
var _data_grid_cell_popover = require("./data_grid_cell_popover.styles");
|
|
16
18
|
var _text = require("../../../text");
|
|
17
19
|
var _code = require("../../../code");
|
|
18
20
|
var _react2 = require("@emotion/react");
|
|
@@ -95,25 +97,23 @@ var useCellPopover = exports.useCellPopover = function useCellPopover() {
|
|
|
95
97
|
// popover button isn't actually the DOM node we pass to `button`. Otherwise,
|
|
96
98
|
// clicking the expansion cell action triggers an outside click
|
|
97
99
|
var onClickOutside = (0, _react.useCallback)(function (event) {
|
|
98
|
-
var
|
|
99
|
-
var cellActions = popoverAnchor === null || popoverAnchor === void 0 || (_popoverAnchor$parent = popoverAnchor.parentElement) === null || _popoverAnchor$parent === void 0 || (_popoverAnchor$parent = _popoverAnchor$parent.parentElement) === null || _popoverAnchor$parent === void 0 ? void 0 : _popoverAnchor$parent.previousElementSibling;
|
|
100
|
+
var cellActions = popoverAnchor === null || popoverAnchor === void 0 ? void 0 : popoverAnchor.closest('.euiDataGridRowCell__actionsWrapper');
|
|
100
101
|
if (!(cellActions !== null && cellActions !== void 0 && cellActions.contains(event.target))) {
|
|
101
102
|
closeCellPopover();
|
|
102
103
|
}
|
|
103
104
|
}, [popoverAnchor, closeCellPopover]);
|
|
104
105
|
var onKeyDown = (0, _react.useCallback)(function (event) {
|
|
105
106
|
if (event.key === _services.keys.F2 || event.key === _services.keys.ESCAPE) {
|
|
106
|
-
var _popoverAnchor$parent2;
|
|
107
107
|
event.preventDefault();
|
|
108
108
|
event.stopPropagation();
|
|
109
109
|
closeCellPopover();
|
|
110
|
-
var cell = popoverAnchor === null || popoverAnchor === void 0
|
|
110
|
+
var cell = popoverAnchor === null || popoverAnchor === void 0 ? void 0 : popoverAnchor.closest('.euiDataGridRowCell');
|
|
111
111
|
|
|
112
112
|
// Prevent cell animation flash while focus is being shifted between popover and cell
|
|
113
113
|
cell === null || cell === void 0 || cell.setAttribute('data-keyboard-closing', 'true');
|
|
114
114
|
// Ensure focus is returned to the parent cell, and remove animation stopgap
|
|
115
115
|
requestAnimationFrame(function () {
|
|
116
|
-
|
|
116
|
+
cell === null || cell === void 0 || cell.focus();
|
|
117
117
|
cell === null || cell === void 0 || cell.removeAttribute('data-keyboard-closing');
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -130,36 +130,45 @@ var useCellPopover = exports.useCellPopover = function useCellPopover() {
|
|
|
130
130
|
setCellPopoverProps: setCellPopoverProps
|
|
131
131
|
};
|
|
132
132
|
}, [popoverIsOpen, closeCellPopover, openCellPopover, cellLocation]);
|
|
133
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_cell_popover.euiDataGridCellPopoverStyles);
|
|
134
|
+
var _useEuiMemoizedStyles = (0, _services.useEuiMemoizedStyles)(_data_grid.euiDataGridVariables),
|
|
135
|
+
levels = _useEuiMemoizedStyles.levels;
|
|
133
136
|
var cellPopover = (0, _react.useMemo)(function () {
|
|
134
|
-
var _cellPopoverProps$pan;
|
|
137
|
+
var _cellPopoverProps$pan, _cell$offsetWidth;
|
|
135
138
|
if (!popoverIsOpen || !popoverAnchor) return null;
|
|
139
|
+
var cell = popoverAnchor.closest('.euiDataGridRowCell');
|
|
136
140
|
|
|
137
141
|
// Note that this popover is rendered once at the top grid level, rather than one popover per cell
|
|
138
142
|
return (0, _react2.jsx)(_popover.EuiWrappingPopover, (0, _extends2.default)({
|
|
139
143
|
isOpen: popoverIsOpen,
|
|
140
144
|
display: "block",
|
|
141
145
|
hasArrow: false,
|
|
146
|
+
attachToAnchor: true // required for https://github.com/elastic/eui/issues/6151
|
|
147
|
+
,
|
|
142
148
|
panelPaddingSize: "s",
|
|
143
149
|
anchorPosition: popoverAnchorPosition,
|
|
144
|
-
repositionToCrossAxis: false
|
|
150
|
+
repositionToCrossAxis: false,
|
|
151
|
+
zIndex: levels.cellPopover
|
|
145
152
|
}, cellPopoverProps, {
|
|
146
153
|
focusTrapProps: {
|
|
147
154
|
onClickOutside: onClickOutside,
|
|
148
155
|
clickOutsideDisables: false
|
|
149
156
|
},
|
|
150
|
-
panelProps: _objectSpread({
|
|
157
|
+
panelProps: _objectSpread(_objectSpread({
|
|
151
158
|
'data-test-subj': 'euiDataGridExpansionPopover'
|
|
152
|
-
}, cellPopoverProps.panelProps || {}),
|
|
159
|
+
}, cellPopoverProps.panelProps || {}), {}, {
|
|
160
|
+
css: [styles.euiDataGridRowCell__popover, cellPopoverProps.css]
|
|
161
|
+
}),
|
|
153
162
|
panelClassName: (0, _classnames.default)('euiDataGridRowCell__popover', cellPopoverProps.panelClassName, (_cellPopoverProps$pan = cellPopoverProps.panelProps) === null || _cellPopoverProps$pan === void 0 ? void 0 : _cellPopoverProps$pan.className),
|
|
154
163
|
panelStyle: {
|
|
155
|
-
maxInlineSize: "min(75vw, max(".concat(
|
|
164
|
+
maxInlineSize: "min(75vw, max(".concat((_cell$offsetWidth = cell === null || cell === void 0 ? void 0 : cell.offsetWidth) !== null && _cell$offsetWidth !== void 0 ? _cell$offsetWidth : 0, "px, 400px))"),
|
|
156
165
|
maxBlockSize: '50vh'
|
|
157
166
|
},
|
|
158
167
|
onKeyDown: onKeyDown,
|
|
159
168
|
button: popoverAnchor,
|
|
160
169
|
closePopover: closeCellPopover
|
|
161
170
|
}), popoverContent);
|
|
162
|
-
}, [popoverIsOpen, popoverAnchor, popoverContent, cellPopoverProps, closeCellPopover, onClickOutside, onKeyDown, popoverAnchorPosition]);
|
|
171
|
+
}, [styles, levels.cellPopover, popoverIsOpen, popoverAnchor, popoverContent, cellPopoverProps, closeCellPopover, onClickOutside, onKeyDown, popoverAnchorPosition]);
|
|
163
172
|
return (0, _react.useMemo)(function () {
|
|
164
173
|
return {
|
|
165
174
|
cellPopoverContext: cellPopoverContext,
|