@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
|
@@ -24,11 +24,11 @@ var _buttonSize = function _buttonSize(size) {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
27
|
-
name: "
|
|
28
|
-
styles: "
|
|
27
|
+
name: "8595p9-isDisabled",
|
|
28
|
+
styles: "cursor:not-allowed;label:isDisabled;"
|
|
29
29
|
} : {
|
|
30
|
-
name: "
|
|
31
|
-
styles: "
|
|
30
|
+
name: "8595p9-isDisabled",
|
|
31
|
+
styles: "cursor:not-allowed;label:isDisabled;",
|
|
32
32
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -46,14 +46,13 @@ var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
46
46
|
iconType = _ref.iconType,
|
|
47
47
|
_ref$iconSize = _ref.iconSize,
|
|
48
48
|
iconSize = _ref$iconSize === void 0 ? 'm' : _ref$iconSize,
|
|
49
|
-
iconSide = _ref.iconSide,
|
|
49
|
+
_ref$iconSide = _ref.iconSide,
|
|
50
|
+
iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
|
|
50
51
|
contentProps = _objectWithoutProperties(_ref, _excluded);
|
|
51
52
|
|
|
52
53
|
var theme = (0, _services.useEuiTheme)();
|
|
53
54
|
var styles = (0, _button_display_content.euiButtonDisplayContentStyles)(theme);
|
|
54
|
-
var cssStyles = [styles.euiButtonDisplayContent
|
|
55
|
-
var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
|
|
56
|
-
var cssIconStyles = [styles.euiButtonDisplayContent__icon, iconSize && styles[iconSize]]; // Add an icon to the button if one exists.
|
|
55
|
+
var cssStyles = [styles.euiButtonDisplayContent]; // Add an icon to the button if one exists.
|
|
57
56
|
|
|
58
57
|
var icon; // When the button is disabled the text gets gray
|
|
59
58
|
// and in some buttons the background gets a light gray
|
|
@@ -62,18 +61,16 @@ var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
62
61
|
// are always visible. The default spinner color could be very light.
|
|
63
62
|
|
|
64
63
|
var loadingSpinnerColor = isDisabled ? {
|
|
65
|
-
border: '
|
|
64
|
+
border: 'currentcolor'
|
|
66
65
|
} : undefined;
|
|
67
66
|
|
|
68
67
|
if (isLoading) {
|
|
69
68
|
icon = (0, _react2.jsx)(_loading.EuiLoadingSpinner, {
|
|
70
|
-
css: cssSpinnerStyles,
|
|
71
69
|
size: iconSize,
|
|
72
70
|
color: loadingSpinnerColor
|
|
73
71
|
});
|
|
74
72
|
} else if (iconType) {
|
|
75
73
|
icon = (0, _react2.jsx)(_icon.EuiIcon, {
|
|
76
|
-
css: cssIconStyles,
|
|
77
74
|
type: iconType,
|
|
78
75
|
size: iconSize,
|
|
79
76
|
color: "inherit" // forces the icon to inherit its parent color
|
|
@@ -84,9 +81,9 @@ var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
84
81
|
var isText = typeof children === 'string';
|
|
85
82
|
return (0, _react2.jsx)("span", _extends({
|
|
86
83
|
css: cssStyles
|
|
87
|
-
}, contentProps), icon, isText ? (0, _react2.jsx)("span", _extends({}, textProps, {
|
|
84
|
+
}, contentProps), iconSide === 'left' && icon, isText || textProps ? (0, _react2.jsx)("span", _extends({}, textProps, {
|
|
88
85
|
className: (0, _classnames.default)('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
|
|
89
|
-
}), children) : children);
|
|
86
|
+
}), children) : children, iconSide === 'right' && icon);
|
|
90
87
|
};
|
|
91
88
|
|
|
92
89
|
exports.EuiButtonDisplayContent = EuiButtonDisplayContent;
|
|
@@ -9,48 +9,18 @@ var _react = require("@emotion/react");
|
|
|
9
9
|
|
|
10
10
|
var _global_styling = require("../../../global_styling");
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
24
|
-
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
25
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;"
|
|
26
|
-
} : {
|
|
27
|
-
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
28
|
-
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;",
|
|
29
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
33
|
-
name: "qfl6yj-right",
|
|
34
|
-
styles: "flex-direction:row-reverse;label:right;"
|
|
35
|
-
} : {
|
|
36
|
-
name: "qfl6yj-right",
|
|
37
|
-
styles: "flex-direction:row-reverse;label:right;",
|
|
38
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref4) {
|
|
42
|
-
var euiTheme = _ref4.euiTheme;
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref) {
|
|
20
|
+
var euiTheme = _ref.euiTheme;
|
|
43
21
|
return {
|
|
44
22
|
// Base
|
|
45
|
-
euiButtonDisplayContent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
46
|
-
// Icon side
|
|
47
|
-
left: /*#__PURE__*/(0, _react.css)(";label:left;"),
|
|
48
|
-
right: _ref3,
|
|
49
|
-
euiButtonDisplayContent__spinner: _ref2,
|
|
50
|
-
euiButtonDisplayContent__icon: _ref,
|
|
51
|
-
// Icon size
|
|
52
|
-
s: /*#__PURE__*/(0, _react.css)(";label:s;"),
|
|
53
|
-
m: /*#__PURE__*/(0, _react.css)(";label:m;")
|
|
23
|
+
euiButtonDisplayContent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
|
|
54
24
|
};
|
|
55
25
|
};
|
|
56
26
|
|
|
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.EuiCard = exports.ALIGNMENTS = void 0;
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
@@ -13,10 +13,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
15
|
|
|
16
|
-
var _common = require("../common");
|
|
17
|
-
|
|
18
16
|
var _services = require("../../services");
|
|
19
17
|
|
|
18
|
+
var _clone_element = require("../../services/theme/clone_element");
|
|
19
|
+
|
|
20
20
|
var _text = require("../text");
|
|
21
21
|
|
|
22
22
|
var _title = require("../title");
|
|
@@ -58,23 +58,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
58
58
|
|
|
59
59
|
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; }
|
|
60
60
|
|
|
61
|
-
var
|
|
62
|
-
left: 'euiCard--leftAligned',
|
|
63
|
-
center: 'euiCard--centerAligned',
|
|
64
|
-
right: 'euiCard--rightAligned'
|
|
65
|
-
};
|
|
66
|
-
var ALIGNMENTS = (0, _common.keysOf)(textAlignToClassNameMap);
|
|
61
|
+
var ALIGNMENTS = ['left', 'center', 'right'];
|
|
67
62
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
68
|
-
var layoutToClassNameMap = {
|
|
69
|
-
vertical: '',
|
|
70
|
-
horizontal: 'euiCard--horizontal'
|
|
71
|
-
};
|
|
72
|
-
var LAYOUT_ALIGNMENTS = (0, _common.keysOf)(layoutToClassNameMap);
|
|
73
|
-
/**
|
|
74
|
-
* Certain props are only allowed when the layout is vertical
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
exports.LAYOUT_ALIGNMENTS = LAYOUT_ALIGNMENTS;
|
|
78
63
|
|
|
79
64
|
var EuiCard = function EuiCard(_ref) {
|
|
80
65
|
var className = _ref.className,
|
|
@@ -110,8 +95,9 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
110
95
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
111
96
|
var styles = (0, _card.euiCardStyles)(euiThemeContext, paddingSize);
|
|
112
97
|
var cardStyles = [styles.card.euiCard, // Text alignment should always be left when horizontal
|
|
113
|
-
styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign],
|
|
98
|
+
styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign], isDisabled && styles.card.disabled];
|
|
114
99
|
var contentStyles = [styles.content.euiCard__content, styles.content.layout[layout]];
|
|
100
|
+
var mainStyles = [styles.main.euiCard__main, styles.main.layout[layout]];
|
|
115
101
|
var textStyles = (0, _card.euiCardTextStyles)(euiThemeContext);
|
|
116
102
|
var textCSS = [textStyles.euiCard__text, // Text alignment should always be left when horizontal
|
|
117
103
|
textStyles.aligned[layout === 'horizontal' ? 'left' : textAlign], isClickable && textStyles.interactive, isDisabled && textStyles.disabled];
|
|
@@ -135,15 +121,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
135
121
|
}
|
|
136
122
|
}
|
|
137
123
|
|
|
138
|
-
var
|
|
139
|
-
var classes = (0, _classnames.default)('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
140
|
-
'euiCard--isClickable': isClickable,
|
|
141
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
142
|
-
'euiCard--hasIcon': icon,
|
|
143
|
-
'euiCard--isSelectable': selectable,
|
|
144
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
145
|
-
'euiCard-isDisabled': isDisabled
|
|
146
|
-
}, selectableColorClass, className);
|
|
124
|
+
var classes = (0, _classnames.default)('euiCard', className);
|
|
147
125
|
var ariaId = (0, _accessibility.useGeneratedHtmlId)();
|
|
148
126
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
149
127
|
/**
|
|
@@ -171,7 +149,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
171
149
|
|
|
172
150
|
if (icon) {
|
|
173
151
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
174
|
-
iconNode =
|
|
152
|
+
iconNode = (0, _clone_element.cloneElementWithCss)(icon, {
|
|
175
153
|
className: (0, _classnames.default)(icon.props.className, 'euiCard__icon'),
|
|
176
154
|
css: iconStyles
|
|
177
155
|
});
|
|
@@ -327,14 +305,17 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
327
305
|
hasShadow: isDisabled || display ? false : true,
|
|
328
306
|
hasBorder: display ? false : undefined,
|
|
329
307
|
paddingSize: paddingSize
|
|
330
|
-
}, rest),
|
|
308
|
+
}, rest), (0, _react2.jsx)("div", {
|
|
309
|
+
className: "euiCard__main",
|
|
310
|
+
css: mainStyles
|
|
311
|
+
}, optionalCardTop, (0, _react2.jsx)("div", {
|
|
331
312
|
className: "euiCard__content",
|
|
332
313
|
css: contentStyles
|
|
333
314
|
}, (0, _react2.jsx)(_title.EuiTitle, {
|
|
334
315
|
id: "".concat(ariaId, "Title"),
|
|
335
316
|
className: "euiCard__title",
|
|
336
317
|
size: titleSize
|
|
337
|
-
}, (0, _react2.jsx)(TitleElement, null, theTitle)), optionalDescription, optionalChildren), optionalBetaBadge, optionalFooter, optionalSelectButton);
|
|
318
|
+
}, (0, _react2.jsx)(TitleElement, null, theTitle)), optionalDescription, optionalChildren), optionalBetaBadge, optionalFooter), optionalSelectButton);
|
|
338
319
|
};
|
|
339
320
|
|
|
340
321
|
exports.EuiCard = EuiCard;
|
|
@@ -348,7 +329,7 @@ EuiCard.propTypes = {
|
|
|
348
329
|
/**
|
|
349
330
|
* Changes alignment of the title and description
|
|
350
331
|
*/
|
|
351
|
-
textAlign: _propTypes.default.
|
|
332
|
+
textAlign: _propTypes.default.any,
|
|
352
333
|
|
|
353
334
|
/**
|
|
354
335
|
* Accepts any combination of elements
|
|
@@ -57,6 +57,15 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
57
57
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
var _ref6 = process.env.NODE_ENV === "production" ? {
|
|
61
|
+
name: "z24364-euiCard__main",
|
|
62
|
+
styles: "display:flex;label:euiCard__main;"
|
|
63
|
+
} : {
|
|
64
|
+
name: "z24364-euiCard__main",
|
|
65
|
+
styles: "display:flex;label:euiCard__main;",
|
|
66
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
67
|
+
};
|
|
68
|
+
|
|
60
69
|
var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
|
|
61
70
|
var euiTheme = euiThemeContext.euiTheme;
|
|
62
71
|
var paddingAmount = (0, _global_styling.euiPaddingSize)(euiThemeContext, paddingSize);
|
|
@@ -64,17 +73,20 @@ var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
|
|
|
64
73
|
var halfSpacing = (0, _global_styling.euiPaddingSize)(euiThemeContext, halfPaddingKey);
|
|
65
74
|
return {
|
|
66
75
|
card: {
|
|
67
|
-
euiCard: /*#__PURE__*/(0, _react.css)("display:flex;&:has([class*='euiCard__text'][class*='-interactive']:focus:focus-visible){outline:", euiTheme.focus.width, " solid currentColor;};label:euiCard;"),
|
|
76
|
+
euiCard: /*#__PURE__*/(0, _react.css)("display:flex;align-items:flex-start;justify-content:space-between;flex-direction:column;&:has([class*='euiCard__text'][class*='-interactive']:focus:focus-visible){outline:", euiTheme.focus.width, " solid currentColor;};label:euiCard;"),
|
|
68
77
|
aligned: {
|
|
69
78
|
center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";align-items:center;;label:center;"),
|
|
70
79
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";align-items:flex-start;;label:left;"),
|
|
71
80
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";align-items:flex-end;;label:right;")
|
|
72
81
|
},
|
|
82
|
+
disabled: /*#__PURE__*/(0, _react.css)("cursor:not-allowed;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled'), ";color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
83
|
+
},
|
|
84
|
+
main: {
|
|
85
|
+
euiCard__main: _ref6,
|
|
73
86
|
layout: {
|
|
74
87
|
vertical: _ref5,
|
|
75
88
|
horizontal: _ref4
|
|
76
|
-
}
|
|
77
|
-
disabled: /*#__PURE__*/(0, _react.css)("cursor:not-allowed;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled'), ";color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
89
|
+
}
|
|
78
90
|
},
|
|
79
91
|
content: {
|
|
80
92
|
euiCard__content: _ref3,
|
|
@@ -10,11 +10,11 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
11
11
|
|
|
12
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
-
name: "
|
|
14
|
-
styles: "transform:none!important;label:euiCardSelect;"
|
|
13
|
+
name: "aogl4-euiCardSelect",
|
|
14
|
+
styles: "transform:none!important;align-self:flex-end;label:euiCardSelect;"
|
|
15
15
|
} : {
|
|
16
|
-
name: "
|
|
17
|
-
styles: "transform:none!important;label:euiCardSelect;",
|
|
16
|
+
name: "aogl4-euiCardSelect",
|
|
17
|
+
styles: "transform:none!important;align-self:flex-end;label:euiCardSelect;",
|
|
18
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ var _checkable_card = require("./checkable_card.styles");
|
|
|
23
23
|
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
26
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
27
27
|
|
|
28
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
29
|
|
|
@@ -40,6 +40,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
40
40
|
var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
41
41
|
var children = _ref.children,
|
|
42
42
|
className = _ref.className,
|
|
43
|
+
css = _ref.css,
|
|
43
44
|
_ref$checkableType = _ref.checkableType,
|
|
44
45
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
45
46
|
label = _ref.label,
|
|
@@ -52,7 +53,7 @@ var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
52
53
|
|
|
53
54
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
54
55
|
var styles = (0, _checkable_card.euiCheckableCardStyles)(euiThemeContext);
|
|
55
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
56
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
56
57
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
57
58
|
var childStyles = [styles.euiCheckableCard__children];
|
|
58
59
|
var id = rest.id;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _context_menu_item = require("./context_menu_item");
|
|
6
|
+
|
|
7
|
+
var _context_menu_panel = require("./context_menu_panel");
|
|
8
|
+
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
/// <reference types="../../../cypress/support"/>
|
|
21
|
+
var items = [(0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
22
|
+
key: "A",
|
|
23
|
+
"data-test-subj": "itemA"
|
|
24
|
+
}, "Option A"), (0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
25
|
+
key: "B",
|
|
26
|
+
"data-test-subj": "itemB"
|
|
27
|
+
}, "Option B"), (0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
28
|
+
key: "C",
|
|
29
|
+
"data-test-subj": "itemC"
|
|
30
|
+
}, "Option C")];
|
|
31
|
+
describe('EuiContextMenuPanel', function () {
|
|
32
|
+
describe('Automated accessibility check', function () {
|
|
33
|
+
it('has zero violations', function () {
|
|
34
|
+
var showNextPanelHandler = cy.stub();
|
|
35
|
+
cy.mount((0, _react2.jsx)(_context_menu_panel.EuiContextMenuPanel, {
|
|
36
|
+
items: items,
|
|
37
|
+
showNextPanel: showNextPanelHandler
|
|
38
|
+
}));
|
|
39
|
+
cy.checkAxe();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -147,7 +147,7 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
147
147
|
},
|
|
148
148
|
anchorPosition: "downLeft",
|
|
149
149
|
panelPaddingSize: "s",
|
|
150
|
-
|
|
150
|
+
hasDragDrop: true,
|
|
151
151
|
button: (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
152
152
|
size: "xs",
|
|
153
153
|
iconType: allowColumnHiding ? 'listAdd' : 'list',
|
|
@@ -159,7 +159,7 @@ var useDataGridColumnSorting = function useDataGridColumnSorting(columns, sortin
|
|
|
159
159
|
},
|
|
160
160
|
anchorPosition: "downLeft",
|
|
161
161
|
panelPaddingSize: "s",
|
|
162
|
-
|
|
162
|
+
hasDragDrop: true,
|
|
163
163
|
button: (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
164
164
|
size: "xs",
|
|
165
165
|
iconType: "sortable",
|
|
@@ -10,6 +10,8 @@ exports.renderAdditionalControls = renderAdditionalControls;
|
|
|
10
10
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
|
|
13
|
+
var _accessibility = require("../../accessibility");
|
|
14
|
+
|
|
13
15
|
var _utils = require("../../../utils");
|
|
14
16
|
|
|
15
17
|
var _react2 = require("@emotion/react");
|
|
@@ -33,6 +35,7 @@ var EuiDataGridToolbar = function EuiDataGridToolbar(_ref) {
|
|
|
33
35
|
toolbarVisibility = _ref.toolbarVisibility,
|
|
34
36
|
isFullScreen = _ref.isFullScreen,
|
|
35
37
|
fullScreenSelector = _ref.fullScreenSelector,
|
|
38
|
+
keyboardShortcuts = _ref.keyboardShortcuts,
|
|
36
39
|
displaySelector = _ref.displaySelector,
|
|
37
40
|
columnSelector = _ref.columnSelector,
|
|
38
41
|
columnSorting = _ref.columnSorting;
|
|
@@ -40,12 +43,14 @@ var EuiDataGridToolbar = function EuiDataGridToolbar(_ref) {
|
|
|
40
43
|
var hasRoomForGridControls = _utils.IS_JEST_ENVIRONMENT ? true : gridWidth > minSizeForControls || isFullScreen;
|
|
41
44
|
return (0, _react2.jsx)("div", {
|
|
42
45
|
className: "euiDataGrid__controls",
|
|
43
|
-
"data-test-
|
|
46
|
+
"data-test-subj": "dataGridControls"
|
|
44
47
|
}, hasRoomForGridControls && (0, _react2.jsx)("div", {
|
|
45
48
|
className: "euiDataGrid__leftControls"
|
|
46
49
|
}, renderAdditionalControls(toolbarVisibility, 'left.prepend'), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showColumnSelector') ? columnSelector : null, checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showSortSelector') ? columnSorting : null, renderAdditionalControls(toolbarVisibility, 'left.append')), (0, _react2.jsx)("div", {
|
|
47
50
|
className: "euiDataGrid__rightControls"
|
|
48
|
-
}, renderAdditionalControls(toolbarVisibility, 'right'), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, '
|
|
51
|
+
}, renderAdditionalControls(toolbarVisibility, 'right'), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showKeyboardShortcuts') ? keyboardShortcuts : (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, {
|
|
52
|
+
showOnFocus: true
|
|
53
|
+
}, (0, _react2.jsx)("span", null, keyboardShortcuts)), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showDisplaySelector') ? displaySelector : null, checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showFullScreenSelector') ? fullScreenSelector : null));
|
|
49
54
|
};
|
|
50
55
|
/**
|
|
51
56
|
* Toolbar utilities
|
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "useDataGridFullScreenSelector", {
|
|
|
45
45
|
return _fullscreen_selector.useDataGridFullScreenSelector;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "useDataGridKeyboardShortcuts", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _keyboard_shortcuts.useDataGridKeyboardShortcuts;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
|
|
49
55
|
var _column_selector = require("./column_selector");
|
|
50
56
|
|
|
@@ -52,6 +58,8 @@ var _column_sorting = require("./column_sorting");
|
|
|
52
58
|
|
|
53
59
|
var _display_selector = require("./display_selector");
|
|
54
60
|
|
|
61
|
+
var _keyboard_shortcuts = require("./keyboard_shortcuts");
|
|
62
|
+
|
|
55
63
|
var _fullscreen_selector = require("./fullscreen_selector");
|
|
56
64
|
|
|
57
65
|
var _data_grid_toolbar = require("./data_grid_toolbar");
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useDataGridKeyboardShortcuts = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _services = require("../../../services");
|
|
13
|
+
|
|
14
|
+
var _button = require("../../button");
|
|
15
|
+
|
|
16
|
+
var _tool_tip = require("../../tool_tip");
|
|
17
|
+
|
|
18
|
+
var _popover = require("../../popover");
|
|
19
|
+
|
|
20
|
+
var _description_list = require("../../description_list");
|
|
21
|
+
|
|
22
|
+
var _text = require("../../text");
|
|
23
|
+
|
|
24
|
+
var _i18n = require("../../i18n");
|
|
25
|
+
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
33
|
+
|
|
34
|
+
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."); }
|
|
35
|
+
|
|
36
|
+
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); }
|
|
37
|
+
|
|
38
|
+
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; }
|
|
39
|
+
|
|
40
|
+
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; }
|
|
41
|
+
|
|
42
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
43
|
+
|
|
44
|
+
var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts() {
|
|
45
|
+
var _useState = (0, _react.useState)(false),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
isOpen = _useState2[0],
|
|
48
|
+
setIsOpen = _useState2[1];
|
|
49
|
+
|
|
50
|
+
var title = (0, _i18n.useEuiI18n)('euiKeyboardShortcuts.title', 'Keyboard shortcuts');
|
|
51
|
+
var titleId = (0, _services.useGeneratedHtmlId)();
|
|
52
|
+
var keyboardShortcuts = (0, _react.useMemo)(function () {
|
|
53
|
+
return (0, _react2.jsx)(_popover.EuiPopover, {
|
|
54
|
+
"data-test-subj": "dataGridKeyboardShortcutsPopover",
|
|
55
|
+
isOpen: isOpen,
|
|
56
|
+
closePopover: function closePopover() {
|
|
57
|
+
return setIsOpen(false);
|
|
58
|
+
},
|
|
59
|
+
anchorPosition: "downRight",
|
|
60
|
+
button: (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
61
|
+
content: title,
|
|
62
|
+
delay: "long"
|
|
63
|
+
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
64
|
+
size: "xs",
|
|
65
|
+
iconType: "keyboard",
|
|
66
|
+
color: "text",
|
|
67
|
+
"data-test-subj": "dataGridKeyboardShortcutsButton",
|
|
68
|
+
onClick: function onClick() {
|
|
69
|
+
return setIsOpen(!isOpen);
|
|
70
|
+
},
|
|
71
|
+
"aria-label": title
|
|
72
|
+
}))
|
|
73
|
+
}, (0, _react2.jsx)(_popover.EuiPopoverTitle, {
|
|
74
|
+
paddingSize: "s"
|
|
75
|
+
}, (0, _react2.jsx)("h2", {
|
|
76
|
+
id: titleId
|
|
77
|
+
}, title)), (0, _react2.jsx)(_text.EuiText, {
|
|
78
|
+
className: "euiDataGrid__keyboardShortcuts",
|
|
79
|
+
size: "xs"
|
|
80
|
+
}, (0, _react2.jsx)(_description_list.EuiDescriptionList, {
|
|
81
|
+
"aria-labelledby": titleId,
|
|
82
|
+
type: "column",
|
|
83
|
+
align: "center",
|
|
84
|
+
compressed: true,
|
|
85
|
+
gutterSize: "s",
|
|
86
|
+
listItems: [{
|
|
87
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
88
|
+
token: "euiKeyboardShortcuts.upArrowTitle",
|
|
89
|
+
default: "Up arrow"
|
|
90
|
+
})),
|
|
91
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
92
|
+
token: "euiKeyboardShortcuts.upArrowDescription",
|
|
93
|
+
default: "Move one cell up"
|
|
94
|
+
})
|
|
95
|
+
}, {
|
|
96
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
97
|
+
token: "euiKeyboardShortcuts.downArrowTitle",
|
|
98
|
+
default: "Down arrow"
|
|
99
|
+
})),
|
|
100
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
101
|
+
token: "euiKeyboardShortcuts.downArrowDescription",
|
|
102
|
+
default: "Move one cell down"
|
|
103
|
+
})
|
|
104
|
+
}, {
|
|
105
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
106
|
+
token: "euiKeyboardShortcuts.rightArrowTitle",
|
|
107
|
+
default: "Right arrow"
|
|
108
|
+
})),
|
|
109
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
110
|
+
token: "euiKeyboardShortcuts.rightArrowDescription",
|
|
111
|
+
default: "Move one cell right"
|
|
112
|
+
})
|
|
113
|
+
}, {
|
|
114
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
115
|
+
token: "euiKeyboardShortcuts.leftArrowTitle",
|
|
116
|
+
default: "Left arrow"
|
|
117
|
+
})),
|
|
118
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
119
|
+
token: "euiKeyboardShortcuts.leftArrowDescription",
|
|
120
|
+
default: "Move one cell left"
|
|
121
|
+
})
|
|
122
|
+
}, {
|
|
123
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
124
|
+
token: "euiKeyboardShortcuts.homeTitle",
|
|
125
|
+
default: "Home"
|
|
126
|
+
})),
|
|
127
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
128
|
+
token: "euiKeyboardShortcuts.homeDescription",
|
|
129
|
+
default: "Move to the first cell of the current row"
|
|
130
|
+
})
|
|
131
|
+
}, {
|
|
132
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
133
|
+
token: "euiKeyboardShortcuts.endTitle",
|
|
134
|
+
default: "End"
|
|
135
|
+
})),
|
|
136
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
137
|
+
token: "euiKeyboardShortcuts.endDescription",
|
|
138
|
+
default: "Move to the last cell of the current row"
|
|
139
|
+
})
|
|
140
|
+
}, {
|
|
141
|
+
title: (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
142
|
+
token: "euiKeyboardShortcuts.ctrl",
|
|
143
|
+
default: "Ctrl"
|
|
144
|
+
})), ' ', (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
145
|
+
token: "euiKeyboardShortcuts.homeTitle",
|
|
146
|
+
default: "Home"
|
|
147
|
+
}))),
|
|
148
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
149
|
+
token: "euiKeyboardShortcuts.ctrlHomeDescription",
|
|
150
|
+
default: "Move to the first cell of the current page"
|
|
151
|
+
})
|
|
152
|
+
}, {
|
|
153
|
+
title: (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
154
|
+
token: "euiKeyboardShortcuts.ctrl",
|
|
155
|
+
default: "Ctrl"
|
|
156
|
+
})), ' ', (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
157
|
+
token: "euiKeyboardShortcuts.endTitle",
|
|
158
|
+
default: "End"
|
|
159
|
+
}))),
|
|
160
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
161
|
+
token: "euiKeyboardShortcuts.ctrlEndDescription",
|
|
162
|
+
default: "Move to the last cell of the current page"
|
|
163
|
+
})
|
|
164
|
+
}, {
|
|
165
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
166
|
+
token: "euiKeyboardShortcuts.pageUpTitle",
|
|
167
|
+
default: "Page Up"
|
|
168
|
+
})),
|
|
169
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
170
|
+
token: "euiKeyboardShortcuts.pageUpDescription",
|
|
171
|
+
default: "Go to the last row of the previous page"
|
|
172
|
+
})
|
|
173
|
+
}, {
|
|
174
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
175
|
+
token: "euiKeyboardShortcuts.pageDownTitle",
|
|
176
|
+
default: "Page Down"
|
|
177
|
+
})),
|
|
178
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
179
|
+
token: "euiKeyboardShortcuts.pageDownDescription",
|
|
180
|
+
default: "Go to the first row of the next page"
|
|
181
|
+
})
|
|
182
|
+
}, {
|
|
183
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
184
|
+
token: "euiKeyboardShortcuts.enterTitle",
|
|
185
|
+
default: "Enter"
|
|
186
|
+
})),
|
|
187
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
188
|
+
token: "euiKeyboardShortcuts.enterDescription",
|
|
189
|
+
default: "Open cell details and actions"
|
|
190
|
+
})
|
|
191
|
+
}, {
|
|
192
|
+
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
193
|
+
token: "euiKeyboardShortcuts.escapeTitle",
|
|
194
|
+
default: "Escape"
|
|
195
|
+
})),
|
|
196
|
+
description: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
197
|
+
token: "euiKeyboardShortcuts.escapeDescription",
|
|
198
|
+
default: "Close cell details and actions"
|
|
199
|
+
})
|
|
200
|
+
}]
|
|
201
|
+
})));
|
|
202
|
+
}, [isOpen, title, titleId]);
|
|
203
|
+
return {
|
|
204
|
+
keyboardShortcuts: keyboardShortcuts
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
exports.useDataGridKeyboardShortcuts = useDataGridKeyboardShortcuts;
|