@elastic/eui 69.0.0 → 70.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_theme_dark.css +0 -375
- package/dist/eui_theme_dark.json +0 -27
- package/dist/eui_theme_dark.json.d.ts +0 -27
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -375
- package/dist/eui_theme_light.json +0 -27
- package/dist/eui_theme_light.json.d.ts +0 -27
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/in_memory_table.js +8 -2
- package/es/components/code/code.js +7 -3
- package/es/components/code/code.styles.js +32 -0
- package/es/components/code/code_block.js +72 -315
- package/es/components/code/code_block.styles.js +153 -0
- package/es/components/code/code_block_controls.js +29 -0
- package/es/components/code/code_block_controls.styles.js +43 -0
- package/es/components/code/code_block_copy.js +65 -0
- package/es/components/code/code_block_full_screen.js +90 -0
- package/es/components/code/code_block_line.styles.js +49 -0
- package/es/components/code/code_block_overflow.js +78 -0
- package/es/components/code/code_block_virtualized.js +59 -0
- package/es/components/code/code_syntax.styles.js +43 -0
- package/es/components/code/utils.js +43 -37
- package/es/components/collapsible_nav/collapsible_nav.js +0 -5
- package/es/components/overlay_mask/overlay_mask.js +8 -14
- package/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/es/components/provider/provider.js +1 -5
- package/es/components/resizable_container/helpers.js +2 -2
- package/es/components/resizable_container/resizable_container.js +6 -9
- package/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/es/components/resizable_container/resizable_panel.js +25 -48
- package/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/es/components/search_bar/query/ast.js +14 -3
- package/es/components/tool_tip/tool_tip.js +3 -2
- package/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/es/components/tool_tip/tool_tip_arrow.js +17 -3
- package/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/es/components/tour/tour.styles.js +4 -3
- package/es/components/tour/tour_step.js +7 -5
- package/es/global_styling/functions/logicals.js +5 -3
- package/es/global_styling/functions/math.js +37 -19
- package/es/global_styling/mixins/_padding.js +13 -9
- package/eui.d.ts +291 -37
- package/i18ntokens.json +22 -22
- package/lib/components/basic_table/in_memory_table.js +8 -2
- package/lib/components/code/code.js +9 -3
- package/lib/components/code/code.styles.js +35 -0
- package/lib/components/code/code_block.js +72 -320
- package/lib/components/code/code_block.styles.js +154 -0
- package/lib/components/code/code_block_controls.js +48 -0
- package/lib/components/code/code_block_controls.styles.js +39 -0
- package/lib/components/code/code_block_copy.js +78 -0
- package/lib/components/code/code_block_full_screen.js +108 -0
- package/lib/components/code/code_block_line.styles.js +45 -0
- package/lib/components/code/code_block_overflow.js +82 -0
- package/lib/components/code/code_block_virtualized.js +72 -0
- package/lib/components/code/code_syntax.styles.js +57 -0
- package/lib/components/code/utils.js +40 -39
- package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
- package/lib/components/overlay_mask/overlay_mask.js +9 -14
- package/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/lib/components/provider/provider.js +7 -12
- package/lib/components/resizable_container/helpers.js +2 -2
- package/lib/components/resizable_container/resizable_container.js +7 -9
- package/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/lib/components/resizable_container/resizable_panel.js +28 -49
- package/lib/components/resizable_container/resizable_panel.styles.js +74 -0
- package/lib/components/search_bar/query/ast.js +14 -3
- package/lib/components/tool_tip/tool_tip.js +3 -2
- package/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/lib/components/tool_tip/tool_tip_arrow.js +19 -4
- package/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/lib/components/tour/tour.styles.js +3 -2
- package/lib/components/tour/tour_step.js +7 -5
- package/lib/global_styling/functions/logicals.js +5 -3
- package/lib/global_styling/functions/math.js +37 -19
- package/lib/global_styling/mixins/_padding.js +17 -10
- package/optimize/es/components/basic_table/in_memory_table.js +1 -1
- package/optimize/es/components/code/code.js +7 -3
- package/optimize/es/components/code/code.styles.js +32 -0
- package/optimize/es/components/code/code_block.js +70 -299
- package/optimize/es/components/code/code_block.styles.js +153 -0
- package/optimize/es/components/code/code_block_controls.js +29 -0
- package/optimize/es/components/code/code_block_controls.styles.js +43 -0
- package/optimize/es/components/code/code_block_copy.js +55 -0
- package/optimize/es/components/code/code_block_full_screen.js +80 -0
- package/optimize/es/components/code/code_block_line.styles.js +49 -0
- package/optimize/es/components/code/code_block_overflow.js +67 -0
- package/optimize/es/components/code/code_block_virtualized.js +59 -0
- package/optimize/es/components/code/code_syntax.styles.js +43 -0
- package/optimize/es/components/code/utils.js +43 -37
- package/optimize/es/components/overlay_mask/overlay_mask.js +8 -9
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +4 -14
- package/optimize/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
- package/optimize/es/components/provider/provider.js +1 -5
- package/optimize/es/components/resizable_container/helpers.js +2 -2
- package/optimize/es/components/resizable_container/resizable_container.js +6 -9
- package/optimize/es/components/resizable_container/resizable_container.styles.js +28 -0
- package/optimize/es/components/resizable_container/resizable_panel.js +25 -48
- package/optimize/es/components/resizable_container/resizable_panel.styles.js +69 -0
- package/optimize/es/components/search_bar/query/ast.js +14 -3
- package/optimize/es/components/tool_tip/tool_tip.js +3 -2
- package/optimize/es/components/tool_tip/tool_tip.styles.js +17 -22
- package/optimize/es/components/tool_tip/tool_tip_arrow.js +9 -3
- package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
- package/optimize/es/components/tour/tour.styles.js +4 -3
- package/optimize/es/components/tour/tour_step.js +7 -5
- package/optimize/es/global_styling/functions/logicals.js +5 -3
- package/optimize/es/global_styling/functions/math.js +35 -17
- package/optimize/es/global_styling/mixins/_padding.js +13 -9
- package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
- package/optimize/lib/components/code/code.js +9 -3
- package/optimize/lib/components/code/code.styles.js +35 -0
- package/optimize/lib/components/code/code_block.js +71 -306
- package/optimize/lib/components/code/code_block.styles.js +156 -0
- package/optimize/lib/components/code/code_block_controls.js +48 -0
- package/optimize/lib/components/code/code_block_controls.styles.js +39 -0
- package/optimize/lib/components/code/code_block_copy.js +78 -0
- package/optimize/lib/components/code/code_block_full_screen.js +108 -0
- package/optimize/lib/components/code/code_block_line.styles.js +45 -0
- package/optimize/lib/components/code/code_block_overflow.js +82 -0
- package/optimize/lib/components/code/code_block_virtualized.js +81 -0
- package/optimize/lib/components/code/code_syntax.styles.js +57 -0
- package/optimize/lib/components/code/utils.js +40 -37
- package/optimize/lib/components/overlay_mask/overlay_mask.js +9 -9
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/optimize/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/optimize/lib/components/provider/provider.js +7 -12
- package/optimize/lib/components/resizable_container/helpers.js +2 -2
- package/optimize/lib/components/resizable_container/resizable_container.js +7 -9
- package/optimize/lib/components/resizable_container/resizable_container.styles.js +31 -0
- package/optimize/lib/components/resizable_container/resizable_panel.js +28 -49
- package/optimize/lib/components/resizable_container/resizable_panel.styles.js +76 -0
- package/optimize/lib/components/search_bar/query/ast.js +14 -3
- package/optimize/lib/components/tool_tip/tool_tip.js +3 -2
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +18 -26
- package/optimize/lib/components/tool_tip/tool_tip_arrow.js +10 -10
- package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
- package/optimize/lib/components/tour/tour.styles.js +3 -2
- package/optimize/lib/components/tour/tour_step.js +7 -5
- package/optimize/lib/global_styling/functions/logicals.js +4 -10
- package/optimize/lib/global_styling/functions/math.js +37 -19
- package/optimize/lib/global_styling/mixins/_padding.js +17 -10
- package/package.json +8 -7
- package/src/components/index.scss +0 -1
- package/src/components/resizable_container/_index.scss +0 -2
- package/src/global_styling/mixins/_header.scss +1 -1
- package/src/global_styling/variables/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/in_memory_table.js +8 -2
- package/test-env/components/code/code.styles.js +35 -0
- package/test-env/components/code/code_block.styles.js +156 -0
- package/test-env/components/code/code_block_controls.js +48 -0
- package/test-env/components/code/code_block_controls.styles.js +39 -0
- package/test-env/components/code/code_block_copy.js +78 -0
- package/test-env/components/code/code_block_full_screen.js +108 -0
- package/test-env/components/code/code_block_line.styles.js +45 -0
- package/test-env/components/code/code_block_overflow.js +82 -0
- package/test-env/components/code/code_block_virtualized.js +81 -0
- package/test-env/components/code/code_syntax.styles.js +57 -0
- package/test-env/components/code/utils.js +40 -37
- package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
- package/test-env/components/overlay_mask/overlay_mask.js +9 -14
- package/test-env/components/overlay_mask/overlay_mask.styles.js +13 -17
- package/test-env/components/overlay_mask/overlay_mask_body.styles.js +20 -0
- package/test-env/components/provider/provider.js +7 -12
- package/test-env/components/resizable_container/helpers.js +2 -2
- package/test-env/components/resizable_container/resizable_container.js +7 -9
- package/test-env/components/resizable_container/resizable_container.styles.js +31 -0
- package/test-env/components/resizable_container/resizable_panel.js +28 -49
- package/test-env/components/resizable_container/resizable_panel.styles.js +76 -0
- package/test-env/components/search_bar/query/ast.js +14 -3
- package/test-env/components/tool_tip/tool_tip.js +3 -2
- package/test-env/components/tool_tip/tool_tip.styles.js +18 -26
- package/test-env/components/tool_tip/tool_tip_arrow.js +16 -11
- package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
- package/test-env/components/tour/tour.styles.js +3 -2
- package/test-env/components/tour/tour_step.js +7 -5
- package/test-env/global_styling/functions/logicals.js +4 -10
- package/test-env/global_styling/functions/math.js +37 -19
- package/test-env/global_styling/mixins/_padding.js +17 -10
- package/src/components/code/_code.scss +0 -15
- package/src/components/code/_code_block.scss +0 -177
- package/src/components/code/_index.scss +0 -4
- package/src/components/code/_mixins.scss +0 -127
- package/src/components/code/_variables.scss +0 -5
- package/src/components/resizable_container/_resizable_container.scss +0 -8
- package/src/components/resizable_container/_resizable_panel.scss +0 -51
- package/src/global_styling/variables/_colors_code.scss +0 -23
- package/src/themes/amsterdam/overrides/_code.scss +0 -9
|
@@ -23,11 +23,8 @@ import { EuiResizableContainerContextProvider } from './context';
|
|
|
23
23
|
import { euiResizableButtonWithControls } from './resizable_button';
|
|
24
24
|
import { euiResizablePanelWithControls, getModeType } from './resizable_panel';
|
|
25
25
|
import { useContainerCallbacks, getPosition } from './helpers';
|
|
26
|
+
import { euiResizableContainerStyles } from './resizable_container.styles';
|
|
26
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
-
var containerDirections = {
|
|
28
|
-
vertical: 'vertical',
|
|
29
|
-
horizontal: 'horizontal'
|
|
30
|
-
};
|
|
31
28
|
var initialState = {
|
|
32
29
|
isDragging: false,
|
|
33
30
|
currentResizerPos: -1,
|
|
@@ -49,11 +46,10 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
49
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
47
|
|
|
51
48
|
var containerRef = useRef(null);
|
|
52
|
-
var isHorizontal = direction ===
|
|
53
|
-
var classes = classNames('euiResizableContainer',
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, className);
|
|
49
|
+
var isHorizontal = direction === 'horizontal';
|
|
50
|
+
var classes = classNames('euiResizableContainer', className);
|
|
51
|
+
var styles = euiResizableContainerStyles();
|
|
52
|
+
var cssStyles = [styles.euiResizableContainer, styles[direction]];
|
|
57
53
|
|
|
58
54
|
var _useContainerCallback = useContainerCallbacks({
|
|
59
55
|
initialState: _objectSpread(_objectSpread({}, initialState), {}, {
|
|
@@ -226,6 +222,7 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
226
222
|
resizers: reducerState.resizers
|
|
227
223
|
}
|
|
228
224
|
}, ___EmotionJSX("div", _extends({
|
|
225
|
+
css: cssStyles,
|
|
229
226
|
className: classes,
|
|
230
227
|
ref: containerRef,
|
|
231
228
|
onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
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)."; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { logicalCSS } from '../../global_styling';
|
|
12
|
+
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "omnk2l-vertical",
|
|
15
|
+
styles: "flex-direction:column;label:vertical;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "omnk2l-vertical",
|
|
18
|
+
styles: "flex-direction:column;label:vertical;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export var euiResizableContainerStyles = function euiResizableContainerStyles() {
|
|
23
|
+
return {
|
|
24
|
+
euiResizableContainer: /*#__PURE__*/css("display:flex;", logicalCSS('width', '100%'), ";;label:euiResizableContainer;"),
|
|
25
|
+
horizontal: /*#__PURE__*/css(";label:horizontal;"),
|
|
26
|
+
vertical: _ref
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -17,20 +17,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
*/
|
|
18
18
|
import React, { useEffect, useMemo, useRef } from 'react';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
|
+
import { useGeneratedHtmlId, useEuiTheme } from '../../services';
|
|
21
|
+
import { logicalSizeStyle, euiPaddingSize } from '../../global_styling';
|
|
20
22
|
import { useEuiResizableContainerContext } from './context';
|
|
21
|
-
import { useGeneratedHtmlId } from '../../services';
|
|
22
23
|
import { EuiPanel } from '../panel';
|
|
23
24
|
import { useEuiI18n } from '../i18n';
|
|
24
25
|
import { EuiResizableCollapseButton } from './resizable_collapse_button';
|
|
26
|
+
import { euiResizablePanelStyles, euiResizablePanelContentStyles } from './resizable_panel.styles';
|
|
25
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
26
|
-
var panelPaddingValues = {
|
|
27
|
-
none: 0,
|
|
28
|
-
xs: 4,
|
|
29
|
-
s: 8,
|
|
30
|
-
m: 16,
|
|
31
|
-
l: 24,
|
|
32
|
-
xl: 32
|
|
33
|
-
};
|
|
34
28
|
var defaultToggleOptions = {
|
|
35
29
|
className: null,
|
|
36
30
|
'data-test-subj': undefined,
|
|
@@ -42,12 +36,6 @@ export var getModeType = function getModeType(mode) {
|
|
|
42
36
|
export var getToggleOptions = function getToggleOptions(mode) {
|
|
43
37
|
return _typeof(mode) === 'object' ? _objectSpread(_objectSpread({}, defaultToggleOptions), mode[1]) : defaultToggleOptions;
|
|
44
38
|
};
|
|
45
|
-
var paddingSizeToClassNameMap = {
|
|
46
|
-
none: null,
|
|
47
|
-
s: 'euiResizablePanel--paddingSmall',
|
|
48
|
-
m: 'euiResizablePanel--paddingMedium',
|
|
49
|
-
l: 'euiResizablePanel--paddingLarge'
|
|
50
|
-
};
|
|
51
39
|
|
|
52
40
|
var getPosition = function getPosition(ref) {
|
|
53
41
|
var position = 'middle';
|
|
@@ -154,34 +142,18 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
154
142
|
|
|
155
143
|
return direction;
|
|
156
144
|
}, [isCollapsed, isCollapsible, position, panels, panelId]);
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
var dimensions;
|
|
170
|
-
|
|
171
|
-
if (size) {
|
|
172
|
-
dimensions = {
|
|
173
|
-
width: isHorizontal ? "".concat(size, "%") : '100%',
|
|
174
|
-
height: isHorizontal ? 'auto' : "".concat(size, "%")
|
|
175
|
-
};
|
|
176
|
-
} else {
|
|
177
|
-
dimensions = {
|
|
178
|
-
width: isHorizontal ? "".concat(innerSize, "%") : '100%',
|
|
179
|
-
height: isHorizontal ? 'auto' : "".concat(innerSize, "%")
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
var styles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), dimensions);
|
|
184
|
-
|
|
145
|
+
var axis = isHorizontal ? 'horizontal' : 'vertical';
|
|
146
|
+
var euiTheme = useEuiTheme();
|
|
147
|
+
var styles = euiResizablePanelStyles(euiTheme);
|
|
148
|
+
var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding]];
|
|
149
|
+
var contentStyles = euiResizablePanelContentStyles(euiTheme);
|
|
150
|
+
var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
|
|
151
|
+
var classes = classNames('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
|
|
152
|
+
var panelClasses = classNames('euiResizablePanel__content', className);
|
|
153
|
+
|
|
154
|
+
var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? logicalSizeStyle("".concat(size || innerSize, "%"), 'auto') : logicalSizeStyle('100%', "".concat(size || innerSize, "%")));
|
|
155
|
+
|
|
156
|
+
var padding = euiPaddingSize(euiTheme, paddingSize) || '0px';
|
|
185
157
|
useEffect(function () {
|
|
186
158
|
if (!registration) return;
|
|
187
159
|
var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
|
|
@@ -233,7 +205,7 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
233
205
|
theResizer = resizers[resizerIds.current[0]];
|
|
234
206
|
theToggle = ___EmotionJSX(EuiResizableCollapseButton, {
|
|
235
207
|
externalPosition: "before",
|
|
236
|
-
direction:
|
|
208
|
+
direction: axis,
|
|
237
209
|
isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
|
|
238
210
|
isCollapsed: theResizer && theResizer.isDisabled,
|
|
239
211
|
internalPosition: toggleOpts.position,
|
|
@@ -245,7 +217,7 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
245
217
|
theResizer = resizers[resizerIds.current[1]];
|
|
246
218
|
theToggle = ___EmotionJSX(EuiResizableCollapseButton, {
|
|
247
219
|
externalPosition: "after",
|
|
248
|
-
direction:
|
|
220
|
+
direction: axis,
|
|
249
221
|
isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
|
|
250
222
|
isCollapsed: theResizer && theResizer.isDisabled,
|
|
251
223
|
internalPosition: toggleOpts.position,
|
|
@@ -255,12 +227,17 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
255
227
|
});
|
|
256
228
|
}
|
|
257
229
|
|
|
258
|
-
return ___EmotionJSX("div", _extends({
|
|
230
|
+
return ___EmotionJSX("div", _extends({
|
|
231
|
+
css: cssStyles
|
|
232
|
+
}, wrapperProps, {
|
|
259
233
|
id: panelId,
|
|
260
234
|
ref: divRef,
|
|
261
|
-
style:
|
|
262
|
-
className: classes
|
|
235
|
+
style: inlineStyles,
|
|
236
|
+
className: classes,
|
|
237
|
+
"data-collapsed": isCollapsed || undefined,
|
|
238
|
+
"data-position": position
|
|
263
239
|
}), hasVisibleToggle && hasLeftToggle && theToggle, ___EmotionJSX(EuiPanel, _extends({
|
|
240
|
+
css: contentCssStyles,
|
|
264
241
|
className: panelClasses,
|
|
265
242
|
hasShadow: hasShadow,
|
|
266
243
|
borderRadius: borderRadius,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
7
|
+
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)."; }
|
|
8
|
+
|
|
9
|
+
/*
|
|
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
|
+
import { css } from '@emotion/react';
|
|
17
|
+
import { logicalCSS, logicalCSSWithFallback, euiScrollBarStyles, euiPaddingSizeCSS } from '../../global_styling';
|
|
18
|
+
|
|
19
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
20
|
+
name: "11qmbh3-collapsed",
|
|
21
|
+
styles: "overflow:hidden;label:collapsed;"
|
|
22
|
+
} : {
|
|
23
|
+
name: "11qmbh3-collapsed",
|
|
24
|
+
styles: "overflow:hidden;label:collapsed;",
|
|
25
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
29
|
+
name: "15ifdgc-euiResizablePanel",
|
|
30
|
+
styles: "position:relative;label:euiResizablePanel;"
|
|
31
|
+
} : {
|
|
32
|
+
name: "15ifdgc-euiResizablePanel",
|
|
33
|
+
styles: "position:relative;label:euiResizablePanel;",
|
|
34
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export var euiResizablePanelStyles = function euiResizablePanelStyles(euiThemeContext) {
|
|
38
|
+
return {
|
|
39
|
+
euiResizablePanel: _ref3,
|
|
40
|
+
collapsed: _ref2,
|
|
41
|
+
paddingSizes: _objectSpread({}, euiPaddingSizeCSS(euiThemeContext))
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
46
|
+
name: "597kt8-collapsedChildren",
|
|
47
|
+
styles: "*{display:none;};label:collapsedChildren;"
|
|
48
|
+
} : {
|
|
49
|
+
name: "597kt8-collapsedChildren",
|
|
50
|
+
styles: "*{display:none;};label:collapsedChildren;",
|
|
51
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export var euiResizablePanelContentStyles = function euiResizablePanelContentStyles(euiThemeContext) {
|
|
55
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
56
|
+
return {
|
|
57
|
+
euiResizablePanel__content: /*#__PURE__*/css(logicalCSS('height', '100%'), ";;label:euiResizablePanel__content;"),
|
|
58
|
+
scrollable: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " ", logicalCSSWithFallback('overflow-y', 'auto'), ";;label:scrollable;"),
|
|
59
|
+
collapsedChildren: _ref,
|
|
60
|
+
horizontal: {
|
|
61
|
+
collapsed: /*#__PURE__*/css(logicalCSS('min-width', '0 !important'), ";;label:collapsed;"),
|
|
62
|
+
hasCollapsibleButton: /*#__PURE__*/css(logicalCSS('min-width', "".concat(euiTheme.size.l, " !important")), ";;label:hasCollapsibleButton;")
|
|
63
|
+
},
|
|
64
|
+
vertical: {
|
|
65
|
+
collapsed: /*#__PURE__*/css(logicalCSS('min-height', '0 !important'), ";;label:collapsed;"),
|
|
66
|
+
hasCollapsibleButton: /*#__PURE__*/css(logicalCSS('min-height', "".concat(euiTheme.size.l, " !important")), ";;label:hasCollapsibleButton;")
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -268,6 +268,10 @@ var arrayIncludesValue = function arrayIncludesValue(array, value) {
|
|
|
268
268
|
return valuesEqual(item, value);
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
+
|
|
272
|
+
var mustToMatch = function mustToMatch(must) {
|
|
273
|
+
return must === true ? Match.MUST : Match.MUST_NOT;
|
|
274
|
+
};
|
|
271
275
|
/**
|
|
272
276
|
* The AST structure is an array of clauses. There are 3 types of clauses that are supported:
|
|
273
277
|
*
|
|
@@ -392,9 +396,16 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
392
396
|
}
|
|
393
397
|
}, {
|
|
394
398
|
key: "getOrFieldClause",
|
|
395
|
-
value: function getOrFieldClause(field, value) {
|
|
399
|
+
value: function getOrFieldClause(field, value, must, operator) {
|
|
396
400
|
return this.getFieldClause(field, function (clause) {
|
|
397
|
-
|
|
401
|
+
if (!isArray(clause.value)) {
|
|
402
|
+
return false;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
var matchValue = isNil(value) || arrayIncludesValue(clause.value, value);
|
|
406
|
+
var matchMust = isNil(must) || mustToMatch(must) === clause.match;
|
|
407
|
+
var matchOperator = isNil(operator) || operator === clause.operator;
|
|
408
|
+
return matchValue && matchMust && matchOperator;
|
|
398
409
|
});
|
|
399
410
|
}
|
|
400
411
|
}, {
|
|
@@ -402,7 +413,7 @@ export var _AST = /*#__PURE__*/function () {
|
|
|
402
413
|
value: function addOrFieldValue(field, value) {
|
|
403
414
|
var must = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
404
415
|
var operator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Operator.EQ;
|
|
405
|
-
var existingClause = this.getOrFieldClause(field);
|
|
416
|
+
var existingClause = this.getOrFieldClause(field, undefined, must, operator);
|
|
406
417
|
|
|
407
418
|
if (!existingClause) {
|
|
408
419
|
var newClause = must ? Field.must[operator](field, [value]) : Field.mustNot[operator](field, [value]);
|
|
@@ -262,7 +262,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
262
262
|
toolTipStyles = _this$state.toolTipStyles,
|
|
263
263
|
visible = _this$state.visible,
|
|
264
264
|
calculatedPosition = _this$state.calculatedPosition;
|
|
265
|
-
var classes = classNames('euiToolTip',
|
|
265
|
+
var classes = classNames('euiToolTip', className);
|
|
266
266
|
var anchorClasses = classNames(anchorClassName, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.className);
|
|
267
267
|
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiToolTipAnchor, _extends({}, anchorProps, {
|
|
268
268
|
ref: this.setAnchorRef,
|
|
@@ -285,7 +285,8 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
285
285
|
calculatedPosition: calculatedPosition
|
|
286
286
|
}, rest), ___EmotionJSX(EuiToolTipArrow, {
|
|
287
287
|
style: arrowStyles,
|
|
288
|
-
className: "euiToolTip__arrow"
|
|
288
|
+
className: "euiToolTip__arrow",
|
|
289
|
+
position: calculatedPosition
|
|
289
290
|
}), ___EmotionJSX(EuiResizeObserver, {
|
|
290
291
|
onResize: this.positionToolTip
|
|
291
292
|
}, function (resizeRef) {
|
|
@@ -12,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
import { css, keyframes } from '@emotion/react';
|
|
15
|
-
import { logicalCSS, logicalSizeCSS, euiFontSize, mathWithUnits } from '../../global_styling';
|
|
15
|
+
import { logicalCSS, logicalSizeCSS, euiFontSize, euiCanAnimate, mathWithUnits } from '../../global_styling';
|
|
16
16
|
import { COLOR_MODES_STANDARD, tint, shade } from '../../services';
|
|
17
17
|
import { euiShadow } from '../../themes/amsterdam';
|
|
18
18
|
export var euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme, colorMode) {
|
|
@@ -33,39 +33,34 @@ var euiToolTipAnimationHorizontal = function euiToolTipAnimationHorizontal(size)
|
|
|
33
33
|
export var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
34
34
|
var euiTheme = euiThemeContext.euiTheme,
|
|
35
35
|
colorMode = euiThemeContext.colorMode;
|
|
36
|
-
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards");
|
|
37
|
-
/*
|
|
38
|
-
* 1. Shift arrow 1px more than half its size to account for border radius
|
|
39
|
-
*/
|
|
36
|
+
var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards"); // Shift arrow 1px more than half its size to account for border radius
|
|
40
37
|
|
|
41
38
|
var arrowSize = euiTheme.size.m;
|
|
42
39
|
var arrowPlusSize = mathWithUnits(arrowSize, function (x) {
|
|
43
40
|
return (x / 2 + 1) * -1;
|
|
44
|
-
});
|
|
45
|
-
|
|
41
|
+
});
|
|
46
42
|
var arrowMinusSize = mathWithUnits(arrowSize, function (x) {
|
|
47
43
|
return (x / 2 - 1) * -1;
|
|
48
|
-
});
|
|
49
|
-
|
|
44
|
+
});
|
|
50
45
|
return {
|
|
51
46
|
// Base
|
|
52
47
|
euiToolTip: /*#__PURE__*/css(euiShadow(euiThemeContext), ";border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";color:", euiTheme.colors.ghost, ";z-index:", euiTheme.levels.toast, ";", logicalCSS('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", euiFontSize(euiThemeContext, 's'), ";position:absolute;[class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme, colorMode), ";};label:euiToolTip;"),
|
|
53
48
|
// Sizes
|
|
54
49
|
s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";;label:s;"),
|
|
55
50
|
// Positions
|
|
56
|
-
top: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, "
|
|
57
|
-
bottom: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";
|
|
58
|
-
left: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";
|
|
59
|
-
right: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";
|
|
60
|
-
//
|
|
61
|
-
euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), "
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
51
|
+
top: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";};label:right;"),
|
|
55
|
+
// Arrow
|
|
56
|
+
euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), ";;label:euiToolTip__arrow;"),
|
|
57
|
+
arrowPositions: {
|
|
58
|
+
top: /*#__PURE__*/css("transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:top;"),
|
|
59
|
+
bottom: /*#__PURE__*/css("transform:translateY(", arrowMinusSize, ") rotateZ(45deg);;label:bottom;"),
|
|
60
|
+
left: /*#__PURE__*/css("transform:translateX(", arrowPlusSize, ") rotateZ(45deg);;label:left;"),
|
|
61
|
+
right: /*#__PURE__*/css("transform:translateX(", arrowMinusSize, ") rotateZ(45deg);;label:right;")
|
|
62
|
+
},
|
|
63
|
+
// Title
|
|
69
64
|
euiToolTip__title: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";", logicalCSS('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme, colorMode))), ";", logicalCSS('padding-bottom', euiTheme.size.xs), ";", logicalCSS('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;")
|
|
70
65
|
};
|
|
71
66
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["position"];
|
|
2
4
|
|
|
3
5
|
/*
|
|
4
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -11,10 +13,14 @@ import React from 'react';
|
|
|
11
13
|
import { useEuiTheme } from '../../services';
|
|
12
14
|
import { euiToolTipStyles } from './tool_tip.styles';
|
|
13
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
-
export var EuiToolTipArrow = function EuiToolTipArrow(
|
|
16
|
+
export var EuiToolTipArrow = function EuiToolTipArrow(_ref) {
|
|
17
|
+
var position = _ref.position,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
|
|
15
20
|
var euiTheme = useEuiTheme();
|
|
16
|
-
var
|
|
21
|
+
var styles = euiToolTipStyles(euiTheme);
|
|
22
|
+
var cssStyles = [styles.euiToolTip__arrow, styles.arrowPositions[position]];
|
|
17
23
|
return ___EmotionJSX("div", _extends({
|
|
18
|
-
css:
|
|
24
|
+
css: cssStyles
|
|
19
25
|
}, props));
|
|
20
26
|
};
|
|
@@ -12,7 +12,7 @@ var _excluded = ["children", "title", "className", "positionToolTip", "popoverRe
|
|
|
12
12
|
import React, { useEffect, useRef, useCallback } from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
14
|
import { useEuiTheme } from '../../services';
|
|
15
|
-
import { euiToolTipStyles
|
|
15
|
+
import { euiToolTipStyles } from './tool_tip.styles';
|
|
16
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
17
|
export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
18
18
|
var children = _ref.children,
|
|
@@ -25,9 +25,8 @@ export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
|
25
25
|
|
|
26
26
|
var popover = useRef();
|
|
27
27
|
var euiTheme = useEuiTheme();
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var titleCss = [popoverStyles.euiToolTip__title];
|
|
28
|
+
var styles = euiToolTipStyles(euiTheme);
|
|
29
|
+
var cssStyles = [styles.euiToolTip, calculatedPosition && styles[calculatedPosition]];
|
|
31
30
|
var updateDimensions = useCallback(function () {
|
|
32
31
|
requestAnimationFrame(function () {
|
|
33
32
|
// Because of this delay, sometimes `positionToolTip` becomes unavailable.
|
|
@@ -53,11 +52,12 @@ export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
|
|
|
53
52
|
}, [updateDimensions]);
|
|
54
53
|
var classes = classNames('euiToolTipPopover', className);
|
|
55
54
|
return ___EmotionJSX("div", _extends({
|
|
56
|
-
css:
|
|
55
|
+
css: cssStyles,
|
|
57
56
|
className: classes,
|
|
58
|
-
ref: setPopoverRef
|
|
57
|
+
ref: setPopoverRef,
|
|
58
|
+
"data-position": calculatedPosition
|
|
59
59
|
}, rest), title && ___EmotionJSX("div", {
|
|
60
|
-
css:
|
|
60
|
+
css: styles.euiToolTip__title,
|
|
61
61
|
className: "euiToolTip__title"
|
|
62
62
|
}, title), children);
|
|
63
63
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
|
|
10
|
-
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
10
|
+
import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
|
|
11
11
|
import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
|
|
12
12
|
import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
|
|
13
13
|
|
|
@@ -20,7 +20,7 @@ export var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
20
20
|
colorMode = _ref.colorMode;
|
|
21
21
|
return {
|
|
22
22
|
// Targets EuiPopoverPanel
|
|
23
|
-
euiTour: /*#__PURE__*/css("
|
|
23
|
+
euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
@@ -34,7 +34,8 @@ export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
34
34
|
});
|
|
35
35
|
return {
|
|
36
36
|
// Base
|
|
37
|
-
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], "
|
|
37
|
+
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;", euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";};label:euiTourBeacon;"),
|
|
38
|
+
isOpen: /*#__PURE__*/css(euiCanAnimate, "{opacity:1;};label:isOpen;"),
|
|
38
39
|
// Positions
|
|
39
40
|
right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
|
|
40
41
|
left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
|
|
6
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
@@ -34,6 +34,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
34
34
|
anchor = _ref.anchor,
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
className = _ref.className,
|
|
37
|
+
css = _ref.css,
|
|
37
38
|
_ref$closePopover = _ref.closePopover,
|
|
38
39
|
closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
|
|
39
40
|
content = _ref.content,
|
|
@@ -53,6 +54,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
53
54
|
_ref$decoration = _ref.decoration,
|
|
54
55
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
55
56
|
footerAction = _ref.footerAction,
|
|
57
|
+
panelProps = _ref.panelProps,
|
|
56
58
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
57
59
|
|
|
58
60
|
var titleId = useGeneratedHtmlId();
|
|
@@ -96,7 +98,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
96
98
|
var headerStyles = euiTourHeaderStyles(euiTheme);
|
|
97
99
|
var footerStyles = euiTourFooterStyles(euiTheme);
|
|
98
100
|
var beaconStyles = euiTourBeaconStyles(euiTheme);
|
|
99
|
-
var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
|
|
101
|
+
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
100
102
|
var finishButtonProps = {
|
|
101
103
|
color: 'text',
|
|
102
104
|
flush: 'right',
|
|
@@ -157,9 +159,9 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
157
159
|
ownFocus: false,
|
|
158
160
|
panelClassName: classes,
|
|
159
161
|
panelStyle: style,
|
|
160
|
-
panelProps: {
|
|
161
|
-
css: tourStyles.euiTour
|
|
162
|
-
},
|
|
162
|
+
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
163
|
+
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
164
|
+
}),
|
|
163
165
|
offset: hasBeacon ? 10 : 0,
|
|
164
166
|
'aria-labelledby': titleId,
|
|
165
167
|
arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
3
7
|
/*
|
|
4
8
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
9
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -83,9 +87,7 @@ export var logicalSizeCSS = function logicalSizeCSS(width, height) {
|
|
|
83
87
|
*/
|
|
84
88
|
|
|
85
89
|
export var logicalSizeStyle = function logicalSizeStyle(width, height) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return _ref2 = {}, _defineProperty(_ref2, logicals.width, width), _defineProperty(_ref2, logicals.height, height), _ref2;
|
|
90
|
+
return _objectSpread(_objectSpread({}, logicalStyle('width', width)), logicalStyle('height', height));
|
|
89
91
|
}; // Text alignment is separate because its the value that changes not the property
|
|
90
92
|
|
|
91
93
|
export var logicalText = {
|
|
@@ -19,26 +19,44 @@ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return
|
|
|
19
19
|
* Example usage:
|
|
20
20
|
* mathWithUnits('4px', (x) => x / 2) = '2px';
|
|
21
21
|
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
22
|
+
* mathWithUnits([euiTheme.size.l, euiTheme.size.s], (x, y) => x - y) = '16px';
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
+
// Unfortunately, this is the CSSProperties[] type used for several euiTheme vars
|
|
25
|
+
export var mathWithUnits = function mathWithUnits(values, callback) {
|
|
24
26
|
var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
27
|
+
if (!Array.isArray(values)) values = [values];
|
|
28
|
+
var foundNumericValues = [];
|
|
29
|
+
var foundUnit = '';
|
|
30
|
+
values.forEach(function (value) {
|
|
31
|
+
if (typeof value === 'string') {
|
|
32
|
+
var _matches$groups, _matches$groups2;
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
|
|
35
|
+
value: 1,
|
|
36
|
+
unit: 2
|
|
37
|
+
});
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
unit: 2
|
|
32
|
-
});
|
|
39
|
+
var matches = regex.exec(value);
|
|
40
|
+
var numericValue = Number(matches === null || matches === void 0 ? void 0 : (_matches$groups = matches.groups) === null || _matches$groups === void 0 ? void 0 : _matches$groups.value);
|
|
33
41
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
if (!isNaN(numericValue)) {
|
|
43
|
+
foundNumericValues.push(numericValue);
|
|
44
|
+
} else {
|
|
45
|
+
throw new Error('No valid numeric value found');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (!unit && matches !== null && matches !== void 0 && (_matches$groups2 = matches.groups) !== null && _matches$groups2 !== void 0 && _matches$groups2.unit) {
|
|
49
|
+
if (!foundUnit) {
|
|
50
|
+
foundUnit = matches.groups.unit;
|
|
51
|
+
} else if (foundUnit !== matches.groups.unit) {
|
|
52
|
+
throw new Error('Multiple units found. Use `calc()` to mix and math multiple unit types (e.g. `%` & `px`) instead');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
} else if (typeof value === 'number') {
|
|
56
|
+
foundNumericValues.push(value);
|
|
57
|
+
} else {
|
|
58
|
+
throw new Error('Invalid value type - pass a string or number');
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return "".concat(callback.apply(void 0, foundNumericValues)).concat(unit || foundUnit);
|
|
44
62
|
};
|