@elastic/eui 119.0.0 → 119.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 +93 -90
- package/dist/svgs/cursor_default.svg +3 -0
- package/dist/svgs/log_in.svg +4 -0
- package/dist/svgs/route_split.svg +3 -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.js +4 -2
- 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_group/button_group.js +87 -9
- package/es/components/button/button_group/button_group.styles.js +48 -9
- package/es/components/button/button_icon/button_icon.js +5 -3
- package/es/components/button/split_button/split_button.js +39 -16
- package/es/components/button/split_button/split_button.styles.js +28 -32
- package/es/components/button/split_button/split_button_actions.js +16 -5
- package/es/components/button/use_button_common_props.js +6 -2
- package/es/components/call_out/call_out.js +2 -2
- 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/column_actions.js +3 -1
- 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_menu/flyout_menu.js +39 -14
- 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/file_picker/file_picker.js +187 -224
- package/es/components/form/file_picker/file_picker.styles.js +1 -1
- 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/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_logo/header_logo.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/icon/assets/cursor_default.js +35 -0
- package/es/components/icon/assets/log_in.js +35 -0
- package/es/components/icon/assets/route_split.js +33 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +15 -0
- package/es/components/icon/svgs/cursor_default.svg +3 -0
- package/es/components/icon/svgs/log_in.svg +4 -0
- package/es/components/icon/svgs/route_split.svg +3 -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/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_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -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/es/global_styling/mixins/_button.js +6 -0
- package/es/services/accessibility/html_id_generator.js +26 -1
- package/eui.d.ts +241 -329
- package/i18ntokens.json +2678 -2660
- 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.js +4 -2
- 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_group/button_group.js +86 -10
- package/lib/components/button/button_group/button_group.styles.js +47 -8
- package/lib/components/button/button_icon/button_icon.js +5 -3
- package/lib/components/button/split_button/split_button.js +37 -15
- package/lib/components/button/split_button/split_button.styles.js +29 -31
- package/lib/components/button/split_button/split_button_actions.js +15 -4
- package/lib/components/button/use_button_common_props.js +6 -2
- package/lib/components/call_out/call_out.js +2 -2
- 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/column_actions.js +3 -1
- 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_menu/flyout_menu.js +39 -14
- 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/file_picker/file_picker.js +193 -227
- package/lib/components/form/file_picker/file_picker.styles.js +1 -1
- 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/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_logo/header_logo.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/icon/assets/cursor_default.js +42 -0
- package/lib/components/icon/assets/log_in.js +42 -0
- package/lib/components/icon/assets/route_split.js +40 -0
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +21 -0
- package/lib/components/icon/svgs/cursor_default.svg +3 -0
- package/lib/components/icon/svgs/log_in.svg +4 -0
- package/lib/components/icon/svgs/route_split.svg +3 -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/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_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -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/lib/global_styling/mixins/_button.js +6 -0
- package/lib/services/accessibility/html_id_generator.js +26 -1
- package/optimize/es/components/button/button.js +4 -2
- package/optimize/es/components/button/button_group/button_group.js +55 -8
- package/optimize/es/components/button/button_group/button_group.styles.js +48 -9
- package/optimize/es/components/button/button_icon/button_icon.js +4 -2
- package/optimize/es/components/button/split_button/split_button.js +36 -16
- package/optimize/es/components/button/split_button/split_button.styles.js +28 -32
- package/optimize/es/components/button/split_button/split_button_actions.js +16 -5
- package/optimize/es/components/button/use_button_common_props.js +6 -2
- package/optimize/es/components/datagrid/body/header/column_actions.js +3 -1
- package/optimize/es/components/flyout/flyout_menu/flyout_menu.js +32 -9
- package/optimize/es/components/form/file_picker/file_picker.js +182 -216
- package/optimize/es/components/form/file_picker/file_picker.styles.js +1 -1
- package/optimize/es/components/icon/assets/cursor_default.js +34 -0
- package/optimize/es/components/icon/assets/log_in.js +34 -0
- package/optimize/es/components/icon/assets/route_split.js +32 -0
- package/optimize/es/components/icon/icon_map.js +15 -0
- package/optimize/es/components/icon/svgs/cursor_default.svg +3 -0
- package/optimize/es/components/icon/svgs/log_in.svg +4 -0
- package/optimize/es/components/icon/svgs/route_split.svg +3 -0
- package/optimize/es/global_styling/mixins/_button.js +6 -0
- package/optimize/es/services/accessibility/html_id_generator.js +26 -1
- package/optimize/lib/components/button/button.js +4 -2
- package/optimize/lib/components/button/button_group/button_group.js +55 -9
- package/optimize/lib/components/button/button_group/button_group.styles.js +47 -8
- package/optimize/lib/components/button/button_icon/button_icon.js +4 -2
- package/optimize/lib/components/button/split_button/split_button.js +35 -15
- package/optimize/lib/components/button/split_button/split_button.styles.js +29 -31
- package/optimize/lib/components/button/split_button/split_button_actions.js +15 -4
- package/optimize/lib/components/button/use_button_common_props.js +6 -2
- package/optimize/lib/components/datagrid/body/header/column_actions.js +3 -1
- package/optimize/lib/components/flyout/flyout_menu/flyout_menu.js +32 -9
- package/optimize/lib/components/form/file_picker/file_picker.js +183 -215
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +1 -1
- package/optimize/lib/components/icon/assets/cursor_default.js +42 -0
- package/optimize/lib/components/icon/assets/log_in.js +42 -0
- package/optimize/lib/components/icon/assets/route_split.js +40 -0
- package/optimize/lib/components/icon/icon_map.js +21 -0
- package/optimize/lib/components/icon/svgs/cursor_default.svg +3 -0
- package/optimize/lib/components/icon/svgs/log_in.svg +4 -0
- package/optimize/lib/components/icon/svgs/route_split.svg +3 -0
- package/optimize/lib/global_styling/mixins/_button.js +6 -0
- package/optimize/lib/services/accessibility/html_id_generator.js +26 -1
- package/package.json +11 -17
- 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.js +4 -2
- 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_group/button_group.js +84 -10
- package/test-env/components/button/button_group/button_group.styles.js +47 -8
- package/test-env/components/button/button_icon/button_icon.js +5 -3
- package/test-env/components/button/split_button/split_button.js +35 -15
- package/test-env/components/button/split_button/split_button.styles.js +29 -31
- package/test-env/components/button/split_button/split_button_actions.js +15 -4
- package/test-env/components/button/use_button_common_props.js +6 -2
- package/test-env/components/call_out/call_out.js +2 -2
- 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/column_actions.js +3 -1
- 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_menu/flyout_menu.js +39 -14
- 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/file_picker/file_picker.js +184 -216
- package/test-env/components/form/file_picker/file_picker.styles.js +1 -1
- 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/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_logo/header_logo.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/icon/assets/cursor_default.js +42 -0
- package/test-env/components/icon/assets/log_in.js +42 -0
- package/test-env/components/icon/assets/route_split.js +40 -0
- package/test-env/components/icon/icon_map.js +21 -0
- 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/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_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -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
- package/test-env/global_styling/mixins/_button.js +6 -0
- package/test-env/services/accessibility/html_id_generator.js +11 -0
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["stylesMemoizer", "id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display", "files"];
|
|
11
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
5
|
+
var _excluded = ["id", "name", "initialPromptText", "className", "disabled", "compressed", "onChange", "isInvalid", "fullWidth", "isLoading", "display", "files"];
|
|
13
6
|
/*
|
|
14
7
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
8
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -18,227 +11,200 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
18
11
|
* Side Public License, v 1.
|
|
19
12
|
*/
|
|
20
13
|
|
|
21
|
-
import React, {
|
|
14
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
22
15
|
import classNames from 'classnames';
|
|
23
|
-
import {
|
|
16
|
+
import { useEuiMemoizedStyles, useGeneratedHtmlId } from '../../../services';
|
|
24
17
|
import { EuiButtonEmpty } from '../../button';
|
|
25
18
|
import { EuiProgress } from '../../progress';
|
|
26
19
|
import { EuiIcon } from '../../icon';
|
|
27
|
-
import { EuiI18n } from '../../i18n';
|
|
20
|
+
import { EuiI18n, useEuiI18n } from '../../i18n';
|
|
28
21
|
import { EuiLoadingSpinner } from '../../loading';
|
|
29
|
-
import {
|
|
22
|
+
import { useFormContext } from '../eui_form_context';
|
|
30
23
|
import { EuiValidatableControl } from '../validatable_control';
|
|
31
24
|
import { EuiFormControlLayoutClearButton } from '../form_control_layout/form_control_layout_clear_button';
|
|
32
25
|
import { euiFilePickerStyles } from './file_picker.styles';
|
|
33
26
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_defineProperty(_this, "getPromptTextFromFileList", function (files) {
|
|
45
|
-
if (!files || files.length === 0) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
if (files.length > 1) {
|
|
49
|
-
return ___EmotionJSX(EuiI18n, {
|
|
50
|
-
token: "euiFilePicker.filesSelected",
|
|
51
|
-
default: "{fileCount} files selected",
|
|
52
|
-
values: {
|
|
53
|
-
fileCount: files.length
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return files[0].name;
|
|
58
|
-
});
|
|
59
|
-
_defineProperty(_this, "state", {
|
|
60
|
-
promptText: _this.props.files ? _this.getPromptTextFromFileList(_this.props.files) : null,
|
|
61
|
-
isHoveringDrop: false
|
|
62
|
-
});
|
|
63
|
-
_defineProperty(_this, "handleChange", function () {
|
|
64
|
-
if (!_this.fileInput) return;
|
|
65
|
-
if (_this.fileInput.files && _this.fileInput.files.length === 1) {
|
|
66
|
-
_this.setState({
|
|
67
|
-
promptText: _this.fileInput.value.split('\\').pop()
|
|
68
|
-
});
|
|
69
|
-
} else {
|
|
70
|
-
_this.setState({
|
|
71
|
-
promptText: _this.getPromptTextFromFileList(_this.fileInput.files ? Array.from(_this.fileInput.files) : null)
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
var onChange = _this.props.onChange;
|
|
75
|
-
if (onChange) {
|
|
76
|
-
onChange(_this.fileInput.files && _this.fileInput.files.length > 0 ? _this.fileInput.files : null);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
_defineProperty(_this, "removeFiles", function (e) {
|
|
80
|
-
if (e) {
|
|
81
|
-
e.stopPropagation();
|
|
82
|
-
e.preventDefault();
|
|
83
|
-
}
|
|
84
|
-
if (!_this.fileInput) return;
|
|
85
|
-
_this.fileInput.value = '';
|
|
86
|
-
_this.handleChange();
|
|
87
|
-
});
|
|
88
|
-
_defineProperty(_this, "showDrop", function () {
|
|
89
|
-
if (!_this.props.disabled) {
|
|
90
|
-
_this.setState({
|
|
91
|
-
isHoveringDrop: true
|
|
92
|
-
});
|
|
27
|
+
var getPromptTextFromFileList = function getPromptTextFromFileList(files) {
|
|
28
|
+
if (!files || files.length === 0) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if (files.length > 1) {
|
|
32
|
+
return ___EmotionJSX(EuiI18n, {
|
|
33
|
+
token: "euiFilePicker.filesSelected",
|
|
34
|
+
default: "{fileCount} files selected",
|
|
35
|
+
values: {
|
|
36
|
+
fileCount: files.length
|
|
93
37
|
}
|
|
94
38
|
});
|
|
95
|
-
_defineProperty(_this, "hideDrop", function () {
|
|
96
|
-
_this.setState({
|
|
97
|
-
isHoveringDrop: false
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
return _this;
|
|
101
39
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
key: "componentDidUpdate",
|
|
105
|
-
value: function componentDidUpdate(prevProps) {
|
|
106
|
-
// Update prompt text when files prop changes
|
|
107
|
-
if (this.props.files !== prevProps.files) {
|
|
108
|
-
var _this$props$files;
|
|
109
|
-
this.setState({
|
|
110
|
-
promptText: this.getPromptTextFromFileList((_this$props$files = this.props.files) !== null && _this$props$files !== void 0 ? _this$props$files : null)
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
key: "render",
|
|
116
|
-
value: function render() {
|
|
117
|
-
var _this2 = this;
|
|
118
|
-
var _ref = this.context,
|
|
119
|
-
defaultFullWidth = _ref.defaultFullWidth;
|
|
120
|
-
return ___EmotionJSX(EuiI18n, {
|
|
121
|
-
token: "euiFilePicker.removeSelectedAriaLabel",
|
|
122
|
-
default: "Remove selected files"
|
|
123
|
-
}, function (removeSelectedAriaLabel) {
|
|
124
|
-
var _this2$props = _this2.props,
|
|
125
|
-
stylesMemoizer = _this2$props.stylesMemoizer,
|
|
126
|
-
id = _this2$props.id,
|
|
127
|
-
name = _this2$props.name,
|
|
128
|
-
initialPromptText = _this2$props.initialPromptText,
|
|
129
|
-
className = _this2$props.className,
|
|
130
|
-
disabled = _this2$props.disabled,
|
|
131
|
-
compressed = _this2$props.compressed,
|
|
132
|
-
onChange = _this2$props.onChange,
|
|
133
|
-
isInvalid = _this2$props.isInvalid,
|
|
134
|
-
_this2$props$fullWidt = _this2$props.fullWidth,
|
|
135
|
-
fullWidth = _this2$props$fullWidt === void 0 ? defaultFullWidth : _this2$props$fullWidt,
|
|
136
|
-
isLoading = _this2$props.isLoading,
|
|
137
|
-
display = _this2$props.display,
|
|
138
|
-
files = _this2$props.files,
|
|
139
|
-
rest = _objectWithoutProperties(_this2$props, _excluded);
|
|
140
|
-
var promptId = "".concat(id || _this2.generatedId, "-filePicker__prompt");
|
|
141
|
-
var isOverridingInitialPrompt = _this2.state.promptText != null;
|
|
142
|
-
var normalFormControl = display === 'default';
|
|
143
|
-
var classes = classNames('euiFilePicker', {
|
|
144
|
-
'euiFilePicker-isDroppingFile': _this2.state.isHoveringDrop,
|
|
145
|
-
'euiFilePicker-isInvalid': isInvalid,
|
|
146
|
-
'euiFilePicker-isLoading': isLoading,
|
|
147
|
-
'euiFilePicker-hasFiles': isOverridingInitialPrompt
|
|
148
|
-
}, className);
|
|
149
|
-
var styles = stylesMemoizer(euiFilePickerStyles);
|
|
150
|
-
var cssStyles = [styles.euiFilePicker, fullWidth ? styles.fullWidth : styles.formWidth, _this2.state.isHoveringDrop && styles.isDroppingFile, isInvalid && !disabled && styles.invalid, isOverridingInitialPrompt && !disabled && styles.hasFiles, isLoading && styles.loading];
|
|
151
|
-
var inputStyles = [styles.input.euiFilePicker__input, !normalFormControl && !disabled && styles.input.largeInteractive];
|
|
152
|
-
var promptStyles = [styles.euiFilePicker__prompt, disabled && styles.disabled].concat(_toConsumableArray(normalFormControl ? [compressed ? styles.compressed : styles.uncompressed] : [styles.large.large, compressed ? styles.large.compressed : styles.large.uncompressed]));
|
|
153
|
-
var iconStyles = [styles.icon.euiFilePicker__icon].concat(_toConsumableArray(normalFormControl ? [styles.icon.normal, compressed ? styles.icon.compresssed : styles.icon.uncompressed] : [styles.icon.large]));
|
|
154
|
-
var rightIconStyles = normalFormControl ? [styles.rightIcon.euiFilePicker__rightIcon, compressed ? styles.rightIcon.compressed : styles.rightIcon.uncompressed] : undefined;
|
|
155
|
-
var clearButton;
|
|
156
|
-
if (isLoading && normalFormControl) {
|
|
157
|
-
// Override clear button with loading spinner if it is in loading state
|
|
158
|
-
clearButton = ___EmotionJSX(EuiLoadingSpinner, {
|
|
159
|
-
css: rightIconStyles,
|
|
160
|
-
className: "euiFilePicker__loadingSpinner",
|
|
161
|
-
size: compressed ? 's' : 'm'
|
|
162
|
-
});
|
|
163
|
-
} else if (isOverridingInitialPrompt && !disabled) {
|
|
164
|
-
if (normalFormControl) {
|
|
165
|
-
clearButton = ___EmotionJSX(EuiFormControlLayoutClearButton, {
|
|
166
|
-
"aria-label": removeSelectedAriaLabel,
|
|
167
|
-
css: [styles.euiFilePicker__clearButton, rightIconStyles, ";label:clearButton;"],
|
|
168
|
-
className: "euiFilePicker__clearButton",
|
|
169
|
-
onClick: _this2.removeFiles,
|
|
170
|
-
size: compressed ? 's' : 'm'
|
|
171
|
-
});
|
|
172
|
-
} else {
|
|
173
|
-
clearButton = ___EmotionJSX(EuiButtonEmpty, {
|
|
174
|
-
"aria-label": removeSelectedAriaLabel,
|
|
175
|
-
css: styles.euiFilePicker__clearButton,
|
|
176
|
-
className: "euiFilePicker__clearButton",
|
|
177
|
-
size: "xs",
|
|
178
|
-
onClick: _this2.removeFiles
|
|
179
|
-
}, ___EmotionJSX(EuiI18n, {
|
|
180
|
-
token: "euiFilePicker.removeSelected",
|
|
181
|
-
default: "Remove"
|
|
182
|
-
}));
|
|
183
|
-
}
|
|
184
|
-
} else {
|
|
185
|
-
clearButton = null;
|
|
186
|
-
}
|
|
187
|
-
var loader = !normalFormControl && isLoading && ___EmotionJSX(EuiProgress, {
|
|
188
|
-
size: "xs",
|
|
189
|
-
color: "accent",
|
|
190
|
-
position: "absolute"
|
|
191
|
-
});
|
|
192
|
-
var iconColor = isInvalid ? 'danger' : disabled ? 'disabled' : 'text';
|
|
193
|
-
return ___EmotionJSX("div", {
|
|
194
|
-
css: cssStyles,
|
|
195
|
-
className: classes
|
|
196
|
-
}, ___EmotionJSX(EuiValidatableControl, {
|
|
197
|
-
isInvalid: isInvalid
|
|
198
|
-
}, ___EmotionJSX("input", _extends({
|
|
199
|
-
type: "file",
|
|
200
|
-
id: id,
|
|
201
|
-
name: name,
|
|
202
|
-
css: inputStyles,
|
|
203
|
-
className: "euiFilePicker__input",
|
|
204
|
-
onChange: _this2.handleChange,
|
|
205
|
-
ref: function ref(input) {
|
|
206
|
-
_this2.fileInput = input;
|
|
207
|
-
},
|
|
208
|
-
onDragOver: _this2.showDrop,
|
|
209
|
-
onDragLeave: _this2.hideDrop,
|
|
210
|
-
onDrop: _this2.hideDrop,
|
|
211
|
-
disabled: disabled,
|
|
212
|
-
"aria-describedby": promptId
|
|
213
|
-
}, rest))), ___EmotionJSX("div", {
|
|
214
|
-
css: promptStyles,
|
|
215
|
-
className: "euiFilePicker__prompt",
|
|
216
|
-
id: promptId
|
|
217
|
-
}, ___EmotionJSX(EuiIcon, {
|
|
218
|
-
css: iconStyles,
|
|
219
|
-
className: "euiFilePicker__icon",
|
|
220
|
-
color: iconColor,
|
|
221
|
-
type: isInvalid ? 'warning' : disabled ? 'minusCircle' : 'upload',
|
|
222
|
-
size: normalFormControl ? 'm' : 'l',
|
|
223
|
-
"aria-hidden": "true"
|
|
224
|
-
}), ___EmotionJSX("span", {
|
|
225
|
-
className: "euiFilePicker__promptText"
|
|
226
|
-
}, _this2.state.promptText || initialPromptText), clearButton, loader));
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}]);
|
|
230
|
-
}(Component);
|
|
40
|
+
return files[0].name;
|
|
41
|
+
};
|
|
231
42
|
|
|
232
43
|
/**
|
|
233
44
|
* @see {@link https://eui.elastic.co/docs/components/forms/other/file-picker/|EuiFilePicker documentation}
|
|
234
45
|
*/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
46
|
+
export var EuiFilePicker = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
47
|
+
var _useFormContext = useFormContext(),
|
|
48
|
+
defaultFullWidth = _useFormContext.defaultFullWidth;
|
|
49
|
+
var id = props.id,
|
|
50
|
+
name = props.name,
|
|
51
|
+
_props$initialPromptT = props.initialPromptText,
|
|
52
|
+
initialPromptText = _props$initialPromptT === void 0 ? ___EmotionJSX(EuiI18n, {
|
|
53
|
+
token: "euiFilePicker.promptText",
|
|
54
|
+
default: "Select or drag and drop a file"
|
|
55
|
+
}) : _props$initialPromptT,
|
|
56
|
+
className = props.className,
|
|
57
|
+
disabled = props.disabled,
|
|
58
|
+
_props$compressed = props.compressed,
|
|
59
|
+
compressed = _props$compressed === void 0 ? false : _props$compressed,
|
|
60
|
+
onChange = props.onChange,
|
|
61
|
+
isInvalid = props.isInvalid,
|
|
62
|
+
_props$fullWidth = props.fullWidth,
|
|
63
|
+
fullWidth = _props$fullWidth === void 0 ? defaultFullWidth : _props$fullWidth,
|
|
64
|
+
isLoading = props.isLoading,
|
|
65
|
+
_props$display = props.display,
|
|
66
|
+
display = _props$display === void 0 ? 'large' : _props$display,
|
|
67
|
+
files = props.files,
|
|
68
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
69
|
+
var removeSelectedAriaLabel = useEuiI18n('euiFilePicker.removeSelectedAriaLabel', 'Remove selected files');
|
|
70
|
+
var fileInput = useRef(null);
|
|
71
|
+
var _useState = useState(function () {
|
|
72
|
+
return files ? getPromptTextFromFileList(files) : null;
|
|
73
|
+
}),
|
|
74
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
75
|
+
promptText = _useState2[0],
|
|
76
|
+
setPromptText = _useState2[1];
|
|
77
|
+
var _useState3 = useState(false),
|
|
78
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
79
|
+
isHoveringDrop = _useState4[0],
|
|
80
|
+
setIsHoveringDrop = _useState4[1];
|
|
81
|
+
|
|
82
|
+
// Update prompt text when the `files` prop changes. The ref guard keeps this
|
|
83
|
+
// from re-running on mount, where the initial state is already derived above.
|
|
84
|
+
var prevFiles = useRef(files);
|
|
85
|
+
useEffect(function () {
|
|
86
|
+
if (prevFiles.current !== files) {
|
|
87
|
+
prevFiles.current = files;
|
|
88
|
+
setPromptText(getPromptTextFromFileList(files !== null && files !== void 0 ? files : null));
|
|
89
|
+
}
|
|
90
|
+
}, [files]);
|
|
91
|
+
var handleChange = useCallback(function () {
|
|
92
|
+
if (!fileInput.current) return;
|
|
93
|
+
if (fileInput.current.files && fileInput.current.files.length === 1) {
|
|
94
|
+
setPromptText(fileInput.current.value.split('\\').pop());
|
|
95
|
+
} else {
|
|
96
|
+
setPromptText(getPromptTextFromFileList(fileInput.current.files ? Array.from(fileInput.current.files) : null));
|
|
97
|
+
}
|
|
98
|
+
if (onChange) {
|
|
99
|
+
onChange(fileInput.current.files && fileInput.current.files.length > 0 ? fileInput.current.files : null);
|
|
100
|
+
}
|
|
101
|
+
}, [onChange]);
|
|
102
|
+
var removeFiles = useCallback(function (e) {
|
|
103
|
+
if (e) {
|
|
104
|
+
e.stopPropagation();
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
}
|
|
107
|
+
if (!fileInput.current) return;
|
|
108
|
+
fileInput.current.value = '';
|
|
109
|
+
handleChange();
|
|
110
|
+
}, [handleChange]);
|
|
111
|
+
useImperativeHandle(ref, function () {
|
|
112
|
+
return {
|
|
113
|
+
removeFiles: removeFiles,
|
|
114
|
+
input: fileInput.current
|
|
115
|
+
};
|
|
116
|
+
}, [removeFiles]);
|
|
117
|
+
var showDrop = function showDrop() {
|
|
118
|
+
return !disabled && setIsHoveringDrop(true);
|
|
119
|
+
};
|
|
120
|
+
var hideDrop = function hideDrop() {
|
|
121
|
+
return setIsHoveringDrop(false);
|
|
122
|
+
};
|
|
123
|
+
var generatedId = useGeneratedHtmlId();
|
|
124
|
+
var promptId = "".concat(id || generatedId, "-filePicker__prompt");
|
|
125
|
+
var isOverridingInitialPrompt = promptText != null;
|
|
126
|
+
var normalFormControl = display === 'default';
|
|
127
|
+
var classes = classNames('euiFilePicker', {
|
|
128
|
+
'euiFilePicker-isDroppingFile': isHoveringDrop,
|
|
129
|
+
'euiFilePicker-isInvalid': isInvalid,
|
|
130
|
+
'euiFilePicker-isLoading': isLoading,
|
|
131
|
+
'euiFilePicker-hasFiles': isOverridingInitialPrompt
|
|
132
|
+
}, className);
|
|
133
|
+
var styles = useEuiMemoizedStyles(euiFilePickerStyles);
|
|
134
|
+
var cssStyles = [styles.euiFilePicker, fullWidth ? styles.fullWidth : styles.formWidth, isHoveringDrop && styles.isDroppingFile, isInvalid && !disabled && styles.invalid, isOverridingInitialPrompt && !disabled && styles.hasFiles, isLoading && styles.loading];
|
|
135
|
+
var inputStyles = [styles.input.euiFilePicker__input, !normalFormControl && !disabled && styles.input.largeInteractive];
|
|
136
|
+
var promptStyles = [styles.euiFilePicker__prompt, disabled && styles.disabled].concat(_toConsumableArray(normalFormControl ? [compressed ? styles.compressed : styles.uncompressed] : [styles.large.large, compressed ? styles.large.compressed : styles.large.uncompressed]));
|
|
137
|
+
var iconStyles = [styles.icon.euiFilePicker__icon].concat(_toConsumableArray(normalFormControl ? [styles.icon.normal, compressed ? styles.icon.compressed : styles.icon.uncompressed] : [styles.icon.large]));
|
|
138
|
+
var rightIconStyles = normalFormControl ? [styles.rightIcon.euiFilePicker__rightIcon, compressed ? styles.rightIcon.compressed : styles.rightIcon.uncompressed] : undefined;
|
|
139
|
+
var clearButton;
|
|
140
|
+
if (isLoading && normalFormControl) {
|
|
141
|
+
// Override clear button with loading spinner if it is in loading state
|
|
142
|
+
clearButton = ___EmotionJSX(EuiLoadingSpinner, {
|
|
143
|
+
css: rightIconStyles,
|
|
144
|
+
className: "euiFilePicker__loadingSpinner",
|
|
145
|
+
size: compressed ? 's' : 'm'
|
|
146
|
+
});
|
|
147
|
+
} else if (isOverridingInitialPrompt && !disabled) {
|
|
148
|
+
if (normalFormControl) {
|
|
149
|
+
clearButton = ___EmotionJSX(EuiFormControlLayoutClearButton, {
|
|
150
|
+
"aria-label": removeSelectedAriaLabel,
|
|
151
|
+
css: [styles.euiFilePicker__clearButton, rightIconStyles, ";label:clearButton;"],
|
|
152
|
+
className: "euiFilePicker__clearButton",
|
|
153
|
+
onClick: removeFiles,
|
|
154
|
+
size: compressed ? 's' : 'm'
|
|
155
|
+
});
|
|
156
|
+
} else {
|
|
157
|
+
clearButton = ___EmotionJSX(EuiButtonEmpty, {
|
|
158
|
+
"aria-label": removeSelectedAriaLabel,
|
|
159
|
+
css: styles.euiFilePicker__clearButton,
|
|
160
|
+
className: "euiFilePicker__clearButton",
|
|
161
|
+
size: "xs",
|
|
162
|
+
onClick: removeFiles
|
|
163
|
+
}, ___EmotionJSX(EuiI18n, {
|
|
164
|
+
token: "euiFilePicker.removeSelected",
|
|
165
|
+
default: "Remove"
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
168
|
+
} else {
|
|
169
|
+
clearButton = null;
|
|
170
|
+
}
|
|
171
|
+
var loader = !normalFormControl && isLoading && ___EmotionJSX(EuiProgress, {
|
|
172
|
+
size: "xs",
|
|
173
|
+
color: "accent",
|
|
174
|
+
position: "absolute"
|
|
175
|
+
});
|
|
176
|
+
var iconColor = isInvalid ? 'danger' : disabled ? 'disabled' : 'text';
|
|
177
|
+
return ___EmotionJSX("div", {
|
|
178
|
+
css: cssStyles,
|
|
179
|
+
className: classes
|
|
180
|
+
}, ___EmotionJSX(EuiValidatableControl, {
|
|
181
|
+
isInvalid: isInvalid
|
|
182
|
+
}, ___EmotionJSX("input", _extends({
|
|
183
|
+
type: "file",
|
|
184
|
+
id: id,
|
|
185
|
+
name: name,
|
|
186
|
+
css: inputStyles,
|
|
187
|
+
className: "euiFilePicker__input",
|
|
188
|
+
onChange: handleChange,
|
|
189
|
+
ref: fileInput,
|
|
190
|
+
onDragOver: showDrop,
|
|
191
|
+
onDragLeave: hideDrop,
|
|
192
|
+
onDrop: hideDrop,
|
|
193
|
+
disabled: disabled,
|
|
194
|
+
"aria-describedby": promptId
|
|
195
|
+
}, rest))), ___EmotionJSX("div", {
|
|
196
|
+
css: promptStyles,
|
|
197
|
+
className: "euiFilePicker__prompt",
|
|
198
|
+
id: promptId
|
|
199
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
200
|
+
css: iconStyles,
|
|
201
|
+
className: "euiFilePicker__icon",
|
|
202
|
+
color: iconColor,
|
|
203
|
+
type: isInvalid ? 'warning' : disabled ? 'minusCircle' : 'upload',
|
|
204
|
+
size: normalFormControl ? 'm' : 'l',
|
|
205
|
+
"aria-hidden": "true"
|
|
206
|
+
}), ___EmotionJSX("span", {
|
|
207
|
+
className: "euiFilePicker__promptText"
|
|
208
|
+
}, promptText || initialPromptText), clearButton, loader));
|
|
243
209
|
});
|
|
244
|
-
|
|
210
|
+
EuiFilePicker.displayName = 'EuiFilePicker';
|
|
@@ -82,7 +82,7 @@ export var euiFilePickerStyles = function euiFilePickerStyles(euiThemeContext) {
|
|
|
82
82
|
euiFilePicker__icon: /*#__PURE__*/css(";label:euiFilePicker__icon;"),
|
|
83
83
|
normal: /*#__PURE__*/css("position:absolute;", logicalCSS('top', 0), " ", logicalCSS('height', '100%'), ";;label:normal;"),
|
|
84
84
|
uncompressed: "\n ".concat(logicalCSS('left', euiTheme.size.m), "\n "),
|
|
85
|
-
|
|
85
|
+
compressed: /*#__PURE__*/css(logicalCSS('left', euiTheme.size.s), " ", logicalCSS('width', euiTheme.size.m), ";;label:compressed;"),
|
|
86
86
|
large: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.base), " ", euiCanAnimate, "{transition:transform ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";};label:large;")
|
|
87
87
|
},
|
|
88
88
|
rightIcon: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
+
var EuiIconCursorDefault = function EuiIconCursorDefault(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
titleId = _ref.titleId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return ___EmotionJSX("svg", _extends({
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
width: 16,
|
|
23
|
+
height: 16,
|
|
24
|
+
viewBox: "0 0 16 16",
|
|
25
|
+
"aria-labelledby": titleId
|
|
26
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
27
|
+
id: titleId
|
|
28
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
+
fillRule: "evenodd",
|
|
30
|
+
d: "M2.646 2.646a.5.5 0 0 1 .497-.125l10 3a.5.5 0 0 1 .134.895l-2.493 1.66 3.069 3.07a.5.5 0 0 1 0 .707l-2 2a.5.5 0 0 1-.707 0l-3.07-3.07-1.66 2.494a.5.5 0 0 1-.895-.134l-3-10a.5.5 0 0 1 .125-.497m3.526 9.192 1.411-2.116.072-.085a.503.503 0 0 1 .698.01l3.146 3.146 1.293-1.293-3.146-3.147a.5.5 0 0 1 .076-.77l2.115-1.41-8.093-2.428z",
|
|
31
|
+
clipRule: "evenodd"
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
export var icon = EuiIconCursorDefault;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
+
var EuiIconLogIn = function EuiIconLogIn(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
titleId = _ref.titleId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return ___EmotionJSX("svg", _extends({
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
width: 16,
|
|
23
|
+
height: 16,
|
|
24
|
+
viewBox: "0 0 16 16",
|
|
25
|
+
"aria-labelledby": titleId
|
|
26
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
27
|
+
id: titleId
|
|
28
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
+
d: "M13 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3v-1h10V3H3V2z"
|
|
30
|
+
}), ___EmotionJSX("path", {
|
|
31
|
+
d: "m11.707 8-3.353 3.354-.708-.707L9.793 8.5H2v-1h7.793L7.646 5.354l.708-.708z"
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
export var icon = EuiIconLogIn;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["title", "titleId"];
|
|
4
|
+
/*
|
|
5
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
7
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
8
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
9
|
+
* Side Public License, v 1.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
|
|
13
|
+
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
|
+
var EuiIconRouteSplit = function EuiIconRouteSplit(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
titleId = _ref.titleId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
return ___EmotionJSX("svg", _extends({
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
22
|
+
width: 16,
|
|
23
|
+
height: 16,
|
|
24
|
+
viewBox: "0 0 16 16",
|
|
25
|
+
"aria-labelledby": titleId
|
|
26
|
+
}, props), title ? ___EmotionJSX("title", {
|
|
27
|
+
id: titleId
|
|
28
|
+
}, title) : null, ___EmotionJSX("path", {
|
|
29
|
+
d: "M13 3a2 2 0 1 1 0 4 2 2 0 0 1-1.934-1.5H6.903C7.524 6.105 8 7.053 8 8.5c0 1.654.47 2.372.83 2.687.093.082.187.14.273.185a2 2 0 1 1-.056 1.053 2.3 2.3 0 0 1-.876-.487C7.53 11.378 7 10.346 7 8.5c0-1.574-.657-2.284-1.252-2.63a2.8 2.8 0 0 0-.828-.313A2 2 0 1 1 4.935 4.5h6.131A2 2 0 0 1 13 3m-2 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2M3 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2"
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
export var icon = EuiIconRouteSplit;
|
|
@@ -571,6 +571,11 @@ export var typeToPathMap = {
|
|
|
571
571
|
}, {
|
|
572
572
|
synonyms: ['crosshair']
|
|
573
573
|
}),
|
|
574
|
+
cursorDefault: withMetadata(function () {
|
|
575
|
+
return import('./assets/cursor_default');
|
|
576
|
+
}, {
|
|
577
|
+
synonyms: ['cursor', 'ui']
|
|
578
|
+
}),
|
|
574
579
|
money: withMetadata(function () {
|
|
575
580
|
return import('./assets/money');
|
|
576
581
|
}, {
|
|
@@ -806,6 +811,11 @@ export var typeToPathMap = {
|
|
|
806
811
|
esqlVis: function esqlVis() {
|
|
807
812
|
return import('./assets/esql_vis');
|
|
808
813
|
},
|
|
814
|
+
logIn: withMetadata(function () {
|
|
815
|
+
return import('./assets/log_in');
|
|
816
|
+
}, {
|
|
817
|
+
synonyms: ['entry', 'incoming']
|
|
818
|
+
}),
|
|
809
819
|
logOut: withMetadata(function () {
|
|
810
820
|
return import('./assets/log_out');
|
|
811
821
|
}, {
|
|
@@ -1916,6 +1926,11 @@ export var typeToPathMap = {
|
|
|
1916
1926
|
}, {
|
|
1917
1927
|
synonyms: ['return', 'enter', 'keyboard', 'submit', 'back', 'revert']
|
|
1918
1928
|
}),
|
|
1929
|
+
routeSplit: withMetadata(function () {
|
|
1930
|
+
return import('./assets/route_split');
|
|
1931
|
+
}, {
|
|
1932
|
+
synonyms: ['tree', 'parent']
|
|
1933
|
+
}),
|
|
1919
1934
|
save: withMetadata(function () {
|
|
1920
1935
|
return import('./assets/save');
|
|
1921
1936
|
}, {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path fill-rule="evenodd" d="M2.646 2.646a.5.5 0 0 1 .497-.125l10 3a.5.5 0 0 1 .134.895l-2.493 1.66 3.069 3.07a.5.5 0 0 1 0 .707l-2 2a.5.5 0 0 1-.707 0l-3.07-3.07-1.66 2.494a.5.5 0 0 1-.895-.134l-3-10a.5.5 0 0 1 .125-.497m3.526 9.192 1.411-2.116.072-.085a.503.503 0 0 1 .698.01l3.146 3.146 1.293-1.293-3.146-3.147a.5.5 0 0 1 .076-.77l2.115-1.41-8.093-2.428z" clip-rule="evenodd"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
|
2
|
+
<path d="M13 3a2 2 0 1 1 0 4 2 2 0 0 1-1.934-1.5H6.903C7.524 6.105 8 7.053 8 8.5c0 1.654.47 2.372.83 2.687.093.082.187.14.273.185a2 2 0 1 1-.056 1.053 2.3 2.3 0 0 1-.876-.487C7.53 11.378 7 10.346 7 8.5c0-1.574-.657-2.284-1.252-2.63a2.8 2.8 0 0 0-.828-.313A2 2 0 1 1 4.935 4.5h6.131A2 2 0 0 1 13 3m-2 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2M3 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/>
|
|
3
|
+
</svg>
|
|
@@ -198,6 +198,9 @@ var euiButtonFocusCSS = function euiButtonFocusCSS(_euiThemeContext) {
|
|
|
198
198
|
*/
|
|
199
199
|
export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
200
200
|
var euiTheme = euiThemeContext.euiTheme;
|
|
201
|
+
|
|
202
|
+
// TODO: replace with token once available
|
|
203
|
+
var radiusInset = '2px';
|
|
201
204
|
return {
|
|
202
205
|
xs: {
|
|
203
206
|
minWidth: euiTheme.base * 6,
|
|
@@ -206,6 +209,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
206
209
|
return x / 2;
|
|
207
210
|
}),
|
|
208
211
|
radius: euiTheme.border.radius.small,
|
|
212
|
+
radiusInset: radiusInset,
|
|
209
213
|
fontScale: 'xs'
|
|
210
214
|
},
|
|
211
215
|
s: {
|
|
@@ -213,6 +217,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
213
217
|
height: euiTheme.size.xl,
|
|
214
218
|
padding: euiTheme.size.s,
|
|
215
219
|
radius: euiTheme.border.radius.small,
|
|
220
|
+
radiusInset: radiusInset,
|
|
216
221
|
fontScale: 's'
|
|
217
222
|
},
|
|
218
223
|
m: {
|
|
@@ -220,6 +225,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
220
225
|
height: euiTheme.size.xxl,
|
|
221
226
|
padding: euiTheme.size.m,
|
|
222
227
|
radius: euiTheme.border.radius.small,
|
|
228
|
+
radiusInset: radiusInset,
|
|
223
229
|
fontScale: 's'
|
|
224
230
|
}
|
|
225
231
|
};
|