@elastic/eui 87.2.0 → 88.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -154
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -154
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/color_picker/color_palette_display/color_palette_display.js +3 -6
- package/es/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
- package/es/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
- package/es/components/color_picker/color_stops/color_stops.js +11 -0
- package/es/components/control_bar/control_bar.js +11 -0
- package/es/components/datagrid/controls/keyboard_shortcuts.js +0 -1
- package/es/components/description_list/description_list.js +28 -12
- package/es/components/description_list/description_list.styles.js +19 -6
- package/es/components/description_list/description_list_context.js +1 -1
- package/es/components/description_list/description_list_description.js +3 -9
- package/es/components/description_list/description_list_description.styles.js +3 -9
- package/es/components/description_list/description_list_title.js +7 -4
- package/es/components/description_list/description_list_title.styles.js +3 -6
- package/es/components/description_list/description_list_types.js +4 -2
- package/es/components/key_pad_menu/key_pad_menu_item.js +37 -34
- package/es/components/key_pad_menu/key_pad_menu_item.styles.js +41 -0
- package/es/components/notification/notification_event.js +10 -0
- package/es/components/suggest/suggest.js +16 -0
- package/es/components/suggest/suggest_item.js +12 -0
- package/es/services/color_picker/color_picker.js +4 -0
- package/eui.d.ts +2348 -2255
- package/i18ntokens.json +144 -144
- package/lib/components/color_picker/color_palette_display/color_palette_display.js +3 -6
- package/lib/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
- package/lib/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
- package/lib/components/color_picker/color_stops/color_stops.js +10 -1
- package/lib/components/control_bar/control_bar.js +10 -1
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +0 -1
- package/lib/components/description_list/description_list.js +31 -12
- package/lib/components/description_list/description_list.styles.js +24 -13
- package/lib/components/description_list/description_list_context.js +1 -1
- package/lib/components/description_list/description_list_description.js +2 -8
- package/lib/components/description_list/description_list_description.styles.js +2 -8
- package/lib/components/description_list/description_list_title.js +7 -4
- package/lib/components/description_list/description_list_title.styles.js +2 -5
- package/lib/components/description_list/description_list_types.js +8 -4
- package/lib/components/key_pad_menu/key_pad_menu_item.js +40 -34
- package/lib/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
- package/lib/components/notification/notification_event.js +9 -0
- package/lib/components/suggest/suggest.js +16 -0
- package/lib/components/suggest/suggest_item.js +11 -0
- package/lib/services/color_picker/color_picker.js +4 -0
- package/optimize/es/components/color_picker/color_stops/color_stops.js +11 -0
- package/optimize/es/components/control_bar/control_bar.js +11 -0
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +0 -1
- package/optimize/es/components/description_list/description_list.js +20 -10
- package/optimize/es/components/description_list/description_list.styles.js +19 -6
- package/optimize/es/components/description_list/description_list_context.js +1 -1
- package/optimize/es/components/description_list/description_list_description.js +3 -9
- package/optimize/es/components/description_list/description_list_description.styles.js +3 -9
- package/optimize/es/components/description_list/description_list_title.js +7 -4
- package/optimize/es/components/description_list/description_list_title.styles.js +3 -6
- package/optimize/es/components/description_list/description_list_types.js +4 -2
- package/optimize/es/components/key_pad_menu/key_pad_menu_item.js +37 -34
- package/optimize/es/components/key_pad_menu/key_pad_menu_item.styles.js +41 -0
- package/optimize/es/components/notification/notification_event.js +10 -0
- package/optimize/es/components/suggest/suggest.js +16 -0
- package/optimize/es/components/suggest/suggest_item.js +12 -0
- package/optimize/es/services/color_picker/color_picker.js +4 -0
- package/optimize/lib/components/color_picker/color_stops/color_stops.js +10 -1
- package/optimize/lib/components/control_bar/control_bar.js +10 -1
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +0 -1
- package/optimize/lib/components/description_list/description_list.js +23 -10
- package/optimize/lib/components/description_list/description_list.styles.js +24 -13
- package/optimize/lib/components/description_list/description_list_context.js +1 -1
- package/optimize/lib/components/description_list/description_list_description.js +2 -8
- package/optimize/lib/components/description_list/description_list_description.styles.js +2 -8
- package/optimize/lib/components/description_list/description_list_title.js +7 -4
- package/optimize/lib/components/description_list/description_list_title.styles.js +2 -5
- package/optimize/lib/components/description_list/description_list_types.js +8 -4
- package/optimize/lib/components/key_pad_menu/key_pad_menu_item.js +40 -34
- package/optimize/lib/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
- package/optimize/lib/components/notification/notification_event.js +9 -0
- package/optimize/lib/components/suggest/suggest.js +16 -0
- package/optimize/lib/components/suggest/suggest_item.js +11 -0
- package/optimize/lib/services/color_picker/color_picker.js +4 -0
- package/package.json +6 -6
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/color_picker/color_palette_display/color_palette_display.js +3 -6
- package/test-env/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
- package/test-env/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
- package/test-env/components/color_picker/color_stops/color_stops.js +10 -1
- package/test-env/components/control_bar/control_bar.js +10 -1
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +0 -1
- package/test-env/components/description_list/description_list.js +31 -12
- package/test-env/components/description_list/description_list.styles.js +24 -13
- package/test-env/components/description_list/description_list_context.js +1 -1
- package/test-env/components/description_list/description_list_description.js +2 -8
- package/test-env/components/description_list/description_list_description.styles.js +2 -8
- package/test-env/components/description_list/description_list_title.js +7 -4
- package/test-env/components/description_list/description_list_title.styles.js +2 -5
- package/test-env/components/description_list/description_list_types.js +8 -4
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +40 -34
- package/test-env/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
- package/test-env/components/notification/notification_event.js +9 -0
- package/test-env/components/suggest/suggest.js +16 -0
- package/test-env/components/suggest/suggest_item.js +11 -0
- package/test-env/services/color_picker/color_picker.js +4 -0
- package/src/components/key_pad_menu/_index.scss +0 -5
- package/src/components/key_pad_menu/_key_pad_menu_item.scss +0 -123
- package/src/components/key_pad_menu/_variables.scss +0 -2
- package/src/themes/amsterdam/overrides/_key_pad_menu.scss +0 -46
|
@@ -48,10 +48,7 @@ EuiColorPaletteDisplayFixed.propTypes = {
|
|
|
48
48
|
"data-test-subj": _propTypes.default.string,
|
|
49
49
|
css: _propTypes.default.any,
|
|
50
50
|
/**
|
|
51
|
-
* Array of color `strings` or an array of #
|
|
51
|
+
* Array of color `strings` or an array of #PaletteColorStop. The stops must be numbers in an ordered range.
|
|
52
52
|
*/
|
|
53
|
-
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.
|
|
54
|
-
stop: _propTypes.default.number.isRequired,
|
|
55
|
-
color: _propTypes.default.string.isRequired
|
|
56
|
-
}).isRequired).isRequired]).isRequired
|
|
53
|
+
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.any.isRequired).isRequired]).isRequired
|
|
57
54
|
};
|
|
@@ -50,10 +50,7 @@ EuiColorPaletteDisplayGradient.propTypes = {
|
|
|
50
50
|
"data-test-subj": _propTypes.default.string,
|
|
51
51
|
css: _propTypes.default.any,
|
|
52
52
|
/**
|
|
53
|
-
* Array of color `strings` or an array of #
|
|
53
|
+
* Array of color `strings` or an array of #PaletteColorStop. The stops must be numbers in an ordered range.
|
|
54
54
|
*/
|
|
55
|
-
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.
|
|
56
|
-
stop: _propTypes.default.number.isRequired,
|
|
57
|
-
color: _propTypes.default.string.isRequired
|
|
58
|
-
}).isRequired).isRequired]).isRequired
|
|
55
|
+
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.any.isRequired).isRequired]).isRequired
|
|
59
56
|
};
|
|
@@ -180,7 +180,7 @@ EuiColorPalettePicker.propTypes = {
|
|
|
180
180
|
*/
|
|
181
181
|
type: _propTypes.default.oneOf(["text"]).isRequired,
|
|
182
182
|
/**
|
|
183
|
-
* Array of color `strings` or an array of #
|
|
183
|
+
* Array of color `strings` or an array of #PaletteColorStop. The stops must be numbers in an ordered range.
|
|
184
184
|
*/
|
|
185
185
|
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
186
186
|
stop: _propTypes.default.number.isRequired,
|
|
@@ -204,7 +204,7 @@ EuiColorPalettePicker.propTypes = {
|
|
|
204
204
|
*/
|
|
205
205
|
type: _propTypes.default.oneOf(["fixed"]).isRequired,
|
|
206
206
|
/**
|
|
207
|
-
* Array of color `strings` or an array of #
|
|
207
|
+
* Array of color `strings` or an array of #PaletteColorStop. The stops must be numbers in an ordered range.
|
|
208
208
|
*/
|
|
209
209
|
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
210
210
|
stop: _propTypes.default.number.isRequired,
|
|
@@ -228,7 +228,7 @@ EuiColorPalettePicker.propTypes = {
|
|
|
228
228
|
*/
|
|
229
229
|
type: _propTypes.default.oneOf(["gradient"]).isRequired,
|
|
230
230
|
/**
|
|
231
|
-
* Array of color `strings` or an array of #
|
|
231
|
+
* Array of color `strings` or an array of #PaletteColorStop. The stops must be numbers in an ordered range.
|
|
232
232
|
*/
|
|
233
233
|
palette: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired).isRequired, _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
234
234
|
stop: _propTypes.default.number.isRequired,
|
|
@@ -46,7 +46,9 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
46
46
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
47
47
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
48
48
|
* Side Public License, v 1.
|
|
49
|
-
*/
|
|
49
|
+
*/ /**
|
|
50
|
+
* @deprecated
|
|
51
|
+
*/
|
|
50
52
|
// Because of how the thumbs are rendered in the popover, using ref results in an infinite loop.
|
|
51
53
|
// We'll instead use old fashioned namespaced DOM selectors to get references
|
|
52
54
|
var STOP_ATTR = 'euiColorStop_';
|
|
@@ -101,6 +103,13 @@ function getRangeMax(colorStops, max) {
|
|
|
101
103
|
}
|
|
102
104
|
return DEFAULT_MAX;
|
|
103
105
|
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated - EuiColorStops is scheduled for deprecation due to low internal usage and high
|
|
109
|
+
* maintenance requirements. If necessary, we recommend copying this component into your own application.
|
|
110
|
+
*
|
|
111
|
+
* The component will be permanently removed in October 2023.
|
|
112
|
+
*/
|
|
104
113
|
var EuiColorStops = function EuiColorStops(_ref) {
|
|
105
114
|
var _ref$addColor = _ref.addColor,
|
|
106
115
|
addColor = _ref$addColor === void 0 ? _services.DEFAULT_VISUALIZATION_COLOR : _ref$addColor,
|
|
@@ -67,7 +67,16 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
67
67
|
*/ /**
|
|
68
68
|
* Icon can extend EuiButtonIcon
|
|
69
69
|
* Also omits `iconType` and `id` as these are also specific to icon control
|
|
70
|
-
*/
|
|
70
|
+
*/ /**
|
|
71
|
+
* @deprecated
|
|
72
|
+
*/
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated - EuiControlBar is scheduled for deprecation due to low internal usage and high
|
|
75
|
+
* overlap with other existing EUI components. We recommend using EuiBottomBar instead,
|
|
76
|
+
* or copying this component into your own application for usage if necessary.
|
|
77
|
+
*
|
|
78
|
+
* The component will be permanently removed in December 2023.
|
|
79
|
+
*/
|
|
71
80
|
var EuiControlBar = /*#__PURE__*/function (_Component) {
|
|
72
81
|
_inherits(EuiControlBar, _Component);
|
|
73
82
|
var _super = _createSuper(EuiControlBar);
|
|
@@ -68,7 +68,6 @@ var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts() {
|
|
|
68
68
|
type: "column",
|
|
69
69
|
align: "center",
|
|
70
70
|
compressed: true,
|
|
71
|
-
gutterSize: "s",
|
|
72
71
|
listItems: [{
|
|
73
72
|
title: (0, _react2.jsx)("kbd", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
74
73
|
token: "euiKeyboardShortcuts.upArrowTitle",
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.EuiDescriptionList = void 0;
|
|
7
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _services = require("../../services");
|
|
12
|
+
var _description_list_context = require("./description_list_context");
|
|
10
13
|
var _description_list_title = require("./description_list_title");
|
|
11
14
|
var _description_list_description = require("./description_list_description");
|
|
12
|
-
var _services = require("../../services");
|
|
13
15
|
var _description_list = require("./description_list.styles");
|
|
14
|
-
var _description_list_context = require("./description_list_context");
|
|
15
16
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "
|
|
17
|
+
var _excluded = ["align", "children", "className", "compressed", "descriptionProps", "listItems", "textStyle", "titleProps", "type", "rowGutterSize", "columnGutterSize"];
|
|
17
18
|
/*
|
|
18
19
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
20
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -22,6 +23,8 @@ var _excluded = ["align", "children", "className", "compressed", "descriptionPro
|
|
|
22
23
|
* Side Public License, v 1.
|
|
23
24
|
*/
|
|
24
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
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); }
|
|
27
|
+
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; }
|
|
25
28
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
26
29
|
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; }
|
|
27
30
|
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; }
|
|
@@ -38,13 +41,23 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
38
41
|
textStyle = _ref$textStyle === void 0 ? 'normal' : _ref$textStyle,
|
|
39
42
|
titleProps = _ref.titleProps,
|
|
40
43
|
_ref$type = _ref.type,
|
|
41
|
-
|
|
42
|
-
_ref$
|
|
43
|
-
|
|
44
|
+
_type = _ref$type === void 0 ? 'row' : _ref$type,
|
|
45
|
+
_ref$rowGutterSize = _ref.rowGutterSize,
|
|
46
|
+
rowGutterSize = _ref$rowGutterSize === void 0 ? 's' : _ref$rowGutterSize,
|
|
47
|
+
_ref$columnGutterSize = _ref.columnGutterSize,
|
|
48
|
+
columnGutterSize = _ref$columnGutterSize === void 0 ? 's' : _ref$columnGutterSize,
|
|
44
49
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
|
+
var showResponsiveColumns = (0, _services.useIsWithinBreakpoints)(['xs', 's']);
|
|
51
|
+
var type = (0, _react.useMemo)(function () {
|
|
52
|
+
if (_type === 'responsiveColumn') {
|
|
53
|
+
return showResponsiveColumns ? 'row' : 'column';
|
|
54
|
+
} else {
|
|
55
|
+
return _type;
|
|
56
|
+
}
|
|
57
|
+
}, [_type, showResponsiveColumns]);
|
|
45
58
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
46
59
|
var styles = (0, _description_list.euiDescriptionListStyles)(euiTheme);
|
|
47
|
-
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align]];
|
|
60
|
+
var cssStyles = [styles.euiDescriptionList, styles[type], styles[align], type === 'column' && styles.rowGap[rowGutterSize], type === 'column' && styles.columnGap[columnGutterSize]];
|
|
48
61
|
var classes = (0, _classnames.default)('euiDescriptionList', className);
|
|
49
62
|
var childrenOrListItems = null;
|
|
50
63
|
if (listItems) {
|
|
@@ -64,13 +77,13 @@ var EuiDescriptionList = function EuiDescriptionList(_ref) {
|
|
|
64
77
|
compressed: compressed,
|
|
65
78
|
textStyle: textStyle,
|
|
66
79
|
align: align,
|
|
67
|
-
|
|
80
|
+
rowGutterSize: rowGutterSize
|
|
68
81
|
}
|
|
69
82
|
}, (0, _react2.jsx)("dl", _extends({
|
|
70
83
|
className: classes,
|
|
71
84
|
css: cssStyles
|
|
72
85
|
}, rest, {
|
|
73
|
-
"data-type":
|
|
86
|
+
"data-type": _type
|
|
74
87
|
}), childrenOrListItems));
|
|
75
88
|
};
|
|
76
89
|
exports.EuiDescriptionList = EuiDescriptionList;
|
|
@@ -119,7 +132,13 @@ EuiDescriptionList.propTypes = {
|
|
|
119
132
|
css: _propTypes.default.any
|
|
120
133
|
}),
|
|
121
134
|
/**
|
|
122
|
-
*
|
|
135
|
+
* Allows customizing the vertical spacing between rows.
|
|
136
|
+
*/
|
|
137
|
+
rowGutterSize: _propTypes.default.any,
|
|
138
|
+
/**
|
|
139
|
+
* Allows customizing the horizontal spacing between columns.
|
|
140
|
+
*
|
|
141
|
+
* Only applies to `column` and `responsiveColumn` types.
|
|
123
142
|
*/
|
|
124
|
-
|
|
143
|
+
columnGutterSize: _propTypes.default.any
|
|
125
144
|
};
|
|
@@ -6,25 +6,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.euiDescriptionListStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
|
-
/*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
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)."; } /*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
17
|
+
name: "zr5fhc-column",
|
|
18
|
+
styles: "display:grid;grid-template-columns:minmax(auto, max-content) minmax(auto, max-content);align-items:baseline;label:column;"
|
|
19
|
+
} : {
|
|
20
|
+
name: "zr5fhc-column",
|
|
21
|
+
styles: "display:grid;grid-template-columns:minmax(auto, max-content) minmax(auto, max-content);align-items:baseline;label:column;",
|
|
22
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
23
|
+
};
|
|
17
24
|
var euiDescriptionListStyles = function euiDescriptionListStyles(euiThemeContext) {
|
|
18
|
-
// Flex display for column and responsive column
|
|
19
|
-
var columnDisplay = "\n display: flex;\n align-items: baseline;\n flex-wrap: wrap; \n ";
|
|
20
25
|
return {
|
|
21
26
|
euiDescriptionList: /*#__PURE__*/(0, _react.css)(";label:euiDescriptionList;"),
|
|
22
27
|
// Types
|
|
23
28
|
row: /*#__PURE__*/(0, _react.css)(";label:row;"),
|
|
24
29
|
inline: /*#__PURE__*/(0, _react.css)(";label:inline;"),
|
|
25
|
-
column:
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
column: _ref,
|
|
31
|
+
columnGap: {
|
|
32
|
+
s: /*#__PURE__*/(0, _react.css)("column-gap:", euiThemeContext.euiTheme.size.s, ";;label:s;"),
|
|
33
|
+
m: /*#__PURE__*/(0, _react.css)("column-gap:", euiThemeContext.euiTheme.size.xl, ";;label:m;")
|
|
34
|
+
},
|
|
35
|
+
rowGap: {
|
|
36
|
+
s: /*#__PURE__*/(0, _react.css)("row-gap:", euiThemeContext.euiTheme.size.s, ";;label:s;"),
|
|
37
|
+
m: /*#__PURE__*/(0, _react.css)("row-gap:", euiThemeContext.euiTheme.size.m, ";;label:m;")
|
|
38
|
+
},
|
|
28
39
|
// Alignment
|
|
29
40
|
center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";;label:center;"),
|
|
30
41
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;")
|
|
@@ -17,7 +17,7 @@ var contextDefaults = {
|
|
|
17
17
|
type: 'row',
|
|
18
18
|
textStyle: 'normal',
|
|
19
19
|
align: 'left',
|
|
20
|
-
|
|
20
|
+
rowGutterSize: 's'
|
|
21
21
|
};
|
|
22
22
|
exports.contextDefaults = contextDefaults;
|
|
23
23
|
var EuiDescriptionListContext = /*#__PURE__*/(0, _react.createContext)(contextDefaults);
|
|
@@ -9,8 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../services");
|
|
12
|
-
var _description_list_description = require("./description_list_description.styles");
|
|
13
12
|
var _description_list_context = require("./description_list_context");
|
|
13
|
+
var _description_list_description = require("./description_list_description.styles");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
15
|
var _excluded = ["children", "className"];
|
|
16
16
|
/*
|
|
@@ -41,9 +41,7 @@ var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref)
|
|
|
41
41
|
type = _useContext.type,
|
|
42
42
|
textStyle = _useContext.textStyle,
|
|
43
43
|
compressed = _useContext.compressed,
|
|
44
|
-
align = _useContext.align
|
|
45
|
-
gutterSize = _useContext.gutterSize;
|
|
46
|
-
var showResponsiveColumns = (0, _services.useIsWithinMinBreakpoint)('m');
|
|
44
|
+
align = _useContext.align;
|
|
47
45
|
var theme = (0, _services.useEuiTheme)();
|
|
48
46
|
var styles = (0, _description_list_description.euiDescriptionListDescriptionStyles)(theme);
|
|
49
47
|
var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
@@ -51,14 +49,10 @@ var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref)
|
|
|
51
49
|
case 'inline':
|
|
52
50
|
conditionalStyles = compressed ? [styles.inlineStyles.compressed] : [styles.inlineStyles.normal];
|
|
53
51
|
break;
|
|
54
|
-
case 'responsiveColumn':
|
|
55
52
|
case 'column':
|
|
56
53
|
if (align === 'center') {
|
|
57
54
|
conditionalStyles.push(styles.left);
|
|
58
55
|
}
|
|
59
|
-
if (type === 'column' || showResponsiveColumns) {
|
|
60
|
-
conditionalStyles.push(styles[gutterSize]);
|
|
61
|
-
}
|
|
62
56
|
break;
|
|
63
57
|
}
|
|
64
58
|
var cssStyles = [styles.euiDescriptionList__description, styles[type]].concat(_toConsumableArray(conditionalStyles));
|
|
@@ -23,14 +23,11 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
23
23
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
24
|
};
|
|
25
25
|
var euiDescriptionListDescriptionStyles = function euiDescriptionListDescriptionStyles(euiThemeContext) {
|
|
26
|
-
var euiTheme = euiThemeContext.euiTheme;
|
|
27
|
-
var columnDisplay = "\n ".concat((0, _global_styling.logicalCSS)('width', '50%'), "\n ").concat((0, _global_styling.logicalCSS)('padding-left', euiTheme.size.s), "\n ");
|
|
28
26
|
return {
|
|
29
27
|
euiDescriptionList__description: /*#__PURE__*/(0, _react.css)(";label:euiDescriptionList__description;"),
|
|
30
28
|
// Types
|
|
31
29
|
row: /*#__PURE__*/(0, _react.css)(";label:row;"),
|
|
32
|
-
column: /*#__PURE__*/(0, _react.css)(
|
|
33
|
-
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('width', '100%'), " padding:0;}", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
30
|
+
column: /*#__PURE__*/(0, _react.css)(";label:column;"),
|
|
34
31
|
inline: _ref,
|
|
35
32
|
// This nested block handles just the font styling based on compressed and reverse
|
|
36
33
|
fontStyles: {
|
|
@@ -44,10 +41,7 @@ var euiDescriptionListDescriptionStyles = function euiDescriptionListDescription
|
|
|
44
41
|
normal: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";;label:normal;")
|
|
45
42
|
},
|
|
46
43
|
// Column types should align description text to the left when EuiDecriptionList is centered
|
|
47
|
-
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;")
|
|
48
|
-
// Gutter
|
|
49
|
-
s: /*#__PURE__*/(0, _react.css)("&:not(:first-of-type){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), ";};label:s;"),
|
|
50
|
-
m: /*#__PURE__*/(0, _react.css)("&:not(:first-of-type){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.base), ";};label:m;")
|
|
44
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;")
|
|
51
45
|
};
|
|
52
46
|
};
|
|
53
47
|
exports.euiDescriptionListDescriptionStyles = euiDescriptionListDescriptionStyles;
|
|
@@ -9,8 +9,8 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../services");
|
|
12
|
-
var _description_list_title = require("./description_list_title.styles");
|
|
13
12
|
var _description_list_context = require("./description_list_context");
|
|
13
|
+
var _description_list_title = require("./description_list_title.styles");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
15
|
var _excluded = ["children", "className"];
|
|
16
16
|
/*
|
|
@@ -42,22 +42,25 @@ var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
|
|
|
42
42
|
textStyle = _useContext.textStyle,
|
|
43
43
|
compressed = _useContext.compressed,
|
|
44
44
|
align = _useContext.align,
|
|
45
|
-
|
|
45
|
+
rowGutterSize = _useContext.rowGutterSize;
|
|
46
46
|
var theme = (0, _services.useEuiTheme)();
|
|
47
47
|
var styles = (0, _description_list_title.euiDescriptionListTitleStyles)(theme);
|
|
48
48
|
var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
49
49
|
switch (type) {
|
|
50
50
|
case 'inline':
|
|
51
51
|
conditionalStyles = compressed ? [styles.inlineStyles.compressed] : [styles.inlineStyles.normal];
|
|
52
|
+
conditionalStyles.push(styles[rowGutterSize]);
|
|
53
|
+
break;
|
|
54
|
+
case 'row':
|
|
55
|
+
conditionalStyles.push(styles[rowGutterSize]);
|
|
52
56
|
break;
|
|
53
|
-
case 'responsiveColumn':
|
|
54
57
|
case 'column':
|
|
55
58
|
if (align === 'center') {
|
|
56
59
|
conditionalStyles.push(styles.right);
|
|
57
60
|
}
|
|
58
61
|
break;
|
|
59
62
|
}
|
|
60
|
-
var cssStyles = [styles.euiDescriptionList__title, styles[type]
|
|
63
|
+
var cssStyles = [styles.euiDescriptionList__title, styles[type]].concat(_toConsumableArray(conditionalStyles));
|
|
61
64
|
var classes = (0, _classnames.default)('euiDescriptionList__title', className);
|
|
62
65
|
return (0, _react2.jsx)("dt", _extends({
|
|
63
66
|
className: classes,
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.euiDescriptionListTitleStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
|
-
var _services = require("../../services");
|
|
10
9
|
var _title = require("../title/title.styles");
|
|
11
10
|
/*
|
|
12
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -19,14 +18,12 @@ var _title = require("../title/title.styles");
|
|
|
19
18
|
var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiThemeContext) {
|
|
20
19
|
var euiTheme = euiThemeContext.euiTheme,
|
|
21
20
|
colorMode = euiThemeContext.colorMode;
|
|
22
|
-
var columnDisplay = "\n ".concat((0, _global_styling.logicalCSS)('width', '50%'), "\n ").concat((0, _global_styling.logicalCSS)('padding-right', euiTheme.size.s), "\n ");
|
|
23
21
|
return {
|
|
24
22
|
euiDescriptionList__title: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";;label:euiDescriptionList__title;"),
|
|
25
23
|
// Types
|
|
26
24
|
row: /*#__PURE__*/(0, _react.css)(";label:row;"),
|
|
27
|
-
column: /*#__PURE__*/(0, _react.css)(
|
|
28
|
-
|
|
29
|
-
inline: /*#__PURE__*/(0, _react.css)("display:inline;border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.medium, ";background-color:", colorMode === 'DARK' ? (0, _services.tint)(euiTheme.colors.lightestShade, 0.5) : euiTheme.colors.lightestShade, ";", (0, _global_styling.logicalCSS)('margin-vertical', '0'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', euiTheme.size.xs), "&:first-of-type{", (0, _global_styling.logicalCSS)('margin-left', '0'), ";};label:inline;"),
|
|
25
|
+
column: /*#__PURE__*/(0, _react.css)(";label:column;"),
|
|
26
|
+
inline: /*#__PURE__*/(0, _react.css)("display:inline;border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.medium, ";background-color:", colorMode === 'DARK' ? euiTheme.colors.lightShade : euiTheme.colors.lightestShade, ";", (0, _global_styling.logicalCSS)('margin-vertical', '0'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', euiTheme.size.xs), " ", colorMode === 'DARK' && "color: ".concat(euiTheme.colors.title, ";"), "&:first-of-type{", (0, _global_styling.logicalCSS)('margin-left', '0'), ";};label:inline;"),
|
|
30
27
|
// This nested block handles just the font styling based on compressed and reverse
|
|
31
28
|
fontStyles: {
|
|
32
29
|
normal: /*#__PURE__*/(0, _react.css)((0, _title.euiTitle)(euiThemeContext, 'xs'), ";;label:normal;"),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TYPES = exports.TEXT_STYLES = exports.
|
|
6
|
+
exports.TYPES = exports.TEXT_STYLES = exports.ROW_GUTTER_SIZES = exports.COLUMN_GUTTER_SIZES = exports.CHILD_TYPES = exports.ALIGNMENTS = void 0;
|
|
7
7
|
/*
|
|
8
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -12,11 +12,15 @@ exports.TYPES = exports.TEXT_STYLES = exports.GUTTER_SIZES = exports.ALIGNMENTS
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var CHILD_TYPES = ['row', 'inline', 'column'];
|
|
16
|
+
exports.CHILD_TYPES = CHILD_TYPES;
|
|
17
|
+
var TYPES = [].concat(CHILD_TYPES, ['responsiveColumn']);
|
|
16
18
|
exports.TYPES = TYPES;
|
|
17
19
|
var ALIGNMENTS = ['center', 'left'];
|
|
18
20
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
19
21
|
var TEXT_STYLES = ['normal', 'reverse'];
|
|
20
22
|
exports.TEXT_STYLES = TEXT_STYLES;
|
|
21
|
-
var
|
|
22
|
-
exports.
|
|
23
|
+
var ROW_GUTTER_SIZES = ['s', 'm'];
|
|
24
|
+
exports.ROW_GUTTER_SIZES = ROW_GUTTER_SIZES;
|
|
25
|
+
var COLUMN_GUTTER_SIZES = ['s', 'm'];
|
|
26
|
+
exports.COLUMN_GUTTER_SIZES = COLUMN_GUTTER_SIZES;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.EuiKeyPadMenuItem = void 0;
|
|
7
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _beta_badge = require("../badge/beta_badge");
|
|
11
11
|
var _services = require("../../services");
|
|
12
|
+
var _beta_badge = require("../badge/beta_badge");
|
|
12
13
|
var _form = require("../form");
|
|
13
14
|
var _href_validator = require("../../services/security/href_validator");
|
|
14
15
|
var _tool_tip = require("../tool_tip");
|
|
16
|
+
var _key_pad_menu_item = require("./key_pad_menu_item.styles");
|
|
15
17
|
var _react2 = require("@emotion/react");
|
|
16
18
|
var _excluded = ["id", "isSelected", "isDisabled", "label", "children", "className", "betaBadgeLabel", "betaBadgeTooltipContent", "betaBadgeIconType", "betaBadgeTooltipProps", "href", "rel", "target", "buttonRef", "checkable", "name", "value", "disabled", "onChange"];
|
|
17
19
|
/*
|
|
@@ -22,6 +24,8 @@ var _excluded = ["id", "isSelected", "isDisabled", "label", "children", "classNa
|
|
|
22
24
|
* Side Public License, v 1.
|
|
23
25
|
*/
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
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); }
|
|
28
|
+
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; }
|
|
25
29
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
26
30
|
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; }
|
|
27
31
|
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; }
|
|
@@ -48,48 +52,45 @@ var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
48
52
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
49
53
|
var isHrefValid = !href || (0, _href_validator.validateHref)(href);
|
|
50
54
|
var isDisabled = disabled || _isDisabled || !isHrefValid;
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'euiKeyPadMenuItem-isSelected': isSelected
|
|
56
|
-
}, className);
|
|
55
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
56
|
+
var styles = (0, _key_pad_menu_item.euiKeyPadMenuItemStyles)(euiTheme);
|
|
57
|
+
var cssStyles = [styles.euiKeyPadMenuItem, !isDisabled ? styles.enabled : styles.disabled.disabled, isSelected && (!isDisabled ? styles.selected : styles.disabled.selected)];
|
|
58
|
+
var classes = (0, _classnames.default)('euiKeyPadMenuItem', className);
|
|
57
59
|
var Element = href && !isDisabled ? 'a' : 'button';
|
|
58
60
|
if (checkable) Element = 'label';
|
|
59
61
|
var itemId = (0, _services.useGeneratedHtmlId)({
|
|
60
62
|
conditionalId: id
|
|
61
63
|
});
|
|
62
|
-
var
|
|
64
|
+
var childStyles = (0, _react.useMemo)(function () {
|
|
65
|
+
return (0, _key_pad_menu_item.euiKeyPadMenuItemChildStyles)(euiTheme);
|
|
66
|
+
}, [euiTheme]);
|
|
67
|
+
var checkableElement = (0, _react.useMemo)(function () {
|
|
63
68
|
if (!checkable) return;
|
|
64
|
-
var
|
|
65
|
-
var
|
|
69
|
+
var cssStyles = [childStyles.euiKeyPadMenuItem__checkableInput, !isSelected && isDisabled && childStyles.hideCheckableInput, !isSelected && !isDisabled && childStyles.showCheckableInputOnInteraction];
|
|
70
|
+
var sharedProps = {
|
|
71
|
+
id: itemId,
|
|
72
|
+
className: 'euiKeyPadMenuItem__checkableInput',
|
|
73
|
+
css: cssStyles,
|
|
74
|
+
checked: isSelected,
|
|
75
|
+
disabled: isDisabled,
|
|
76
|
+
name: name
|
|
77
|
+
};
|
|
66
78
|
if (checkable === 'single') {
|
|
67
|
-
|
|
68
|
-
id: itemId,
|
|
69
|
-
className: inputClasses,
|
|
70
|
-
checked: isSelected,
|
|
71
|
-
disabled: isDisabled,
|
|
72
|
-
name: name,
|
|
79
|
+
return (0, _react2.jsx)(_form.EuiRadio, _extends({}, sharedProps, {
|
|
73
80
|
value: value,
|
|
74
81
|
onChange: function onChange() {
|
|
75
82
|
return _onChange(itemId, value);
|
|
76
83
|
}
|
|
77
|
-
});
|
|
84
|
+
}));
|
|
78
85
|
} else {
|
|
79
|
-
|
|
80
|
-
id: itemId,
|
|
81
|
-
className: inputClasses,
|
|
82
|
-
checked: isSelected,
|
|
83
|
-
disabled: isDisabled,
|
|
84
|
-
name: name,
|
|
86
|
+
return (0, _react2.jsx)(_form.EuiCheckbox, _extends({}, sharedProps, {
|
|
85
87
|
onChange: function onChange() {
|
|
86
88
|
return _onChange(itemId);
|
|
87
89
|
}
|
|
88
|
-
});
|
|
90
|
+
}));
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
var renderBetaBadge = function renderBetaBadge() {
|
|
92
|
+
}, [checkable, isDisabled, isSelected, _onChange, value, name, itemId, childStyles]);
|
|
93
|
+
var betaBadge = (0, _react.useMemo)(function () {
|
|
93
94
|
if (!betaBadgeLabel) return;
|
|
94
95
|
return (0, _react2.jsx)(_beta_badge.EuiBetaBadge
|
|
95
96
|
// Since we move the tooltip contents to a wrapping EuiToolTip,
|
|
@@ -99,10 +100,11 @@ var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
99
100
|
size: "s",
|
|
100
101
|
color: "subdued",
|
|
101
102
|
className: "euiKeyPadMenuItem__betaBadge",
|
|
103
|
+
css: childStyles.euiKeyPadMenuItem__betaBadge,
|
|
102
104
|
label: betaBadgeLabel.charAt(0),
|
|
103
105
|
iconType: betaBadgeIconType
|
|
104
106
|
});
|
|
105
|
-
};
|
|
107
|
+
}, [betaBadgeLabel, betaBadgeIconType, childStyles]);
|
|
106
108
|
var relObj = {};
|
|
107
109
|
if (href && !isDisabled) {
|
|
108
110
|
relObj.href = href;
|
|
@@ -121,16 +123,20 @@ var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
121
123
|
relObj['aria-pressed'] = isSelected;
|
|
122
124
|
}
|
|
123
125
|
var button = (0, _react2.jsx)(Element, _extends({
|
|
124
|
-
className: classes
|
|
126
|
+
className: classes,
|
|
127
|
+
css: cssStyles
|
|
125
128
|
}, relObj, rest, {
|
|
126
129
|
// Unable to get past `LegacyRef` conflicts
|
|
127
130
|
ref: buttonRef
|
|
128
131
|
}), (0, _react2.jsx)("span", {
|
|
129
|
-
className: "euiKeyPadMenuItem__inner"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
className: "euiKeyPadMenuItem__inner",
|
|
133
|
+
css: childStyles.euiKeyPadMenuItem__inner
|
|
134
|
+
}, checkable ? checkableElement : betaBadge, (0, _react2.jsx)("span", {
|
|
135
|
+
className: "euiKeyPadMenuItem__icon",
|
|
136
|
+
css: childStyles.euiKeyPadMenuItem__icon
|
|
132
137
|
}, children), (0, _react2.jsx)("span", {
|
|
133
|
-
className: "euiKeyPadMenuItem__label"
|
|
138
|
+
className: "euiKeyPadMenuItem__label",
|
|
139
|
+
css: childStyles.euiKeyPadMenuItem__label
|
|
134
140
|
}, label)));
|
|
135
141
|
return betaBadgeLabel ? (0, _react2.jsx)(_tool_tip.EuiToolTip, _extends({}, betaBadgeTooltipProps, {
|
|
136
142
|
title: betaBadgeLabel,
|