@elastic/eui 69.0.0 → 70.1.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 -554
- 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 -554
- 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/badge/beta_badge/beta_badge.js +6 -6
- package/es/components/basic_table/in_memory_table.js +16 -2
- package/es/components/button/button_display/_button_display.js +7 -6
- package/es/components/button/button_display/_button_display.styles.js +4 -4
- package/es/components/button/button_display/_button_display_content.js +6 -9
- package/es/components/button/button_display/_button_display_content.styles.js +3 -41
- package/es/components/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/datagrid/controls/column_selector.js +1 -1
- package/es/components/datagrid/controls/column_sorting.js +1 -1
- package/es/components/header/header_links/header_links.js +6 -0
- package/es/components/loading/loading_spinner.js +14 -3
- package/es/components/loading/loading_spinner.styles.js +11 -7
- package/es/components/modal/modal.js +17 -2
- package/es/components/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/page_template/page_template.js +6 -9
- package/es/components/popover/popover.js +13 -3
- package/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/es/components/popover/popover_panel/_popover_panel.js +8 -2
- package/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/es/components/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/search_bar/search_bar.js +39 -5
- package/es/components/search_bar/search_box.js +37 -4
- package/es/components/tabs/tab.js +33 -13
- package/es/components/tabs/tab.styles.js +50 -0
- package/es/components/tabs/tabbed_content/tabbed_content.js +16 -0
- package/es/components/tabs/tabs.js +20 -14
- package/es/components/tabs/tabs.styles.js +23 -0
- 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 +13 -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 +401 -84
- package/i18ntokens.json +26 -26
- package/lib/components/badge/beta_badge/beta_badge.js +6 -10
- package/lib/components/basic_table/in_memory_table.js +16 -2
- package/lib/components/button/button_display/_button_display.js +7 -6
- package/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/lib/components/button/button_display/_button_display_content.js +6 -9
- package/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- package/lib/components/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/datagrid/controls/column_selector.js +1 -1
- package/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/lib/components/header/header_links/header_links.js +6 -0
- package/lib/components/loading/loading_spinner.js +13 -2
- package/lib/components/loading/loading_spinner.styles.js +14 -6
- package/lib/components/modal/modal.js +23 -2
- package/lib/components/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/page_template/page_template.js +6 -9
- package/lib/components/popover/popover.js +13 -3
- package/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/lib/components/popover/popover_panel/_popover_panel.js +8 -2
- package/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/lib/components/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/search_bar/search_bar.js +40 -5
- package/lib/components/search_bar/search_box.js +38 -4
- package/lib/components/tabs/tab.js +33 -12
- package/lib/components/tabs/tab.styles.js +56 -0
- package/lib/components/tabs/tabbed_content/tabbed_content.js +16 -0
- package/lib/components/tabs/tabs.js +24 -14
- package/lib/components/tabs/tabs.styles.js +34 -0
- 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/badge/beta_badge/beta_badge.js +6 -6
- package/optimize/es/components/basic_table/in_memory_table.js +1 -1
- package/optimize/es/components/button/button_display/_button_display.js +6 -5
- package/optimize/es/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/es/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +3 -41
- package/optimize/es/components/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/datagrid/controls/column_selector.js +1 -1
- package/optimize/es/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/es/components/loading/loading_spinner.js +13 -3
- package/optimize/es/components/loading/loading_spinner.styles.js +11 -7
- package/optimize/es/components/modal/modal.js +17 -2
- package/optimize/es/components/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/page_template/page_template.js +6 -9
- package/optimize/es/components/popover/popover.js +7 -3
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/es/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +15 -1
- package/optimize/es/components/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/search_bar/search_bar.js +31 -5
- package/optimize/es/components/search_bar/search_box.js +29 -3
- package/optimize/es/components/tabs/tab.js +21 -13
- package/optimize/es/components/tabs/tab.styles.js +50 -0
- package/optimize/es/components/tabs/tabs.js +20 -14
- package/optimize/es/components/tabs/tabs.styles.js +23 -0
- 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/badge/beta_badge/beta_badge.js +6 -13
- package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
- package/optimize/lib/components/button/button_display/_button_display.js +7 -6
- package/optimize/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/lib/components/button/button_display/_button_display_content.js +6 -9
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +10 -40
- package/optimize/lib/components/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/datagrid/controls/column_selector.js +1 -1
- package/optimize/lib/components/datagrid/controls/column_sorting.js +1 -1
- package/optimize/lib/components/loading/loading_spinner.js +14 -2
- package/optimize/lib/components/loading/loading_spinner.styles.js +14 -6
- package/optimize/lib/components/modal/modal.js +22 -2
- package/optimize/lib/components/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/page_template/page_template.js +6 -9
- package/optimize/lib/components/popover/popover.js +7 -3
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/optimize/lib/components/popover/popover_panel/_popover_panel.js +6 -1
- package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/optimize/lib/components/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/search_bar/search_bar.js +31 -5
- package/optimize/lib/components/search_bar/search_box.js +30 -3
- package/optimize/lib/components/tabs/tab.js +21 -12
- package/optimize/lib/components/tabs/tab.styles.js +56 -0
- package/optimize/lib/components/tabs/tabs.js +24 -14
- package/optimize/lib/components/tabs/tabs.styles.js +34 -0
- 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 +10 -9
- package/src/components/datagrid/controls/_data_grid_toolbar.scss +0 -8
- package/src/components/index.scss +0 -2
- 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 -2
- package/test-env/components/badge/beta_badge/beta_badge.js +6 -13
- package/test-env/components/basic_table/in_memory_table.js +16 -2
- package/test-env/components/button/button_display/_button_display.js +7 -6
- package/test-env/components/button/button_display/_button_display.styles.js +4 -4
- package/test-env/components/button/button_display/_button_display_content.js +6 -9
- package/test-env/components/button/button_display/_button_display_content.styles.js +10 -40
- package/test-env/components/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/datagrid/controls/column_selector.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting.js +1 -1
- package/test-env/components/header/header_links/header_links.js +6 -0
- package/test-env/components/loading/loading_spinner.js +14 -2
- package/test-env/components/loading/loading_spinner.styles.js +14 -6
- package/test-env/components/modal/modal.js +22 -2
- package/test-env/components/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/page_template/page_template.js +6 -9
- package/test-env/components/popover/popover.js +13 -3
- package/test-env/components/popover/popover_arrow/_popover_arrow.js +1 -0
- package/test-env/components/popover/popover_panel/_popover_panel.js +8 -2
- package/test-env/components/popover/popover_panel/_popover_panel.styles.js +16 -1
- package/test-env/components/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/search_bar/search_bar.js +39 -5
- package/test-env/components/search_bar/search_box.js +38 -4
- package/test-env/components/tabs/tab.js +33 -12
- package/test-env/components/tabs/tab.styles.js +56 -0
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +16 -0
- package/test-env/components/tabs/tabs.js +24 -14
- package/test-env/components/tabs/tabs.styles.js +34 -0
- 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/components/tabs/_index.scss +0 -1
- package/src/components/tabs/_tabs.scss +0 -110
- package/src/global_styling/variables/_colors_code.scss +0 -23
- package/src/themes/amsterdam/overrides/_code.scss +0 -9
- package/src/themes/amsterdam/overrides/_tabs.scss +0 -80
|
@@ -13,7 +13,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
13
13
|
*/
|
|
14
14
|
import React, { createElement } from 'react';
|
|
15
15
|
import { listLanguages, highlight } from 'refractor';
|
|
16
|
-
import
|
|
16
|
+
import { cx } from '@emotion/css';
|
|
17
|
+
import { euiCodeBlockLineStyles } from './code_block_line.styles';
|
|
18
|
+
/**
|
|
19
|
+
* Utils shared between EuiCode and EuiCodeBlock
|
|
20
|
+
*/
|
|
21
|
+
|
|
17
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
23
|
export var SUPPORTED_LANGUAGES = listLanguages();
|
|
19
24
|
export var DEFAULT_LANGUAGE = 'text';
|
|
@@ -40,7 +45,7 @@ export var nodeToHtml = function nodeToHtml(node, idx, nodes) {
|
|
|
40
45
|
children = node.children;
|
|
41
46
|
return /*#__PURE__*/createElement(tagName, _objectSpread(_objectSpread({}, properties), {}, {
|
|
42
47
|
key: key,
|
|
43
|
-
className:
|
|
48
|
+
className: cx(properties.className)
|
|
44
49
|
}), children && children.map(function (el, i) {
|
|
45
50
|
return nodeToHtml(el, i, nodes, depth + 1);
|
|
46
51
|
}));
|
|
@@ -55,8 +60,7 @@ export var nodeToHtml = function nodeToHtml(node, idx, nodes) {
|
|
|
55
60
|
*/
|
|
56
61
|
|
|
57
62
|
// Approximate width of a single digit/character
|
|
58
|
-
var CHAR_SIZE = 8;
|
|
59
|
-
var $euiSizeS = 8; // Creates an array of numbers from comma-separeated
|
|
63
|
+
var CHAR_SIZE = 8; // Creates an array of numbers from comma-separeated
|
|
60
64
|
// string of numbers or number ranges using `-`
|
|
61
65
|
// (e.g., "1, 3-10, 15")
|
|
62
66
|
|
|
@@ -129,8 +133,7 @@ var addLineData = function addLineData(nodes, data) {
|
|
|
129
133
|
}, []);
|
|
130
134
|
};
|
|
131
135
|
|
|
132
|
-
function wrapLines(nodes, options) {
|
|
133
|
-
var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
|
|
136
|
+
function wrapLines(nodes, options, euiTheme) {
|
|
134
137
|
var grouped = [];
|
|
135
138
|
nodes.forEach(function (node) {
|
|
136
139
|
var lineStart = node.lineStart - 1;
|
|
@@ -142,41 +145,44 @@ function wrapLines(nodes, options) {
|
|
|
142
145
|
}
|
|
143
146
|
});
|
|
144
147
|
var wrapped = [];
|
|
145
|
-
var digits = grouped.length.toString().length;
|
|
146
|
-
var width = digits * CHAR_SIZE;
|
|
147
148
|
grouped.forEach(function (node, i) {
|
|
148
|
-
var
|
|
149
|
-
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
149
|
+
var children = node;
|
|
150
|
+
var styles = euiCodeBlockLineStyles(euiTheme);
|
|
151
|
+
var lineStyles = cx([styles.euiCodeBlock__line, options.showLineNumbers && styles.hasLineNumbers]);
|
|
152
|
+
|
|
153
|
+
if (options.showLineNumbers) {
|
|
154
|
+
var _properties;
|
|
155
|
+
|
|
156
|
+
var lineNumber = i + 1;
|
|
157
|
+
var digits = grouped.length.toString().length;
|
|
158
|
+
var width = digits * CHAR_SIZE;
|
|
159
|
+
var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
|
|
160
|
+
var lineTextStyles = cx([styles.lineText.euiCodeBlock__lineText, highlights.includes(lineNumber) && styles.lineText.isHighlighted]);
|
|
161
|
+
var lineNumberStyles = cx(styles.lineNumber.euiCodeBlock__lineNumber);
|
|
162
|
+
children = [{
|
|
163
|
+
type: 'element',
|
|
164
|
+
tagName: 'span',
|
|
165
|
+
properties: (_properties = {
|
|
166
|
+
style: {
|
|
167
|
+
inlineSize: width
|
|
168
|
+
}
|
|
169
|
+
}, _defineProperty(_properties, 'data-line-number', lineNumber), _defineProperty(_properties, 'aria-hidden', true), _defineProperty(_properties, "className", ['euiCodeBlock__lineNumber', lineNumberStyles]), _properties),
|
|
170
|
+
children: []
|
|
171
|
+
}, {
|
|
172
|
+
type: 'element',
|
|
173
|
+
tagName: 'span',
|
|
174
|
+
properties: {
|
|
175
|
+
className: ['euiCodeBlock__lineText', lineTextStyles]
|
|
170
176
|
},
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
children: node
|
|
178
|
+
}];
|
|
179
|
+
}
|
|
180
|
+
|
|
175
181
|
wrapped.push({
|
|
176
182
|
type: 'element',
|
|
177
183
|
tagName: 'span',
|
|
178
184
|
properties: {
|
|
179
|
-
className: [
|
|
185
|
+
className: ['euiCodeBlock__line', lineStyles]
|
|
180
186
|
},
|
|
181
187
|
children: children
|
|
182
188
|
});
|
|
@@ -184,11 +190,11 @@ function wrapLines(nodes, options) {
|
|
|
184
190
|
return wrapped;
|
|
185
191
|
}
|
|
186
192
|
|
|
187
|
-
export var highlightByLine = function highlightByLine(children, language, data) {
|
|
193
|
+
export var highlightByLine = function highlightByLine(children, language, data, euiTheme) {
|
|
188
194
|
return wrapLines(addLineData(highlight(children, language), {
|
|
189
195
|
lineNumber: data.start
|
|
190
196
|
}), {
|
|
191
197
|
showLineNumbers: data.show,
|
|
192
198
|
highlight: data.highlight
|
|
193
|
-
});
|
|
199
|
+
}, euiTheme);
|
|
194
200
|
};
|
|
@@ -110,7 +110,7 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
|
|
|
110
110
|
},
|
|
111
111
|
anchorPosition: "downLeft",
|
|
112
112
|
panelPaddingSize: "s",
|
|
113
|
-
|
|
113
|
+
hasDragDrop: true,
|
|
114
114
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
115
115
|
size: "xs",
|
|
116
116
|
iconType: allowColumnHiding ? 'listAdd' : 'list',
|
|
@@ -123,7 +123,7 @@ export var useDataGridColumnSorting = function useDataGridColumnSorting(columns,
|
|
|
123
123
|
},
|
|
124
124
|
anchorPosition: "downLeft",
|
|
125
125
|
panelPaddingSize: "s",
|
|
126
|
-
|
|
126
|
+
hasDragDrop: true,
|
|
127
127
|
button: ___EmotionJSX(EuiButtonEmpty, {
|
|
128
128
|
size: "xs",
|
|
129
129
|
iconType: "sortable",
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["size", "className", "aria-label", "color"];
|
|
4
|
+
var _excluded = ["size", "className", "aria-label", "color", "style"];
|
|
5
|
+
|
|
6
|
+
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; }
|
|
7
|
+
|
|
8
|
+
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; }
|
|
4
9
|
|
|
5
10
|
/*
|
|
6
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -13,7 +18,7 @@ import React from 'react';
|
|
|
13
18
|
import classNames from 'classnames';
|
|
14
19
|
import { useEuiTheme } from '../..//services';
|
|
15
20
|
import { useLoadingAriaLabel } from './_loading_strings';
|
|
16
|
-
import { euiLoadingSpinnerStyles } from './loading_spinner.styles';
|
|
21
|
+
import { euiLoadingSpinnerStyles, euiSpinnerBorderColorsCSS } from './loading_spinner.styles';
|
|
17
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
23
|
export var SIZES = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
19
24
|
export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
@@ -22,16 +27,21 @@ export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
|
22
27
|
className = _ref.className,
|
|
23
28
|
ariaLabel = _ref['aria-label'],
|
|
24
29
|
color = _ref.color,
|
|
30
|
+
style = _ref.style,
|
|
25
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
26
32
|
|
|
27
33
|
var euiTheme = useEuiTheme();
|
|
28
|
-
var styles = euiLoadingSpinnerStyles(euiTheme
|
|
34
|
+
var styles = euiLoadingSpinnerStyles(euiTheme);
|
|
29
35
|
var cssStyles = [styles.euiLoadingSpinner, styles[size]];
|
|
30
36
|
var classes = classNames('euiLoadingSpinner', className);
|
|
31
37
|
var defaultLabel = useLoadingAriaLabel();
|
|
38
|
+
var customColorStyle = color ? _objectSpread(_objectSpread({}, style), {}, {
|
|
39
|
+
borderColor: euiSpinnerBorderColorsCSS(euiTheme, color)
|
|
40
|
+
}) : style;
|
|
32
41
|
return ___EmotionJSX("span", _extends({
|
|
33
42
|
className: classes,
|
|
34
43
|
css: cssStyles,
|
|
44
|
+
style: customColorStyle,
|
|
35
45
|
role: "progressbar",
|
|
36
46
|
"aria-label": ariaLabel || defaultLabel
|
|
37
47
|
}, rest));
|
|
@@ -21,15 +21,19 @@ var spinnerSizes = {
|
|
|
21
21
|
xl: 'xl',
|
|
22
22
|
xxl: 'xxl'
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
var spinnerColorsCSS = function spinnerColorsCSS(border, highlight) {
|
|
26
|
-
return "\n border-color: ".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border, ";\n ");
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(_ref, color) {
|
|
24
|
+
export var euiSpinnerBorderColorsCSS = function euiSpinnerBorderColorsCSS(_ref) {
|
|
30
25
|
var euiTheme = _ref.euiTheme;
|
|
26
|
+
var colors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
27
|
+
var _colors$border = colors.border,
|
|
28
|
+
border = _colors$border === void 0 ? euiTheme.colors.lightShade : _colors$border,
|
|
29
|
+
_colors$highlight = colors.highlight,
|
|
30
|
+
highlight = _colors$highlight === void 0 ? euiTheme.colors.primary : _colors$highlight;
|
|
31
|
+
return "".concat(highlight, " ").concat(border, " ").concat(border, " ").concat(border);
|
|
32
|
+
};
|
|
33
|
+
export var euiLoadingSpinnerStyles = function euiLoadingSpinnerStyles(euiThemeContext) {
|
|
34
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
35
|
return {
|
|
32
|
-
euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";
|
|
36
|
+
euiLoadingSpinner: /*#__PURE__*/css("flex-shrink:0;display:inline-block;border-radius:50%;border:", euiTheme.border.thick, ";border-color:", euiSpinnerBorderColorsCSS(euiThemeContext), ";", euiCanAnimate, "{animation:", _loadingSpinner, " 0.6s infinite linear;};label:euiLoadingSpinner;"),
|
|
33
37
|
// Sizes
|
|
34
38
|
s: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size[spinnerSizes.s], euiTheme.size[spinnerSizes.s]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:s;"),
|
|
35
39
|
m: /*#__PURE__*/css(logicalSizeCSS(euiTheme.size[spinnerSizes.m], euiTheme.size[spinnerSizes.m]), " border-width:calc(", euiTheme.border.width.thin, " * 1.5);;label:m;"),
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
15
|
* Side Public License, v 1.
|
|
16
16
|
*/
|
|
17
|
-
import React from 'react';
|
|
17
|
+
import React, { useRef, useCallback } from 'react';
|
|
18
18
|
import classnames from 'classnames';
|
|
19
19
|
import { keys } from '../../services';
|
|
20
20
|
import { EuiButtonIcon } from '../button';
|
|
@@ -32,6 +32,19 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
32
32
|
style = _ref.style,
|
|
33
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
34
|
|
|
35
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
36
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
37
|
+
var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
38
|
+
);
|
|
39
|
+
var onFocus = useCallback(function () {
|
|
40
|
+
if (bodyScrollTop.current != null) {
|
|
41
|
+
window.scrollTo({
|
|
42
|
+
top: bodyScrollTop.current
|
|
43
|
+
});
|
|
44
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
35
48
|
var onKeyDown = function onKeyDown(event) {
|
|
36
49
|
if (event.key === keys.ESCAPE) {
|
|
37
50
|
event.preventDefault();
|
|
@@ -54,11 +67,13 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
54
67
|
|
|
55
68
|
var classes = classnames('euiModal', widthClassName, className);
|
|
56
69
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
57
|
-
initialFocus: initialFocus
|
|
70
|
+
initialFocus: initialFocus,
|
|
71
|
+
scrollLock: true
|
|
58
72
|
}, ___EmotionJSX("div", _extends({
|
|
59
73
|
className: classes,
|
|
60
74
|
onKeyDown: onKeyDown,
|
|
61
75
|
tabIndex: 0,
|
|
76
|
+
onFocus: onFocus,
|
|
62
77
|
style: newStyle || style
|
|
63
78
|
}, rest), ___EmotionJSX(EuiI18n, {
|
|
64
79
|
token: "euiModal.closeModal",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children", "headerZindexLocation", "maskRef"
|
|
3
|
+
var _excluded = ["className", "children", "headerZindexLocation", "maskRef"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -15,12 +15,13 @@ var _excluded = ["className", "children", "headerZindexLocation", "maskRef", "cs
|
|
|
15
15
|
* into portals.
|
|
16
16
|
*/
|
|
17
17
|
import React, { useEffect, useState } from 'react';
|
|
18
|
-
import
|
|
18
|
+
import { cx } from '@emotion/css';
|
|
19
19
|
import { Global } from '@emotion/react';
|
|
20
20
|
import { keysOf } from '../common';
|
|
21
21
|
import { useCombinedRefs, useEuiTheme } from '../../services';
|
|
22
22
|
import { EuiPortal } from '../portal';
|
|
23
|
-
import { euiOverlayMaskStyles
|
|
23
|
+
import { euiOverlayMaskStyles } from './overlay_mask.styles';
|
|
24
|
+
import { euiOverlayMaskBodyStyles } from './overlay_mask_body.styles';
|
|
24
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
26
|
export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
26
27
|
var className = _ref.className,
|
|
@@ -28,7 +29,6 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
28
29
|
_ref$headerZindexLoca = _ref.headerZindexLocation,
|
|
29
30
|
headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
|
|
30
31
|
maskRef = _ref.maskRef,
|
|
31
|
-
css = _ref.css,
|
|
32
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
33
|
|
|
34
34
|
var _useState = useState(null),
|
|
@@ -39,7 +39,7 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
39
39
|
var combinedMaskRef = useCombinedRefs([setOverlayMaskNode, maskRef]);
|
|
40
40
|
var euiTheme = useEuiTheme();
|
|
41
41
|
var styles = euiOverlayMaskStyles(euiTheme);
|
|
42
|
-
var cssStyles = [styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]];
|
|
42
|
+
var cssStyles = cx([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]]);
|
|
43
43
|
useEffect(function () {
|
|
44
44
|
if (!overlayMaskNode) return;
|
|
45
45
|
keysOf(rest).forEach(function (key) {
|
|
@@ -55,13 +55,12 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
55
55
|
|
|
56
56
|
useEffect(function () {
|
|
57
57
|
if (!overlayMaskNode) return;
|
|
58
|
-
overlayMaskNode.className =
|
|
59
|
-
|
|
58
|
+
overlayMaskNode.className = cx('euiOverlayMask', cssStyles, className);
|
|
59
|
+
overlayMaskNode.dataset.relativeToHeader = headerZindexLocation;
|
|
60
|
+
}, [overlayMaskNode, className, cssStyles, headerZindexLocation]);
|
|
60
61
|
return ___EmotionJSX(EuiPortal, {
|
|
61
62
|
portalRef: combinedMaskRef
|
|
62
63
|
}, ___EmotionJSX(Global, {
|
|
63
64
|
styles: euiOverlayMaskBodyStyles
|
|
64
|
-
}), ___EmotionJSX(Global, {
|
|
65
|
-
styles: cssStyles
|
|
66
65
|
}), children);
|
|
67
66
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
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
1
|
/*
|
|
4
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -7,22 +5,14 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
7
5
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
6
|
* Side Public License, v 1.
|
|
9
7
|
*/
|
|
10
|
-
import { css } from '@emotion/
|
|
8
|
+
import { css } from '@emotion/css';
|
|
11
9
|
import { logicalCSS, euiAnimFadeIn } from '../../global_styling';
|
|
12
10
|
import { transparentize } from '../../services';
|
|
13
11
|
export var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
|
|
14
12
|
var euiTheme = _ref.euiTheme;
|
|
15
13
|
return {
|
|
16
|
-
euiOverlayMask: /*#__PURE__*/css("
|
|
17
|
-
aboveHeader: /*#__PURE__*/css("
|
|
18
|
-
belowHeader: /*#__PURE__*/css("
|
|
14
|
+
euiOverlayMask: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;", logicalCSS('padding-bottom', '10vh'), ";animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", transparentize(euiTheme.colors.ink, 0.5), ";;label:euiOverlayMask;"),
|
|
15
|
+
aboveHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
|
|
16
|
+
belowHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', "".concat(euiTheme.base * 3, "px")), ";;label:belowHeader;")
|
|
19
17
|
};
|
|
20
|
-
};
|
|
21
|
-
export var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
|
|
22
|
-
name: "131160-euiOverlayMaskBodyStyles",
|
|
23
|
-
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
|
|
24
|
-
} : {
|
|
25
|
-
name: "131160-euiOverlayMaskBodyStyles",
|
|
26
|
-
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
|
|
27
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
18
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
|
|
12
|
+
name: "131160-euiOverlayMaskBodyStyles",
|
|
13
|
+
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
|
|
14
|
+
} : {
|
|
15
|
+
name: "131160-euiOverlayMaskBodyStyles",
|
|
16
|
+
styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
|
|
17
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
18
|
+
};
|
|
@@ -132,15 +132,12 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
132
132
|
React.Children.toArray(children).forEach(function (child, index) {
|
|
133
133
|
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
sidebar.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
default:
|
|
143
|
-
sections.push(child);
|
|
135
|
+
if (child.type === EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === EuiPageSidebar) {
|
|
136
|
+
sidebar.push( /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({
|
|
137
|
+
key: "sidebar".concat(index)
|
|
138
|
+
}, getSideBarProps()), child.props)));
|
|
139
|
+
} else {
|
|
140
|
+
sections.push(child);
|
|
144
141
|
}
|
|
145
142
|
});
|
|
146
143
|
|
|
@@ -10,7 +10,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
10
10
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
13
|
-
var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
13
|
+
var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "hasDragDrop", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "onTrapDeactivation", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
|
|
14
14
|
|
|
15
15
|
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; }
|
|
16
16
|
|
|
@@ -382,7 +382,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
382
382
|
}, {
|
|
383
383
|
key: "render",
|
|
384
384
|
value: function render() {
|
|
385
|
-
var
|
|
385
|
+
var _panelProps$tabIndex,
|
|
386
|
+
_this4 = this;
|
|
386
387
|
|
|
387
388
|
var _this$props = this.props,
|
|
388
389
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -405,6 +406,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
405
406
|
hasArrow = _this$props.hasArrow,
|
|
406
407
|
arrowChildren = _this$props.arrowChildren,
|
|
407
408
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
409
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
408
410
|
zIndex = _this$props.zIndex,
|
|
409
411
|
attachToAnchor = _this$props.attachToAnchor,
|
|
410
412
|
display = _this$props.display,
|
|
@@ -417,9 +419,10 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
417
419
|
container = _this$props.container,
|
|
418
420
|
focusTrapProps = _this$props.focusTrapProps,
|
|
419
421
|
initialFocusProp = _this$props.initialFocus,
|
|
420
|
-
|
|
422
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
421
423
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
422
424
|
|
|
425
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
423
426
|
var styles = euiPopoverStyles();
|
|
424
427
|
var popoverStyles = [styles.euiPopover, {
|
|
425
428
|
display: display
|
|
@@ -483,6 +486,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
483
486
|
position: this.state.arrowPosition,
|
|
484
487
|
isAttached: attachToAnchor,
|
|
485
488
|
className: classNames(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
489
|
+
hasDragDrop: hasDragDrop,
|
|
486
490
|
hasShadow: false,
|
|
487
491
|
paddingSize: panelPaddingSize,
|
|
488
492
|
tabIndex: tabIndex,
|
|
@@ -23,6 +23,7 @@ export var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
23
23
|
var styles = euiPopoverArrowStyles(euiTheme);
|
|
24
24
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
25
25
|
return ___EmotionJSX("div", _extends({
|
|
26
|
+
className: "euiPopover__arrow",
|
|
26
27
|
"data-popover-arrow": position,
|
|
27
28
|
css: cssStyles
|
|
28
29
|
}, rest), children);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
4
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -29,6 +29,7 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
29
29
|
className = _ref.className,
|
|
30
30
|
isOpen = _ref.isOpen,
|
|
31
31
|
isAttached = _ref.isAttached,
|
|
32
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
32
33
|
position = _ref.position,
|
|
33
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
35
|
|
|
@@ -44,6 +45,10 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
44
45
|
panelCSS = [].concat(_toConsumableArray(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
45
46
|
}
|
|
46
47
|
|
|
48
|
+
if (hasDragDrop) {
|
|
49
|
+
panelCSS = [].concat(_toConsumableArray(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
50
|
+
}
|
|
51
|
+
|
|
47
52
|
return ___EmotionJSX(EuiPopoverPanelContext.Provider, {
|
|
48
53
|
value: panelContext
|
|
49
54
|
}, ___EmotionJSX(EuiPanel, _extends({
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { euiShadow, euiShadowFlat, euiShadowMedium } from '../../../themes/amsterdam/global_styling/mixins';
|
|
10
|
+
import { getShadowColor } from '../../../themes/amsterdam/global_styling/functions';
|
|
10
11
|
import { euiCanAnimate, logicalCSS } from '../../../global_styling';
|
|
11
12
|
export var openAnimationTiming = 'slow';
|
|
12
13
|
var translateDistance = 's';
|
|
@@ -17,7 +18,8 @@ var translateDistance = 's';
|
|
|
17
18
|
*/
|
|
18
19
|
|
|
19
20
|
export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContext) {
|
|
20
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
21
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
22
|
+
colorMode = euiThemeContext.colorMode;
|
|
21
23
|
return {
|
|
22
24
|
// Base
|
|
23
25
|
euiPopover__panel: /*#__PURE__*/css("position:absolute;", logicalCSS('min-width', "".concat(euiTheme.base * 7, "px")), ";", logicalCSS('max-width', "calc(100vw - ".concat(euiTheme.size.xl, ")")), ";backface-visibility:hidden;pointer-events:none;opacity:0;transform:translateY(0) translateX(0) translateZ(0);", euiShadowMedium(euiThemeContext, {
|
|
@@ -38,6 +40,18 @@ export var euiPopoverPanelStyles = function euiPopoverPanelStyles(euiThemeContex
|
|
|
38
40
|
// Satisfies TS
|
|
39
41
|
left: /*#__PURE__*/css(";label:left;"),
|
|
40
42
|
right: /*#__PURE__*/css(";label:right;")
|
|
43
|
+
},
|
|
44
|
+
// Overrides for drag & drop contexts within popovers. This is required because
|
|
45
|
+
// the fixed positions of drag and drop don't work inside of transformed elements
|
|
46
|
+
hasDragDrop: {
|
|
47
|
+
hasDragDrop: /*#__PURE__*/css("transform:none;filter:none;", euiShadowMedium(euiThemeContext, {
|
|
48
|
+
property: 'box-shadow'
|
|
49
|
+
}), ";;label:hasDragDrop;"),
|
|
50
|
+
// The offset transforms must be recreated in margins
|
|
51
|
+
top: /*#__PURE__*/css("margin-block-start:", euiTheme.size[translateDistance], ";;label:top;"),
|
|
52
|
+
bottom: /*#__PURE__*/css("margin-block-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 0 -6px 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:bottom;"),
|
|
53
|
+
left: /*#__PURE__*/css("margin-inline-start:", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n 6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:left;"),
|
|
54
|
+
right: /*#__PURE__*/css("margin-inline-start:-", euiTheme.size[translateDistance], ";.euiPopover__arrow{filter:drop-shadow(\n -6px 0 6px ", getShadowColor(euiTheme.colors.shadow, 0.12, colorMode), "\n );};label:right;")
|
|
41
55
|
}
|
|
42
56
|
};
|
|
43
57
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import
|
|
9
|
+
import { cache as fallbackCache } from '@emotion/css';
|
|
10
10
|
import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
|
|
11
11
|
import { EuiUtilityClasses } from '../../global_styling/utility/utility';
|
|
12
12
|
import { EuiThemeProvider, CurrentEuiBreakpointProvider } from '../../services';
|
|
@@ -18,10 +18,6 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
|
18
18
|
return obj.hasOwnProperty('key');
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
var fallbackCache = createCache({
|
|
22
|
-
key: 'css'
|
|
23
|
-
});
|
|
24
|
-
fallbackCache.compat = true;
|
|
25
21
|
export var EuiProvider = function EuiProvider(_ref) {
|
|
26
22
|
var _defaultCache;
|
|
27
23
|
|
|
@@ -33,7 +33,7 @@ export var sizesOnly = function sizesOnly(panelObject) {
|
|
|
33
33
|
|
|
34
34
|
var _getPanelMinSize = function _getPanelMinSize(panelMinSize, containerSize) {
|
|
35
35
|
var panelMinSizePercent = 0;
|
|
36
|
-
var panelMinSizeInt =
|
|
36
|
+
var panelMinSizeInt = parseFloat(panelMinSize);
|
|
37
37
|
|
|
38
38
|
if (panelMinSize.indexOf('px') > -1) {
|
|
39
39
|
panelMinSizePercent = pxToPercent(panelMinSizeInt, containerSize);
|
|
@@ -63,7 +63,7 @@ var getSiblingPanel = function getSiblingPanel(element, adjacency) {
|
|
|
63
63
|
var sibling = element[method];
|
|
64
64
|
|
|
65
65
|
while (sibling) {
|
|
66
|
-
if (sibling.matches('.euiResizablePanel:not(
|
|
66
|
+
if (sibling.matches('.euiResizablePanel:not([data-collapsed])')) {
|
|
67
67
|
return sibling;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -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
|
+
};
|