@elastic/eui 62.0.2 → 62.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +1 -783
- package/dist/eui_theme_dark.json +0 -57
- package/dist/eui_theme_dark.json.d.ts +0 -57
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +1 -783
- package/dist/eui_theme_light.json +0 -57
- package/dist/eui_theme_light.json.d.ts +0 -57
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/breadcrumb.js +199 -0
- package/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
- package/es/components/breadcrumbs/breadcrumbs.js +115 -187
- package/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
- package/es/components/code/code_block.js +119 -107
- package/es/components/collapsible_nav/collapsible_nav.js +2 -2
- package/es/components/control_bar/control_bar.js +13 -0
- package/es/components/datagrid/body/data_grid_body.js +12 -2
- package/es/components/datagrid/body/data_grid_cell.js +31 -3
- package/es/components/datagrid/body/header/data_grid_header_row.js +1 -1
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/data_grid.js +10 -2
- package/es/components/datagrid/utils/row_heights.js +33 -4
- package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/es/components/description_list/description_list.js +22 -26
- package/es/components/description_list/description_list.styles.js +25 -0
- package/es/components/description_list/description_list_context.js +14 -0
- package/es/components/description_list/description_list_description.js +43 -2
- package/es/components/description_list/description_list_description.styles.js +47 -0
- package/es/components/description_list/description_list_title.js +43 -2
- package/es/components/description_list/description_list_title.styles.js +37 -0
- package/es/components/description_list/description_list_types.js +10 -0
- package/es/components/header/header.js +1 -27
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +22 -2
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
- package/es/components/header/header_links/header_links.js +9 -9
- package/es/components/icon/assets/tokenStruct.js +1 -1
- package/es/components/page/page_header/page_header.js +1 -0
- package/es/components/page/page_header/page_header_content.js +2 -1
- package/es/components/page/page_template.js +1 -0
- package/es/components/pagination/pagination.js +1 -1
- package/es/components/panel/split_panel/split_panel.js +2 -2
- package/es/components/popover/wrapping_popover.js +88 -45
- package/es/components/portal/portal.js +84 -38
- package/es/components/provider/provider.js +2 -2
- package/es/components/responsive/hide_for.js +6 -38
- package/es/components/responsive/show_for.js +6 -38
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +17 -36
- package/es/components/side_nav/side_nav.js +1 -1
- package/es/components/table/table_row_cell.js +1 -2
- package/es/components/toast/global_toast_list.js +208 -241
- package/es/components/toast/global_toast_list.styles.js +38 -0
- package/es/components/toast/global_toast_list_item.js +12 -7
- package/es/components/toast/toast.js +25 -25
- package/es/components/toast/toast.styles.js +55 -0
- package/es/components/token/index.js +2 -1
- package/es/components/token/token.js +48 -112
- package/es/components/token/token.styles.js +93 -0
- package/es/components/token/token_map.js +6 -9
- package/es/components/token/token_types.js +11 -0
- package/es/global_styling/reset/global_styles.js +1 -1
- package/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
- package/es/services/{hooks/useIsWithinBreakpoints.js → breakpoint/currentEuiBreakpoint.js} +36 -28
- package/es/services/breakpoint/index.js +10 -0
- package/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
- package/es/services/hooks/index.js +0 -1
- package/es/services/index.js +1 -1
- package/es/test/rtl/component_helpers.js +60 -1
- package/eui.d.ts +1787 -1550
- package/i18ntokens.json +36 -36
- package/lib/components/breadcrumbs/breadcrumb.js +225 -0
- package/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
- package/lib/components/breadcrumbs/breadcrumbs.js +125 -188
- package/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
- package/lib/components/code/code_block.js +118 -106
- package/lib/components/collapsible_nav/collapsible_nav.js +2 -2
- package/lib/components/control_bar/control_bar.js +13 -0
- package/lib/components/datagrid/body/data_grid_body.js +12 -2
- package/lib/components/datagrid/body/data_grid_cell.js +31 -3
- package/lib/components/datagrid/body/header/data_grid_header_row.js +1 -1
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/data_grid.js +10 -2
- package/lib/components/datagrid/utils/row_heights.js +33 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/lib/components/description_list/description_list.js +25 -31
- package/lib/components/description_list/description_list.styles.js +36 -0
- package/lib/components/description_list/description_list_context.js +24 -0
- package/lib/components/description_list/description_list_description.js +52 -2
- package/lib/components/description_list/description_list_description.styles.js +51 -0
- package/lib/components/description_list/description_list_title.js +52 -2
- package/lib/components/description_list/description_list_title.styles.js +50 -0
- package/lib/components/description_list/description_list_types.js +20 -0
- package/lib/components/header/header.js +1 -27
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
- package/lib/components/header/header_links/header_links.js +8 -8
- package/lib/components/icon/assets/tokenStruct.js +1 -1
- package/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
- package/lib/components/page/page_header/page_header.js +1 -0
- package/lib/components/page/page_header/page_header_content.js +3 -2
- package/lib/components/page/page_template.js +1 -0
- package/lib/components/pagination/pagination.js +1 -1
- package/lib/components/panel/split_panel/split_panel.js +3 -3
- package/lib/components/popover/wrapping_popover.js +85 -44
- package/lib/components/portal/portal.js +87 -39
- package/lib/components/provider/provider.js +1 -1
- package/lib/components/responsive/hide_for.js +12 -44
- package/lib/components/responsive/show_for.js +12 -44
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
- package/lib/components/side_nav/side_nav.js +1 -1
- package/lib/components/table/table_row_cell.js +1 -3
- package/lib/components/toast/global_toast_list.js +209 -238
- package/lib/components/toast/global_toast_list.styles.js +45 -0
- package/lib/components/toast/global_toast_list_item.js +14 -7
- package/lib/components/toast/toast.js +27 -25
- package/lib/components/toast/toast.styles.js +66 -0
- package/lib/components/token/index.js +5 -3
- package/lib/components/token/token.js +50 -120
- package/lib/components/token/token.styles.js +101 -0
- package/lib/components/token/token_map.js +6 -9
- package/lib/components/token/token_types.js +22 -0
- package/lib/global_styling/reset/global_styles.js +1 -1
- package/{test-env/services → lib/services/breakpoint}/breakpoint.js +5 -9
- package/lib/services/breakpoint/currentEuiBreakpoint.js +80 -0
- package/lib/services/breakpoint/index.js +44 -0
- package/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
- package/lib/services/hooks/index.js +0 -13
- package/lib/services/index.js +28 -0
- package/lib/test/rtl/component_helpers.js +69 -3
- package/optimize/es/components/breadcrumbs/breadcrumb.js +136 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +61 -0
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +92 -165
- package/optimize/es/components/breadcrumbs/breadcrumbs.styles.js +30 -0
- package/optimize/es/components/code/code_block.js +106 -107
- package/optimize/es/components/datagrid/body/data_grid_body.js +2 -0
- package/optimize/es/components/datagrid/body/data_grid_cell.js +13 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +33 -4
- package/optimize/es/components/description_list/description_list.js +20 -24
- package/optimize/es/components/description_list/description_list.styles.js +25 -0
- package/optimize/es/components/description_list/description_list_context.js +14 -0
- package/optimize/es/components/description_list/description_list_description.js +32 -2
- package/optimize/es/components/description_list/description_list_description.styles.js +47 -0
- package/optimize/es/components/description_list/description_list_title.js +32 -2
- package/optimize/es/components/description_list/description_list_title.styles.js +37 -0
- package/optimize/es/components/description_list/description_list_types.js +10 -0
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +8 -1
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +15 -0
- package/optimize/es/components/header/header_links/header_links.js +8 -8
- package/optimize/es/components/icon/assets/tokenStruct.js +1 -1
- package/optimize/es/components/page/page_header/page_header_content.js +1 -1
- package/optimize/es/components/panel/split_panel/split_panel.js +1 -1
- package/optimize/es/components/popover/wrapping_popover.js +79 -38
- package/optimize/es/components/portal/portal.js +66 -34
- package/optimize/es/components/provider/provider.js +2 -2
- package/optimize/es/components/responsive/hide_for.js +5 -27
- package/optimize/es/components/responsive/show_for.js +5 -27
- package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.js +16 -35
- package/optimize/es/components/table/table_row_cell.js +1 -2
- package/optimize/es/components/toast/global_toast_list.js +199 -230
- package/optimize/es/components/toast/global_toast_list.styles.js +38 -0
- package/optimize/es/components/toast/global_toast_list_item.js +11 -6
- package/optimize/es/components/toast/toast.js +24 -24
- package/optimize/es/components/toast/toast.styles.js +55 -0
- package/optimize/es/components/token/index.js +2 -1
- package/optimize/es/components/token/token.js +46 -69
- package/optimize/es/components/token/token.styles.js +83 -0
- package/optimize/es/components/token/token_map.js +6 -9
- package/optimize/es/components/token/token_types.js +11 -0
- package/optimize/es/global_styling/reset/global_styles.js +1 -1
- package/optimize/es/services/{breakpoint.js → breakpoint/breakpoint.js} +4 -9
- package/optimize/es/services/breakpoint/currentEuiBreakpoint.js +53 -0
- package/optimize/es/services/breakpoint/index.js +10 -0
- package/optimize/es/services/breakpoint/useIsWithinBreakpoints.js +24 -0
- package/optimize/es/services/hooks/index.js +0 -1
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/test/rtl/component_helpers.js +60 -1
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +162 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +68 -0
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +99 -164
- package/optimize/lib/components/breadcrumbs/breadcrumbs.styles.js +33 -0
- package/optimize/lib/components/code/code_block.js +105 -106
- package/optimize/lib/components/datagrid/body/data_grid_body.js +2 -0
- package/optimize/lib/components/datagrid/body/data_grid_cell.js +13 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +33 -4
- package/optimize/lib/components/description_list/description_list.js +23 -28
- package/optimize/lib/components/description_list/description_list.styles.js +36 -0
- package/optimize/lib/components/description_list/description_list_context.js +24 -0
- package/optimize/lib/components/description_list/description_list_description.js +43 -2
- package/optimize/lib/components/description_list/description_list_description.styles.js +51 -0
- package/optimize/lib/components/description_list/description_list_title.js +43 -2
- package/optimize/lib/components/description_list/description_list_title.styles.js +50 -0
- package/optimize/lib/components/description_list/description_list_types.js +20 -0
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +10 -1
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
- package/optimize/lib/components/header/header_links/header_links.js +7 -7
- package/optimize/lib/components/icon/assets/tokenStruct.js +1 -1
- package/optimize/lib/components/icon/svgs/tokens/tokenStruct.svg +1 -1
- package/optimize/lib/components/page/page_header/page_header_content.js +2 -2
- package/optimize/lib/components/panel/split_panel/split_panel.js +2 -2
- package/optimize/lib/components/popover/wrapping_popover.js +78 -38
- package/optimize/lib/components/portal/portal.js +65 -44
- package/optimize/lib/components/provider/provider.js +1 -1
- package/optimize/lib/components/responsive/hide_for.js +4 -33
- package/optimize/lib/components/responsive/show_for.js +4 -33
- package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +14 -34
- package/optimize/lib/components/table/table_row_cell.js +1 -3
- package/optimize/lib/components/toast/global_toast_list.js +206 -220
- package/optimize/lib/components/toast/global_toast_list.styles.js +47 -0
- package/optimize/lib/components/toast/global_toast_list_item.js +14 -7
- package/optimize/lib/components/toast/toast.js +26 -24
- package/optimize/lib/components/toast/toast.styles.js +66 -0
- package/optimize/lib/components/token/index.js +5 -3
- package/optimize/lib/components/token/token.js +50 -76
- package/optimize/lib/components/token/token.styles.js +91 -0
- package/optimize/lib/components/token/token_map.js +6 -9
- package/optimize/lib/components/token/token_types.js +22 -0
- package/optimize/lib/global_styling/reset/global_styles.js +1 -1
- package/optimize/lib/services/{breakpoint.js → breakpoint/breakpoint.js} +5 -9
- package/optimize/lib/services/breakpoint/currentEuiBreakpoint.js +81 -0
- package/optimize/lib/services/breakpoint/index.js +44 -0
- package/optimize/lib/services/breakpoint/useIsWithinBreakpoints.js +34 -0
- package/optimize/lib/services/hooks/index.js +0 -13
- package/optimize/lib/services/index.js +28 -0
- package/optimize/lib/test/rtl/component_helpers.js +69 -3
- package/package.json +2 -2
- package/src/components/control_bar/_control_bar.scss +1 -1
- package/src/components/header/_index.scss +0 -1
- package/src/components/index.scss +0 -5
- package/src/themes/amsterdam/overrides/_breadcrumbs.scss +0 -12
- package/src/themes/amsterdam/overrides/_index.scss +0 -4
- package/test-env/components/breadcrumbs/breadcrumb.js +211 -0
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +68 -0
- package/test-env/components/breadcrumbs/breadcrumbs.js +122 -174
- package/test-env/components/breadcrumbs/breadcrumbs.styles.js +33 -0
- package/test-env/components/collapsible_nav/collapsible_nav.js +2 -2
- package/test-env/components/control_bar/control_bar.js +13 -0
- package/test-env/components/datagrid/body/data_grid_body.js +12 -2
- package/test-env/components/datagrid/body/data_grid_cell.js +31 -3
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/data_grid.js +10 -2
- package/test-env/components/datagrid/utils/row_heights.js +33 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/test-env/components/description_list/description_list.js +25 -30
- package/test-env/components/description_list/description_list.styles.js +36 -0
- package/test-env/components/description_list/description_list_context.js +24 -0
- package/test-env/components/description_list/description_list_description.js +43 -2
- package/test-env/components/description_list/description_list_description.styles.js +51 -0
- package/test-env/components/description_list/description_list_title.js +43 -2
- package/test-env/components/description_list/description_list_title.styles.js +50 -0
- package/test-env/components/description_list/description_list_types.js +20 -0
- package/test-env/components/header/header.js +1 -27
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +24 -2
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.styles.js +26 -0
- package/test-env/components/header/header_links/header_links.js +8 -8
- package/test-env/components/icon/assets/tokenStruct.js +1 -1
- package/test-env/components/observer/resize_observer/resize_observer.js +43 -126
- package/test-env/components/page/page_header/page_header.js +1 -0
- package/test-env/components/page/page_header/page_header_content.js +3 -2
- package/test-env/components/page/page_template.js +1 -0
- package/test-env/components/pagination/pagination.js +1 -1
- package/test-env/components/panel/split_panel/split_panel.js +3 -3
- package/test-env/components/popover/wrapping_popover.js +78 -38
- package/test-env/components/portal/portal.js +79 -45
- package/test-env/components/provider/provider.js +1 -1
- package/test-env/components/responsive/hide_for.js +5 -34
- package/test-env/components/responsive/show_for.js +5 -34
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +15 -35
- package/test-env/components/side_nav/side_nav.js +1 -1
- package/test-env/components/table/table_row_cell.js +1 -3
- package/test-env/components/toast/global_toast_list.js +206 -220
- package/test-env/components/toast/global_toast_list.styles.js +47 -0
- package/test-env/components/toast/global_toast_list_item.js +14 -7
- package/test-env/components/toast/toast.js +27 -25
- package/test-env/components/toast/toast.styles.js +66 -0
- package/test-env/components/token/index.js +5 -3
- package/test-env/components/token/token.js +51 -120
- package/test-env/components/token/token.styles.js +91 -0
- package/test-env/components/token/token_map.js +6 -9
- package/test-env/components/token/token_types.js +22 -0
- package/test-env/global_styling/reset/global_styles.js +1 -1
- package/{lib/services → test-env/services/breakpoint}/breakpoint.js +5 -9
- package/test-env/services/breakpoint/currentEuiBreakpoint.js +37 -0
- package/test-env/services/breakpoint/index.js +44 -0
- package/test-env/services/breakpoint/useIsWithinBreakpoints.js +34 -0
- package/test-env/services/hooks/index.js +0 -13
- package/test-env/services/index.js +28 -0
- package/test-env/test/rtl/component_helpers.js +69 -3
- package/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
- package/optimize/es/services/hooks/useIsWithinBreakpoints.js +0 -46
- package/optimize/lib/services/hooks/useIsWithinBreakpoints.js +0 -57
- package/src/components/breadcrumbs/_breadcrumbs.scss +0 -79
- package/src/components/breadcrumbs/_index.scss +0 -2
- package/src/components/breadcrumbs/_variables.scss +0 -2
- package/src/components/description_list/_description_list.scss +0 -211
- package/src/components/description_list/_index.scss +0 -1
- package/src/components/header/header_breadcrumbs/_header_breadcrumbs.scss +0 -8
- package/src/components/header/header_breadcrumbs/_index.scss +0 -1
- package/src/components/portal/_index.scss +0 -1
- package/src/components/portal/_portal.scss +0 -6
- package/src/components/toast/_global_toast_list.scss +0 -90
- package/src/components/toast/_index.scss +0 -4
- package/src/components/toast/_toast.scss +0 -103
- package/src/components/token/_index.scss +0 -2
- package/src/components/token/_token.scss +0 -85
- package/src/components/token/_variables.scss +0 -13
- package/src/themes/amsterdam/overrides/_header_breadcrumbs.scss +0 -71
- package/src/themes/amsterdam/overrides/_toast.scss +0 -21
- package/src/themes/amsterdam/overrides/_token.scss +0 -4
- package/test-env/services/hooks/useIsWithinBreakpoints.js +0 -57
|
@@ -1,22 +1,34 @@
|
|
|
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
|
+
|
|
1
3
|
var _excluded = ["button"];
|
|
2
4
|
|
|
3
5
|
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
6
|
|
|
5
|
-
function
|
|
7
|
+
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
8
|
|
|
7
|
-
function
|
|
9
|
+
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; }
|
|
8
10
|
|
|
9
|
-
function
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
12
|
|
|
11
|
-
function
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
12
14
|
|
|
13
|
-
function
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
14
16
|
|
|
15
|
-
function
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
16
18
|
|
|
17
|
-
function
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
18
20
|
|
|
19
|
-
function
|
|
21
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
22
|
+
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
24
|
+
|
|
25
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
+
|
|
27
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
+
|
|
29
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
|
+
|
|
31
|
+
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; }
|
|
20
32
|
|
|
21
33
|
/*
|
|
22
34
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -25,7 +37,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
25
37
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
38
|
* Side Public License, v 1.
|
|
27
39
|
*/
|
|
28
|
-
import React, {
|
|
40
|
+
import React, { Component } from 'react';
|
|
29
41
|
import PropTypes from "prop-types";
|
|
30
42
|
import { EuiPopover } from './popover';
|
|
31
43
|
import { EuiPortal } from '../portal';
|
|
@@ -36,46 +48,77 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
|
36
48
|
* then the button element is moved into the popover dom.
|
|
37
49
|
* On unmount, the button is moved back to its original location.
|
|
38
50
|
*/
|
|
39
|
-
export var EuiWrappingPopover = function
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
setPortal = _useState4[1];
|
|
52
|
-
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
if (anchor) {
|
|
55
|
-
// move the button into the popover DOM
|
|
56
|
-
anchor.insertAdjacentElement('beforebegin', button);
|
|
51
|
+
export var EuiWrappingPopover = /*#__PURE__*/function (_Component) {
|
|
52
|
+
_inherits(EuiWrappingPopover, _Component);
|
|
53
|
+
|
|
54
|
+
var _super = _createSuper(EuiWrappingPopover);
|
|
55
|
+
|
|
56
|
+
function EuiWrappingPopover() {
|
|
57
|
+
var _this;
|
|
58
|
+
|
|
59
|
+
_classCallCheck(this, EuiWrappingPopover);
|
|
60
|
+
|
|
61
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
62
|
+
args[_key] = arguments[_key];
|
|
57
63
|
}
|
|
58
64
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
66
|
+
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "portal", null);
|
|
68
|
+
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "anchor", null);
|
|
70
|
+
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "setPortalRef", function (node) {
|
|
72
|
+
_this.portal = node;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "setAnchorRef", function (node) {
|
|
76
|
+
_this.anchor = node;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return _this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
_createClass(EuiWrappingPopover, [{
|
|
83
|
+
key: "componentDidMount",
|
|
84
|
+
value: function componentDidMount() {
|
|
85
|
+
if (this.anchor) {
|
|
86
|
+
this.anchor.insertAdjacentElement('beforebegin', this.props.button);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: "componentWillUnmount",
|
|
91
|
+
value: function componentWillUnmount() {
|
|
92
|
+
if (this.props.button.parentNode) {
|
|
93
|
+
if (this.portal) {
|
|
94
|
+
this.portal.insertAdjacentElement('beforebegin', this.props.button);
|
|
95
|
+
}
|
|
63
96
|
}
|
|
64
|
-
};
|
|
65
|
-
}, [anchor, button, portal]);
|
|
66
|
-
return ___EmotionJSX(EuiPortal, {
|
|
67
|
-
portalRef: setPortal,
|
|
68
|
-
insert: {
|
|
69
|
-
sibling: button,
|
|
70
|
-
position: 'after'
|
|
71
97
|
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
98
|
+
}, {
|
|
99
|
+
key: "render",
|
|
100
|
+
value: function render() {
|
|
101
|
+
var _this$props = this.props,
|
|
102
|
+
button = _this$props.button,
|
|
103
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
104
|
+
|
|
105
|
+
return ___EmotionJSX(EuiPortal, {
|
|
106
|
+
portalRef: this.setPortalRef,
|
|
107
|
+
insert: {
|
|
108
|
+
sibling: this.props.button,
|
|
109
|
+
position: 'after'
|
|
110
|
+
}
|
|
111
|
+
}, ___EmotionJSX(EuiPopover, _extends({}, rest, {
|
|
112
|
+
button: ___EmotionJSX("div", {
|
|
113
|
+
ref: this.setAnchorRef,
|
|
114
|
+
className: "euiWrappingPopover__anchor"
|
|
115
|
+
})
|
|
116
|
+
})));
|
|
117
|
+
}
|
|
118
|
+
}]);
|
|
119
|
+
|
|
120
|
+
return EuiWrappingPopover;
|
|
121
|
+
}(Component);
|
|
79
122
|
EuiWrappingPopover.propTypes = {
|
|
80
123
|
button: PropTypes.any.isRequired
|
|
81
124
|
};
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
function
|
|
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
|
-
function
|
|
3
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8
8
|
|
|
9
|
-
function
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
|
+
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
|
+
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
12
24
|
|
|
13
25
|
/*
|
|
14
26
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -22,54 +34,88 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
22
34
|
* NOTE: We can't test this component because Enzyme doesn't support rendering
|
|
23
35
|
* into portals.
|
|
24
36
|
*/
|
|
25
|
-
import {
|
|
37
|
+
import { Component } from 'react';
|
|
38
|
+
import PropTypes from "prop-types";
|
|
26
39
|
import { createPortal } from 'react-dom';
|
|
27
40
|
import { keysOf } from '../common';
|
|
28
|
-
import { useUpdateEffect } from '../../services';
|
|
29
41
|
export var insertPositions = {
|
|
30
42
|
after: 'afterend',
|
|
31
43
|
before: 'beforebegin'
|
|
32
44
|
};
|
|
33
45
|
export var INSERT_POSITIONS = keysOf(insertPositions);
|
|
34
|
-
export var EuiPortal = function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
export var EuiPortal = /*#__PURE__*/function (_Component) {
|
|
47
|
+
_inherits(EuiPortal, _Component);
|
|
48
|
+
|
|
49
|
+
var _super = _createSuper(EuiPortal);
|
|
50
|
+
|
|
51
|
+
function EuiPortal(props) {
|
|
52
|
+
var _this;
|
|
53
|
+
|
|
54
|
+
_classCallCheck(this, EuiPortal);
|
|
38
55
|
|
|
39
|
-
|
|
40
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
-
portalNode = _useState2[0],
|
|
42
|
-
setPortalNode = _useState2[1]; // pull `sibling` and `position` out of insert in case their wrapping object is recreated every render
|
|
56
|
+
_this = _super.call(this, props);
|
|
43
57
|
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "portalNode", null);
|
|
44
59
|
|
|
45
|
-
|
|
46
|
-
sibling = _ref2.sibling,
|
|
47
|
-
position = _ref2.position;
|
|
60
|
+
if (typeof window === 'undefined') return _possibleConstructorReturn(_this); // Prevent SSR errors
|
|
48
61
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
portalNode.dataset.euiportal = 'true';
|
|
52
|
-
setPortalNode(portalNode);
|
|
62
|
+
var insert = _this.props.insert;
|
|
63
|
+
_this.portalNode = document.createElement('div');
|
|
64
|
+
_this.portalNode.dataset.euiportal = 'true';
|
|
53
65
|
|
|
54
|
-
if (
|
|
66
|
+
if (insert == null) {
|
|
55
67
|
// no insertion defined, append to body
|
|
56
|
-
document.body.appendChild(portalNode);
|
|
68
|
+
document.body.appendChild(_this.portalNode);
|
|
57
69
|
} else {
|
|
58
70
|
// inserting before or after an element
|
|
59
|
-
sibling.
|
|
71
|
+
var sibling = insert.sibling,
|
|
72
|
+
position = insert.position;
|
|
73
|
+
sibling.insertAdjacentElement(insertPositions[position], _this.portalNode);
|
|
60
74
|
}
|
|
61
75
|
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
76
|
+
return _this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
_createClass(EuiPortal, [{
|
|
80
|
+
key: "componentDidMount",
|
|
81
|
+
value: function componentDidMount() {
|
|
82
|
+
this.updatePortalRef(this.portalNode);
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "componentWillUnmount",
|
|
86
|
+
value: function componentWillUnmount() {
|
|
87
|
+
var _this$portalNode;
|
|
88
|
+
|
|
89
|
+
if ((_this$portalNode = this.portalNode) !== null && _this$portalNode !== void 0 && _this$portalNode.parentNode) {
|
|
90
|
+
this.portalNode.parentNode.removeChild(this.portalNode);
|
|
65
91
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
92
|
+
|
|
93
|
+
this.updatePortalRef(null);
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "updatePortalRef",
|
|
97
|
+
value: function updatePortalRef(ref) {
|
|
98
|
+
if (this.props.portalRef) {
|
|
99
|
+
this.props.portalRef(ref);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "render",
|
|
104
|
+
value: function render() {
|
|
105
|
+
return this.portalNode ? /*#__PURE__*/createPortal(this.props.children, this.portalNode) : null;
|
|
106
|
+
}
|
|
107
|
+
}]);
|
|
108
|
+
|
|
109
|
+
return EuiPortal;
|
|
110
|
+
}(Component);
|
|
111
|
+
EuiPortal.propTypes = {
|
|
112
|
+
/**
|
|
113
|
+
* ReactNode to render as this component's content
|
|
114
|
+
*/
|
|
115
|
+
children: PropTypes.node.isRequired,
|
|
116
|
+
insert: PropTypes.shape({
|
|
117
|
+
sibling: PropTypes.any.isRequired,
|
|
118
|
+
position: PropTypes.oneOf(["before", "after"]).isRequired
|
|
119
|
+
}),
|
|
120
|
+
portalRef: PropTypes.func
|
|
75
121
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
|
|
10
10
|
import { EuiUtilityClasses } from '../../global_styling/utility/utility';
|
|
11
|
-
import { EuiThemeProvider } from '../../services';
|
|
11
|
+
import { EuiThemeProvider, CurrentEuiBreakpointProvider } from '../../services';
|
|
12
12
|
import { EuiThemeAmsterdam } from '../../themes';
|
|
13
13
|
import { EuiCacheProvider } from './cache';
|
|
14
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -54,5 +54,5 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
54
54
|
}), ___EmotionJSX(EuiCacheProvider, {
|
|
55
55
|
cache: utilityCache,
|
|
56
56
|
children: Utilities && ___EmotionJSX(Utilities, null)
|
|
57
|
-
})), children));
|
|
57
|
+
})), ___EmotionJSX(CurrentEuiBreakpointProvider, null, children)));
|
|
58
58
|
};
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
/*
|
|
14
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,37 +5,17 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
17
5
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
6
|
* Side Public License, v 1.
|
|
19
7
|
*/
|
|
20
|
-
import React
|
|
8
|
+
import React from 'react';
|
|
21
9
|
import PropTypes from "prop-types";
|
|
22
|
-
import {
|
|
23
|
-
import { getBreakpoint } from '../../services/breakpoint';
|
|
10
|
+
import { useCurrentEuiBreakpoint } from '../../services';
|
|
24
11
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
12
|
export var EuiHideFor = function EuiHideFor(_ref) {
|
|
26
13
|
var children = _ref.children,
|
|
27
14
|
sizes = _ref.sizes;
|
|
15
|
+
var currentBreakpoint = useCurrentEuiBreakpoint();
|
|
16
|
+
var isWithinBreakpointSizes = currentBreakpoint && sizes.includes(currentBreakpoint);
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
currentBreakpoint = _useState2[0],
|
|
32
|
-
setCurrentBreakpoint = _useState2[1];
|
|
33
|
-
|
|
34
|
-
var functionToCallOnWindowResize = throttle(function () {
|
|
35
|
-
var newBreakpoint = getBreakpoint(window.innerWidth);
|
|
36
|
-
|
|
37
|
-
if (newBreakpoint !== currentBreakpoint) {
|
|
38
|
-
setCurrentBreakpoint(newBreakpoint);
|
|
39
|
-
} // reacts every 50ms to resize changes and always gets the final update
|
|
40
|
-
|
|
41
|
-
}, 50); // Add window resize handlers
|
|
42
|
-
|
|
43
|
-
useEffect(function () {
|
|
44
|
-
window.addEventListener('resize', functionToCallOnWindowResize);
|
|
45
|
-
return function () {
|
|
46
|
-
window.removeEventListener('resize', functionToCallOnWindowResize);
|
|
47
|
-
};
|
|
48
|
-
}, [functionToCallOnWindowResize]);
|
|
49
|
-
|
|
50
|
-
if (sizes === 'all' || sizes.includes(currentBreakpoint)) {
|
|
18
|
+
if (sizes === 'all' || isWithinBreakpointSizes) {
|
|
51
19
|
return null;
|
|
52
20
|
}
|
|
53
21
|
|
|
@@ -63,5 +31,5 @@ EuiHideFor.propTypes = {
|
|
|
63
31
|
* List of all the responsive sizes to hide the children for.
|
|
64
32
|
* Array of #EuiBreakpointSize
|
|
65
33
|
*/
|
|
66
|
-
sizes: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.
|
|
34
|
+
sizes: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.any.isRequired).isRequired, PropTypes.oneOf(["all", "none"])]).isRequired
|
|
67
35
|
};
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
/*
|
|
14
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,37 +5,17 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
17
5
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
6
|
* Side Public License, v 1.
|
|
19
7
|
*/
|
|
20
|
-
import React
|
|
8
|
+
import React from 'react';
|
|
21
9
|
import PropTypes from "prop-types";
|
|
22
|
-
import {
|
|
23
|
-
import { getBreakpoint } from '../../services/breakpoint';
|
|
10
|
+
import { useCurrentEuiBreakpoint } from '../../services';
|
|
24
11
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
12
|
export var EuiShowFor = function EuiShowFor(_ref) {
|
|
26
13
|
var children = _ref.children,
|
|
27
14
|
sizes = _ref.sizes;
|
|
15
|
+
var currentBreakpoint = useCurrentEuiBreakpoint();
|
|
16
|
+
var isWithinBreakpointSizes = currentBreakpoint && sizes.includes(currentBreakpoint);
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
-
currentBreakpoint = _useState2[0],
|
|
32
|
-
setCurrentBreakpoint = _useState2[1];
|
|
33
|
-
|
|
34
|
-
var functionToCallOnWindowResize = throttle(function () {
|
|
35
|
-
var newBreakpoint = getBreakpoint(window.innerWidth);
|
|
36
|
-
|
|
37
|
-
if (newBreakpoint !== currentBreakpoint) {
|
|
38
|
-
setCurrentBreakpoint(newBreakpoint);
|
|
39
|
-
} // reacts every 50ms to resize changes and always gets the final update
|
|
40
|
-
|
|
41
|
-
}, 50); // Add window resize handlers
|
|
42
|
-
|
|
43
|
-
useEffect(function () {
|
|
44
|
-
window.addEventListener('resize', functionToCallOnWindowResize);
|
|
45
|
-
return function () {
|
|
46
|
-
window.removeEventListener('resize', functionToCallOnWindowResize);
|
|
47
|
-
};
|
|
48
|
-
}, [sizes, functionToCallOnWindowResize]);
|
|
49
|
-
|
|
50
|
-
if (sizes === 'all' || sizes.includes(currentBreakpoint)) {
|
|
18
|
+
if (sizes === 'all' || isWithinBreakpointSizes) {
|
|
51
19
|
return ___EmotionJSX(React.Fragment, null, children);
|
|
52
20
|
}
|
|
53
21
|
|
|
@@ -63,5 +31,5 @@ EuiShowFor.propTypes = {
|
|
|
63
31
|
* List of all the responsive sizes to show the children for.
|
|
64
32
|
* Array of #EuiBreakpointSize
|
|
65
33
|
*/
|
|
66
|
-
sizes: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.
|
|
34
|
+
sizes: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.any.isRequired).isRequired, PropTypes.oneOf(["all", "none"])]).isRequired
|
|
67
35
|
};
|
|
@@ -32,10 +32,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
32
32
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
33
33
|
* Side Public License, v 1.
|
|
34
34
|
*/
|
|
35
|
-
import React, { useState,
|
|
35
|
+
import React, { useState, useMemo } from 'react';
|
|
36
36
|
import PropTypes from "prop-types";
|
|
37
37
|
import classNames from 'classnames';
|
|
38
|
-
import { useCombinedRefs,
|
|
38
|
+
import { useCombinedRefs, useCurrentEuiBreakpoint } from '../../../services';
|
|
39
39
|
import { EuiSelectable } from '../selectable';
|
|
40
40
|
import { EuiPopoverTitle, EuiPopoverFooter } from '../../popover';
|
|
41
41
|
import { EuiPopover } from '../../popover/popover';
|
|
@@ -43,7 +43,6 @@ import { useEuiI18n, EuiI18n } from '../../i18n';
|
|
|
43
43
|
import { EuiSelectableMessage } from '../selectable_message';
|
|
44
44
|
import { EuiLoadingSpinner } from '../../loading';
|
|
45
45
|
import { euiSelectableTemplateSitewideFormatOptions, euiSelectableTemplateSitewideRenderOptions } from './selectable_template_sitewide_option';
|
|
46
|
-
import { isWithinBreakpoints } from '../../../services/breakpoint';
|
|
47
46
|
import { EuiSpacer } from '../../spacer';
|
|
48
47
|
import { ENTER } from '../../../services/keys';
|
|
49
48
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -61,33 +60,9 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
61
60
|
popoverButtonBreakpoints = _ref.popoverButtonBreakpoints,
|
|
62
61
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
63
62
|
|
|
64
|
-
/**
|
|
65
|
-
* Breakpoint management
|
|
66
|
-
*/
|
|
67
|
-
var _useState = useState(typeof window !== 'undefined' && popoverButtonBreakpoints ? isWithinBreakpoints(window.innerWidth, popoverButtonBreakpoints) : true),
|
|
68
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
69
|
-
canShowPopoverButton = _useState2[0],
|
|
70
|
-
setCanShowPopoverButton = _useState2[1];
|
|
71
|
-
|
|
72
|
-
var functionToCallOnWindowResize = throttle(function () {
|
|
73
|
-
var newWidthIsWithinBreakpoint = popoverButtonBreakpoints ? isWithinBreakpoints(window.innerWidth, popoverButtonBreakpoints) : true;
|
|
74
|
-
|
|
75
|
-
if (newWidthIsWithinBreakpoint !== canShowPopoverButton) {
|
|
76
|
-
setCanShowPopoverButton(newWidthIsWithinBreakpoint);
|
|
77
|
-
} // reacts every 50ms to resize changes and always gets the final update
|
|
78
|
-
|
|
79
|
-
}, 50); // Add window resize handlers
|
|
80
|
-
|
|
81
|
-
useEffect(function () {
|
|
82
|
-
window.addEventListener('resize', functionToCallOnWindowResize);
|
|
83
|
-
return function () {
|
|
84
|
-
window.removeEventListener('resize', functionToCallOnWindowResize);
|
|
85
|
-
};
|
|
86
|
-
}, [functionToCallOnWindowResize]);
|
|
87
63
|
/**
|
|
88
64
|
* i18n text
|
|
89
65
|
*/
|
|
90
|
-
|
|
91
66
|
var _useEuiI18n = useEuiI18n(['euiSelectableTemplateSitewide.searchPlaceholder'], ['Search for anything...']),
|
|
92
67
|
_useEuiI18n2 = _slicedToArray(_useEuiI18n, 1),
|
|
93
68
|
searchPlaceholder = _useEuiI18n2[0];
|
|
@@ -96,15 +71,15 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
96
71
|
*/
|
|
97
72
|
|
|
98
73
|
|
|
99
|
-
var
|
|
100
|
-
|
|
101
|
-
popoverRef =
|
|
102
|
-
setPopoverRef =
|
|
74
|
+
var _useState = useState(null),
|
|
75
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
76
|
+
popoverRef = _useState2[0],
|
|
77
|
+
setPopoverRef = _useState2[1];
|
|
103
78
|
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
popoverIsOpen =
|
|
107
|
-
setPopoverIsOpen =
|
|
79
|
+
var _useState3 = useState(false),
|
|
80
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
81
|
+
popoverIsOpen = _useState4[0],
|
|
82
|
+
setPopoverIsOpen = _useState4[1];
|
|
108
83
|
|
|
109
84
|
var _popoverProps = _objectSpread({}, popoverProps),
|
|
110
85
|
_closePopover = _popoverProps.closePopover,
|
|
@@ -201,6 +176,12 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
201
176
|
*/
|
|
202
177
|
|
|
203
178
|
|
|
179
|
+
var currentBreakpoint = useCurrentEuiBreakpoint();
|
|
180
|
+
var canShowPopoverButton = useMemo(function () {
|
|
181
|
+
if (!popoverButtonBreakpoints) return true;
|
|
182
|
+
if (!currentBreakpoint) return false;
|
|
183
|
+
return popoverButtonBreakpoints.includes(currentBreakpoint);
|
|
184
|
+
}, [currentBreakpoint, popoverButtonBreakpoints]);
|
|
204
185
|
var popoverTrigger;
|
|
205
186
|
|
|
206
187
|
if (popoverButton && canShowPopoverButton) {
|
|
@@ -477,5 +458,5 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
477
458
|
* Pass an array of named breakpoints for which to show the `popoverButton`.
|
|
478
459
|
* If `undefined`, the `popoverButton` will always show (if provided)
|
|
479
460
|
*/
|
|
480
|
-
popoverButtonBreakpoints: PropTypes.arrayOf(PropTypes.
|
|
461
|
+
popoverButtonBreakpoints: PropTypes.arrayOf(PropTypes.any.isRequired)
|
|
481
462
|
};
|
|
@@ -285,7 +285,7 @@ EuiSideNav.propTypes = {
|
|
|
285
285
|
* Array of breakpoint names for when to show the mobile version.
|
|
286
286
|
* Set to `undefined` to remove responsive behavior
|
|
287
287
|
*/
|
|
288
|
-
mobileBreakpoints: PropTypes.arrayOf(PropTypes.
|
|
288
|
+
mobileBreakpoints: PropTypes.arrayOf(PropTypes.any.isRequired),
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
291
|
* An array of #EuiSideNavItem objects. Lists navigation menu items.
|
|
@@ -22,9 +22,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
22
22
|
import React, { Fragment } from 'react';
|
|
23
23
|
import PropTypes from "prop-types";
|
|
24
24
|
import classNames from 'classnames';
|
|
25
|
-
import { LEFT_ALIGNMENT, RIGHT_ALIGNMENT, CENTER_ALIGNMENT } from '../../services';
|
|
25
|
+
import { LEFT_ALIGNMENT, RIGHT_ALIGNMENT, CENTER_ALIGNMENT, useIsWithinBreakpoints } from '../../services';
|
|
26
26
|
import { resolveWidthAsStyle } from './utils';
|
|
27
|
-
import { useIsWithinBreakpoints } from '../../services/hooks/useIsWithinBreakpoints';
|
|
28
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
28
|
export var EuiTableRowCell = function EuiTableRowCell(_ref) {
|
|
30
29
|
var _mobileOptions$showOn, _mobileOptions$trunca;
|