@elastic/eui 104.1.0 → 105.0.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/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +4 -4
- package/es/components/basic_table/in_memory_table.js +4 -4
- package/es/components/button/button.js +1 -1
- package/es/components/button/button_display/_button_display.js +1 -1
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group_button.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/call_out/call_out.js +1 -1
- package/es/components/card/card.js +2 -2
- package/es/components/card/card_select/card_select.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/es/components/combo_box/combo_box.a11y.js +53 -2
- package/es/components/combo_box/combo_box.js +26 -8
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
- package/es/components/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/es/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
- package/es/components/datagrid/body/data_grid_body.js +7 -7
- package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/es/components/datagrid/controls/column_sorting.js +7 -7
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/es/components/datagrid/data_grid.styles.js +4 -1
- package/es/components/datagrid/utils/in_memory.js +6 -6
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/facet/facet_button.js +1 -1
- package/es/components/filter_group/filter_select_item.js +21 -17
- package/es/components/flyout/flyout.js +88 -21
- package/es/components/flyout/flyout.styles.js +9 -5
- package/es/components/flyout/flyout_child.js +209 -0
- package/es/components/flyout/flyout_child.styles.js +31 -0
- package/es/components/flyout/flyout_child_manager.js +112 -0
- package/es/components/flyout/flyout_context.js +16 -0
- package/es/components/flyout/index.js +3 -1
- package/es/components/flyout/sessions/flyout_provider.js +109 -0
- package/es/components/flyout/sessions/flyout_reducer.js +217 -0
- package/es/components/flyout/sessions/index.js +10 -0
- package/es/components/flyout/sessions/types.js +1 -0
- package/es/components/flyout/sessions/use_eui_flyout.js +94 -0
- package/es/components/form/field_number/field_number.js +2 -2
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/es/components/form/text_area/text_area.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo/header_logo.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +1 -4
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/progress/progress.js +51 -11
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/table/table_row.styles.js +11 -6
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +1 -1
- package/es/components/toast/toast.js +1 -1
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/themes/amsterdam/global_styling/variables/_components.js +305 -270
- package/eui.d.ts +400 -77
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +4 -4
- package/lib/components/basic_table/in_memory_table.js +4 -4
- package/lib/components/button/button.js +1 -1
- package/lib/components/button/button_display/_button_display.js +1 -1
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/call_out/call_out.js +1 -1
- package/lib/components/card/card.js +2 -2
- package/lib/components/card/card_select/card_select.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/lib/components/combo_box/combo_box.a11y.js +53 -2
- package/lib/components/combo_box/combo_box.js +26 -8
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
- package/lib/components/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
- package/lib/components/datagrid/body/data_grid_body.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/lib/components/datagrid/controls/column_sorting.js +7 -7
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/lib/components/datagrid/data_grid.styles.js +4 -1
- package/lib/components/datagrid/utils/in_memory.js +6 -6
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/facet/facet_button.js +1 -1
- package/lib/components/filter_group/filter_select_item.js +21 -17
- package/lib/components/flyout/flyout.js +88 -21
- package/lib/components/flyout/flyout.styles.js +10 -6
- package/lib/components/flyout/flyout_child.js +217 -0
- package/lib/components/flyout/flyout_child.styles.js +37 -0
- package/lib/components/flyout/flyout_child_manager.js +120 -0
- package/lib/components/flyout/flyout_context.js +21 -0
- package/lib/components/flyout/index.js +21 -1
- package/lib/components/flyout/sessions/flyout_provider.js +116 -0
- package/lib/components/flyout/sessions/flyout_reducer.js +224 -0
- package/lib/components/flyout/sessions/index.js +25 -0
- package/lib/components/flyout/sessions/types.js +5 -0
- package/lib/components/flyout/sessions/use_eui_flyout.js +99 -0
- package/lib/components/form/field_number/field_number.js +2 -2
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/lib/components/form/text_area/text_area.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo/header_logo.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +1 -4
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/pagination/pagination_button.js +1 -1
- package/lib/components/progress/progress.js +54 -11
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/table/table_row.styles.js +11 -6
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +1 -1
- package/lib/components/toast/toast.js +1 -1
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/themes/amsterdam/global_styling/variables/_components.js +305 -270
- package/optimize/es/components/combo_box/combo_box.a11y.js +53 -2
- package/optimize/es/components/combo_box/combo_box.js +26 -8
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +8 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
- package/optimize/es/components/datagrid/data_grid.styles.js +4 -1
- package/optimize/es/components/filter_group/filter_select_item.js +20 -17
- package/optimize/es/components/flyout/flyout.js +88 -21
- package/optimize/es/components/flyout/flyout.styles.js +9 -5
- package/optimize/es/components/flyout/flyout_child.js +168 -0
- package/optimize/es/components/flyout/flyout_child.styles.js +31 -0
- package/optimize/es/components/flyout/flyout_child_manager.js +98 -0
- package/optimize/es/components/flyout/flyout_context.js +16 -0
- package/optimize/es/components/flyout/index.js +3 -1
- package/optimize/es/components/flyout/sessions/flyout_provider.js +104 -0
- package/optimize/es/components/flyout/sessions/flyout_reducer.js +209 -0
- package/optimize/es/components/flyout/sessions/index.js +10 -0
- package/optimize/es/components/flyout/sessions/types.js +1 -0
- package/optimize/es/components/flyout/sessions/use_eui_flyout.js +94 -0
- package/optimize/es/components/icon/icon_map.js +1 -4
- package/optimize/es/components/progress/progress.js +38 -9
- package/optimize/es/components/table/table_row.styles.js +11 -6
- package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +305 -270
- package/optimize/lib/components/combo_box/combo_box.a11y.js +53 -2
- package/optimize/lib/components/combo_box/combo_box.js +26 -8
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +8 -3
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
- package/optimize/lib/components/datagrid/data_grid.styles.js +4 -1
- package/optimize/lib/components/filter_group/filter_select_item.js +20 -17
- package/optimize/lib/components/flyout/flyout.js +88 -21
- package/optimize/lib/components/flyout/flyout.styles.js +10 -6
- package/optimize/lib/components/flyout/flyout_child.js +176 -0
- package/optimize/lib/components/flyout/flyout_child.styles.js +37 -0
- package/optimize/lib/components/flyout/flyout_child_manager.js +108 -0
- package/optimize/lib/components/flyout/flyout_context.js +21 -0
- package/optimize/lib/components/flyout/index.js +21 -1
- package/optimize/lib/components/flyout/sessions/flyout_provider.js +114 -0
- package/optimize/lib/components/flyout/sessions/flyout_reducer.js +217 -0
- package/optimize/lib/components/flyout/sessions/index.js +25 -0
- package/optimize/lib/components/flyout/sessions/types.js +5 -0
- package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +99 -0
- package/optimize/lib/components/icon/icon_map.js +1 -4
- package/optimize/lib/components/progress/progress.js +41 -9
- package/optimize/lib/components/table/table_row.styles.js +11 -6
- package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +305 -270
- package/package.json +4 -4
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +4 -4
- package/test-env/components/basic_table/in_memory_table.js +4 -4
- package/test-env/components/button/button.js +1 -1
- package/test-env/components/button/button_display/_button_display.js +1 -1
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/call_out/call_out.js +1 -1
- package/test-env/components/card/card.js +2 -2
- package/test-env/components/card/card_select/card_select.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/test-env/components/combo_box/combo_box.a11y.js +53 -2
- package/test-env/components/combo_box/combo_box.js +26 -8
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +9 -3
- package/test-env/components/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +9 -4
- package/test-env/components/datagrid/body/data_grid_body.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/test-env/components/datagrid/controls/column_sorting.js +7 -7
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/test-env/components/datagrid/data_grid.styles.js +4 -1
- package/test-env/components/datagrid/utils/in_memory.js +6 -6
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/facet/facet_button.js +1 -1
- package/test-env/components/filter_group/filter_select_item.js +21 -17
- package/test-env/components/flyout/flyout.styles.js +10 -6
- package/test-env/components/flyout/flyout_child.js +216 -0
- package/test-env/components/flyout/flyout_child.styles.js +37 -0
- package/test-env/components/flyout/flyout_child_manager.js +117 -0
- package/test-env/components/flyout/flyout_context.js +21 -0
- package/test-env/components/flyout/index.js +21 -1
- package/test-env/components/flyout/sessions/flyout_provider.js +114 -0
- package/test-env/components/flyout/sessions/flyout_reducer.js +217 -0
- package/test-env/components/flyout/sessions/index.js +25 -0
- package/test-env/components/flyout/sessions/types.js +5 -0
- package/test-env/components/flyout/sessions/use_eui_flyout.js +99 -0
- package/test-env/components/form/field_number/field_number.js +2 -2
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/test-env/components/form/text_area/text_area.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo/header_logo.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/icon/icon_map.js +1 -4
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/pagination/pagination_button.js +1 -1
- package/test-env/components/progress/progress.js +49 -11
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/table/table_row.styles.js +11 -6
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +1 -1
- package/test-env/components/toast/toast.js +1 -1
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/themes/amsterdam/global_styling/variables/_components.js +305 -270
|
@@ -14,8 +14,9 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
14
14
|
import React, { useState } from 'react';
|
|
15
15
|
import { EuiComboBox } from './index';
|
|
16
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
|
-
var ComboBox = function ComboBox() {
|
|
18
|
-
var
|
|
17
|
+
var ComboBox = function ComboBox(_ref) {
|
|
18
|
+
var initialOptions = _ref.initialOptions;
|
|
19
|
+
var _useState = useState(initialOptions !== null && initialOptions !== void 0 ? initialOptions : [{
|
|
19
20
|
label: 'Titan',
|
|
20
21
|
'data-test-subj': 'titanOption'
|
|
21
22
|
}, {
|
|
@@ -98,4 +99,54 @@ describe('EuiComboBox', function () {
|
|
|
98
99
|
cy.checkAxe();
|
|
99
100
|
});
|
|
100
101
|
});
|
|
102
|
+
describe('Manual Accessibility check', function () {
|
|
103
|
+
it('sets the correct aria-activedescendant id', function () {
|
|
104
|
+
cy.realPress('Tab');
|
|
105
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').should('have.focus');
|
|
106
|
+
cy.get('button[data-test-subj="titanOption"]').should('exist');
|
|
107
|
+
cy.realPress('ArrowDown');
|
|
108
|
+
cy.realPress('ArrowDown');
|
|
109
|
+
cy.realPress('ArrowDown');
|
|
110
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').invoke('attr', 'aria-activedescendant').should('include', 'option-2');
|
|
111
|
+
cy.realPress('Enter');
|
|
112
|
+
cy.realPress('ArrowDown');
|
|
113
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').invoke('attr', 'aria-activedescendant').should('include', 'option-3');
|
|
114
|
+
});
|
|
115
|
+
it('sets the correct aria-activedescendant id with custom option ids', function () {
|
|
116
|
+
cy.realMount(___EmotionJSX(ComboBox, {
|
|
117
|
+
initialOptions: [{
|
|
118
|
+
id: 'titan',
|
|
119
|
+
label: 'Titan',
|
|
120
|
+
'data-test-subj': 'titanOption'
|
|
121
|
+
}, {
|
|
122
|
+
id: 'enceladus',
|
|
123
|
+
label: 'Enceladus',
|
|
124
|
+
'data-test-subj': 'enceladusOption'
|
|
125
|
+
}, {
|
|
126
|
+
id: 'mimas',
|
|
127
|
+
label: 'Mimas',
|
|
128
|
+
'data-test-subj': 'mimasOption'
|
|
129
|
+
}, {
|
|
130
|
+
id: 'dione',
|
|
131
|
+
label: 'Dione',
|
|
132
|
+
'data-test-subj': 'dioneOption'
|
|
133
|
+
}, {
|
|
134
|
+
id: 'iapetus',
|
|
135
|
+
label: 'Iapetus',
|
|
136
|
+
'data-test-subj': 'iapetusOption'
|
|
137
|
+
}]
|
|
138
|
+
}));
|
|
139
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').should('exist');
|
|
140
|
+
cy.realPress('Tab');
|
|
141
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').should('have.focus');
|
|
142
|
+
cy.get('button[data-test-subj="titanOption"]').should('exist');
|
|
143
|
+
cy.realPress('ArrowDown');
|
|
144
|
+
cy.realPress('ArrowDown');
|
|
145
|
+
cy.realPress('ArrowDown');
|
|
146
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').should('have.attr', 'aria-activedescendant', 'mimas');
|
|
147
|
+
cy.realPress('Enter');
|
|
148
|
+
cy.realPress('ArrowDown');
|
|
149
|
+
cy.get('input[data-test-subj="comboBoxSearchInput"]').should('have.attr', 'aria-activedescendant', 'iapetus');
|
|
150
|
+
});
|
|
151
|
+
});
|
|
101
152
|
});
|
|
@@ -68,6 +68,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
68
68
|
showPrevSelected: Boolean(_this.props.singleSelection),
|
|
69
69
|
sortMatchesBy: _this.props.sortMatchesBy
|
|
70
70
|
}),
|
|
71
|
+
listOptionRefs: [],
|
|
71
72
|
searchValue: initialSearchValue
|
|
72
73
|
});
|
|
73
74
|
_defineProperty(_this, "rootId", htmlIdGenerator());
|
|
@@ -86,6 +87,16 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
86
87
|
_defineProperty(_this, "listRefCallback", function (ref) {
|
|
87
88
|
_this.listRefInstance = ref;
|
|
88
89
|
});
|
|
90
|
+
_defineProperty(_this, "setListOptionRefs", function (node, index) {
|
|
91
|
+
_this.setState(function (_ref) {
|
|
92
|
+
var listOptionRefs = _ref.listOptionRefs;
|
|
93
|
+
var _listOptionRefs = listOptionRefs;
|
|
94
|
+
_listOptionRefs[index] = node;
|
|
95
|
+
return {
|
|
96
|
+
listOptionRefs: _listOptionRefs
|
|
97
|
+
};
|
|
98
|
+
});
|
|
99
|
+
});
|
|
89
100
|
_defineProperty(_this, "openList", function () {
|
|
90
101
|
_this.setState({
|
|
91
102
|
isListOpen: true
|
|
@@ -102,9 +113,9 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
102
113
|
if (!_this.state.matchingOptions.length) {
|
|
103
114
|
return;
|
|
104
115
|
}
|
|
105
|
-
_this.setState(function (
|
|
106
|
-
var activeOptionIndex =
|
|
107
|
-
matchingOptions =
|
|
116
|
+
_this.setState(function (_ref2) {
|
|
117
|
+
var activeOptionIndex = _ref2.activeOptionIndex,
|
|
118
|
+
matchingOptions = _ref2.matchingOptions;
|
|
108
119
|
var nextActiveOptionIndex;
|
|
109
120
|
if (activeOptionIndex < 0) {
|
|
110
121
|
// If this is the beginning of the user's keyboard navigation of the menu, then we'll focus
|
|
@@ -220,8 +231,8 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
220
231
|
});
|
|
221
232
|
});
|
|
222
233
|
var numberOfSelectedOptions = 0;
|
|
223
|
-
selectedOptions.forEach(function (
|
|
224
|
-
var label =
|
|
234
|
+
selectedOptions.forEach(function (_ref3) {
|
|
235
|
+
var label = _ref3.label;
|
|
225
236
|
var trimmedLabel = transformForCaseSensitivity(label.trim(), isCaseSensitive);
|
|
226
237
|
if (flattenOptions.findIndex(function (option) {
|
|
227
238
|
return option.label === trimmedLabel;
|
|
@@ -363,8 +374,13 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
363
374
|
return _this.closeList();
|
|
364
375
|
});
|
|
365
376
|
} else {
|
|
366
|
-
_this.setState({
|
|
367
|
-
|
|
377
|
+
_this.setState(function (_ref4) {
|
|
378
|
+
var listOptionRefs = _ref4.listOptionRefs,
|
|
379
|
+
matchingOptions = _ref4.matchingOptions;
|
|
380
|
+
return {
|
|
381
|
+
listOptionRefs: listOptionRefs.slice(0, matchingOptions.length - 1),
|
|
382
|
+
activeOptionIndex: matchingOptions.indexOf(addedOption)
|
|
383
|
+
};
|
|
368
384
|
});
|
|
369
385
|
}
|
|
370
386
|
});
|
|
@@ -517,6 +533,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
517
533
|
isCaseSensitive: isCaseSensitive,
|
|
518
534
|
isLoading: isLoading,
|
|
519
535
|
listRef: _this2.listRefCallback,
|
|
536
|
+
setListOptionRefs: _this2.setListOptionRefs,
|
|
520
537
|
matchingOptions: matchingOptions,
|
|
521
538
|
onCloseList: _this2.closeList,
|
|
522
539
|
onCreateOption: onCreateOption,
|
|
@@ -547,6 +564,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
547
564
|
* https://www.w3.org/TR/wai-aria-practices-1.2/examples/combobox/combobox-autocomplete-list.html
|
|
548
565
|
*/
|
|
549
566
|
___EmotionJSX(RenderWithEuiTheme, null, function (euiTheme) {
|
|
567
|
+
var _this2$state$listOpti, _this2$state$listOpti2;
|
|
550
568
|
var cssStyles = [styles.euiComboBox, fullWidth ? styles.fullWidth : logicalStyle('max-width', euiFormMaxWidth(euiTheme))];
|
|
551
569
|
return ___EmotionJSX("div", _extends({
|
|
552
570
|
css: cssStyles
|
|
@@ -570,7 +588,7 @@ export var EuiComboBox = /*#__PURE__*/function (_Component) {
|
|
|
570
588
|
"aria-live": "off",
|
|
571
589
|
input: ___EmotionJSX(EuiComboBoxInput, {
|
|
572
590
|
compressed: compressed,
|
|
573
|
-
focusedOptionId: _this2.hasActiveOption() ? _this2.rootId("_option-".concat(_this2.state.activeOptionIndex)) : undefined,
|
|
591
|
+
focusedOptionId: _this2.hasActiveOption() ? (_this2$state$listOpti = (_this2$state$listOpti2 = _this2.state.listOptionRefs[_this2.state.activeOptionIndex]) === null || _this2$state$listOpti2 === void 0 ? void 0 : _this2$state$listOpti2.id) !== null && _this2$state$listOpti !== void 0 ? _this2$state$listOpti : _this2.rootId("_option-".concat(_this2.state.activeOptionIndex)) : undefined,
|
|
574
592
|
fullWidth: fullWidth,
|
|
575
593
|
hasSelectedOptions: selectedOptions.length > 0,
|
|
576
594
|
id: inputId,
|
|
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
var _excluded = ["children"],
|
|
10
10
|
_excluded2 = ["key", "isGroupLabelOption", "label", "value", "prepend", "append", "truncationProps"],
|
|
11
|
-
_excluded3 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "options", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "delimiter", "truncationProps", "listboxAriaLabel"];
|
|
11
|
+
_excluded3 = ["data-test-subj", "activeOptionIndex", "areAllOptionsSelected", "customOptionText", "fullWidth", "getSelectedOptionForSearchValue", "isCaseSensitive", "isLoading", "listRef", "matchingOptions", "onCloseList", "onCreateOption", "onOptionClick", "onOptionEnterKey", "onScroll", "options", "renderOption", "rootId", "rowHeight", "scrollToIndex", "searchValue", "selectedOptions", "singleSelection", "delimiter", "truncationProps", "listboxAriaLabel", "setListOptionRefs"];
|
|
12
12
|
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; }
|
|
13
13
|
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; }
|
|
14
14
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -89,7 +89,8 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
89
89
|
renderOption = _this$props.renderOption,
|
|
90
90
|
searchValue = _this$props.searchValue,
|
|
91
91
|
rootId = _this$props.rootId,
|
|
92
|
-
matchingOptions = _this$props.matchingOptions
|
|
92
|
+
matchingOptions = _this$props.matchingOptions,
|
|
93
|
+
setListOptionRefs = _this$props.setListOptionRefs;
|
|
93
94
|
var optionIndex = matchingOptions.indexOf(option);
|
|
94
95
|
var hasTruncationProps = _this.props.truncationProps || _truncationProps;
|
|
95
96
|
var truncationProps = hasTruncationProps ? // Individual truncation settings should override component prop
|
|
@@ -120,7 +121,10 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
120
121
|
id: rootId("_option-".concat(index)),
|
|
121
122
|
title: label,
|
|
122
123
|
"aria-setsize": matchingOptions.length,
|
|
123
|
-
"aria-posinset": optionIndex + 1
|
|
124
|
+
"aria-posinset": optionIndex + 1,
|
|
125
|
+
forwardRef: function forwardRef(ref) {
|
|
126
|
+
return setListOptionRefs(ref, index);
|
|
127
|
+
}
|
|
124
128
|
}, rest), ___EmotionJSX("span", {
|
|
125
129
|
className: "euiComboBoxOption__contentWrapper"
|
|
126
130
|
}, ___EmotionJSX(EuiComboBoxOptionAppendPrepend, {
|
|
@@ -212,6 +216,7 @@ export var EuiComboBoxOptionsList = /*#__PURE__*/function (_Component) {
|
|
|
212
216
|
delimiter = _this$props2.delimiter,
|
|
213
217
|
truncationProps = _this$props2.truncationProps,
|
|
214
218
|
listboxAriaLabel = _this$props2.listboxAriaLabel,
|
|
219
|
+
setListOptionRefs = _this$props2.setListOptionRefs,
|
|
215
220
|
rest = _objectWithoutProperties(_this$props2, _excluded3);
|
|
216
221
|
var emptyStateContent;
|
|
217
222
|
if (isLoading) {
|
|
@@ -11,8 +11,9 @@ import { css } from '@emotion/react';
|
|
|
11
11
|
import { logicalCSS, logicalTextAlignCSS, mathWithUnits } from '../../../../global_styling';
|
|
12
12
|
export var euiDataGridCellOutlineStyles = function euiDataGridCellOutlineStyles(_ref2) {
|
|
13
13
|
var euiTheme = _ref2.euiTheme;
|
|
14
|
-
var focusColor = euiTheme.
|
|
15
|
-
var hoverColor = euiTheme.
|
|
14
|
+
var focusColor = euiTheme.components.dataGridRowBorderActive;
|
|
15
|
+
var hoverColor = euiTheme.components.dataGridRowBorderHover;
|
|
16
|
+
var markedColor = euiTheme.components.dataGridRowBorderMarked;
|
|
16
17
|
var outlineWidth = euiTheme.border.width.thick;
|
|
17
18
|
var borderRadius = mathWithUnits(euiTheme.border.radius.medium, function (x) {
|
|
18
19
|
return x / 2;
|
|
@@ -26,7 +27,10 @@ export var euiDataGridCellOutlineStyles = function euiDataGridCellOutlineStyles(
|
|
|
26
27
|
focusColor: focusColor,
|
|
27
28
|
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 "),
|
|
28
29
|
hoverColor: hoverColor,
|
|
29
|
-
hoverStyles: "\n &::after {\n border-color: ".concat(hoverColor, ";\n }\n ")
|
|
30
|
+
hoverStyles: "\n &::after {\n border-color: ".concat(hoverColor, ";\n }\n "),
|
|
31
|
+
markedColor: markedColor,
|
|
32
|
+
// marked styles are used in `data_grid.styles.ts`
|
|
33
|
+
markedStyles: "\n &::after {\n border-color: ".concat(markedColor, ";\n }\n\n .euiDataGridRowCell__actions {\n background-color: ").concat(markedColor, ";\n border-color: ").concat(markedColor, ";\n }\n ")
|
|
30
34
|
};
|
|
31
35
|
};
|
|
32
36
|
export var euiDataGridCellOutlineSelectors = function euiDataGridCellOutlineSelectors() {
|
|
@@ -68,7 +72,8 @@ export var euiDataGridCellOutlineSelectors = function euiDataGridCellOutlineSele
|
|
|
68
72
|
outline: {
|
|
69
73
|
show: is(selectors(hover, focus, isOpen, isEntered)),
|
|
70
74
|
hover: hoverNot(selectors(focus, focusWithin, isOpen)),
|
|
71
|
-
focusTrapped: _(isEntered)
|
|
75
|
+
focusTrapped: _(isEntered),
|
|
76
|
+
marked: is(selectors(focus, isOpen))
|
|
72
77
|
},
|
|
73
78
|
actions: {
|
|
74
79
|
hoverZone: hoverNot(selectors(focus, isOpen)),
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { euiFontSize, logicalCSS, logicalSizeCSS, mathWithUnits } from '../../global_styling';
|
|
11
11
|
import { highContrastModeStyles } from '../../global_styling/functions/high_contrast';
|
|
12
|
+
import { euiDataGridCellOutlineSelectors, euiDataGridCellOutlineStyles } from './body/cell/data_grid_cell.styles';
|
|
12
13
|
export var euiDataGridVariables = function euiDataGridVariables(euiThemeContext) {
|
|
13
14
|
var euiTheme = euiThemeContext.euiTheme;
|
|
14
15
|
return {
|
|
@@ -43,13 +44,15 @@ export var euiDataGridStyles = function euiDataGridStyles(euiThemeContext) {
|
|
|
43
44
|
_cellPadding = _euiDataGridVariables.cellPadding,
|
|
44
45
|
lineHeight = _euiDataGridVariables.lineHeight,
|
|
45
46
|
_fontSize = _euiDataGridVariables.fontSize;
|
|
47
|
+
var _euiDataGridCellOutli = euiDataGridCellOutlineSelectors(),
|
|
48
|
+
outlineSelectors = _euiDataGridCellOutli.outline;
|
|
46
49
|
var borderColors = {
|
|
47
50
|
default: highContrastMode ? euiTheme.border.color : euiTheme.components.dataGridBorderColor,
|
|
48
51
|
vertical: highContrastMode ? euiTheme.border.color : euiTheme.components.dataGridVerticalLineBorderColor
|
|
49
52
|
};
|
|
50
53
|
var border = "".concat(euiTheme.border.width.thin, " solid ").concat(borderColors.default);
|
|
51
54
|
return {
|
|
52
|
-
euiDataGrid: /*#__PURE__*/css("display:flex;flex-direction:column;align-items:stretch;", logicalCSS('height', '100%'), " overflow:hidden;*:where(& .euiDataGridRow){background-color:", euiTheme.components.dataGridRowBackground, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow:hover){background-color:", euiTheme.components.dataGridRowBackgroundHover, ";}*:where(& .euiDataGridRow--selected){background-color:", euiTheme.components.dataGridRowBackgroundSelect, ";}*:where(\n &.euiDataGrid--rowHoverHighlight .euiDataGridRow--selected:hover\n ){background-color:", euiTheme.components.dataGridRowBackgroundSelectHover, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow){background-color:", euiTheme.components.dataGridRowStripesBackground, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--striped){background-color:", euiTheme.components.dataGridRowStripesBackgroundStriped, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundHover, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow--striped:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundStripedHover, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--selected){background-color:", euiTheme.components.dataGridRowStripesBackgroundSelect, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow--selected:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundSelectHover, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow)::before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:0;background-color:", euiTheme.components.dataGridRowBackground, ";};label:euiDataGrid;"),
|
|
55
|
+
euiDataGrid: /*#__PURE__*/css("display:flex;flex-direction:column;align-items:stretch;", logicalCSS('height', '100%'), " overflow:hidden;*:where(& .euiDataGridRow){background-color:", euiTheme.components.dataGridRowBackground, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow:hover){background-color:", euiTheme.components.dataGridRowBackgroundHover, ";}*:where(& .euiDataGridRow--selected){background-color:", euiTheme.components.dataGridRowBackgroundSelect, ";}*:where(& .euiDataGridRow--marked){background-color:", euiTheme.components.dataGridRowBackgroundMarked, ";&:hover{background-color:", euiTheme.components.dataGridRowBackgroundMarkedHover, ";}.euiDataGridRowCell.euiDataGridRowCell{", outlineSelectors.marked, "{", euiDataGridCellOutlineStyles(euiThemeContext).markedStyles, ";}}}*:where(\n &.euiDataGrid--rowHoverHighlight .euiDataGridRow--selected:hover\n ){background-color:", euiTheme.components.dataGridRowBackgroundSelectHover, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow){background-color:", euiTheme.components.dataGridRowStripesBackground, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--striped){background-color:", euiTheme.components.dataGridRowStripesBackgroundStriped, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundHover, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow--striped:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundStripedHover, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--selected){background-color:", euiTheme.components.dataGridRowStripesBackgroundSelect, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow--selected:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundSelectHover, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow)::before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:0;background-color:", euiTheme.components.dataGridRowBackground, ";};label:euiDataGrid;"),
|
|
53
56
|
cellPadding: {
|
|
54
57
|
cellPadding: function cellPadding(size) {
|
|
55
58
|
return /*#__PURE__*/css(".euiDataGridHeaderCell,.euiDataGridRowCell__content{padding:", _cellPadding[size], ";}.euiDataGridRowCell__content--lineCountHeight,.euiDataGridRowCell__content--autoBelowLineCountHeight{", highContrastModeStyles(euiThemeContext, {
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["theme", "children", "className", "disabled", "checked", "isFocused", "showIcons", "toolTipContent", "toolTipProps", "style"];
|
|
9
|
+
var _excluded = ["theme", "children", "className", "disabled", "checked", "isFocused", "showIcons", "toolTipContent", "toolTipProps", "style", "forwardRef"];
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
12
12
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -61,6 +61,11 @@ export var EuiFilterSelectItemClass = /*#__PURE__*/function (_Component) {
|
|
|
61
61
|
_defineProperty(_this, "state", {
|
|
62
62
|
hasFocus: false
|
|
63
63
|
});
|
|
64
|
+
_defineProperty(_this, "setButtonRef", function (node) {
|
|
65
|
+
var _this$props$forwardRe, _this$props;
|
|
66
|
+
_this.buttonRef = node;
|
|
67
|
+
(_this$props$forwardRe = (_this$props = _this.props).forwardRef) === null || _this$props$forwardRe === void 0 || _this$props$forwardRe.call(_this$props, node);
|
|
68
|
+
});
|
|
64
69
|
_defineProperty(_this, "focus", function () {
|
|
65
70
|
if (_this.buttonRef) {
|
|
66
71
|
_this.buttonRef.focus();
|
|
@@ -84,19 +89,19 @@ export var EuiFilterSelectItemClass = /*#__PURE__*/function (_Component) {
|
|
|
84
89
|
return _createClass(EuiFilterSelectItemClass, [{
|
|
85
90
|
key: "render",
|
|
86
91
|
value: function render() {
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
rest = _objectWithoutProperties(_this$
|
|
92
|
+
var _this$props2 = this.props,
|
|
93
|
+
theme = _this$props2.theme,
|
|
94
|
+
children = _this$props2.children,
|
|
95
|
+
className = _this$props2.className,
|
|
96
|
+
disabled = _this$props2.disabled,
|
|
97
|
+
checked = _this$props2.checked,
|
|
98
|
+
isFocused = _this$props2.isFocused,
|
|
99
|
+
showIcons = _this$props2.showIcons,
|
|
100
|
+
toolTipContent = _this$props2.toolTipContent,
|
|
101
|
+
toolTipProps = _this$props2.toolTipProps,
|
|
102
|
+
style = _this$props2.style,
|
|
103
|
+
forwardRef = _this$props2.forwardRef,
|
|
104
|
+
rest = _objectWithoutProperties(_this$props2, _excluded);
|
|
100
105
|
var styles = euiFilterSelectItemStyles(theme);
|
|
101
106
|
var cssStyles = [styles.euiFilterSelectItem, isFocused && styles.isFocused];
|
|
102
107
|
var classes = classNames('euiFilterSelectItem', className);
|
|
@@ -128,9 +133,7 @@ export var EuiFilterSelectItemClass = /*#__PURE__*/function (_Component) {
|
|
|
128
133
|
}));
|
|
129
134
|
}
|
|
130
135
|
var optionItem = ___EmotionJSX("button", _extends({
|
|
131
|
-
ref:
|
|
132
|
-
return _this2.buttonRef = _ref;
|
|
133
|
-
},
|
|
136
|
+
ref: this.setButtonRef,
|
|
134
137
|
role: "option",
|
|
135
138
|
type: "button",
|
|
136
139
|
"aria-selected": checked === 'on',
|
|
@@ -26,6 +26,8 @@ import { EuiPortal } from '../portal';
|
|
|
26
26
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
27
27
|
import { EuiFlyoutCloseButton } from './_flyout_close_button';
|
|
28
28
|
import { euiFlyoutStyles } from './flyout.styles';
|
|
29
|
+
import { EuiFlyoutChild } from './flyout_child';
|
|
30
|
+
import { EuiFlyoutChildProvider } from './flyout_child_manager';
|
|
29
31
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
30
32
|
export var TYPES = ['push', 'overlay'];
|
|
31
33
|
export var SIDES = ['left', 'right'];
|
|
@@ -47,7 +49,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
47
49
|
hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
|
|
48
50
|
closeButtonProps = _ref.closeButtonProps,
|
|
49
51
|
_ref$closeButtonPosit = _ref.closeButtonPosition,
|
|
50
|
-
|
|
52
|
+
_closeButtonPosition = _ref$closeButtonPosit === void 0 ? 'inside' : _ref$closeButtonPosit,
|
|
51
53
|
onClose = _ref.onClose,
|
|
52
54
|
_ref$ownFocus = _ref.ownFocus,
|
|
53
55
|
ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
|
|
@@ -75,6 +77,42 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
75
77
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
76
78
|
var Element = as || defaultElement;
|
|
77
79
|
var maskRef = useRef(null);
|
|
80
|
+
|
|
81
|
+
// Ref for the main flyout element to pass to context
|
|
82
|
+
var internalParentFlyoutRef = useRef(null);
|
|
83
|
+
var _useState = useState(false),
|
|
84
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
85
|
+
isChildFlyoutOpen = _useState2[0],
|
|
86
|
+
setIsChildFlyoutOpen = _useState2[1];
|
|
87
|
+
var _useState3 = useState('side-by-side'),
|
|
88
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
89
|
+
childLayoutMode = _useState4[0],
|
|
90
|
+
setChildLayoutMode = _useState4[1];
|
|
91
|
+
|
|
92
|
+
// Check for child flyout
|
|
93
|
+
var childFlyoutElement = React.Children.toArray(children).find(function (child) {
|
|
94
|
+
return /*#__PURE__*/React.isValidElement(child) && (child.type === EuiFlyoutChild || child.type.displayName === 'EuiFlyoutChild');
|
|
95
|
+
});
|
|
96
|
+
var hasChildFlyout = !!childFlyoutElement;
|
|
97
|
+
|
|
98
|
+
// Validate props, determine close button position and set child flyout classes
|
|
99
|
+
var closeButtonPosition;
|
|
100
|
+
var childFlyoutClasses = [];
|
|
101
|
+
if (hasChildFlyout) {
|
|
102
|
+
if (side !== 'right') {
|
|
103
|
+
throw new Error('EuiFlyout: When an EuiFlyoutChild is present, the `side` prop of EuiFlyout must be "right".');
|
|
104
|
+
}
|
|
105
|
+
if (!isEuiFlyoutSizeNamed(size) || !['s', 'm'].includes(size)) {
|
|
106
|
+
throw new Error("EuiFlyout: When an EuiFlyoutChild is present, the `size` prop of EuiFlyout must be \"s\" or \"m\". Received \"".concat(size, "\"."));
|
|
107
|
+
}
|
|
108
|
+
if (_closeButtonPosition !== 'inside') {
|
|
109
|
+
throw new Error('EuiFlyout: When an EuiFlyoutChild is present, the `closeButtonPosition` prop of EuiFlyout must be "inside".');
|
|
110
|
+
}
|
|
111
|
+
closeButtonPosition = 'inside';
|
|
112
|
+
childFlyoutClasses = ['euiFlyout--hasChild', "euiFlyout--hasChild--".concat(childLayoutMode), "euiFlyout--hasChild--".concat(childFlyoutElement.props.size || 's')];
|
|
113
|
+
} else {
|
|
114
|
+
closeButtonPosition = _closeButtonPosition;
|
|
115
|
+
}
|
|
78
116
|
var windowIsLargeEnoughToPush = useIsWithinMinBreakpoint(pushMinBreakpoint);
|
|
79
117
|
var isPushed = type === 'push' && windowIsLargeEnoughToPush;
|
|
80
118
|
|
|
@@ -82,11 +120,11 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
82
120
|
* Setting up the refs on the actual flyout element in order to
|
|
83
121
|
* accommodate for the `isPushed` state by adding padding to the body equal to the width of the element
|
|
84
122
|
*/
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
resizeRef =
|
|
88
|
-
setResizeRef =
|
|
89
|
-
var setRef = useCombinedRefs([setResizeRef, ref]);
|
|
123
|
+
var _useState5 = useState(null),
|
|
124
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
125
|
+
resizeRef = _useState6[0],
|
|
126
|
+
setResizeRef = _useState6[1];
|
|
127
|
+
var setRef = useCombinedRefs([setResizeRef, ref, internalParentFlyoutRef]);
|
|
90
128
|
var _useResizeObserver = useResizeObserver(isPushed ? resizeRef : null, 'width'),
|
|
91
129
|
width = _useResizeObserver.width;
|
|
92
130
|
useEffect(function () {
|
|
@@ -133,17 +171,25 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
133
171
|
}, [style, maxWidth, size]);
|
|
134
172
|
var styles = useEuiMemoizedStyles(euiFlyoutStyles);
|
|
135
173
|
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], isPushed && !pushAnimation && styles.push.noAnimation, styles[side]];
|
|
136
|
-
var classes = classnames('euiFlyout', className);
|
|
174
|
+
var classes = classnames.apply(void 0, ['euiFlyout'].concat(_toConsumableArray(childFlyoutClasses), [className]));
|
|
137
175
|
|
|
138
176
|
/*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
177
|
+
* Trap focus even when `ownFocus={false}`, otherwise closing
|
|
178
|
+
* the flyout won't return focus to the originating button.
|
|
179
|
+
*
|
|
180
|
+
* Set `clickOutsideDisables={true}` when `ownFocus={false}`
|
|
181
|
+
* to allow non-keyboard users the ability to interact with
|
|
182
|
+
* elements outside the flyout.
|
|
183
|
+
*
|
|
184
|
+
* Set `onClickOutside={onClose}` when `ownFocus` and `type` are the defaults,
|
|
185
|
+
* or if `outsideClickCloses={true}` to close on clicks that target
|
|
186
|
+
* (both mousedown and mouseup) the overlay mask.
|
|
141
187
|
*/
|
|
142
188
|
var flyoutToggle = useRef(document.activeElement);
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
fixedHeaders =
|
|
146
|
-
setFixedHeaders =
|
|
189
|
+
var _useState7 = useState([]),
|
|
190
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
191
|
+
fixedHeaders = _useState8[0],
|
|
192
|
+
setFixedHeaders = _useState8[1];
|
|
147
193
|
useEffect(function () {
|
|
148
194
|
if (includeFixedHeadersInFocusTrap) {
|
|
149
195
|
var fixedHeaderEls = document.querySelectorAll('.euiHeader[data-fixed-header]');
|
|
@@ -167,7 +213,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
167
213
|
return _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
168
214
|
shards: [].concat(_toConsumableArray(fixedHeaders), _toConsumableArray((_focusTrapProps === null || _focusTrapProps === void 0 ? void 0 : _focusTrapProps.shards) || []))
|
|
169
215
|
});
|
|
170
|
-
}, [
|
|
216
|
+
}, [_focusTrapProps, fixedHeaders]);
|
|
171
217
|
|
|
172
218
|
/*
|
|
173
219
|
* Provide meaningful screen reader instructions/details
|
|
@@ -215,6 +261,24 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
215
261
|
// Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
|
|
216
262
|
return undefined;
|
|
217
263
|
}, [onClose, hasOverlayMask, outsideClickCloses]);
|
|
264
|
+
var closeButton = !hideCloseButton && ___EmotionJSX(EuiFlyoutCloseButton, _extends({}, closeButtonProps, {
|
|
265
|
+
onClose: onClose,
|
|
266
|
+
closeButtonPosition: closeButtonPosition,
|
|
267
|
+
side: side
|
|
268
|
+
}));
|
|
269
|
+
|
|
270
|
+
// render content within EuiFlyoutChildProvider if childFlyoutElement is present
|
|
271
|
+
var contentToRender = children;
|
|
272
|
+
if (hasChildFlyout && childFlyoutElement) {
|
|
273
|
+
contentToRender = ___EmotionJSX(EuiFlyoutChildProvider, {
|
|
274
|
+
parentSize: size,
|
|
275
|
+
parentFlyoutRef: internalParentFlyoutRef,
|
|
276
|
+
childElement: childFlyoutElement,
|
|
277
|
+
childrenToRender: children,
|
|
278
|
+
reportIsChildOpen: setIsChildFlyoutOpen,
|
|
279
|
+
reportChildLayoutMode: setChildLayoutMode
|
|
280
|
+
});
|
|
281
|
+
}
|
|
218
282
|
return ___EmotionJSX(EuiFlyoutWrapper, {
|
|
219
283
|
hasOverlayMask: hasOverlayMask,
|
|
220
284
|
maskProps: _objectSpread(_objectSpread({}, maskProps), {}, {
|
|
@@ -225,10 +289,17 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
225
289
|
event: "keydown",
|
|
226
290
|
handler: onKeyDown
|
|
227
291
|
}), ___EmotionJSX(EuiFocusTrap, _extends({
|
|
228
|
-
disabled: isPushed,
|
|
292
|
+
disabled: isPushed || ownFocus && isChildFlyoutOpen,
|
|
229
293
|
scrollLock: hasOverlayMask,
|
|
230
294
|
clickOutsideDisables: !ownFocus,
|
|
231
|
-
onClickOutside: onClickOutside
|
|
295
|
+
onClickOutside: onClickOutside,
|
|
296
|
+
returnFocus: function returnFocus() {
|
|
297
|
+
if (!isChildFlyoutOpen && flyoutToggle.current) {
|
|
298
|
+
flyoutToggle.current.focus();
|
|
299
|
+
return false; // We've handled focus
|
|
300
|
+
}
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
232
303
|
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
233
304
|
className: classes,
|
|
234
305
|
css: cssStyles,
|
|
@@ -240,11 +311,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
240
311
|
tabIndex: !isPushed ? 0 : rest.tabIndex,
|
|
241
312
|
"aria-describedby": !isPushed ? ariaDescribedBy : _ariaDescribedBy,
|
|
242
313
|
"data-autofocus": !isPushed || undefined
|
|
243
|
-
}), !isPushed && screenReaderDescription,
|
|
244
|
-
onClose: onClose,
|
|
245
|
-
closeButtonPosition: closeButtonPosition,
|
|
246
|
-
side: side
|
|
247
|
-
})), children)));
|
|
314
|
+
}), !isPushed && screenReaderDescription, closeButton, contentToRender)));
|
|
248
315
|
}
|
|
249
316
|
// React.forwardRef interferes with the inferred element type
|
|
250
317
|
// Casting to ensure correct element prop type checking for `as`
|
|
@@ -28,14 +28,15 @@ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
|
28
28
|
var euiTheme = euiThemeContext.euiTheme,
|
|
29
29
|
colorMode = euiThemeContext.colorMode;
|
|
30
30
|
return {
|
|
31
|
-
euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('bottom', 0), " ", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), " ", logicalCSS('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}",
|
|
31
|
+
euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('bottom', 0), " ", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), " ", logicalCSS('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", maxedFlyoutWidth(euiThemeContext), ";;label:euiFlyout;"),
|
|
32
32
|
// Flyout sizes
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// When a child flyout is stacked on top of the parent, the parent flyout size will match the child flyout size
|
|
34
|
+
s: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 's'), " &.euiFlyout--hasChild--stacked.euiFlyout--hasChild--m{", composeFlyoutSizing(euiThemeContext, 'm'), ";};label:s;"),
|
|
35
|
+
m: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'm'), " &.euiFlyout--hasChild--stacked.euiFlyout--hasChild--s{", composeFlyoutSizing(euiThemeContext, 's'), ";};label:m;"),
|
|
35
36
|
l: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
|
|
36
37
|
noMaxWidth: /*#__PURE__*/css(logicalCSS('max-width', 'none'), ";;label:noMaxWidth;"),
|
|
37
38
|
// Side
|
|
38
|
-
right: /*#__PURE__*/css("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", logicalCSS('right', 0), " ", euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
|
|
39
|
+
right: /*#__PURE__*/css("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", logicalCSS('right', 0), " ", euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";}&.euiFlyout--hasChild{clip-path:none;};label:right;"),
|
|
39
40
|
// Left-side flyouts should only be used for navigation
|
|
40
41
|
left: /*#__PURE__*/css(logicalCSS('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:left;"),
|
|
41
42
|
// Type
|
|
@@ -61,7 +62,10 @@ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
|
-
var
|
|
65
|
+
export var maxedFlyoutWidth = function maxedFlyoutWidth(euiThemeContext) {
|
|
66
|
+
return "\n ".concat(euiMaxBreakpoint(euiThemeContext, FLYOUT_BREAKPOINT), " {\n ").concat(logicalCSS('max-width', '90vw !important'), "\n }\n");
|
|
67
|
+
};
|
|
68
|
+
export var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
|
|
65
69
|
var euiTheme = euiThemeContext.euiTheme;
|
|
66
70
|
var formMaxWidth = euiFormMaxWidth(euiThemeContext);
|
|
67
71
|
|