@elastic/eui 91.0.0 → 91.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +191 -124
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +191 -124
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.a11y.js +1 -3
- 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/action_types.js +5 -0
- package/es/components/basic_table/basic_table.a11y.js +1 -2
- package/es/components/basic_table/basic_table.js +9 -9
- package/es/components/basic_table/collapsed_item_actions.js +120 -249
- package/es/components/basic_table/custom_item_action.js +9 -95
- package/es/components/basic_table/default_item_action.js +23 -14
- package/es/components/basic_table/in_memory_table.a11y.js +13 -11
- package/es/components/basic_table/in_memory_table.js +9 -9
- package/es/components/breadcrumbs/breadcrumb.js +11 -7
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -0
- package/es/components/button/button_display/_button_display.js +6 -4
- package/es/components/button/button_display/_button_display_content.js +9 -5
- package/es/components/button/button_empty/button_empty.js +10 -8
- package/es/components/button/button_group/button_group.js +6 -4
- package/es/components/button/button_group/button_group_button.js +6 -4
- 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.a11y.js +5 -18
- package/es/components/card/card.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +21 -59
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +91 -39
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +69 -83
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +1 -19
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -102
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +7 -90
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +154 -134
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
- package/es/components/combo_box/combo_box.js +1 -1
- 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 +16 -8
- package/es/components/context_menu/context_menu_item.styles.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +29 -19
- package/es/components/datagrid/body/data_grid_body_custom.js +29 -19
- package/es/components/datagrid/body/data_grid_body_virtualized.js +29 -19
- package/es/components/datagrid/body/data_grid_cell.js +91 -68
- package/es/components/datagrid/body/data_grid_cell_actions.js +12 -12
- package/es/components/datagrid/body/data_grid_cell_popover.js +43 -10
- package/es/components/datagrid/body/header/data_grid_header_cell.js +77 -46
- package/es/components/datagrid/body/header/data_grid_header_row.js +29 -19
- package/es/components/datagrid/controls/column_selector.js +19 -39
- package/es/components/datagrid/controls/column_sorting.js +18 -29
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +154 -0
- package/es/components/datagrid/controls/display_selector.js +0 -1
- package/es/components/datagrid/controls/fullscreen_selector.js +2 -6
- package/es/components/datagrid/controls/index.js +2 -1
- package/es/components/datagrid/index.js +1 -1
- package/es/components/datagrid/utils/in_memory.js +28 -18
- package/es/components/datagrid/utils/row_heights.js +1 -1
- package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -4
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/error_boundary/error_boundary.a11y.js +1 -1
- package/es/components/expression/expression.a11y.js +2 -4
- package/es/components/facet/facet_button.js +6 -4
- package/es/components/filter_group/filter_button.js +2 -2
- package/es/components/focus_trap/focus_trap.a11y.js +3 -3
- package/es/components/form/field_number/field_number.js +1 -1
- 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/range/range.a11y.js +5 -10
- package/es/components/form/super_select/super_select.js +3 -2
- package/es/components/form/super_select/super_select_control.js +13 -20
- package/es/components/header/header.a11y.js +1 -1
- package/es/components/header/header_links/header_link.js +8 -6
- 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 +8 -6
- package/es/components/icon/assets/endpoint.js +37 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +1 -0
- package/es/components/image/image.a11y.js +1 -2
- package/es/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/link/external_link_icon.js +51 -0
- package/es/components/link/link.js +6 -20
- package/es/components/link/link.styles.js +2 -5
- package/es/components/list_group/list_group.js +8 -3
- package/es/components/list_group/list_group_item.js +16 -6
- package/es/components/list_group/list_group_item.styles.js +2 -1
- 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 +16 -6
- 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/notification/notification_event.a11y.js +1 -2
- package/es/components/notification/notification_event.js +9 -7
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +8 -6
- package/es/components/popover/popover.js +4 -1
- package/es/components/resizable_container/resizable_container.a11y.js +4 -8
- package/es/components/search_bar/search_bar.a11y.js +3 -6
- package/es/components/selectable/selectable.js +16 -1
- package/es/components/selectable/selectable_list/selectable_list.js +233 -79
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -2
- package/es/components/table/table_header_button.js +1 -1
- package/es/components/text/text.styles.js +2 -2
- package/es/components/text_truncate/text_truncate.js +33 -10
- 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/eui.d.ts +480 -138
- package/i18ntokens.json +224 -260
- package/lib/components/accordion/accordion.a11y.js +1 -3
- 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/action_types.js +8 -2
- package/lib/components/basic_table/basic_table.a11y.js +1 -2
- package/lib/components/basic_table/basic_table.js +9 -9
- package/lib/components/basic_table/collapsed_item_actions.js +128 -257
- package/lib/components/basic_table/custom_item_action.js +18 -104
- package/lib/components/basic_table/default_item_action.js +23 -14
- package/lib/components/basic_table/in_memory_table.a11y.js +13 -11
- package/lib/components/basic_table/in_memory_table.js +9 -9
- package/lib/components/breadcrumbs/breadcrumb.js +11 -7
- package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -0
- package/lib/components/button/button_display/_button_display.js +6 -4
- package/lib/components/button/button_display/_button_display_content.js +9 -5
- package/lib/components/button/button_empty/button_empty.js +10 -8
- package/lib/components/button/button_group/button_group.js +6 -4
- package/lib/components/button/button_group/button_group_button.js +6 -4
- 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.a11y.js +5 -18
- package/lib/components/card/card.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +21 -59
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +91 -39
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +68 -82
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -104
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +7 -90
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +154 -134
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
- package/lib/components/combo_box/combo_box.js +1 -1
- 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 +16 -8
- package/lib/components/context_menu/context_menu_item.styles.js +1 -1
- package/lib/components/datagrid/body/data_grid_body.js +29 -19
- package/lib/components/datagrid/body/data_grid_body_custom.js +29 -19
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +29 -19
- package/lib/components/datagrid/body/data_grid_cell.js +91 -68
- package/lib/components/datagrid/body/data_grid_cell_actions.js +12 -13
- package/lib/components/datagrid/body/data_grid_cell_popover.js +43 -10
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +77 -46
- package/lib/components/datagrid/body/header/data_grid_header_row.js +29 -19
- package/lib/components/datagrid/controls/column_selector.js +19 -39
- package/lib/components/datagrid/controls/column_sorting.js +18 -30
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +159 -0
- package/lib/components/datagrid/controls/display_selector.js +0 -1
- package/lib/components/datagrid/controls/fullscreen_selector.js +2 -7
- package/lib/components/datagrid/controls/index.js +8 -1
- package/lib/components/datagrid/index.js +8 -1
- package/lib/components/datagrid/utils/in_memory.js +28 -18
- package/lib/components/datagrid/utils/row_heights.js +1 -1
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -4
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/error_boundary/error_boundary.a11y.js +1 -1
- package/lib/components/expression/expression.a11y.js +2 -4
- package/lib/components/facet/facet_button.js +6 -4
- package/lib/components/filter_group/filter_button.js +2 -2
- package/lib/components/focus_trap/focus_trap.a11y.js +3 -3
- package/lib/components/form/field_number/field_number.js +1 -1
- 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/range/range.a11y.js +5 -10
- package/lib/components/form/super_select/super_select.js +3 -2
- package/lib/components/form/super_select/super_select_control.js +12 -19
- package/lib/components/header/header.a11y.js +1 -1
- package/lib/components/header/header_links/header_link.js +8 -6
- 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 +8 -6
- package/lib/components/icon/assets/endpoint.js +45 -0
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +1 -0
- package/lib/components/icon/svgs/endpoint.svg +4 -0
- package/lib/components/image/image.a11y.js +1 -2
- package/lib/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/link/external_link_icon.js +57 -0
- package/lib/components/link/link.js +6 -20
- package/lib/components/link/link.styles.js +1 -4
- package/lib/components/list_group/list_group.js +8 -3
- package/lib/components/list_group/list_group_item.js +16 -6
- package/lib/components/list_group/list_group_item.styles.js +2 -1
- 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 +16 -6
- 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/notification/notification_event.a11y.js +1 -2
- package/lib/components/notification/notification_event.js +9 -7
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/popover/popover.js +4 -1
- package/lib/components/resizable_container/resizable_container.a11y.js +4 -8
- package/lib/components/search_bar/search_bar.a11y.js +3 -6
- package/lib/components/selectable/selectable.js +16 -1
- package/lib/components/selectable/selectable_list/selectable_list.js +233 -79
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -2
- package/lib/components/table/table_header_button.js +1 -1
- package/lib/components/text/text.styles.js +2 -2
- package/lib/components/text_truncate/text_truncate.js +32 -9
- 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/optimize/es/components/accordion/accordion.a11y.js +1 -3
- package/optimize/es/components/basic_table/action_types.js +5 -0
- package/optimize/es/components/basic_table/basic_table.a11y.js +1 -2
- package/optimize/es/components/basic_table/collapsed_item_actions.js +116 -169
- package/optimize/es/components/basic_table/custom_item_action.js +10 -83
- package/optimize/es/components/basic_table/default_item_action.js +23 -14
- package/optimize/es/components/basic_table/in_memory_table.a11y.js +13 -11
- package/optimize/es/components/breadcrumbs/breadcrumb.js +11 -7
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -0
- package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
- package/optimize/es/components/button/button_empty/button_empty.js +2 -2
- package/optimize/es/components/card/card.a11y.js +5 -18
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +2 -2
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -3
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +10 -5
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +8 -36
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +1 -19
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -23
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +6 -10
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
- package/optimize/es/components/context_menu/context_menu_item.js +9 -6
- package/optimize/es/components/context_menu/context_menu_item.styles.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_cell.js +38 -30
- package/optimize/es/components/datagrid/body/data_grid_cell_actions.js +12 -12
- package/optimize/es/components/datagrid/body/data_grid_cell_popover.js +43 -10
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +49 -28
- package/optimize/es/components/datagrid/controls/column_selector.js +19 -39
- package/optimize/es/components/datagrid/controls/column_sorting.js +18 -29
- package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +70 -0
- package/optimize/es/components/datagrid/controls/display_selector.js +0 -1
- package/optimize/es/components/datagrid/controls/fullscreen_selector.js +2 -6
- package/optimize/es/components/datagrid/controls/index.js +2 -1
- package/optimize/es/components/datagrid/index.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/optimize/es/components/error_boundary/error_boundary.a11y.js +1 -1
- package/optimize/es/components/expression/expression.a11y.js +2 -4
- package/optimize/es/components/filter_group/filter_button.js +2 -2
- package/optimize/es/components/focus_trap/focus_trap.a11y.js +3 -3
- package/optimize/es/components/form/range/range.a11y.js +5 -10
- package/optimize/es/components/form/super_select/super_select.js +3 -2
- package/optimize/es/components/form/super_select/super_select_control.js +13 -20
- package/optimize/es/components/header/header.a11y.js +1 -1
- package/optimize/es/components/icon/assets/endpoint.js +36 -0
- package/optimize/es/components/icon/icon_map.js +1 -0
- package/optimize/es/components/image/image.a11y.js +1 -2
- package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
- package/optimize/es/components/link/external_link_icon.js +41 -0
- package/optimize/es/components/link/link.js +6 -20
- package/optimize/es/components/link/link.styles.js +2 -5
- package/optimize/es/components/list_group/list_group_item.js +8 -3
- package/optimize/es/components/list_group/list_group_item.styles.js +2 -1
- package/optimize/es/components/notification/notification_event.a11y.js +1 -2
- package/optimize/es/components/popover/popover.js +4 -1
- package/optimize/es/components/resizable_container/resizable_container.a11y.js +4 -8
- package/optimize/es/components/search_bar/search_bar.a11y.js +3 -6
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +204 -76
- package/optimize/es/components/text/text.styles.js +2 -2
- package/optimize/es/components/text_truncate/text_truncate.js +26 -9
- package/optimize/lib/components/accordion/accordion.a11y.js +1 -3
- package/optimize/lib/components/basic_table/action_types.js +8 -2
- package/optimize/lib/components/basic_table/basic_table.a11y.js +1 -2
- package/optimize/lib/components/basic_table/collapsed_item_actions.js +123 -174
- package/optimize/lib/components/basic_table/custom_item_action.js +17 -91
- package/optimize/lib/components/basic_table/default_item_action.js +23 -14
- package/optimize/lib/components/basic_table/in_memory_table.a11y.js +13 -11
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +11 -7
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -0
- package/optimize/lib/components/button/button_display/_button_display_content.js +3 -1
- package/optimize/lib/components/button/button_empty/button_empty.js +2 -2
- package/optimize/lib/components/card/card.a11y.js +5 -18
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +1 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -3
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +10 -5
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +8 -36
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -26
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +6 -10
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
- package/optimize/lib/components/context_menu/context_menu_item.js +9 -6
- package/optimize/lib/components/context_menu/context_menu_item.styles.js +1 -1
- package/optimize/lib/components/datagrid/body/data_grid_cell.js +38 -30
- package/optimize/lib/components/datagrid/body/data_grid_cell_actions.js +12 -12
- package/optimize/lib/components/datagrid/body/data_grid_cell_popover.js +43 -10
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +55 -36
- package/optimize/lib/components/datagrid/controls/column_selector.js +19 -39
- package/optimize/lib/components/datagrid/controls/column_sorting.js +18 -29
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +75 -0
- package/optimize/lib/components/datagrid/controls/display_selector.js +0 -1
- package/optimize/lib/components/datagrid/controls/fullscreen_selector.js +2 -6
- package/optimize/lib/components/datagrid/controls/index.js +8 -1
- package/optimize/lib/components/datagrid/index.js +8 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/optimize/lib/components/error_boundary/error_boundary.a11y.js +1 -1
- package/optimize/lib/components/expression/expression.a11y.js +2 -4
- package/optimize/lib/components/filter_group/filter_button.js +2 -2
- package/optimize/lib/components/focus_trap/focus_trap.a11y.js +3 -3
- package/optimize/lib/components/form/range/range.a11y.js +5 -10
- package/optimize/lib/components/form/super_select/super_select.js +3 -2
- package/optimize/lib/components/form/super_select/super_select_control.js +12 -19
- package/optimize/lib/components/header/header.a11y.js +1 -1
- package/optimize/lib/components/icon/assets/endpoint.js +45 -0
- package/optimize/lib/components/icon/icon_map.js +1 -0
- package/optimize/lib/components/icon/svgs/endpoint.svg +4 -0
- package/optimize/lib/components/image/image.a11y.js +1 -2
- package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
- package/optimize/lib/components/link/external_link_icon.js +47 -0
- package/optimize/lib/components/link/link.js +6 -20
- package/optimize/lib/components/link/link.styles.js +1 -4
- package/optimize/lib/components/list_group/list_group_item.js +8 -3
- package/optimize/lib/components/list_group/list_group_item.styles.js +2 -1
- package/optimize/lib/components/notification/notification_event.a11y.js +1 -2
- package/optimize/lib/components/popover/popover.js +4 -1
- package/optimize/lib/components/resizable_container/resizable_container.a11y.js +4 -8
- package/optimize/lib/components/search_bar/search_bar.a11y.js +3 -6
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +204 -76
- package/optimize/lib/components/text/text.styles.js +2 -2
- package/optimize/lib/components/text_truncate/text_truncate.js +25 -8
- package/package.json +6 -7
- package/src/components/datagrid/_data_grid_data_row.scss +139 -100
- package/src/components/datagrid/_mixins.scss +2 -2
- package/src/components/datagrid/body/header/_data_grid_header_row.scss +36 -28
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -5
- package/src/components/form/form_row/_form_row.scss +1 -1
- package/src/components/table/_responsive.scss +19 -0
- package/src/components/table/_table.scss +4 -9
- package/test-env/components/accordion/accordion.a11y.js +1 -3
- package/test-env/components/auto_sizer/auto_sizer.js +10 -3
- 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/action_types.js +8 -2
- package/test-env/components/basic_table/basic_table.a11y.js +1 -2
- package/test-env/components/basic_table/basic_table.js +9 -9
- package/test-env/components/basic_table/collapsed_item_actions.js +124 -251
- package/test-env/components/basic_table/custom_item_action.js +18 -100
- package/test-env/components/basic_table/default_item_action.js +23 -14
- package/test-env/components/basic_table/in_memory_table.a11y.js +13 -11
- package/test-env/components/basic_table/in_memory_table.js +9 -9
- package/test-env/components/breadcrumbs/breadcrumb.js +11 -7
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -0
- package/test-env/components/button/button_display/_button_display.js +6 -4
- package/test-env/components/button/button_display/_button_display_content.js +9 -5
- package/test-env/components/button/button_empty/button_empty.js +10 -8
- package/test-env/components/button/button_group/button_group.js +6 -4
- package/test-env/components/button/button_group/button_group_button.js +6 -4
- 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.a11y.js +5 -18
- package/test-env/components/card/card.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/collapsible_nav_beta.styles.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +4 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +12 -9
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +1 -101
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +21 -59
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +91 -39
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +68 -82
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.styles.js +11 -28
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -105
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +4 -4
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +7 -90
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +154 -134
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
- package/test-env/components/combo_box/combo_box.js +1 -1
- 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 +16 -8
- package/test-env/components/context_menu/context_menu_item.styles.js +1 -1
- package/test-env/components/datagrid/body/data_grid_body.js +29 -19
- package/test-env/components/datagrid/body/data_grid_body_custom.js +29 -19
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +29 -19
- package/test-env/components/datagrid/body/data_grid_cell.js +91 -68
- package/test-env/components/datagrid/body/data_grid_cell_actions.js +12 -12
- package/test-env/components/datagrid/body/data_grid_cell_popover.js +43 -10
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +83 -54
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +29 -19
- package/test-env/components/datagrid/controls/column_selector.js +19 -39
- package/test-env/components/datagrid/controls/column_sorting.js +18 -29
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +158 -0
- package/test-env/components/datagrid/controls/display_selector.js +0 -1
- package/test-env/components/datagrid/controls/fullscreen_selector.js +2 -6
- package/test-env/components/datagrid/controls/index.js +8 -1
- package/test-env/components/datagrid/index.js +8 -1
- package/test-env/components/datagrid/utils/in_memory.js +28 -18
- package/test-env/components/datagrid/utils/row_heights.js +1 -1
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -4
- 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/date_picker/super_date_picker/super_update_button.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/error_boundary/error_boundary.a11y.js +1 -1
- package/test-env/components/expression/expression.a11y.js +2 -4
- package/test-env/components/facet/facet_button.js +6 -4
- package/test-env/components/filter_group/filter_button.js +2 -2
- package/test-env/components/focus_trap/focus_trap.a11y.js +3 -3
- package/test-env/components/form/field_number/field_number.js +1 -1
- 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/range/range.a11y.js +5 -10
- package/test-env/components/form/super_select/super_select.js +3 -2
- package/test-env/components/form/super_select/super_select_control.js +12 -19
- package/test-env/components/header/header.a11y.js +1 -1
- package/test-env/components/header/header_links/header_link.js +8 -6
- 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 +8 -6
- package/test-env/components/icon/assets/endpoint.js +45 -0
- package/test-env/components/icon/icon_map.js +1 -0
- package/test-env/components/image/image.a11y.js +1 -2
- package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +5 -5
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/link/external_link_icon.js +56 -0
- package/test-env/components/link/link.js +6 -20
- package/test-env/components/link/link.styles.js +1 -4
- package/test-env/components/list_group/list_group.js +8 -3
- package/test-env/components/list_group/list_group_item.js +16 -6
- package/test-env/components/list_group/list_group_item.styles.js +2 -1
- 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 +16 -6
- 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/notification/notification_event.a11y.js +1 -2
- package/test-env/components/notification/notification_event.js +9 -7
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/popover/popover.js +4 -1
- package/test-env/components/resizable_container/resizable_container.a11y.js +4 -8
- package/test-env/components/search_bar/search_bar.a11y.js +3 -6
- package/test-env/components/selectable/selectable.js +16 -1
- package/test-env/components/selectable/selectable_list/selectable_list.js +233 -79
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -2
- package/test-env/components/table/table_header_button.js +1 -1
- package/test-env/components/text/text.styles.js +2 -2
- package/test-env/components/text_truncate/text_truncate.js +32 -9
- 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
|
@@ -8,8 +8,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
var _excluded = ["data"],
|
|
11
|
-
_excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data"],
|
|
12
|
-
_excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isVirtualized", "textWrap"];
|
|
11
|
+
_excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data", "truncationProps"],
|
|
12
|
+
_excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isVirtualized", "textWrap", "truncationProps"];
|
|
13
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
15
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -27,6 +27,8 @@ import classNames from 'classnames';
|
|
|
27
27
|
import { FixedSizeList, areEqual } from 'react-window';
|
|
28
28
|
import { EuiAutoSizer } from '../../auto_sizer';
|
|
29
29
|
import { EuiHighlight } from '../../highlight';
|
|
30
|
+
import { EuiMark } from '../../mark';
|
|
31
|
+
import { EuiTextTruncate } from '../../text_truncate';
|
|
30
32
|
import { EuiSelectableListItem } from './selectable_list_item';
|
|
31
33
|
|
|
32
34
|
// Consumer Configurable Props via `EuiSelectable.listProps`
|
|
@@ -81,20 +83,23 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
|
-
|
|
85
|
-
_defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
|
|
86
|
+
// This utility is necessary to exclude group labels from the aria set count
|
|
86
87
|
_defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
87
|
-
|
|
88
|
+
var ariaPosInSetMap = {};
|
|
88
89
|
var latestAriaPosIndex = 0;
|
|
89
90
|
optionArray.forEach(function (option, index) {
|
|
90
91
|
if (!option.isGroupLabel) {
|
|
91
92
|
latestAriaPosIndex++;
|
|
92
|
-
|
|
93
|
+
ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
|
-
|
|
96
|
+
return {
|
|
97
|
+
ariaPosInSetMap: ariaPosInSetMap,
|
|
98
|
+
ariaSetSize: latestAriaPosIndex
|
|
99
|
+
};
|
|
96
100
|
});
|
|
97
101
|
_defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/memo(function (_ref) {
|
|
102
|
+
var _option$textWrap;
|
|
98
103
|
var data = _ref.data,
|
|
99
104
|
index = _ref.index,
|
|
100
105
|
style = _ref.style;
|
|
@@ -111,19 +116,20 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
111
116
|
key = option.key,
|
|
112
117
|
searchableLabel = option.searchableLabel,
|
|
113
118
|
_data = option.data,
|
|
119
|
+
_truncationProps = option.truncationProps,
|
|
114
120
|
optionRest = _objectWithoutProperties(option, _excluded2);
|
|
115
121
|
var _this$props2 = _this.props,
|
|
116
122
|
activeOptionIndex = _this$props2.activeOptionIndex,
|
|
117
123
|
allowExclusions = _this$props2.allowExclusions,
|
|
118
124
|
onFocusBadge = _this$props2.onFocusBadge,
|
|
119
125
|
paddingSize = _this$props2.paddingSize,
|
|
120
|
-
searchValue = _this$props2.searchValue,
|
|
121
126
|
showIcons = _this$props2.showIcons,
|
|
122
127
|
makeOptionId = _this$props2.makeOptionId,
|
|
123
128
|
renderOption = _this$props2.renderOption,
|
|
124
129
|
setActiveOptionIndex = _this$props2.setActiveOptionIndex,
|
|
125
130
|
searchable = _this$props2.searchable,
|
|
126
|
-
|
|
131
|
+
searchValue = _this$props2.searchValue,
|
|
132
|
+
isVirtualized = _this$props2.isVirtualized;
|
|
127
133
|
if (isGroupLabel) {
|
|
128
134
|
return ___EmotionJSX("li", _extends({
|
|
129
135
|
role: "presentation",
|
|
@@ -133,6 +139,15 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
133
139
|
}, optionRest), prepend, label, append);
|
|
134
140
|
}
|
|
135
141
|
var id = makeOptionId(index);
|
|
142
|
+
var isFocused = activeOptionIndex === index;
|
|
143
|
+
|
|
144
|
+
// Text wrapping
|
|
145
|
+
var canWrap = !isVirtualized;
|
|
146
|
+
var _textWrap = (_option$textWrap = option.textWrap) !== null && _option$textWrap !== void 0 ? _option$textWrap : _this.props.textWrap;
|
|
147
|
+
var textWrap = canWrap ? _textWrap : 'truncate';
|
|
148
|
+
|
|
149
|
+
// Truncation config (if any). If none, CSS truncation is used
|
|
150
|
+
var truncationProps = textWrap === 'truncate' ? _this.getTruncationProps(option, isFocused) : undefined;
|
|
136
151
|
return ___EmotionJSX(EuiSelectableListItem, _extends({
|
|
137
152
|
key: id,
|
|
138
153
|
id: id,
|
|
@@ -145,14 +160,14 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
145
160
|
_this.onAddOrRemoveOption(option, event);
|
|
146
161
|
},
|
|
147
162
|
ref: ref ? ref.bind(null, index) : undefined,
|
|
148
|
-
isFocused:
|
|
163
|
+
isFocused: isFocused,
|
|
149
164
|
title: searchableLabel || label,
|
|
150
165
|
checked: checked,
|
|
151
166
|
disabled: disabled,
|
|
152
167
|
prepend: prepend,
|
|
153
168
|
append: append,
|
|
154
|
-
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
155
|
-
"aria-setsize": _this.ariaSetSize,
|
|
169
|
+
"aria-posinset": _this.state.ariaPosInSetMap[index],
|
|
170
|
+
"aria-setsize": _this.state.ariaSetSize,
|
|
156
171
|
onFocusBadge: onFocusBadge,
|
|
157
172
|
allowExclusions: allowExclusions,
|
|
158
173
|
showIcons: showIcons,
|
|
@@ -160,16 +175,18 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
160
175
|
searchable: searchable,
|
|
161
176
|
textWrap: textWrap
|
|
162
177
|
}, optionRest), renderOption ? renderOption( // @ts-ignore complex
|
|
163
|
-
_objectSpread(_objectSpread({}, _option), optionData), _this.
|
|
164
|
-
search: searchValue
|
|
165
|
-
}, label));
|
|
178
|
+
_objectSpread(_objectSpread({}, _option), optionData), searchValue) : searchValue ? _this.renderSearchedText(label, truncationProps) : truncationProps ? _this.renderTruncatedText(label, truncationProps) : label);
|
|
166
179
|
}, areEqual));
|
|
167
|
-
_defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function (
|
|
180
|
+
_defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function () {
|
|
168
181
|
if (!_this.props.isVirtualized) return null;
|
|
182
|
+
var _this$state = _this.state,
|
|
183
|
+
optionArray = _this$state.optionArray,
|
|
184
|
+
itemData = _this$state.itemData;
|
|
169
185
|
var _this$props3 = _this.props,
|
|
170
186
|
windowProps = _this$props3.windowProps,
|
|
171
187
|
forcedHeight = _this$props3.height,
|
|
172
188
|
rowHeight = _this$props3.rowHeight;
|
|
189
|
+
var heightIsFull = forcedHeight === 'full';
|
|
173
190
|
var virtualizationProps = _objectSpread({
|
|
174
191
|
className: 'euiSelectableList__list',
|
|
175
192
|
ref: _this.setListRef,
|
|
@@ -177,7 +194,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
177
194
|
innerRef: _this.setListBoxRef,
|
|
178
195
|
innerElementType: 'ul',
|
|
179
196
|
itemCount: optionArray.length,
|
|
180
|
-
itemData:
|
|
197
|
+
itemData: itemData,
|
|
181
198
|
itemSize: rowHeight,
|
|
182
199
|
'data-skip-axe': 'scrollable-region-focusable'
|
|
183
200
|
}, windowProps);
|
|
@@ -197,7 +214,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
197
214
|
calculatedHeight = numVisibleOptions * rowHeight;
|
|
198
215
|
}
|
|
199
216
|
}
|
|
200
|
-
return heightIsFull ? ___EmotionJSX(EuiAutoSizer,
|
|
217
|
+
return heightIsFull ? ___EmotionJSX(EuiAutoSizer, {
|
|
218
|
+
onResize: _this.calculateDefaultOptionWidth
|
|
219
|
+
}, function (_ref2) {
|
|
201
220
|
var width = _ref2.width,
|
|
202
221
|
height = _ref2.height;
|
|
203
222
|
return ___EmotionJSX(FixedSizeList, _extends({
|
|
@@ -205,7 +224,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
205
224
|
height: height
|
|
206
225
|
}, virtualizationProps), _this.ListRow);
|
|
207
226
|
}) : ___EmotionJSX(EuiAutoSizer, {
|
|
208
|
-
disableHeight: true
|
|
227
|
+
disableHeight: true,
|
|
228
|
+
onResize: _this.calculateDefaultOptionWidth
|
|
209
229
|
}, function (_ref3) {
|
|
210
230
|
var width = _ref3.width;
|
|
211
231
|
return ___EmotionJSX(FixedSizeList, _extends({
|
|
@@ -214,17 +234,111 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
214
234
|
}, virtualizationProps), _this.ListRow);
|
|
215
235
|
});
|
|
216
236
|
});
|
|
237
|
+
_defineProperty(_assertThisInitialized(_this), "forceVirtualizedListRowRerender", function () {
|
|
238
|
+
_this.setState({
|
|
239
|
+
itemData: _objectSpread({}, _this.state.optionArray)
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
// EuiTextTruncate is expensive perf-wise - we use several utilities here to
|
|
243
|
+
// offset its performance cost
|
|
244
|
+
// and creates a resize observer for
|
|
245
|
+
// each individual item. This logic tries to offset this performance hit by
|
|
246
|
+
// guesstimating a default width for each option
|
|
247
|
+
_defineProperty(_assertThisInitialized(_this), "focusBadgeOffset", 0);
|
|
248
|
+
_defineProperty(_assertThisInitialized(_this), "calculateDefaultOptionWidth", function (_ref4) {
|
|
249
|
+
var containerWidth = _ref4.width;
|
|
250
|
+
var _this$props4 = _this.props,
|
|
251
|
+
truncationProps = _this$props4.truncationProps,
|
|
252
|
+
searchable = _this$props4.searchable,
|
|
253
|
+
searchValue = _this$props4.searchValue;
|
|
254
|
+
|
|
255
|
+
// If it's not likely we'll need to use EuiTextTruncate, don't set state/rerender on every panel resize
|
|
256
|
+
var mayTruncate = searchable || truncationProps;
|
|
257
|
+
if (!mayTruncate) return;
|
|
258
|
+
var paddingOffset = _this.props.paddingSize === 'none' ? 0 : 24; // Defaults to 's'
|
|
259
|
+
var checkedIconOffset = _this.props.showIcons === false ? 0 : 28; // Defaults to true
|
|
260
|
+
_this.focusBadgeOffset = _this.props.onFocusBadge === false ? 0 : 46;
|
|
261
|
+
|
|
262
|
+
// Wait a tick for the listbox ref to update before proceeding
|
|
263
|
+
requestAnimationFrame(function () {
|
|
264
|
+
var scrollbarOffset = _this.listBoxRef ? containerWidth - _this.listBoxRef.offsetWidth : 0;
|
|
265
|
+
_this.setState({
|
|
266
|
+
defaultOptionWidth: containerWidth - scrollbarOffset - paddingOffset - checkedIconOffset
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// Potentially force list rows to rerender on dynamic resize as well,
|
|
270
|
+
// but try to do it as lightly as possible
|
|
271
|
+
if (truncationProps || searchable && searchValue) {
|
|
272
|
+
_this.forceVirtualizedListRowRerender();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
_defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, isFocused) {
|
|
277
|
+
// Individual truncation settings should override component-wide settings
|
|
278
|
+
var truncationProps = _objectSpread(_objectSpread({}, _this.props.truncationProps), option.truncationProps);
|
|
279
|
+
|
|
280
|
+
// If we're not actually using EuiTextTruncate, no need to continue
|
|
281
|
+
var hasComplexTruncation = _this.props.searchValue || Object.keys(truncationProps).length > 0;
|
|
282
|
+
if (!hasComplexTruncation) return undefined;
|
|
283
|
+
|
|
284
|
+
// Determine whether we can use the optimized default option width
|
|
285
|
+
var defaultOptionWidth = _this.state.defaultOptionWidth;
|
|
286
|
+
var useDefaultWidth = !option.append && !option.prepend;
|
|
287
|
+
var defaultWidth = useDefaultWidth && defaultOptionWidth ? isFocused ? defaultOptionWidth - _this.focusBadgeOffset : defaultOptionWidth : undefined;
|
|
288
|
+
return _objectSpread({
|
|
289
|
+
width: defaultWidth
|
|
290
|
+
}, truncationProps);
|
|
291
|
+
});
|
|
292
|
+
_defineProperty(_assertThisInitialized(_this), "renderSearchedText", function (text, truncationProps) {
|
|
293
|
+
var searchValue = _this.props.searchValue;
|
|
294
|
+
|
|
295
|
+
// If truncationProps is undefined, we're using non-virtualized text wrapping
|
|
296
|
+
if (!truncationProps) {
|
|
297
|
+
return ___EmotionJSX(EuiHighlight, {
|
|
298
|
+
search: searchValue
|
|
299
|
+
}, text);
|
|
300
|
+
}
|
|
301
|
+
var searchPositionStart = text.toLowerCase().indexOf(searchValue.toLowerCase());
|
|
302
|
+
var searchPositionCenter = searchPositionStart + Math.floor(searchValue.length / 2);
|
|
303
|
+
return ___EmotionJSX(EuiTextTruncate, _extends({}, truncationProps, {
|
|
304
|
+
// When searching, don't allow overriding the truncation settings
|
|
305
|
+
truncation: "startEnd",
|
|
306
|
+
truncationPosition: searchPositionCenter,
|
|
307
|
+
text: text
|
|
308
|
+
}), function (text) {
|
|
309
|
+
return ___EmotionJSX(React.Fragment, null, text.length >= searchValue.length ? ___EmotionJSX(EuiHighlight, {
|
|
310
|
+
search: searchValue
|
|
311
|
+
}, text) :
|
|
312
|
+
// If the available truncated text is shorter than the full search string,
|
|
313
|
+
// just highlight the entire truncated text
|
|
314
|
+
___EmotionJSX(EuiMark, null, text));
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
_defineProperty(_assertThisInitialized(_this), "renderTruncatedText", function (text, truncationProps) {
|
|
318
|
+
return (
|
|
319
|
+
// For some bizarre reason, truncation in EuiSelectable is off on initial mount
|
|
320
|
+
// (but not on rerender) for Safari and _some_ truncation types in Firefox :|
|
|
321
|
+
// Waiting a tick before calculating truncation seems to smooth over the issue
|
|
322
|
+
___EmotionJSX(EuiTextTruncate, _extends({
|
|
323
|
+
calculationDelayMs: 2
|
|
324
|
+
}, truncationProps, {
|
|
325
|
+
text: text
|
|
326
|
+
}), function (text) {
|
|
327
|
+
return text;
|
|
328
|
+
})
|
|
329
|
+
);
|
|
330
|
+
});
|
|
217
331
|
_defineProperty(_assertThisInitialized(_this), "onAddOrRemoveOption", function (option, event) {
|
|
218
332
|
if (option.disabled) {
|
|
219
333
|
return;
|
|
220
334
|
}
|
|
221
|
-
var _this$
|
|
222
|
-
allowExclusions = _this$
|
|
223
|
-
options = _this$
|
|
224
|
-
_this$
|
|
225
|
-
visibleOptions = _this$
|
|
226
|
-
_this.props.setActiveOptionIndex(visibleOptions.findIndex(function (
|
|
227
|
-
var label =
|
|
335
|
+
var _this$props5 = _this.props,
|
|
336
|
+
allowExclusions = _this$props5.allowExclusions,
|
|
337
|
+
options = _this$props5.options,
|
|
338
|
+
_this$props5$visibleO = _this$props5.visibleOptions,
|
|
339
|
+
visibleOptions = _this$props5$visibleO === void 0 ? options : _this$props5$visibleO;
|
|
340
|
+
_this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref5) {
|
|
341
|
+
var label = _ref5.label;
|
|
228
342
|
return label === option.label;
|
|
229
343
|
}), function () {
|
|
230
344
|
if (option.checked === 'on' && allowExclusions) {
|
|
@@ -237,10 +351,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
237
351
|
});
|
|
238
352
|
});
|
|
239
353
|
_defineProperty(_assertThisInitialized(_this), "onAddOption", function (addedOption, event) {
|
|
240
|
-
var _this$
|
|
241
|
-
onOptionClick = _this$
|
|
242
|
-
options = _this$
|
|
243
|
-
singleSelection = _this$
|
|
354
|
+
var _this$props6 = _this.props,
|
|
355
|
+
onOptionClick = _this$props6.onOptionClick,
|
|
356
|
+
options = _this$props6.options,
|
|
357
|
+
singleSelection = _this$props6.singleSelection;
|
|
244
358
|
var changedOption = _objectSpread({}, addedOption);
|
|
245
359
|
var updatedOptions = options.map(function (option) {
|
|
246
360
|
// if singleSelection is enabled, uncheck any selected option(s)
|
|
@@ -259,10 +373,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
259
373
|
onOptionClick(updatedOptions, event, changedOption);
|
|
260
374
|
});
|
|
261
375
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
|
|
262
|
-
var _this$
|
|
263
|
-
onOptionClick = _this$
|
|
264
|
-
singleSelection = _this$
|
|
265
|
-
options = _this$
|
|
376
|
+
var _this$props7 = _this.props,
|
|
377
|
+
onOptionClick = _this$props7.onOptionClick,
|
|
378
|
+
singleSelection = _this$props7.singleSelection,
|
|
379
|
+
options = _this$props7.options;
|
|
266
380
|
var changedOption = _objectSpread({}, removedOption);
|
|
267
381
|
var updatedOptions = options.map(function (option) {
|
|
268
382
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -275,9 +389,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
275
389
|
onOptionClick(updatedOptions, event, changedOption);
|
|
276
390
|
});
|
|
277
391
|
_defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
|
|
278
|
-
var _this$
|
|
279
|
-
onOptionClick = _this$
|
|
280
|
-
options = _this$
|
|
392
|
+
var _this$props8 = _this.props,
|
|
393
|
+
onOptionClick = _this$props8.onOptionClick,
|
|
394
|
+
options = _this$props8.options;
|
|
281
395
|
var changedOption = _objectSpread({}, excludedOption);
|
|
282
396
|
var updatedOptions = options.map(function (option) {
|
|
283
397
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -289,69 +403,83 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
289
403
|
});
|
|
290
404
|
onOptionClick(updatedOptions, event, changedOption);
|
|
291
405
|
});
|
|
406
|
+
var _optionArray = props.visibleOptions || props.options;
|
|
407
|
+
_this.state = _objectSpread({
|
|
408
|
+
defaultOptionWidth: 0,
|
|
409
|
+
optionArray: _optionArray,
|
|
410
|
+
itemData: _objectSpread({}, _optionArray)
|
|
411
|
+
}, _this.calculateAriaSetAttrs(_optionArray));
|
|
292
412
|
return _this;
|
|
293
413
|
}
|
|
294
414
|
_createClass(EuiSelectableList, [{
|
|
295
415
|
key: "componentDidUpdate",
|
|
296
|
-
value: function componentDidUpdate() {
|
|
297
|
-
var
|
|
416
|
+
value: function componentDidUpdate(prevProps) {
|
|
417
|
+
var _this$props9 = this.props,
|
|
418
|
+
activeOptionIndex = _this$props9.activeOptionIndex,
|
|
419
|
+
visibleOptions = _this$props9.visibleOptions,
|
|
420
|
+
options = _this$props9.options;
|
|
298
421
|
if (this.listBoxRef && this.props.searchable !== true) {
|
|
299
422
|
this.listBoxRef.setAttribute('aria-activedescendant', "".concat(this.props.makeOptionId(activeOptionIndex)));
|
|
300
423
|
}
|
|
301
|
-
if (this.listRef && typeof
|
|
302
|
-
this.listRef.scrollToItem(
|
|
424
|
+
if (this.listRef && typeof activeOptionIndex !== 'undefined') {
|
|
425
|
+
this.listRef.scrollToItem(activeOptionIndex, 'auto');
|
|
426
|
+
}
|
|
427
|
+
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
428
|
+
var optionArray = visibleOptions || options;
|
|
429
|
+
this.setState(_objectSpread({
|
|
430
|
+
optionArray: optionArray,
|
|
431
|
+
itemData: _objectSpread({}, optionArray)
|
|
432
|
+
}, this.calculateAriaSetAttrs(optionArray)));
|
|
303
433
|
}
|
|
304
434
|
}
|
|
305
435
|
}, {
|
|
306
436
|
key: "render",
|
|
307
437
|
value: function render() {
|
|
308
438
|
var _this2 = this;
|
|
309
|
-
var _this$
|
|
310
|
-
className = _this$
|
|
311
|
-
options = _this$
|
|
312
|
-
searchValue = _this$
|
|
313
|
-
onOptionClick = _this$
|
|
314
|
-
renderOption = _this$
|
|
315
|
-
forcedHeight = _this$
|
|
316
|
-
windowProps = _this$
|
|
317
|
-
rowHeight = _this$
|
|
318
|
-
activeOptionIndex = _this$
|
|
319
|
-
makeOptionId = _this$
|
|
320
|
-
showIcons = _this$
|
|
321
|
-
singleSelection = _this$
|
|
322
|
-
visibleOptions = _this$
|
|
323
|
-
allowExclusions = _this$
|
|
324
|
-
bordered = _this$
|
|
325
|
-
paddingSize = _this$
|
|
326
|
-
searchable = _this$
|
|
327
|
-
onFocusBadge = _this$
|
|
328
|
-
listId = _this$
|
|
329
|
-
setActiveOptionIndex = _this$
|
|
330
|
-
ariaLabel = _this$
|
|
331
|
-
ariaLabelledby = _this$
|
|
332
|
-
ariaDescribedby = _this$
|
|
333
|
-
role = _this$
|
|
334
|
-
isVirtualized = _this$
|
|
335
|
-
textWrap = _this$
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
this.calculateAriaSetAttrs(optionArray);
|
|
339
|
-
var heightIsFull = forcedHeight === 'full';
|
|
439
|
+
var _this$props10 = this.props,
|
|
440
|
+
className = _this$props10.className,
|
|
441
|
+
options = _this$props10.options,
|
|
442
|
+
searchValue = _this$props10.searchValue,
|
|
443
|
+
onOptionClick = _this$props10.onOptionClick,
|
|
444
|
+
renderOption = _this$props10.renderOption,
|
|
445
|
+
forcedHeight = _this$props10.height,
|
|
446
|
+
windowProps = _this$props10.windowProps,
|
|
447
|
+
rowHeight = _this$props10.rowHeight,
|
|
448
|
+
activeOptionIndex = _this$props10.activeOptionIndex,
|
|
449
|
+
makeOptionId = _this$props10.makeOptionId,
|
|
450
|
+
showIcons = _this$props10.showIcons,
|
|
451
|
+
singleSelection = _this$props10.singleSelection,
|
|
452
|
+
visibleOptions = _this$props10.visibleOptions,
|
|
453
|
+
allowExclusions = _this$props10.allowExclusions,
|
|
454
|
+
bordered = _this$props10.bordered,
|
|
455
|
+
paddingSize = _this$props10.paddingSize,
|
|
456
|
+
searchable = _this$props10.searchable,
|
|
457
|
+
onFocusBadge = _this$props10.onFocusBadge,
|
|
458
|
+
listId = _this$props10.listId,
|
|
459
|
+
setActiveOptionIndex = _this$props10.setActiveOptionIndex,
|
|
460
|
+
ariaLabel = _this$props10['aria-label'],
|
|
461
|
+
ariaLabelledby = _this$props10['aria-labelledby'],
|
|
462
|
+
ariaDescribedby = _this$props10['aria-describedby'],
|
|
463
|
+
role = _this$props10.role,
|
|
464
|
+
isVirtualized = _this$props10.isVirtualized,
|
|
465
|
+
textWrap = _this$props10.textWrap,
|
|
466
|
+
truncationProps = _this$props10.truncationProps,
|
|
467
|
+
rest = _objectWithoutProperties(_this$props10, _excluded3);
|
|
340
468
|
var classes = classNames('euiSelectableList', {
|
|
341
|
-
'euiSelectableList-fullHeight':
|
|
469
|
+
'euiSelectableList-fullHeight': forcedHeight === 'full',
|
|
342
470
|
'euiSelectableList-bordered': bordered
|
|
343
471
|
}, className);
|
|
344
472
|
return ___EmotionJSX("div", _extends({
|
|
345
473
|
className: classes
|
|
346
|
-
}, rest), isVirtualized ? this.renderVirtualizedList(
|
|
474
|
+
}, rest), isVirtualized ? this.renderVirtualizedList() : ___EmotionJSX("div", {
|
|
347
475
|
className: "euiSelectableList__list",
|
|
348
476
|
ref: this.removeScrollableTabStop
|
|
349
477
|
}, ___EmotionJSX("ul", {
|
|
350
478
|
ref: this.setListBoxRef
|
|
351
|
-
}, optionArray.map(function (_, index) {
|
|
479
|
+
}, this.state.optionArray.map(function (_, index) {
|
|
352
480
|
return /*#__PURE__*/React.createElement(_this2.ListRow, {
|
|
353
481
|
key: index,
|
|
354
|
-
data: optionArray,
|
|
482
|
+
data: _this2.state.optionArray,
|
|
355
483
|
index: index
|
|
356
484
|
}, null);
|
|
357
485
|
}))));
|
|
@@ -54,7 +54,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
54
54
|
var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
|
|
55
55
|
return x / 4;
|
|
56
56
|
});
|
|
57
|
-
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n dl,\n blockquote,\n
|
|
57
|
+
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n dl,\n blockquote,\n pre,\n > ul,\n > ol {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n\n /* The styles of the nested ordered lists follow the style of GitHub\n which is commonly used in Markdown or MDX formatting. */\n ol ol,\n ul ol {\n list-style-type: lower-roman;\n }\n\n ul ul ol,\n ul ol ol,\n ol ul ol,\n ol ol ol {\n list-style-type: lower-alpha;\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n ").concat(logicalShorthandCSS('padding', "0 ".concat(fontSize)), "\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; /* 90% of parent font size */\n }\n ").concat(
|
|
58
58
|
// when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
|
|
59
59
|
_customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n /* Ensures the shape still looks like a square when only one character */\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
|
|
60
60
|
};
|
|
@@ -65,7 +65,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
65
65
|
export var euiTextStyles = function euiTextStyles(euiThemeContext) {
|
|
66
66
|
var euiTheme = euiThemeContext.euiTheme;
|
|
67
67
|
return {
|
|
68
|
-
euiText: /*#__PURE__*/css(euiText(euiTheme, true), "clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}
|
|
68
|
+
euiText: /*#__PURE__*/css(euiText(euiTheme, true), "clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote{border-inline-start-color:", euiTheme.border.color, ";border-inline-start-style:solid;}blockquote:not(.euiMarkdownFormat__blockquote){color:", euiTheme.colors.subduedText, ";}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
69
69
|
return x / 2;
|
|
70
70
|
}), ";};label:euiText;"),
|
|
71
71
|
constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
|
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["width", "onResize"],
|
|
5
|
-
_excluded2 = ["width", "children", "text", "truncation", "truncationOffset", "truncationPosition", "ellipsis", "containerRef", "className"],
|
|
5
|
+
_excluded2 = ["width", "children", "text", "truncation", "truncationOffset", "truncationPosition", "ellipsis", "calculationDelayMs", "containerRef", "className"],
|
|
6
6
|
_excluded3 = ["onResize"];
|
|
7
7
|
/*
|
|
8
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -12,7 +12,7 @@ var _excluded = ["width", "onResize"],
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import React, { useState, useMemo, useCallback } from 'react';
|
|
15
|
+
import React, { useState, useMemo, useCallback, useEffect } from 'react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
17
|
import { useCombinedRefs } from '../../services';
|
|
18
18
|
import { EuiResizeObserver } from '../observer/resize_observer';
|
|
@@ -41,6 +41,7 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
41
41
|
truncationPosition = _ref2.truncationPosition,
|
|
42
42
|
_ref2$ellipsis = _ref2.ellipsis,
|
|
43
43
|
ellipsis = _ref2$ellipsis === void 0 ? '…' : _ref2$ellipsis,
|
|
44
|
+
calculationDelayMs = _ref2.calculationDelayMs,
|
|
44
45
|
containerRef = _ref2.containerRef,
|
|
45
46
|
className = _ref2.className,
|
|
46
47
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
@@ -51,6 +52,19 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
51
52
|
setContainerEl = _useState2[1];
|
|
52
53
|
var refs = useCombinedRefs([setContainerEl, containerRef]);
|
|
53
54
|
|
|
55
|
+
// If necessary, wait a tick on mount before truncating
|
|
56
|
+
var _useState3 = useState(!calculationDelayMs),
|
|
57
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
58
|
+
ready = _useState4[0],
|
|
59
|
+
setReady = _useState4[1];
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
if (calculationDelayMs) {
|
|
62
|
+
setTimeout(function () {
|
|
63
|
+
return setReady(true);
|
|
64
|
+
}, calculationDelayMs);
|
|
65
|
+
}
|
|
66
|
+
}, [calculationDelayMs]);
|
|
67
|
+
|
|
54
68
|
// Handle exceptions where we need to override the passed props
|
|
55
69
|
var _useMemo = useMemo(function () {
|
|
56
70
|
var truncation = _truncation;
|
|
@@ -75,7 +89,8 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
75
89
|
truncationOffset = _useMemo.truncationOffset;
|
|
76
90
|
var truncatedText = useMemo(function () {
|
|
77
91
|
var truncatedText = '';
|
|
78
|
-
if (!
|
|
92
|
+
if (!ready || !containerEl) return text;
|
|
93
|
+
if (!width) return truncatedText;
|
|
79
94
|
var utils = new TruncationUtils({
|
|
80
95
|
fullText: text,
|
|
81
96
|
ellipsis: ellipsis,
|
|
@@ -107,7 +122,7 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
107
122
|
}
|
|
108
123
|
}
|
|
109
124
|
return truncatedText;
|
|
110
|
-
}, [width, text, truncation, truncationOffset, truncationPosition, ellipsis, containerEl]);
|
|
125
|
+
}, [ready, width, text, truncation, truncationOffset, truncationPosition, ellipsis, containerEl]);
|
|
111
126
|
var isTruncating = truncatedText !== text;
|
|
112
127
|
return ___EmotionJSX("div", _extends({
|
|
113
128
|
className: classNames('euiTextTruncate', className),
|
|
@@ -131,10 +146,10 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
131
146
|
var EuiTextTruncateWithResizeObserver = function EuiTextTruncateWithResizeObserver(_ref3) {
|
|
132
147
|
var _onResize = _ref3.onResize,
|
|
133
148
|
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
-
width =
|
|
137
|
-
setWidth =
|
|
149
|
+
var _useState5 = useState(0),
|
|
150
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
151
|
+
width = _useState6[0],
|
|
152
|
+
setWidth = _useState6[1];
|
|
138
153
|
var onResize = useCallback(function (_ref4) {
|
|
139
154
|
var width = _ref4.width;
|
|
140
155
|
setWidth(width);
|
|
@@ -146,6 +161,8 @@ var EuiTextTruncateWithResizeObserver = function EuiTextTruncateWithResizeObserv
|
|
|
146
161
|
return ___EmotionJSX(EuiTextTruncateWithWidth, _extends({
|
|
147
162
|
width: width,
|
|
148
163
|
containerRef: ref
|
|
149
|
-
}, props
|
|
164
|
+
}, props, {
|
|
165
|
+
"data-resize-observer": "true"
|
|
166
|
+
}));
|
|
150
167
|
});
|
|
151
168
|
};
|
|
@@ -32,9 +32,7 @@ describe('EuiAccordion', function () {
|
|
|
32
32
|
it('has zero violations when expanded', function () {
|
|
33
33
|
cy.mount((0, _react2.jsx)(_index.EuiAccordion, noArrowProps, (0, _react2.jsx)(_panel.EuiPanel, {
|
|
34
34
|
color: "subdued"
|
|
35
|
-
}, "Any content inside of ", (0, _react2.jsx)("strong", null, "EuiAccordion"), " will appear here.
|
|
36
|
-
href: "#"
|
|
37
|
-
}, "a link"), " to confirm focus.")));
|
|
35
|
+
}, "Any content inside of ", (0, _react2.jsx)("strong", null, "EuiAccordion"), " will appear here.")));
|
|
38
36
|
cy.get('button.euiAccordion__button').click();
|
|
39
37
|
cy.checkAxe();
|
|
40
38
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isCustomItemAction = void 0;
|
|
6
|
+
exports.isCustomItemAction = exports.callWithItemIfFunction = void 0;
|
|
7
7
|
/*
|
|
8
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -15,4 +15,10 @@ exports.isCustomItemAction = void 0;
|
|
|
15
15
|
var isCustomItemAction = function isCustomItemAction(action) {
|
|
16
16
|
return action.hasOwnProperty('render');
|
|
17
17
|
};
|
|
18
|
-
exports.isCustomItemAction = isCustomItemAction;
|
|
18
|
+
exports.isCustomItemAction = isCustomItemAction;
|
|
19
|
+
var callWithItemIfFunction = function callWithItemIfFunction(item) {
|
|
20
|
+
return function (prop) {
|
|
21
|
+
return typeof prop === 'function' ? prop(item) : prop;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.callWithItemIfFunction = callWithItemIfFunction;
|
|
@@ -185,8 +185,7 @@ describe('EuiTable', function () {
|
|
|
185
185
|
});
|
|
186
186
|
describe('Keyboard accessibility', function () {
|
|
187
187
|
it('has zero violations after expanding a row', function () {
|
|
188
|
-
cy.
|
|
189
|
-
cy.get('button#1').should('have.focus');
|
|
188
|
+
cy.get('button#1').focus();
|
|
190
189
|
cy.realPress('Enter');
|
|
191
190
|
cy.get('tr.euiTableRow-isExpandedRow div.euiTableCellContent').should('exist');
|
|
192
191
|
cy.checkAxe();
|