@elastic/eui 71.1.0 → 72.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +13 -1
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +20 -176
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +20 -176
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +2 -2
- package/es/components/basic_table/in_memory_table.js +3 -6
- package/es/components/basic_table/table.a11y.js +128 -0
- package/es/components/color_picker/color_picker.styles.js +16 -0
- package/es/components/color_picker/color_stops/color_stop_thumb.js +19 -7
- package/es/components/color_picker/color_stops/color_stop_thumb.styles.js +59 -0
- package/es/components/color_picker/color_stops/color_stops.js +25 -15
- package/es/components/color_picker/color_stops/color_stops.styles.js +65 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- 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/error_boundary/error_boundary.a11y.js +67 -0
- 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/form/range/range_highlight.styles.js +1 -1
- package/es/components/form/range/range_levels.styles.js +1 -1
- package/es/components/form/range/range_track.js +5 -2
- 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/image/image.a11y.js +55 -0
- package/es/components/key_pad_menu/key_pad_menu.a11y.js +158 -0
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/es/components/popover/popover.js +2 -2
- package/es/components/selectable/selectable.js +4 -3
- package/es/components/selectable/selectable_list/selectable_list.js +17 -5
- package/es/components/table/table_footer_cell.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/table/table_row_cell.js +2 -2
- 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/es/services/color/manipulation.js +9 -0
- package/es/services/index.js +11 -11
- package/eui.d.ts +195 -138
- package/i18ntokens.json +46 -30
- package/lib/components/basic_table/basic_table.js +2 -2
- package/lib/components/basic_table/in_memory_table.js +3 -6
- package/lib/components/basic_table/table.a11y.js +139 -0
- package/lib/components/color_picker/color_picker.styles.js +26 -0
- package/lib/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/lib/components/color_picker/color_stops/color_stops.js +25 -14
- package/lib/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- 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/error_boundary/error_boundary.a11y.js +75 -0
- 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/form/range/range_highlight.styles.js +1 -1
- package/lib/components/form/range/range_levels.styles.js +1 -1
- package/lib/components/form/range/range_track.js +6 -2
- 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/image/image.a11y.js +61 -0
- package/lib/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/lib/components/popover/popover.js +2 -2
- package/lib/components/selectable/selectable.js +4 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +17 -5
- package/lib/components/table/table_footer_cell.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/table/table_row_cell.js +2 -2
- 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/lib/services/color/manipulation.js +14 -2
- package/lib/services/index.js +65 -58
- package/optimize/es/components/basic_table/table.a11y.js +128 -0
- package/optimize/es/components/color_picker/color_picker.styles.js +16 -0
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.js +19 -7
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.styles.js +59 -0
- package/optimize/es/components/color_picker/color_stops/color_stops.js +25 -15
- package/optimize/es/components/color_picker/color_stops/color_stops.styles.js +65 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- 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/error_boundary/error_boundary.a11y.js +67 -0
- 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/form/range/range_highlight.styles.js +1 -1
- package/optimize/es/components/form/range/range_levels.styles.js +1 -1
- package/optimize/es/components/form/range/range_track.js +5 -2
- 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/image/image.a11y.js +55 -0
- package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +148 -0
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/optimize/es/components/popover/popover.js +2 -2
- 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/es/services/color/manipulation.js +9 -0
- package/optimize/es/services/index.js +11 -11
- package/optimize/lib/components/basic_table/table.a11y.js +139 -0
- package/optimize/lib/components/color_picker/color_picker.styles.js +26 -0
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/optimize/lib/components/color_picker/color_stops/color_stops.js +25 -14
- package/optimize/lib/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- 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/error_boundary/error_boundary.a11y.js +75 -0
- 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/form/range/range_highlight.styles.js +1 -1
- package/optimize/lib/components/form/range/range_levels.styles.js +1 -1
- package/optimize/lib/components/form/range/range_track.js +6 -2
- 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/image/image.a11y.js +61 -0
- package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/optimize/lib/components/popover/popover.js +2 -2
- 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/optimize/lib/services/color/manipulation.js +14 -2
- package/optimize/lib/services/index.js +65 -58
- package/package.json +4 -6
- package/src/components/color_picker/_index.scss +0 -1
- package/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss +14 -0
- package/src/components/form/file_picker/_file_picker.scss +14 -14
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +2 -2
- package/test-env/components/basic_table/in_memory_table.js +3 -6
- package/test-env/components/basic_table/table.a11y.js +139 -0
- package/test-env/components/color_picker/color_picker.styles.js +26 -0
- package/test-env/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/test-env/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/test-env/components/color_picker/color_stops/color_stops.js +25 -14
- package/test-env/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- 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/error_boundary/error_boundary.a11y.js +75 -0
- 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/form/range/range_highlight.styles.js +1 -1
- package/test-env/components/form/range/range_levels.styles.js +1 -1
- package/test-env/components/form/range/range_track.js +6 -2
- 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/image/image.a11y.js +61 -0
- package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/test-env/components/popover/popover.js +2 -2
- 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/table/table_footer_cell.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/table/table_row_cell.js +2 -2
- 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/test-env/services/color/manipulation.js +14 -2
- package/test-env/services/index.js +65 -58
- package/src/components/color_picker/color_stops/_color_stops.scss +0 -101
- package/src/components/color_picker/color_stops/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_color_stops.scss +0 -58
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _icon = require("./icon");
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@emotion/react");
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
/// <reference types="../../../cypress/support"/>
|
|
19
|
+
describe('EuiIcons', function () {
|
|
20
|
+
describe('Automated accessibility check for editor icons', function () {
|
|
21
|
+
var EditorIcons = ['editorAlignCenter', 'editorAlignLeft', 'editorAlignRight', 'editorBold', 'editorChecklist', 'editorCodeBlock', 'editorComment', 'editorDistributeHorizontal', 'editorDistributeVertical', 'editorHeading', 'editorItalic', 'editorItemAlignBottom', 'editorItemAlignCenter', 'editorItemAlignLeft', 'editorItemAlignMiddle', 'editorItemAlignRight', 'editorItemAlignTop', 'editorLink', 'editorOrderedList', 'editorPositionBottomLeft', 'editorPositionBottomRight', 'editorPositionTopLeft', 'editorPositionTopRight', 'editorRedo', 'editorStrike', 'editorTable', 'editorUnderline', 'editorUndo', 'editorUnorderedList'];
|
|
22
|
+
|
|
23
|
+
var EditorGrid = function EditorGrid() {
|
|
24
|
+
return (0, _react2.jsx)("div", null, EditorIcons.map(function (glyph) {
|
|
25
|
+
return (0, _react2.jsx)(_icon.EuiIcon, {
|
|
26
|
+
className: "eui-alignMiddle",
|
|
27
|
+
type: glyph
|
|
28
|
+
});
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it('has zero violations on first render', function () {
|
|
33
|
+
cy.mount((0, _react2.jsx)(EditorGrid, null));
|
|
34
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
35
|
+
timeout: 5000
|
|
36
|
+
}).should('have.length', 29);
|
|
37
|
+
cy.checkAxe();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _icon = require("./icon");
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@emotion/react");
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
/// <reference types="../../../cypress/support"/>
|
|
19
|
+
describe('EuiIcons', function () {
|
|
20
|
+
describe('Automated accessibility check for Elastic logos', function () {
|
|
21
|
+
var ElasticLogos = ['logoElastic', 'logoElasticStack', 'logoElasticsearch', 'logoAppSearch', 'logoBeats', 'logoBusinessAnalytics', 'logoCloud', 'logoCloudEnterprise', 'logoEnterpriseSearch', 'logoKibana', 'logoLogging', 'logoLogstash', 'logoMaps', 'logoMetrics', 'logoObservability', 'logoSecurity', 'logoSiteSearch', 'logoUptime', 'logoWorkplaceSearch'];
|
|
22
|
+
|
|
23
|
+
var ElasticGrid = function ElasticGrid() {
|
|
24
|
+
return (0, _react2.jsx)("div", null, ElasticLogos.map(function (glyph) {
|
|
25
|
+
return (0, _react2.jsx)(_icon.EuiIcon, {
|
|
26
|
+
className: "eui-alignMiddle",
|
|
27
|
+
type: glyph
|
|
28
|
+
});
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it('has zero violations on first render', function () {
|
|
33
|
+
cy.mount((0, _react2.jsx)(ElasticGrid, null));
|
|
34
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
35
|
+
timeout: 5000
|
|
36
|
+
}).should('have.length', 19);
|
|
37
|
+
cy.checkAxe();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _icon = require("./icon");
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@emotion/react");
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
/// <reference types="../../../cypress/support"/>
|
|
19
|
+
describe('EuiIcons', function () {
|
|
20
|
+
describe('Automated accessibility check for glyph icons', function () {
|
|
21
|
+
var GlyphIcons = ['accessibility', 'aggregate', 'alert', 'analyzeEvent', 'annotation', 'apmTrace', 'apps', 'arrowDown', 'arrowLeft', 'arrowRight', 'arrowUp', 'arrowStart', 'arrowEnd', 'article', 'asterisk', 'beaker', 'bell', 'bellSlash', 'beta', 'bolt', 'boxesHorizontal', 'boxesVertical', 'branch', 'branchUser', 'broom', 'brush', 'bug', 'bullseye', 'calendar', 'check', 'checkInCircleFilled', 'cheer', 'clock', 'cloudDrizzle', 'cloudStormy', 'cloudSunny', 'cluster', 'color', 'compute', 'console', 'container', 'continuityAbove', 'continuityAboveBelow', 'continuityBelow', 'continuityWithin', 'controlsHorizontal', 'controlsVertical', 'copy', 'copyClipboard', 'cross', 'crosshairs', 'crossInACircleFilled', 'currency', 'cut', 'database', 'desktop', 'discuss', 'document', 'documents', 'documentEdit', 'documentation', 'dot', 'dotInCircle', 'doubleArrowLeft', 'doubleArrowRight', 'download', 'email', 'empty', 'eql', 'eraser', 'exit', 'expand', 'expandMini', 'exportAction', 'eye', 'eyeClosed', 'faceHappy', 'faceNeutral', 'faceSad', 'filter', 'filterExclude', 'filterIgnore', 'filterInclude', 'filterInCircle', 'flag', 'fold', 'folderCheck', 'folderClosed', 'folderExclamation', 'folderOpen', 'frameNext', 'framePrevious', 'fullScreen', 'fullScreenExit', 'function', 'gear', 'glasses', 'globe', 'grab', 'grabHorizontal', 'grid', 'heart', 'heatmap', 'help', 'home', 'iInCircle', 'image', 'importAction', 'indexClose', 'indexEdit', 'indexFlush', 'indexMapping', 'indexOpen', 'indexRuntime', 'indexSettings', 'indexTemporary', 'infinity', 'inputOutput', 'inspect', 'invert', 'ip', 'keyboard', 'kqlField', 'kqlFunction', 'kqlOperand', 'kqlSelector', 'kqlValue', 'kubernetesNode', 'kubernetesPod', 'launch', 'layers', 'lettering', 'lineDashed', 'lineDotted', 'lineSolid', 'link', 'list', 'listAdd', 'lock', 'lockOpen', 'logstashFilter', 'logstashIf', 'logstashInput', 'logstashOutput', 'logstashQueue', 'magnifyWithExclamation', 'magnifyWithMinus', 'magnifyWithPlus', 'magnet', 'mapMarker', 'memory', 'merge', 'menu', 'menuDown', 'menuLeft', 'menuRight', 'menuUp', 'minimize', 'minus', 'minusInCircle', 'minusInCircleFilled', 'mobile', 'moon', 'namespace', 'nested', 'node', 'number', 'offline', 'online', 'package', 'pageSelect', 'pagesSelect', 'paperClip', 'partial', 'pause', 'payment', 'pencil', 'percent', 'pin', 'pinFilled', 'play', 'playFilled', 'plus', 'plusInCircle', 'plusInCircleFilled', 'popout', 'push', 'questionInCircle', 'quote', 'refresh', 'reporter', 'returnKey', 'save', 'scale', 'search', 'securitySignal', 'securitySignalDetected', 'securitySignalResolved', 'sessionViewer', 'shard', 'share', 'snowflake', 'sortable', 'sortAscending', 'sortDescending', 'sortDown', 'sortLeft', 'sortRight', 'sortUp', 'spaces', 'starEmpty', 'starEmptySpace', 'starFilled', 'starFilledSpace', 'starMinusEmpty', 'starMinusFilled', 'starPlusEmpty', 'starPlusFilled', 'stats', 'stop', 'stopFilled', 'stopSlash', 'storage', 'string', 'submodule', 'sun', 'symlink', 'tableOfContents', 'tableDensityExpanded', 'tableDensityCompact', 'tableDensityNormal', 'tag', 'tear', 'temperature', 'timeline', 'timeRefresh', 'timeslider', 'training', 'trash', 'unfold', 'unlink', 'user', 'userAvatar', 'users', 'vector', 'videoPlayer', 'visArea', 'visAreaStacked', 'visBarHorizontal', 'visBarHorizontalStacked', 'visBarVertical', 'visBarVerticalStacked', 'visGauge', 'visGoal', 'visLine', 'visMapCoordinate', 'visMapRegion', 'visMetric', 'visPie', 'visTable', 'visTagCloud', 'visText', 'visTimelion', 'visVega', 'visVisualBuilder', 'wordWrap', 'wordWrapDisabled', 'wrench'];
|
|
22
|
+
|
|
23
|
+
var GlyphGrid = function GlyphGrid() {
|
|
24
|
+
return (0, _react2.jsx)("div", null, GlyphIcons.map(function (glyph) {
|
|
25
|
+
return (0, _react2.jsx)(_icon.EuiIcon, {
|
|
26
|
+
className: "eui-alignMiddle",
|
|
27
|
+
type: glyph
|
|
28
|
+
});
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it('has zero violations on first render', function () {
|
|
33
|
+
cy.mount((0, _react2.jsx)(GlyphGrid, null));
|
|
34
|
+
cy.get('svg[data-icon-type="wrench"]', {
|
|
35
|
+
timeout: 5000
|
|
36
|
+
}).should('exist');
|
|
37
|
+
cy.checkAxe();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _icon = require("./icon");
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@emotion/react");
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
/// <reference types="../../../cypress/support"/>
|
|
19
|
+
describe('EuiIcons', function () {
|
|
20
|
+
describe('Automated accessibility check for token icons', function () {
|
|
21
|
+
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'];
|
|
22
|
+
|
|
23
|
+
var TokenGrid = function TokenGrid() {
|
|
24
|
+
return (0, _react2.jsx)("div", null, TokenIcons.map(function (glyph) {
|
|
25
|
+
return (0, _react2.jsx)(_icon.EuiIcon, {
|
|
26
|
+
className: "eui-alignMiddle",
|
|
27
|
+
type: glyph
|
|
28
|
+
});
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
it('has zero violations on first render', function () {
|
|
33
|
+
cy.mount((0, _react2.jsx)(TokenGrid, null));
|
|
34
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
35
|
+
timeout: 5000
|
|
36
|
+
}).should('have.length', 53);
|
|
37
|
+
cy.checkAxe();
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _image = require("./image");
|
|
6
|
+
|
|
7
|
+
var _react2 = require("@emotion/react");
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
/// <reference types="../../../cypress/support"/>
|
|
19
|
+
var Image = function Image() {
|
|
20
|
+
return (0, _react2.jsx)(_image.EuiImage, {
|
|
21
|
+
size: "m",
|
|
22
|
+
hasShadow: true,
|
|
23
|
+
allowFullScreen: true,
|
|
24
|
+
caption: "Albert Einstein, theoretical physicist",
|
|
25
|
+
alt: "" // Because this image is sufficiently described by its caption, there is no need to repeat it via alt text
|
|
26
|
+
,
|
|
27
|
+
src: "https://upload.wikimedia.org/wikipedia/commons/d/d3/Albert_Einstein_Head.jpg"
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
beforeEach(function () {
|
|
32
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
33
|
+
|
|
34
|
+
cy.realMount((0, _react2.jsx)(Image, null));
|
|
35
|
+
cy.get('figure[aria-label="Albert Einstein, theoretical physicist"]').should('exist');
|
|
36
|
+
});
|
|
37
|
+
describe('EuiImage', function () {
|
|
38
|
+
describe('Automated accessibility check', function () {
|
|
39
|
+
it('has zero violations on first render', function () {
|
|
40
|
+
cy.checkAxe();
|
|
41
|
+
});
|
|
42
|
+
it('has zero violations on fullscreen render', function () {
|
|
43
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').realClick();
|
|
44
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('exist');
|
|
45
|
+
cy.checkAxe();
|
|
46
|
+
cy.get('div[data-test-subj="fullScreenOverlayMask"]').realClick();
|
|
47
|
+
cy.checkAxe();
|
|
48
|
+
});
|
|
49
|
+
it('has zero violations on keyboard interaction', function () {
|
|
50
|
+
cy.realPress('Tab');
|
|
51
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').should('have.focus');
|
|
52
|
+
cy.realPress('Enter');
|
|
53
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('exist');
|
|
54
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('have.focus');
|
|
55
|
+
cy.checkAxe();
|
|
56
|
+
cy.realPress('Escape');
|
|
57
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').should('have.focus');
|
|
58
|
+
cy.checkAxe();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
|
|
7
|
+
var _key_pad_menu = require("./key_pad_menu");
|
|
8
|
+
|
|
9
|
+
var _key_pad_menu_item = require("./key_pad_menu_item");
|
|
10
|
+
|
|
11
|
+
var _icon = require("../icon");
|
|
12
|
+
|
|
13
|
+
var _services = require("../../services");
|
|
14
|
+
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
16
|
+
|
|
17
|
+
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); }
|
|
18
|
+
|
|
19
|
+
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; }
|
|
20
|
+
|
|
21
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
|
+
|
|
23
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
|
|
25
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
26
|
+
|
|
27
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
28
|
+
|
|
29
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
30
|
+
|
|
31
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
|
+
|
|
33
|
+
var KeyPadMenu = function KeyPadMenu() {
|
|
34
|
+
var keypadButtonId__1 = (0, _services.useGeneratedHtmlId)({
|
|
35
|
+
prefix: 'keypadButton',
|
|
36
|
+
suffix: 'first'
|
|
37
|
+
});
|
|
38
|
+
var keypadButtonId__2 = (0, _services.useGeneratedHtmlId)({
|
|
39
|
+
prefix: 'keypadButton',
|
|
40
|
+
suffix: 'second'
|
|
41
|
+
});
|
|
42
|
+
var keypadButtonId__3 = (0, _services.useGeneratedHtmlId)({
|
|
43
|
+
prefix: 'keypadButton',
|
|
44
|
+
suffix: 'third'
|
|
45
|
+
});
|
|
46
|
+
var keypadButtonId__4 = (0, _services.useGeneratedHtmlId)({
|
|
47
|
+
prefix: 'keypadButton',
|
|
48
|
+
suffix: 'fourth'
|
|
49
|
+
});
|
|
50
|
+
var keypadButtonId__5 = (0, _services.useGeneratedHtmlId)({
|
|
51
|
+
prefix: 'keypadButton',
|
|
52
|
+
suffix: 'fifth'
|
|
53
|
+
});
|
|
54
|
+
var keypadButtonId__6 = (0, _services.useGeneratedHtmlId)({
|
|
55
|
+
prefix: 'keypadButton',
|
|
56
|
+
suffix: 'sixth'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _useState = (0, _react.useState)(keypadButtonId__6),
|
|
60
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
61
|
+
selectedID = _useState2[0],
|
|
62
|
+
setSelectedID = _useState2[1];
|
|
63
|
+
|
|
64
|
+
return (0, _react2.jsx)("div", {
|
|
65
|
+
"aria-label": "Menu keypad"
|
|
66
|
+
}, (0, _react2.jsx)(_key_pad_menu.EuiKeyPadMenu, null, (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
67
|
+
"data-test-subj": "cy-keypad-button-1",
|
|
68
|
+
id: keypadButtonId__1,
|
|
69
|
+
label: "Button 1",
|
|
70
|
+
isSelected: selectedID === keypadButtonId__1,
|
|
71
|
+
onClick: function onClick() {
|
|
72
|
+
return setSelectedID(keypadButtonId__1);
|
|
73
|
+
}
|
|
74
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
75
|
+
type: "grid",
|
|
76
|
+
size: "l"
|
|
77
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
78
|
+
"data-test-subj": "cy-keypad-button-2",
|
|
79
|
+
id: keypadButtonId__2,
|
|
80
|
+
label: "Button 2",
|
|
81
|
+
isSelected: selectedID === keypadButtonId__2,
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
return setSelectedID(keypadButtonId__2);
|
|
84
|
+
}
|
|
85
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
86
|
+
type: "grid",
|
|
87
|
+
size: "l"
|
|
88
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
89
|
+
"data-test-subj": "cy-keypad-button-3",
|
|
90
|
+
id: keypadButtonId__3,
|
|
91
|
+
label: "Button 3",
|
|
92
|
+
isSelected: selectedID === keypadButtonId__3,
|
|
93
|
+
onClick: function onClick() {
|
|
94
|
+
return setSelectedID(keypadButtonId__3);
|
|
95
|
+
}
|
|
96
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
97
|
+
type: "grid",
|
|
98
|
+
size: "l"
|
|
99
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
100
|
+
"data-test-subj": "cy-keypad-link-1",
|
|
101
|
+
id: keypadButtonId__4,
|
|
102
|
+
label: "Link 1",
|
|
103
|
+
href: "#/navigation/key-pad-menu",
|
|
104
|
+
isSelected: selectedID === keypadButtonId__4,
|
|
105
|
+
onClick: function onClick() {
|
|
106
|
+
return setSelectedID(keypadButtonId__4);
|
|
107
|
+
}
|
|
108
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
109
|
+
type: "link",
|
|
110
|
+
size: "l"
|
|
111
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
112
|
+
"data-test-subj": "cy-keypad-link-2",
|
|
113
|
+
id: keypadButtonId__5,
|
|
114
|
+
label: "Link 2",
|
|
115
|
+
href: "#/navigation/key-pad-menu",
|
|
116
|
+
isSelected: selectedID === keypadButtonId__5,
|
|
117
|
+
onClick: function onClick() {
|
|
118
|
+
return setSelectedID(keypadButtonId__5);
|
|
119
|
+
}
|
|
120
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
121
|
+
type: "link",
|
|
122
|
+
size: "l"
|
|
123
|
+
})), (0, _react2.jsx)(_key_pad_menu_item.EuiKeyPadMenuItem, {
|
|
124
|
+
"data-test-subj": "cy-keypad-link-3",
|
|
125
|
+
id: keypadButtonId__6,
|
|
126
|
+
label: "Disabled Link 3",
|
|
127
|
+
isDisabled: true,
|
|
128
|
+
isSelected: selectedID === keypadButtonId__6
|
|
129
|
+
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
130
|
+
type: "link",
|
|
131
|
+
size: "l"
|
|
132
|
+
}))));
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
beforeEach(function () {
|
|
136
|
+
cy.realMount((0, _react2.jsx)(KeyPadMenu, null));
|
|
137
|
+
cy.get('div[aria-label="Menu keypad"]').should('exist');
|
|
138
|
+
});
|
|
139
|
+
describe('EuiKeyPadMenu', function () {
|
|
140
|
+
describe('Automated accessibility check', function () {
|
|
141
|
+
it('has zero violations on first render', function () {
|
|
142
|
+
cy.checkAxe();
|
|
143
|
+
});
|
|
144
|
+
it('has zero violations on item click', function () {
|
|
145
|
+
cy.get('a[data-test-subj="cy-keypad-link-2"]').realClick();
|
|
146
|
+
cy.get('a[data-test-subj="cy-keypad-link-2"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
147
|
+
cy.checkAxe();
|
|
148
|
+
});
|
|
149
|
+
it('has zero violations on item keypress', function () {
|
|
150
|
+
cy.repeatRealPress('Tab', 3);
|
|
151
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('have.focus');
|
|
152
|
+
cy.realPress('Space');
|
|
153
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
154
|
+
cy.checkAxe();
|
|
155
|
+
cy.realPress(['Shift', 'Tab']);
|
|
156
|
+
cy.get('button[data-test-subj="cy-keypad-button-2"]').should('have.focus');
|
|
157
|
+
cy.realPress('Space');
|
|
158
|
+
cy.get('button[data-test-subj="cy-keypad-button-2"]').should('have.class', 'euiKeyPadMenuItem-isSelected');
|
|
159
|
+
cy.get('button[data-test-subj="cy-keypad-button-3"]').should('not.have.class', 'euiKeyPadMenuItem-isSelected');
|
|
160
|
+
cy.checkAxe();
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
});
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.getDefaultEuiMarkdownParsingPlugins = exports.defaultParsingPlugins = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _remarkParseNoTrim = _interopRequireDefault(require("remark-parse-no-trim"));
|
|
11
11
|
|
|
12
12
|
var _remarkEmoji = _interopRequireDefault(require("remark-emoji"));
|
|
13
13
|
|
|
@@ -43,7 +43,7 @@ var getDefaultEuiMarkdownParsingPlugins = function getDefaultEuiMarkdownParsingP
|
|
|
43
43
|
exclude = _ref.exclude;
|
|
44
44
|
|
|
45
45
|
var excludeSet = new Set(exclude);
|
|
46
|
-
var parsingPlugins = [[
|
|
46
|
+
var parsingPlugins = [[_remarkParseNoTrim.default, {}], [_remark_prismjs.default, {}], [_remarkEmoji.default, {
|
|
47
47
|
emoticon: false
|
|
48
48
|
}], [_remarkBreaks.default, {}], [_markdown_link_validator.euiMarkdownLinkValidator, {
|
|
49
49
|
allowRelative: true,
|
|
@@ -535,13 +535,13 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
535
535
|
panel = (0, _react.jsx)(_portal.EuiPortal, {
|
|
536
536
|
insert: insert
|
|
537
537
|
}, (0, _react.jsx)(_focus_trap.EuiFocusTrap, _extends({
|
|
538
|
-
clickOutsideDisables: true
|
|
538
|
+
clickOutsideDisables: true,
|
|
539
|
+
onClickOutside: this.onClickOutside
|
|
539
540
|
}, focusTrapProps, {
|
|
540
541
|
returnFocus: returnFocus // Ignore temporary state of indecisive focus
|
|
541
542
|
,
|
|
542
543
|
initialFocus: initialFocus,
|
|
543
544
|
onDeactivation: onTrapDeactivation,
|
|
544
|
-
onClickOutside: this.onClickOutside,
|
|
545
545
|
onEscapeKey: this.onEscapeKey,
|
|
546
546
|
disabled: !ownFocus || !this.state.isOpenStable || this.state.isClosing
|
|
547
547
|
}), (0, _react.jsx)(_popover_panel.EuiPopoverPanel, _extends({}, panelProps, {
|
|
@@ -294,7 +294,7 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
294
294
|
});
|
|
295
295
|
});
|
|
296
296
|
|
|
297
|
-
_defineProperty(_assertThisInitialized(_this), "onOptionClick", function (options, event) {
|
|
297
|
+
_defineProperty(_assertThisInitialized(_this), "onOptionClick", function (options, event, clickedOption) {
|
|
298
298
|
var _this$props = _this.props,
|
|
299
299
|
isPreFiltered = _this$props.isPreFiltered,
|
|
300
300
|
onChange = _this$props.onChange;
|
|
@@ -306,7 +306,7 @@ var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
|
306
306
|
});
|
|
307
307
|
|
|
308
308
|
if (onChange) {
|
|
309
|
-
onChange(options, event);
|
|
309
|
+
onChange(options, event, clickedOption);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
|
|
@@ -740,7 +740,8 @@ EuiSelectable.propTypes = {
|
|
|
740
740
|
|
|
741
741
|
/**
|
|
742
742
|
* Passes back the altered `options` array with selected options having `checked: 'on'`.
|
|
743
|
-
* Also passes back the React click/keyboard event as a second argument
|
|
743
|
+
* Also passes back the React click/keyboard event as a second argument,
|
|
744
|
+
* and the option that triggered the onChange event as a third argument.
|
|
744
745
|
*/
|
|
745
746
|
onChange: _propTypes.default.func,
|
|
746
747
|
|
|
@@ -241,6 +241,9 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
241
241
|
onOptionClick = _this$props4.onOptionClick,
|
|
242
242
|
options = _this$props4.options,
|
|
243
243
|
singleSelection = _this$props4.singleSelection;
|
|
244
|
+
|
|
245
|
+
var changedOption = _objectSpread({}, addedOption);
|
|
246
|
+
|
|
244
247
|
var updatedOptions = options.map(function (option) {
|
|
245
248
|
// if singleSelection is enabled, uncheck any selected option(s)
|
|
246
249
|
var updatedOption = _objectSpread({}, option);
|
|
@@ -252,11 +255,12 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
252
255
|
|
|
253
256
|
if (option === addedOption) {
|
|
254
257
|
updatedOption.checked = 'on';
|
|
258
|
+
changedOption = updatedOption;
|
|
255
259
|
}
|
|
256
260
|
|
|
257
261
|
return updatedOption;
|
|
258
262
|
});
|
|
259
|
-
onOptionClick(updatedOptions, event);
|
|
263
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
260
264
|
});
|
|
261
265
|
|
|
262
266
|
_defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
|
|
@@ -264,33 +268,40 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
264
268
|
onOptionClick = _this$props5.onOptionClick,
|
|
265
269
|
singleSelection = _this$props5.singleSelection,
|
|
266
270
|
options = _this$props5.options;
|
|
271
|
+
|
|
272
|
+
var changedOption = _objectSpread({}, removedOption);
|
|
273
|
+
|
|
267
274
|
var updatedOptions = options.map(function (option) {
|
|
268
275
|
var updatedOption = _objectSpread({}, option);
|
|
269
276
|
|
|
270
277
|
if (option === removedOption && singleSelection !== 'always') {
|
|
271
278
|
delete updatedOption.checked;
|
|
279
|
+
changedOption = updatedOption;
|
|
272
280
|
}
|
|
273
281
|
|
|
274
282
|
return updatedOption;
|
|
275
283
|
});
|
|
276
|
-
onOptionClick(updatedOptions, event);
|
|
284
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
277
285
|
});
|
|
278
286
|
|
|
279
287
|
_defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
|
|
280
288
|
var _this$props6 = _this.props,
|
|
281
289
|
onOptionClick = _this$props6.onOptionClick,
|
|
282
290
|
options = _this$props6.options;
|
|
283
|
-
|
|
291
|
+
|
|
292
|
+
var changedOption = _objectSpread({}, excludedOption);
|
|
293
|
+
|
|
284
294
|
var updatedOptions = options.map(function (option) {
|
|
285
295
|
var updatedOption = _objectSpread({}, option);
|
|
286
296
|
|
|
287
297
|
if (option === excludedOption) {
|
|
288
298
|
updatedOption.checked = 'off';
|
|
299
|
+
changedOption = updatedOption;
|
|
289
300
|
}
|
|
290
301
|
|
|
291
302
|
return updatedOption;
|
|
292
303
|
});
|
|
293
|
-
onOptionClick(updatedOptions, event);
|
|
304
|
+
onOptionClick(updatedOptions, event, changedOption);
|
|
294
305
|
});
|
|
295
306
|
|
|
296
307
|
return _this;
|
|
@@ -606,7 +617,8 @@ EuiSelectableList.propTypes = {
|
|
|
606
617
|
searchValue: _propTypes.default.string.isRequired,
|
|
607
618
|
|
|
608
619
|
/**
|
|
609
|
-
* Returns the array of options with altered checked state
|
|
620
|
+
* Returns the array of options with altered checked state, the click/keyboard event,
|
|
621
|
+
* and the option that triggered the click/keyboard event
|
|
610
622
|
*/
|
|
611
623
|
onOptionClick: _propTypes.default.func.isRequired,
|
|
612
624
|
|
|
@@ -58,6 +58,6 @@ EuiTableFooterCell.propTypes = {
|
|
|
58
58
|
"aria-label": _propTypes.default.string,
|
|
59
59
|
"data-test-subj": _propTypes.default.string,
|
|
60
60
|
css: _propTypes.default.any,
|
|
61
|
-
align: _propTypes.default.
|
|
61
|
+
align: _propTypes.default.any,
|
|
62
62
|
width: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired])
|
|
63
63
|
};
|
|
@@ -151,7 +151,7 @@ EuiTableHeaderCell.propTypes = {
|
|
|
151
151
|
"aria-label": _propTypes.default.string,
|
|
152
152
|
"data-test-subj": _propTypes.default.string,
|
|
153
153
|
css: _propTypes.default.any,
|
|
154
|
-
align: _propTypes.default.
|
|
154
|
+
align: _propTypes.default.any,
|
|
155
155
|
isSortAscending: _propTypes.default.bool,
|
|
156
156
|
isSorted: _propTypes.default.bool,
|
|
157
157
|
|
|
@@ -211,7 +211,7 @@ EuiTableRowCell.propTypes = {
|
|
|
211
211
|
/**
|
|
212
212
|
* Horizontal alignment of the text in the cell
|
|
213
213
|
*/
|
|
214
|
-
align: _propTypes.default.
|
|
214
|
+
align: _propTypes.default.any,
|
|
215
215
|
|
|
216
216
|
/**
|
|
217
217
|
* _Should only be used for action cells_
|
|
@@ -233,7 +233,7 @@ EuiTableRowCell.propTypes = {
|
|
|
233
233
|
/**
|
|
234
234
|
* Horizontal alignment of the text in the cell
|
|
235
235
|
*/
|
|
236
|
-
align: _propTypes.default.
|
|
236
|
+
align: _propTypes.default.any,
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
239
|
* _Should only be used for action cells_
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.EuiTab = void 0;
|
|
7
9
|
|
|
8
|
-
var _react =
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
11
|
|
|
10
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
|
|
@@ -17,12 +19,18 @@ var _href_validator = require("../../services/security/href_validator");
|
|
|
17
19
|
|
|
18
20
|
var _tab = require("./tab.styles");
|
|
19
21
|
|
|
22
|
+
var _tabs_context = require("./tabs_context");
|
|
23
|
+
|
|
20
24
|
var _react2 = require("@emotion/react");
|
|
21
25
|
|
|
22
|
-
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"
|
|
26
|
+
var _excluded = ["isSelected", "children", "className", "disabled", "href", "target", "rel", "prepend", "append"];
|
|
23
27
|
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
29
|
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
26
34
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
35
|
|
|
28
36
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -39,11 +47,12 @@ var EuiTab = function EuiTab(_ref) {
|
|
|
39
47
|
rel = _ref.rel,
|
|
40
48
|
prepend = _ref.prepend,
|
|
41
49
|
append = _ref.append,
|
|
42
|
-
_ref$size = _ref.size,
|
|
43
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
44
|
-
expand = _ref.expand,
|
|
45
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
46
51
|
|
|
52
|
+
var _useContext = (0, _react.useContext)(_tabs_context.EuiTabsContext),
|
|
53
|
+
size = _useContext.size,
|
|
54
|
+
expand = _useContext.expand;
|
|
55
|
+
|
|
47
56
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
48
57
|
var isHrefValid = !href || (0, _href_validator.validateHref)(href);
|
|
49
58
|
var disabled = _disabled || !isHrefValid; // Keep CSS classnames for reference
|
|
@@ -122,18 +131,6 @@ EuiTab.propTypes = {
|
|
|
122
131
|
* Will be excluded from interactive effects.
|
|
123
132
|
*/
|
|
124
133
|
append: _propTypes.default.node,
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Evenly stretches each tab to fill the
|
|
128
|
-
* horizontal space
|
|
129
|
-
*/
|
|
130
|
-
expand: _propTypes.default.bool,
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Sizes affect both font size and overall size.
|
|
134
|
-
* Only use the `xl` size when displayed as page titles.
|
|
135
|
-
*/
|
|
136
|
-
size: _propTypes.default.any,
|
|
137
134
|
className: _propTypes.default.string,
|
|
138
135
|
"aria-label": _propTypes.default.string,
|
|
139
136
|
"data-test-subj": _propTypes.default.string,
|