@elastic/eui 87.1.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 -388
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -388
- 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/page_template/page_template.js +2 -1
- package/es/components/resizable_container/index.js +2 -1
- package/es/components/resizable_container/resizable_button.js +81 -50
- package/es/components/resizable_container/resizable_button.styles.js +66 -0
- package/es/components/resizable_container/resizable_collapse_button.js +24 -14
- package/es/components/resizable_container/resizable_collapse_button.styles.js +85 -0
- package/es/components/steps/step.styles.js +5 -5
- package/es/components/suggest/suggest.js +16 -0
- package/es/components/suggest/suggest_item.js +12 -0
- package/es/services/accessibility/html_id_generator.js +19 -3
- package/es/services/color_picker/color_picker.js +4 -0
- package/es/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
- package/eui.d.ts +2277 -2090
- package/i18ntokens.json +154 -154
- 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/page_template/page_template.js +2 -1
- package/lib/components/resizable_container/index.js +8 -1
- package/lib/components/resizable_container/resizable_button.js +83 -51
- package/lib/components/resizable_container/resizable_button.styles.js +71 -0
- package/lib/components/resizable_container/resizable_collapse_button.js +24 -14
- package/lib/components/resizable_container/resizable_collapse_button.styles.js +90 -0
- package/lib/components/steps/step.styles.js +5 -5
- package/lib/components/suggest/suggest.js +16 -0
- package/lib/components/suggest/suggest_item.js +11 -0
- package/lib/services/accessibility/html_id_generator.js +21 -2
- package/lib/services/color_picker/color_picker.js +4 -0
- package/lib/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
- 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/page_template/page_template.js +2 -1
- package/optimize/es/components/resizable_container/index.js +2 -1
- package/optimize/es/components/resizable_container/resizable_button.js +61 -44
- package/optimize/es/components/resizable_container/resizable_button.styles.js +66 -0
- package/optimize/es/components/resizable_container/resizable_collapse_button.js +19 -11
- package/optimize/es/components/resizable_container/resizable_collapse_button.styles.js +85 -0
- package/optimize/es/components/steps/step.styles.js +5 -5
- package/optimize/es/components/suggest/suggest.js +16 -0
- package/optimize/es/components/suggest/suggest_item.js +12 -0
- package/optimize/es/services/accessibility/html_id_generator.js +19 -3
- package/optimize/es/services/color_picker/color_picker.js +4 -0
- package/optimize/es/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
- 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/page_template/page_template.js +2 -1
- package/optimize/lib/components/resizable_container/index.js +8 -1
- package/optimize/lib/components/resizable_container/resizable_button.js +63 -45
- package/optimize/lib/components/resizable_container/resizable_button.styles.js +71 -0
- package/optimize/lib/components/resizable_container/resizable_collapse_button.js +19 -11
- package/optimize/lib/components/resizable_container/resizable_collapse_button.styles.js +90 -0
- package/optimize/lib/components/steps/step.styles.js +5 -5
- package/optimize/lib/components/suggest/suggest.js +16 -0
- package/optimize/lib/components/suggest/suggest_item.js +11 -0
- package/optimize/lib/services/accessibility/html_id_generator.js +21 -2
- package/optimize/lib/services/color_picker/color_picker.js +4 -0
- package/optimize/lib/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
- package/package.json +18 -18
- package/src/components/index.scss +0 -2
- 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/page_template/page_template.js +2 -1
- package/test-env/components/resizable_container/index.js +8 -1
- package/test-env/components/resizable_container/resizable_button.js +83 -51
- package/test-env/components/resizable_container/resizable_button.styles.js +71 -0
- package/test-env/components/resizable_container/resizable_collapse_button.js +19 -14
- package/test-env/components/resizable_container/resizable_collapse_button.styles.js +90 -0
- package/test-env/components/steps/step.styles.js +5 -5
- 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/test-env/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
- 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/components/resizable_container/_index.scss +0 -3
- package/src/components/resizable_container/_resizable_button.scss +0 -129
- package/src/components/resizable_container/_resizable_collapse_button.scss +0 -145
- package/src/components/resizable_container/_variables.scss +0 -2
- package/src/themes/amsterdam/overrides/_key_pad_menu.scss +0 -46
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.EuiKeyPadMenuItem = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
var _beta_badge = require("../badge/beta_badge");
|
|
14
14
|
var _services = require("../../services");
|
|
15
|
+
var _beta_badge = require("../badge/beta_badge");
|
|
15
16
|
var _form = require("../form");
|
|
16
17
|
var _href_validator = require("../../services/security/href_validator");
|
|
17
18
|
var _tool_tip = require("../tool_tip");
|
|
19
|
+
var _key_pad_menu_item = require("./key_pad_menu_item.styles");
|
|
18
20
|
var _react2 = require("@emotion/react");
|
|
19
21
|
var _excluded = ["id", "isSelected", "isDisabled", "label", "children", "className", "betaBadgeLabel", "betaBadgeTooltipContent", "betaBadgeIconType", "betaBadgeTooltipProps", "href", "rel", "target", "buttonRef", "checkable", "name", "value", "disabled", "onChange"];
|
|
20
22
|
/*
|
|
@@ -24,6 +26,8 @@ var _excluded = ["id", "isSelected", "isDisabled", "label", "children", "classNa
|
|
|
24
26
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
25
27
|
* Side Public License, v 1.
|
|
26
28
|
*/
|
|
29
|
+
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); }
|
|
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; }
|
|
27
31
|
var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
28
32
|
var id = _ref.id,
|
|
29
33
|
isSelected = _ref.isSelected,
|
|
@@ -47,48 +51,45 @@ var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
47
51
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
48
52
|
var isHrefValid = !href || (0, _href_validator.validateHref)(href);
|
|
49
53
|
var isDisabled = disabled || _isDisabled || !isHrefValid;
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
'euiKeyPadMenuItem-isSelected': isSelected
|
|
55
|
-
}, className);
|
|
54
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
55
|
+
var styles = (0, _key_pad_menu_item.euiKeyPadMenuItemStyles)(euiTheme);
|
|
56
|
+
var cssStyles = [styles.euiKeyPadMenuItem, !isDisabled ? styles.enabled : styles.disabled.disabled, isSelected && (!isDisabled ? styles.selected : styles.disabled.selected)];
|
|
57
|
+
var classes = (0, _classnames.default)('euiKeyPadMenuItem', className);
|
|
56
58
|
var Element = href && !isDisabled ? 'a' : 'button';
|
|
57
59
|
if (checkable) Element = 'label';
|
|
58
60
|
var itemId = (0, _services.useGeneratedHtmlId)({
|
|
59
61
|
conditionalId: id
|
|
60
62
|
});
|
|
61
|
-
var
|
|
63
|
+
var childStyles = (0, _react.useMemo)(function () {
|
|
64
|
+
return (0, _key_pad_menu_item.euiKeyPadMenuItemChildStyles)(euiTheme);
|
|
65
|
+
}, [euiTheme]);
|
|
66
|
+
var checkableElement = (0, _react.useMemo)(function () {
|
|
62
67
|
if (!checkable) return;
|
|
63
|
-
var
|
|
64
|
-
var
|
|
68
|
+
var cssStyles = [childStyles.euiKeyPadMenuItem__checkableInput, !isSelected && isDisabled && childStyles.hideCheckableInput, !isSelected && !isDisabled && childStyles.showCheckableInputOnInteraction];
|
|
69
|
+
var sharedProps = {
|
|
70
|
+
id: itemId,
|
|
71
|
+
className: 'euiKeyPadMenuItem__checkableInput',
|
|
72
|
+
css: cssStyles,
|
|
73
|
+
checked: isSelected,
|
|
74
|
+
disabled: isDisabled,
|
|
75
|
+
name: name
|
|
76
|
+
};
|
|
65
77
|
if (checkable === 'single') {
|
|
66
|
-
|
|
67
|
-
id: itemId,
|
|
68
|
-
className: inputClasses,
|
|
69
|
-
checked: isSelected,
|
|
70
|
-
disabled: isDisabled,
|
|
71
|
-
name: name,
|
|
78
|
+
return (0, _react2.jsx)(_form.EuiRadio, (0, _extends2.default)({}, sharedProps, {
|
|
72
79
|
value: value,
|
|
73
80
|
onChange: function onChange() {
|
|
74
81
|
return _onChange(itemId, value);
|
|
75
82
|
}
|
|
76
|
-
});
|
|
83
|
+
}));
|
|
77
84
|
} else {
|
|
78
|
-
|
|
79
|
-
id: itemId,
|
|
80
|
-
className: inputClasses,
|
|
81
|
-
checked: isSelected,
|
|
82
|
-
disabled: isDisabled,
|
|
83
|
-
name: name,
|
|
85
|
+
return (0, _react2.jsx)(_form.EuiCheckbox, (0, _extends2.default)({}, sharedProps, {
|
|
84
86
|
onChange: function onChange() {
|
|
85
87
|
return _onChange(itemId);
|
|
86
88
|
}
|
|
87
|
-
});
|
|
89
|
+
}));
|
|
88
90
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var renderBetaBadge = function renderBetaBadge() {
|
|
91
|
+
}, [checkable, isDisabled, isSelected, _onChange, value, name, itemId, childStyles]);
|
|
92
|
+
var betaBadge = (0, _react.useMemo)(function () {
|
|
92
93
|
if (!betaBadgeLabel) return;
|
|
93
94
|
return (0, _react2.jsx)(_beta_badge.EuiBetaBadge
|
|
94
95
|
// Since we move the tooltip contents to a wrapping EuiToolTip,
|
|
@@ -98,10 +99,11 @@ var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
98
99
|
size: "s",
|
|
99
100
|
color: "subdued",
|
|
100
101
|
className: "euiKeyPadMenuItem__betaBadge",
|
|
102
|
+
css: childStyles.euiKeyPadMenuItem__betaBadge,
|
|
101
103
|
label: betaBadgeLabel.charAt(0),
|
|
102
104
|
iconType: betaBadgeIconType
|
|
103
105
|
});
|
|
104
|
-
};
|
|
106
|
+
}, [betaBadgeLabel, betaBadgeIconType, childStyles]);
|
|
105
107
|
var relObj = {};
|
|
106
108
|
if (href && !isDisabled) {
|
|
107
109
|
relObj.href = href;
|
|
@@ -120,16 +122,20 @@ var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
|
|
|
120
122
|
relObj['aria-pressed'] = isSelected;
|
|
121
123
|
}
|
|
122
124
|
var button = (0, _react2.jsx)(Element, (0, _extends2.default)({
|
|
123
|
-
className: classes
|
|
125
|
+
className: classes,
|
|
126
|
+
css: cssStyles
|
|
124
127
|
}, relObj, rest, {
|
|
125
128
|
// Unable to get past `LegacyRef` conflicts
|
|
126
129
|
ref: buttonRef
|
|
127
130
|
}), (0, _react2.jsx)("span", {
|
|
128
|
-
className: "euiKeyPadMenuItem__inner"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
className: "euiKeyPadMenuItem__inner",
|
|
132
|
+
css: childStyles.euiKeyPadMenuItem__inner
|
|
133
|
+
}, checkable ? checkableElement : betaBadge, (0, _react2.jsx)("span", {
|
|
134
|
+
className: "euiKeyPadMenuItem__icon",
|
|
135
|
+
css: childStyles.euiKeyPadMenuItem__icon
|
|
131
136
|
}, children), (0, _react2.jsx)("span", {
|
|
132
|
-
className: "euiKeyPadMenuItem__label"
|
|
137
|
+
className: "euiKeyPadMenuItem__label",
|
|
138
|
+
css: childStyles.euiKeyPadMenuItem__label
|
|
133
139
|
}, label)));
|
|
134
140
|
return betaBadgeLabel ? (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({}, betaBadgeTooltipProps, {
|
|
135
141
|
title: betaBadgeLabel,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiKeyPadMenuItemStyles = exports.euiKeyPadMenuItemChildStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../services");
|
|
9
|
+
var _global_styling = require("../../global_styling");
|
|
10
|
+
var _mixins = require("../../themes/amsterdam/global_styling/mixins");
|
|
11
|
+
var _accessibility = require("../accessibility");
|
|
12
|
+
var _key_pad_menu = require("./key_pad_menu.styles");
|
|
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
|
+
|
|
21
|
+
var euiKeyPadMenuItemStyles = function euiKeyPadMenuItemStyles(euiThemeContext) {
|
|
22
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
23
|
+
var _euiKeyPadMenuVariabl = (0, _key_pad_menu.euiKeyPadMenuVariables)(euiThemeContext),
|
|
24
|
+
euiKeyPadMenuSize = _euiKeyPadMenuVariabl.euiKeyPadMenuSize;
|
|
25
|
+
return {
|
|
26
|
+
euiKeyPadMenuItem: /*#__PURE__*/(0, _react.css)("display:block;padding:", euiTheme.size.xs, ";", (0, _global_styling.logicalSizeCSS)(euiKeyPadMenuSize), " border-radius:", euiTheme.border.radius.medium, ";color:", euiTheme.colors.text, ";", _global_styling.euiCanAnimate, "{transition:background-color ", euiTheme.animation.fast, " ease-in,box-shadow ", euiTheme.animation.fast, " ease-in;};label:euiKeyPadMenuItem;"),
|
|
27
|
+
enabled: /*#__PURE__*/(0, _react.css)("&:hover,&:focus,&:focus-within{cursor:pointer;text-decoration:underline;", (0, _mixins.euiShadow)(euiThemeContext, 's'), " ", _global_styling.euiCanAnimate, "{.euiKeyPadMenuItem__icon{transform:translateY(0);}}}&:focus{background-color:", euiTheme.focus.backgroundColor, ";box-shadow:none;};label:enabled;"),
|
|
28
|
+
selected: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.title, ";background-color:", euiTheme.focus.backgroundColor, ";&,&:hover,&:focus,&:focus-within{color:", euiTheme.colors.primaryText, ";};label:selected;"),
|
|
29
|
+
disabled: {
|
|
30
|
+
disabled: /*#__PURE__*/(0, _react.css)("cursor:not-allowed;color:", euiTheme.colors.disabledText, ";.euiKeyPadMenuItem__icon{filter:grayscale(100%);svg *{fill:", euiTheme.colors.disabledText, ";}};label:disabled;"),
|
|
31
|
+
selected: /*#__PURE__*/(0, _react.css)("background-color:", (0, _services.transparentize)(euiTheme.colors.disabled, euiTheme.focus.transparency), ";;label:selected;")
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
exports.euiKeyPadMenuItemStyles = euiKeyPadMenuItemStyles;
|
|
36
|
+
var euiKeyPadMenuItemChildStyles = function euiKeyPadMenuItemChildStyles(euiThemeContext) {
|
|
37
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
38
|
+
var topRightChildren = "\n z-index: 3;\n position: absolute;\n ".concat((0, _global_styling.logicalCSS)('top', euiTheme.size.xs), "\n ").concat((0, _global_styling.logicalCSS)('right', euiTheme.size.xs), "\n ");
|
|
39
|
+
return {
|
|
40
|
+
euiKeyPadMenuItem__inner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)('100%'), " display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;;label:euiKeyPadMenuItem__inner;"),
|
|
41
|
+
euiKeyPadMenuItem__icon: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.m), " transform:translateY(2px);", _global_styling.euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";};label:euiKeyPadMenuItem__icon;"),
|
|
42
|
+
euiKeyPadMenuItem__label: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), " font-weight:", euiTheme.font.weight.semiBold, ";text-align:center;;label:euiKeyPadMenuItem__label;"),
|
|
43
|
+
euiKeyPadMenuItem__betaBadge: /*#__PURE__*/(0, _react.css)(topRightChildren, ";;label:euiKeyPadMenuItem__betaBadge;"),
|
|
44
|
+
euiKeyPadMenuItem__checkableInput: /*#__PURE__*/(0, _react.css)(topRightChildren, " transform:scale(.75);transform-origin:top right;&&{position:absolute;};label:euiKeyPadMenuItem__checkableInput;"),
|
|
45
|
+
showCheckableInputOnInteraction: /*#__PURE__*/(0, _react.css)(".euiKeyPadMenuItem:not(:hover, :focus, :focus-within) &{", (0, _accessibility.euiScreenReaderOnly)(), ";};label:showCheckableInputOnInteraction;"),
|
|
46
|
+
hideCheckableInput: /*#__PURE__*/(0, _react.css)((0, _accessibility.euiScreenReaderOnly)(), ";;label:hideCheckableInput;")
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
exports.euiKeyPadMenuItemChildStyles = euiKeyPadMenuItemChildStyles;
|
|
@@ -27,8 +27,17 @@ var _excluded = ["id", "type", "severity", "badgeColor", "iconType", "iconAriaLa
|
|
|
27
27
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
28
28
|
* Side Public License, v 1.
|
|
29
29
|
*/
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
30
33
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
34
|
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; }
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated - EuiNotificationEvent is scheduled for deprecation due to low internal usage and high
|
|
37
|
+
* maintenance requirements. If necessary, we recommend copying this component into your own application.
|
|
38
|
+
*
|
|
39
|
+
* The component will be permanently removed in December 2023.
|
|
40
|
+
*/
|
|
32
41
|
var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
|
|
33
42
|
var id = _ref.id,
|
|
34
43
|
type = _ref.type,
|
|
@@ -127,7 +127,8 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
127
127
|
return {
|
|
128
128
|
restrictWidth: restrictWidth,
|
|
129
129
|
paddingSize: paddingSize,
|
|
130
|
-
|
|
130
|
+
// pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
|
|
131
|
+
parent: "#".concat(CSS.escape(pageInnerId))
|
|
131
132
|
};
|
|
132
133
|
};
|
|
133
134
|
var innerPanelled = function innerPanelled() {
|
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "EuiResizableButton", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _resizable_button.EuiResizableButton;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "EuiResizableContainer", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function get() {
|
|
9
15
|
return _resizable_container.EuiResizableContainer;
|
|
10
16
|
}
|
|
11
17
|
});
|
|
12
|
-
var _resizable_container = require("./resizable_container");
|
|
18
|
+
var _resizable_container = require("./resizable_container");
|
|
19
|
+
var _resizable_button = require("./resizable_button");
|
|
@@ -5,8 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.EuiResizableButton = void 0;
|
|
9
|
-
exports.euiResizableButtonWithControls = euiResizableButtonWithControls;
|
|
8
|
+
exports.euiResizableButtonWithControls = exports.EuiResizableButtonControlled = exports.EuiResizableButton = void 0;
|
|
10
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
@@ -16,8 +15,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
16
15
|
var _i18n = require("../i18n");
|
|
17
16
|
var _services = require("../../services");
|
|
18
17
|
var _context = require("./context");
|
|
18
|
+
var _resizable_button = require("./resizable_button.styles");
|
|
19
19
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["isHorizontal", "
|
|
20
|
+
var _excluded = ["isHorizontal", "alignIndicator", "className"],
|
|
21
|
+
_excluded2 = ["registration", "id", "disabled", "onFocus"];
|
|
21
22
|
/*
|
|
22
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
24
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -27,15 +28,70 @@ var _excluded = ["isHorizontal", "className", "id", "registration", "disabled",
|
|
|
27
28
|
*/
|
|
28
29
|
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; }
|
|
30
|
-
|
|
31
|
+
/**
|
|
32
|
+
* A generic button for indicating/facilitating resizable content,
|
|
33
|
+
* usable outside of the EuiResizableContainer context
|
|
34
|
+
*/
|
|
35
|
+
var EuiResizableButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
31
36
|
var isHorizontal = _ref.isHorizontal,
|
|
37
|
+
_ref$alignIndicator = _ref.alignIndicator,
|
|
38
|
+
alignIndicator = _ref$alignIndicator === void 0 ? 'center' : _ref$alignIndicator,
|
|
32
39
|
className = _ref.className,
|
|
33
|
-
id = _ref.id,
|
|
34
|
-
registration = _ref.registration,
|
|
35
|
-
disabled = _ref.disabled,
|
|
36
|
-
onFocus = _ref.onFocus,
|
|
37
|
-
onBlur = _ref.onBlur,
|
|
38
40
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
|
+
var classes = (0, _classnames.default)('euiResizableButton', className);
|
|
42
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
43
|
+
var styles = (0, _resizable_button.euiResizableButtonStyles)(euiTheme);
|
|
44
|
+
var cssStyles = [styles.euiResizableButton, isHorizontal ? styles.horizontal : styles.vertical, styles.alignIndicator[alignIndicator]];
|
|
45
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
46
|
+
tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
|
|
47
|
+
defaults: ['Press the left or right arrow keys to adjust panels size', 'Press the up or down arrow keys to adjust panels size']
|
|
48
|
+
}, function (_ref2) {
|
|
49
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
50
|
+
horizontalResizerAriaLabel = _ref3[0],
|
|
51
|
+
verticalResizerAriaLabel = _ref3[1];
|
|
52
|
+
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
53
|
+
ref: ref,
|
|
54
|
+
"aria-label": isHorizontal ? horizontalResizerAriaLabel : verticalResizerAriaLabel,
|
|
55
|
+
className: classes,
|
|
56
|
+
css: cssStyles,
|
|
57
|
+
"data-test-subj": "euiResizableButton",
|
|
58
|
+
type: "button"
|
|
59
|
+
}, rest));
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
exports.EuiResizableButton = EuiResizableButton;
|
|
63
|
+
EuiResizableButton.propTypes = {
|
|
64
|
+
className: _propTypes.default.string,
|
|
65
|
+
"aria-label": _propTypes.default.string,
|
|
66
|
+
"data-test-subj": _propTypes.default.string,
|
|
67
|
+
css: _propTypes.default.any,
|
|
68
|
+
/**
|
|
69
|
+
* Defaults to displaying a resizer for vertical (y-axis) resizing.
|
|
70
|
+
* Set to `true` to display a resizer for horizontal (x-axis) resizing.
|
|
71
|
+
*/
|
|
72
|
+
isHorizontal: _propTypes.default.bool,
|
|
73
|
+
/**
|
|
74
|
+
* Specify the alignment of the initial resize indicator. Defaults to `center`,
|
|
75
|
+
* but consider using `start` for extremely tall content that scrolls off-screen
|
|
76
|
+
*/
|
|
77
|
+
alignIndicator: _propTypes.default.oneOf(["center", "start", "end"]),
|
|
78
|
+
/**
|
|
79
|
+
* When disabled, the resizer button will be completely hidden
|
|
80
|
+
*/
|
|
81
|
+
disabled: _propTypes.default.bool
|
|
82
|
+
};
|
|
83
|
+
EuiResizableButton.displayName = 'EuiResizableButton';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Resizer button specific to controlled EuiResizableContainer usage
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
var EuiResizableButtonControlled = function EuiResizableButtonControlled(_ref4) {
|
|
90
|
+
var registration = _ref4.registration,
|
|
91
|
+
id = _ref4.id,
|
|
92
|
+
disabled = _ref4.disabled,
|
|
93
|
+
_onFocus = _ref4.onFocus,
|
|
94
|
+
rest = (0, _objectWithoutProperties2.default)(_ref4, _excluded2);
|
|
39
95
|
var resizerId = (0, _services.useGeneratedHtmlId)({
|
|
40
96
|
prefix: 'resizable-button',
|
|
41
97
|
conditionalId: id
|
|
@@ -47,13 +103,9 @@ var EuiResizableButton = function EuiResizableButton(_ref) {
|
|
|
47
103
|
} : _useEuiResizableConta2,
|
|
48
104
|
resizers = _useEuiResizableConta3.resizers;
|
|
49
105
|
var isDisabled = (0, _react.useMemo)(function () {
|
|
50
|
-
|
|
106
|
+
var _resizers$resizerId;
|
|
107
|
+
return disabled || ((_resizers$resizerId = resizers[resizerId]) === null || _resizers$resizerId === void 0 ? void 0 : _resizers$resizerId.isDisabled);
|
|
51
108
|
}, [resizers, resizerId, disabled]);
|
|
52
|
-
var classes = (0, _classnames.default)('euiResizableButton', {
|
|
53
|
-
'euiResizableButton--vertical': !isHorizontal,
|
|
54
|
-
'euiResizableButton--horizontal': isHorizontal,
|
|
55
|
-
'euiResizableButton--disabled': isDisabled
|
|
56
|
-
}, className);
|
|
57
109
|
var previousRef = (0, _react.useRef)();
|
|
58
110
|
var onRef = (0, _react.useCallback)(function (ref) {
|
|
59
111
|
if (!registration) return;
|
|
@@ -72,42 +124,22 @@ var EuiResizableButton = function EuiResizableButton(_ref) {
|
|
|
72
124
|
}
|
|
73
125
|
}
|
|
74
126
|
}, [registration, resizerId, disabled]);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
horizontalResizerAriaLabel = _ref3[0],
|
|
87
|
-
verticalResizerAriaLabel = _ref3[1];
|
|
88
|
-
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
89
|
-
id: resizerId,
|
|
90
|
-
ref: onRef,
|
|
91
|
-
"aria-label": isHorizontal ? horizontalResizerAriaLabel : verticalResizerAriaLabel,
|
|
92
|
-
className: classes,
|
|
93
|
-
"data-test-subj": "euiResizableButton",
|
|
94
|
-
type: "button",
|
|
95
|
-
onClick: setFocus,
|
|
96
|
-
onFocus: handleFocus,
|
|
97
|
-
onBlur: onBlur,
|
|
98
|
-
disabled: isDisabled
|
|
99
|
-
}, rest));
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
exports.EuiResizableButton = EuiResizableButton;
|
|
103
|
-
EuiResizableButton.propTypes = {
|
|
104
|
-
className: _propTypes.default.string,
|
|
105
|
-
"aria-label": _propTypes.default.string,
|
|
106
|
-
"data-test-subj": _propTypes.default.string,
|
|
107
|
-
css: _propTypes.default.any
|
|
127
|
+
return (0, _react2.jsx)(EuiResizableButton, (0, _extends2.default)({
|
|
128
|
+
id: resizerId,
|
|
129
|
+
ref: onRef,
|
|
130
|
+
disabled: isDisabled,
|
|
131
|
+
onClick: function onClick(e) {
|
|
132
|
+
return e.currentTarget.focus();
|
|
133
|
+
},
|
|
134
|
+
onFocus: function onFocus() {
|
|
135
|
+
return _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(resizerId);
|
|
136
|
+
}
|
|
137
|
+
}, rest));
|
|
108
138
|
};
|
|
109
|
-
|
|
139
|
+
exports.EuiResizableButtonControlled = EuiResizableButtonControlled;
|
|
140
|
+
var euiResizableButtonWithControls = function euiResizableButtonWithControls(controls) {
|
|
110
141
|
return function (props) {
|
|
111
|
-
return (0, _react2.jsx)(
|
|
142
|
+
return (0, _react2.jsx)(EuiResizableButtonControlled, (0, _extends2.default)({}, controls, props));
|
|
112
143
|
};
|
|
113
|
-
}
|
|
144
|
+
};
|
|
145
|
+
exports.euiResizableButtonWithControls = euiResizableButtonWithControls;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiResizableButtonStyles = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
var _services = require("../../services");
|
|
9
|
+
var _global_styling = require("../../global_styling");
|
|
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
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
13
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
14
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
|
+
* Side Public License, v 1.
|
|
16
|
+
*/
|
|
17
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
18
|
+
name: "1fvu7sv-end",
|
|
19
|
+
styles: "align-items:flex-end;label:end;"
|
|
20
|
+
} : {
|
|
21
|
+
name: "1fvu7sv-end",
|
|
22
|
+
styles: "align-items:flex-end;label:end;",
|
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
+
};
|
|
25
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
26
|
+
name: "h0ntv8-start",
|
|
27
|
+
styles: "align-items:flex-start;label:start;"
|
|
28
|
+
} : {
|
|
29
|
+
name: "h0ntv8-start",
|
|
30
|
+
styles: "align-items:flex-start;label:start;",
|
|
31
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
32
|
+
};
|
|
33
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
34
|
+
name: "8391db-center",
|
|
35
|
+
styles: "align-items:center;label:center;"
|
|
36
|
+
} : {
|
|
37
|
+
name: "8391db-center",
|
|
38
|
+
styles: "align-items:center;label:center;",
|
|
39
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
40
|
+
};
|
|
41
|
+
var euiResizableButtonStyles = function euiResizableButtonStyles(euiThemeContext) {
|
|
42
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
43
|
+
var buttonSize = euiTheme.size.base;
|
|
44
|
+
var grabHandleWidth = euiTheme.size.m;
|
|
45
|
+
var grabHandleHeight = euiTheme.border.width.thin;
|
|
46
|
+
var transitionSpeed = euiTheme.animation.fast;
|
|
47
|
+
var transition = "".concat(transitionSpeed, " ease");
|
|
48
|
+
return {
|
|
49
|
+
// Mimics the "grab" icon with CSS psuedo-elements.
|
|
50
|
+
// 1. The "grab" icon transforms into a thicker straight line on :hover and :focus
|
|
51
|
+
// 2. Start/end aligned handles should have a slight margin offset that disappears on hover/focus
|
|
52
|
+
// 3. CSS hack to smooth out/anti-alias the 1px wide handles at various zoom levels
|
|
53
|
+
euiResizableButton: /*#__PURE__*/(0, _react.css)("z-index:1;flex-shrink:0;display:flex;justify-content:center;gap:", (0, _global_styling.mathWithUnits)(grabHandleHeight, function (x) {
|
|
54
|
+
return x * 2;
|
|
55
|
+
}), ";&:disabled{display:none;}&:hover,&:focus{gap:0;justify-content:center;}", _global_styling.euiCanAnimate, "{transition:gap ", transition, ",justify-content ", transition, ";}&::before,&::after{content:'';display:block;background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);", _global_styling.euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";", _global_styling.euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}}&:focus,&:active{background-color:", (0, _services.transparentize)(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", _global_styling.euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", (0, _global_styling.mathWithUnits)(transitionSpeed, function (x) {
|
|
56
|
+
return x / 2;
|
|
57
|
+
}), ";}}};label:euiResizableButton;"),
|
|
58
|
+
horizontal: /*#__PURE__*/(0, _react.css)("cursor:col-resize;", (0, _global_styling.logicalCSS)('height', '100%'), " ", (0, _global_styling.logicalCSS)('width', buttonSize), " margin-inline:", (0, _global_styling.mathWithUnits)(buttonSize, function (x) {
|
|
59
|
+
return x / -2;
|
|
60
|
+
}), ";&::before,&::after{", (0, _global_styling.logicalCSS)('width', grabHandleHeight), " ", (0, _global_styling.logicalCSS)('height', grabHandleWidth), " margin-block:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", (0, _global_styling.logicalCSS)('height', '100%'), " margin-block:0;transform:none;}};label:horizontal;"),
|
|
61
|
+
vertical: /*#__PURE__*/(0, _react.css)("flex-direction:column;cursor:row-resize;", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.logicalCSS)('height', buttonSize), " margin-block:", (0, _global_styling.mathWithUnits)(buttonSize, function (x) {
|
|
62
|
+
return x / -2;
|
|
63
|
+
}), ";&::before,&::after{", (0, _global_styling.logicalCSS)('height', grabHandleHeight), " ", (0, _global_styling.logicalCSS)('width', grabHandleWidth), " margin-inline:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", (0, _global_styling.logicalCSS)('width', '100%'), " margin-inline:0;transform:none;}};label:vertical;"),
|
|
64
|
+
alignIndicator: {
|
|
65
|
+
center: _ref3,
|
|
66
|
+
start: _ref2,
|
|
67
|
+
end: _ref
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
exports.euiResizableButtonStyles = euiResizableButtonStyles;
|
|
@@ -6,11 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.EuiResizableCollapseButton = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
var _services = require("../../services");
|
|
13
15
|
var _button = require("../button");
|
|
16
|
+
var _screen_reader_only = require("../accessibility/screen_reader_only/screen_reader_only.styles");
|
|
17
|
+
var _resizable_collapse_button = require("./resizable_collapse_button.styles");
|
|
14
18
|
var _react2 = require("@emotion/react");
|
|
15
19
|
var _excluded = ["className", "externalPosition", "internalPosition", "direction", "isVisible", "isCollapsed"];
|
|
16
20
|
/*
|
|
@@ -22,7 +26,8 @@ var _excluded = ["className", "externalPosition", "internalPosition", "direction
|
|
|
22
26
|
*/
|
|
23
27
|
var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
|
|
24
28
|
var className = _ref.className,
|
|
25
|
-
externalPosition = _ref.externalPosition,
|
|
29
|
+
_ref$externalPosition = _ref.externalPosition,
|
|
30
|
+
externalPosition = _ref$externalPosition === void 0 ? 'before' : _ref$externalPosition,
|
|
26
31
|
_ref$internalPosition = _ref.internalPosition,
|
|
27
32
|
internalPosition = _ref$internalPosition === void 0 ? 'middle' : _ref$internalPosition,
|
|
28
33
|
_ref$direction = _ref.direction,
|
|
@@ -31,14 +36,15 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
|
|
|
31
36
|
isCollapsed = _ref.isCollapsed,
|
|
32
37
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
33
38
|
var isHorizontal = direction === 'horizontal';
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
var
|
|
39
|
+
var showOnFocus = !isCollapsed && !isVisible;
|
|
40
|
+
var screenReaderOnlyStyles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus).euiScreenReaderOnly;
|
|
41
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
42
|
+
var styles = (0, _resizable_collapse_button.euiResizableCollapseButtonStyles)(euiTheme);
|
|
43
|
+
var collapsedStyles = [styles.collapsed.collapsed, styles.collapsed[direction], styles.collapsed["".concat(direction, "Positions")][internalPosition]];
|
|
44
|
+
var collapsibleStyles = [styles.collapsible.collapsible, styles.collapsible[direction][externalPosition], styles.collapsible[direction][internalPosition]];
|
|
45
|
+
var cssStyles = [styles.euiResizableCollapseButton, showOnFocus && screenReaderOnlyStyles].concat((0, _toConsumableArray2.default)(isCollapsed ? collapsedStyles : collapsibleStyles));
|
|
46
|
+
var COLLAPSED_ICON = '';
|
|
47
|
+
var NOT_COLLAPSED_ICON = '';
|
|
42
48
|
switch (externalPosition) {
|
|
43
49
|
case 'before':
|
|
44
50
|
COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
|
|
@@ -49,11 +55,13 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
|
|
|
49
55
|
NOT_COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
|
|
50
56
|
break;
|
|
51
57
|
}
|
|
58
|
+
var classes = (0, _classnames.default)('euiResizableCollapseButton', className);
|
|
52
59
|
return (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
|
|
53
60
|
display: isCollapsed ? 'empty' : 'base',
|
|
54
|
-
color: "text"
|
|
55
|
-
}, rest, {
|
|
61
|
+
color: "text",
|
|
56
62
|
className: classes,
|
|
63
|
+
css: cssStyles
|
|
64
|
+
}, rest, {
|
|
57
65
|
iconType: isCollapsed ? COLLAPSED_ICON : NOT_COLLAPSED_ICON
|
|
58
66
|
}));
|
|
59
67
|
};
|
|
@@ -73,9 +81,6 @@ EuiResizableCollapseButton.propTypes = {
|
|
|
73
81
|
* Same direction derived from EuiResizableContainer
|
|
74
82
|
*/
|
|
75
83
|
direction: _propTypes.default.oneOf(["vertical", "horizontal"]),
|
|
76
|
-
/**
|
|
77
|
-
*
|
|
78
|
-
*/
|
|
79
84
|
isVisible: _propTypes.default.bool,
|
|
80
85
|
isCollapsed: _propTypes.default.bool
|
|
81
86
|
};
|