@elastic/eui 89.1.0 → 90.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +2 -467
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +2 -467
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/skip_link/skip_link.js +1 -2
- package/es/components/accordion/accordion.js +27 -2
- package/es/components/accordion/accordion_children/accordion_children.js +7 -15
- package/es/components/basic_table/basic_table.js +60 -23
- package/es/components/basic_table/collapsed_item_actions.js +1 -1
- package/es/components/basic_table/in_memory_table.js +18 -4
- package/es/components/button/button.js +17 -45
- package/es/components/button/button_empty/button_empty.js +30 -47
- package/es/components/button/button_icon/button_icon.js +26 -43
- package/es/components/card/card.js +1 -6
- package/es/components/card/card_select/card_select.js +1 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +12 -8
- package/es/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.js +12 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +18 -4
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +11 -4
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +11 -4
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +11 -4
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +36 -4
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +158 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +65 -26
- package/es/components/collapsible_nav_beta/context.js +1 -0
- package/es/components/comment_list/comment_event.js +31 -19
- package/es/components/comment_list/comment_event.styles.js +26 -24
- package/es/components/context_menu/context_menu.js +28 -22
- package/es/components/context_menu/context_menu.styles.js +26 -0
- package/es/components/context_menu/context_menu_item.js +95 -125
- package/es/components/context_menu/context_menu_item.styles.js +82 -0
- package/es/components/context_menu/context_menu_panel.a11y.js +4 -2
- package/es/components/context_menu/context_menu_panel.js +32 -61
- package/es/components/context_menu/context_menu_panel.styles.js +40 -0
- package/es/components/control_bar/control_bar.js +28 -23
- package/es/components/datagrid/body/data_grid_body.js +6 -7
- package/es/components/datagrid/body/data_grid_body_custom.js +6 -7
- package/es/components/datagrid/body/data_grid_body_virtualized.js +6 -7
- package/es/components/datagrid/body/data_grid_cell.js +12 -13
- package/es/components/datagrid/body/data_grid_row_manager.js +28 -9
- package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -7
- package/es/components/datagrid/body/header/data_grid_header_row.js +6 -7
- package/es/components/datagrid/data_grid.js +6 -7
- package/es/components/datagrid/utils/in_memory.js +6 -7
- package/es/components/date_picker/auto_refresh/auto_refresh.js +1 -2
- package/es/components/form/field_number/field_number.js +13 -9
- package/es/components/form/field_password/field_password.js +4 -7
- package/es/components/form/range/dual_range.js +110 -85
- package/es/components/form/range/range.js +47 -40
- package/es/components/form/range/range_track.js +6 -20
- package/es/components/form/range/utils.js +1 -2
- package/es/components/header/header_links/header_link.js +1 -6
- package/es/components/header/header_section/header_section_item_button.js +1 -6
- package/es/components/list_group/list_group.js +1 -2
- package/es/components/list_group/list_group_item.js +7 -5
- package/es/components/list_group/list_group_item_extra_action.js +1 -2
- package/es/components/list_group/list_group_item_extra_action.styles.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -3
- package/es/components/modal/confirm_modal.js +1 -1
- package/es/components/notification/notification_event.js +1 -6
- package/es/components/notification/notification_event_read_button.js +1 -2
- package/es/components/page/index.js +1 -4
- package/es/components/pagination/pagination_button.js +1 -6
- package/es/components/popover/input_popover.js +26 -11
- package/es/components/tabs/tab.js +1 -1
- package/eui.d.ts +198 -287
- package/i18ntokens.json +103 -67
- package/lib/components/accessibility/skip_link/skip_link.js +1 -2
- package/lib/components/accordion/accordion.js +27 -2
- package/lib/components/accordion/accordion_children/accordion_children.js +5 -13
- package/lib/components/basic_table/basic_table.js +60 -23
- package/lib/components/basic_table/collapsed_item_actions.js +1 -1
- package/lib/components/basic_table/in_memory_table.js +18 -4
- package/lib/components/button/button.js +24 -51
- package/lib/components/button/button_empty/button_empty.js +29 -46
- package/lib/components/button/button_icon/button_icon.js +25 -42
- package/lib/components/card/card.js +1 -6
- package/lib/components/card/card_select/card_select.js +1 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +12 -8
- package/lib/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.js +12 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +18 -4
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +11 -4
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +11 -4
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +11 -4
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +36 -4
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +165 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +65 -26
- package/lib/components/collapsible_nav_beta/context.js +1 -0
- package/lib/components/comment_list/comment_event.js +33 -18
- package/lib/components/comment_list/comment_event.styles.js +28 -25
- package/lib/components/context_menu/context_menu.js +31 -24
- package/lib/components/context_menu/context_menu.styles.js +34 -0
- package/lib/components/context_menu/context_menu_item.js +102 -133
- package/lib/components/context_menu/context_menu_item.styles.js +87 -0
- package/lib/components/context_menu/context_menu_panel.a11y.js +4 -2
- package/lib/components/context_menu/context_menu_panel.js +35 -63
- package/lib/components/context_menu/context_menu_panel.styles.js +46 -0
- package/lib/components/control_bar/control_bar.js +28 -23
- package/lib/components/datagrid/body/data_grid_body.js +6 -7
- package/lib/components/datagrid/body/data_grid_body_custom.js +6 -7
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +6 -7
- package/lib/components/datagrid/body/data_grid_cell.js +12 -13
- package/lib/components/datagrid/body/data_grid_row_manager.js +33 -16
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -7
- package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -7
- package/lib/components/datagrid/data_grid.js +6 -7
- package/lib/components/datagrid/utils/in_memory.js +6 -7
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +1 -2
- package/lib/components/form/field_number/field_number.js +12 -8
- package/lib/components/form/field_password/field_password.js +4 -7
- package/lib/components/form/range/dual_range.js +110 -85
- package/lib/components/form/range/range.js +47 -40
- package/lib/components/form/range/range_track.js +5 -19
- package/lib/components/form/range/utils.js +1 -2
- package/lib/components/header/header_links/header_link.js +1 -6
- package/lib/components/header/header_section/header_section_item_button.js +1 -6
- package/lib/components/list_group/list_group.js +1 -2
- package/lib/components/list_group/list_group_item.js +7 -5
- package/lib/components/list_group/list_group_item_extra_action.js +1 -2
- package/lib/components/list_group/list_group_item_extra_action.styles.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -3
- package/lib/components/modal/confirm_modal.js +1 -1
- package/lib/components/notification/notification_event.js +1 -6
- package/lib/components/notification/notification_event_read_button.js +1 -2
- package/lib/components/page/index.js +1 -40
- package/lib/components/popover/input_popover.js +26 -11
- package/lib/components/tabs/tab.js +1 -1
- package/optimize/es/components/accordion/accordion.js +27 -2
- package/optimize/es/components/accordion/accordion_children/accordion_children.js +5 -14
- package/optimize/es/components/basic_table/basic_table.js +42 -19
- package/optimize/es/components/button/button.js +15 -33
- package/optimize/es/components/button/button_empty/button_empty.js +29 -41
- package/optimize/es/components/button/button_icon/button_icon.js +25 -37
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +12 -8
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.js +12 -7
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -1
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +60 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +21 -10
- package/optimize/es/components/collapsible_nav_beta/context.js +1 -0
- package/optimize/es/components/comment_list/comment_event.js +31 -19
- package/optimize/es/components/comment_list/comment_event.styles.js +26 -24
- package/optimize/es/components/context_menu/context_menu.js +25 -19
- package/optimize/es/components/context_menu/context_menu.styles.js +26 -0
- package/optimize/es/components/context_menu/context_menu_item.js +94 -119
- package/optimize/es/components/context_menu/context_menu_item.styles.js +82 -0
- package/optimize/es/components/context_menu/context_menu_panel.a11y.js +4 -2
- package/optimize/es/components/context_menu/context_menu_panel.js +29 -58
- package/optimize/es/components/context_menu/context_menu_panel.styles.js +40 -0
- package/optimize/es/components/control_bar/control_bar.js +28 -23
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +23 -9
- package/optimize/es/components/form/field_number/field_number.js +13 -9
- package/optimize/es/components/form/field_password/field_password.js +4 -7
- package/optimize/es/components/form/range/dual_range.js +110 -85
- package/optimize/es/components/form/range/range.js +47 -40
- package/optimize/es/components/form/range/range_track.js +5 -14
- package/optimize/es/components/form/range/utils.js +1 -2
- package/optimize/es/components/list_group/list_group_item.js +6 -3
- package/optimize/es/components/list_group/list_group_item_extra_action.styles.js +1 -1
- package/optimize/es/components/page/index.js +1 -4
- package/optimize/es/components/popover/input_popover.js +26 -11
- package/optimize/es/components/tabs/tab.js +1 -1
- package/optimize/lib/components/accordion/accordion.js +27 -2
- package/optimize/lib/components/accordion/accordion_children/accordion_children.js +3 -12
- package/optimize/lib/components/basic_table/basic_table.js +42 -19
- package/optimize/lib/components/button/button.js +16 -34
- package/optimize/lib/components/button/button_empty/button_empty.js +28 -40
- package/optimize/lib/components/button/button_icon/button_icon.js +24 -36
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +12 -8
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.js +12 -7
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +67 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +21 -10
- package/optimize/lib/components/collapsible_nav_beta/context.js +1 -0
- package/optimize/lib/components/comment_list/comment_event.js +33 -18
- package/optimize/lib/components/comment_list/comment_event.styles.js +28 -25
- package/optimize/lib/components/context_menu/context_menu.js +28 -21
- package/optimize/lib/components/context_menu/context_menu.styles.js +34 -0
- package/optimize/lib/components/context_menu/context_menu_item.js +101 -128
- package/optimize/lib/components/context_menu/context_menu_item.styles.js +87 -0
- package/optimize/lib/components/context_menu/context_menu_panel.a11y.js +4 -2
- package/optimize/lib/components/context_menu/context_menu_panel.js +32 -60
- package/optimize/lib/components/context_menu/context_menu_panel.styles.js +47 -0
- package/optimize/lib/components/control_bar/control_bar.js +28 -23
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +23 -8
- package/optimize/lib/components/form/field_number/field_number.js +12 -8
- package/optimize/lib/components/form/field_password/field_password.js +5 -8
- package/optimize/lib/components/form/range/dual_range.js +110 -85
- package/optimize/lib/components/form/range/range.js +47 -40
- package/optimize/lib/components/form/range/range_track.js +4 -13
- package/optimize/lib/components/form/range/utils.js +1 -2
- package/optimize/lib/components/list_group/list_group_item.js +6 -3
- package/optimize/lib/components/list_group/list_group_item_extra_action.styles.js +1 -1
- package/optimize/lib/components/page/index.js +1 -40
- package/optimize/lib/components/popover/input_popover.js +27 -12
- package/optimize/lib/components/tabs/tab.js +1 -1
- package/package.json +5 -5
- package/src/components/datagrid/_data_grid_data_row.scss +0 -1
- package/src/components/date_picker/super_date_picker/date_popover/_date_popover_content.scss +2 -1
- package/src/components/index.scss +0 -2
- package/test-env/components/accessibility/skip_link/skip_link.js +1 -2
- package/test-env/components/accordion/accordion.js +27 -2
- package/test-env/components/accordion/accordion_children/accordion_children.js +5 -13
- package/test-env/components/basic_table/basic_table.js +60 -23
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
- package/test-env/components/basic_table/in_memory_table.js +18 -4
- package/test-env/components/button/button.js +17 -40
- package/test-env/components/button/button_empty/button_empty.js +29 -46
- package/test-env/components/button/button_icon/button_icon.js +25 -42
- package/test-env/components/card/card.js +1 -6
- package/test-env/components/card/card_select/card_select.js +1 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +12 -8
- package/test-env/components/collapsible_nav_beta/collapsible_nav_button/collapsible_nav_button.js +12 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +18 -4
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +11 -4
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +11 -4
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +11 -4
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +36 -4
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_group.js +164 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +65 -26
- package/test-env/components/collapsible_nav_beta/context.js +1 -0
- package/test-env/components/comment_list/comment_event.js +33 -18
- package/test-env/components/comment_list/comment_event.styles.js +28 -25
- package/test-env/components/context_menu/context_menu.js +31 -24
- package/test-env/components/context_menu/context_menu.styles.js +34 -0
- package/test-env/components/context_menu/context_menu_item.js +102 -129
- package/test-env/components/context_menu/context_menu_item.styles.js +87 -0
- package/test-env/components/context_menu/context_menu_panel.a11y.js +4 -2
- package/test-env/components/context_menu/context_menu_panel.js +35 -63
- package/test-env/components/context_menu/context_menu_panel.styles.js +47 -0
- package/test-env/components/control_bar/control_bar.js +28 -23
- package/test-env/components/datagrid/body/data_grid_body.js +6 -7
- package/test-env/components/datagrid/body/data_grid_body_custom.js +6 -7
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +6 -7
- package/test-env/components/datagrid/body/data_grid_cell.js +12 -13
- package/test-env/components/datagrid/body/data_grid_row_manager.js +23 -8
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -7
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -7
- package/test-env/components/datagrid/data_grid.js +6 -7
- package/test-env/components/datagrid/utils/in_memory.js +6 -7
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +1 -2
- package/test-env/components/form/field_number/field_number.js +12 -8
- package/test-env/components/form/field_password/field_password.js +4 -7
- package/test-env/components/form/range/dual_range.js +110 -85
- package/test-env/components/form/range/range.js +47 -40
- package/test-env/components/form/range/range_track.js +5 -14
- package/test-env/components/form/range/utils.js +1 -2
- package/test-env/components/header/header_links/header_link.js +1 -6
- package/test-env/components/header/header_section/header_section_item_button.js +1 -6
- package/test-env/components/list_group/list_group.js +1 -2
- package/test-env/components/list_group/list_group_item.js +7 -5
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -2
- package/test-env/components/list_group/list_group_item_extra_action.styles.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -3
- package/test-env/components/modal/confirm_modal.js +1 -1
- package/test-env/components/notification/notification_event.js +1 -6
- package/test-env/components/notification/notification_event_read_button.js +1 -2
- package/test-env/components/page/index.js +1 -40
- package/test-env/components/popover/input_popover.js +26 -11
- package/test-env/components/tabs/tab.js +1 -1
- package/es/components/page/page_content/index.js +0 -12
- package/es/components/page/page_content/page_content.js +0 -110
- package/es/components/page/page_content/page_content_body.js +0 -69
- package/es/components/page/page_content/page_content_header.js +0 -43
- package/es/components/page/page_content/page_content_header_section.js +0 -34
- package/es/components/page/page_side_bar/index.js +0 -9
- package/es/components/page/page_side_bar/page_side_bar.js +0 -60
- package/es/components/page/page_template.js +0 -591
- package/lib/components/page/page_content/index.js +0 -33
- package/lib/components/page/page_content/page_content.js +0 -117
- package/lib/components/page/page_content/page_content_body.js +0 -77
- package/lib/components/page/page_content/page_content_header.js +0 -50
- package/lib/components/page/page_content/page_content_header_section.js +0 -41
- package/lib/components/page/page_side_bar/index.js +0 -12
- package/lib/components/page/page_side_bar/page_side_bar.js +0 -67
- package/lib/components/page/page_template.js +0 -598
- package/optimize/es/components/page/page_content/index.js +0 -12
- package/optimize/es/components/page/page_content/page_content.js +0 -45
- package/optimize/es/components/page/page_content/page_content_body.js +0 -45
- package/optimize/es/components/page/page_content/page_content_header.js +0 -30
- package/optimize/es/components/page/page_content/page_content_header_section.js +0 -26
- package/optimize/es/components/page/page_side_bar/index.js +0 -9
- package/optimize/es/components/page/page_side_bar/page_side_bar.js +0 -44
- package/optimize/es/components/page/page_template.js +0 -325
- package/optimize/lib/components/page/page_content/index.js +0 -33
- package/optimize/lib/components/page/page_content/page_content.js +0 -52
- package/optimize/lib/components/page/page_content/page_content_body.js +0 -53
- package/optimize/lib/components/page/page_content/page_content_header.js +0 -37
- package/optimize/lib/components/page/page_content/page_content_header_section.js +0 -33
- package/optimize/lib/components/page/page_side_bar/index.js +0 -12
- package/optimize/lib/components/page/page_side_bar/page_side_bar.js +0 -51
- package/optimize/lib/components/page/page_template.js +0 -332
- package/src/components/context_menu/_context_menu.scss +0 -27
- package/src/components/context_menu/_context_menu_item.scss +0 -65
- package/src/components/context_menu/_context_menu_panel.scss +0 -101
- package/src/components/context_menu/_index.scss +0 -3
- package/src/components/page/_index.scss +0 -2
- package/src/components/page/page_content/_index.scss +0 -4
- package/src/components/page/page_content/_page_content.scss +0 -25
- package/src/components/page/page_content/_page_content_body.scss +0 -19
- package/src/components/page/page_content/_page_content_header.scss +0 -20
- package/src/components/page/page_content/_page_content_header_section.scss +0 -17
- package/src/components/page/page_side_bar/_index.scss +0 -1
- package/src/components/page/page_side_bar/_page_side_bar.scss +0 -31
- package/test-env/components/page/page_content/index.js +0 -33
- package/test-env/components/page/page_content/page_content.js +0 -116
- package/test-env/components/page/page_content/page_content_body.js +0 -73
- package/test-env/components/page/page_content/page_content_header.js +0 -49
- package/test-env/components/page/page_content/page_content_header_section.js +0 -40
- package/test-env/components/page/page_side_bar/index.js +0 -12
- package/test-env/components/page/page_side_bar/page_side_bar.js +0 -66
- package/test-env/components/page/page_template.js +0 -594
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
var _excluded = ["children", "className", "hasPanel", "icon", "buttonRef", "disabled", "layoutAlign", "toolTipTitle", "toolTipContent", "toolTipPosition", "href", "target", "rel", "size"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
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); }
|
|
4
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
-
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); } }
|
|
8
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
9
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
-
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); }
|
|
11
|
-
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); }
|
|
12
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
13
|
-
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); }; }
|
|
14
|
-
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); }
|
|
15
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
|
-
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; } }
|
|
17
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
18
5
|
/*
|
|
19
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
20
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -23,130 +10,113 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
23
10
|
* Side Public License, v 1.
|
|
24
11
|
*/
|
|
25
12
|
|
|
26
|
-
import React
|
|
13
|
+
import React from 'react';
|
|
27
14
|
import PropTypes from "prop-types";
|
|
28
15
|
import classNames from 'classnames';
|
|
16
|
+
import { useEuiTheme, getSecureRelForTarget, cloneElementWithCss } from '../../services';
|
|
17
|
+
import { validateHref } from '../../services/security/href_validator';
|
|
29
18
|
import { keysOf } from '../common';
|
|
30
19
|
import { EuiIcon } from '../icon';
|
|
31
20
|
import { EuiToolTip } from '../tool_tip';
|
|
32
|
-
import {
|
|
33
|
-
import { validateHref } from '../../services/security/href_validator';
|
|
21
|
+
import { euiContextMenuItemStyles } from './context_menu_item.styles';
|
|
34
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
35
|
-
var
|
|
36
|
-
s: 'euiContextMenuItem--small',
|
|
37
|
-
m: null
|
|
38
|
-
};
|
|
39
|
-
export var SIZES = keysOf(sizeToClassNameMap);
|
|
23
|
+
export var SIZES = ['s', 'm'];
|
|
40
24
|
var layoutAlignToClassNames = {
|
|
41
25
|
center: null,
|
|
42
26
|
top: 'euiContextMenu__itemLayout--top',
|
|
43
27
|
bottom: 'euiContextMenu__itemLayout--bottom'
|
|
44
28
|
};
|
|
45
29
|
export var LAYOUT_ALIGN = keysOf(layoutAlignToClassNames);
|
|
46
|
-
export var EuiContextMenuItem =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
30
|
+
export var EuiContextMenuItem = function EuiContextMenuItem(_ref) {
|
|
31
|
+
var children = _ref.children,
|
|
32
|
+
className = _ref.className,
|
|
33
|
+
hasPanel = _ref.hasPanel,
|
|
34
|
+
icon = _ref.icon,
|
|
35
|
+
buttonRef = _ref.buttonRef,
|
|
36
|
+
_disabled = _ref.disabled,
|
|
37
|
+
_ref$layoutAlign = _ref.layoutAlign,
|
|
38
|
+
layoutAlign = _ref$layoutAlign === void 0 ? 'center' : _ref$layoutAlign,
|
|
39
|
+
toolTipTitle = _ref.toolTipTitle,
|
|
40
|
+
toolTipContent = _ref.toolTipContent,
|
|
41
|
+
_ref$toolTipPosition = _ref.toolTipPosition,
|
|
42
|
+
toolTipPosition = _ref$toolTipPosition === void 0 ? 'right' : _ref$toolTipPosition,
|
|
43
|
+
href = _ref.href,
|
|
44
|
+
target = _ref.target,
|
|
45
|
+
rel = _ref.rel,
|
|
46
|
+
_ref$size = _ref.size,
|
|
47
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
48
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
+
var isHrefValid = !href || validateHref(href);
|
|
50
|
+
var disabled = _disabled || !isHrefValid;
|
|
51
|
+
var classes = classNames('euiContextMenuItem', className);
|
|
52
|
+
var euiTheme = useEuiTheme();
|
|
53
|
+
var styles = euiContextMenuItemStyles(euiTheme);
|
|
54
|
+
var cssStyles = [styles.euiContextMenuItem, styles.sizes[size], styles.layoutAlign[layoutAlign], disabled && styles.disabled];
|
|
55
|
+
var iconInstance = icon && (typeof icon === 'string' ? ___EmotionJSX(EuiIcon, {
|
|
56
|
+
type: icon,
|
|
57
|
+
size: "m",
|
|
58
|
+
className: "euiContextMenu__icon",
|
|
59
|
+
css: styles.euiContextMenu__icon,
|
|
60
|
+
color: "inherit" // forces the icon to inherit its parent color
|
|
61
|
+
}) :
|
|
62
|
+
// Assume it's already an instance of an icon.
|
|
63
|
+
cloneElementWithCss(icon, {
|
|
64
|
+
css: styles.euiContextMenu__icon
|
|
65
|
+
}));
|
|
66
|
+
var arrow = hasPanel && ___EmotionJSX(EuiIcon, {
|
|
67
|
+
type: "arrowRight",
|
|
68
|
+
size: "m",
|
|
69
|
+
className: "euiContextMenu__arrow",
|
|
70
|
+
css: styles.euiContextMenuItem__arrow
|
|
71
|
+
});
|
|
72
|
+
var textStyles = [styles.text.euiContextMenuItem__text, size === 's' && styles.text.s];
|
|
73
|
+
var buttonContent = ___EmotionJSX(React.Fragment, null, iconInstance, ___EmotionJSX("span", {
|
|
74
|
+
className: "euiContextMenuItem__text",
|
|
75
|
+
css: textStyles
|
|
76
|
+
}, children), arrow);
|
|
77
|
+
var button;
|
|
78
|
+
// <a> elements don't respect the `disabled` attribute. So if we're disabled, we'll just pretend
|
|
79
|
+
// this is a button and piggyback off its disabled styles.
|
|
80
|
+
if (href && !disabled) {
|
|
81
|
+
var secureRel = getSecureRelForTarget({
|
|
82
|
+
href: href,
|
|
83
|
+
target: target,
|
|
84
|
+
rel: rel
|
|
85
|
+
});
|
|
86
|
+
button = ___EmotionJSX("a", _extends({
|
|
87
|
+
css: cssStyles,
|
|
88
|
+
className: classes,
|
|
89
|
+
href: href,
|
|
90
|
+
target: target,
|
|
91
|
+
rel: secureRel,
|
|
92
|
+
ref: buttonRef
|
|
93
|
+
}, rest), buttonContent);
|
|
94
|
+
} else if (href || rest.onClick) {
|
|
95
|
+
button = ___EmotionJSX("button", _extends({
|
|
96
|
+
disabled: disabled,
|
|
97
|
+
css: cssStyles,
|
|
98
|
+
className: classes,
|
|
99
|
+
type: "button",
|
|
100
|
+
ref: buttonRef
|
|
101
|
+
}, rest), buttonContent);
|
|
102
|
+
} else {
|
|
103
|
+
button = ___EmotionJSX("div", _extends({
|
|
104
|
+
css: cssStyles,
|
|
105
|
+
className: classes,
|
|
106
|
+
ref: buttonRef
|
|
107
|
+
}, rest), buttonContent);
|
|
52
108
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
layoutAlign = _this$props$layoutAli === void 0 ? 'center' : _this$props$layoutAli,
|
|
65
|
-
toolTipTitle = _this$props.toolTipTitle,
|
|
66
|
-
toolTipContent = _this$props.toolTipContent,
|
|
67
|
-
_this$props$toolTipPo = _this$props.toolTipPosition,
|
|
68
|
-
toolTipPosition = _this$props$toolTipPo === void 0 ? 'right' : _this$props$toolTipPo,
|
|
69
|
-
href = _this$props.href,
|
|
70
|
-
target = _this$props.target,
|
|
71
|
-
rel = _this$props.rel,
|
|
72
|
-
size = _this$props.size,
|
|
73
|
-
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
74
|
-
var iconInstance;
|
|
75
|
-
var isHrefValid = !href || validateHref(href);
|
|
76
|
-
var disabled = _disabled || !isHrefValid;
|
|
77
|
-
if (icon) {
|
|
78
|
-
switch (_typeof(icon)) {
|
|
79
|
-
case 'string':
|
|
80
|
-
iconInstance = ___EmotionJSX(EuiIcon, {
|
|
81
|
-
type: icon,
|
|
82
|
-
size: "m",
|
|
83
|
-
className: "euiContextMenu__icon",
|
|
84
|
-
color: "inherit" // forces the icon to inherit its parent color
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
break;
|
|
88
|
-
default:
|
|
89
|
-
// Assume it's already an instance of an icon.
|
|
90
|
-
iconInstance = /*#__PURE__*/cloneElement(icon, {
|
|
91
|
-
className: 'euiContextMenu__icon'
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
var arrow;
|
|
96
|
-
if (hasPanel) {
|
|
97
|
-
arrow = ___EmotionJSX(EuiIcon, {
|
|
98
|
-
type: "arrowRight",
|
|
99
|
-
size: "m",
|
|
100
|
-
className: "euiContextMenu__arrow"
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
var classes = classNames('euiContextMenuItem', size && sizeToClassNameMap[size], className, {
|
|
104
|
-
'euiContextMenuItem-isDisabled': disabled
|
|
105
|
-
});
|
|
106
|
-
var layoutClasses = classNames('euiContextMenu__itemLayout', layoutAlignToClassNames[layoutAlign]);
|
|
107
|
-
var buttonInner = ___EmotionJSX("span", {
|
|
108
|
-
className: layoutClasses
|
|
109
|
-
}, iconInstance, ___EmotionJSX("span", {
|
|
110
|
-
className: "euiContextMenuItem__text"
|
|
111
|
-
}, children), arrow);
|
|
112
|
-
var button;
|
|
113
|
-
// <a> elements don't respect the `disabled` attribute. So if we're disabled, we'll just pretend
|
|
114
|
-
// this is a button and piggyback off its disabled styles.
|
|
115
|
-
if (href && !disabled) {
|
|
116
|
-
var secureRel = getSecureRelForTarget({
|
|
117
|
-
href: href,
|
|
118
|
-
target: target,
|
|
119
|
-
rel: rel
|
|
120
|
-
});
|
|
121
|
-
button = ___EmotionJSX("a", _extends({
|
|
122
|
-
className: classes,
|
|
123
|
-
href: href,
|
|
124
|
-
target: target,
|
|
125
|
-
rel: secureRel,
|
|
126
|
-
ref: buttonRef
|
|
127
|
-
}, rest), buttonInner);
|
|
128
|
-
} else {
|
|
129
|
-
button = ___EmotionJSX("button", _extends({
|
|
130
|
-
disabled: disabled,
|
|
131
|
-
className: classes,
|
|
132
|
-
type: "button",
|
|
133
|
-
ref: buttonRef
|
|
134
|
-
}, rest), buttonInner);
|
|
135
|
-
}
|
|
136
|
-
if (toolTipContent) {
|
|
137
|
-
return ___EmotionJSX(EuiToolTip, {
|
|
138
|
-
title: toolTipTitle ? toolTipTitle : null,
|
|
139
|
-
content: toolTipContent,
|
|
140
|
-
anchorClassName: "eui-displayBlock",
|
|
141
|
-
position: toolTipPosition
|
|
142
|
-
}, button);
|
|
143
|
-
} else {
|
|
144
|
-
return button;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}]);
|
|
148
|
-
return EuiContextMenuItem;
|
|
149
|
-
}(Component);
|
|
109
|
+
if (toolTipContent) {
|
|
110
|
+
return ___EmotionJSX(EuiToolTip, {
|
|
111
|
+
title: toolTipTitle ? toolTipTitle : null,
|
|
112
|
+
content: toolTipContent,
|
|
113
|
+
anchorClassName: "eui-displayBlock",
|
|
114
|
+
position: toolTipPosition
|
|
115
|
+
}, button);
|
|
116
|
+
} else {
|
|
117
|
+
return button;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
150
120
|
EuiContextMenuItem.propTypes = {
|
|
151
121
|
className: PropTypes.string,
|
|
152
122
|
"aria-label": PropTypes.string,
|
|
@@ -179,5 +149,5 @@ EuiContextMenuItem.propTypes = {
|
|
|
179
149
|
/**
|
|
180
150
|
* Reduce the size to `s` when in need of a more compressed menu
|
|
181
151
|
*/
|
|
182
|
-
size: PropTypes.
|
|
152
|
+
size: PropTypes.any
|
|
183
153
|
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { logicalCSS, logicalTextAlignCSS, euiFontSize } from '../../global_styling';
|
|
12
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
+
name: "4ak4s8-euiContextMenuItem__arrow",
|
|
14
|
+
styles: "align-self:flex-end;label:euiContextMenuItem__arrow;"
|
|
15
|
+
} : {
|
|
16
|
+
name: "4ak4s8-euiContextMenuItem__arrow",
|
|
17
|
+
styles: "align-self:flex-end;label:euiContextMenuItem__arrow;",
|
|
18
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
|
+
};
|
|
20
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "o1gg22-euiContextMenuItem__text",
|
|
22
|
+
styles: "flex-grow:1;overflow:hidden;label:euiContextMenuItem__text;"
|
|
23
|
+
} : {
|
|
24
|
+
name: "o1gg22-euiContextMenuItem__text",
|
|
25
|
+
styles: "flex-grow:1;overflow:hidden;label:euiContextMenuItem__text;",
|
|
26
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
|
+
};
|
|
28
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
29
|
+
name: "1lzohcs-euiContextMenu__icon",
|
|
30
|
+
styles: "flex-shrink:0;label:euiContextMenu__icon;"
|
|
31
|
+
} : {
|
|
32
|
+
name: "1lzohcs-euiContextMenu__icon",
|
|
33
|
+
styles: "flex-shrink:0;label:euiContextMenu__icon;",
|
|
34
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
|
+
};
|
|
36
|
+
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
37
|
+
name: "1msaet2-bottom",
|
|
38
|
+
styles: "align-items:flex-end;label:bottom;"
|
|
39
|
+
} : {
|
|
40
|
+
name: "1msaet2-bottom",
|
|
41
|
+
styles: "align-items:flex-end;label:bottom;",
|
|
42
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
43
|
+
};
|
|
44
|
+
var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
45
|
+
name: "1gnwbvd-top",
|
|
46
|
+
styles: "align-items:flex-start;label:top;"
|
|
47
|
+
} : {
|
|
48
|
+
name: "1gnwbvd-top",
|
|
49
|
+
styles: "align-items:flex-start;label:top;",
|
|
50
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
51
|
+
};
|
|
52
|
+
var _ref6 = process.env.NODE_ENV === "production" ? {
|
|
53
|
+
name: "8391db-center",
|
|
54
|
+
styles: "align-items:center;label:center;"
|
|
55
|
+
} : {
|
|
56
|
+
name: "8391db-center",
|
|
57
|
+
styles: "align-items:center;label:center;",
|
|
58
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
59
|
+
};
|
|
60
|
+
export var euiContextMenuItemStyles = function euiContextMenuItemStyles(euiThemeContext) {
|
|
61
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
62
|
+
return {
|
|
63
|
+
euiContextMenuItem: /*#__PURE__*/css("display:flex;gap:", euiTheme.size.s, ";", logicalCSS('width', '100%'), " ", logicalTextAlignCSS('left'), " color:", euiTheme.colors.text, ";outline-offset:-", euiTheme.focus.width, ";&:enabled:hover,&:enabled:focus{text-decoration:underline;}&:enabled:focus{background-color:", euiTheme.focus.backgroundColor, ";};label:euiContextMenuItem;"),
|
|
64
|
+
disabled: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";cursor:default;;label:disabled;"),
|
|
65
|
+
layoutAlign: {
|
|
66
|
+
center: _ref6,
|
|
67
|
+
top: _ref5,
|
|
68
|
+
bottom: _ref4
|
|
69
|
+
},
|
|
70
|
+
sizes: {
|
|
71
|
+
m: /*#__PURE__*/css("padding:", euiTheme.size.m, ";;label:m;"),
|
|
72
|
+
s: /*#__PURE__*/css("padding:", euiTheme.size.s, ";;label:s;")
|
|
73
|
+
},
|
|
74
|
+
// Children
|
|
75
|
+
euiContextMenu__icon: _ref3,
|
|
76
|
+
text: {
|
|
77
|
+
euiContextMenuItem__text: _ref2,
|
|
78
|
+
s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:s;")
|
|
79
|
+
},
|
|
80
|
+
euiContextMenuItem__arrow: _ref
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -16,10 +16,12 @@ import { EuiContextMenuPanel } from './context_menu_panel';
|
|
|
16
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
17
|
var items = [___EmotionJSX(EuiContextMenuItem, {
|
|
18
18
|
key: "A",
|
|
19
|
-
"data-test-subj": "itemA"
|
|
19
|
+
"data-test-subj": "itemA",
|
|
20
|
+
href: "#"
|
|
20
21
|
}, "Option A"), ___EmotionJSX(EuiContextMenuItem, {
|
|
21
22
|
key: "B",
|
|
22
|
-
"data-test-subj": "itemB"
|
|
23
|
+
"data-test-subj": "itemB",
|
|
24
|
+
onClick: function onClick() {}
|
|
23
25
|
}, "Option B"), ___EmotionJSX(EuiContextMenuItem, {
|
|
24
26
|
key: "C",
|
|
25
27
|
"data-test-subj": "itemC"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "onClose", "title", "onHeightChange", "transitionType", "transitionDirection", "onTransitionComplete", "onUseKeyboardToNavigate", "items", "initialFocusedItemIndex", "showNextPanel", "showPreviousPanel", "size"];
|
|
1
|
+
var _excluded = ["theme", "children", "className", "onClose", "title", "onHeightChange", "transitionType", "transitionDirection", "onTransitionComplete", "onUseKeyboardToNavigate", "items", "initialFocusedItemIndex", "showNextPanel", "showPreviousPanel", "size"];
|
|
2
2
|
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); }
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -28,33 +28,18 @@ import React, { cloneElement, Component } from 'react';
|
|
|
28
28
|
import PropTypes from "prop-types";
|
|
29
29
|
import classNames from 'classnames';
|
|
30
30
|
import { tabbable } from 'tabbable';
|
|
31
|
-
import {
|
|
32
|
-
import { EuiIcon } from '../icon';
|
|
31
|
+
import { withEuiTheme, keys } from '../../services';
|
|
33
32
|
import { EuiResizeObserver } from '../observer/resize_observer';
|
|
34
|
-
import { keys } from '../../services';
|
|
35
33
|
import { EuiContextMenuItem } from './context_menu_item';
|
|
34
|
+
import { euiContextMenuPanelStyles } from './context_menu_panel.styles';
|
|
36
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var transitionDirectionAndTypeToClassNameMap = {
|
|
43
|
-
next: {
|
|
44
|
-
in: 'euiContextMenuPanel-txInLeft',
|
|
45
|
-
out: 'euiContextMenuPanel-txOutLeft'
|
|
46
|
-
},
|
|
47
|
-
previous: {
|
|
48
|
-
in: 'euiContextMenuPanel-txInRight',
|
|
49
|
-
out: 'euiContextMenuPanel-txOutRight'
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
export var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
|
|
53
|
-
_inherits(EuiContextMenuPanel, _Component);
|
|
54
|
-
var _super = _createSuper(EuiContextMenuPanel);
|
|
55
|
-
function EuiContextMenuPanel(props) {
|
|
36
|
+
export var SIZES = ['s', 'm'];
|
|
37
|
+
export var EuiContextMenuPanelClass = /*#__PURE__*/function (_Component) {
|
|
38
|
+
_inherits(EuiContextMenuPanelClass, _Component);
|
|
39
|
+
var _super = _createSuper(EuiContextMenuPanelClass);
|
|
40
|
+
function EuiContextMenuPanelClass(props) {
|
|
56
41
|
var _this;
|
|
57
|
-
_classCallCheck(this,
|
|
42
|
+
_classCallCheck(this, EuiContextMenuPanelClass);
|
|
58
43
|
_this = _super.call(this, props);
|
|
59
44
|
_defineProperty(_assertThisInitialized(_this), "_isMounted", false);
|
|
60
45
|
_defineProperty(_assertThisInitialized(_this), "backButton", null);
|
|
@@ -189,7 +174,7 @@ export var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
|
|
|
189
174
|
};
|
|
190
175
|
return _this;
|
|
191
176
|
}
|
|
192
|
-
_createClass(
|
|
177
|
+
_createClass(EuiContextMenuPanelClass, [{
|
|
193
178
|
key: "takeInitialFocus",
|
|
194
179
|
value: function takeInitialFocus() {
|
|
195
180
|
var _this2 = this;
|
|
@@ -333,6 +318,7 @@ export var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
|
|
|
333
318
|
value: function render() {
|
|
334
319
|
var _this3 = this;
|
|
335
320
|
var _this$props2 = this.props,
|
|
321
|
+
theme = _this$props2.theme,
|
|
336
322
|
children = _this$props2.children,
|
|
337
323
|
className = _this$props2.className,
|
|
338
324
|
onClose = _this$props2.onClose,
|
|
@@ -348,36 +334,19 @@ export var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
|
|
|
348
334
|
showPreviousPanel = _this$props2.showPreviousPanel,
|
|
349
335
|
size = _this$props2.size,
|
|
350
336
|
rest = _objectWithoutProperties(_this$props2, _excluded);
|
|
351
|
-
var
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
className: "euiContextMenu__itemLayout"
|
|
365
|
-
}, ___EmotionJSX(EuiIcon, {
|
|
366
|
-
type: "arrowLeft",
|
|
367
|
-
size: "m",
|
|
368
|
-
className: "euiContextMenu__icon"
|
|
369
|
-
}), ___EmotionJSX("span", {
|
|
370
|
-
className: "euiContextMenu__text"
|
|
371
|
-
}, title)));
|
|
372
|
-
} else {
|
|
373
|
-
panelTitle = ___EmotionJSX("div", {
|
|
374
|
-
className: titleClasses
|
|
375
|
-
}, ___EmotionJSX("span", {
|
|
376
|
-
className: "euiContextMenu__itemLayout"
|
|
377
|
-
}, title));
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
var classes = classNames('euiContextMenuPanel', className, transitionDirection && transitionType && transitionDirectionAndTypeToClassNameMap[transitionDirection] ? transitionDirectionAndTypeToClassNameMap[transitionDirection][transitionType] : undefined);
|
|
337
|
+
var classes = classNames('euiContextMenuPanel', className);
|
|
338
|
+
var styles = euiContextMenuPanelStyles(theme);
|
|
339
|
+
var cssStyles = [styles.euiContextMenuPanel, transitionDirection && transitionType && styles[transitionDirection][transitionType]];
|
|
340
|
+
var panelTitle = title && ___EmotionJSX(EuiContextMenuItem, {
|
|
341
|
+
css: styles.euiContextMenuPanel__title,
|
|
342
|
+
className: "euiContextMenuPanel__title",
|
|
343
|
+
onClick: onClose,
|
|
344
|
+
buttonRef: function buttonRef(node) {
|
|
345
|
+
if (onClose) _this3.backButton = node;
|
|
346
|
+
},
|
|
347
|
+
"data-test-subj": onClose ? 'contextMenuPanelTitleButton' : 'contextMenuPanelTitle',
|
|
348
|
+
icon: onClose && 'arrowLeft'
|
|
349
|
+
}, title);
|
|
381
350
|
var content = items && items.length ? items.map(function (MenuItem) {
|
|
382
351
|
var cloneProps = {};
|
|
383
352
|
if (size) {
|
|
@@ -387,6 +356,7 @@ export var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
|
|
|
387
356
|
}) : children;
|
|
388
357
|
return ___EmotionJSX("div", _extends({
|
|
389
358
|
ref: this.panelRef,
|
|
359
|
+
css: cssStyles,
|
|
390
360
|
className: classes,
|
|
391
361
|
onKeyDown: this.onKeyDown,
|
|
392
362
|
tabIndex: -1,
|
|
@@ -421,12 +391,12 @@ export var EuiContextMenuPanel = /*#__PURE__*/function (_Component) {
|
|
|
421
391
|
return null;
|
|
422
392
|
}
|
|
423
393
|
}]);
|
|
424
|
-
return
|
|
394
|
+
return EuiContextMenuPanelClass;
|
|
425
395
|
}(Component);
|
|
426
|
-
_defineProperty(
|
|
396
|
+
_defineProperty(EuiContextMenuPanelClass, "defaultProps", {
|
|
427
397
|
items: []
|
|
428
398
|
});
|
|
429
|
-
|
|
399
|
+
EuiContextMenuPanelClass.propTypes = {
|
|
430
400
|
className: PropTypes.string,
|
|
431
401
|
"aria-label": PropTypes.string,
|
|
432
402
|
"data-test-subj": PropTypes.string,
|
|
@@ -443,7 +413,8 @@ EuiContextMenuPanel.propTypes = {
|
|
|
443
413
|
transitionDirection: PropTypes.oneOf(["next", "previous"]),
|
|
444
414
|
transitionType: PropTypes.oneOf(["in", "out"]),
|
|
445
415
|
/**
|
|
446
|
-
|
|
447
|
-
|
|
416
|
+
* Alters the size of the items and the title
|
|
417
|
+
*/
|
|
448
418
|
size: PropTypes.any
|
|
449
|
-
};
|
|
419
|
+
};
|
|
420
|
+
export var EuiContextMenuPanel = withEuiTheme(EuiContextMenuPanelClass);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { css, keyframes } from '@emotion/react';
|
|
12
|
+
import { logicalCSS, euiCantAnimate } from '../../global_styling';
|
|
13
|
+
import { euiTitle } from '../title/title.styles';
|
|
14
|
+
import { euiContextMenuVariables } from './context_menu.styles';
|
|
15
|
+
export var euiContextMenuPanelStyles = function euiContextMenuPanelStyles(euiThemeContext) {
|
|
16
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
17
|
+
var _euiContextMenuVariab = euiContextMenuVariables(euiThemeContext),
|
|
18
|
+
panelWidth = _euiContextMenuVariab.panelWidth;
|
|
19
|
+
var animations = {
|
|
20
|
+
transitioning: /*#__PURE__*/css("pointer-events:none;animation-fill-mode:forwards;animation-duration:", euiTheme.animation.normal, ";animation-timing-function:", euiTheme.animation.resistance, ";", euiCantAnimate, "{animation-duration:0s;};label:transitioning;"),
|
|
21
|
+
inLeft: keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% { transform: translateX(", "); }\n 100% { transform: translateX(0); }\n "])), panelWidth),
|
|
22
|
+
outLeft: keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% { transform: translateX(0); }\n 100% { transform: translateX(-", "); }\n "])), panelWidth),
|
|
23
|
+
inRight: keyframes(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% { transform: translateX(-", "); }\n 100% { transform: translateX(0); }\n "])), panelWidth),
|
|
24
|
+
outRight: keyframes(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n 0% { transform: translateX(0); }\n 100% { transform: translateX(", "); }\n "])), panelWidth)
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
euiContextMenuPanel: /*#__PURE__*/css(logicalCSS('width', '100%'), " visibility:visible;outline-offset:-", euiTheme.focus.width, ";&:focus{outline:none;};label:euiContextMenuPanel;"),
|
|
28
|
+
// Panel animations
|
|
29
|
+
next: {
|
|
30
|
+
in: /*#__PURE__*/css(animations.transitioning, " animation-name:", animations.inLeft, ";;label:in;"),
|
|
31
|
+
out: /*#__PURE__*/css(animations.transitioning, " animation-name:", animations.outLeft, ";;label:out;")
|
|
32
|
+
},
|
|
33
|
+
previous: {
|
|
34
|
+
in: /*#__PURE__*/css(animations.transitioning, " animation-name:", animations.inRight, ";;label:in;"),
|
|
35
|
+
out: /*#__PURE__*/css(animations.transitioning, " animation-name:", animations.outRight, ";;label:out;")
|
|
36
|
+
},
|
|
37
|
+
// Children
|
|
38
|
+
euiContextMenuPanel__title: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxs'), " ", logicalCSS('border-bottom', euiTheme.border.thin), " &:enabled:focus{background-color:unset;};label:euiContextMenuPanel__title;")
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -34,6 +34,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
34
34
|
import classNames from 'classnames';
|
|
35
35
|
import PropTypes from "prop-types";
|
|
36
36
|
import React, { Component } from 'react';
|
|
37
|
+
import { EuiThemeProvider } from '../../services';
|
|
37
38
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
38
39
|
import { EuiBreadcrumbs } from '../breadcrumbs';
|
|
39
40
|
import { EuiButton, EuiButtonIcon } from '../button';
|
|
@@ -168,8 +169,7 @@ export var EuiControlBar = /*#__PURE__*/function (_Component) {
|
|
|
168
169
|
{
|
|
169
170
|
var controlType = control.controlType,
|
|
170
171
|
id = control.id,
|
|
171
|
-
|
|
172
|
-
color = _control$color === void 0 ? 'ghost' : _control$color,
|
|
172
|
+
color = control.color,
|
|
173
173
|
label = control.label,
|
|
174
174
|
_className = control.className,
|
|
175
175
|
_rest = _objectWithoutProperties(control, _excluded2);
|
|
@@ -187,8 +187,8 @@ export var EuiControlBar = /*#__PURE__*/function (_Component) {
|
|
|
187
187
|
_id = control.id,
|
|
188
188
|
iconType = control.iconType,
|
|
189
189
|
_className2 = control.className,
|
|
190
|
-
_control$
|
|
191
|
-
_color = _control$
|
|
190
|
+
_control$color = control.color,
|
|
191
|
+
_color = _control$color === void 0 ? 'text' : _control$color,
|
|
192
192
|
onClick = control.onClick,
|
|
193
193
|
href = control.href,
|
|
194
194
|
_rest2 = _objectWithoutProperties(control, _excluded3);
|
|
@@ -264,25 +264,30 @@ export var EuiControlBar = /*#__PURE__*/function (_Component) {
|
|
|
264
264
|
token: "euiControlBar.screenReaderHeading",
|
|
265
265
|
default: "Page level controls"
|
|
266
266
|
}, function (screenReaderHeading) {
|
|
267
|
-
return (
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
267
|
+
return ___EmotionJSX(EuiThemeProvider, {
|
|
268
|
+
colorMode: "dark",
|
|
269
|
+
wrapperProps: {
|
|
270
|
+
cloneElement: true
|
|
271
|
+
}
|
|
272
|
+
}, ___EmotionJSX("section", _extends({
|
|
273
|
+
className: classes
|
|
274
|
+
// Though it would be better to use aria-labelledby than aria-label
|
|
275
|
+
// and not repeat the same string twice, a bug in voiceover won't list
|
|
276
|
+
// some landmarks in the rotor without an aria-label
|
|
277
|
+
,
|
|
278
|
+
"aria-label": landmarkHeading ? landmarkHeading : screenReaderHeading
|
|
279
|
+
}, rest, {
|
|
280
|
+
style: styles
|
|
281
|
+
}), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("h2", null, landmarkHeading ? landmarkHeading : screenReaderHeading)), ___EmotionJSX("div", {
|
|
282
|
+
className: "euiControlBar__controls",
|
|
283
|
+
ref: function ref(node) {
|
|
284
|
+
_this2.bar = node;
|
|
285
|
+
}
|
|
286
|
+
}, controls.map(function (control, index) {
|
|
287
|
+
return controlItem(control, index);
|
|
288
|
+
})), _this2.props.showContent ? ___EmotionJSX("div", {
|
|
289
|
+
className: "euiControlBar__content"
|
|
290
|
+
}, children) : null));
|
|
286
291
|
});
|
|
287
292
|
return position === 'fixed' ? ___EmotionJSX(EuiPortal, null, controlBar, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
288
293
|
"aria-live": "assertive"
|