@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
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
var _excluded = ["size", "className", "aria-label", "color"];
|
|
1
|
+
var _excluded = ["size", "className", "aria-label", "color", "style"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
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; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
5
11
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
12
|
|
|
7
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -18,7 +24,7 @@ import PropTypes from "prop-types";
|
|
|
18
24
|
import classNames from 'classnames';
|
|
19
25
|
import { useEuiTheme } from '../..//services';
|
|
20
26
|
import { useLoadingAriaLabel } from './_loading_strings';
|
|
21
|
-
import { euiLoadingSpinnerStyles } from './loading_spinner.styles';
|
|
27
|
+
import { euiLoadingSpinnerStyles, euiSpinnerBorderColorsCSS } from './loading_spinner.styles';
|
|
22
28
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
29
|
export var SIZES = ['s', 'm', 'l', 'xl', 'xxl'];
|
|
24
30
|
export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
@@ -27,16 +33,21 @@ export var EuiLoadingSpinner = function EuiLoadingSpinner(_ref) {
|
|
|
27
33
|
className = _ref.className,
|
|
28
34
|
ariaLabel = _ref['aria-label'],
|
|
29
35
|
color = _ref.color,
|
|
36
|
+
style = _ref.style,
|
|
30
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
38
|
|
|
32
39
|
var euiTheme = useEuiTheme();
|
|
33
|
-
var styles = euiLoadingSpinnerStyles(euiTheme
|
|
40
|
+
var styles = euiLoadingSpinnerStyles(euiTheme);
|
|
34
41
|
var cssStyles = [styles.euiLoadingSpinner, styles[size]];
|
|
35
42
|
var classes = classNames('euiLoadingSpinner', className);
|
|
36
43
|
var defaultLabel = useLoadingAriaLabel();
|
|
44
|
+
var customColorStyle = color ? _objectSpread(_objectSpread({}, style), {}, {
|
|
45
|
+
borderColor: euiSpinnerBorderColorsCSS(euiTheme, color)
|
|
46
|
+
}) : style;
|
|
37
47
|
return ___EmotionJSX("span", _extends({
|
|
38
48
|
className: classes,
|
|
39
49
|
css: cssStyles,
|
|
50
|
+
style: customColorStyle,
|
|
40
51
|
role: "progressbar",
|
|
41
52
|
"aria-label": ariaLabel || defaultLabel
|
|
42
53
|
}, 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;"),
|
|
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
19
19
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
20
20
|
* Side Public License, v 1.
|
|
21
21
|
*/
|
|
22
|
-
import React from 'react';
|
|
22
|
+
import React, { useRef, useCallback } from 'react';
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import classnames from 'classnames';
|
|
25
25
|
import { keys } from '../../services';
|
|
@@ -38,6 +38,19 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
38
38
|
style = _ref.style,
|
|
39
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
40
40
|
|
|
41
|
+
// TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
|
|
42
|
+
// @see https://github.com/elastic/eui/issues/6304
|
|
43
|
+
var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
|
|
44
|
+
);
|
|
45
|
+
var onFocus = useCallback(function () {
|
|
46
|
+
if (bodyScrollTop.current != null) {
|
|
47
|
+
window.scrollTo({
|
|
48
|
+
top: bodyScrollTop.current
|
|
49
|
+
});
|
|
50
|
+
bodyScrollTop.current = undefined; // Unset after first auto focus
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
|
|
41
54
|
var onKeyDown = function onKeyDown(event) {
|
|
42
55
|
if (event.key === keys.ESCAPE) {
|
|
43
56
|
event.preventDefault();
|
|
@@ -60,11 +73,13 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
60
73
|
|
|
61
74
|
var classes = classnames('euiModal', widthClassName, className);
|
|
62
75
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
|
|
63
|
-
initialFocus: initialFocus
|
|
76
|
+
initialFocus: initialFocus,
|
|
77
|
+
scrollLock: true
|
|
64
78
|
}, ___EmotionJSX("div", _extends({
|
|
65
79
|
className: classes,
|
|
66
80
|
onKeyDown: onKeyDown,
|
|
67
81
|
tabIndex: 0,
|
|
82
|
+
onFocus: onFocus,
|
|
68
83
|
style: newStyle || style
|
|
69
84
|
}, rest), ___EmotionJSX(EuiI18n, {
|
|
70
85
|
token: "euiModal.closeModal",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "children", "headerZindexLocation", "maskRef"
|
|
1
|
+
var _excluded = ["className", "children", "headerZindexLocation", "maskRef"];
|
|
2
2
|
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
|
|
@@ -30,12 +30,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
30
30
|
*/
|
|
31
31
|
import React, { useEffect, useState } from 'react';
|
|
32
32
|
import PropTypes from "prop-types";
|
|
33
|
-
import
|
|
33
|
+
import { cx } from '@emotion/css';
|
|
34
34
|
import { Global } from '@emotion/react';
|
|
35
35
|
import { keysOf } from '../common';
|
|
36
36
|
import { useCombinedRefs, useEuiTheme } from '../../services';
|
|
37
37
|
import { EuiPortal } from '../portal';
|
|
38
|
-
import { euiOverlayMaskStyles
|
|
38
|
+
import { euiOverlayMaskStyles } from './overlay_mask.styles';
|
|
39
|
+
import { euiOverlayMaskBodyStyles } from './overlay_mask_body.styles';
|
|
39
40
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
40
41
|
export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
41
42
|
var className = _ref.className,
|
|
@@ -43,7 +44,6 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
43
44
|
_ref$headerZindexLoca = _ref.headerZindexLocation,
|
|
44
45
|
headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
|
|
45
46
|
maskRef = _ref.maskRef,
|
|
46
|
-
css = _ref.css,
|
|
47
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
48
|
|
|
49
49
|
var _useState = useState(null),
|
|
@@ -54,7 +54,7 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
54
54
|
var combinedMaskRef = useCombinedRefs([setOverlayMaskNode, maskRef]);
|
|
55
55
|
var euiTheme = useEuiTheme();
|
|
56
56
|
var styles = euiOverlayMaskStyles(euiTheme);
|
|
57
|
-
var cssStyles = [styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]];
|
|
57
|
+
var cssStyles = cx([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]]);
|
|
58
58
|
useEffect(function () {
|
|
59
59
|
if (!overlayMaskNode) return;
|
|
60
60
|
keysOf(rest).forEach(function (key) {
|
|
@@ -70,22 +70,16 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
|
|
|
70
70
|
|
|
71
71
|
useEffect(function () {
|
|
72
72
|
if (!overlayMaskNode) return;
|
|
73
|
-
overlayMaskNode.className =
|
|
74
|
-
|
|
73
|
+
overlayMaskNode.className = cx('euiOverlayMask', cssStyles, className);
|
|
74
|
+
overlayMaskNode.dataset.relativeToHeader = headerZindexLocation;
|
|
75
|
+
}, [overlayMaskNode, className, cssStyles, headerZindexLocation]);
|
|
75
76
|
return ___EmotionJSX(EuiPortal, {
|
|
76
77
|
portalRef: combinedMaskRef
|
|
77
78
|
}, ___EmotionJSX(Global, {
|
|
78
79
|
styles: euiOverlayMaskBodyStyles
|
|
79
|
-
}), ___EmotionJSX(Global, {
|
|
80
|
-
styles: cssStyles
|
|
81
80
|
}), children);
|
|
82
81
|
};
|
|
83
82
|
EuiOverlayMask.propTypes = {
|
|
84
|
-
className: PropTypes.string,
|
|
85
|
-
"aria-label": PropTypes.string,
|
|
86
|
-
"data-test-subj": PropTypes.string,
|
|
87
|
-
css: PropTypes.any,
|
|
88
|
-
|
|
89
83
|
/**
|
|
90
84
|
* ReactNode to render as this component's content
|
|
91
85
|
*/
|
|
@@ -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
|
+
};
|
|
@@ -149,15 +149,12 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
149
149
|
React.Children.toArray(children).forEach(function (child, index) {
|
|
150
150
|
if (! /*#__PURE__*/React.isValidElement(child)) return; // Skip non-components
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
sidebar.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
default:
|
|
160
|
-
sections.push(child);
|
|
152
|
+
if (child.type === EuiPageSidebar || child.props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__ === EuiPageSidebar) {
|
|
153
|
+
sidebar.push( /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({
|
|
154
|
+
key: "sidebar".concat(index)
|
|
155
|
+
}, getSideBarProps()), child.props)));
|
|
156
|
+
} else {
|
|
157
|
+
sections.push(child);
|
|
161
158
|
}
|
|
162
159
|
});
|
|
163
160
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
3
|
import { css as _css } from "@emotion/react";
|
|
4
|
-
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"];
|
|
4
|
+
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"];
|
|
5
5
|
|
|
6
6
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
7
|
|
|
@@ -419,7 +419,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
419
419
|
}, {
|
|
420
420
|
key: "render",
|
|
421
421
|
value: function render() {
|
|
422
|
-
var
|
|
422
|
+
var _panelProps$tabIndex,
|
|
423
|
+
_this4 = this;
|
|
423
424
|
|
|
424
425
|
var _this$props = this.props,
|
|
425
426
|
anchorClassName = _this$props.anchorClassName,
|
|
@@ -442,6 +443,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
442
443
|
hasArrow = _this$props.hasArrow,
|
|
443
444
|
arrowChildren = _this$props.arrowChildren,
|
|
444
445
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
446
|
+
hasDragDrop = _this$props.hasDragDrop,
|
|
445
447
|
zIndex = _this$props.zIndex,
|
|
446
448
|
attachToAnchor = _this$props.attachToAnchor,
|
|
447
449
|
display = _this$props.display,
|
|
@@ -454,9 +456,10 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
454
456
|
container = _this$props.container,
|
|
455
457
|
focusTrapProps = _this$props.focusTrapProps,
|
|
456
458
|
initialFocusProp = _this$props.initialFocus,
|
|
457
|
-
|
|
459
|
+
_tabIndexProp = _this$props.tabIndex,
|
|
458
460
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
459
461
|
|
|
462
|
+
var tabIndexProp = (_panelProps$tabIndex = panelProps === null || panelProps === void 0 ? void 0 : panelProps.tabIndex) !== null && _panelProps$tabIndex !== void 0 ? _panelProps$tabIndex : _tabIndexProp;
|
|
460
463
|
var styles = euiPopoverStyles();
|
|
461
464
|
var popoverStyles = [styles.euiPopover, {
|
|
462
465
|
display: display
|
|
@@ -520,6 +523,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
520
523
|
position: this.state.arrowPosition,
|
|
521
524
|
isAttached: attachToAnchor,
|
|
522
525
|
className: classNames(panelClassName, panelProps === null || panelProps === void 0 ? void 0 : panelProps.className),
|
|
526
|
+
hasDragDrop: hasDragDrop,
|
|
523
527
|
hasShadow: false,
|
|
524
528
|
paddingSize: panelPaddingSize,
|
|
525
529
|
tabIndex: tabIndex,
|
|
@@ -738,6 +742,12 @@ EuiPopover.propTypes = {
|
|
|
738
742
|
*/
|
|
739
743
|
repositionOnScroll: PropTypes.bool,
|
|
740
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Must be set to true if using `EuiDragDropContext` within a popover,
|
|
747
|
+
* otherwise your nested drag & drop will have incorrect positioning
|
|
748
|
+
*/
|
|
749
|
+
hasDragDrop: PropTypes.bool,
|
|
750
|
+
|
|
741
751
|
/**
|
|
742
752
|
* By default, popover content inherits the z-index of the anchor
|
|
743
753
|
* component; pass `zIndex` to override
|
|
@@ -28,6 +28,7 @@ export var EuiPopoverArrow = function EuiPopoverArrow(_ref) {
|
|
|
28
28
|
var styles = euiPopoverArrowStyles(euiTheme);
|
|
29
29
|
var cssStyles = [styles.euiPopoverArrow, styles[position]];
|
|
30
30
|
return ___EmotionJSX("div", _extends({
|
|
31
|
+
className: "euiPopover__arrow",
|
|
31
32
|
"data-popover-arrow": position,
|
|
32
33
|
css: cssStyles
|
|
33
34
|
}, rest), children);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "isOpen", "isAttached", "position"];
|
|
1
|
+
var _excluded = ["children", "className", "isOpen", "isAttached", "hasDragDrop", "position"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -45,6 +45,7 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
45
45
|
className = _ref.className,
|
|
46
46
|
isOpen = _ref.isOpen,
|
|
47
47
|
isAttached = _ref.isAttached,
|
|
48
|
+
hasDragDrop = _ref.hasDragDrop,
|
|
48
49
|
position = _ref.position,
|
|
49
50
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
51
|
|
|
@@ -60,6 +61,10 @@ export var EuiPopoverPanel = function EuiPopoverPanel(_ref) {
|
|
|
60
61
|
panelCSS = [].concat(_toConsumableArray(panelCSS), [isOpen && styles.attached.isOpen, position && styles.attached[position]]);
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
if (hasDragDrop) {
|
|
65
|
+
panelCSS = [].concat(_toConsumableArray(panelCSS), [styles.hasDragDrop.hasDragDrop, position && styles.hasDragDrop[position]]);
|
|
66
|
+
}
|
|
67
|
+
|
|
63
68
|
return ___EmotionJSX(EuiPopoverPanelContext.Provider, {
|
|
64
69
|
value: panelContext
|
|
65
70
|
}, ___EmotionJSX(EuiPanel, _extends({
|
|
@@ -111,5 +116,6 @@ EuiPopoverPanel.propTypes = {
|
|
|
111
116
|
css: PropTypes.any,
|
|
112
117
|
isOpen: PropTypes.bool,
|
|
113
118
|
isAttached: PropTypes.bool,
|
|
114
|
-
position: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([null])])
|
|
119
|
+
position: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([null])]),
|
|
120
|
+
hasDragDrop: PropTypes.bool
|
|
115
121
|
};
|
|
@@ -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
|
|
|
@@ -45,7 +45,7 @@ export var sizesOnly = function sizesOnly(panelObject) {
|
|
|
45
45
|
|
|
46
46
|
var _getPanelMinSize = function _getPanelMinSize(panelMinSize, containerSize) {
|
|
47
47
|
var panelMinSizePercent = 0;
|
|
48
|
-
var panelMinSizeInt =
|
|
48
|
+
var panelMinSizeInt = parseFloat(panelMinSize);
|
|
49
49
|
|
|
50
50
|
if (panelMinSize.indexOf('px') > -1) {
|
|
51
51
|
panelMinSizePercent = pxToPercent(panelMinSizeInt, containerSize);
|
|
@@ -75,7 +75,7 @@ var getSiblingPanel = function getSiblingPanel(element, adjacency) {
|
|
|
75
75
|
var sibling = element[method];
|
|
76
76
|
|
|
77
77
|
while (sibling) {
|
|
78
|
-
if (sibling.matches('.euiResizablePanel:not(
|
|
78
|
+
if (sibling.matches('.euiResizablePanel:not([data-collapsed])')) {
|
|
79
79
|
return sibling;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -40,11 +40,8 @@ import { EuiResizableContainerContextProvider } from './context';
|
|
|
40
40
|
import { euiResizableButtonWithControls } from './resizable_button';
|
|
41
41
|
import { euiResizablePanelWithControls, getModeType } from './resizable_panel';
|
|
42
42
|
import { useContainerCallbacks, getPosition } from './helpers';
|
|
43
|
+
import { euiResizableContainerStyles } from './resizable_container.styles';
|
|
43
44
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
44
|
-
var containerDirections = {
|
|
45
|
-
vertical: 'vertical',
|
|
46
|
-
horizontal: 'horizontal'
|
|
47
|
-
};
|
|
48
45
|
var initialState = {
|
|
49
46
|
isDragging: false,
|
|
50
47
|
currentResizerPos: -1,
|
|
@@ -66,11 +63,10 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
66
63
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
67
64
|
|
|
68
65
|
var containerRef = useRef(null);
|
|
69
|
-
var isHorizontal = direction ===
|
|
70
|
-
var classes = classNames('euiResizableContainer',
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, className);
|
|
66
|
+
var isHorizontal = direction === 'horizontal';
|
|
67
|
+
var classes = classNames('euiResizableContainer', className);
|
|
68
|
+
var styles = euiResizableContainerStyles();
|
|
69
|
+
var cssStyles = [styles.euiResizableContainer, styles[direction]];
|
|
74
70
|
|
|
75
71
|
var _useContainerCallback = useContainerCallbacks({
|
|
76
72
|
initialState: _objectSpread(_objectSpread({}, initialState), {}, {
|
|
@@ -243,6 +239,7 @@ export var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
243
239
|
resizers: reducerState.resizers
|
|
244
240
|
}
|
|
245
241
|
}, ___EmotionJSX("div", _extends({
|
|
242
|
+
css: cssStyles,
|
|
246
243
|
className: classes,
|
|
247
244
|
ref: containerRef,
|
|
248
245
|
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
|
+
};
|
|
@@ -25,20 +25,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|
|
25
25
|
*/
|
|
26
26
|
import React, { useEffect, useMemo, useRef } from 'react';
|
|
27
27
|
import classNames from 'classnames';
|
|
28
|
+
import { useGeneratedHtmlId, useEuiTheme } from '../../services';
|
|
29
|
+
import { logicalSizeStyle, euiPaddingSize } from '../../global_styling';
|
|
28
30
|
import { useEuiResizableContainerContext } from './context';
|
|
29
|
-
import { useGeneratedHtmlId } from '../../services';
|
|
30
31
|
import { EuiPanel } from '../panel';
|
|
31
32
|
import { useEuiI18n } from '../i18n';
|
|
32
33
|
import { EuiResizableCollapseButton } from './resizable_collapse_button';
|
|
34
|
+
import { euiResizablePanelStyles, euiResizablePanelContentStyles } from './resizable_panel.styles';
|
|
33
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
34
|
-
var panelPaddingValues = {
|
|
35
|
-
none: 0,
|
|
36
|
-
xs: 4,
|
|
37
|
-
s: 8,
|
|
38
|
-
m: 16,
|
|
39
|
-
l: 24,
|
|
40
|
-
xl: 32
|
|
41
|
-
};
|
|
42
36
|
var defaultToggleOptions = {
|
|
43
37
|
className: null,
|
|
44
38
|
'data-test-subj': undefined,
|
|
@@ -50,12 +44,6 @@ export var getModeType = function getModeType(mode) {
|
|
|
50
44
|
export var getToggleOptions = function getToggleOptions(mode) {
|
|
51
45
|
return _typeof(mode) === 'object' ? _objectSpread(_objectSpread({}, defaultToggleOptions), mode[1]) : defaultToggleOptions;
|
|
52
46
|
};
|
|
53
|
-
var paddingSizeToClassNameMap = {
|
|
54
|
-
none: null,
|
|
55
|
-
s: 'euiResizablePanel--paddingSmall',
|
|
56
|
-
m: 'euiResizablePanel--paddingMedium',
|
|
57
|
-
l: 'euiResizablePanel--paddingLarge'
|
|
58
|
-
};
|
|
59
47
|
|
|
60
48
|
var getPosition = function getPosition(ref) {
|
|
61
49
|
var position = 'middle';
|
|
@@ -162,34 +150,18 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
162
150
|
|
|
163
151
|
return direction;
|
|
164
152
|
}, [isCollapsed, isCollapsible, position, panels, panelId]);
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
var dimensions;
|
|
178
|
-
|
|
179
|
-
if (size) {
|
|
180
|
-
dimensions = {
|
|
181
|
-
width: isHorizontal ? "".concat(size, "%") : '100%',
|
|
182
|
-
height: isHorizontal ? 'auto' : "".concat(size, "%")
|
|
183
|
-
};
|
|
184
|
-
} else {
|
|
185
|
-
dimensions = {
|
|
186
|
-
width: isHorizontal ? "".concat(innerSize, "%") : '100%',
|
|
187
|
-
height: isHorizontal ? 'auto' : "".concat(innerSize, "%")
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
var styles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), dimensions);
|
|
192
|
-
|
|
153
|
+
var axis = isHorizontal ? 'horizontal' : 'vertical';
|
|
154
|
+
var euiTheme = useEuiTheme();
|
|
155
|
+
var styles = euiResizablePanelStyles(euiTheme);
|
|
156
|
+
var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding]];
|
|
157
|
+
var contentStyles = euiResizablePanelContentStyles(euiTheme);
|
|
158
|
+
var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
|
|
159
|
+
var classes = classNames('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
|
|
160
|
+
var panelClasses = classNames('euiResizablePanel__content', className);
|
|
161
|
+
|
|
162
|
+
var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? logicalSizeStyle("".concat(size || innerSize, "%"), 'auto') : logicalSizeStyle('100%', "".concat(size || innerSize, "%")));
|
|
163
|
+
|
|
164
|
+
var padding = euiPaddingSize(euiTheme, paddingSize) || '0px';
|
|
193
165
|
useEffect(function () {
|
|
194
166
|
if (!registration) return;
|
|
195
167
|
var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
|
|
@@ -241,7 +213,7 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
241
213
|
theResizer = resizers[resizerIds.current[0]];
|
|
242
214
|
theToggle = ___EmotionJSX(EuiResizableCollapseButton, {
|
|
243
215
|
externalPosition: "before",
|
|
244
|
-
direction:
|
|
216
|
+
direction: axis,
|
|
245
217
|
isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
|
|
246
218
|
isCollapsed: theResizer && theResizer.isDisabled,
|
|
247
219
|
internalPosition: toggleOpts.position,
|
|
@@ -253,7 +225,7 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
253
225
|
theResizer = resizers[resizerIds.current[1]];
|
|
254
226
|
theToggle = ___EmotionJSX(EuiResizableCollapseButton, {
|
|
255
227
|
externalPosition: "after",
|
|
256
|
-
direction:
|
|
228
|
+
direction: axis,
|
|
257
229
|
isVisible: theResizer && (theResizer.isFocused || theResizer.isDisabled),
|
|
258
230
|
isCollapsed: theResizer && theResizer.isDisabled,
|
|
259
231
|
internalPosition: toggleOpts.position,
|
|
@@ -263,12 +235,17 @@ export var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
263
235
|
});
|
|
264
236
|
}
|
|
265
237
|
|
|
266
|
-
return ___EmotionJSX("div", _extends({
|
|
238
|
+
return ___EmotionJSX("div", _extends({
|
|
239
|
+
css: cssStyles
|
|
240
|
+
}, wrapperProps, {
|
|
267
241
|
id: panelId,
|
|
268
242
|
ref: divRef,
|
|
269
|
-
style:
|
|
270
|
-
className: classes
|
|
243
|
+
style: inlineStyles,
|
|
244
|
+
className: classes,
|
|
245
|
+
"data-collapsed": isCollapsed || undefined,
|
|
246
|
+
"data-position": position
|
|
271
247
|
}), hasVisibleToggle && hasLeftToggle && theToggle, ___EmotionJSX(EuiPanel, _extends({
|
|
248
|
+
css: contentCssStyles,
|
|
272
249
|
className: panelClasses,
|
|
273
250
|
hasShadow: hasShadow,
|
|
274
251
|
borderRadius: borderRadius,
|