@elastic/eui 90.0.0 → 91.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +1 -15
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +302 -203
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +302 -203
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.a11y.js +1 -3
- package/es/components/accordion/accordion.js +13 -2
- package/es/components/accordion/accordion_children/accordion_children.js +4 -3
- 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 +8 -8
- 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 +8 -8
- package/es/components/breadcrumbs/breadcrumb.js +16 -12
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -0
- package/es/components/breadcrumbs/breadcrumbs.js +5 -5
- package/es/components/button/button_display/_button_display.js +6 -4
- package/es/components/button/button_display/_button_display_content.js +8 -4
- package/es/components/button/button_empty/button_empty.js +9 -7
- package/es/components/button/button_group/button_group.js +13 -13
- package/es/components/button/button_group/button_group_button.js +13 -54
- package/es/components/button/button_group/button_group_button.styles.js +2 -12
- package/es/components/card/card.a11y.js +5 -18
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +8 -0
- 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 +9 -104
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +20 -58
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +89 -37
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +67 -81
- 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 +11 -90
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +150 -130
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
- package/es/components/combo_box/combo_box.js +8 -6
- package/es/components/combo_box/combo_box_input/combo_box_input.js +107 -65
- package/es/components/combo_box/combo_box_input/combo_box_pill.js +8 -18
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +6 -6
- package/es/components/combo_box/utils.js +23 -0
- 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/control_bar/control_bar.js +5 -5
- package/es/components/datagrid/body/data_grid_body.js +16 -6
- package/es/components/datagrid/body/data_grid_body_custom.js +16 -6
- package/es/components/datagrid/body/data_grid_body_virtualized.js +16 -6
- package/es/components/datagrid/body/data_grid_cell.js +67 -44
- 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 +66 -35
- package/es/components/datagrid/body/header/data_grid_header_row.js +16 -6
- package/es/components/datagrid/controls/column_selector.js +24 -45
- package/es/components/datagrid/controls/column_sorting.js +23 -37
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +154 -0
- package/es/components/datagrid/controls/display_selector.js +21 -17
- package/es/components/datagrid/controls/fullscreen_selector.js +2 -6
- package/es/components/datagrid/controls/index.js +2 -1
- package/es/components/datagrid/data_grid.js +3 -864
- package/es/components/datagrid/index.js +1 -1
- package/es/components/datagrid/utils/in_memory.js +16 -6
- 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/super_date_picker/date_popover/absolute_tab.js +92 -26
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +1 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +1 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +19 -0
- package/es/components/date_picker/super_date_picker/super_update_button.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/filter_group/filter_group.styles.js +1 -1
- package/es/components/focus_trap/focus_trap.a11y.js +3 -3
- 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_breadcrumbs/header_breadcrumbs.js +5 -5
- package/es/components/header/header_links/header_link.js +7 -5
- package/es/components/header/header_links/header_links.js +5 -5
- package/es/components/header/header_section/header_section_item_button.js +7 -5
- package/es/components/i18n/i18n.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/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 +6 -1
- package/es/components/list_group/list_group_item.js +14 -4
- package/es/components/list_group/list_group_item.styles.js +2 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +12 -2
- package/es/components/notification/notification_event.a11y.js +1 -2
- package/es/components/notification/notification_event.js +7 -5
- package/es/components/page/page_header/page_header_content.js +5 -5
- package/es/components/pagination/pagination_button.js +7 -5
- package/es/components/popover/input_popover.js +1 -1
- package/es/components/popover/popover.js +19 -28
- package/es/components/popover/popover_arrow/_popover_arrow.styles.js +2 -4
- package/es/components/popover/popover_panel/_popover_panel.js +2 -6
- package/es/components/popover/popover_panel/_popover_panel.styles.js +6 -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 +227 -78
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +29 -12
- package/es/components/text/text.styles.js +2 -2
- package/es/components/text_truncate/text_truncate.js +33 -10
- package/es/components/toast/global_toast_list.js +11 -1
- package/es/components/tour/tour_step.js +5 -5
- package/es/global_styling/mixins/_states.js +4 -1
- package/es/services/color/eui_palettes.js +0 -6
- package/es/services/color/index.js +1 -1
- package/es/services/hooks/useCombinedRefs.js +16 -9
- package/es/services/index.js +1 -2
- package/es/test/rtl/component_helpers.d.ts +2 -0
- package/es/test/rtl/component_helpers.js +40 -1
- package/eui.d.ts +562 -218
- package/i18ntokens.json +329 -347
- package/lib/components/accordion/accordion.a11y.js +1 -3
- package/lib/components/accordion/accordion.js +13 -2
- package/lib/components/accordion/accordion_children/accordion_children.js +4 -3
- 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 +8 -8
- 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 +8 -8
- package/lib/components/breadcrumbs/breadcrumb.js +16 -12
- 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 +8 -4
- package/lib/components/button/button_empty/button_empty.js +9 -7
- package/lib/components/button/button_group/button_group.js +12 -12
- package/lib/components/button/button_group/button_group_button.js +13 -54
- package/lib/components/button/button_group/button_group_button.styles.js +2 -12
- package/lib/components/card/card.a11y.js +5 -18
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +8 -0
- 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 +8 -103
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +20 -58
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +89 -37
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +66 -80
- 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 +10 -89
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +150 -130
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_link.js +0 -10
- package/lib/components/combo_box/combo_box.js +8 -6
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +107 -65
- package/lib/components/combo_box/combo_box_input/combo_box_pill.js +8 -18
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +6 -6
- package/lib/components/combo_box/utils.js +31 -0
- 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 +16 -6
- package/lib/components/datagrid/body/data_grid_body_custom.js +16 -6
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +16 -6
- package/lib/components/datagrid/body/data_grid_cell.js +67 -44
- 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 +66 -35
- package/lib/components/datagrid/body/header/data_grid_header_row.js +16 -6
- package/lib/components/datagrid/controls/column_selector.js +24 -45
- package/lib/components/datagrid/controls/column_sorting.js +22 -37
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +159 -0
- package/lib/components/datagrid/controls/display_selector.js +21 -17
- package/lib/components/datagrid/controls/fullscreen_selector.js +2 -7
- package/lib/components/datagrid/controls/index.js +8 -1
- package/lib/components/datagrid/data_grid.js +2 -863
- package/lib/components/datagrid/index.js +8 -1
- package/lib/components/datagrid/utils/in_memory.js +16 -6
- 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/super_date_picker/date_popover/absolute_tab.js +91 -26
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +1 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +1 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +19 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.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/filter_group/filter_group.styles.js +1 -1
- package/lib/components/focus_trap/focus_trap.a11y.js +3 -3
- 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 +7 -5
- package/lib/components/header/header_section/header_section_item_button.js +7 -5
- package/lib/components/i18n/i18n.js +1 -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/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 +6 -1
- package/lib/components/list_group/list_group_item.js +14 -4
- package/lib/components/list_group/list_group_item.styles.js +2 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +12 -2
- package/lib/components/notification/notification_event.a11y.js +1 -2
- package/lib/components/notification/notification_event.js +7 -5
- package/lib/components/popover/input_popover.js +1 -1
- package/lib/components/popover/popover.js +33 -36
- package/lib/components/popover/popover_arrow/_popover_arrow.styles.js +1 -3
- package/lib/components/popover/popover_panel/_popover_panel.js +2 -1
- package/lib/components/popover/popover_panel/_popover_panel.styles.js +6 -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 +227 -78
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +28 -11
- package/lib/components/text/text.styles.js +2 -2
- package/lib/components/text_truncate/text_truncate.js +32 -9
- package/lib/components/toast/global_toast_list.js +11 -1
- package/lib/global_styling/mixins/_states.js +4 -1
- package/lib/services/color/eui_palettes.js +1 -8
- package/lib/services/color/index.js +0 -7
- package/lib/services/hooks/useCombinedRefs.js +19 -10
- package/lib/services/index.js +0 -15
- package/lib/test/rtl/component_helpers.d.ts +2 -0
- package/lib/test/rtl/component_helpers.js +41 -3
- package/optimize/es/components/accordion/accordion.a11y.js +1 -3
- package/optimize/es/components/accordion/accordion.js +5 -2
- package/optimize/es/components/accordion/accordion_children/accordion_children.js +4 -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/button/button_group/button_group.js +7 -8
- package/optimize/es/components/button/button_group/button_group_button.js +6 -38
- package/optimize/es/components/button/button_group/button_group_button.styles.js +2 -12
- 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_group/collapsible_nav_group.js +8 -3
- 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 +10 -10
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
- package/optimize/es/components/combo_box/combo_box.js +7 -5
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +107 -65
- package/optimize/es/components/combo_box/combo_box_input/combo_box_pill.js +8 -17
- package/optimize/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +6 -6
- package/optimize/es/components/combo_box/utils.js +23 -0
- 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 +50 -29
- package/optimize/es/components/datagrid/controls/column_selector.js +24 -45
- package/optimize/es/components/datagrid/controls/column_sorting.js +23 -37
- package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +70 -0
- package/optimize/es/components/datagrid/controls/display_selector.js +21 -17
- 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/data_grid.js +3 -3
- 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/date_popover/absolute_tab.js +87 -26
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +1 -2
- 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/filter_group/filter_group.styles.js +1 -1
- 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/i18n/i18n.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/input_popover.js +1 -1
- package/optimize/es/components/popover/popover.js +14 -23
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.styles.js +2 -4
- package/optimize/es/components/popover/popover_panel/_popover_panel.js +2 -1
- package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +6 -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 +199 -76
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +13 -11
- package/optimize/es/components/text/text.styles.js +2 -2
- package/optimize/es/components/text_truncate/text_truncate.js +26 -9
- package/optimize/es/components/toast/global_toast_list.js +1 -1
- package/optimize/es/global_styling/mixins/_states.js +4 -1
- package/optimize/es/services/color/eui_palettes.js +0 -6
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/hooks/useCombinedRefs.js +16 -9
- package/optimize/es/services/index.js +1 -2
- package/optimize/es/test/rtl/component_helpers.d.ts +2 -0
- package/optimize/es/test/rtl/component_helpers.js +40 -1
- package/optimize/lib/components/accordion/accordion.a11y.js +1 -3
- package/optimize/lib/components/accordion/accordion.js +5 -2
- package/optimize/lib/components/accordion/accordion_children/accordion_children.js +4 -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/button/button_group/button_group.js +6 -7
- package/optimize/lib/components/button/button_group/button_group_button.js +6 -38
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +2 -12
- 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_group/collapsible_nav_group.js +7 -2
- 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 +9 -9
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -5
- package/optimize/lib/components/combo_box/combo_box.js +7 -5
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +107 -65
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_pill.js +8 -17
- package/optimize/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +6 -6
- package/optimize/lib/components/combo_box/utils.js +31 -0
- 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 +56 -37
- package/optimize/lib/components/datagrid/controls/column_selector.js +24 -45
- package/optimize/lib/components/datagrid/controls/column_sorting.js +22 -36
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +75 -0
- package/optimize/lib/components/datagrid/controls/display_selector.js +21 -17
- 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/data_grid.js +2 -2
- 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/date_popover/absolute_tab.js +86 -26
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +1 -2
- 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/filter_group/filter_group.styles.js +1 -1
- 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/i18n/i18n.js +1 -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/input_popover.js +1 -1
- package/optimize/lib/components/popover/popover.js +28 -36
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.styles.js +1 -3
- package/optimize/lib/components/popover/popover_panel/_popover_panel.js +2 -1
- package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +6 -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 +199 -76
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +12 -10
- package/optimize/lib/components/text/text.styles.js +2 -2
- package/optimize/lib/components/text_truncate/text_truncate.js +25 -8
- package/optimize/lib/components/toast/global_toast_list.js +1 -1
- package/optimize/lib/global_styling/mixins/_states.js +4 -1
- package/optimize/lib/services/color/eui_palettes.js +1 -8
- package/optimize/lib/services/color/index.js +0 -7
- package/optimize/lib/services/hooks/useCombinedRefs.js +19 -10
- package/optimize/lib/services/index.js +0 -15
- package/optimize/lib/test/rtl/component_helpers.d.ts +2 -0
- package/optimize/lib/test/rtl/component_helpers.js +41 -3
- package/package.json +13 -13
- package/src/components/combo_box/_combo_box.scss +46 -14
- package/src/components/combo_box/combo_box_input/_combo_box_pill.scss +0 -17
- package/src/components/combo_box/combo_box_input/_index.scss +0 -2
- package/src/components/datagrid/_data_grid_data_row.scss +139 -101
- 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/date_picker/super_date_picker/date_popover/_absolute_tab.scss +21 -0
- package/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss +0 -4
- package/src/components/form/form_control_layout/_form_control_layout.scss +0 -1
- 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/src/global_styling/variables/_typography.scss +2 -2
- package/test-env/components/accordion/accordion.a11y.js +1 -3
- package/test-env/components/accordion/accordion.js +13 -2
- package/test-env/components/accordion/accordion_children/accordion_children.js +4 -3
- package/test-env/components/auto_sizer/auto_sizer.js +10 -3
- 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 +8 -8
- 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 +8 -8
- package/test-env/components/breadcrumbs/breadcrumb.js +16 -12
- 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 +8 -4
- package/test-env/components/button/button_empty/button_empty.js +9 -7
- package/test-env/components/button/button_group/button_group.js +12 -12
- package/test-env/components/button/button_group/button_group_button.js +13 -54
- package/test-env/components/button/button_group/button_group_button.styles.js +2 -12
- package/test-env/components/card/card.a11y.js +5 -18
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +8 -0
- 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 +8 -103
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +20 -58
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +89 -37
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +66 -80
- 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 +10 -89
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +150 -130
- 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 +8 -6
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +107 -65
- package/test-env/components/combo_box/combo_box_input/combo_box_pill.js +8 -18
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +6 -6
- package/test-env/components/combo_box/utils.js +31 -0
- 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 +16 -6
- package/test-env/components/datagrid/body/data_grid_body_custom.js +16 -6
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +16 -6
- package/test-env/components/datagrid/body/data_grid_cell.js +67 -44
- 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 +72 -43
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +16 -6
- package/test-env/components/datagrid/controls/column_selector.js +24 -45
- package/test-env/components/datagrid/controls/column_sorting.js +22 -36
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +158 -0
- package/test-env/components/datagrid/controls/display_selector.js +21 -17
- 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/data_grid.js +2 -863
- package/test-env/components/datagrid/index.js +8 -1
- package/test-env/components/datagrid/utils/in_memory.js +16 -6
- 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/super_date_picker/date_popover/absolute_tab.js +86 -26
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +1 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +1 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +19 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.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/filter_group/filter_group.styles.js +1 -1
- package/test-env/components/focus_trap/focus_trap.a11y.js +3 -3
- 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 +7 -5
- package/test-env/components/header/header_section/header_section_item_button.js +7 -5
- package/test-env/components/i18n/i18n.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/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 +6 -1
- package/test-env/components/list_group/list_group_item.js +14 -4
- package/test-env/components/list_group/list_group_item.styles.js +2 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +12 -2
- package/test-env/components/notification/notification_event.a11y.js +1 -2
- package/test-env/components/notification/notification_event.js +7 -5
- package/test-env/components/popover/input_popover.js +1 -1
- package/test-env/components/popover/popover.js +33 -36
- package/test-env/components/popover/popover_arrow/_popover_arrow.styles.js +1 -3
- package/test-env/components/popover/popover_panel/_popover_panel.js +2 -1
- package/test-env/components/popover/popover_panel/_popover_panel.styles.js +6 -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 +227 -78
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +28 -11
- 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/toast/global_toast_list.js +11 -1
- package/test-env/global_styling/mixins/_states.js +4 -1
- package/test-env/services/color/eui_palettes.js +1 -8
- package/test-env/services/color/index.js +0 -7
- package/test-env/services/hooks/useCombinedRefs.js +19 -10
- package/test-env/services/index.js +0 -15
- package/test-env/test/rtl/component_helpers.js +41 -3
- package/es/services/random.js +0 -94
- package/es/services/utils.js +0 -25
- package/es/test/patch_random.js +0 -18
- package/lib/services/random.js +0 -100
- package/lib/services/utils.js +0 -35
- package/lib/test/patch_random.js +0 -25
- package/optimize/es/services/random.js +0 -85
- package/optimize/es/services/utils.js +0 -25
- package/optimize/es/test/patch_random.js +0 -18
- package/optimize/lib/services/random.js +0 -91
- package/optimize/lib/services/utils.js +0 -35
- package/optimize/lib/test/patch_random.js +0 -25
- package/src/components/combo_box/combo_box_input/_combo_box_input.scss +0 -12
- package/src/components/combo_box/combo_box_input/_combo_box_placeholder.scss +0 -11
- package/test-env/services/random.js +0 -91
- package/test-env/services/utils.js +0 -35
- package/test-env/test/patch_random.js +0 -25
|
@@ -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,106 @@ 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
|
+
_this.setState({
|
|
262
|
+
defaultOptionWidth: containerWidth - paddingOffset - checkedIconOffset
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
// Potentially force list rows to rerender on dynamic resize as well,
|
|
266
|
+
// but try to do it as lightly as possible
|
|
267
|
+
if (truncationProps || searchable && searchValue) {
|
|
268
|
+
_this.forceVirtualizedListRowRerender();
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
_defineProperty(_assertThisInitialized(_this), "getTruncationProps", function (option, isFocused) {
|
|
272
|
+
// Individual truncation settings should override component-wide settings
|
|
273
|
+
var truncationProps = _objectSpread(_objectSpread({}, _this.props.truncationProps), option.truncationProps);
|
|
274
|
+
|
|
275
|
+
// If we're not actually using EuiTextTruncate, no need to continue
|
|
276
|
+
var hasComplexTruncation = _this.props.searchValue || Object.keys(truncationProps).length > 0;
|
|
277
|
+
if (!hasComplexTruncation) return undefined;
|
|
278
|
+
|
|
279
|
+
// Determine whether we can use the optimized default option width
|
|
280
|
+
var defaultOptionWidth = _this.state.defaultOptionWidth;
|
|
281
|
+
var useDefaultWidth = !option.append && !option.prepend;
|
|
282
|
+
var defaultWidth = useDefaultWidth && defaultOptionWidth ? isFocused ? defaultOptionWidth - _this.focusBadgeOffset : defaultOptionWidth : undefined;
|
|
283
|
+
return _objectSpread({
|
|
284
|
+
width: defaultWidth
|
|
285
|
+
}, truncationProps);
|
|
286
|
+
});
|
|
287
|
+
_defineProperty(_assertThisInitialized(_this), "renderSearchedText", function (text, truncationProps) {
|
|
288
|
+
var searchValue = _this.props.searchValue;
|
|
289
|
+
|
|
290
|
+
// If truncationProps is undefined, we're using non-virtualized text wrapping
|
|
291
|
+
if (!truncationProps) {
|
|
292
|
+
return ___EmotionJSX(EuiHighlight, {
|
|
293
|
+
search: searchValue
|
|
294
|
+
}, text);
|
|
295
|
+
}
|
|
296
|
+
var searchPositionStart = text.toLowerCase().indexOf(searchValue.toLowerCase());
|
|
297
|
+
var searchPositionCenter = searchPositionStart + Math.floor(searchValue.length / 2);
|
|
298
|
+
return ___EmotionJSX(EuiTextTruncate, _extends({}, truncationProps, {
|
|
299
|
+
// When searching, don't allow overriding the truncation settings
|
|
300
|
+
truncation: "startEnd",
|
|
301
|
+
truncationPosition: searchPositionCenter,
|
|
302
|
+
text: text
|
|
303
|
+
}), function (text) {
|
|
304
|
+
return ___EmotionJSX(React.Fragment, null, text.length >= searchValue.length ? ___EmotionJSX(EuiHighlight, {
|
|
305
|
+
search: searchValue
|
|
306
|
+
}, text) :
|
|
307
|
+
// If the available truncated text is shorter than the full search string,
|
|
308
|
+
// just highlight the entire truncated text
|
|
309
|
+
___EmotionJSX(EuiMark, null, text));
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
_defineProperty(_assertThisInitialized(_this), "renderTruncatedText", function (text, truncationProps) {
|
|
313
|
+
return (
|
|
314
|
+
// For some bizarre reason, truncation in EuiSelectable is off on initial mount
|
|
315
|
+
// (but not on rerender) for Safari and _some_ truncation types in Firefox :|
|
|
316
|
+
// Waiting a tick before calculating truncation seems to smooth over the issue
|
|
317
|
+
___EmotionJSX(EuiTextTruncate, _extends({
|
|
318
|
+
calculationDelayMs: 2
|
|
319
|
+
}, truncationProps, {
|
|
320
|
+
text: text
|
|
321
|
+
}), function (text) {
|
|
322
|
+
return text;
|
|
323
|
+
})
|
|
324
|
+
);
|
|
325
|
+
});
|
|
217
326
|
_defineProperty(_assertThisInitialized(_this), "onAddOrRemoveOption", function (option, event) {
|
|
218
327
|
if (option.disabled) {
|
|
219
328
|
return;
|
|
220
329
|
}
|
|
221
|
-
var _this$
|
|
222
|
-
allowExclusions = _this$
|
|
223
|
-
options = _this$
|
|
224
|
-
_this$
|
|
225
|
-
visibleOptions = _this$
|
|
226
|
-
_this.props.setActiveOptionIndex(visibleOptions.findIndex(function (
|
|
227
|
-
var label =
|
|
330
|
+
var _this$props5 = _this.props,
|
|
331
|
+
allowExclusions = _this$props5.allowExclusions,
|
|
332
|
+
options = _this$props5.options,
|
|
333
|
+
_this$props5$visibleO = _this$props5.visibleOptions,
|
|
334
|
+
visibleOptions = _this$props5$visibleO === void 0 ? options : _this$props5$visibleO;
|
|
335
|
+
_this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref5) {
|
|
336
|
+
var label = _ref5.label;
|
|
228
337
|
return label === option.label;
|
|
229
338
|
}), function () {
|
|
230
339
|
if (option.checked === 'on' && allowExclusions) {
|
|
@@ -237,10 +346,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
237
346
|
});
|
|
238
347
|
});
|
|
239
348
|
_defineProperty(_assertThisInitialized(_this), "onAddOption", function (addedOption, event) {
|
|
240
|
-
var _this$
|
|
241
|
-
onOptionClick = _this$
|
|
242
|
-
options = _this$
|
|
243
|
-
singleSelection = _this$
|
|
349
|
+
var _this$props6 = _this.props,
|
|
350
|
+
onOptionClick = _this$props6.onOptionClick,
|
|
351
|
+
options = _this$props6.options,
|
|
352
|
+
singleSelection = _this$props6.singleSelection;
|
|
244
353
|
var changedOption = _objectSpread({}, addedOption);
|
|
245
354
|
var updatedOptions = options.map(function (option) {
|
|
246
355
|
// if singleSelection is enabled, uncheck any selected option(s)
|
|
@@ -259,10 +368,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
259
368
|
onOptionClick(updatedOptions, event, changedOption);
|
|
260
369
|
});
|
|
261
370
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
|
|
262
|
-
var _this$
|
|
263
|
-
onOptionClick = _this$
|
|
264
|
-
singleSelection = _this$
|
|
265
|
-
options = _this$
|
|
371
|
+
var _this$props7 = _this.props,
|
|
372
|
+
onOptionClick = _this$props7.onOptionClick,
|
|
373
|
+
singleSelection = _this$props7.singleSelection,
|
|
374
|
+
options = _this$props7.options;
|
|
266
375
|
var changedOption = _objectSpread({}, removedOption);
|
|
267
376
|
var updatedOptions = options.map(function (option) {
|
|
268
377
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -275,9 +384,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
275
384
|
onOptionClick(updatedOptions, event, changedOption);
|
|
276
385
|
});
|
|
277
386
|
_defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
|
|
278
|
-
var _this$
|
|
279
|
-
onOptionClick = _this$
|
|
280
|
-
options = _this$
|
|
387
|
+
var _this$props8 = _this.props,
|
|
388
|
+
onOptionClick = _this$props8.onOptionClick,
|
|
389
|
+
options = _this$props8.options;
|
|
281
390
|
var changedOption = _objectSpread({}, excludedOption);
|
|
282
391
|
var updatedOptions = options.map(function (option) {
|
|
283
392
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -289,69 +398,83 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
289
398
|
});
|
|
290
399
|
onOptionClick(updatedOptions, event, changedOption);
|
|
291
400
|
});
|
|
401
|
+
var _optionArray = props.visibleOptions || props.options;
|
|
402
|
+
_this.state = _objectSpread({
|
|
403
|
+
defaultOptionWidth: 0,
|
|
404
|
+
optionArray: _optionArray,
|
|
405
|
+
itemData: _objectSpread({}, _optionArray)
|
|
406
|
+
}, _this.calculateAriaSetAttrs(_optionArray));
|
|
292
407
|
return _this;
|
|
293
408
|
}
|
|
294
409
|
_createClass(EuiSelectableList, [{
|
|
295
410
|
key: "componentDidUpdate",
|
|
296
|
-
value: function componentDidUpdate() {
|
|
297
|
-
var
|
|
411
|
+
value: function componentDidUpdate(prevProps) {
|
|
412
|
+
var _this$props9 = this.props,
|
|
413
|
+
activeOptionIndex = _this$props9.activeOptionIndex,
|
|
414
|
+
visibleOptions = _this$props9.visibleOptions,
|
|
415
|
+
options = _this$props9.options;
|
|
298
416
|
if (this.listBoxRef && this.props.searchable !== true) {
|
|
299
417
|
this.listBoxRef.setAttribute('aria-activedescendant', "".concat(this.props.makeOptionId(activeOptionIndex)));
|
|
300
418
|
}
|
|
301
|
-
if (this.listRef && typeof
|
|
302
|
-
this.listRef.scrollToItem(
|
|
419
|
+
if (this.listRef && typeof activeOptionIndex !== 'undefined') {
|
|
420
|
+
this.listRef.scrollToItem(activeOptionIndex, 'auto');
|
|
421
|
+
}
|
|
422
|
+
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
423
|
+
var optionArray = visibleOptions || options;
|
|
424
|
+
this.setState(_objectSpread({
|
|
425
|
+
optionArray: optionArray,
|
|
426
|
+
itemData: _objectSpread({}, optionArray)
|
|
427
|
+
}, this.calculateAriaSetAttrs(optionArray)));
|
|
303
428
|
}
|
|
304
429
|
}
|
|
305
430
|
}, {
|
|
306
431
|
key: "render",
|
|
307
432
|
value: function render() {
|
|
308
433
|
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';
|
|
434
|
+
var _this$props10 = this.props,
|
|
435
|
+
className = _this$props10.className,
|
|
436
|
+
options = _this$props10.options,
|
|
437
|
+
searchValue = _this$props10.searchValue,
|
|
438
|
+
onOptionClick = _this$props10.onOptionClick,
|
|
439
|
+
renderOption = _this$props10.renderOption,
|
|
440
|
+
forcedHeight = _this$props10.height,
|
|
441
|
+
windowProps = _this$props10.windowProps,
|
|
442
|
+
rowHeight = _this$props10.rowHeight,
|
|
443
|
+
activeOptionIndex = _this$props10.activeOptionIndex,
|
|
444
|
+
makeOptionId = _this$props10.makeOptionId,
|
|
445
|
+
showIcons = _this$props10.showIcons,
|
|
446
|
+
singleSelection = _this$props10.singleSelection,
|
|
447
|
+
visibleOptions = _this$props10.visibleOptions,
|
|
448
|
+
allowExclusions = _this$props10.allowExclusions,
|
|
449
|
+
bordered = _this$props10.bordered,
|
|
450
|
+
paddingSize = _this$props10.paddingSize,
|
|
451
|
+
searchable = _this$props10.searchable,
|
|
452
|
+
onFocusBadge = _this$props10.onFocusBadge,
|
|
453
|
+
listId = _this$props10.listId,
|
|
454
|
+
setActiveOptionIndex = _this$props10.setActiveOptionIndex,
|
|
455
|
+
ariaLabel = _this$props10['aria-label'],
|
|
456
|
+
ariaLabelledby = _this$props10['aria-labelledby'],
|
|
457
|
+
ariaDescribedby = _this$props10['aria-describedby'],
|
|
458
|
+
role = _this$props10.role,
|
|
459
|
+
isVirtualized = _this$props10.isVirtualized,
|
|
460
|
+
textWrap = _this$props10.textWrap,
|
|
461
|
+
truncationProps = _this$props10.truncationProps,
|
|
462
|
+
rest = _objectWithoutProperties(_this$props10, _excluded3);
|
|
340
463
|
var classes = classNames('euiSelectableList', {
|
|
341
|
-
'euiSelectableList-fullHeight':
|
|
464
|
+
'euiSelectableList-fullHeight': forcedHeight === 'full',
|
|
342
465
|
'euiSelectableList-bordered': bordered
|
|
343
466
|
}, className);
|
|
344
467
|
return ___EmotionJSX("div", _extends({
|
|
345
468
|
className: classes
|
|
346
|
-
}, rest), isVirtualized ? this.renderVirtualizedList(
|
|
469
|
+
}, rest), isVirtualized ? this.renderVirtualizedList() : ___EmotionJSX("div", {
|
|
347
470
|
className: "euiSelectableList__list",
|
|
348
471
|
ref: this.removeScrollableTabStop
|
|
349
472
|
}, ___EmotionJSX("ul", {
|
|
350
473
|
ref: this.setListBoxRef
|
|
351
|
-
}, optionArray.map(function (_, index) {
|
|
474
|
+
}, this.state.optionArray.map(function (_, index) {
|
|
352
475
|
return /*#__PURE__*/React.createElement(_this2.ListRow, {
|
|
353
476
|
key: index,
|
|
354
|
-
data: optionArray,
|
|
477
|
+
data: _this2.state.optionArray,
|
|
355
478
|
index: index
|
|
356
479
|
}, null);
|
|
357
480
|
}))));
|
package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js
CHANGED
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { useState, useMemo } from 'react';
|
|
17
|
+
import React, { useState, useMemo, useCallback } from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { useCombinedRefs, useCurrentEuiBreakpoint } from '../../../services';
|
|
20
20
|
import { EuiSelectable } from '../selectable';
|
|
@@ -67,9 +67,11 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
67
67
|
setPopoverIsOpen(false);
|
|
68
68
|
_closePopover && _closePopover();
|
|
69
69
|
};
|
|
70
|
-
var togglePopover = function
|
|
71
|
-
setPopoverIsOpen(
|
|
72
|
-
|
|
70
|
+
var togglePopover = useCallback(function () {
|
|
71
|
+
setPopoverIsOpen(function (isOpen) {
|
|
72
|
+
return !isOpen;
|
|
73
|
+
});
|
|
74
|
+
}, []);
|
|
73
75
|
|
|
74
76
|
// Width applied to the internal div
|
|
75
77
|
var popoverWidth = width || 600;
|
|
@@ -144,16 +146,16 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
144
146
|
if (!currentBreakpoint) return false;
|
|
145
147
|
return popoverButtonBreakpoints.includes(currentBreakpoint);
|
|
146
148
|
}, [currentBreakpoint, popoverButtonBreakpoints]);
|
|
147
|
-
var popoverTrigger
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
var popoverTrigger = useMemo(function () {
|
|
150
|
+
if (!popoverButton || !canShowPopoverButton) return;
|
|
151
|
+
return ___EmotionJSX("span", {
|
|
152
|
+
className: "euiSelectableTemplateSitewide__popoverTrigger",
|
|
150
153
|
onClick: togglePopover,
|
|
151
154
|
onKeyDown: function onKeyDown(e) {
|
|
152
|
-
|
|
153
|
-
e.stopPropagation();
|
|
155
|
+
return e.stopPropagation();
|
|
154
156
|
}
|
|
155
|
-
})
|
|
156
|
-
}
|
|
157
|
+
}, popoverButton);
|
|
158
|
+
}, [popoverButton, canShowPopoverButton, togglePopover]);
|
|
157
159
|
return ___EmotionJSX(EuiSelectable, _extends({
|
|
158
160
|
isLoading: isLoading,
|
|
159
161
|
options: formattedOptions,
|
|
@@ -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
|
};
|
|
@@ -263,7 +263,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
263
263
|
var classes = classNames('euiGlobalToastList', className);
|
|
264
264
|
return ___EmotionJSX("div", _extends({
|
|
265
265
|
"aria-live": "polite",
|
|
266
|
-
role: "
|
|
266
|
+
role: "log",
|
|
267
267
|
ref: listElement,
|
|
268
268
|
css: cssStyles,
|
|
269
269
|
className: classes
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useEuiTheme } from '../../services';
|
|
10
|
+
import { mathWithUnits } from '../functions';
|
|
10
11
|
/**
|
|
11
12
|
* It is best practice to utilize the browser's default `outline` property for handling focus rings.
|
|
12
13
|
* However, some components need to be forced to have the same behavior, or adjust the display.
|
|
@@ -29,7 +30,9 @@ export var euiOutline = function euiOutline(_ref) {
|
|
|
29
30
|
} else if (offset === 'outset') {
|
|
30
31
|
outlineOffset = "".concat(outlineWidth);
|
|
31
32
|
} else if (offset === 'center') {
|
|
32
|
-
outlineOffset =
|
|
33
|
+
outlineOffset = mathWithUnits(outlineWidth, function (x) {
|
|
34
|
+
return x / -2;
|
|
35
|
+
});
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
// This is a separate function from `euiFocusRing` because some EUI components
|