@elastic/eui 123.0.0 → 123.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui-icons.json +103 -92
- package/dist/svgs/chart_mix.svg +5 -0
- package/dist/svgs/chart_waffle.svg +4 -0
- package/dist/svgs/clipboard_warning.svg +6 -0
- package/dist/svgs/clock_up.svg +5 -0
- package/dist/svgs/emergency_light.svg +4 -0
- package/dist/svgs/product_canvas.svg +5 -0
- package/dist/svgs/product_elastic_agent.svg +5 -0
- package/dist/svgs/product_fleet.svg +3 -0
- package/dist/svgs/product_lens.svg +4 -0
- package/dist/svgs/puzzle_piece.svg +3 -0
- package/dist/svgs/shield.svg +4 -0
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +4 -4
- package/es/components/basic_table/in_memory_table.js +4 -4
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/call_out/call_out.js +5 -10
- package/es/components/call_out/call_out.styles.js +3 -14
- 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/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +24 -24
- package/es/components/datagrid/body/data_grid_body.js +13 -13
- package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/es/components/datagrid/controls/column_sorting.js +13 -13
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/es/components/datagrid/utils/in_memory.js +12 -12
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/flyout/flyout.component.js +4 -2
- package/es/components/flyout/flyout_body.js +12 -12
- package/es/components/flyout/flyout_footer.js +8 -5
- package/es/components/flyout/flyout_header.js +8 -5
- package/es/components/flyout/flyout_menu/flyout_menu.js +2 -2
- package/es/components/flyout/flyout_menu/flyout_menu.styles.js +17 -5
- package/es/components/form/field_number/field_number.js +2 -2
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_button/form_control_button.js +1 -1
- package/es/components/form/form_control_layout/append_prepend/form_append_prepend.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_label_append/form_label_append.js +43 -0
- package/es/components/form/form_label_append/form_label_append.styles.js +16 -0
- package/es/components/form/form_label_append/index.js +9 -0
- package/es/components/form/form_row/form_row.js +7 -4
- package/es/components/form/range/range.js +218 -258
- package/es/components/form/super_select/super_select_control.js +25 -9
- package/es/components/form/text_area/text_area.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/icon/assets/chart_mix.js +35 -0
- package/es/components/icon/assets/chart_waffle.js +33 -0
- package/es/components/icon/assets/clipboard_warning.js +39 -0
- package/es/components/icon/assets/clock_up.js +37 -0
- package/es/components/icon/assets/emergency_light.js +33 -0
- package/es/components/icon/assets/product_canvas.js +35 -0
- package/es/components/icon/assets/product_elastic_agent.js +35 -0
- package/es/components/icon/assets/product_fleet.js +33 -0
- package/es/components/icon/assets/product_lens.js +35 -0
- package/es/components/icon/assets/puzzle_piece.js +33 -0
- package/es/components/icon/assets/shield.js +35 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +58 -3
- package/es/components/icon/svgs/chart_mix.svg +5 -0
- package/es/components/icon/svgs/chart_waffle.svg +4 -0
- package/es/components/icon/svgs/clipboard_warning.svg +6 -0
- package/es/components/icon/svgs/clock_up.svg +5 -0
- package/es/components/icon/svgs/emergency_light.svg +4 -0
- package/es/components/icon/svgs/product_canvas.svg +5 -0
- package/es/components/icon/svgs/product_elastic_agent.svg +5 -0
- package/es/components/icon/svgs/product_fleet.svg +3 -0
- package/es/components/icon/svgs/product_lens.svg +4 -0
- package/es/components/icon/svgs/puzzle_piece.svg +3 -0
- package/es/components/icon/svgs/shield.svg +4 -0
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/list_item_layout/_list_item_layout.js +3 -2
- package/es/components/list_item_layout/_list_item_layout.styles.js +11 -10
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/selectable/selectable.js +16 -5
- package/es/components/selectable/selectable_list/selectable_list.js +6 -2
- package/es/components/selectable/selectable_list/selectable_list_item.js +11 -7
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +2 -2
- package/es/components/toast/toast.js +2 -2
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/eui.d.ts +192 -63
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +4 -4
- package/lib/components/basic_table/in_memory_table.js +4 -4
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/call_out/call_out.js +5 -10
- package/lib/components/call_out/call_out.styles.js +2 -13
- 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/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +24 -24
- package/lib/components/datagrid/body/data_grid_body.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/lib/components/datagrid/controls/column_sorting.js +13 -13
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/lib/components/datagrid/utils/in_memory.js +12 -12
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/flyout/flyout.component.js +4 -2
- package/lib/components/flyout/flyout_body.js +12 -12
- package/lib/components/flyout/flyout_footer.js +11 -5
- package/lib/components/flyout/flyout_header.js +11 -5
- package/lib/components/flyout/flyout_menu/flyout_menu.js +2 -2
- package/lib/components/flyout/flyout_menu/flyout_menu.styles.js +16 -4
- package/lib/components/form/field_number/field_number.js +2 -2
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_button/form_control_button.js +1 -1
- package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.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_label_append/form_label_append.js +49 -0
- package/lib/components/form/form_label_append/form_label_append.styles.js +22 -0
- package/lib/components/form/form_label_append/index.js +12 -0
- package/lib/components/form/form_row/form_row.js +7 -4
- package/lib/components/form/range/range.js +224 -262
- package/lib/components/form/super_select/super_select_control.js +24 -8
- package/lib/components/form/text_area/text_area.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/icon/assets/chart_mix.js +42 -0
- package/lib/components/icon/assets/chart_waffle.js +40 -0
- package/lib/components/icon/assets/clipboard_warning.js +46 -0
- package/lib/components/icon/assets/clock_up.js +44 -0
- package/lib/components/icon/assets/emergency_light.js +40 -0
- package/lib/components/icon/assets/product_canvas.js +42 -0
- package/lib/components/icon/assets/product_elastic_agent.js +42 -0
- package/lib/components/icon/assets/product_fleet.js +40 -0
- package/lib/components/icon/assets/product_lens.js +42 -0
- package/lib/components/icon/assets/puzzle_piece.js +40 -0
- package/lib/components/icon/assets/shield.js +42 -0
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +80 -3
- package/lib/components/icon/svgs/chart_mix.svg +5 -0
- package/lib/components/icon/svgs/chart_waffle.svg +4 -0
- package/lib/components/icon/svgs/clipboard_warning.svg +6 -0
- package/lib/components/icon/svgs/clock_up.svg +5 -0
- package/lib/components/icon/svgs/emergency_light.svg +4 -0
- package/lib/components/icon/svgs/product_canvas.svg +5 -0
- package/lib/components/icon/svgs/product_elastic_agent.svg +5 -0
- package/lib/components/icon/svgs/product_fleet.svg +3 -0
- package/lib/components/icon/svgs/product_lens.svg +4 -0
- package/lib/components/icon/svgs/puzzle_piece.svg +3 -0
- package/lib/components/icon/svgs/shield.svg +4 -0
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/list_item_layout/_list_item_layout.js +3 -2
- package/lib/components/list_item_layout/_list_item_layout.styles.js +10 -10
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/pagination/pagination_button.js +1 -1
- package/lib/components/selectable/selectable.js +16 -5
- package/lib/components/selectable/selectable_list/selectable_list.js +6 -2
- package/lib/components/selectable/selectable_list/selectable_list_item.js +11 -7
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +2 -2
- package/lib/components/toast/toast.js +2 -2
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/optimize/es/components/call_out/call_out.js +3 -8
- package/optimize/es/components/call_out/call_out.styles.js +3 -14
- package/optimize/es/components/flyout/flyout.component.js +4 -2
- package/optimize/es/components/flyout/flyout_footer.js +7 -4
- package/optimize/es/components/flyout/flyout_header.js +7 -4
- package/optimize/es/components/flyout/flyout_menu/flyout_menu.styles.js +17 -5
- package/optimize/es/components/form/form_label_append/form_label_append.js +34 -0
- package/optimize/es/components/form/form_label_append/form_label_append.styles.js +16 -0
- package/optimize/es/components/form/form_label_append/index.js +9 -0
- package/optimize/es/components/form/form_row/form_row.js +4 -1
- package/optimize/es/components/form/range/range.js +212 -251
- package/optimize/es/components/form/super_select/super_select_control.js +25 -9
- package/optimize/es/components/icon/assets/chart_mix.js +34 -0
- package/optimize/es/components/icon/assets/chart_waffle.js +32 -0
- package/optimize/es/components/icon/assets/clipboard_warning.js +38 -0
- package/optimize/es/components/icon/assets/clock_up.js +36 -0
- package/optimize/es/components/icon/assets/emergency_light.js +32 -0
- package/optimize/es/components/icon/assets/product_canvas.js +34 -0
- package/optimize/es/components/icon/assets/product_elastic_agent.js +34 -0
- package/optimize/es/components/icon/assets/product_fleet.js +32 -0
- package/optimize/es/components/icon/assets/product_lens.js +34 -0
- package/optimize/es/components/icon/assets/puzzle_piece.js +32 -0
- package/optimize/es/components/icon/assets/shield.js +34 -0
- package/optimize/es/components/icon/icon_map.js +58 -3
- package/optimize/es/components/icon/svgs/chart_mix.svg +5 -0
- package/optimize/es/components/icon/svgs/chart_waffle.svg +4 -0
- package/optimize/es/components/icon/svgs/clipboard_warning.svg +6 -0
- package/optimize/es/components/icon/svgs/clock_up.svg +5 -0
- package/optimize/es/components/icon/svgs/emergency_light.svg +4 -0
- package/optimize/es/components/icon/svgs/product_canvas.svg +5 -0
- package/optimize/es/components/icon/svgs/product_elastic_agent.svg +5 -0
- package/optimize/es/components/icon/svgs/product_fleet.svg +3 -0
- package/optimize/es/components/icon/svgs/product_lens.svg +4 -0
- package/optimize/es/components/icon/svgs/puzzle_piece.svg +3 -0
- package/optimize/es/components/icon/svgs/shield.svg +4 -0
- package/optimize/es/components/list_item_layout/_list_item_layout.js +3 -2
- package/optimize/es/components/list_item_layout/_list_item_layout.styles.js +11 -10
- package/optimize/es/components/selectable/selectable.js +15 -5
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +3 -1
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +9 -6
- package/optimize/lib/components/call_out/call_out.js +3 -8
- package/optimize/lib/components/call_out/call_out.styles.js +2 -13
- package/optimize/lib/components/flyout/flyout.component.js +4 -2
- package/optimize/lib/components/flyout/flyout_footer.js +10 -4
- package/optimize/lib/components/flyout/flyout_header.js +10 -4
- package/optimize/lib/components/flyout/flyout_menu/flyout_menu.styles.js +16 -4
- package/optimize/lib/components/form/form_label_append/form_label_append.js +40 -0
- package/optimize/lib/components/form/form_label_append/form_label_append.styles.js +22 -0
- package/optimize/lib/components/form/form_label_append/index.js +12 -0
- package/optimize/lib/components/form/form_row/form_row.js +4 -1
- package/optimize/lib/components/form/range/range.js +213 -251
- package/optimize/lib/components/form/super_select/super_select_control.js +24 -8
- package/optimize/lib/components/icon/assets/chart_mix.js +42 -0
- package/optimize/lib/components/icon/assets/chart_waffle.js +40 -0
- package/optimize/lib/components/icon/assets/clipboard_warning.js +46 -0
- package/optimize/lib/components/icon/assets/clock_up.js +44 -0
- package/optimize/lib/components/icon/assets/emergency_light.js +40 -0
- package/optimize/lib/components/icon/assets/product_canvas.js +42 -0
- package/optimize/lib/components/icon/assets/product_elastic_agent.js +42 -0
- package/optimize/lib/components/icon/assets/product_fleet.js +40 -0
- package/optimize/lib/components/icon/assets/product_lens.js +42 -0
- package/optimize/lib/components/icon/assets/puzzle_piece.js +40 -0
- package/optimize/lib/components/icon/assets/shield.js +42 -0
- package/optimize/lib/components/icon/icon_map.js +80 -3
- package/optimize/lib/components/icon/svgs/chart_mix.svg +5 -0
- package/optimize/lib/components/icon/svgs/chart_waffle.svg +4 -0
- package/optimize/lib/components/icon/svgs/clipboard_warning.svg +6 -0
- package/optimize/lib/components/icon/svgs/clock_up.svg +5 -0
- package/optimize/lib/components/icon/svgs/emergency_light.svg +4 -0
- package/optimize/lib/components/icon/svgs/product_canvas.svg +5 -0
- package/optimize/lib/components/icon/svgs/product_elastic_agent.svg +5 -0
- package/optimize/lib/components/icon/svgs/product_fleet.svg +3 -0
- package/optimize/lib/components/icon/svgs/product_lens.svg +4 -0
- package/optimize/lib/components/icon/svgs/puzzle_piece.svg +3 -0
- package/optimize/lib/components/icon/svgs/shield.svg +4 -0
- package/optimize/lib/components/list_item_layout/_list_item_layout.js +3 -2
- package/optimize/lib/components/list_item_layout/_list_item_layout.styles.js +10 -10
- package/optimize/lib/components/selectable/selectable.js +15 -5
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +3 -1
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +9 -6
- package/package.json +1 -1
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +4 -4
- package/test-env/components/basic_table/in_memory_table.js +4 -4
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/call_out/call_out.js +5 -10
- package/test-env/components/call_out/call_out.styles.js +2 -13
- 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/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +24 -24
- package/test-env/components/datagrid/body/data_grid_body.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
- package/test-env/components/datagrid/controls/column_sorting.js +13 -13
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/test-env/components/datagrid/utils/in_memory.js +12 -12
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/flyout/flyout.component.js +4 -2
- package/test-env/components/flyout/flyout_body.js +12 -12
- package/test-env/components/flyout/flyout_footer.js +11 -5
- package/test-env/components/flyout/flyout_header.js +11 -5
- package/test-env/components/flyout/flyout_menu/flyout_menu.js +2 -2
- package/test-env/components/flyout/flyout_menu/flyout_menu.styles.js +16 -4
- package/test-env/components/form/field_number/field_number.js +2 -2
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_button/form_control_button.js +1 -1
- package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.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_label_append/form_label_append.js +48 -0
- package/test-env/components/form/form_label_append/form_label_append.styles.js +22 -0
- package/test-env/components/form/form_label_append/index.js +12 -0
- package/test-env/components/form/form_row/form_row.js +7 -4
- package/test-env/components/form/range/range.js +214 -252
- package/test-env/components/form/super_select/super_select_control.js +24 -8
- package/test-env/components/form/text_area/text_area.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/icon/assets/chart_mix.js +42 -0
- package/test-env/components/icon/assets/chart_waffle.js +40 -0
- package/test-env/components/icon/assets/clipboard_warning.js +46 -0
- package/test-env/components/icon/assets/clock_up.js +44 -0
- package/test-env/components/icon/assets/emergency_light.js +40 -0
- package/test-env/components/icon/assets/product_canvas.js +42 -0
- package/test-env/components/icon/assets/product_elastic_agent.js +42 -0
- package/test-env/components/icon/assets/product_fleet.js +40 -0
- package/test-env/components/icon/assets/product_lens.js +42 -0
- package/test-env/components/icon/assets/puzzle_piece.js +40 -0
- package/test-env/components/icon/assets/shield.js +42 -0
- package/test-env/components/icon/icon_map.js +80 -3
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/list_item_layout/_list_item_layout.js +3 -2
- package/test-env/components/list_item_layout/_list_item_layout.styles.js +10 -10
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/pagination/pagination_button.js +1 -1
- package/test-env/components/selectable/selectable.js +16 -5
- package/test-env/components/selectable/selectable_list/selectable_list.js +6 -2
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +11 -7
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +2 -2
- package/test-env/components/toast/toast.js +2 -2
- package/test-env/components/tool_tip/icon_tip.js +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.
|
|
7
|
+
exports.EuiRange = void 0;
|
|
7
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
11
|
var _number = require("../../../services/number");
|
|
11
12
|
var _popover = require("../../popover");
|
|
12
|
-
var _services = require("../../../services
|
|
13
|
+
var _services = require("../../../services");
|
|
13
14
|
var _eui_form_context = require("../eui_form_context");
|
|
14
15
|
var _range_levels_colors = require("./range_levels_colors");
|
|
15
16
|
var _range_highlight = require("./range_highlight");
|
|
@@ -22,274 +23,235 @@ var _range_wrapper = require("./range_wrapper");
|
|
|
22
23
|
var _range = require("./range.styles");
|
|
23
24
|
var _i18n = require("../../i18n");
|
|
24
25
|
var _react2 = require("@emotion/react");
|
|
25
|
-
var _excluded = ["
|
|
26
|
-
|
|
27
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
30
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
31
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
32
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
33
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
34
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
35
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
36
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
37
|
-
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
38
|
-
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
39
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
|
-
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
41
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
42
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
43
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
44
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
45
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
|
|
26
|
+
var _excluded = ["min", "max", "step", "compressed", "isLoading", "showLabels", "showInput", "showRange", "showTicks", "showValue", "levels", "className", "disabled", "fullWidth", "readOnly", "id", "name", "tickInterval", "ticks", "valueAppend", "valuePrepend", "onBlur", "onChange", "onFocus", "value", "tabIndex", "isInvalid", "inputPopoverProps"];
|
|
27
|
+
/*
|
|
46
28
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
47
29
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
48
30
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
49
31
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
50
32
|
* Side Public License, v 1.
|
|
51
33
|
*/
|
|
52
|
-
var EuiRangeClass = exports.EuiRangeClass = /*#__PURE__*/function (_Component) {
|
|
53
|
-
function EuiRangeClass() {
|
|
54
|
-
var _this;
|
|
55
|
-
_classCallCheck(this, EuiRangeClass);
|
|
56
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
57
|
-
args[_key] = arguments[_key];
|
|
58
|
-
}
|
|
59
|
-
_this = _callSuper(this, EuiRangeClass, [].concat(args));
|
|
60
|
-
_defineProperty(_this, "preventPopoverClose", false);
|
|
61
|
-
_defineProperty(_this, "state", {
|
|
62
|
-
id: _this.props.id || (0, _services.htmlIdGenerator)()(),
|
|
63
|
-
isPopoverOpen: false,
|
|
64
|
-
trackWidth: 0
|
|
65
|
-
});
|
|
66
|
-
_defineProperty(_this, "handleOnChange", function (e) {
|
|
67
|
-
var isValid = (0, _number.isWithinRange)(_this.props.min, _this.props.max, e.currentTarget.value);
|
|
68
|
-
if (_this.props.onChange) {
|
|
69
|
-
_this.props.onChange(e, isValid);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
_defineProperty(_this, "setTrackWidth", function (_ref) {
|
|
73
|
-
var width = _ref.width;
|
|
74
|
-
_this.setState({
|
|
75
|
-
trackWidth: width
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
_defineProperty(_this, "onInputFocus", function (e) {
|
|
79
|
-
if (_this.props.onFocus) {
|
|
80
|
-
_this.props.onFocus(e);
|
|
81
|
-
}
|
|
82
|
-
_this.setState({
|
|
83
|
-
isPopoverOpen: true
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
_defineProperty(_this, "onInputBlur", function (e) {
|
|
87
|
-
return setTimeout(function () {
|
|
88
|
-
// Safari does not recognize any focus-related eventing for input[type=range]
|
|
89
|
-
// making it impossible to capture its state using active/focus/relatedTarget
|
|
90
|
-
// Instead, a prevention flag is set on mousedown, with a waiting period here.
|
|
91
|
-
// Mousedown is viable because in the popover case, it is inaccessible via keyboard (intentionally)
|
|
92
|
-
if (_this.preventPopoverClose) {
|
|
93
|
-
_this.preventPopoverClose = false;
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
if (_this.props.onBlur) {
|
|
97
|
-
_this.props.onBlur(e);
|
|
98
|
-
}
|
|
99
|
-
_this.closePopover();
|
|
100
|
-
}, 200);
|
|
101
|
-
});
|
|
102
|
-
_defineProperty(_this, "closePopover", function () {
|
|
103
|
-
_this.preventPopoverClose = false;
|
|
104
|
-
_this.setState({
|
|
105
|
-
isPopoverOpen: false
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
_defineProperty(_this, "handleAriaValueText", function (ticks, currentVal) {
|
|
109
|
-
var target = ticks.find(function (tick) {
|
|
110
|
-
return tick.value.toString() === currentVal.toString();
|
|
111
|
-
});
|
|
112
|
-
if (target) {
|
|
113
|
-
return target.accessibleLabel ? "".concat(target.value, ", (").concat(target.accessibleLabel, ")") : typeof target.label === 'string' // Fall back to the label if it's a usable string
|
|
114
|
-
? "".concat(target.value, ", (").concat(target.label, ")") : undefined;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
return _this;
|
|
118
|
-
}
|
|
119
|
-
_inherits(EuiRangeClass, _Component);
|
|
120
|
-
return _createClass(EuiRangeClass, [{
|
|
121
|
-
key: "isValid",
|
|
122
|
-
get: function get() {
|
|
123
|
-
return (0, _number.isWithinRange)(this.props.min, this.props.max, this.props.value || '');
|
|
124
|
-
}
|
|
125
|
-
}, {
|
|
126
|
-
key: "render",
|
|
127
|
-
value: function render() {
|
|
128
|
-
var _this2 = this;
|
|
129
|
-
var _ref2 = this.context,
|
|
130
|
-
defaultFullWidth = _ref2.defaultFullWidth;
|
|
131
|
-
var _this$props = this.props,
|
|
132
|
-
className = _this$props.className,
|
|
133
|
-
compressed = _this$props.compressed,
|
|
134
|
-
disabled = _this$props.disabled,
|
|
135
|
-
_this$props$fullWidth = _this$props.fullWidth,
|
|
136
|
-
fullWidth = _this$props$fullWidth === void 0 ? defaultFullWidth : _this$props$fullWidth,
|
|
137
|
-
isLoading = _this$props.isLoading,
|
|
138
|
-
readOnly = _this$props.readOnly,
|
|
139
|
-
propsId = _this$props.id,
|
|
140
|
-
max = _this$props.max,
|
|
141
|
-
min = _this$props.min,
|
|
142
|
-
name = _this$props.name,
|
|
143
|
-
step = _this$props.step,
|
|
144
|
-
showLabels = _this$props.showLabels,
|
|
145
|
-
showInput = _this$props.showInput,
|
|
146
|
-
inputPopoverProps = _this$props.inputPopoverProps,
|
|
147
|
-
showTicks = _this$props.showTicks,
|
|
148
|
-
tickInterval = _this$props.tickInterval,
|
|
149
|
-
ticks = _this$props.ticks,
|
|
150
|
-
levels = _this$props.levels,
|
|
151
|
-
showRange = _this$props.showRange,
|
|
152
|
-
showValue = _this$props.showValue,
|
|
153
|
-
valueAppend = _this$props.valueAppend,
|
|
154
|
-
valuePrepend = _this$props.valuePrepend,
|
|
155
|
-
onBlur = _this$props.onBlur,
|
|
156
|
-
onChange = _this$props.onChange,
|
|
157
|
-
onFocus = _this$props.onFocus,
|
|
158
|
-
value = _this$props.value,
|
|
159
|
-
tabIndex = _this$props.tabIndex,
|
|
160
|
-
isInvalid = _this$props.isInvalid,
|
|
161
|
-
theme = _this$props.theme,
|
|
162
|
-
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
163
|
-
var id = this.state.id;
|
|
164
|
-
var showInputOnly = showInput === 'inputWithPopover';
|
|
165
|
-
var canShowDropdown = showInputOnly && !readOnly && !disabled;
|
|
166
|
-
var theInput = !!showInput ? (0, _react2.jsx)(_range_input.EuiRangeInput, _extends({
|
|
167
|
-
id: id,
|
|
168
|
-
min: min,
|
|
169
|
-
max: max,
|
|
170
|
-
step: step,
|
|
171
|
-
value: value,
|
|
172
|
-
readOnly: readOnly,
|
|
173
|
-
disabled: disabled,
|
|
174
|
-
compressed: compressed,
|
|
175
|
-
onChange: this.handleOnChange,
|
|
176
|
-
name: name,
|
|
177
|
-
onFocus: canShowDropdown ? this.onInputFocus : onFocus,
|
|
178
|
-
onBlur: canShowDropdown ? this.onInputBlur : onBlur,
|
|
179
|
-
fullWidth: showInputOnly && fullWidth,
|
|
180
|
-
isLoading: showInputOnly && isLoading,
|
|
181
|
-
isInvalid: isInvalid,
|
|
182
|
-
autoSize: !showInputOnly
|
|
183
|
-
}, rest)) : null;
|
|
184
|
-
var classes = (0, _classnames.default)('euiRange', className);
|
|
185
|
-
var styles = (0, _range.euiRangeStyles)(theme);
|
|
186
|
-
var cssStyles = [styles.euiRange, showInput && styles.hasInput];
|
|
187
|
-
var thumbColor = levels && (0, _range_levels_colors.getLevelColor)(levels, Number(value));
|
|
188
|
-
var sliderScreenReaderInstructions = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
189
|
-
token: "euiRange.sliderScreenReaderInstructions",
|
|
190
|
-
default: "You are in a custom range slider. Use the Up and Down arrow keys to change the value."
|
|
191
|
-
});
|
|
192
|
-
var theRange = (0, _react2.jsx)(_range_wrapper.EuiRangeWrapper, {
|
|
193
|
-
className: classes,
|
|
194
|
-
css: cssStyles,
|
|
195
|
-
fullWidth: fullWidth,
|
|
196
|
-
compressed: compressed
|
|
197
|
-
}, showLabels && (0, _react2.jsx)(_range_label.EuiRangeLabel, {
|
|
198
|
-
side: "min",
|
|
199
|
-
disabled: disabled
|
|
200
|
-
}, min), (0, _react2.jsx)(_range_track.EuiRangeTrack, {
|
|
201
|
-
trackWidth: this.state.trackWidth,
|
|
202
|
-
disabled: disabled,
|
|
203
|
-
compressed: compressed,
|
|
204
|
-
max: max,
|
|
205
|
-
min: min,
|
|
206
|
-
step: step,
|
|
207
|
-
showTicks: showTicks,
|
|
208
|
-
tickInterval: tickInterval,
|
|
209
|
-
ticks: ticks,
|
|
210
|
-
levels: levels,
|
|
211
|
-
onChange: this.handleOnChange,
|
|
212
|
-
value: value,
|
|
213
|
-
"aria-hidden": !!showInput,
|
|
214
|
-
showRange: showRange
|
|
215
|
-
}, (0, _react2.jsx)(_range_slider.EuiRangeSlider, _extends({
|
|
216
|
-
ariaValueText: ticks ? this.handleAriaValueText(ticks, value) : undefined,
|
|
217
|
-
id: showInput ? undefined : id // Attach id only to the input if there is one
|
|
218
|
-
,
|
|
219
|
-
name: name,
|
|
220
|
-
min: min,
|
|
221
|
-
max: max,
|
|
222
|
-
step: step,
|
|
223
|
-
value: value,
|
|
224
|
-
disabled: disabled,
|
|
225
|
-
onChange: this.handleOnChange,
|
|
226
|
-
showTicks: showTicks,
|
|
227
|
-
showRange: showRange,
|
|
228
|
-
tabIndex: showInput ? -1 : tabIndex,
|
|
229
|
-
onMouseDown: showInputOnly ? function () {
|
|
230
|
-
return _this2.preventPopoverClose = true;
|
|
231
|
-
} : undefined,
|
|
232
|
-
onFocus: showInput === true ? undefined : onFocus,
|
|
233
|
-
onBlur: showInputOnly ? this.onInputBlur : onBlur,
|
|
234
|
-
"aria-hidden": !!showInput,
|
|
235
|
-
thumbColor: thumbColor
|
|
236
|
-
}, rest, {
|
|
237
|
-
onResize: this.setTrackWidth
|
|
238
|
-
})), showRange && this.isValid && (0, _react2.jsx)(_range_highlight.EuiRangeHighlight, {
|
|
239
|
-
showTicks: showTicks,
|
|
240
|
-
min: Number(min),
|
|
241
|
-
max: Number(max),
|
|
242
|
-
lowerValue: Number(min),
|
|
243
|
-
upperValue: Number(value),
|
|
244
|
-
levels: levels,
|
|
245
|
-
trackWidth: this.state.trackWidth
|
|
246
|
-
}), showValue && !!String(value).length && (0, _react2.jsx)(_range_tooltip.EuiRangeTooltip, {
|
|
247
|
-
value: value,
|
|
248
|
-
max: max,
|
|
249
|
-
min: min,
|
|
250
|
-
name: name,
|
|
251
|
-
showTicks: showTicks,
|
|
252
|
-
valuePrepend: valuePrepend,
|
|
253
|
-
valueAppend: valueAppend
|
|
254
|
-
})), showLabels && (0, _react2.jsx)(_range_label.EuiRangeLabel, {
|
|
255
|
-
side: "max",
|
|
256
|
-
disabled: disabled
|
|
257
|
-
}, max), showInput && !showInputOnly && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", {
|
|
258
|
-
className: showTicks || ticks ? 'euiRange__slimHorizontalSpacer' : 'euiRange__horizontalSpacer',
|
|
259
|
-
css: showTicks || ticks ? styles.euiRange__slimHorizontalSpacer : styles.euiRange__horizontalSpacer
|
|
260
|
-
}), theInput));
|
|
261
|
-
var thePopover = showInputOnly ? (0, _react2.jsx)(_popover.EuiInputPopover, _extends({}, inputPopoverProps, {
|
|
262
|
-
className: (0, _classnames.default)('euiRange__popover', inputPopoverProps === null || inputPopoverProps === void 0 ? void 0 : inputPopoverProps.className),
|
|
263
|
-
input: theInput // `showInputOnly` confirms existence
|
|
264
|
-
,
|
|
265
|
-
fullWidth: fullWidth,
|
|
266
|
-
isOpen: this.state.isPopoverOpen,
|
|
267
|
-
closePopover: this.closePopover,
|
|
268
|
-
disableFocusTrap: true,
|
|
269
|
-
popoverScreenReaderText: sliderScreenReaderInstructions
|
|
270
|
-
}), theRange) : undefined;
|
|
271
|
-
return thePopover ? thePopover : theRange;
|
|
272
|
-
}
|
|
273
|
-
}]);
|
|
274
|
-
}(_react.Component);
|
|
275
34
|
/**
|
|
276
35
|
* @see {@link https://eui.elastic.co/docs/components/forms/numeric/range-sliders/|EuiRange documentation}
|
|
277
36
|
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
37
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
38
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
39
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
40
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
41
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
42
|
+
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."); }
|
|
43
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
44
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
45
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
46
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
47
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
48
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
49
|
+
var EuiRange = exports.EuiRange = function EuiRange(_ref) {
|
|
50
|
+
var _ref$min = _ref.min,
|
|
51
|
+
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
52
|
+
_ref$max = _ref.max,
|
|
53
|
+
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
54
|
+
_ref$step = _ref.step,
|
|
55
|
+
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
56
|
+
_ref$compressed = _ref.compressed,
|
|
57
|
+
compressed = _ref$compressed === void 0 ? false : _ref$compressed,
|
|
58
|
+
_ref$isLoading = _ref.isLoading,
|
|
59
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
60
|
+
_ref$showLabels = _ref.showLabels,
|
|
61
|
+
showLabels = _ref$showLabels === void 0 ? false : _ref$showLabels,
|
|
62
|
+
_ref$showInput = _ref.showInput,
|
|
63
|
+
showInput = _ref$showInput === void 0 ? false : _ref$showInput,
|
|
64
|
+
_ref$showRange = _ref.showRange,
|
|
65
|
+
showRange = _ref$showRange === void 0 ? false : _ref$showRange,
|
|
66
|
+
_ref$showTicks = _ref.showTicks,
|
|
67
|
+
showTicks = _ref$showTicks === void 0 ? false : _ref$showTicks,
|
|
68
|
+
_ref$showValue = _ref.showValue,
|
|
69
|
+
showValue = _ref$showValue === void 0 ? false : _ref$showValue,
|
|
70
|
+
_ref$levels = _ref.levels,
|
|
71
|
+
levels = _ref$levels === void 0 ? [] : _ref$levels,
|
|
72
|
+
className = _ref.className,
|
|
73
|
+
disabled = _ref.disabled,
|
|
74
|
+
_fullWidth = _ref.fullWidth,
|
|
75
|
+
readOnly = _ref.readOnly,
|
|
76
|
+
propsId = _ref.id,
|
|
77
|
+
name = _ref.name,
|
|
78
|
+
tickInterval = _ref.tickInterval,
|
|
79
|
+
ticks = _ref.ticks,
|
|
80
|
+
valueAppend = _ref.valueAppend,
|
|
81
|
+
valuePrepend = _ref.valuePrepend,
|
|
82
|
+
onBlur = _ref.onBlur,
|
|
83
|
+
onChange = _ref.onChange,
|
|
84
|
+
onFocus = _ref.onFocus,
|
|
85
|
+
value = _ref.value,
|
|
86
|
+
tabIndex = _ref.tabIndex,
|
|
87
|
+
isInvalid = _ref.isInvalid,
|
|
88
|
+
inputPopoverProps = _ref.inputPopoverProps,
|
|
89
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
90
|
+
var theme = (0, _services.useEuiTheme)();
|
|
91
|
+
var _useFormContext = (0, _eui_form_context.useFormContext)(),
|
|
92
|
+
defaultFullWidth = _useFormContext.defaultFullWidth;
|
|
93
|
+
var generatedId = (0, _services.useGeneratedHtmlId)();
|
|
94
|
+
var onBlurRef = (0, _services.useLatest)(onBlur);
|
|
95
|
+
var _useState = (0, _react.useState)(false),
|
|
96
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
97
|
+
isPopoverOpen = _useState2[0],
|
|
98
|
+
setIsPopoverOpen = _useState2[1];
|
|
99
|
+
var _useState3 = (0, _react.useState)(0),
|
|
100
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
101
|
+
trackWidth = _useState4[0],
|
|
102
|
+
setTrackWidth = _useState4[1];
|
|
103
|
+
var preventPopoverClose = (0, _react.useRef)(false);
|
|
104
|
+
var id = propsId || generatedId;
|
|
105
|
+
var isValid = (0, _number.isWithinRange)(min, max, value || '');
|
|
106
|
+
var showInputOnly = showInput === 'inputWithPopover';
|
|
107
|
+
var canShowDropdown = showInputOnly && !readOnly && !disabled;
|
|
108
|
+
var classes = (0, _classnames.default)('euiRange', className);
|
|
109
|
+
var styles = (0, _range.euiRangeStyles)(theme);
|
|
110
|
+
var cssStyles = [styles.euiRange, showInput && styles.hasInput];
|
|
111
|
+
var thumbColor = levels && (0, _range_levels_colors.getLevelColor)(levels, Number(value));
|
|
112
|
+
var fullWidth = _fullWidth !== null && _fullWidth !== void 0 ? _fullWidth : defaultFullWidth;
|
|
113
|
+
var handleOnChange = function handleOnChange(e) {
|
|
114
|
+
var isValid = (0, _number.isWithinRange)(min, max, e.currentTarget.value);
|
|
115
|
+
onChange === null || onChange === void 0 || onChange(e, isValid);
|
|
116
|
+
};
|
|
117
|
+
var handleSetTrackWidth = function handleSetTrackWidth(_ref2) {
|
|
118
|
+
var width = _ref2.width;
|
|
119
|
+
setTrackWidth(width);
|
|
120
|
+
};
|
|
121
|
+
var onInputFocus = function onInputFocus(e) {
|
|
122
|
+
onFocus === null || onFocus === void 0 || onFocus(e);
|
|
123
|
+
setIsPopoverOpen(true);
|
|
124
|
+
};
|
|
125
|
+
var onInputBlur = function onInputBlur(e) {
|
|
126
|
+
return setTimeout(function () {
|
|
127
|
+
var _onBlurRef$current;
|
|
128
|
+
// Safari does not recognize any focus-related eventing for input[type=range]
|
|
129
|
+
// making it impossible to capture its state using active/focus/relatedTarget
|
|
130
|
+
// Instead, a prevention flag is set on mousedown, with a waiting period here.
|
|
131
|
+
// Mousedown is viable because in the popover case, it is inaccessible via keyboard (intentionally)
|
|
132
|
+
if (preventPopoverClose.current) {
|
|
133
|
+
preventPopoverClose.current = false;
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
(_onBlurRef$current = onBlurRef.current) === null || _onBlurRef$current === void 0 || _onBlurRef$current.call(onBlurRef, e);
|
|
137
|
+
closePopover();
|
|
138
|
+
}, 200);
|
|
139
|
+
};
|
|
140
|
+
var closePopover = function closePopover() {
|
|
141
|
+
preventPopoverClose.current = false;
|
|
142
|
+
setIsPopoverOpen(false);
|
|
143
|
+
};
|
|
144
|
+
var handleAriaValueText = function handleAriaValueText(ticks, currentVal) {
|
|
145
|
+
var target = ticks.find(function (tick) {
|
|
146
|
+
return tick.value.toString() === currentVal.toString();
|
|
147
|
+
});
|
|
148
|
+
if (target) {
|
|
149
|
+
return target.accessibleLabel ? "".concat(target.value, ", (").concat(target.accessibleLabel, ")") : typeof target.label === 'string' // Fall back to the label if it's a usable string
|
|
150
|
+
? "".concat(target.value, ", (").concat(target.label, ")") : undefined;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
var input = showInput ? (0, _react2.jsx)(_range_input.EuiRangeInput, _extends({
|
|
154
|
+
id: id,
|
|
155
|
+
min: min,
|
|
156
|
+
max: max,
|
|
157
|
+
step: step,
|
|
158
|
+
value: value,
|
|
159
|
+
readOnly: readOnly,
|
|
160
|
+
disabled: disabled,
|
|
161
|
+
compressed: compressed,
|
|
162
|
+
onChange: handleOnChange,
|
|
163
|
+
name: name,
|
|
164
|
+
onFocus: canShowDropdown ? onInputFocus : onFocus,
|
|
165
|
+
onBlur: canShowDropdown ? onInputBlur : onBlur,
|
|
166
|
+
fullWidth: showInputOnly && fullWidth,
|
|
167
|
+
isLoading: showInputOnly && isLoading,
|
|
168
|
+
isInvalid: isInvalid,
|
|
169
|
+
autoSize: !showInputOnly
|
|
170
|
+
}, rest)) : null;
|
|
171
|
+
var sliderScreenReaderInstructions = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
172
|
+
token: "euiRange.sliderScreenReaderInstructions",
|
|
173
|
+
default: "You are in a custom range slider. Use the Up and Down arrow keys to change the value."
|
|
174
|
+
});
|
|
175
|
+
var range = (0, _react2.jsx)(_range_wrapper.EuiRangeWrapper, {
|
|
176
|
+
className: classes,
|
|
177
|
+
css: cssStyles,
|
|
178
|
+
fullWidth: fullWidth,
|
|
179
|
+
compressed: compressed
|
|
180
|
+
}, showLabels && (0, _react2.jsx)(_range_label.EuiRangeLabel, {
|
|
181
|
+
side: "min",
|
|
182
|
+
disabled: disabled
|
|
183
|
+
}, min), (0, _react2.jsx)(_range_track.EuiRangeTrack, {
|
|
184
|
+
trackWidth: trackWidth,
|
|
185
|
+
disabled: disabled,
|
|
186
|
+
compressed: compressed,
|
|
187
|
+
max: max,
|
|
188
|
+
min: min,
|
|
189
|
+
step: step,
|
|
190
|
+
showTicks: showTicks,
|
|
191
|
+
tickInterval: tickInterval,
|
|
192
|
+
ticks: ticks,
|
|
193
|
+
levels: levels,
|
|
194
|
+
onChange: handleOnChange,
|
|
195
|
+
value: value,
|
|
196
|
+
"aria-hidden": !!showInput,
|
|
197
|
+
showRange: showRange
|
|
198
|
+
}, (0, _react2.jsx)(_range_slider.EuiRangeSlider, _extends({
|
|
199
|
+
ariaValueText: ticks ? handleAriaValueText(ticks, value) : undefined,
|
|
200
|
+
id: showInput ? undefined : id,
|
|
201
|
+
name: name,
|
|
202
|
+
min: min,
|
|
203
|
+
max: max,
|
|
204
|
+
step: step,
|
|
205
|
+
value: value,
|
|
206
|
+
disabled: disabled,
|
|
207
|
+
onChange: handleOnChange,
|
|
208
|
+
showTicks: showTicks,
|
|
209
|
+
showRange: showRange,
|
|
210
|
+
tabIndex: showInput ? -1 : tabIndex,
|
|
211
|
+
onMouseDown: showInputOnly ? function () {
|
|
212
|
+
return preventPopoverClose.current = true;
|
|
213
|
+
} : undefined,
|
|
214
|
+
onFocus: showInput === true ? undefined : onFocus,
|
|
215
|
+
onBlur: showInputOnly ? onInputBlur : onBlur,
|
|
216
|
+
"aria-hidden": !!showInput,
|
|
217
|
+
thumbColor: thumbColor
|
|
218
|
+
}, rest, {
|
|
219
|
+
onResize: handleSetTrackWidth
|
|
220
|
+
})), showRange && isValid && (0, _react2.jsx)(_range_highlight.EuiRangeHighlight, {
|
|
221
|
+
showTicks: showTicks,
|
|
222
|
+
min: Number(min),
|
|
223
|
+
max: Number(max),
|
|
224
|
+
lowerValue: Number(min),
|
|
225
|
+
upperValue: Number(value),
|
|
226
|
+
levels: levels,
|
|
227
|
+
trackWidth: trackWidth
|
|
228
|
+
}), showValue && !!String(value).length && (0, _react2.jsx)(_range_tooltip.EuiRangeTooltip, {
|
|
229
|
+
value: value,
|
|
230
|
+
max: max,
|
|
231
|
+
min: min,
|
|
232
|
+
name: name,
|
|
233
|
+
showTicks: showTicks,
|
|
234
|
+
valuePrepend: valuePrepend,
|
|
235
|
+
valueAppend: valueAppend
|
|
236
|
+
})), showLabels && (0, _react2.jsx)(_range_label.EuiRangeLabel, {
|
|
237
|
+
side: "max",
|
|
238
|
+
disabled: disabled
|
|
239
|
+
}, max), showInput && !showInputOnly && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", {
|
|
240
|
+
className: showTicks || ticks ? 'euiRange__slimHorizontalSpacer' : 'euiRange__horizontalSpacer',
|
|
241
|
+
css: showTicks || ticks ? styles.euiRange__slimHorizontalSpacer : styles.euiRange__horizontalSpacer
|
|
242
|
+
}), input));
|
|
243
|
+
var popover = showInputOnly && input ? (0, _react2.jsx)(_popover.EuiInputPopover, _extends({}, inputPopoverProps, {
|
|
244
|
+
className: (0, _classnames.default)('euiRange__popover', inputPopoverProps === null || inputPopoverProps === void 0 ? void 0 : inputPopoverProps.className),
|
|
245
|
+
input: input,
|
|
246
|
+
fullWidth: fullWidth,
|
|
247
|
+
isOpen: isPopoverOpen,
|
|
248
|
+
closePopover: closePopover,
|
|
249
|
+
disableFocusTrap: true,
|
|
250
|
+
popoverScreenReaderText: sliderScreenReaderInstructions
|
|
251
|
+
}), range) : undefined;
|
|
252
|
+
return popover !== null && popover !== void 0 ? popover : range;
|
|
253
|
+
};
|
|
254
|
+
EuiRange.propTypes = {
|
|
293
255
|
/**
|
|
294
256
|
* Shows a tooltip styled value
|
|
295
257
|
*/
|
|
@@ -405,4 +367,4 @@ EuiRangeClass.propTypes = {
|
|
|
405
367
|
*/
|
|
406
368
|
inputPopoverProps: _propTypes.default.any
|
|
407
369
|
};
|
|
408
|
-
|
|
370
|
+
EuiRange.displayName = 'EuiRange';
|
|
@@ -13,7 +13,7 @@ var _form_control_layout = require("../form_control_layout");
|
|
|
13
13
|
var _eui_form_context = require("../eui_form_context");
|
|
14
14
|
var _super_select = require("./super_select.styles");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["buttonRef", "className", "options", "id", "name", "fullWidth", "isLoading", "isInvalid", "isDropdownOpen", "readOnly", "defaultValue", "compressed", "value", "placeholder", "prepend", "append", "disabled"];
|
|
16
|
+
var _excluded = ["buttonRef", "className", "options", "id", "name", "fullWidth", "isLoading", "isInvalid", "isDropdownOpen", "readOnly", "defaultValue", "compressed", "value", "placeholder", "prepend", "append", "disabled", "aria-label", "aria-labelledby"];
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -57,6 +57,8 @@ var EuiSuperSelectControl = exports.EuiSuperSelectControl = function EuiSuperSel
|
|
|
57
57
|
prepend = props.prepend,
|
|
58
58
|
append = props.append,
|
|
59
59
|
disabled = props.disabled,
|
|
60
|
+
ariaLabel = props['aria-label'],
|
|
61
|
+
ariaLabelledByProp = props['aria-labelledby'],
|
|
60
62
|
rest = _objectWithoutProperties(props, _excluded);
|
|
61
63
|
var classes = (0, _classnames.default)('euiSuperSelectControl', {
|
|
62
64
|
'euiSuperSelectControl-isLoading': isLoading,
|
|
@@ -91,15 +93,32 @@ var EuiSuperSelectControl = exports.EuiSuperSelectControl = function EuiSuperSel
|
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
95
|
}, [id]);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
|
|
97
|
+
// `aria-label`s are rendered as a separate screen reader only element instead
|
|
98
|
+
// of being set on the <button>, so that the label can be combined with (rather
|
|
99
|
+
// than override) the currently selected value, which is the button's content
|
|
100
|
+
var ariaLabelId = (0, _services.useGeneratedHtmlId)({
|
|
101
|
+
suffix: 'label'
|
|
102
|
+
});
|
|
103
|
+
var generatedButtonId = (0, _services.useGeneratedHtmlId)({
|
|
104
|
+
suffix: 'button'
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// Consumer-passed labels take precedence over the label rendered by EuiFormRow
|
|
108
|
+
var externalLabelId = ariaLabelledByProp || (ariaLabel ? ariaLabelId : hasFormLabel ? formLabelId : undefined);
|
|
109
|
+
var buttonId = externalLabelId ? hasFormLabel ? "".concat(id, "-button") : generatedButtonId : undefined;
|
|
110
|
+
// Self-reference the button so that its content (the selected value) remains
|
|
111
|
+
// part of the accessible name alongside the external label
|
|
112
|
+
var ariaLabelledBy = externalLabelId ? "".concat(buttonId, " ").concat(externalLabelId) : undefined;
|
|
96
113
|
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("input", {
|
|
97
114
|
type: "hidden",
|
|
98
115
|
id: id,
|
|
99
116
|
name: name,
|
|
100
117
|
value: String(inputValue !== null && inputValue !== void 0 ? inputValue : ''),
|
|
101
118
|
readOnly: readOnly
|
|
102
|
-
}), (0, _react2.jsx)(
|
|
119
|
+
}), ariaLabel && !ariaLabelledByProp && (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", {
|
|
120
|
+
id: ariaLabelId
|
|
121
|
+
}, ariaLabel)), (0, _react2.jsx)(_form_control_layout.EuiFormControlLayout, {
|
|
103
122
|
isDropdown: true,
|
|
104
123
|
fullWidth: fullWidth,
|
|
105
124
|
isLoading: isLoading,
|
|
@@ -122,8 +141,5 @@ var EuiSuperSelectControl = exports.EuiSuperSelectControl = function EuiSuperSel
|
|
|
122
141
|
}), showPlaceholder ? (0, _react2.jsx)("span", {
|
|
123
142
|
className: "euiSuperSelectControl__placeholder",
|
|
124
143
|
css: styles.euiSuperSelect__placeholder
|
|
125
|
-
}, placeholder) : selectedValue
|
|
126
|
-
// Add a slight pause between reading out the multiple aria-labelledby elements,
|
|
127
|
-
// mimicking how screen readers handle native <select> elements
|
|
128
|
-
(0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, ", ")))));
|
|
144
|
+
}, placeholder) : selectedValue)));
|
|
129
145
|
};
|