@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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiCodeSyntaxTokens = exports.euiCodeSyntaxColors = void 0;
|
|
7
|
+
|
|
8
|
+
var _services = require("../../services");
|
|
9
|
+
|
|
10
|
+
/*
|
|
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 visColors = (0, _services.euiPaletteColorBlind)();
|
|
18
|
+
|
|
19
|
+
var euiCodeSyntaxColors = function euiCodeSyntaxColors(euiThemeContext) {
|
|
20
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
var backgroundColor = euiTheme.colors.lightestShade;
|
|
22
|
+
return {
|
|
23
|
+
backgroundColor: backgroundColor,
|
|
24
|
+
color: (0, _services.makeHighContrastColor)(euiTheme.colors.text)(backgroundColor),
|
|
25
|
+
inlineCodeColor: (0, _services.makeHighContrastColor)(visColors[3])(backgroundColor),
|
|
26
|
+
selectedBackgroundColor: 'inherit',
|
|
27
|
+
commentColor: (0, _services.makeHighContrastColor)(euiTheme.colors.subduedText)(backgroundColor),
|
|
28
|
+
selectorTagColor: 'inherit',
|
|
29
|
+
stringColor: (0, _services.makeHighContrastColor)(visColors[2])(backgroundColor),
|
|
30
|
+
tagColor: (0, _services.makeHighContrastColor)(visColors[1])(backgroundColor),
|
|
31
|
+
nameColor: (0, _services.makeHighContrastColor)(visColors[1])(backgroundColor),
|
|
32
|
+
numberColor: (0, _services.makeHighContrastColor)(visColors[0])(backgroundColor),
|
|
33
|
+
keywordColor: (0, _services.makeHighContrastColor)(visColors[3])(backgroundColor),
|
|
34
|
+
functionTitleColor: 'inherit',
|
|
35
|
+
typeColor: (0, _services.makeHighContrastColor)(visColors[1])(backgroundColor),
|
|
36
|
+
attributeColor: 'inherit',
|
|
37
|
+
symbolColor: (0, _services.makeHighContrastColor)(visColors[9])(backgroundColor),
|
|
38
|
+
paramsColor: 'inherit',
|
|
39
|
+
metaColor: (0, _services.makeHighContrastColor)(euiTheme.colors.subduedText)(backgroundColor),
|
|
40
|
+
titleColor: (0, _services.makeHighContrastColor)(visColors[7])(backgroundColor),
|
|
41
|
+
sectionColor: (0, _services.makeHighContrastColor)(visColors[9])(backgroundColor),
|
|
42
|
+
additionColor: (0, _services.makeHighContrastColor)(visColors[0])(backgroundColor),
|
|
43
|
+
deletionColor: (0, _services.makeHighContrastColor)(euiTheme.colors.danger)(backgroundColor),
|
|
44
|
+
selectorClassColor: 'inherit',
|
|
45
|
+
selectorIdColor: 'inherit'
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.euiCodeSyntaxColors = euiCodeSyntaxColors;
|
|
50
|
+
|
|
51
|
+
var euiCodeSyntaxTokens = function euiCodeSyntaxTokens(euiThemeContext) {
|
|
52
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
53
|
+
var euiCodeBlock = euiCodeSyntaxColors(euiThemeContext);
|
|
54
|
+
return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: .7;\n }\n \n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ".concat(euiCodeBlock.commentColor, ";\n font-style: italic;\n }\n \n .token.selector {\n color: ").concat(euiCodeBlock.selectorTagColor, ";\n }\n \n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(euiCodeBlock.stringColor, ";\n }\n \n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(euiCodeBlock.numberColor, ";\n }\n \n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(euiCodeBlock.keywordColor, ";\n }\n \n .token.function {\n color: ").concat(euiCodeBlock.functionTitleColor, ";\n }\n \n .token.tag {\n color: ").concat(euiCodeBlock.tagColor, ";\n }\n \n .token.class-name {\n color: ").concat(euiCodeBlock.typeColor, ";\n }\n \n .token.property {\n color: ").concat(euiCodeBlock.attributeColor, ";\n }\n \n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(euiCodeBlock.symbolColor, ";\n }\n \n .token.paramater {\n color: ").concat(euiCodeBlock.paramsColor, ";\n }\n \n .token.meta,\n .token.important {\n color: ").concat(euiCodeBlock.metaColor, ";\n }\n \n .token.title {\n color: ").concat(euiCodeBlock.titleColor, ";\n }\n \n .token.section {\n color: ").concat(euiCodeBlock.sectionColor, ";\n }\n \n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n \n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(euiCodeBlock.additionColor, ";\n color: ").concat(euiCodeBlock.additionColor, ";\n }\n \n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(euiCodeBlock.deletionColor, ";\n color: ").concat(euiCodeBlock.deletionColor, ";\n }\n \n .token.selector .token.class {\n color: ").concat(euiCodeBlock.selectorClassColor, ";\n }\n \n .token.selector .token.id {\n color: ").concat(euiCodeBlock.selectorIdColor, ";\n }\n \n .token.italic {\n font-style: italic;\n }\n \n .token.important,\n .token.bold {\n font-weight: $euiCodeFontWeightBold;\n }\n \n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n \n .token.entity {\n cursor: help;\n }\n ");
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.euiCodeSyntaxTokens = euiCodeSyntaxTokens;
|
|
@@ -15,7 +15,9 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _refractor = require("refractor");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _css = require("@emotion/css");
|
|
19
|
+
|
|
20
|
+
var _code_block_line = require("./code_block_line.styles");
|
|
19
21
|
|
|
20
22
|
var _react2 = require("@emotion/react");
|
|
21
23
|
|
|
@@ -64,7 +66,7 @@ var nodeToHtml = function nodeToHtml(node, idx, nodes) {
|
|
|
64
66
|
children = node.children;
|
|
65
67
|
return /*#__PURE__*/(0, _react.createElement)(tagName, _objectSpread(_objectSpread({}, properties), {}, {
|
|
66
68
|
key: key,
|
|
67
|
-
className: (0,
|
|
69
|
+
className: (0, _css.cx)(properties.className)
|
|
68
70
|
}), children && children.map(function (el, i) {
|
|
69
71
|
return nodeToHtml(el, i, nodes, depth + 1);
|
|
70
72
|
}));
|
|
@@ -81,8 +83,7 @@ var nodeToHtml = function nodeToHtml(node, idx, nodes) {
|
|
|
81
83
|
|
|
82
84
|
exports.nodeToHtml = nodeToHtml;
|
|
83
85
|
// Approximate width of a single digit/character
|
|
84
|
-
var CHAR_SIZE = 8;
|
|
85
|
-
var $euiSizeS = 8; // Creates an array of numbers from comma-separeated
|
|
86
|
+
var CHAR_SIZE = 8; // Creates an array of numbers from comma-separeated
|
|
86
87
|
// string of numbers or number ranges using `-`
|
|
87
88
|
// (e.g., "1, 3-10, 15")
|
|
88
89
|
|
|
@@ -157,8 +158,7 @@ var addLineData = function addLineData(nodes, data) {
|
|
|
157
158
|
}, []);
|
|
158
159
|
};
|
|
159
160
|
|
|
160
|
-
function wrapLines(nodes, options) {
|
|
161
|
-
var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
|
|
161
|
+
function wrapLines(nodes, options, euiTheme) {
|
|
162
162
|
var grouped = [];
|
|
163
163
|
nodes.forEach(function (node) {
|
|
164
164
|
var lineStart = node.lineStart - 1;
|
|
@@ -170,41 +170,44 @@ function wrapLines(nodes, options) {
|
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
var wrapped = [];
|
|
173
|
-
var digits = grouped.length.toString().length;
|
|
174
|
-
var width = digits * CHAR_SIZE;
|
|
175
173
|
grouped.forEach(function (node, i) {
|
|
176
|
-
var
|
|
177
|
-
|
|
178
|
-
var
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
174
|
+
var children = node;
|
|
175
|
+
var styles = (0, _code_block_line.euiCodeBlockLineStyles)(euiTheme);
|
|
176
|
+
var lineStyles = (0, _css.cx)([styles.euiCodeBlock__line, options.showLineNumbers && styles.hasLineNumbers]);
|
|
177
|
+
|
|
178
|
+
if (options.showLineNumbers) {
|
|
179
|
+
var _properties;
|
|
180
|
+
|
|
181
|
+
var lineNumber = i + 1;
|
|
182
|
+
var digits = grouped.length.toString().length;
|
|
183
|
+
var width = digits * CHAR_SIZE;
|
|
184
|
+
var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
|
|
185
|
+
var lineTextStyles = (0, _css.cx)([styles.lineText.euiCodeBlock__lineText, highlights.includes(lineNumber) && styles.lineText.isHighlighted]);
|
|
186
|
+
var lineNumberStyles = (0, _css.cx)(styles.lineNumber.euiCodeBlock__lineNumber);
|
|
187
|
+
children = [{
|
|
188
|
+
type: 'element',
|
|
189
|
+
tagName: 'span',
|
|
190
|
+
properties: (_properties = {
|
|
191
|
+
style: {
|
|
192
|
+
inlineSize: width
|
|
193
|
+
}
|
|
194
|
+
}, (0, _defineProperty2.default)(_properties, 'data-line-number', lineNumber), (0, _defineProperty2.default)(_properties, 'aria-hidden', true), (0, _defineProperty2.default)(_properties, "className", ['euiCodeBlock__lineNumber', lineNumberStyles]), _properties),
|
|
195
|
+
children: []
|
|
196
|
+
}, {
|
|
197
|
+
type: 'element',
|
|
198
|
+
tagName: 'span',
|
|
199
|
+
properties: {
|
|
200
|
+
className: ['euiCodeBlock__lineText', lineTextStyles]
|
|
198
201
|
},
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
children: node
|
|
203
|
+
}];
|
|
204
|
+
}
|
|
205
|
+
|
|
203
206
|
wrapped.push({
|
|
204
207
|
type: 'element',
|
|
205
208
|
tagName: 'span',
|
|
206
209
|
properties: {
|
|
207
|
-
className: [
|
|
210
|
+
className: ['euiCodeBlock__line', lineStyles]
|
|
208
211
|
},
|
|
209
212
|
children: children
|
|
210
213
|
});
|
|
@@ -212,13 +215,13 @@ function wrapLines(nodes, options) {
|
|
|
212
215
|
return wrapped;
|
|
213
216
|
}
|
|
214
217
|
|
|
215
|
-
var highlightByLine = function highlightByLine(children, language, data) {
|
|
218
|
+
var highlightByLine = function highlightByLine(children, language, data, euiTheme) {
|
|
216
219
|
return wrapLines(addLineData((0, _refractor.highlight)(children, language), {
|
|
217
220
|
lineNumber: data.start
|
|
218
221
|
}), {
|
|
219
222
|
showLineNumbers: data.show,
|
|
220
223
|
highlight: data.highlight
|
|
221
|
-
});
|
|
224
|
+
}, euiTheme);
|
|
222
225
|
};
|
|
223
226
|
|
|
224
227
|
exports.highlightByLine = highlightByLine;
|
|
@@ -15,7 +15,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _css = require("@emotion/css");
|
|
19
19
|
|
|
20
20
|
var _react2 = require("@emotion/react");
|
|
21
21
|
|
|
@@ -27,7 +27,9 @@ var _portal = require("../portal");
|
|
|
27
27
|
|
|
28
28
|
var _overlay_mask = require("./overlay_mask.styles");
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _overlay_mask_body = require("./overlay_mask_body.styles");
|
|
31
|
+
|
|
32
|
+
var _excluded = ["className", "children", "headerZindexLocation", "maskRef"];
|
|
31
33
|
|
|
32
34
|
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); }
|
|
33
35
|
|
|
@@ -39,7 +41,6 @@ var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
39
41
|
_ref$headerZindexLoca = _ref.headerZindexLocation,
|
|
40
42
|
headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
|
|
41
43
|
maskRef = _ref.maskRef,
|
|
42
|
-
css = _ref.css,
|
|
43
44
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
44
45
|
|
|
45
46
|
var _useState = (0, _react.useState)(null),
|
|
@@ -50,7 +51,7 @@ var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
50
51
|
var combinedMaskRef = (0, _services.useCombinedRefs)([setOverlayMaskNode, maskRef]);
|
|
51
52
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
52
53
|
var styles = (0, _overlay_mask.euiOverlayMaskStyles)(euiTheme);
|
|
53
|
-
var cssStyles = [styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]];
|
|
54
|
+
var cssStyles = (0, _css.cx)([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]]);
|
|
54
55
|
(0, _react.useEffect)(function () {
|
|
55
56
|
if (!overlayMaskNode) return;
|
|
56
57
|
(0, _common.keysOf)(rest).forEach(function (key) {
|
|
@@ -66,14 +67,13 @@ var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
66
67
|
|
|
67
68
|
(0, _react.useEffect)(function () {
|
|
68
69
|
if (!overlayMaskNode) return;
|
|
69
|
-
overlayMaskNode.className = (0,
|
|
70
|
-
|
|
70
|
+
overlayMaskNode.className = (0, _css.cx)('euiOverlayMask', cssStyles, className);
|
|
71
|
+
overlayMaskNode.dataset.relativeToHeader = headerZindexLocation;
|
|
72
|
+
}, [overlayMaskNode, className, cssStyles, headerZindexLocation]);
|
|
71
73
|
return (0, _react2.jsx)(_portal.EuiPortal, {
|
|
72
74
|
portalRef: combinedMaskRef
|
|
73
75
|
}, (0, _react2.jsx)(_react2.Global, {
|
|
74
|
-
styles:
|
|
75
|
-
}), (0, _react2.jsx)(_react2.Global, {
|
|
76
|
-
styles: cssStyles
|
|
76
|
+
styles: _overlay_mask_body.euiOverlayMaskBodyStyles
|
|
77
77
|
}), children);
|
|
78
78
|
};
|
|
79
79
|
|
|
@@ -3,32 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.euiOverlayMaskStyles =
|
|
6
|
+
exports.euiOverlayMaskStyles = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _css = require("@emotion/css");
|
|
9
9
|
|
|
10
10
|
var _global_styling = require("../../global_styling");
|
|
11
11
|
|
|
12
12
|
var _services = require("../../services");
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
/*
|
|
15
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
16
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
17
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
18
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
19
|
+
* Side Public License, v 1.
|
|
20
|
+
*/
|
|
16
21
|
var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
|
|
17
22
|
var euiTheme = _ref.euiTheme;
|
|
18
23
|
return {
|
|
19
|
-
euiOverlayMask: /*#__PURE__*/(0,
|
|
20
|
-
aboveHeader: /*#__PURE__*/(0,
|
|
21
|
-
belowHeader: /*#__PURE__*/(0,
|
|
24
|
+
euiOverlayMask: /*#__PURE__*/(0, _css.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " display:flex;align-items:center;justify-content:center;", (0, _global_styling.logicalCSS)('padding-bottom', '10vh'), ";animation:", _global_styling.euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", (0, _services.transparentize)(euiTheme.colors.ink, 0.5), ";;label:euiOverlayMask;"),
|
|
25
|
+
aboveHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
|
|
26
|
+
belowHeader: /*#__PURE__*/(0, _css.css)("z-index:", euiTheme.levels.maskBelowHeader, ";", (0, _global_styling.logicalCSS)('top', "".concat(euiTheme.base * 3, "px")), ";;label:belowHeader;")
|
|
22
27
|
};
|
|
23
28
|
};
|
|
24
29
|
|
|
25
|
-
exports.euiOverlayMaskStyles = euiOverlayMaskStyles;
|
|
26
|
-
var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
|
|
27
|
-
name: "131160-euiOverlayMaskBodyStyles",
|
|
28
|
-
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
|
|
29
|
-
} : {
|
|
30
|
-
name: "131160-euiOverlayMaskBodyStyles",
|
|
31
|
-
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
|
|
32
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
33
|
-
};
|
|
34
|
-
exports.euiOverlayMaskBodyStyles = euiOverlayMaskBodyStyles;
|
|
30
|
+
exports.euiOverlayMaskStyles = euiOverlayMaskStyles;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiOverlayMaskBodyStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
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
|
+
|
|
12
|
+
var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
|
|
13
|
+
name: "131160-euiOverlayMaskBodyStyles",
|
|
14
|
+
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
|
|
15
|
+
} : {
|
|
16
|
+
name: "131160-euiOverlayMaskBodyStyles",
|
|
17
|
+
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
|
|
18
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
|
+
};
|
|
20
|
+
exports.euiOverlayMaskBodyStyles = euiOverlayMaskBodyStyles;
|
|
@@ -9,7 +9,7 @@ exports.EuiProvider = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _css = require("@emotion/css");
|
|
13
13
|
|
|
14
14
|
var _global_styles = require("../../global_styling/reset/global_styles");
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ var _services = require("../../services");
|
|
|
19
19
|
|
|
20
20
|
var _themes = require("../../themes");
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _cache = require("./cache");
|
|
23
23
|
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
25
|
|
|
@@ -34,16 +34,11 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
|
34
34
|
return obj.hasOwnProperty('key');
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
var fallbackCache = (0, _cache.default)({
|
|
38
|
-
key: 'css'
|
|
39
|
-
});
|
|
40
|
-
fallbackCache.compat = true;
|
|
41
|
-
|
|
42
37
|
var EuiProvider = function EuiProvider(_ref) {
|
|
43
38
|
var _defaultCache;
|
|
44
39
|
|
|
45
40
|
var _ref$cache = _ref.cache,
|
|
46
|
-
cache = _ref$cache === void 0 ?
|
|
41
|
+
cache = _ref$cache === void 0 ? _css.cache : _ref$cache,
|
|
47
42
|
_ref$theme = _ref.theme,
|
|
48
43
|
theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
|
|
49
44
|
_ref$globalStyles = _ref.globalStyles,
|
|
@@ -82,16 +77,16 @@ var EuiProvider = function EuiProvider(_ref) {
|
|
|
82
77
|
}
|
|
83
78
|
}
|
|
84
79
|
|
|
85
|
-
return (0, _react2.jsx)(
|
|
86
|
-
cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache :
|
|
80
|
+
return (0, _react2.jsx)(_cache.EuiCacheProvider, {
|
|
81
|
+
cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : _css.cache
|
|
87
82
|
}, (0, _react2.jsx)(_services.EuiThemeProvider, {
|
|
88
83
|
theme: theme !== null && theme !== void 0 ? theme : undefined,
|
|
89
84
|
colorMode: colorMode,
|
|
90
85
|
modify: modify
|
|
91
|
-
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
86
|
+
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache.EuiCacheProvider, {
|
|
92
87
|
cache: globalCache,
|
|
93
88
|
children: Globals && (0, _react2.jsx)(Globals, null)
|
|
94
|
-
}), (0, _react2.jsx)(
|
|
89
|
+
}), (0, _react2.jsx)(_cache.EuiCacheProvider, {
|
|
95
90
|
cache: utilityCache,
|
|
96
91
|
children: Utilities && (0, _react2.jsx)(Utilities, null)
|
|
97
92
|
})), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
|
|
@@ -43,7 +43,7 @@ exports.sizesOnly = sizesOnly;
|
|
|
43
43
|
|
|
44
44
|
var _getPanelMinSize = function _getPanelMinSize(panelMinSize, containerSize) {
|
|
45
45
|
var panelMinSizePercent = 0;
|
|
46
|
-
var panelMinSizeInt =
|
|
46
|
+
var panelMinSizeInt = parseFloat(panelMinSize);
|
|
47
47
|
|
|
48
48
|
if (panelMinSize.indexOf('px') > -1) {
|
|
49
49
|
panelMinSizePercent = pxToPercent(panelMinSizeInt, containerSize);
|
|
@@ -78,7 +78,7 @@ var getSiblingPanel = function getSiblingPanel(element, adjacency) {
|
|
|
78
78
|
var sibling = element[method];
|
|
79
79
|
|
|
80
80
|
while (sibling) {
|
|
81
|
-
if (sibling.matches('.euiResizablePanel:not(
|
|
81
|
+
if (sibling.matches('.euiResizablePanel:not([data-collapsed])')) {
|
|
82
82
|
return sibling;
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -33,6 +33,8 @@ var _resizable_panel = require("./resizable_panel");
|
|
|
33
33
|
|
|
34
34
|
var _helpers = require("./helpers");
|
|
35
35
|
|
|
36
|
+
var _resizable_container = require("./resizable_container.styles");
|
|
37
|
+
|
|
36
38
|
var _react2 = require("@emotion/react");
|
|
37
39
|
|
|
38
40
|
var _excluded = ["direction", "children", "className", "onPanelWidthChange", "onToggleCollapsed", "onResizeStart", "onResizeEnd"];
|
|
@@ -45,10 +47,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
45
47
|
|
|
46
48
|
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) { (0, _defineProperty2.default)(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; }
|
|
47
49
|
|
|
48
|
-
var containerDirections = {
|
|
49
|
-
vertical: 'vertical',
|
|
50
|
-
horizontal: 'horizontal'
|
|
51
|
-
};
|
|
52
50
|
var initialState = {
|
|
53
51
|
isDragging: false,
|
|
54
52
|
currentResizerPos: -1,
|
|
@@ -70,11 +68,10 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
70
68
|
onResizeEnd = _ref.onResizeEnd,
|
|
71
69
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
72
70
|
var containerRef = (0, _react.useRef)(null);
|
|
73
|
-
var isHorizontal = direction ===
|
|
74
|
-
var classes = (0, _classnames.default)('euiResizableContainer',
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, className);
|
|
71
|
+
var isHorizontal = direction === 'horizontal';
|
|
72
|
+
var classes = (0, _classnames.default)('euiResizableContainer', className);
|
|
73
|
+
var styles = (0, _resizable_container.euiResizableContainerStyles)();
|
|
74
|
+
var cssStyles = [styles.euiResizableContainer, styles[direction]];
|
|
78
75
|
|
|
79
76
|
var _useContainerCallback = (0, _helpers.useContainerCallbacks)({
|
|
80
77
|
initialState: _objectSpread(_objectSpread({}, initialState), {}, {
|
|
@@ -247,6 +244,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
247
244
|
resizers: reducerState.resizers
|
|
248
245
|
}
|
|
249
246
|
}, (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
247
|
+
css: cssStyles,
|
|
250
248
|
className: classes,
|
|
251
249
|
ref: containerRef,
|
|
252
250
|
onMouseMove: reducerState.isDragging ? onMouseMove : undefined,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiResizableContainerStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
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)."; }
|
|
13
|
+
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "omnk2l-vertical",
|
|
16
|
+
styles: "flex-direction:column;label:vertical;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "omnk2l-vertical",
|
|
19
|
+
styles: "flex-direction:column;label:vertical;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var euiResizableContainerStyles = function euiResizableContainerStyles() {
|
|
24
|
+
return {
|
|
25
|
+
euiResizableContainer: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiResizableContainer;"),
|
|
26
|
+
horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
|
|
27
|
+
vertical: _ref
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.euiResizableContainerStyles = euiResizableContainerStyles;
|
|
@@ -23,16 +23,20 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
23
23
|
|
|
24
24
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
25
|
|
|
26
|
-
var _context = require("./context");
|
|
27
|
-
|
|
28
26
|
var _services = require("../../services");
|
|
29
27
|
|
|
28
|
+
var _global_styling = require("../../global_styling");
|
|
29
|
+
|
|
30
|
+
var _context = require("./context");
|
|
31
|
+
|
|
30
32
|
var _panel = require("../panel");
|
|
31
33
|
|
|
32
34
|
var _i18n = require("../i18n");
|
|
33
35
|
|
|
34
36
|
var _resizable_collapse_button = require("./resizable_collapse_button");
|
|
35
37
|
|
|
38
|
+
var _resizable_panel = require("./resizable_panel.styles");
|
|
39
|
+
|
|
36
40
|
var _react2 = require("@emotion/react");
|
|
37
41
|
|
|
38
42
|
var _excluded = ["children", "className", "id", "isHorizontal", "size", "initialSize", "minSize", "scrollable", "mode", "registration", "onToggleCollapsed", "onToggleCollapsedInternal", "wrapperProps", "hasShadow", "borderRadius", "color", "paddingSize", "wrapperPadding"];
|
|
@@ -45,14 +49,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
45
49
|
|
|
46
50
|
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) { (0, _defineProperty2.default)(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; }
|
|
47
51
|
|
|
48
|
-
var panelPaddingValues = {
|
|
49
|
-
none: 0,
|
|
50
|
-
xs: 4,
|
|
51
|
-
s: 8,
|
|
52
|
-
m: 16,
|
|
53
|
-
l: 24,
|
|
54
|
-
xl: 32
|
|
55
|
-
};
|
|
56
52
|
var defaultToggleOptions = {
|
|
57
53
|
className: null,
|
|
58
54
|
'data-test-subj': undefined,
|
|
@@ -70,12 +66,6 @@ var getToggleOptions = function getToggleOptions(mode) {
|
|
|
70
66
|
};
|
|
71
67
|
|
|
72
68
|
exports.getToggleOptions = getToggleOptions;
|
|
73
|
-
var paddingSizeToClassNameMap = {
|
|
74
|
-
none: null,
|
|
75
|
-
s: 'euiResizablePanel--paddingSmall',
|
|
76
|
-
m: 'euiResizablePanel--paddingMedium',
|
|
77
|
-
l: 'euiResizablePanel--paddingLarge'
|
|
78
|
-
};
|
|
79
69
|
|
|
80
70
|
var getPosition = function getPosition(ref) {
|
|
81
71
|
var position = 'middle';
|
|
@@ -182,34 +172,18 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
182
172
|
|
|
183
173
|
return direction;
|
|
184
174
|
}, [isCollapsed, isCollapsible, position, panels, panelId]);
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
var dimensions;
|
|
198
|
-
|
|
199
|
-
if (size) {
|
|
200
|
-
dimensions = {
|
|
201
|
-
width: isHorizontal ? "".concat(size, "%") : '100%',
|
|
202
|
-
height: isHorizontal ? 'auto' : "".concat(size, "%")
|
|
203
|
-
};
|
|
204
|
-
} else {
|
|
205
|
-
dimensions = {
|
|
206
|
-
width: isHorizontal ? "".concat(innerSize, "%") : '100%',
|
|
207
|
-
height: isHorizontal ? 'auto' : "".concat(innerSize, "%")
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
var styles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), dimensions);
|
|
212
|
-
|
|
175
|
+
var axis = isHorizontal ? 'horizontal' : 'vertical';
|
|
176
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
177
|
+
var styles = (0, _resizable_panel.euiResizablePanelStyles)(euiTheme);
|
|
178
|
+
var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding]];
|
|
179
|
+
var contentStyles = (0, _resizable_panel.euiResizablePanelContentStyles)(euiTheme);
|
|
180
|
+
var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
|
|
181
|
+
var classes = (0, _classnames.default)('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
|
|
182
|
+
var panelClasses = (0, _classnames.default)('euiResizablePanel__content', className);
|
|
183
|
+
|
|
184
|
+
var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? (0, _global_styling.logicalSizeStyle)("".concat(size || innerSize, "%"), 'auto') : (0, _global_styling.logicalSizeStyle)('100%', "".concat(size || innerSize, "%")));
|
|
185
|
+
|
|
186
|
+
var padding = (0, _global_styling.euiPaddingSize)(euiTheme, paddingSize) || '0px';
|
|
213
187
|
(0, _react.useEffect)(function () {
|
|
214
188
|
if (!registration) return;
|
|
215
189
|
var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
|
|
@@ -261,7 +235,7 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
261
235
|
theResizer = resizers[resizerIds.current[0]];
|
|
262
236
|
theToggle = (0, _react2.jsx)(_resizable_collapse_button.EuiResizableCollapseButton, {
|
|
263
237
|
externalPosition: "before",
|
|
264
|
-
direction:
|
|
238
|
+
direction: axis,
|
|
265
239
|
isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
|
|
266
240
|
isCollapsed: theResizer && theResizer.isDisabled,
|
|
267
241
|
internalPosition: toggleOpts.position,
|
|
@@ -273,7 +247,7 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
273
247
|
theResizer = resizers[resizerIds.current[1]];
|
|
274
248
|
theToggle = (0, _react2.jsx)(_resizable_collapse_button.EuiResizableCollapseButton, {
|
|
275
249
|
externalPosition: "after",
|
|
276
|
-
direction:
|
|
250
|
+
direction: axis,
|
|
277
251
|
isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
|
|
278
252
|
isCollapsed: theResizer && theResizer.isDisabled,
|
|
279
253
|
internalPosition: toggleOpts.position,
|
|
@@ -283,12 +257,17 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
283
257
|
});
|
|
284
258
|
}
|
|
285
259
|
|
|
286
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
260
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
261
|
+
css: cssStyles
|
|
262
|
+
}, wrapperProps, {
|
|
287
263
|
id: panelId,
|
|
288
264
|
ref: divRef,
|
|
289
|
-
style:
|
|
290
|
-
className: classes
|
|
265
|
+
style: inlineStyles,
|
|
266
|
+
className: classes,
|
|
267
|
+
"data-collapsed": isCollapsed || undefined,
|
|
268
|
+
"data-position": position
|
|
291
269
|
}), hasVisibleToggle && hasLeftToggle && theToggle, (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({
|
|
270
|
+
css: contentCssStyles,
|
|
292
271
|
className: panelClasses,
|
|
293
272
|
hasShadow: hasShadow,
|
|
294
273
|
borderRadius: borderRadius,
|