@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
|
@@ -0,0 +1,33 @@
|
|
|
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 { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for token icons', function () {
|
|
14
|
+
var TokenIcons = ['tokenAlias', 'tokenAnnotation', 'tokenArray', 'tokenBinary', 'tokenBoolean', 'tokenClass', 'tokenCompletionSuggester', 'tokenConstant', 'tokenDate', 'tokenDenseVector', 'tokenElement', 'tokenEnum', 'tokenEnumMember', 'tokenEvent', 'tokenException', 'tokenField', 'tokenFile', 'tokenFlattened', 'tokenFunction', 'tokenGeo', 'tokenHistogram', 'tokenInterface', 'tokenIP', 'tokenJoin', 'tokenKey', 'tokenKeyword', 'tokenMethod', 'tokenMetricCounter', 'tokenMetricGauge', 'tokenModule', 'tokenNamespace', 'tokenNested', 'tokenNull', 'tokenNumber', 'tokenObject', 'tokenOperator', 'tokenPackage', 'tokenParameter', 'tokenPercolator', 'tokenProperty', 'tokenRange', 'tokenRankFeature', 'tokenRankFeatures', 'tokenRepo', 'tokenSearchType', 'tokenShape', 'tokenString', 'tokenStruct', 'tokenSymbol', 'tokenTag', 'tokenText', 'tokenTokenCount', 'tokenVariable'];
|
|
15
|
+
|
|
16
|
+
var TokenGrid = function TokenGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, TokenIcons.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(TokenGrid, null));
|
|
27
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('have.length', 53);
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// are exported for two versions of TypeScript (3.4, 4.0) and implicit
|
|
10
10
|
// imports during eui.d.ts generation default to the incorrect version (3.4).
|
|
11
11
|
// Explicit imports here resolve the version mismatch.
|
|
12
|
-
import markdown from 'remark-parse';
|
|
12
|
+
import markdown from 'remark-parse-no-trim';
|
|
13
13
|
import emoji from 'remark-emoji';
|
|
14
14
|
import breaks from 'remark-breaks';
|
|
15
15
|
import highlight from '../remark/remark_prismjs';
|
|
@@ -20,6 +20,9 @@ var paddingSizeToClassNameMap = {
|
|
|
20
20
|
l: 'euiPageSideBar--paddingLarge'
|
|
21
21
|
};
|
|
22
22
|
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use the new EuiPageSidebarProps in page/page_sidebar instead
|
|
25
|
+
*/
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
* @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
|
|
@@ -246,7 +246,7 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
246
246
|
});
|
|
247
247
|
});
|
|
248
248
|
|
|
249
|
-
_defineProperty(_assertThisInitialized(_this), "onOptionClick", function (options, event) {
|
|
249
|
+
_defineProperty(_assertThisInitialized(_this), "onOptionClick", function (options, event, clickedOption) {
|
|
250
250
|
var _this$props = _this.props,
|
|
251
251
|
isPreFiltered = _this$props.isPreFiltered,
|
|
252
252
|
onChange = _this$props.onChange;
|
|
@@ -258,7 +258,7 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
258
258
|
});
|
|
259
259
|
|
|
260
260
|
if (onChange) {
|
|
261
|
-
onChange(options, event);
|
|
261
|
+
onChange(options, event, clickedOption);
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
|
|
@@ -209,6 +209,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
209
209
|
onOptionClick = _this$props4.onOptionClick,
|
|
210
210
|
options = _this$props4.options,
|
|
211
211
|
singleSelection = _this$props4.singleSelection;
|
|
212
|
+
|
|
213
|
+
var changedOption = _objectSpread({}, addedOption);
|
|
214
|
+
|
|
212
215
|
var updatedOptions = options.map(function (option) {
|
|
213
216
|
// if singleSelection is enabled, uncheck any selected option(s)
|
|
214
217
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -220,11 +223,12 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
220
223
|
|
|
221
224
|
if (option === addedOption) {
|
|
222
225
|
updatedOption.checked = 'on';
|
|
226
|
+
changedOption = updatedOption;
|
|
223
227
|
}
|
|
224
228
|
|
|
225
229
|
return updatedOption;
|
|
226
230
|
});
|
|
227
|
-
onOptionClick(updatedOptions, event);
|
|
231
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
228
232
|
});
|
|
229
233
|
|
|
230
234
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
|
|
@@ -232,33 +236,40 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
232
236
|
onOptionClick = _this$props5.onOptionClick,
|
|
233
237
|
singleSelection = _this$props5.singleSelection,
|
|
234
238
|
options = _this$props5.options;
|
|
239
|
+
|
|
240
|
+
var changedOption = _objectSpread({}, removedOption);
|
|
241
|
+
|
|
235
242
|
var updatedOptions = options.map(function (option) {
|
|
236
243
|
var updatedOption = _objectSpread({}, option);
|
|
237
244
|
|
|
238
245
|
if (option === removedOption && singleSelection !== 'always') {
|
|
239
246
|
delete updatedOption.checked;
|
|
247
|
+
changedOption = updatedOption;
|
|
240
248
|
}
|
|
241
249
|
|
|
242
250
|
return updatedOption;
|
|
243
251
|
});
|
|
244
|
-
onOptionClick(updatedOptions, event);
|
|
252
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
245
253
|
});
|
|
246
254
|
|
|
247
255
|
_defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
|
|
248
256
|
var _this$props6 = _this.props,
|
|
249
257
|
onOptionClick = _this$props6.onOptionClick,
|
|
250
258
|
options = _this$props6.options;
|
|
251
|
-
|
|
259
|
+
|
|
260
|
+
var changedOption = _objectSpread({}, excludedOption);
|
|
261
|
+
|
|
252
262
|
var updatedOptions = options.map(function (option) {
|
|
253
263
|
var updatedOption = _objectSpread({}, option);
|
|
254
264
|
|
|
255
265
|
if (option === excludedOption) {
|
|
256
266
|
updatedOption.checked = 'off';
|
|
267
|
+
changedOption = updatedOption;
|
|
257
268
|
}
|
|
258
269
|
|
|
259
270
|
return updatedOption;
|
|
260
271
|
});
|
|
261
|
-
onOptionClick(updatedOptions, event);
|
|
272
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
262
273
|
});
|
|
263
274
|
|
|
264
275
|
return _this;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"
|
|
3
|
+
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -9,11 +9,12 @@ var _excluded = ["isSelected", "children", "className", "disabled", "href", "tar
|
|
|
9
9
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
|
-
import React from 'react';
|
|
12
|
+
import React, { useContext } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
15
15
|
import { validateHref } from '../../services/security/href_validator';
|
|
16
16
|
import { euiTabStyles, euiTabContentStyles } from './tab.styles';
|
|
17
|
+
import { EuiTabsContext } from './tabs_context';
|
|
17
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
19
|
export var EuiTab = function EuiTab(_ref) {
|
|
19
20
|
var isSelected = _ref.isSelected,
|
|
@@ -25,11 +26,12 @@ export var EuiTab = function EuiTab(_ref) {
|
|
|
25
26
|
rel = _ref.rel,
|
|
26
27
|
prepend = _ref.prepend,
|
|
27
28
|
append = _ref.append,
|
|
28
|
-
_ref$size = _ref.size,
|
|
29
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
30
|
-
expand = _ref.expand,
|
|
31
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
30
|
|
|
31
|
+
var _useContext = useContext(EuiTabsContext),
|
|
32
|
+
size = _useContext.size,
|
|
33
|
+
expand = _useContext.expand;
|
|
34
|
+
|
|
33
35
|
var euiTheme = useEuiTheme();
|
|
34
36
|
var isHrefValid = !href || validateHref(href);
|
|
35
37
|
var disabled = _disabled || !isHrefValid; // Keep CSS classnames for reference
|
|
@@ -12,8 +12,8 @@ var _excluded = ["children", "className", "bottomBorder", "expand", "size"];
|
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiTheme } from '../../services';
|
|
15
|
-
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
16
15
|
import { euiTabsStyles } from './tabs.styles';
|
|
16
|
+
import { EuiTabsContext } from './tabs_context';
|
|
17
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
18
|
export var SIZES = ['s', 'm', 'l', 'xl'];
|
|
19
19
|
export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -31,21 +31,17 @@ export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
31
31
|
var classes = classNames('euiTabs', className);
|
|
32
32
|
var styles = euiTabsStyles(euiTheme);
|
|
33
33
|
var cssStyles = [styles.euiTabs, styles[size], bottomBorder && styles.bottomBorder];
|
|
34
|
-
var tabItems = React.Children.map(children, function (child) {
|
|
35
|
-
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
36
|
-
return cloneElementWithCss(child, {
|
|
37
|
-
// we're passing the parent `size` and `expand` down to the children
|
|
38
|
-
size: size,
|
|
39
|
-
expand: expand
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
34
|
return ___EmotionJSX("div", _extends({
|
|
44
35
|
ref: ref,
|
|
45
36
|
className: classes,
|
|
46
37
|
css: cssStyles
|
|
47
38
|
}, children && {
|
|
48
39
|
role: 'tablist'
|
|
49
|
-
}, rest),
|
|
40
|
+
}, rest), ___EmotionJSX(EuiTabsContext.Provider, {
|
|
41
|
+
value: {
|
|
42
|
+
expand: expand,
|
|
43
|
+
size: size
|
|
44
|
+
}
|
|
45
|
+
}, children));
|
|
50
46
|
});
|
|
51
47
|
EuiTabs.displayName = 'EuiTabs';
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
import { createContext } from 'react';
|
|
9
|
+
export var contextDefaults = {
|
|
10
|
+
expand: false,
|
|
11
|
+
size: 'm'
|
|
12
|
+
};
|
|
13
|
+
export var EuiTabsContext = /*#__PURE__*/createContext(contextDefaults);
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
8
|
+
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
|
|
13
|
+
var _index = require("./index");
|
|
14
|
+
|
|
15
|
+
var _faker = require("@faker-js/faker");
|
|
16
|
+
|
|
17
|
+
var _react2 = require("@emotion/react");
|
|
18
|
+
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
25
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
26
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
27
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
28
|
+
* Side Public License, v 1.
|
|
29
|
+
*/
|
|
30
|
+
/// <reference types="../../../cypress/support"/>
|
|
31
|
+
var columns = [{
|
|
32
|
+
id: 'Name'
|
|
33
|
+
}, {
|
|
34
|
+
id: 'Email',
|
|
35
|
+
cellActions: [function (_ref) {
|
|
36
|
+
var rowIndex = _ref.rowIndex,
|
|
37
|
+
columnId = _ref.columnId,
|
|
38
|
+
Component = _ref.Component;
|
|
39
|
+
var row = ++rowIndex;
|
|
40
|
+
return (0, _react2.jsx)(Component, {
|
|
41
|
+
onClick: function onClick() {},
|
|
42
|
+
iconType: "heart",
|
|
43
|
+
"aria-label": "Send love to ".concat(row, ", column \"").concat(columnId, "\" ")
|
|
44
|
+
}, "Send love");
|
|
45
|
+
}]
|
|
46
|
+
}, {
|
|
47
|
+
id: 'User ID',
|
|
48
|
+
schema: 'string'
|
|
49
|
+
}, {
|
|
50
|
+
id: 'Account balance'
|
|
51
|
+
}, {
|
|
52
|
+
id: 'Last purchase',
|
|
53
|
+
schema: 'datetime'
|
|
54
|
+
}, {
|
|
55
|
+
id: 'Favorite distro',
|
|
56
|
+
schema: 'favoriteDistro'
|
|
57
|
+
}];
|
|
58
|
+
var storeData = [];
|
|
59
|
+
|
|
60
|
+
for (var i = 1; i < 11; i++) {
|
|
61
|
+
storeData.push({
|
|
62
|
+
Name: "".concat(_faker.faker.name.lastName(), ", ").concat(_faker.faker.name.firstName(), " ").concat(_faker.faker.name.suffix()),
|
|
63
|
+
Email: "".concat(_faker.faker.internet.email()),
|
|
64
|
+
'User ID': "".concat(_faker.faker.datatype.number({
|
|
65
|
+
min: 1000000,
|
|
66
|
+
max: 9999999
|
|
67
|
+
})),
|
|
68
|
+
'Account balance': _faker.faker.finance.amount(),
|
|
69
|
+
'Last purchase': "".concat(_faker.faker.date.past()),
|
|
70
|
+
'Favorite distro': i % 2 === 0 ? 'Alma' : 'Debian'
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var commaSeparateNumbers = function commaSeparateNumbers(numberString) {
|
|
75
|
+
// extract the groups-of-three digits that are right-aligned
|
|
76
|
+
return numberString.replace(/((\d{3})+)$/, function (match) {
|
|
77
|
+
return (// then replace each group of xyz digits with ,xyz
|
|
78
|
+
match.replace(/(\d{3})/g, ',$1')
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
var DataGrid = function DataGrid() {
|
|
84
|
+
var _useState = (0, _react.useState)(columns.map(function (_ref2) {
|
|
85
|
+
var id = _ref2.id;
|
|
86
|
+
return id;
|
|
87
|
+
})),
|
|
88
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
89
|
+
visibleColumns = _useState2[0],
|
|
90
|
+
setVisibleColumns = _useState2[1];
|
|
91
|
+
|
|
92
|
+
var _useState3 = (0, _react.useState)(storeData),
|
|
93
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
94
|
+
data = _useState4[0],
|
|
95
|
+
setData = _useState4[1];
|
|
96
|
+
|
|
97
|
+
var _useState5 = (0, _react.useState)([{
|
|
98
|
+
id: 'custom',
|
|
99
|
+
direction: 'asc'
|
|
100
|
+
}]),
|
|
101
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
102
|
+
sortingColumns = _useState6[0],
|
|
103
|
+
setSortingColumns = _useState6[1];
|
|
104
|
+
|
|
105
|
+
var setSorting = function setSorting(sortingColumns) {
|
|
106
|
+
var sortedData = (0, _toConsumableArray2.default)(data).sort(function (a, b) {
|
|
107
|
+
for (var _i = 0; _i < sortingColumns.length; _i++) {
|
|
108
|
+
var column = sortingColumns[_i];
|
|
109
|
+
var aValue = a[column.id];
|
|
110
|
+
var bValue = b[column.id];
|
|
111
|
+
if (aValue < bValue) return column.direction === 'asc' ? -1 : 1;
|
|
112
|
+
if (aValue > bValue) return column.direction === 'asc' ? 1 : -1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return 0;
|
|
116
|
+
});
|
|
117
|
+
setData(sortedData);
|
|
118
|
+
setSortingColumns(sortingColumns);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return (0, _react2.jsx)(_index.EuiDataGrid, {
|
|
122
|
+
"aria-label": "Data grid schema example",
|
|
123
|
+
columns: columns,
|
|
124
|
+
columnVisibility: {
|
|
125
|
+
visibleColumns: visibleColumns,
|
|
126
|
+
setVisibleColumns: setVisibleColumns
|
|
127
|
+
},
|
|
128
|
+
rowCount: data.length,
|
|
129
|
+
inMemory: {
|
|
130
|
+
level: 'sorting'
|
|
131
|
+
},
|
|
132
|
+
renderCellValue: function renderCellValue(_ref3) {
|
|
133
|
+
var rowIndex = _ref3.rowIndex,
|
|
134
|
+
columnId = _ref3.columnId,
|
|
135
|
+
schema = _ref3.schema;
|
|
136
|
+
var value = data[rowIndex][columnId];
|
|
137
|
+
|
|
138
|
+
if (schema === 'numeric') {
|
|
139
|
+
value = commaSeparateNumbers(value);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return value;
|
|
143
|
+
},
|
|
144
|
+
sorting: {
|
|
145
|
+
columns: sortingColumns,
|
|
146
|
+
onSort: setSorting
|
|
147
|
+
},
|
|
148
|
+
schemaDetectors: [{
|
|
149
|
+
type: 'favoriteDistro',
|
|
150
|
+
textTransform: 'capitalize',
|
|
151
|
+
detector: function detector(value) {
|
|
152
|
+
return value.toLowerCase() === 'alma' || value.toLowerCase() === 'debian' ? 1 : 0;
|
|
153
|
+
},
|
|
154
|
+
comparator: function comparator(a, b, direction) {
|
|
155
|
+
var aValue = a.toLowerCase() === 'alma';
|
|
156
|
+
var bValue = b.toLowerCase() === 'alma';
|
|
157
|
+
if (aValue < bValue) return direction === 'asc' ? 1 : -1;
|
|
158
|
+
if (aValue > bValue) return direction === 'asc' ? -1 : 1;
|
|
159
|
+
return 0;
|
|
160
|
+
},
|
|
161
|
+
sortTextAsc: 'Alma to Debian',
|
|
162
|
+
sortTextDesc: 'Debian to Alma',
|
|
163
|
+
icon: 'starFilled',
|
|
164
|
+
color: '#800080'
|
|
165
|
+
}]
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
beforeEach(function () {
|
|
170
|
+
cy.viewport(1280, 800); // large breakpoint
|
|
171
|
+
|
|
172
|
+
cy.mount((0, _react2.jsx)("div", {
|
|
173
|
+
style: {
|
|
174
|
+
width: '80%',
|
|
175
|
+
margin: '0 auto'
|
|
176
|
+
}
|
|
177
|
+
}, (0, _react2.jsx)(DataGrid, null)));
|
|
178
|
+
});
|
|
179
|
+
describe('EuiDataGrid', function () {
|
|
180
|
+
describe('Automated accessibility check', function () {
|
|
181
|
+
it('has zero violations on first render', function () {
|
|
182
|
+
cy.checkAxe();
|
|
183
|
+
});
|
|
184
|
+
it('has zero violations when the columns reorder menu is open', function () {
|
|
185
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
186
|
+
cy.checkAxe();
|
|
187
|
+
});
|
|
188
|
+
it('has zero violations when the hide all columns button is clicked', function () {
|
|
189
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
190
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorHideAllButton"]').realClick(); // TODO: Log this issue and remove the skipFailures boolean when fixed
|
|
191
|
+
|
|
192
|
+
cy.checkAxe({
|
|
193
|
+
skipFailures: true
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
it('has zero violations when the columns reorder searchbox returns multiple results', function () {
|
|
197
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
198
|
+
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('a');
|
|
199
|
+
cy.get('div.euiSwitch--compressed').should(function ($s) {
|
|
200
|
+
expect($s).to.have.length(5);
|
|
201
|
+
});
|
|
202
|
+
cy.checkAxe();
|
|
203
|
+
});
|
|
204
|
+
it('has zero violations when the columns reorder searchbox returns 1 result', function () {
|
|
205
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
206
|
+
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('favorite');
|
|
207
|
+
cy.get('div.euiSwitch--compressed').should(function ($s) {
|
|
208
|
+
expect($s).to.have.length(1);
|
|
209
|
+
});
|
|
210
|
+
cy.checkAxe();
|
|
211
|
+
});
|
|
212
|
+
it('has zero violations when the columns reorder searchbox returns 0 results', function () {
|
|
213
|
+
cy.get('button[data-test-subj="dataGridColumnSelectorButton"]').realClick();
|
|
214
|
+
cy.get('input[data-test-subj="dataGridColumnSelectorSearch"]').type('x');
|
|
215
|
+
cy.get('div.euiSwitch--compressed').should(function ($s) {
|
|
216
|
+
expect($s).to.have.length(0);
|
|
217
|
+
});
|
|
218
|
+
cy.checkAxe();
|
|
219
|
+
});
|
|
220
|
+
it('has zero violations when the keyboard shortcut menu is open', function () {
|
|
221
|
+
cy.get('button[data-test-subj="dataGridKeyboardShortcutsButton"]').realClick();
|
|
222
|
+
cy.checkAxe();
|
|
223
|
+
});
|
|
224
|
+
it('has zero violations when the grid display menu is open', function () {
|
|
225
|
+
cy.get('button[data-test-subj="dataGridDisplaySelectorButton"]').realClick();
|
|
226
|
+
cy.checkAxe();
|
|
227
|
+
});
|
|
228
|
+
it('has zero violations when the column actions menu is open', function () {
|
|
229
|
+
cy.get('button.euiDataGridHeaderCell__button').first().realClick();
|
|
230
|
+
cy.checkAxe();
|
|
231
|
+
});
|
|
232
|
+
it('has zero violations when a cell expansion popover is open', function () {
|
|
233
|
+
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').realClick();
|
|
234
|
+
cy.get('div[data-gridcell-visible-row-index="0"][data-gridcell-column-index="1"]').find('button.euiButtonIcon').last().realClick();
|
|
235
|
+
cy.checkAxe();
|
|
236
|
+
});
|
|
237
|
+
it('has zero violations when the Favorite Distro column has been sorted', function () {
|
|
238
|
+
cy.get('button.euiDataGridHeaderCell__button').last().realClick();
|
|
239
|
+
cy.get('button.euiListGroupItem__button').contains('Sort Alma to Debian').should('exist').realClick();
|
|
240
|
+
cy.checkAxe();
|
|
241
|
+
});
|
|
242
|
+
it('has zero violations when fullscreen is open', function () {
|
|
243
|
+
cy.get('button[data-test-subj="dataGridFullScreenButton"]').realClick();
|
|
244
|
+
cy.get('div.euiDataGrid--fullScreen').should('exist');
|
|
245
|
+
cy.checkAxe();
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
});
|
|
@@ -223,7 +223,9 @@ var EuiRefreshInterval = /*#__PURE__*/function (_Component) {
|
|
|
223
223
|
units = _this$state5.units;
|
|
224
224
|
return (0, _react2.jsx)(_time_options.RenderI18nTimeOptions, null, function (_ref3) {
|
|
225
225
|
var refreshUnitsOptions = _ref3.refreshUnitsOptions;
|
|
226
|
-
return (0, _react2.jsx)("fieldset",
|
|
226
|
+
return (0, _react2.jsx)("fieldset", {
|
|
227
|
+
className: "euiQuickSelectPopover__panel"
|
|
228
|
+
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
227
229
|
alignItems: "center",
|
|
228
230
|
gutterSize: "s",
|
|
229
231
|
responsive: false,
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
8
|
+
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
|
|
11
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
12
|
+
|
|
13
|
+
var _date_picker = require("./date_picker");
|
|
14
|
+
|
|
15
|
+
var _form = require("../form");
|
|
16
|
+
|
|
17
|
+
var _react2 = require("@emotion/react");
|
|
18
|
+
|
|
19
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
+
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
25
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
26
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
27
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
28
|
+
* Side Public License, v 1.
|
|
29
|
+
*/
|
|
30
|
+
/// <reference types="../../../cypress/support"/>
|
|
31
|
+
var DatePicker = function DatePicker() {
|
|
32
|
+
var _useState = (0, _react.useState)((0, _moment.default)()),
|
|
33
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
34
|
+
startDate = _useState2[0],
|
|
35
|
+
setStartDate = _useState2[1];
|
|
36
|
+
|
|
37
|
+
var handleChange = function handleChange(date) {
|
|
38
|
+
setStartDate(date);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (0, _react2.jsx)(_form.EuiFormRow, {
|
|
42
|
+
label: "Select a date"
|
|
43
|
+
}, (0, _react2.jsx)(_date_picker.EuiDatePicker, {
|
|
44
|
+
selected: startDate,
|
|
45
|
+
onChange: handleChange
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
beforeEach(function () {
|
|
50
|
+
cy.realMount((0, _react2.jsx)(DatePicker, null));
|
|
51
|
+
cy.get('input.euiDatePicker').should('exist');
|
|
52
|
+
});
|
|
53
|
+
describe('EuiDatePicker', function () {
|
|
54
|
+
describe('Automated accessibility check', function () {
|
|
55
|
+
it('has zero violations on first render', function () {
|
|
56
|
+
cy.checkAxe();
|
|
57
|
+
});
|
|
58
|
+
it('has zero violations when the calendar widget is expanded', function () {
|
|
59
|
+
cy.get('input.euiDatePicker').realClick();
|
|
60
|
+
cy.get('div.react-datepicker').should('exist');
|
|
61
|
+
cy.checkAxe();
|
|
62
|
+
});
|
|
63
|
+
it('has zero violations after picking a date with arrow keys', function () {
|
|
64
|
+
cy.realPress('Tab');
|
|
65
|
+
cy.get('div.react-datepicker').should('exist');
|
|
66
|
+
cy.repeatRealPress('ArrowDown');
|
|
67
|
+
cy.realPress('ArrowRight');
|
|
68
|
+
cy.realPress('Enter');
|
|
69
|
+
cy.get('div.react-datepicker').should('not.exist');
|
|
70
|
+
cy.checkAxe();
|
|
71
|
+
});
|
|
72
|
+
it('has zero violations after picking a date with dropdown menus', function () {
|
|
73
|
+
cy.realPress('Tab');
|
|
74
|
+
cy.get('div.react-datepicker').should('exist');
|
|
75
|
+
cy.repeatRealPress('Tab', 4);
|
|
76
|
+
cy.get('div.react-datepicker__month-read-view').should('have.focus');
|
|
77
|
+
cy.realPress('Space');
|
|
78
|
+
cy.repeatRealPress('ArrowDown');
|
|
79
|
+
cy.realPress('Enter');
|
|
80
|
+
cy.realPress('Tab');
|
|
81
|
+
cy.realPress('Space');
|
|
82
|
+
cy.repeatRealPress('ArrowDown');
|
|
83
|
+
cy.realPress('Enter');
|
|
84
|
+
cy.checkAxe();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
@@ -54,10 +54,13 @@ var EuiCommonlyUsedTimeRanges = function EuiCommonlyUsedTimeRanges(_ref) {
|
|
|
54
54
|
"data-test-subj": dataTestSubj
|
|
55
55
|
}, label));
|
|
56
56
|
});
|
|
57
|
-
return (0, _react2.jsx)("fieldset",
|
|
57
|
+
return (0, _react2.jsx)("fieldset", {
|
|
58
|
+
className: "euiQuickSelectPopover__panel"
|
|
59
|
+
}, (0, _react2.jsx)(_title.EuiTitle, {
|
|
58
60
|
size: "xxxs"
|
|
59
61
|
}, (0, _react2.jsx)("legend", {
|
|
60
|
-
id: legendId
|
|
62
|
+
id: legendId,
|
|
63
|
+
className: "euiQuickSelectPopover__panelTitle"
|
|
61
64
|
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
62
65
|
token: "euiCommonlyUsedTimeRanges.legend",
|
|
63
66
|
default: "Commonly used"
|
package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js
CHANGED
|
@@ -191,7 +191,9 @@ var EuiQuickSelect = /*#__PURE__*/function (_Component) {
|
|
|
191
191
|
return value === timeUnits;
|
|
192
192
|
});
|
|
193
193
|
var timeUnit = matchedTimeUnit ? matchedTimeUnit.text : '';
|
|
194
|
-
return (0, _react2.jsx)("fieldset",
|
|
194
|
+
return (0, _react2.jsx)("fieldset", {
|
|
195
|
+
className: "euiQuickSelectPopover__panel"
|
|
196
|
+
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
195
197
|
token: "euiQuickSelect.legendText",
|
|
196
198
|
default: "Quick select a time range"
|
|
197
199
|
}, function (legendText) {
|