@elastic/eui 70.0.0 → 70.2.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_theme_dark.css +11 -180
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +11 -180
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/screen_reader_only/screen_reader_only.js +1 -1
- package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/es/components/accordion/accordion.a11y.js +35 -0
- package/es/components/badge/beta_badge/beta_badge.js +6 -6
- package/es/components/basic_table/in_memory_table.js +8 -0
- package/es/components/button/button_display/_button_display.js +7 -6
- package/es/components/button/button_display/_button_display.styles.js +4 -4
- package/es/components/button/button_display/_button_display_content.js +6 -9
- package/es/components/button/button_display/_button_display_content.styles.js +3 -41
- package/es/components/card/card.js +13 -31
- package/es/components/card/card.styles.js +15 -3
- package/es/components/card/card_select/card_select.styles.js +4 -4
- package/es/components/card/checkable_card/checkable_card.js +3 -2
- package/es/components/context_menu/context_menu_panel.a11y.js +34 -0
- package/es/components/datagrid/controls/column_selector.js +1 -1
- package/es/components/datagrid/controls/column_sorting.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar.js +6 -2
- package/es/components/datagrid/controls/index.js +1 -0
- package/es/components/datagrid/controls/keyboard_shortcuts.js +191 -0
- package/es/components/datagrid/data_grid.js +12 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +22 -4
- package/es/components/header/header_links/header_links.js +6 -0
- package/es/components/loading/loading_spinner.js +14 -3
- package/es/components/loading/loading_spinner.styles.js +11 -7
- package/es/components/modal/modal.js +17 -2
- package/es/components/page_template/page_template.js +6 -9
- package/es/components/popover/popover.js +13 -3
- package/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/es/components/popover/popover_panel/_popover_panel.js +8 -2
- package/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/es/components/search_bar/search_bar.js +39 -5
- package/es/components/search_bar/search_box.js +37 -4
- package/es/components/selectable/selectable.a11y.js +118 -0
- package/es/components/selectable/selectable.js +9 -6
- package/es/components/tabs/tab.js +31 -7
- package/es/components/tabs/tab.styles.js +63 -0
- package/es/components/tabs/tabbed_content/tabbed_content.js +17 -1
- package/es/components/tabs/tabs.js +20 -14
- package/es/components/tabs/tabs.styles.js +21 -0
- package/es/components/tour/tour_step.js +6 -0
- package/es/services/string/to_initials.js +1 -1
- package/eui.d.ts +305 -198
- package/i18ntokens.json +442 -10
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +1 -1
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/lib/components/accordion/accordion.a11y.js +44 -0
- package/lib/components/badge/beta_badge/beta_badge.js +6 -10
- package/lib/components/basic_table/in_memory_table.js +8 -0
- package/lib/components/button/button_display/_button_display.js +7 -6
- package/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/lib/components/button/button_display/_button_display_content.js +6 -9
- package/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- package/lib/components/card/card.js +14 -33
- package/lib/components/card/card.styles.js +15 -3
- package/lib/components/card/card_select/card_select.styles.js +4 -4
- package/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/lib/components/context_menu/context_menu_panel.a11y.js +42 -0
- package/lib/components/datagrid/controls/column_selector.js +1 -1
- package/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar.js +7 -2
- package/lib/components/datagrid/controls/index.js +8 -0
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +208 -0
- package/lib/components/datagrid/data_grid.js +11 -1
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +22 -4
- package/lib/components/header/header_links/header_links.js +6 -0
- package/lib/components/loading/loading_spinner.js +13 -2
- package/lib/components/loading/loading_spinner.styles.js +14 -6
- package/lib/components/modal/modal.js +23 -2
- package/lib/components/page_template/page_template.js +6 -9
- package/lib/components/popover/popover.js +13 -3
- package/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/lib/components/popover/popover_panel/_popover_panel.js +8 -2
- package/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/lib/components/search_bar/search_bar.js +40 -5
- package/lib/components/search_bar/search_box.js +38 -4
- package/lib/components/selectable/selectable.a11y.js +122 -0
- package/lib/components/selectable/selectable.js +9 -6
- package/lib/components/tabs/tab.js +31 -6
- package/lib/components/tabs/tab.styles.js +69 -0
- package/lib/components/tabs/tabbed_content/tabbed_content.js +17 -1
- package/lib/components/tabs/tabs.js +24 -14
- package/lib/components/tabs/tabs.styles.js +32 -0
- package/lib/services/string/to_initials.js +1 -1
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/optimize/es/components/accordion/accordion.a11y.js +35 -0
- package/optimize/es/components/badge/beta_badge/beta_badge.js +6 -6
- package/optimize/es/components/button/button_display/_button_display.js +6 -5
- package/optimize/es/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/es/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +3 -41
- package/optimize/es/components/card/card.js +12 -30
- package/optimize/es/components/card/card.styles.js +15 -3
- package/optimize/es/components/card/card_select/card_select.styles.js +4 -4
- package/optimize/es/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/es/components/context_menu/context_menu_panel.a11y.js +34 -0
- package/optimize/es/components/datagrid/controls/column_selector.js +1 -1
- package/optimize/es/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/es/components/datagrid/controls/data_grid_toolbar.js +6 -2
- package/optimize/es/components/datagrid/controls/index.js +1 -0
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +181 -0
- package/optimize/es/components/datagrid/data_grid.js +6 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +12 -4
- package/optimize/es/components/loading/loading_spinner.js +13 -3
- package/optimize/es/components/loading/loading_spinner.styles.js +11 -7
- package/optimize/es/components/modal/modal.js +17 -2
- package/optimize/es/components/page_template/page_template.js +6 -9
- package/optimize/es/components/popover/popover.js +7 -3
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/es/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/optimize/es/components/search_bar/search_bar.js +31 -5
- package/optimize/es/components/search_bar/search_box.js +29 -3
- package/optimize/es/components/selectable/selectable.a11y.js +107 -0
- package/optimize/es/components/selectable/selectable.js +9 -6
- package/optimize/es/components/tabs/tab.js +19 -7
- package/optimize/es/components/tabs/tab.styles.js +63 -0
- package/optimize/es/components/tabs/tabs.js +20 -14
- package/optimize/es/components/tabs/tabs.styles.js +21 -0
- package/optimize/es/services/string/to_initials.js +1 -1
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/optimize/lib/components/accordion/accordion.a11y.js +44 -0
- package/optimize/lib/components/badge/beta_badge/beta_badge.js +6 -13
- package/optimize/lib/components/button/button_display/_button_display.js +7 -6
- package/optimize/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/lib/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- package/optimize/lib/components/card/card.js +13 -32
- package/optimize/lib/components/card/card.styles.js +15 -3
- package/optimize/lib/components/card/card_select/card_select.styles.js +4 -4
- package/optimize/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/lib/components/context_menu/context_menu_panel.a11y.js +42 -0
- package/optimize/lib/components/datagrid/controls/column_selector.js +1 -1
- package/optimize/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar.js +7 -2
- package/optimize/lib/components/datagrid/controls/index.js +8 -0
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +207 -0
- package/optimize/lib/components/datagrid/data_grid.js +5 -1
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +12 -4
- package/optimize/lib/components/loading/loading_spinner.js +14 -2
- package/optimize/lib/components/loading/loading_spinner.styles.js +14 -6
- package/optimize/lib/components/modal/modal.js +22 -2
- package/optimize/lib/components/page_template/page_template.js +6 -9
- package/optimize/lib/components/popover/popover.js +7 -3
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/lib/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/optimize/lib/components/search_bar/search_bar.js +31 -5
- package/optimize/lib/components/search_bar/search_box.js +30 -3
- package/optimize/lib/components/selectable/selectable.a11y.js +122 -0
- package/optimize/lib/components/selectable/selectable.js +9 -6
- package/optimize/lib/components/tabs/tab.js +19 -6
- package/optimize/lib/components/tabs/tab.styles.js +69 -0
- package/optimize/lib/components/tabs/tabs.js +24 -14
- package/optimize/lib/components/tabs/tabs.styles.js +32 -0
- package/optimize/lib/services/string/to_initials.js +1 -1
- package/package.json +5 -4
- package/src/components/datagrid/_index.scss +1 -0
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +17 -0
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -8
- package/src/components/index.scss +0 -1
- package/src/components/modal/_modal.scss +3 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +1 -1
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/test-env/components/accordion/accordion.a11y.js +44 -0
- package/test-env/components/badge/beta_badge/beta_badge.js +6 -13
- package/test-env/components/basic_table/in_memory_table.js +8 -0
- package/test-env/components/button/button_display/_button_display.js +7 -6
- package/test-env/components/button/button_display/_button_display.styles.js +4 -4
- package/test-env/components/button/button_display/_button_display_content.js +6 -9
- package/test-env/components/button/button_display/_button_display_content.styles.js +10 -40
- package/test-env/components/card/card.js +14 -33
- package/test-env/components/card/card.styles.js +15 -3
- package/test-env/components/card/card_select/card_select.styles.js +4 -4
- package/test-env/components/card/checkable_card/checkable_card.js +3 -2
- package/test-env/components/context_menu/context_menu_panel.a11y.js +42 -0
- package/test-env/components/datagrid/controls/column_selector.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar.js +7 -2
- package/test-env/components/datagrid/controls/index.js +8 -0
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +207 -0
- package/test-env/components/datagrid/data_grid.js +11 -1
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +22 -4
- package/test-env/components/header/header_links/header_links.js +6 -0
- package/test-env/components/loading/loading_spinner.js +14 -2
- package/test-env/components/loading/loading_spinner.styles.js +14 -6
- package/test-env/components/modal/modal.js +22 -2
- package/test-env/components/page_template/page_template.js +6 -9
- package/test-env/components/popover/popover.js +13 -3
- package/test-env/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/test-env/components/popover/popover_panel/_popover_panel.js +8 -2
- package/test-env/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/test-env/components/search_bar/search_bar.js +39 -5
- package/test-env/components/search_bar/search_box.js +38 -4
- package/test-env/components/selectable/selectable.a11y.js +122 -0
- package/test-env/components/selectable/selectable.js +9 -6
- package/test-env/components/tabs/tab.js +31 -6
- package/test-env/components/tabs/tab.styles.js +69 -0
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +17 -1
- package/test-env/components/tabs/tabs.js +24 -14
- package/test-env/components/tabs/tabs.styles.js +32 -0
- package/test-env/services/string/to_initials.js +1 -1
- package/src/components/tabs/_index.scss +0 -1
- package/src/components/tabs/_tabs.scss +0 -110
- package/src/themes/amsterdam/overrides/_tabs.scss +0 -80
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
import React, { useState, useMemo } from 'react';
|
|
21
|
+
import { useGeneratedHtmlId } from '../../../services';
|
|
22
|
+
import { EuiButtonIcon } from '../../button';
|
|
23
|
+
import { EuiToolTip } from '../../tool_tip';
|
|
24
|
+
import { EuiPopover, EuiPopoverTitle } from '../../popover';
|
|
25
|
+
import { EuiDescriptionList } from '../../description_list';
|
|
26
|
+
import { EuiText } from '../../text';
|
|
27
|
+
import { useEuiI18n, EuiI18n } from '../../i18n';
|
|
28
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
|
+
export var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts() {
|
|
30
|
+
var _useState = useState(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
isOpen = _useState2[0],
|
|
33
|
+
setIsOpen = _useState2[1];
|
|
34
|
+
|
|
35
|
+
var title = useEuiI18n('euiKeyboardShortcuts.title', 'Keyboard shortcuts');
|
|
36
|
+
var titleId = useGeneratedHtmlId();
|
|
37
|
+
var keyboardShortcuts = useMemo(function () {
|
|
38
|
+
return ___EmotionJSX(EuiPopover, {
|
|
39
|
+
"data-test-subj": "dataGridKeyboardShortcutsPopover",
|
|
40
|
+
isOpen: isOpen,
|
|
41
|
+
closePopover: function closePopover() {
|
|
42
|
+
return setIsOpen(false);
|
|
43
|
+
},
|
|
44
|
+
anchorPosition: "downRight",
|
|
45
|
+
button: ___EmotionJSX(EuiToolTip, {
|
|
46
|
+
content: title,
|
|
47
|
+
delay: "long"
|
|
48
|
+
}, ___EmotionJSX(EuiButtonIcon, {
|
|
49
|
+
size: "xs",
|
|
50
|
+
iconType: "keyboard",
|
|
51
|
+
color: "text",
|
|
52
|
+
"data-test-subj": "dataGridKeyboardShortcutsButton",
|
|
53
|
+
onClick: function onClick() {
|
|
54
|
+
return setIsOpen(!isOpen);
|
|
55
|
+
},
|
|
56
|
+
"aria-label": title
|
|
57
|
+
}))
|
|
58
|
+
}, ___EmotionJSX(EuiPopoverTitle, {
|
|
59
|
+
paddingSize: "s"
|
|
60
|
+
}, ___EmotionJSX("h2", {
|
|
61
|
+
id: titleId
|
|
62
|
+
}, title)), ___EmotionJSX(EuiText, {
|
|
63
|
+
className: "euiDataGrid__keyboardShortcuts",
|
|
64
|
+
size: "xs"
|
|
65
|
+
}, ___EmotionJSX(EuiDescriptionList, {
|
|
66
|
+
"aria-labelledby": titleId,
|
|
67
|
+
type: "column",
|
|
68
|
+
align: "center",
|
|
69
|
+
compressed: true,
|
|
70
|
+
gutterSize: "s",
|
|
71
|
+
listItems: [{
|
|
72
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
73
|
+
token: "euiKeyboardShortcuts.upArrowTitle",
|
|
74
|
+
default: "Up arrow"
|
|
75
|
+
})),
|
|
76
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
77
|
+
token: "euiKeyboardShortcuts.upArrowDescription",
|
|
78
|
+
default: "Move one cell up"
|
|
79
|
+
})
|
|
80
|
+
}, {
|
|
81
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
82
|
+
token: "euiKeyboardShortcuts.downArrowTitle",
|
|
83
|
+
default: "Down arrow"
|
|
84
|
+
})),
|
|
85
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
86
|
+
token: "euiKeyboardShortcuts.downArrowDescription",
|
|
87
|
+
default: "Move one cell down"
|
|
88
|
+
})
|
|
89
|
+
}, {
|
|
90
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
91
|
+
token: "euiKeyboardShortcuts.rightArrowTitle",
|
|
92
|
+
default: "Right arrow"
|
|
93
|
+
})),
|
|
94
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
95
|
+
token: "euiKeyboardShortcuts.rightArrowDescription",
|
|
96
|
+
default: "Move one cell right"
|
|
97
|
+
})
|
|
98
|
+
}, {
|
|
99
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
100
|
+
token: "euiKeyboardShortcuts.leftArrowTitle",
|
|
101
|
+
default: "Left arrow"
|
|
102
|
+
})),
|
|
103
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
104
|
+
token: "euiKeyboardShortcuts.leftArrowDescription",
|
|
105
|
+
default: "Move one cell left"
|
|
106
|
+
})
|
|
107
|
+
}, {
|
|
108
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
109
|
+
token: "euiKeyboardShortcuts.homeTitle",
|
|
110
|
+
default: "Home"
|
|
111
|
+
})),
|
|
112
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
113
|
+
token: "euiKeyboardShortcuts.homeDescription",
|
|
114
|
+
default: "Move to the first cell of the current row"
|
|
115
|
+
})
|
|
116
|
+
}, {
|
|
117
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
118
|
+
token: "euiKeyboardShortcuts.endTitle",
|
|
119
|
+
default: "End"
|
|
120
|
+
})),
|
|
121
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
122
|
+
token: "euiKeyboardShortcuts.endDescription",
|
|
123
|
+
default: "Move to the last cell of the current row"
|
|
124
|
+
})
|
|
125
|
+
}, {
|
|
126
|
+
title: ___EmotionJSX(React.Fragment, null, ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
127
|
+
token: "euiKeyboardShortcuts.ctrl",
|
|
128
|
+
default: "Ctrl"
|
|
129
|
+
})), ' ', ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
130
|
+
token: "euiKeyboardShortcuts.homeTitle",
|
|
131
|
+
default: "Home"
|
|
132
|
+
}))),
|
|
133
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
134
|
+
token: "euiKeyboardShortcuts.ctrlHomeDescription",
|
|
135
|
+
default: "Move to the first cell of the current page"
|
|
136
|
+
})
|
|
137
|
+
}, {
|
|
138
|
+
title: ___EmotionJSX(React.Fragment, null, ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
139
|
+
token: "euiKeyboardShortcuts.ctrl",
|
|
140
|
+
default: "Ctrl"
|
|
141
|
+
})), ' ', ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
142
|
+
token: "euiKeyboardShortcuts.endTitle",
|
|
143
|
+
default: "End"
|
|
144
|
+
}))),
|
|
145
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
146
|
+
token: "euiKeyboardShortcuts.ctrlEndDescription",
|
|
147
|
+
default: "Move to the last cell of the current page"
|
|
148
|
+
})
|
|
149
|
+
}, {
|
|
150
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
151
|
+
token: "euiKeyboardShortcuts.pageUpTitle",
|
|
152
|
+
default: "Page Up"
|
|
153
|
+
})),
|
|
154
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
155
|
+
token: "euiKeyboardShortcuts.pageUpDescription",
|
|
156
|
+
default: "Go to the last row of the previous page"
|
|
157
|
+
})
|
|
158
|
+
}, {
|
|
159
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
160
|
+
token: "euiKeyboardShortcuts.pageDownTitle",
|
|
161
|
+
default: "Page Down"
|
|
162
|
+
})),
|
|
163
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
164
|
+
token: "euiKeyboardShortcuts.pageDownDescription",
|
|
165
|
+
default: "Go to the first row of the next page"
|
|
166
|
+
})
|
|
167
|
+
}, {
|
|
168
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
169
|
+
token: "euiKeyboardShortcuts.enterTitle",
|
|
170
|
+
default: "Enter"
|
|
171
|
+
})),
|
|
172
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
173
|
+
token: "euiKeyboardShortcuts.enterDescription",
|
|
174
|
+
default: "Open cell details and actions"
|
|
175
|
+
})
|
|
176
|
+
}, {
|
|
177
|
+
title: ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
178
|
+
token: "euiKeyboardShortcuts.escapeTitle",
|
|
179
|
+
default: "Escape"
|
|
180
|
+
})),
|
|
181
|
+
description: ___EmotionJSX(EuiI18n, {
|
|
182
|
+
token: "euiKeyboardShortcuts.escapeDescription",
|
|
183
|
+
default: "Close cell details and actions"
|
|
184
|
+
})
|
|
185
|
+
}]
|
|
186
|
+
})));
|
|
187
|
+
}, [isOpen, title, titleId]);
|
|
188
|
+
return {
|
|
189
|
+
keyboardShortcuts: keyboardShortcuts
|
|
190
|
+
};
|
|
191
|
+
};
|
|
@@ -49,7 +49,7 @@ import { EuiI18n, useEuiI18n } from '../i18n';
|
|
|
49
49
|
import { useMutationObserver } from '../observer/mutation_observer';
|
|
50
50
|
import { useResizeObserver } from '../observer/resize_observer';
|
|
51
51
|
import { EuiDataGridBody } from './body';
|
|
52
|
-
import { useDataGridColumnSelector, useDataGridColumnSorting, useDataGridDisplaySelector, startingStyles, useDataGridFullScreenSelector, checkOrDefaultToolBarDisplayOptions, EuiDataGridToolbar } from './controls';
|
|
52
|
+
import { useDataGridColumnSelector, useDataGridColumnSorting, useDataGridDisplaySelector, startingStyles, useDataGridFullScreenSelector, useDataGridKeyboardShortcuts, checkOrDefaultToolBarDisplayOptions, EuiDataGridToolbar } from './controls';
|
|
53
53
|
import { DataGridSortingContext, useSorting } from './utils/sorting';
|
|
54
54
|
import { DataGridFocusContext, useFocus, createKeyDownHandler, preventTabbing } from './utils/focus';
|
|
55
55
|
import { useInMemoryValues, EuiDataGridInMemoryRenderer } from './utils/in_memory';
|
|
@@ -239,12 +239,15 @@ export var EuiDataGrid = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
239
239
|
cellPopoverContext = _useCellPopover.cellPopoverContext,
|
|
240
240
|
cellPopover = _useCellPopover.cellPopover;
|
|
241
241
|
/**
|
|
242
|
-
* Toolbar & fullscreen
|
|
242
|
+
* Toolbar, keyboard shortcuts, & fullscreen
|
|
243
243
|
*/
|
|
244
244
|
|
|
245
245
|
|
|
246
246
|
var showToolbar = !!toolbarVisibility;
|
|
247
247
|
|
|
248
|
+
var _useDataGridKeyboardS = useDataGridKeyboardShortcuts(),
|
|
249
|
+
keyboardShortcuts = _useDataGridKeyboardS.keyboardShortcuts;
|
|
250
|
+
|
|
248
251
|
var _useDataGridFullScree = useDataGridFullScreenSelector(),
|
|
249
252
|
isFullScreen = _useDataGridFullScree.isFullScreen,
|
|
250
253
|
setIsFullScreen = _useDataGridFullScree.setIsFullScreen,
|
|
@@ -333,6 +336,7 @@ export var EuiDataGrid = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
333
336
|
toolbarVisibility: toolbarVisibility,
|
|
334
337
|
isFullScreen: isFullScreen,
|
|
335
338
|
fullScreenSelector: fullScreenSelector,
|
|
339
|
+
keyboardShortcuts: keyboardShortcuts,
|
|
336
340
|
displaySelector: displaySelector,
|
|
337
341
|
columnSelector: columnSelector,
|
|
338
342
|
columnSorting: columnSorting
|
|
@@ -1110,6 +1114,12 @@ EuiDataGrid.propTypes = {
|
|
|
1110
1114
|
*/
|
|
1111
1115
|
showSortSelector: PropTypes.bool,
|
|
1112
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Displays a popover listing all keyboard controls and shortcuts for the data grid.
|
|
1119
|
+
* If set to `false`, the toggle will be visually hidden, but still focusable by keyboard and screen reader users.
|
|
1120
|
+
*/
|
|
1121
|
+
showKeyboardShortcuts: PropTypes.bool,
|
|
1122
|
+
|
|
1113
1123
|
/**
|
|
1114
1124
|
* Allows user to be able to fullscreen the data grid. If set to `false` make sure your grid fits within a large enough panel to still show the other controls.
|
|
1115
1125
|
*/
|
|
@@ -269,7 +269,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
269
269
|
locale = _this$props2.locale,
|
|
270
270
|
timeFormat = _this$props2.timeFormat,
|
|
271
271
|
utcOffset = _this$props2.utcOffset,
|
|
272
|
-
compressed = _this$props2.compressed
|
|
272
|
+
compressed = _this$props2.compressed,
|
|
273
|
+
onFocus = _this$props2.onFocus;
|
|
273
274
|
|
|
274
275
|
if (showPrettyDuration && !isStartDatePopoverOpen && !isEndDatePopoverOpen) {
|
|
275
276
|
return ___EmotionJSX(EuiDatePickerRange, {
|
|
@@ -284,7 +285,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
284
285
|
}),
|
|
285
286
|
"data-test-subj": "superDatePickerShowDatesButton",
|
|
286
287
|
disabled: isDisabled,
|
|
287
|
-
onClick: _this.hidePrettyDuration
|
|
288
|
+
onClick: _this.hidePrettyDuration,
|
|
289
|
+
onFocus: onFocus
|
|
288
290
|
}, ___EmotionJSX(PrettyDuration, {
|
|
289
291
|
timeFrom: start,
|
|
290
292
|
timeTo: end,
|
|
@@ -317,7 +319,10 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
317
319
|
isOpen: _this.state.isStartDatePopoverOpen,
|
|
318
320
|
onPopoverToggle: _this.onStartDatePopoverToggle,
|
|
319
321
|
onPopoverClose: _this.onStartDatePopoverClose,
|
|
320
|
-
timeOptions: timeOptions
|
|
322
|
+
timeOptions: timeOptions,
|
|
323
|
+
buttonProps: {
|
|
324
|
+
onFocus: onFocus
|
|
325
|
+
}
|
|
321
326
|
}),
|
|
322
327
|
endDateControl: ___EmotionJSX(EuiDatePopoverButton, {
|
|
323
328
|
position: "end",
|
|
@@ -335,7 +340,10 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
|
|
|
335
340
|
isOpen: _this.state.isEndDatePopoverOpen,
|
|
336
341
|
onPopoverToggle: _this.onEndDatePopoverToggle,
|
|
337
342
|
onPopoverClose: _this.onEndDatePopoverClose,
|
|
338
|
-
timeOptions: timeOptions
|
|
343
|
+
timeOptions: timeOptions,
|
|
344
|
+
buttonProps: {
|
|
345
|
+
onFocus: onFocus
|
|
346
|
+
}
|
|
339
347
|
})
|
|
340
348
|
});
|
|
341
349
|
});
|
|
@@ -552,6 +560,11 @@ EuiSuperDatePickerInternal.propTypes = {
|
|
|
552
560
|
*/
|
|
553
561
|
locale: PropTypes.any,
|
|
554
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Triggered whenever the EuiSuperDatePicker's dates are focused
|
|
565
|
+
*/
|
|
566
|
+
onFocus: PropTypes.any,
|
|
567
|
+
|
|
555
568
|
/**
|
|
556
569
|
* Callback for when the refresh interval is fired.
|
|
557
570
|
* EuiSuperDatePicker will only manage a refresh interval timer when onRefresh callback is supplied
|
|
@@ -759,6 +772,11 @@ EuiSuperDatePicker.propTypes = {
|
|
|
759
772
|
*/
|
|
760
773
|
locale: PropTypes.any,
|
|
761
774
|
|
|
775
|
+
/**
|
|
776
|
+
* Triggered whenever the EuiSuperDatePicker's dates are focused
|
|
777
|
+
*/
|
|
778
|
+
onFocus: PropTypes.any,
|
|
779
|
+
|
|
762
780
|
/**
|
|
763
781
|
* Callback for when the refresh interval is fired.
|
|
764
782
|
* EuiSuperDatePicker will only manage a refresh interval timer when onRefresh callback is supplied
|
|
@@ -252,6 +252,12 @@ EuiHeaderLinks.propTypes = {
|
|
|
252
252
|
*/
|
|
253
253
|
repositionOnScroll: PropTypes.bool,
|
|
254
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Must be set to true if using `EuiDragDropContext` within a popover,
|
|
257
|
+
* otherwise your nested drag & drop will have incorrect positioning
|
|
258
|
+
*/
|
|
259
|
+
hasDragDrop: PropTypes.bool,
|
|
260
|
+
|
|
255
261
|
/**
|
|
256
262
|
* By default, popover content inherits the z-index of the anchor
|
|
257
263
|
* component; pass `zIndex` to override
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
var _excluded = ["size", "className", "aria-label", "color"];
|
|
1
|
+
var _excluded = ["size", "className", "aria-label", "color", "style"];
|
|
2
2
|
|
|
3
3
|
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); }
|
|
4
4
|
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
5
11
|
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; }
|
|
6
12
|
|
|
7
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -18,7 +24,7 @@ import PropTypes from "prop-types";
|
|
|
18
24
|
import classNames from 'classnames';
|
|
19
25
|
import { useEuiTheme } from '../..//services';
|
|
20
26
|
import { useLoadingAriaLabel } from './_loading_strings';
|
|
21
|
-
import { euiLoadingSpinnerStyles } from './loading_spinner.styles';
|
|
27
|
+
import { euiLoadingSpinnerStyles, euiSpinnerBorderColorsCSS } from './loading_spinner.styles';
|
|
22
28
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
29
|
export var SIZES = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
24
30
|
export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
@@ -27,16 +33,21 @@ export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
|
27
33
|
className = _ref.className,
|
|
28
34
|
ariaLabel = _ref['aria-label'],
|
|
29
35
|
color = _ref.color,
|
|
36
|
+
style = _ref.style,
|
|
30
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
38
|
|
|
32
39
|
var euiTheme = useEuiTheme();
|
|
33
|
-
var styles = euiLoadingSpinnerStyles(euiTheme
|
|
40
|
+
var styles = euiLoadingSpinnerStyles(euiTheme);
|
|
34
41
|
var cssStyles = [styles.euiLoadingSpinner, styles[size]];
|
|
35
42
|
var classes = classNames('euiLoadingSpinner', className);
|
|
36
43
|
var defaultLabel = useLoadingAriaLabel();
|
|
44
|
+
var customColorStyle = color ? _objectSpread(_objectSpread({}, style), {}, {
|
|
45
|
+
borderColor: euiSpinnerBorderColorsCSS(euiTheme, color)
|
|
46
|
+
}) : style;
|
|
37
47
|
return ___EmotionJSX("span", _extends({
|
|
38
48
|
className: classes,
|
|
39
49
|
css: cssStyles,
|
|
50
|
+
style: customColorStyle,
|
|
40
51
|
role: "progressbar",
|
|
41
52
|
"aria-label": ariaLabel || defaultLabel
|
|
42
53
|
}, rest));
|
|
@@ -21,15 +21,19 @@ var spinnerSizes = {
|
|
|
21
21
|
xl: 'xl',
|
|
22
22
|
xxl: 'xxl'
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
var spinnerColorsCSS = function spinnerColorsCSS(border, highlight) {
|
|
26
|
-
return "\n border-color: ".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border, ";\n ");
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref, color) {
|
|
24
|
+
export var euiSpinnerBorderColorsCSS = function euiSpinnerBorderColorsCSS(_ref) {
|
|
30
25
|
var euiTheme = _ref.euiTheme;
|
|
26
|
+
var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
27
|
+
var _colors$border = colors.border,
|
|
28
|
+
border = _colors$border === void 0 ? euiTheme.colors.lightShade : _colors$border,
|
|
29
|
+
_colors$highlight = colors.highlight,
|
|
30
|
+
highlight = _colors$highlight === void 0 ? euiTheme.colors.primary : _colors$highlight;
|
|
31
|
+
return "".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border);
|
|
32
|
+
};
|
|
33
|
+
export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(euiThemeContext) {
|
|
34
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
35
|
return {
|
|
32
|
-
euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";
|
|
36
|
+
euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";border-color:", euiSpinnerBorderColorsCSS(euiThemeContext), ";", euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
|
|
33
37
|
// Sizes
|
|
34
38
|
s: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size[spinnerSizes.s], euiTheme.size[spinnerSizes.s]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:s;"),
|
|
35
39
|
m: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size[spinnerSizes.m], euiTheme.size[spinnerSizes.m]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:m;"),
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
20
20
|
* Side Public License, v 1.
|
|
21
21
|
*/
|
|
22
|
-
import React from 'react';
|
|
22
|
+
import React, { useRef, useCallback } from 'react';
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import classnames from 'classnames';
|
|
25
25
|
import { keys } from '../../services';
|
|
@@ -38,6 +38,19 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
38
38
|
style = _ref.style,
|
|
39
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
|
|
41
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
42
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
43
|
+
var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
44
|
+
);
|
|
45
|
+
var onFocus = useCallback(function () {
|
|
46
|
+
if (bodyScrollTop.current != null) {
|
|
47
|
+
window.scrollTo({
|
|
48
|
+
top: bodyScrollTop.current
|
|
49
|
+
});
|
|
50
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
41
54
|
var onKeyDown = function onKeyDown(event) {
|
|
42
55
|
if (event.key === keys.ESCAPE) {
|
|
43
56
|
event.preventDefault();
|
|
@@ -60,11 +73,13 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
60
73
|
|
|
61
74
|
var classes = classnames('euiModal', widthClassName, className);
|
|
62
75
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
63
|
-
initialFocus: initialFocus
|
|
76
|
+
initialFocus: initialFocus,
|
|
77
|
+
scrollLock: true
|
|
64
78
|
}, ___EmotionJSX("div", _extends({
|
|
65
79
|
className: classes,
|
|
66
80
|
onKeyDown: onKeyDown,
|
|
67
81
|
tabIndex: 0,
|
|
82
|
+
onFocus: onFocus,
|
|
68
83
|
style: newStyle || style
|
|
69
84
|
}, rest), ___EmotionJSX(EuiI18n, {
|
|
70
85
|
token: "euiModal.closeModal",
|
|
@@ -149,15 +149,12 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
149
149
|
React.Children.toArray(children).forEach(function (child, index) {
|
|
150
150
|
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
sidebar.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
default:
|
|
160
|
-
sections.push(child);
|
|
152
|
+
if (child.type === EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === EuiPageSidebar) {
|
|
153
|
+
sidebar.push( /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({
|
|
154
|
+
key: "sidebar".concat(index)
|
|
155
|
+
}, getSideBarProps()), child.props)));
|
|
156
|
+
} else {
|
|
157
|
+
sections.push(child);
|
|
161
158
|
}
|
|
162
159
|
});
|
|
163
160
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
|
|
3
3
|
import { css as _css } from "@emotion/react";
|
|
4
|
-
var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
4
|
+
var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "hasDragDrop", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
5
5
|
|
|
6
6
|
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); }
|
|
7
7
|
|
|
@@ -419,7 +419,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
419
419
|
}, {
|
|
420
420
|
key: "render",
|
|
421
421
|
value: function render() {
|
|
422
|
-
var
|
|
422
|
+
var _panelProps$tabIndex,
|
|
423
|
+
_this4 = this;
|
|
423
424
|
|
|
424
425
|
var _this$props = this.props,
|
|
425
426
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -442,6 +443,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
442
443
|
hasArrow = _this$props.hasArrow,
|
|
443
444
|
arrowChildren = _this$props.arrowChildren,
|
|
444
445
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
446
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
445
447
|
zIndex = _this$props.zIndex,
|
|
446
448
|
attachToAnchor = _this$props.attachToAnchor,
|
|
447
449
|
display = _this$props.display,
|
|
@@ -454,9 +456,10 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
454
456
|
container = _this$props.container,
|
|
455
457
|
focusTrapProps = _this$props.focusTrapProps,
|
|
456
458
|
initialFocusProp = _this$props.initialFocus,
|
|
457
|
-
|
|
459
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
458
460
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
459
461
|
|
|
462
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
460
463
|
var styles = euiPopoverStyles();
|
|
461
464
|
var popoverStyles = [styles.euiPopover, {
|
|
462
465
|
display: display
|
|
@@ -520,6 +523,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
520
523
|
position: this.state.arrowPosition,
|
|
521
524
|
isAttached: attachToAnchor,
|
|
522
525
|
className: classNames(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
526
|
+
hasDragDrop: hasDragDrop,
|
|
523
527
|
hasShadow: false,
|
|
524
528
|
paddingSize: panelPaddingSize,
|
|
525
529
|
tabIndex: tabIndex,
|
|
@@ -738,6 +742,12 @@ EuiPopover.propTypes = {
|
|
|
738
742
|
*/
|
|
739
743
|
repositionOnScroll: PropTypes.bool,
|
|
740
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Must be set to true if using `EuiDragDropContext` within a popover,
|
|
747
|
+
* otherwise your nested drag & drop will have incorrect positioning
|
|
748
|
+
*/
|
|
749
|
+
hasDragDrop: PropTypes.bool,
|
|
750
|
+
|
|
741
751
|
/**
|
|
742
752
|
* By default, popover content inherits the z-index of the anchor
|
|
743
753
|
* component; pass `zIndex` to override
|
|
@@ -28,6 +28,7 @@ export var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
28
28
|
var styles = euiPopoverArrowStyles(euiTheme);
|
|
29
29
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
30
30
|
return ___EmotionJSX("div", _extends({
|
|
31
|
+
className: "euiPopover__arrow",
|
|
31
32
|
"data-popover-arrow": position,
|
|
32
33
|
css: cssStyles
|
|
33
34
|
}, rest), children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
1
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
2
2
|
|
|
3
3
|
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); }
|
|
4
4
|
|
|
@@ -45,6 +45,7 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
45
45
|
className = _ref.className,
|
|
46
46
|
isOpen = _ref.isOpen,
|
|
47
47
|
isAttached = _ref.isAttached,
|
|
48
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
48
49
|
position = _ref.position,
|
|
49
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
|
|
@@ -60,6 +61,10 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
60
61
|
panelCSS = [].concat(_toConsumableArray(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
if (hasDragDrop) {
|
|
65
|
+
panelCSS = [].concat(_toConsumableArray(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
return ___EmotionJSX(EuiPopoverPanelContext.Provider, {
|
|
64
69
|
value: panelContext
|
|
65
70
|
}, ___EmotionJSX(EuiPanel, _extends({
|
|
@@ -111,5 +116,6 @@ EuiPopoverPanel.propTypes = {
|
|
|
111
116
|
css: PropTypes.any,
|
|
112
117
|
isOpen: PropTypes.bool,
|
|
113
118
|
isAttached: PropTypes.bool,
|
|
114
|
-
position: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([null])])
|
|
119
|
+
position: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([null])]),
|
|
120
|
+
hasDragDrop: PropTypes.bool
|
|
115
121
|
};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { euiShadow, euiShadowFlat, euiShadowMedium } from '../../../themes/amsterdam/global_styling/mixins';
|
|
10
|
+
import { getShadowColor } from '../../../themes/amsterdam/global_styling/functions';
|
|
10
11
|
import { euiCanAnimate, logicalCSS } from '../../../global_styling';
|
|
11
12
|
export var openAnimationTiming = 'slow';
|
|
12
13
|
var translateDistance = 's';
|
|
@@ -17,7 +18,8 @@ var translateDistance = 's';
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
|
|
20
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
21
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
22
|
+
colorMode = euiThemeContext.colorMode;
|
|
21
23
|
return {
|
|
22
24
|
// Base
|
|
23
25
|
euiPopover__panel: /*#__PURE__*/css("position:absolute;", logicalCSS('min-width', "".concat(euiTheme.base * 7, "px")), ";", logicalCSS('max-width', "calc(100vw - ".concat(euiTheme.size.xl, ")")), ";backface-visibility:hidden;pointer-events:none;opacity:0;transform:translateY(0) translateX(0) translateZ(0);", euiShadowMedium(euiThemeContext, {
|
|
@@ -38,6 +40,18 @@ export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContex
|
|
|
38
40
|
// Satisfies TS
|
|
39
41
|
left: /*#__PURE__*/css(";label:left;"),
|
|
40
42
|
right: /*#__PURE__*/css(";label:right;")
|
|
43
|
+
},
|
|
44
|
+
// Overrides for drag & drop contexts within popovers. This is required because
|
|
45
|
+
// the fixed positions of drag and drop don't work inside of transformed elements
|
|
46
|
+
hasDragDrop: {
|
|
47
|
+
hasDragDrop: /*#__PURE__*/css("transform:none;filter:none;", euiShadowMedium(euiThemeContext, {
|
|
48
|
+
property: 'box-shadow'
|
|
49
|
+
}), ";;label:hasDragDrop;"),
|
|
50
|
+
// The offset transforms must be recreated in margins
|
|
51
|
+
top: /*#__PURE__*/css("margin-block-start:", euiTheme.size[translateDistance], ";;label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css("margin-block-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 0 -6px 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css("margin-inline-start:", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css("margin-inline-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n -6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:right;")
|
|
41
55
|
}
|
|
42
56
|
};
|
|
43
57
|
};
|