@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
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
function
|
|
2
|
-
function
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
function
|
|
6
|
-
function
|
|
7
|
-
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); }; }
|
|
8
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
9
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
7
|
/*
|
|
16
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
17
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -20,249 +12,128 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
20
12
|
* Side Public License, v 1.
|
|
21
13
|
*/
|
|
22
14
|
|
|
23
|
-
import React, {
|
|
24
|
-
import PropTypes from "prop-types";
|
|
15
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
25
16
|
import { isString } from '../../services/predicate';
|
|
26
17
|
import { EuiContextMenuItem, EuiContextMenuPanel } from '../context_menu';
|
|
27
18
|
import { EuiPopover } from '../popover';
|
|
28
19
|
import { EuiButtonIcon } from '../button';
|
|
29
20
|
import { EuiToolTip } from '../tool_tip';
|
|
30
21
|
import { EuiI18n } from '../i18n';
|
|
22
|
+
import { isCustomItemAction, callWithItemIfFunction } from './action_types';
|
|
31
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
32
|
-
function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
_defineProperty(_assertThisInitialized(_this), "registerPopoverDiv", function (popoverDiv) {
|
|
73
|
-
if (!_this.popoverDiv) {
|
|
74
|
-
_this.popoverDiv = popoverDiv;
|
|
75
|
-
_this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
_defineProperty(_assertThisInitialized(_this), "onClickItem", function (onClickAction) {
|
|
79
|
-
_this.closePopover();
|
|
80
|
-
if (onClickAction) {
|
|
81
|
-
onClickAction();
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
return _this;
|
|
85
|
-
}
|
|
86
|
-
_createClass(CollapsedItemActions, [{
|
|
87
|
-
key: "componentWillUnmount",
|
|
88
|
-
value: function componentWillUnmount() {
|
|
89
|
-
if (this.popoverDiv) {
|
|
90
|
-
this.popoverDiv.removeEventListener('focusout', this.onPopoverBlur);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}, {
|
|
94
|
-
key: "render",
|
|
95
|
-
value: function render() {
|
|
96
|
-
var _this2 = this;
|
|
97
|
-
var _this$props = this.props,
|
|
98
|
-
actions = _this$props.actions,
|
|
99
|
-
itemId = _this$props.itemId,
|
|
100
|
-
item = _this$props.item,
|
|
101
|
-
actionEnabled = _this$props.actionEnabled,
|
|
102
|
-
onFocus = _this$props.onFocus,
|
|
103
|
-
className = _this$props.className;
|
|
104
|
-
var isOpen = this.state.popoverOpen;
|
|
105
|
-
var allDisabled = true;
|
|
106
|
-
var controls = actions.reduce(function (controls, action, index) {
|
|
107
|
-
var key = "action_".concat(itemId, "_").concat(index);
|
|
108
|
-
var available = action.available ? action.available(item) : true;
|
|
109
|
-
if (!available) {
|
|
110
|
-
return controls;
|
|
111
|
-
}
|
|
112
|
-
var enabled = actionEnabled(action);
|
|
113
|
-
allDisabled = allDisabled && !enabled;
|
|
114
|
-
if (actionIsCustomItemAction(action)) {
|
|
115
|
-
var customAction = action;
|
|
116
|
-
var actionControl = customAction.render(item, enabled);
|
|
117
|
-
var actionControlOnClick = actionControl && actionControl.props && actionControl.props.onClick;
|
|
118
|
-
controls.push(___EmotionJSX(EuiContextMenuItem, {
|
|
119
|
-
key: key,
|
|
120
|
-
onClick: function onClick() {
|
|
121
|
-
return _this2.onClickItem(actionControlOnClick ? function () {
|
|
122
|
-
return actionControlOnClick(item);
|
|
123
|
-
} : undefined);
|
|
124
|
-
}
|
|
125
|
-
}, actionControl));
|
|
126
|
-
} else {
|
|
127
|
-
var _onClick = action.onClick,
|
|
128
|
-
name = action.name,
|
|
129
|
-
href = action.href,
|
|
130
|
-
target = action.target,
|
|
131
|
-
dataTestSubj = action['data-test-subj'];
|
|
132
|
-
var buttonIcon = action.icon;
|
|
133
|
-
var icon;
|
|
134
|
-
if (buttonIcon) {
|
|
135
|
-
icon = isString(buttonIcon) ? buttonIcon : buttonIcon(item);
|
|
24
|
+
export var CollapsedItemActions = function CollapsedItemActions(_ref) {
|
|
25
|
+
var actions = _ref.actions,
|
|
26
|
+
itemId = _ref.itemId,
|
|
27
|
+
item = _ref.item,
|
|
28
|
+
actionEnabled = _ref.actionEnabled,
|
|
29
|
+
className = _ref.className;
|
|
30
|
+
var _useState = useState(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
popoverOpen = _useState2[0],
|
|
33
|
+
setPopoverOpen = _useState2[1];
|
|
34
|
+
var _useState3 = useState(true),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
allDisabled = _useState4[0],
|
|
37
|
+
setAllDisabled = _useState4[1];
|
|
38
|
+
var onClickItem = useCallback(function (onClickAction) {
|
|
39
|
+
setPopoverOpen(false);
|
|
40
|
+
onClickAction === null || onClickAction === void 0 ? void 0 : onClickAction();
|
|
41
|
+
}, []);
|
|
42
|
+
var controls = useMemo(function () {
|
|
43
|
+
return actions.reduce(function (controls, action, index) {
|
|
44
|
+
var _action$available, _action$available2;
|
|
45
|
+
var available = (_action$available = (_action$available2 = action.available) === null || _action$available2 === void 0 ? void 0 : _action$available2.call(action, item)) !== null && _action$available !== void 0 ? _action$available : true;
|
|
46
|
+
if (!available) return controls;
|
|
47
|
+
var enabled = actionEnabled(action);
|
|
48
|
+
if (enabled) setAllDisabled(false);
|
|
49
|
+
if (isCustomItemAction(action)) {
|
|
50
|
+
var customAction = action;
|
|
51
|
+
var actionControl = customAction.render(item, enabled);
|
|
52
|
+
controls.push(
|
|
53
|
+
// Do not put the `onClick` on the EuiContextMenuItem itself - otherwise
|
|
54
|
+
// it renders a <button> tag instead of a <div>, and we end up with nested
|
|
55
|
+
// interactive elements
|
|
56
|
+
___EmotionJSX(EuiContextMenuItem, {
|
|
57
|
+
key: index,
|
|
58
|
+
className: "euiBasicTable__collapsedCustomAction"
|
|
59
|
+
}, ___EmotionJSX("span", {
|
|
60
|
+
onClick: function onClick() {
|
|
61
|
+
return onClickItem();
|
|
136
62
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
icon: icon,
|
|
144
|
-
"data-test-subj": dataTestSubj,
|
|
145
|
-
onClick: function onClick() {
|
|
146
|
-
return _this2.onClickItem(_onClick ? function () {
|
|
147
|
-
return _onClick(item);
|
|
148
|
-
} : undefined);
|
|
149
|
-
}
|
|
150
|
-
}, buttonContent));
|
|
63
|
+
}, actionControl)));
|
|
64
|
+
} else {
|
|
65
|
+
var buttonIcon = action.icon;
|
|
66
|
+
var icon;
|
|
67
|
+
if (buttonIcon) {
|
|
68
|
+
icon = isString(buttonIcon) ? buttonIcon : buttonIcon(item);
|
|
151
69
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
70
|
+
var buttonContent = callWithItemIfFunction(item)(action.name);
|
|
71
|
+
var toolTipContent = callWithItemIfFunction(item)(action.description);
|
|
72
|
+
var href = callWithItemIfFunction(item)(action.href);
|
|
73
|
+
var dataTestSubj = callWithItemIfFunction(item)(action['data-test-subj']);
|
|
74
|
+
var _onClick = action.onClick,
|
|
75
|
+
target = action.target;
|
|
76
|
+
controls.push(___EmotionJSX(EuiContextMenuItem, {
|
|
77
|
+
key: index,
|
|
78
|
+
className: "euiBasicTable__collapsedAction",
|
|
79
|
+
disabled: !enabled,
|
|
80
|
+
href: href,
|
|
81
|
+
target: target,
|
|
82
|
+
icon: icon,
|
|
83
|
+
"data-test-subj": dataTestSubj,
|
|
84
|
+
onClick: function onClick() {
|
|
85
|
+
return onClickItem(_onClick ? function () {
|
|
86
|
+
return _onClick(item);
|
|
87
|
+
} : undefined);
|
|
88
|
+
},
|
|
89
|
+
toolTipContent: toolTipContent,
|
|
90
|
+
toolTipProps: {
|
|
91
|
+
delay: 'long'
|
|
92
|
+
}
|
|
93
|
+
}, buttonContent));
|
|
94
|
+
}
|
|
95
|
+
return controls;
|
|
96
|
+
}, []);
|
|
97
|
+
}, [actions, actionEnabled, item, onClickItem]);
|
|
98
|
+
var popoverButton = ___EmotionJSX(EuiI18n, {
|
|
99
|
+
token: "euiCollapsedItemActions.allActions",
|
|
100
|
+
default: "All actions"
|
|
101
|
+
}, function (allActions) {
|
|
102
|
+
return ___EmotionJSX(EuiButtonIcon, {
|
|
103
|
+
className: className,
|
|
104
|
+
"aria-label": allActions,
|
|
105
|
+
iconType: "boxesHorizontal",
|
|
106
|
+
color: "text",
|
|
107
|
+
isDisabled: allDisabled,
|
|
108
|
+
onClick: function onClick() {
|
|
109
|
+
return setPopoverOpen(function (isOpen) {
|
|
110
|
+
return !isOpen;
|
|
167
111
|
});
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
actions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
196
|
-
/**
|
|
197
|
-
* The type of action
|
|
198
|
-
*/
|
|
199
|
-
type: PropTypes.oneOfType([PropTypes.oneOf(["button"]), PropTypes.oneOf(["icon"]).isRequired]),
|
|
200
|
-
/**
|
|
201
|
-
* Defines the color of the button
|
|
202
|
-
*/
|
|
203
|
-
color: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.func.isRequired]),
|
|
204
|
-
/**
|
|
205
|
-
* The display name of the action (will be the button caption)
|
|
206
|
-
*/
|
|
207
|
-
/**
|
|
208
|
-
* The display name of the action (will be the button caption)
|
|
209
|
-
*/
|
|
210
|
-
name: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]).isRequired,
|
|
211
|
-
/**
|
|
212
|
-
* Describes the action (will be the button title)
|
|
213
|
-
*/
|
|
214
|
-
/**
|
|
215
|
-
* Describes the action (will be the button title)
|
|
216
|
-
*/
|
|
217
|
-
description: PropTypes.string.isRequired,
|
|
218
|
-
/**
|
|
219
|
-
* A handler function to execute the action
|
|
220
|
-
*/
|
|
221
|
-
/**
|
|
222
|
-
* A handler function to execute the action
|
|
223
|
-
*/
|
|
224
|
-
onClick: PropTypes.func,
|
|
225
|
-
href: PropTypes.string,
|
|
226
|
-
target: PropTypes.string,
|
|
227
|
-
/**
|
|
228
|
-
* A callback function that determines whether the action is available
|
|
229
|
-
*/
|
|
230
|
-
/**
|
|
231
|
-
* A callback function that determines whether the action is available
|
|
232
|
-
*/
|
|
233
|
-
available: PropTypes.func,
|
|
234
|
-
/**
|
|
235
|
-
* A callback function that determines whether the action is enabled
|
|
236
|
-
*/
|
|
237
|
-
/**
|
|
238
|
-
* A callback function that determines whether the action is enabled
|
|
239
|
-
*/
|
|
240
|
-
enabled: PropTypes.func,
|
|
241
|
-
isPrimary: PropTypes.bool,
|
|
242
|
-
"data-test-subj": PropTypes.string,
|
|
243
|
-
/**
|
|
244
|
-
* Associates an icon with the button
|
|
245
|
-
*/
|
|
246
|
-
icon: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "error", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.func.isRequired])
|
|
247
|
-
}).isRequired, PropTypes.shape({
|
|
248
|
-
/**
|
|
249
|
-
* The function that renders the action. Note that the returned node is expected to have `onFocus` and `onBlur` functions
|
|
250
|
-
*/
|
|
251
|
-
render: PropTypes.func.isRequired,
|
|
252
|
-
/**
|
|
253
|
-
* A callback that defines whether the action is available
|
|
254
|
-
*/
|
|
255
|
-
available: PropTypes.func,
|
|
256
|
-
/**
|
|
257
|
-
* A callback that defines whether the action is enabled
|
|
258
|
-
*/
|
|
259
|
-
enabled: PropTypes.func,
|
|
260
|
-
isPrimary: PropTypes.bool
|
|
261
|
-
}).isRequired]).isRequired).isRequired,
|
|
262
|
-
item: PropTypes.any.isRequired,
|
|
263
|
-
itemId: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired]).isRequired,
|
|
264
|
-
actionEnabled: PropTypes.func.isRequired,
|
|
265
|
-
className: PropTypes.string,
|
|
266
|
-
onFocus: PropTypes.func,
|
|
267
|
-
onBlur: PropTypes.func
|
|
112
|
+
},
|
|
113
|
+
"data-test-subj": "euiCollapsedItemActionsButton"
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
var withTooltip = !allDisabled && ___EmotionJSX(EuiI18n, {
|
|
117
|
+
token: "euiCollapsedItemActions.allActions",
|
|
118
|
+
default: "All actions"
|
|
119
|
+
}, function (allActions) {
|
|
120
|
+
return ___EmotionJSX(EuiToolTip, {
|
|
121
|
+
content: allActions,
|
|
122
|
+
delay: "long"
|
|
123
|
+
}, popoverButton);
|
|
124
|
+
});
|
|
125
|
+
return ___EmotionJSX(EuiPopover, {
|
|
126
|
+
className: className,
|
|
127
|
+
id: "".concat(itemId, "-actions"),
|
|
128
|
+
isOpen: popoverOpen,
|
|
129
|
+
button: withTooltip || popoverButton,
|
|
130
|
+
closePopover: function closePopover() {
|
|
131
|
+
return setPopoverOpen(false);
|
|
132
|
+
},
|
|
133
|
+
panelPaddingSize: "none",
|
|
134
|
+
anchorPosition: "leftCenter"
|
|
135
|
+
}, ___EmotionJSX(EuiContextMenuPanel, {
|
|
136
|
+
className: "euiBasicTable__collapsedActions",
|
|
137
|
+
items: controls
|
|
138
|
+
}));
|
|
268
139
|
};
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
6
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
7
|
-
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); }; }
|
|
8
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
9
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
10
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
12
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
1
|
/*
|
|
16
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
17
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -20,86 +6,14 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
20
6
|
* Side Public License, v 1.
|
|
21
7
|
*/
|
|
22
8
|
|
|
23
|
-
import React
|
|
24
|
-
import PropTypes from "prop-types";
|
|
9
|
+
import React from 'react';
|
|
25
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
|
-
export var CustomItemAction =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
|
|
35
|
-
if (_this.mounted) {
|
|
36
|
-
_this.setState({
|
|
37
|
-
hasFocus: true
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
|
|
42
|
-
if (_this.mounted) {
|
|
43
|
-
_this.setState({
|
|
44
|
-
hasFocus: false
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
_defineProperty(_assertThisInitialized(_this), "hasFocus", function () {
|
|
49
|
-
return _this.state.hasFocus;
|
|
50
|
-
});
|
|
51
|
-
_this.state = {
|
|
52
|
-
hasFocus: false
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// while generally considered an anti-pattern, here we require
|
|
56
|
-
// to do that as the onFocus/onBlur events of the action controls
|
|
57
|
-
// may trigger while this component is unmounted. An alternative
|
|
58
|
-
// (at least the workarounds suggested by react is to unregister
|
|
59
|
-
// the onFocus/onBlur listeners from the action controls... this
|
|
60
|
-
// unfortunately will lead to unnecessarily complex code... so we'll
|
|
61
|
-
// stick to this approach for now)
|
|
62
|
-
_this.mounted = false;
|
|
63
|
-
return _this;
|
|
64
|
-
}
|
|
65
|
-
_createClass(CustomItemAction, [{
|
|
66
|
-
key: "componentDidMount",
|
|
67
|
-
value: function componentDidMount() {
|
|
68
|
-
this.mounted = true;
|
|
69
|
-
}
|
|
70
|
-
}, {
|
|
71
|
-
key: "componentWillUnmount",
|
|
72
|
-
value: function componentWillUnmount() {
|
|
73
|
-
this.mounted = false;
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
key: "render",
|
|
77
|
-
value: function render() {
|
|
78
|
-
var _this$props = this.props,
|
|
79
|
-
action = _this$props.action,
|
|
80
|
-
enabled = _this$props.enabled,
|
|
81
|
-
item = _this$props.item,
|
|
82
|
-
className = _this$props.className;
|
|
83
|
-
var tool = action.render(item, enabled);
|
|
84
|
-
var clonedTool = /*#__PURE__*/cloneElement(tool, {
|
|
85
|
-
onFocus: this.onFocus,
|
|
86
|
-
onBlur: this.onBlur
|
|
87
|
-
});
|
|
88
|
-
var style = this.hasFocus() ? {
|
|
89
|
-
opacity: 1
|
|
90
|
-
} : undefined;
|
|
91
|
-
return ___EmotionJSX("div", {
|
|
92
|
-
style: style,
|
|
93
|
-
className: className
|
|
94
|
-
}, clonedTool);
|
|
95
|
-
}
|
|
96
|
-
}]);
|
|
97
|
-
return CustomItemAction;
|
|
98
|
-
}(Component);
|
|
99
|
-
CustomItemAction.propTypes = {
|
|
100
|
-
action: PropTypes.any.isRequired,
|
|
101
|
-
enabled: PropTypes.bool.isRequired,
|
|
102
|
-
item: PropTypes.any.isRequired,
|
|
103
|
-
className: PropTypes.string.isRequired,
|
|
104
|
-
index: PropTypes.number
|
|
11
|
+
export var CustomItemAction = function CustomItemAction(_ref) {
|
|
12
|
+
var action = _ref.action,
|
|
13
|
+
enabled = _ref.enabled,
|
|
14
|
+
item = _ref.item,
|
|
15
|
+
className = _ref.className;
|
|
16
|
+
return ___EmotionJSX("div", {
|
|
17
|
+
className: className
|
|
18
|
+
}, action.render(item, enabled));
|
|
105
19
|
};
|
|
@@ -12,10 +12,8 @@ import { EuiButtonEmpty, EuiButtonIcon } from '../button';
|
|
|
12
12
|
import { EuiToolTip } from '../tool_tip';
|
|
13
13
|
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
14
14
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
15
|
+
import { callWithItemIfFunction } from './action_types';
|
|
15
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
-
// In order to use generics with an arrow function inside a .tsx file, it's necessary to use
|
|
17
|
-
// this `extends` hack and declare the types as shown, instead of declaring the const as a
|
|
18
|
-
// FunctionComponent
|
|
19
17
|
export var DefaultItemAction = function DefaultItemAction(_ref) {
|
|
20
18
|
var action = _ref.action,
|
|
21
19
|
enabled = _ref.enabled,
|
|
@@ -38,25 +36,36 @@ export var DefaultItemAction = function DefaultItemAction(_ref) {
|
|
|
38
36
|
icon = isString(buttonIcon) ? buttonIcon : buttonIcon(item);
|
|
39
37
|
}
|
|
40
38
|
var button;
|
|
41
|
-
var actionContent =
|
|
39
|
+
var actionContent = callWithItemIfFunction(item)(action.name);
|
|
40
|
+
var tooltipContent = callWithItemIfFunction(item)(action.description);
|
|
41
|
+
var href = callWithItemIfFunction(item)(action.href);
|
|
42
|
+
var dataTestSubj = callWithItemIfFunction(item)(action['data-test-subj']);
|
|
42
43
|
var ariaLabelId = useGeneratedHtmlId();
|
|
44
|
+
var ariaLabelledBy;
|
|
43
45
|
if (action.type === 'icon') {
|
|
44
46
|
if (!icon) {
|
|
45
47
|
throw new Error("Cannot render item action [".concat(action.name, "]. It is configured to render as an icon but no\n icon is provided. Make sure to set the 'icon' property of the action"));
|
|
46
48
|
}
|
|
47
|
-
button = ___EmotionJSX(
|
|
49
|
+
button = ___EmotionJSX(EuiButtonIcon, {
|
|
48
50
|
className: className,
|
|
49
51
|
"aria-labelledby": ariaLabelId,
|
|
50
52
|
isDisabled: !enabled,
|
|
51
53
|
color: color,
|
|
52
54
|
iconType: icon,
|
|
53
55
|
onClick: onClick,
|
|
54
|
-
href:
|
|
56
|
+
href: href,
|
|
55
57
|
target: action.target,
|
|
56
|
-
"data-test-subj":
|
|
57
|
-
|
|
58
|
+
"data-test-subj": dataTestSubj
|
|
59
|
+
// If action is disabled, the normal tooltip can't show - attempt to
|
|
60
|
+
// provide some amount of affordance with a browser title tooltip
|
|
61
|
+
,
|
|
62
|
+
title: !enabled ? tooltipContent : undefined
|
|
63
|
+
});
|
|
64
|
+
// actionContent (action.name) is a ReactNode and must be rendered
|
|
65
|
+
// to an element and referenced by ID for screen readers
|
|
66
|
+
ariaLabelledBy = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", {
|
|
58
67
|
id: ariaLabelId
|
|
59
|
-
}, actionContent))
|
|
68
|
+
}, actionContent));
|
|
60
69
|
} else {
|
|
61
70
|
button = ___EmotionJSX(EuiButtonEmpty, {
|
|
62
71
|
className: className,
|
|
@@ -65,14 +74,14 @@ export var DefaultItemAction = function DefaultItemAction(_ref) {
|
|
|
65
74
|
color: color,
|
|
66
75
|
iconType: icon,
|
|
67
76
|
onClick: onClick,
|
|
68
|
-
href:
|
|
77
|
+
href: href,
|
|
69
78
|
target: action.target,
|
|
70
|
-
"data-test-subj":
|
|
79
|
+
"data-test-subj": dataTestSubj,
|
|
71
80
|
flush: "right"
|
|
72
81
|
}, actionContent);
|
|
73
82
|
}
|
|
74
|
-
return enabled
|
|
75
|
-
content:
|
|
83
|
+
return enabled ? ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiToolTip, {
|
|
84
|
+
content: tooltipContent,
|
|
76
85
|
delay: "long"
|
|
77
|
-
}, button) : button;
|
|
86
|
+
}, button), ariaLabelledBy) : ___EmotionJSX(React.Fragment, null, button, ariaLabelledBy);
|
|
78
87
|
};
|