@elastic/eui 71.0.0 → 72.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -7
- package/dist/eui_theme_dark.css +7747 -5854
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +7737 -5844
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/datagrid/data_grid.a11y.js +251 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/es/components/date_picker/date_picker.a11y.js +83 -0
- package/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +160 -173
- package/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/es/components/delay_hide/delay_hide.a11y.js +106 -0
- package/es/components/delay_render/delay_render.a11y.js +106 -0
- package/es/components/empty_prompt/empty_prompt.a11y.js +63 -0
- package/es/components/error_boundary/error_boundary.a11y.js +67 -0
- package/es/components/error_boundary/error_boundary.js +45 -27
- package/es/components/expression/expression.a11y.js +254 -0
- package/es/components/filter_group/filter_group.a11y.js +281 -0
- package/es/components/focus_trap/focus_trap.a11y.js +131 -0
- package/es/components/form/file_picker/file_picker.js +1 -0
- package/es/components/header/header.a11y.js +374 -0
- package/es/components/icon/icon_ML.a11y.js +33 -0
- package/es/components/icon/icon_apps.a11y.js +33 -0
- package/es/components/icon/icon_editor.a11y.js +33 -0
- package/es/components/icon/icon_elastic.a11y.js +33 -0
- package/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/es/components/icon/icon_tokens.a11y.js +33 -0
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/es/components/page/page_side_bar/page_side_bar.js +3 -0
- package/es/components/page/page_template.js +1 -15
- package/es/components/selectable/selectable.js +4 -3
- package/es/components/selectable/selectable_list/selectable_list.js +17 -5
- package/es/components/tabs/tab.js +7 -17
- package/es/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/es/components/tabs/tabs.js +7 -11
- package/es/components/tabs/tabs_context.js +13 -0
- package/eui.d.ts +60 -43
- package/i18ntokens.json +34 -18
- package/lib/components/datagrid/data_grid.a11y.js +255 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/lib/components/date_picker/date_picker.a11y.js +89 -0
- package/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +155 -168
- package/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/lib/components/delay_hide/delay_hide.a11y.js +111 -0
- package/lib/components/delay_render/delay_render.a11y.js +111 -0
- package/lib/components/empty_prompt/empty_prompt.a11y.js +72 -0
- package/lib/components/error_boundary/error_boundary.a11y.js +75 -0
- package/lib/components/error_boundary/error_boundary.js +49 -29
- package/lib/components/expression/expression.a11y.js +262 -0
- package/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/lib/components/form/file_picker/file_picker.js +1 -0
- package/lib/components/header/header.a11y.js +385 -0
- package/lib/components/icon/icon_ML.a11y.js +40 -0
- package/lib/components/icon/icon_apps.a11y.js +40 -0
- package/lib/components/icon/icon_editor.a11y.js +40 -0
- package/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/lib/components/page/page_side_bar/page_side_bar.js +4 -0
- package/lib/components/page/page_template.js +1 -15
- package/lib/components/selectable/selectable.js +4 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +17 -5
- package/lib/components/tabs/tab.js +14 -17
- package/lib/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/lib/components/tabs/tabs.js +8 -14
- package/lib/components/tabs/tabs_context.js +23 -0
- package/optimize/es/components/datagrid/data_grid.a11y.js +234 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/es/components/date_picker/date_picker.a11y.js +73 -0
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +145 -169
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +2 -0
- package/optimize/es/components/delay_hide/delay_hide.a11y.js +96 -0
- package/optimize/es/components/delay_render/delay_render.a11y.js +96 -0
- package/optimize/es/components/empty_prompt/empty_prompt.a11y.js +63 -0
- package/optimize/es/components/error_boundary/error_boundary.a11y.js +67 -0
- package/optimize/es/components/error_boundary/error_boundary.js +37 -26
- package/optimize/es/components/expression/expression.a11y.js +243 -0
- package/optimize/es/components/filter_group/filter_group.a11y.js +271 -0
- package/optimize/es/components/focus_trap/focus_trap.a11y.js +120 -0
- package/optimize/es/components/form/file_picker/file_picker.js +1 -0
- package/optimize/es/components/header/header.a11y.js +364 -0
- package/optimize/es/components/icon/icon_ML.a11y.js +33 -0
- package/optimize/es/components/icon/icon_apps.a11y.js +33 -0
- package/optimize/es/components/icon/icon_editor.a11y.js +33 -0
- package/optimize/es/components/icon/icon_elastic.a11y.js +33 -0
- package/optimize/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/optimize/es/components/icon/icon_tokens.a11y.js +33 -0
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/optimize/es/components/page/page_side_bar/page_side_bar.js +3 -0
- package/optimize/es/components/selectable/selectable.js +2 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/es/components/tabs/tab.js +7 -5
- package/optimize/es/components/tabs/tabs.js +7 -11
- package/optimize/es/components/tabs/tabs_context.js +13 -0
- package/optimize/lib/components/datagrid/data_grid.a11y.js +248 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/lib/components/date_picker/date_picker.a11y.js +87 -0
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +146 -167
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -0
- package/optimize/lib/components/delay_hide/delay_hide.a11y.js +111 -0
- package/optimize/lib/components/delay_render/delay_render.a11y.js +111 -0
- package/optimize/lib/components/empty_prompt/empty_prompt.a11y.js +72 -0
- package/optimize/lib/components/error_boundary/error_boundary.a11y.js +75 -0
- package/optimize/lib/components/error_boundary/error_boundary.js +41 -28
- package/optimize/lib/components/expression/expression.a11y.js +254 -0
- package/optimize/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/optimize/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/optimize/lib/components/form/file_picker/file_picker.js +1 -0
- package/optimize/lib/components/header/header.a11y.js +385 -0
- package/optimize/lib/components/icon/icon_ML.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_apps.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_editor.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/optimize/lib/components/page/page_side_bar/page_side_bar.js +4 -0
- package/optimize/lib/components/selectable/selectable.js +2 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/lib/components/tabs/tab.js +15 -5
- package/optimize/lib/components/tabs/tabs.js +8 -14
- package/optimize/lib/components/tabs/tabs_context.js +23 -0
- package/package.json +14 -19
- package/src/components/basic_table/_basic_table.scss +1 -4
- package/src/components/button/button_empty/_button_empty.scss +2 -4
- package/src/components/button/button_group/_button_group.scss +1 -1
- package/src/components/button/button_group/_button_group_button.scss +3 -4
- package/src/components/button/button_icon/_button_icon.scss +0 -3
- package/src/components/collapsible_nav/_collapsible_nav.scss +1 -1
- package/src/components/collapsible_nav/collapsible_nav_group/_collapsible_nav_group.scss +1 -1
- package/src/components/color_picker/_color_picker.scss +3 -2
- package/src/components/color_picker/_hue.scss +7 -7
- package/src/components/color_picker/_saturation.scss +1 -1
- package/src/components/color_picker/color_palette_display/_mixins.scss +1 -1
- package/src/components/color_picker/color_stops/_color_stops.scss +2 -3
- package/src/components/combo_box/_combo_box.scss +7 -6
- package/src/components/combo_box/combo_box_input/_combo_box_input.scss +2 -1
- package/src/components/combo_box/combo_box_input/_combo_box_placeholder.scss +1 -1
- package/src/components/combo_box/combo_box_options_list/_combo_box_options_list.scss +2 -3
- package/src/components/control_bar/_variables.scss +0 -1
- package/src/components/datagrid/_data_grid_data_row.scss +4 -5
- package/src/components/datagrid/_mixins.scss +1 -1
- package/src/components/datagrid/body/_data_grid_footer_row.scss +2 -1
- package/src/components/datagrid/body/header/_data_grid_column_resizer.scss +3 -4
- package/src/components/datagrid/body/header/_data_grid_header_row.scss +1 -1
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +1 -2
- package/src/components/date_picker/_date_picker_range.scss +1 -1
- package/src/components/date_picker/super_date_picker/_super_date_picker.scss +1 -4
- package/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss +15 -1
- package/src/components/drag_and_drop/_draggable.scss +3 -5
- package/src/components/drag_and_drop/_droppable.scss +1 -1
- package/src/components/empty_prompt/_empty_prompt.scss +1 -1
- package/src/components/filter_group/_filter_group.scss +2 -2
- package/src/components/filter_group/_filter_select_item.scss +0 -1
- package/src/components/form/checkbox/_checkbox.scss +5 -3
- package/src/components/form/described_form_group/_described_form_group.scss +0 -1
- package/src/components/form/field_password/_field_password.scss +1 -1
- package/src/components/form/field_search/_field_search.scss +1 -1
- package/src/components/form/file_picker/_file_picker.scss +15 -16
- package/src/components/form/form_control_layout/_form_control_layout.scss +6 -7
- package/src/components/form/form_control_layout/_form_control_layout_delimited.scss +4 -6
- package/src/components/form/form_row/_form_row.scss +3 -0
- package/src/components/form/radio/_radio.scss +5 -3
- package/src/components/form/select/_select.scss +1 -1
- package/src/components/form/switch/_switch.scss +3 -1
- package/src/components/header/_mixins.scss +1 -1
- package/src/components/header/header_section/_header_section_item.scss +4 -4
- package/src/components/header/header_section/_header_section_item_button.scss +0 -1
- package/src/components/key_pad_menu/_key_pad_menu_item.scss +2 -7
- package/src/components/markdown_editor/_markdown_editor_drop_zone.scss +4 -4
- package/src/components/markdown_editor/_markdown_editor_footer.scss +1 -1
- package/src/components/markdown_editor/_markdown_editor_text_area.scss +2 -3
- package/src/components/markdown_editor/_markdown_format.scss +4 -2
- package/src/components/notification/_notification_event.scss +2 -2
- package/src/components/page/page_content/_page_content_body.scss +0 -1
- package/src/components/page/page_content/_page_content_header_section.scss +0 -1
- package/src/components/page/page_side_bar/_page_side_bar.scss +0 -1
- package/src/components/panel/split_panel/_split_panel.scss +2 -2
- package/src/components/resizable_container/_resizable_button.scss +31 -31
- package/src/components/resizable_container/_resizable_collapse_button.scss +9 -9
- package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +1 -1
- package/src/components/side_nav/_mixins.scss +1 -1
- package/src/components/side_nav/_side_nav.scss +2 -1
- package/src/components/side_nav/_side_nav_item.scss +2 -3
- package/src/components/steps/_steps.scss +2 -1
- package/src/components/suggest/_suggest_input.scss +1 -1
- package/src/components/suggest/_suggest_item.scss +4 -3
- package/src/components/table/_responsive.scss +5 -3
- package/src/components/table/_table.scss +2 -4
- package/src/components/table/mobile/_mobile.scss +0 -2
- package/src/components/tree_view/tree_view.scss +2 -2
- package/src/global_styling/mixins/_form.scss +7 -18
- package/src/global_styling/mixins/_header.scss +2 -2
- package/src/global_styling/mixins/_helpers.scss +1 -2
- package/src/global_styling/mixins/_icons.scss +1 -1
- package/src/global_styling/mixins/_range.scss +4 -8
- package/src/global_styling/mixins/_responsive.scss +3 -8
- package/src/global_styling/mixins/_shadow.scss +5 -9
- package/src/global_styling/mixins/_states.scss +2 -2
- package/src/global_styling/mixins/_typography.scss +16 -19
- package/src/global_styling/variables/_colors_vis.scss +1 -1
- package/src/global_styling/variables/_typography.scss +1 -3
- package/src/themes/amsterdam/_colors_dark.scss +2 -1
- package/src/themes/amsterdam/_colors_light.scss +2 -0
- package/src/themes/amsterdam/global_styling/mixins/_link.scss +1 -1
- package/src/themes/amsterdam/global_styling/mixins/_states.scss +0 -1
- package/src/themes/amsterdam/global_styling/mixins/_typography.scss +1 -2
- package/src/themes/amsterdam/global_styling/react_date_picker/_date_picker_days.scss +0 -1
- package/src/themes/amsterdam/global_styling/react_date_picker/_date_picker_month_year.scss +0 -1
- package/src/themes/amsterdam/global_styling/react_date_picker/_date_picker_times.scss +3 -4
- package/src/themes/amsterdam/global_styling/react_date_picker/_mixins.scss +0 -1
- package/src/themes/amsterdam/global_styling/variables/_typography.scss +1 -2
- package/src/themes/amsterdam/overrides/_color_stops.scss +4 -5
- package/src/themes/amsterdam/overrides/_combo_box.scss +3 -0
- package/src/themes/amsterdam/overrides/_form_control_layout.scss +3 -0
- package/src/themes/amsterdam/overrides/_form_control_layout_delimited.scss +5 -4
- package/src/themes/amsterdam/overrides/_header.scss +2 -2
- package/src/themes/amsterdam/overrides/_hue.scss +6 -6
- package/src/themes/amsterdam/overrides/_key_pad_menu.scss +2 -2
- package/src/themes/amsterdam/overrides/_steps.scss +1 -2
- package/src/themes/legacy/_colors_dark.scss +2 -1
- package/src/themes/legacy/_colors_light.scss +2 -0
- package/src/themes/legacy/reset/_reset.scss +8 -7
- package/test-env/components/datagrid/data_grid.a11y.js +248 -0
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/test-env/components/date_picker/date_picker.a11y.js +87 -0
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +153 -166
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/test-env/components/delay_hide/delay_hide.a11y.js +111 -0
- package/test-env/components/delay_render/delay_render.a11y.js +111 -0
- package/test-env/components/empty_prompt/empty_prompt.a11y.js +72 -0
- package/test-env/components/error_boundary/error_boundary.a11y.js +75 -0
- package/test-env/components/error_boundary/error_boundary.js +48 -28
- package/test-env/components/expression/expression.a11y.js +254 -0
- package/test-env/components/filter_group/filter_group.a11y.js +287 -0
- package/test-env/components/focus_trap/focus_trap.a11y.js +140 -0
- package/test-env/components/form/file_picker/file_picker.js +1 -0
- package/test-env/components/header/header.a11y.js +385 -0
- package/test-env/components/icon/icon_ML.a11y.js +40 -0
- package/test-env/components/icon/icon_apps.a11y.js +40 -0
- package/test-env/components/icon/icon_editor.a11y.js +40 -0
- package/test-env/components/icon/icon_elastic.a11y.js +40 -0
- package/test-env/components/icon/icon_glyphs.a11y.js +40 -0
- package/test-env/components/icon/icon_tokens.a11y.js +40 -0
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/test-env/components/page/page_side_bar/page_side_bar.js +4 -0
- package/test-env/components/page/page_template.js +1 -15
- package/test-env/components/selectable/selectable.js +4 -3
- package/test-env/components/selectable/selectable_list/selectable_list.js +17 -5
- package/test-env/components/tabs/tab.js +15 -17
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/test-env/components/tabs/tabs.js +8 -14
- package/test-env/components/tabs/tabs_context.js +23 -0
- package/scripts/postinstall.js +0 -9
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["applyTime"];
|
|
12
5
|
|
|
13
6
|
/*
|
|
14
7
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -17,177 +10,160 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
10
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
11
|
* Side Public License, v 1.
|
|
19
12
|
*/
|
|
20
|
-
import React, {
|
|
13
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
21
14
|
import { EuiButtonEmpty } from '../../../button';
|
|
22
15
|
import { EuiIcon } from '../../../icon';
|
|
23
16
|
import { EuiPopover } from '../../../popover';
|
|
24
17
|
import { EuiTitle } from '../../../title';
|
|
25
|
-
import { EuiHorizontalRule } from '../../../horizontal_rule';
|
|
26
18
|
import { EuiText } from '../../../text';
|
|
19
|
+
import { useEuiI18n } from '../../../i18n';
|
|
27
20
|
import { EuiQuickSelect } from './quick_select';
|
|
28
21
|
import { EuiCommonlyUsedTimeRanges } from './commonly_used_time_ranges';
|
|
29
22
|
import { EuiRecentlyUsed } from './recently_used';
|
|
30
23
|
import { EuiRefreshInterval } from '../../auto_refresh/refresh_interval';
|
|
31
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
32
|
-
export var EuiQuickSelectPopover =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
_defineProperty(_assertThisInitialized(_this), "closePopover", function () {
|
|
53
|
-
_this.setState({
|
|
54
|
-
isOpen: false
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
_defineProperty(_assertThisInitialized(_this), "togglePopover", function () {
|
|
59
|
-
_this.setState(function (prevState) {
|
|
60
|
-
return {
|
|
61
|
-
isOpen: !prevState.isOpen
|
|
62
|
-
};
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
_defineProperty(_assertThisInitialized(_this), "applyTime", function (_ref) {
|
|
67
|
-
var start = _ref.start,
|
|
68
|
-
end = _ref.end,
|
|
69
|
-
quickSelect = _ref.quickSelect,
|
|
70
|
-
_ref$keepPopoverOpen = _ref.keepPopoverOpen,
|
|
71
|
-
keepPopoverOpen = _ref$keepPopoverOpen === void 0 ? false : _ref$keepPopoverOpen;
|
|
72
|
-
|
|
73
|
-
_this.props.applyTime({
|
|
74
|
-
start: start,
|
|
75
|
-
end: end
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
if (quickSelect) {
|
|
79
|
-
_this.setState({
|
|
80
|
-
prevQuickSelect: quickSelect
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (!keepPopoverOpen) {
|
|
85
|
-
_this.closePopover();
|
|
86
|
-
}
|
|
25
|
+
export var EuiQuickSelectPopover = function EuiQuickSelectPopover(_ref) {
|
|
26
|
+
var _applyTime = _ref.applyTime,
|
|
27
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
28
|
+
|
|
29
|
+
var _useState = useState(),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
prevQuickSelect = _useState2[0],
|
|
32
|
+
setQuickSelect = _useState2[1];
|
|
33
|
+
|
|
34
|
+
var _useState3 = useState(false),
|
|
35
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
36
|
+
isOpen = _useState4[0],
|
|
37
|
+
setIsOpen = _useState4[1];
|
|
38
|
+
|
|
39
|
+
var closePopover = useCallback(function () {
|
|
40
|
+
return setIsOpen(false);
|
|
41
|
+
}, []);
|
|
42
|
+
var togglePopover = useCallback(function () {
|
|
43
|
+
return setIsOpen(function (isOpen) {
|
|
44
|
+
return !isOpen;
|
|
87
45
|
});
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
applyTime: _this.applyTime,
|
|
100
|
-
start: start,
|
|
101
|
-
end: end,
|
|
102
|
-
prevQuickSelect: prevQuickSelect,
|
|
103
|
-
timeOptions: timeOptions
|
|
104
|
-
}), commonlyUsedRanges.length > 0 && ___EmotionJSX(EuiHorizontalRule, {
|
|
105
|
-
margin: "s"
|
|
106
|
-
}), ___EmotionJSX(EuiCommonlyUsedTimeRanges, {
|
|
107
|
-
applyTime: _this.applyTime,
|
|
108
|
-
commonlyUsedRanges: commonlyUsedRanges
|
|
109
|
-
}), recentlyUsedRanges.length > 0 && ___EmotionJSX(EuiHorizontalRule, {
|
|
110
|
-
margin: "s"
|
|
111
|
-
}), ___EmotionJSX(EuiRecentlyUsed, {
|
|
112
|
-
applyTime: _this.applyTime,
|
|
113
|
-
commonlyUsedRanges: commonlyUsedRanges,
|
|
114
|
-
dateFormat: dateFormat,
|
|
115
|
-
recentlyUsedRanges: recentlyUsedRanges
|
|
116
|
-
}), _this.renderCustomQuickSelectPanels());
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
_defineProperty(_assertThisInitialized(_this), "renderCustomQuickSelectPanels", function () {
|
|
120
|
-
var customQuickSelectPanels = _this.props.customQuickSelectPanels;
|
|
121
|
-
|
|
122
|
-
if (!customQuickSelectPanels) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return customQuickSelectPanels.map(function (_ref2) {
|
|
127
|
-
var title = _ref2.title,
|
|
128
|
-
content = _ref2.content;
|
|
129
|
-
return ___EmotionJSX(Fragment, {
|
|
130
|
-
key: title
|
|
131
|
-
}, ___EmotionJSX(EuiHorizontalRule, {
|
|
132
|
-
margin: "s"
|
|
133
|
-
}), ___EmotionJSX(EuiTitle, {
|
|
134
|
-
size: "xxxs"
|
|
135
|
-
}, ___EmotionJSX("span", null, title)), ___EmotionJSX(EuiText, {
|
|
136
|
-
size: "s",
|
|
137
|
-
className: "euiQuickSelectPopover__section"
|
|
138
|
-
}, /*#__PURE__*/React.cloneElement(content, {
|
|
139
|
-
applyTime: _this.applyTime
|
|
140
|
-
})));
|
|
141
|
-
});
|
|
46
|
+
}, []);
|
|
47
|
+
var applyTime = useCallback(function (_ref2) {
|
|
48
|
+
var start = _ref2.start,
|
|
49
|
+
end = _ref2.end,
|
|
50
|
+
quickSelect = _ref2.quickSelect,
|
|
51
|
+
_ref2$keepPopoverOpen = _ref2.keepPopoverOpen,
|
|
52
|
+
keepPopoverOpen = _ref2$keepPopoverOpen === void 0 ? false : _ref2$keepPopoverOpen;
|
|
53
|
+
|
|
54
|
+
_applyTime({
|
|
55
|
+
start: start,
|
|
56
|
+
end: end
|
|
142
57
|
});
|
|
143
58
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
_createClass(EuiQuickSelectPopover, [{
|
|
148
|
-
key: "render",
|
|
149
|
-
value: function render() {
|
|
150
|
-
var _this$props2 = this.props,
|
|
151
|
-
applyRefreshInterval = _this$props2.applyRefreshInterval,
|
|
152
|
-
isDisabled = _this$props2.isDisabled,
|
|
153
|
-
isPaused = _this$props2.isPaused,
|
|
154
|
-
refreshInterval = _this$props2.refreshInterval;
|
|
155
|
-
var isOpen = this.state.isOpen;
|
|
156
|
-
|
|
157
|
-
var quickSelectButton = ___EmotionJSX(EuiButtonEmpty, {
|
|
158
|
-
className: "euiFormControlLayout__prepend",
|
|
159
|
-
textProps: {
|
|
160
|
-
className: 'euiQuickSelectPopover__buttonText'
|
|
161
|
-
},
|
|
162
|
-
onClick: this.togglePopover,
|
|
163
|
-
"aria-label": "Date quick select",
|
|
164
|
-
size: "xs",
|
|
165
|
-
iconType: "arrowDown",
|
|
166
|
-
iconSide: "right",
|
|
167
|
-
isDisabled: isDisabled,
|
|
168
|
-
"data-test-subj": "superDatePickerToggleQuickMenuButton"
|
|
169
|
-
}, ___EmotionJSX(EuiIcon, {
|
|
170
|
-
type: "calendar"
|
|
171
|
-
}));
|
|
59
|
+
if (quickSelect) {
|
|
60
|
+
setQuickSelect(quickSelect);
|
|
61
|
+
}
|
|
172
62
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
63
|
+
if (!keepPopoverOpen) {
|
|
64
|
+
closePopover();
|
|
65
|
+
}
|
|
66
|
+
}, [_applyTime, closePopover]);
|
|
67
|
+
var buttonlabel = useEuiI18n('euiQuickSelectPopover.buttonLabel', 'Date quick select');
|
|
68
|
+
|
|
69
|
+
var quickSelectButton = ___EmotionJSX(EuiButtonEmpty, {
|
|
70
|
+
className: "euiFormControlLayout__prepend",
|
|
71
|
+
textProps: {
|
|
72
|
+
className: 'euiQuickSelectPopover__buttonText'
|
|
73
|
+
},
|
|
74
|
+
onClick: togglePopover,
|
|
75
|
+
"aria-label": buttonlabel,
|
|
76
|
+
title: buttonlabel,
|
|
77
|
+
size: "xs",
|
|
78
|
+
iconType: "arrowDown",
|
|
79
|
+
iconSide: "right",
|
|
80
|
+
isDisabled: props.isDisabled,
|
|
81
|
+
"data-test-subj": "superDatePickerToggleQuickMenuButton"
|
|
82
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
83
|
+
type: "calendar"
|
|
84
|
+
}));
|
|
85
|
+
|
|
86
|
+
return ___EmotionJSX(EuiPopover, {
|
|
87
|
+
button: quickSelectButton,
|
|
88
|
+
isOpen: isOpen,
|
|
89
|
+
closePopover: closePopover,
|
|
90
|
+
anchorPosition: "downLeft",
|
|
91
|
+
anchorClassName: "euiQuickSelectPopover__anchor"
|
|
92
|
+
}, ___EmotionJSX(EuiQuickSelectPanels, _extends({}, props, {
|
|
93
|
+
applyTime: applyTime,
|
|
94
|
+
prevQuickSelect: prevQuickSelect
|
|
95
|
+
})));
|
|
96
|
+
};
|
|
97
|
+
export var EuiQuickSelectPanels = function EuiQuickSelectPanels(_ref3) {
|
|
98
|
+
var start = _ref3.start,
|
|
99
|
+
end = _ref3.end,
|
|
100
|
+
dateFormat = _ref3.dateFormat,
|
|
101
|
+
timeOptions = _ref3.timeOptions,
|
|
102
|
+
commonlyUsedRanges = _ref3.commonlyUsedRanges,
|
|
103
|
+
recentlyUsedRanges = _ref3.recentlyUsedRanges,
|
|
104
|
+
customQuickSelectPanels = _ref3.customQuickSelectPanels,
|
|
105
|
+
customQuickSelectRender = _ref3.customQuickSelectRender,
|
|
106
|
+
isPaused = _ref3.isPaused,
|
|
107
|
+
refreshInterval = _ref3.refreshInterval,
|
|
108
|
+
applyRefreshInterval = _ref3.applyRefreshInterval,
|
|
109
|
+
applyTime = _ref3.applyTime,
|
|
110
|
+
prevQuickSelect = _ref3.prevQuickSelect;
|
|
111
|
+
|
|
112
|
+
var quickSelectElement = ___EmotionJSX(EuiQuickSelect, {
|
|
113
|
+
applyTime: applyTime,
|
|
114
|
+
start: start,
|
|
115
|
+
end: end,
|
|
116
|
+
prevQuickSelect: prevQuickSelect,
|
|
117
|
+
timeOptions: timeOptions
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
var commonlyUsedElement = ___EmotionJSX(EuiCommonlyUsedTimeRanges, {
|
|
121
|
+
applyTime: applyTime,
|
|
122
|
+
commonlyUsedRanges: commonlyUsedRanges
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
var recentlyUsedElement = ___EmotionJSX(EuiRecentlyUsed, {
|
|
126
|
+
applyTime: applyTime,
|
|
127
|
+
commonlyUsedRanges: commonlyUsedRanges,
|
|
128
|
+
dateFormat: dateFormat,
|
|
129
|
+
recentlyUsedRanges: recentlyUsedRanges
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
var refreshIntervalElement = applyRefreshInterval && ___EmotionJSX(EuiRefreshInterval, {
|
|
133
|
+
onRefreshChange: applyRefreshInterval,
|
|
134
|
+
isPaused: isPaused,
|
|
135
|
+
refreshInterval: refreshInterval
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
var customQuickSelectPanelsElement = useMemo(function () {
|
|
139
|
+
if (!customQuickSelectPanels) {
|
|
140
|
+
return null;
|
|
189
141
|
}
|
|
190
|
-
}]);
|
|
191
142
|
|
|
192
|
-
|
|
193
|
-
|
|
143
|
+
return customQuickSelectPanels.map(function (_ref4) {
|
|
144
|
+
var title = _ref4.title,
|
|
145
|
+
content = _ref4.content;
|
|
146
|
+
return ___EmotionJSX("div", {
|
|
147
|
+
key: title,
|
|
148
|
+
className: "euiQuickSelectPopover__panel"
|
|
149
|
+
}, ___EmotionJSX(EuiTitle, {
|
|
150
|
+
size: "xxxs"
|
|
151
|
+
}, ___EmotionJSX("span", null, title)), ___EmotionJSX(EuiText, {
|
|
152
|
+
size: "s",
|
|
153
|
+
className: "euiQuickSelectPopover__section"
|
|
154
|
+
}, /*#__PURE__*/React.cloneElement(content, {
|
|
155
|
+
applyTime: applyTime
|
|
156
|
+
})));
|
|
157
|
+
});
|
|
158
|
+
}, [customQuickSelectPanels, applyTime]);
|
|
159
|
+
return ___EmotionJSX("div", {
|
|
160
|
+
className: "euiQuickSelectPopover__content",
|
|
161
|
+
"data-test-subj": "superDatePickerQuickMenu"
|
|
162
|
+
}, customQuickSelectRender ? customQuickSelectRender({
|
|
163
|
+
quickSelect: quickSelectElement,
|
|
164
|
+
commonlyUsedRanges: commonlyUsedElement,
|
|
165
|
+
recentlyUsedRanges: recentlyUsedElement,
|
|
166
|
+
refreshInterval: refreshIntervalElement,
|
|
167
|
+
customQuickSelectPanels: customQuickSelectPanelsElement
|
|
168
|
+
}) : ___EmotionJSX(React.Fragment, null, quickSelectElement, commonlyUsedElement, recentlyUsedElement, refreshIntervalElement, customQuickSelectPanelsElement));
|
|
169
|
+
};
|
package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js
CHANGED
|
@@ -47,10 +47,13 @@ export var EuiRecentlyUsed = function EuiRecentlyUsed(_ref) {
|
|
|
47
47
|
dateFormat: dateFormat
|
|
48
48
|
})));
|
|
49
49
|
});
|
|
50
|
-
return ___EmotionJSX("fieldset",
|
|
50
|
+
return ___EmotionJSX("fieldset", {
|
|
51
|
+
className: "euiQuickSelectPopover__panel"
|
|
52
|
+
}, ___EmotionJSX(EuiTitle, {
|
|
51
53
|
size: "xxxs"
|
|
52
54
|
}, ___EmotionJSX("legend", {
|
|
53
|
-
id: legendId
|
|
55
|
+
id: legendId,
|
|
56
|
+
className: "euiQuickSelectPopover__panelTitle"
|
|
54
57
|
}, ___EmotionJSX(EuiI18n, {
|
|
55
58
|
token: "euiRecentlyUsed.legend",
|
|
56
59
|
default: "Recently used date ranges"
|
|
@@ -384,6 +384,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
384
384
|
commonlyUsedRanges = _this$props5.commonlyUsedRanges,
|
|
385
385
|
timeOptions = _this$props5.timeOptions,
|
|
386
386
|
customQuickSelectPanels = _this$props5.customQuickSelectPanels,
|
|
387
|
+
customQuickSelectRender = _this$props5.customQuickSelectRender,
|
|
387
388
|
dateFormat = _this$props5.dateFormat,
|
|
388
389
|
end = _this$props5.end,
|
|
389
390
|
isAutoRefreshOnly = _this$props5.isAutoRefreshOnly,
|
|
@@ -415,6 +416,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
415
416
|
applyTime: this.applyQuickTime,
|
|
416
417
|
commonlyUsedRanges: commonlyUsedRanges,
|
|
417
418
|
customQuickSelectPanels: customQuickSelectPanels,
|
|
419
|
+
customQuickSelectRender: customQuickSelectRender,
|
|
418
420
|
dateFormat: dateFormat,
|
|
419
421
|
end: end,
|
|
420
422
|
isDisabled: isDisabled,
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
/// <reference types="../../../cypress/support"/>
|
|
11
|
+
import React, { useState } from 'react';
|
|
12
|
+
import { EuiDelayHide } from './delay_hide';
|
|
13
|
+
import { EuiCheckbox, EuiFieldNumber, EuiFormRow } from '../form';
|
|
14
|
+
import { EuiFlexItem } from '../flex';
|
|
15
|
+
import { EuiLoadingSpinner } from '../loading';
|
|
16
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
|
+
|
|
18
|
+
var DelayHide = function DelayHide() {
|
|
19
|
+
var _useState = useState(1000),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
minimumDuration = _useState2[0],
|
|
22
|
+
setDuration = _useState2[1];
|
|
23
|
+
|
|
24
|
+
var _useState3 = useState(false),
|
|
25
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
+
hide = _useState4[0],
|
|
27
|
+
setHide = _useState4[1];
|
|
28
|
+
|
|
29
|
+
var onChangeMinimumDuration = function onChangeMinimumDuration(event) {
|
|
30
|
+
setDuration(parseInt(event.target.value, 10));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var onChangeHide = function onChangeHide(event) {
|
|
34
|
+
setHide(event.target.checked);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiFormRow, null, ___EmotionJSX(EuiCheckbox, {
|
|
38
|
+
id: "dummy-id",
|
|
39
|
+
checked: hide,
|
|
40
|
+
onChange: onChangeHide,
|
|
41
|
+
label: "Hide child"
|
|
42
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
43
|
+
label: "Minimum duration"
|
|
44
|
+
}, ___EmotionJSX(EuiFieldNumber, {
|
|
45
|
+
value: minimumDuration,
|
|
46
|
+
onChange: onChangeMinimumDuration
|
|
47
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
48
|
+
label: "Child to render"
|
|
49
|
+
}, ___EmotionJSX(EuiDelayHide, {
|
|
50
|
+
hide: hide,
|
|
51
|
+
minimumDuration: minimumDuration,
|
|
52
|
+
render: function render() {
|
|
53
|
+
return ___EmotionJSX(EuiLoadingSpinner, {
|
|
54
|
+
size: "m"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}))));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
beforeEach(function () {
|
|
61
|
+
cy.realMount(___EmotionJSX(DelayHide, null));
|
|
62
|
+
});
|
|
63
|
+
describe('EuiHideRender', function () {
|
|
64
|
+
describe('Automated accessibility check', function () {
|
|
65
|
+
it('has zero violations on first render', function () {
|
|
66
|
+
cy.checkAxe();
|
|
67
|
+
});
|
|
68
|
+
it('has zero violations when the hide child input is checked', function () {
|
|
69
|
+
cy.get('input.euiCheckbox__input').realClick();
|
|
70
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
71
|
+
timeout: 5000
|
|
72
|
+
}).should('not.exist');
|
|
73
|
+
cy.checkAxe();
|
|
74
|
+
});
|
|
75
|
+
it('has zero violations when the hide child input is pressed', function () {
|
|
76
|
+
cy.realPress('Tab');
|
|
77
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
78
|
+
cy.realPress('Space');
|
|
79
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
80
|
+
timeout: 5000
|
|
81
|
+
}).should('not.exist');
|
|
82
|
+
cy.checkAxe();
|
|
83
|
+
});
|
|
84
|
+
it('has zero violations when the hide child input is toggled', function () {
|
|
85
|
+
cy.realPress('Tab');
|
|
86
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
87
|
+
cy.realPress('Space');
|
|
88
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]').should('not.exist');
|
|
89
|
+
cy.realPress('Space');
|
|
90
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
91
|
+
timeout: 5000
|
|
92
|
+
}).should('exist');
|
|
93
|
+
cy.checkAxe();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
/// <reference types="../../../cypress/support"/>
|
|
11
|
+
import React, { useState } from 'react';
|
|
12
|
+
import { EuiDelayRender } from './delay_render';
|
|
13
|
+
import { EuiCheckbox, EuiFieldNumber, EuiFormRow } from '../form';
|
|
14
|
+
import { EuiFlexItem } from '../flex';
|
|
15
|
+
import { EuiLoadingSpinner } from '../loading';
|
|
16
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
|
+
|
|
18
|
+
var DelayRender = function DelayRender() {
|
|
19
|
+
var _useState = useState(1000),
|
|
20
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21
|
+
minimumDelay = _useState2[0],
|
|
22
|
+
setDelay = _useState2[1];
|
|
23
|
+
|
|
24
|
+
var _useState3 = useState(false),
|
|
25
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
+
render = _useState4[0],
|
|
27
|
+
setRender = _useState4[1];
|
|
28
|
+
|
|
29
|
+
var onChangeMinimumDelay = function onChangeMinimumDelay(event) {
|
|
30
|
+
setDelay(parseInt(event.target.value, 10));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var onChangeHide = function onChangeHide(event) {
|
|
34
|
+
setRender(event.target.checked);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var status = render ? 'showing' : 'hidden';
|
|
38
|
+
var label = "Child (".concat(status, ")");
|
|
39
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiFormRow, null, ___EmotionJSX(EuiCheckbox, {
|
|
40
|
+
id: "dummy-id",
|
|
41
|
+
checked: render,
|
|
42
|
+
onChange: onChangeHide,
|
|
43
|
+
label: "Show child"
|
|
44
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
45
|
+
label: "Minimum delay"
|
|
46
|
+
}, ___EmotionJSX(EuiFieldNumber, {
|
|
47
|
+
value: minimumDelay,
|
|
48
|
+
onChange: onChangeMinimumDelay
|
|
49
|
+
})), ___EmotionJSX(EuiFormRow, {
|
|
50
|
+
label: label
|
|
51
|
+
}, render ? ___EmotionJSX(EuiDelayRender, {
|
|
52
|
+
delay: minimumDelay
|
|
53
|
+
}, ___EmotionJSX(EuiLoadingSpinner, {
|
|
54
|
+
size: "m"
|
|
55
|
+
})) : ___EmotionJSX(React.Fragment, null))));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
beforeEach(function () {
|
|
59
|
+
cy.realMount(___EmotionJSX(DelayRender, null));
|
|
60
|
+
});
|
|
61
|
+
describe('EuiDelayRender', function () {
|
|
62
|
+
describe('Automated accessibility check', function () {
|
|
63
|
+
it('has zero violations on first render', function () {
|
|
64
|
+
cy.checkAxe();
|
|
65
|
+
});
|
|
66
|
+
it('has zero violations when the show child input is checked', function () {
|
|
67
|
+
cy.get('input.euiCheckbox__input').realClick();
|
|
68
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
69
|
+
timeout: 5000
|
|
70
|
+
}).should('exist');
|
|
71
|
+
cy.checkAxe();
|
|
72
|
+
});
|
|
73
|
+
it('has zero violations when the show child input is pressed', function () {
|
|
74
|
+
cy.realPress('Tab');
|
|
75
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
76
|
+
cy.realPress('Space');
|
|
77
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
78
|
+
timeout: 5000
|
|
79
|
+
}).should('exist');
|
|
80
|
+
cy.checkAxe();
|
|
81
|
+
});
|
|
82
|
+
it('has zero violations when the show child input is toggled', function () {
|
|
83
|
+
cy.realPress('Tab');
|
|
84
|
+
cy.get('input.euiCheckbox__input').should('have.focus');
|
|
85
|
+
cy.realPress('Space');
|
|
86
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
87
|
+
timeout: 5000
|
|
88
|
+
});
|
|
89
|
+
cy.realPress('Space');
|
|
90
|
+
cy.get('div.euiFormRow__fieldWrapper').last().find('span[role="progressbar"]', {
|
|
91
|
+
timeout: 5000
|
|
92
|
+
}).should('not.exist');
|
|
93
|
+
cy.checkAxe();
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiButton } from '../button';
|
|
11
|
+
import { EuiEmptyPrompt } from './empty_prompt';
|
|
12
|
+
import { EuiLink } from '../link';
|
|
13
|
+
import { EuiTitle } from '../title';
|
|
14
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
|
+
|
|
16
|
+
var EmptyPrompt = function EmptyPrompt(_ref) {
|
|
17
|
+
var addCaseSpy = _ref.addCaseSpy,
|
|
18
|
+
addLinkSpy = _ref.addLinkSpy;
|
|
19
|
+
return ___EmotionJSX(EuiEmptyPrompt, {
|
|
20
|
+
iconType: "logoSecurity",
|
|
21
|
+
title: ___EmotionJSX("h2", null, "Start adding cases"),
|
|
22
|
+
body: ___EmotionJSX("p", null, "Add a new case or change your filter settings."),
|
|
23
|
+
actions: ___EmotionJSX(EuiButton, {
|
|
24
|
+
color: "primary",
|
|
25
|
+
onClick: addCaseSpy,
|
|
26
|
+
fill: true
|
|
27
|
+
}, "Add a case"),
|
|
28
|
+
footer: ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTitle, {
|
|
29
|
+
size: "xxs"
|
|
30
|
+
}, ___EmotionJSX("h3", null, "Want to learn more?")), ___EmotionJSX(EuiLink, {
|
|
31
|
+
href: "#",
|
|
32
|
+
onClick: addLinkSpy
|
|
33
|
+
}, "Read the docs"))
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
beforeEach(function () {
|
|
38
|
+
var addCaseSpy = cy.spy().as('addCaseSpy');
|
|
39
|
+
var addLinkSpy = cy.spy().as('addLinkSpy');
|
|
40
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
41
|
+
|
|
42
|
+
cy.realMount(___EmotionJSX(EmptyPrompt, {
|
|
43
|
+
addCaseSpy: addCaseSpy,
|
|
44
|
+
addLinkSpy: addLinkSpy
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
describe('EuiEmptyPrompt', function () {
|
|
48
|
+
describe('Automated accessibility check', function () {
|
|
49
|
+
it('has zero violations on first render', function () {
|
|
50
|
+
cy.checkAxe();
|
|
51
|
+
});
|
|
52
|
+
it('has zero violations after clicking Add a case button', function () {
|
|
53
|
+
cy.get('button.euiButton').contains('Add a case').realClick();
|
|
54
|
+
cy.get('@addCaseSpy').should('have.been.called');
|
|
55
|
+
cy.checkAxe();
|
|
56
|
+
});
|
|
57
|
+
it('has zero violations after clicking Read the docs link', function () {
|
|
58
|
+
cy.get('a.euiLink').contains('Read the docs').realClick();
|
|
59
|
+
cy.get('@addLinkSpy').should('have.been.called');
|
|
60
|
+
cy.checkAxe();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|