@elastic/eui 62.2.0 → 62.2.3

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.
Files changed (34) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/es/components/basic_table/collapsed_item_actions.js +1 -2
  4. package/es/components/description_list/description_list_description.js +2 -1
  5. package/es/components/description_list/description_list_title.js +2 -1
  6. package/es/services/breakpoint/{currentEuiBreakpoint.js → current_breakpoint.js} +2 -12
  7. package/es/services/breakpoint/current_breakpoint_hook.js +20 -0
  8. package/es/services/breakpoint/index.js +2 -1
  9. package/es/services/breakpoint/useIsWithinBreakpoints.js +1 -1
  10. package/eui.d.ts +15 -150
  11. package/i18ntokens.json +4 -4
  12. package/lib/components/basic_table/collapsed_item_actions.js +1 -2
  13. package/lib/services/breakpoint/{currentEuiBreakpoint.js → current_breakpoint.js} +5 -16
  14. package/lib/services/breakpoint/current_breakpoint_hook.js +31 -0
  15. package/lib/services/breakpoint/index.js +17 -4
  16. package/lib/services/breakpoint/useIsWithinBreakpoints.js +2 -2
  17. package/optimize/es/components/basic_table/collapsed_item_actions.js +1 -2
  18. package/optimize/es/components/description_list/description_list_description.js +2 -1
  19. package/optimize/es/components/description_list/description_list_title.js +2 -1
  20. package/optimize/es/services/breakpoint/{currentEuiBreakpoint.js → current_breakpoint.js} +2 -11
  21. package/optimize/es/services/breakpoint/current_breakpoint_hook.js +20 -0
  22. package/optimize/es/services/breakpoint/index.js +2 -1
  23. package/optimize/es/services/breakpoint/useIsWithinBreakpoints.js +1 -1
  24. package/optimize/lib/components/basic_table/collapsed_item_actions.js +1 -2
  25. package/optimize/lib/services/breakpoint/{currentEuiBreakpoint.js → current_breakpoint.js} +5 -18
  26. package/optimize/lib/services/breakpoint/current_breakpoint_hook.js +31 -0
  27. package/optimize/lib/services/breakpoint/index.js +17 -4
  28. package/optimize/lib/services/breakpoint/useIsWithinBreakpoints.js +2 -2
  29. package/package.json +1 -1
  30. package/test-env/components/basic_table/collapsed_item_actions.js +1 -2
  31. package/test-env/services/breakpoint/current_breakpoint.js +68 -0
  32. package/test-env/services/breakpoint/{currentEuiBreakpoint.js → current_breakpoint_hook.js} +3 -7
  33. package/test-env/services/breakpoint/index.js +17 -4
  34. package/test-env/services/breakpoint/useIsWithinBreakpoints.js +2 -2
@@ -94,8 +94,7 @@ export var CollapsedItemActions = /*#__PURE__*/function (_Component) {
94
94
  _defineProperty(_assertThisInitialized(_this), "registerPopoverDiv", function (popoverDiv) {
95
95
  if (!_this.popoverDiv) {
96
96
  _this.popoverDiv = popoverDiv;
97
-
98
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
97
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
99
98
  }
100
99
  });
101
100
 
@@ -30,7 +30,8 @@ import PropTypes from "prop-types";
30
30
  import classNames from 'classnames';
31
31
  import { useEuiTheme } from '../../services';
32
32
  import { euiDescriptionListDescriptionStyles } from './description_list_description.styles';
33
- import { EuiDescriptionListContext } from './description_list_context';
33
+ import { EuiDescriptionListContext } from './description_list_context'; // Export required for correct inference by HOCs
34
+
34
35
  import { jsx as ___EmotionJSX } from "@emotion/react";
35
36
  export var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref) {
36
37
  var children = _ref.children,
@@ -30,7 +30,8 @@ import PropTypes from "prop-types";
30
30
  import classNames from 'classnames';
31
31
  import { useEuiTheme } from '../../services';
32
32
  import { euiDescriptionListTitleStyles } from './description_list_title.styles';
33
- import { EuiDescriptionListContext } from './description_list_context';
33
+ import { EuiDescriptionListContext } from './description_list_context'; // Export required for correct inference by HOCs
34
+
34
35
  import { jsx as ___EmotionJSX } from "@emotion/react";
35
36
  export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
36
37
  var children = _ref.children,
@@ -1,5 +1,3 @@
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
-
3
1
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
2
 
5
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."); }
@@ -19,7 +17,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
17
  * in compliance with, at your election, the Elastic License 2.0 or the Server
20
18
  * Side Public License, v 1.
21
19
  */
22
- import React, { createContext, useContext, useState, useEffect } from 'react';
20
+ import React, { createContext, useState, useEffect } from 'react';
23
21
  import { useEuiTheme } from '../theme';
24
22
  import { throttle } from '../throttle';
25
23
  import { getBreakpoint } from './breakpoint';
@@ -36,7 +34,7 @@ export var CurrentEuiBreakpointProvider = function CurrentEuiBreakpointProvider(
36
34
  var _useEuiTheme = useEuiTheme(),
37
35
  breakpoints = _useEuiTheme.euiTheme.breakpoint;
38
36
 
39
- var _useState = useState((typeof window === "undefined" ? "undefined" : _typeof(window)) !== undefined ? getBreakpoint(window.innerWidth, breakpoints) : undefined),
37
+ var _useState = useState(typeof window !== 'undefined' ? getBreakpoint(window.innerWidth, breakpoints) : undefined),
40
38
  _useState2 = _slicedToArray(_useState, 2),
41
39
  currentBreakpoint = _useState2[0],
42
40
  setCurrentBreakpoint = _useState2[1];
@@ -53,12 +51,4 @@ export var CurrentEuiBreakpointProvider = function CurrentEuiBreakpointProvider(
53
51
  return ___EmotionJSX(CurrentEuiBreakpointContext.Provider, {
54
52
  value: currentBreakpoint
55
53
  }, children);
56
- };
57
- /**
58
- * Hook util / syntactical sugar
59
- */
60
-
61
- export var useCurrentEuiBreakpoint = function useCurrentEuiBreakpoint() {
62
- var currentBreakpoint = useContext(CurrentEuiBreakpointContext);
63
- return currentBreakpoint;
64
54
  };
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { useContext } from 'react';
9
+ import { CurrentEuiBreakpointContext } from './current_breakpoint';
10
+ /**
11
+ * Hook util / syntactical sugar for useContext()
12
+ *
13
+ * This hook is in its own separate file to make mocking it
14
+ * as a testenv easy for Jest unit tests
15
+ */
16
+
17
+ export var useCurrentEuiBreakpoint = function useCurrentEuiBreakpoint() {
18
+ var currentBreakpoint = useContext(CurrentEuiBreakpointContext);
19
+ return currentBreakpoint;
20
+ };
@@ -6,5 +6,6 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  export * from './breakpoint';
9
- export * from './currentEuiBreakpoint';
9
+ export * from './current_breakpoint';
10
+ export * from './current_breakpoint_hook';
10
11
  export * from './useIsWithinBreakpoints';
@@ -5,7 +5,7 @@
5
5
  * in compliance with, at your election, the Elastic License 2.0 or the Server
6
6
  * Side Public License, v 1.
7
7
  */
8
- import { useCurrentEuiBreakpoint } from './currentEuiBreakpoint';
8
+ import { useCurrentEuiBreakpoint } from './current_breakpoint_hook';
9
9
  /**
10
10
  * Given the current window.innerWidth and an array of breakpoint keys,
11
11
  * this hook stores state and returns true or false if the window.innerWidth
package/eui.d.ts CHANGED
@@ -6652,7 +6652,7 @@ declare module '@elastic/eui/src/services/throttle' {
6652
6652
  export const throttle: (fn: (...args: any[]) => void, wait?: number) => (...args: any[]) => void;
6653
6653
 
6654
6654
  }
6655
- declare module '@elastic/eui/src/services/breakpoint/currentEuiBreakpoint' {
6655
+ declare module '@elastic/eui/src/services/breakpoint/current_breakpoint' {
6656
6656
  import React, { FunctionComponent } from 'react';
6657
6657
  import { _EuiThemeBreakpoint } from '@elastic/eui/src/global_styling/variables/breakpoint'; type CurrentEuiBreakpoint = _EuiThemeBreakpoint | undefined;
6658
6658
  export const CurrentEuiBreakpointContext: React.Context<CurrentEuiBreakpoint>;
@@ -6661,11 +6661,17 @@ declare module '@elastic/eui/src/services/breakpoint/currentEuiBreakpoint' {
6661
6661
  * resize listener that returns the current breakpoint based on window width
6662
6662
  */
6663
6663
  export const CurrentEuiBreakpointProvider: FunctionComponent;
6664
+ export {};
6665
+
6666
+ }
6667
+ declare module '@elastic/eui/src/services/breakpoint/current_breakpoint_hook' {
6664
6668
  /**
6665
- * Hook util / syntactical sugar
6669
+ * Hook util / syntactical sugar for useContext()
6670
+ *
6671
+ * This hook is in its own separate file to make mocking it
6672
+ * as a testenv easy for Jest unit tests
6666
6673
  */
6667
- export const useCurrentEuiBreakpoint: () => CurrentEuiBreakpoint;
6668
- export {};
6674
+ export const useCurrentEuiBreakpoint: () => "s" | "xs" | "m" | "l" | "xl" | undefined;
6669
6675
 
6670
6676
  }
6671
6677
  declare module '@elastic/eui/src/services/breakpoint/useIsWithinBreakpoints' {
@@ -6685,7 +6691,8 @@ declare module '@elastic/eui/src/services/breakpoint/useIsWithinBreakpoints' {
6685
6691
  }
6686
6692
  declare module '@elastic/eui/src/services/breakpoint' {
6687
6693
  export * from '@elastic/eui/src/services/breakpoint/breakpoint';
6688
- export * from '@elastic/eui/src/services/breakpoint/currentEuiBreakpoint';
6694
+ export * from '@elastic/eui/src/services/breakpoint/current_breakpoint';
6695
+ export * from '@elastic/eui/src/services/breakpoint/current_breakpoint_hook';
6689
6696
  export * from '@elastic/eui/src/services/breakpoint/useIsWithinBreakpoints';
6690
6697
 
6691
6698
  }
@@ -12998,10 +13005,9 @@ declare module '@elastic/eui/src/components/description_list/description_list_co
12998
13005
  declare module '@elastic/eui/src/components/description_list/description_list_title' {
12999
13006
  import { HTMLAttributes, FunctionComponent } from 'react';
13000
13007
  import { CommonProps } from '@elastic/eui/src/components/common';
13001
- interface EuiDescriptionListTitleProps extends CommonProps, HTMLAttributes<HTMLElement> {
13008
+ export interface EuiDescriptionListTitleProps extends CommonProps, HTMLAttributes<HTMLElement> {
13002
13009
  }
13003
13010
  export const EuiDescriptionListTitle: FunctionComponent<EuiDescriptionListTitleProps>;
13004
- export {};
13005
13011
 
13006
13012
  }
13007
13013
  declare module '@elastic/eui/src/components/description_list/description_list_description.styles' {
@@ -13028,10 +13034,9 @@ declare module '@elastic/eui/src/components/description_list/description_list_de
13028
13034
  declare module '@elastic/eui/src/components/description_list/description_list_description' {
13029
13035
  import { HTMLAttributes, FunctionComponent } from 'react';
13030
13036
  import { CommonProps } from '@elastic/eui/src/components/common';
13031
- interface EuiDescriptionListDescriptionProps extends CommonProps, HTMLAttributes<HTMLElement> {
13037
+ export interface EuiDescriptionListDescriptionProps extends CommonProps, HTMLAttributes<HTMLElement> {
13032
13038
  }
13033
13039
  export const EuiDescriptionListDescription: FunctionComponent<EuiDescriptionListDescriptionProps>;
13034
- export {};
13035
13040
 
13036
13041
  }
13037
13042
  declare module '@elastic/eui/src/components/description_list/description_list.styles' {
@@ -18110,7 +18115,7 @@ declare module '@elastic/eui/src/components/basic_table/collapsed_item_actions'
18110
18115
  togglePopover: () => void;
18111
18116
  closePopover: () => void;
18112
18117
  onPopoverBlur: () => void;
18113
- registerPopoverDiv: (popoverDiv: HTMLDivElement) => void;
18118
+ registerPopoverDiv: (popoverDiv: HTMLDivElement | null) => void;
18114
18119
  componentWillUnmount(): void;
18115
18120
  onClickItem: (onClickAction: (() => void) | undefined) => void;
18116
18121
  render(): JSX.Element;
@@ -19061,56 +19066,6 @@ declare module '@elastic/eui' {
19061
19066
  export * from '@elastic/eui/src/themes';
19062
19067
  export * from '@elastic/eui/src/global_styling';
19063
19068
 
19064
- }
19065
- declare module '@elastic/eui/src/test/internal/render_with_styles' {
19066
- import { ReactElement } from 'react';
19067
- /**
19068
- * Use this function to add the `@emotion` Jest serializer to a single test.
19069
- * The resulting snapshot will include the styles of elements in the component that use `@emotion` for styling.
19070
- *
19071
- * This function must be run outside of a `test` block:
19072
-
19073
- ```
19074
- describe('EuiMark', () => {
19075
- renderWithStyles(<EuiMark>Marked</EuiMark>);
19076
-
19077
- test('is rendered', () => {});
19078
- });
19079
- ```
19080
- */
19081
- export const renderWithStyles: (component: ReactElement) => never;
19082
-
19083
- }
19084
- declare module '@elastic/eui/src/test/internal/render_custom_styles' {
19085
- import { ReactElement } from 'react';
19086
- /**
19087
- * Use this test helper to quickly check that the component supports custom
19088
- * `className`, `css`, and `style` properties.
19089
- *
19090
- * Example usage:
19091
- *
19092
- * shouldRenderCustomStyles(<EuiMark {...requiredProps} />Marked</EuiMark>);
19093
- */
19094
- export const shouldRenderCustomStyles: (component: ReactElement) => void;
19095
-
19096
- }
19097
- declare module '@elastic/eui/src/test/internal/test_custom_hook' {
19098
-
19099
- export const HookWrapper: (props: {
19100
- hook?: Function;
19101
- }) => JSX.Element;
19102
- export const testCustomHook: <T>(hook?: Function | undefined, args?: unknown) => {
19103
- return: T;
19104
- getUpdatedState: () => T;
19105
- updateHookArgs: (args: unknown) => void;
19106
- };
19107
-
19108
- }
19109
- declare module '@elastic/eui/src/test/internal' {
19110
- export * from '@elastic/eui/src/test/internal/render_with_styles';
19111
- export * from '@elastic/eui/src/test/internal/render_custom_styles';
19112
- export * from '@elastic/eui/src/test/internal/test_custom_hook';
19113
-
19114
19069
  }
19115
19070
  declare module '@elastic/eui/src/components/icon/assets/videoPlayer' {
19116
19071
  import * as React from 'react';
@@ -23655,96 +23610,6 @@ declare module 'mdast-util-to-hast/lib/all' {
23655
23610
  const all: (h: H, node: Node) => Node[];
23656
23611
  export = all;
23657
23612
  }
23658
- declare module '@elastic/eui/src/test/rtl/component_helpers' {
23659
- import '@testing-library/jest-dom';
23660
- /**
23661
- * Ensure the EuiPopover being tested is open/closed before continuing
23662
- * Note: Because EuiPopover is portalled, we want to query `document`
23663
- * instead of the `container` returned by RTL's render()
23664
- */
23665
- export const waitForEuiPopoverOpen: () => Promise<void>;
23666
- export const waitForEuiPopoverClose: () => Promise<void>;
23667
- /**
23668
- * Ensure the EuiToolTip being tested is open and visible before continuing
23669
- */
23670
- export const waitForEuiToolTipVisible: () => Promise<void>;
23671
- export const waitForEuiToolTipHidden: () => Promise<void>;
23672
-
23673
- }
23674
- declare module '@elastic/eui/src/test/rtl/data_test_subj_queries' {
23675
- import { queryHelpers, Matcher, MatcherOptions } from '@testing-library/react'; const queryAllByTestSubject: (container: HTMLElement, id: Matcher, options?: MatcherOptions | undefined) => HTMLElement[]; const queryByTestSubject: queryHelpers.QueryBy<[Matcher]>, getAllByTestSubject: queryHelpers.GetAllBy<[Matcher]>, getByTestSubject: queryHelpers.GetBy<[Matcher]>, findAllByTestSubject: queryHelpers.FindAllBy<[Matcher]>, findByTestSubject: queryHelpers.FindBy<[Matcher]>;
23676
- export { queryByTestSubject, queryAllByTestSubject, getByTestSubject, getAllByTestSubject, findAllByTestSubject, findByTestSubject, };
23677
-
23678
- }
23679
- declare module '@elastic/eui/src/test/rtl/custom_render' {
23680
- import { ReactElement } from 'react';
23681
- import { queries, RenderOptions, Screen } from '@testing-library/react';
23682
- import * as dataTestSubjQueries from '@elastic/eui/src/test/rtl/data_test_subj_queries'; const customRender: (ui: ReactElement, { queries: renderQueries, ...options }?: RenderOptions) => import("@testing-library/react").RenderResult<{
23683
- getByLabelText: typeof queries.getByLabelText;
23684
- getAllByLabelText: typeof queries.getAllByLabelText;
23685
- queryByLabelText: typeof queries.queryByLabelText;
23686
- queryAllByLabelText: typeof queries.queryAllByLabelText;
23687
- findByLabelText: typeof queries.findByLabelText;
23688
- findAllByLabelText: typeof queries.findAllByLabelText;
23689
- getByPlaceholderText: typeof queries.getByPlaceholderText;
23690
- getAllByPlaceholderText: typeof queries.getAllByPlaceholderText;
23691
- queryByPlaceholderText: typeof queries.queryByPlaceholderText;
23692
- queryAllByPlaceholderText: typeof queries.queryAllByPlaceholderText;
23693
- findByPlaceholderText: typeof queries.findByPlaceholderText;
23694
- findAllByPlaceholderText: typeof queries.findAllByPlaceholderText;
23695
- getByText: typeof queries.getByText;
23696
- getAllByText: typeof queries.getAllByText;
23697
- queryByText: typeof queries.queryByText;
23698
- queryAllByText: typeof queries.queryAllByText;
23699
- findByText: typeof queries.findByText;
23700
- findAllByText: typeof queries.findAllByText;
23701
- getByAltText: typeof queries.getByAltText;
23702
- getAllByAltText: typeof queries.getAllByAltText;
23703
- queryByAltText: typeof queries.queryByAltText;
23704
- queryAllByAltText: typeof queries.queryAllByAltText;
23705
- findByAltText: typeof queries.findByAltText;
23706
- findAllByAltText: typeof queries.findAllByAltText;
23707
- getByTitle: typeof queries.getByTitle;
23708
- getAllByTitle: typeof queries.getAllByTitle;
23709
- queryByTitle: typeof queries.queryByTitle;
23710
- queryAllByTitle: typeof queries.queryAllByTitle;
23711
- findByTitle: typeof queries.findByTitle;
23712
- findAllByTitle: typeof queries.findAllByTitle;
23713
- getByDisplayValue: typeof queries.getByDisplayValue;
23714
- getAllByDisplayValue: typeof queries.getAllByDisplayValue;
23715
- queryByDisplayValue: typeof queries.queryByDisplayValue;
23716
- queryAllByDisplayValue: typeof queries.queryAllByDisplayValue;
23717
- findByDisplayValue: typeof queries.findByDisplayValue;
23718
- findAllByDisplayValue: typeof queries.findAllByDisplayValue;
23719
- getByRole: typeof queries.getByRole;
23720
- getAllByRole: typeof queries.getAllByRole;
23721
- queryByRole: typeof queries.queryByRole;
23722
- queryAllByRole: typeof queries.queryAllByRole;
23723
- findByRole: typeof queries.findByRole;
23724
- findAllByRole: typeof queries.findAllByRole;
23725
- getByTestId: typeof queries.getByTestId;
23726
- getAllByTestId: typeof queries.getAllByTestId;
23727
- queryByTestId: typeof queries.queryByTestId;
23728
- queryAllByTestId: typeof queries.queryAllByTestId;
23729
- findByTestId: typeof queries.findByTestId;
23730
- findAllByTestId: typeof queries.findAllByTestId;
23731
- queryByTestSubject: import("@testing-library/react").QueryBy<[import("@testing-library/react").Matcher]>;
23732
- queryAllByTestSubject: (container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
23733
- getByTestSubject: import("@testing-library/react").GetBy<[import("@testing-library/react").Matcher]>;
23734
- getAllByTestSubject: import("@testing-library/react").GetAllBy<[import("@testing-library/react").Matcher]>;
23735
- findAllByTestSubject: import("@testing-library/react").FindAllBy<[import("@testing-library/react").Matcher]>;
23736
- findByTestSubject: import("@testing-library/react").FindBy<[import("@testing-library/react").Matcher]>;
23737
- }, HTMLElement, HTMLElement>;
23738
- export { customRender as render }; const customScreen: Screen<typeof queries & typeof dataTestSubjQueries>;
23739
- export { customScreen as screen };
23740
-
23741
- }
23742
- declare module '@elastic/eui/src/test/rtl' {
23743
- export * from '@elastic/eui/src/test/rtl/component_helpers';
23744
- export { queryByTestSubject, queryAllByTestSubject, getByTestSubject, getAllByTestSubject, findAllByTestSubject, findByTestSubject, } from '@elastic/eui/src/test/rtl/data_test_subj_queries';
23745
- export { render, screen } from '@elastic/eui/src/test/rtl/custom_render';
23746
-
23747
- }
23748
23613
  declare module '@elastic/eui/src/components/table/mobile' {
23749
23614
  export { EuiTableHeaderMobile } from '@elastic/eui/src/components/table/mobile/table_header_mobile';
23750
23615
  export type { EuiTableSortMobileProps } from '@elastic/eui/src/components/table/mobile/table_sort_mobile';
package/i18ntokens.json CHANGED
@@ -149,11 +149,11 @@
149
149
  "highlighting": "string",
150
150
  "loc": {
151
151
  "start": {
152
- "line": 169,
152
+ "line": 170,
153
153
  "column": 6
154
154
  },
155
155
  "end": {
156
- "line": 169,
156
+ "line": 170,
157
157
  "column": 80
158
158
  }
159
159
  },
@@ -165,11 +165,11 @@
165
165
  "highlighting": "string",
166
166
  "loc": {
167
167
  "start": {
168
- "line": 186,
168
+ "line": 187,
169
169
  "column": 6
170
170
  },
171
171
  "end": {
172
- "line": 186,
172
+ "line": 187,
173
173
  "column": 80
174
174
  }
175
175
  },
@@ -108,8 +108,7 @@ var CollapsedItemActions = /*#__PURE__*/function (_Component) {
108
108
  _defineProperty(_assertThisInitialized(_this), "registerPopoverDiv", function (popoverDiv) {
109
109
  if (!_this.popoverDiv) {
110
110
  _this.popoverDiv = popoverDiv;
111
-
112
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
111
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
113
112
  }
114
113
  });
115
114
 
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ 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); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports.useCurrentEuiBreakpoint = exports.CurrentEuiBreakpointProvider = exports.CurrentEuiBreakpointContext = void 0;
8
+ exports.CurrentEuiBreakpointProvider = exports.CurrentEuiBreakpointContext = void 0;
7
9
 
8
10
  var _react = _interopRequireWildcard(require("react"));
9
11
 
@@ -19,8 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
19
21
 
20
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
23
 
22
- 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); }
23
-
24
24
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
25
25
 
26
26
  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."); }
@@ -47,7 +47,7 @@ var CurrentEuiBreakpointProvider = function CurrentEuiBreakpointProvider(_ref) {
47
47
  var _useEuiTheme = (0, _theme.useEuiTheme)(),
48
48
  breakpoints = _useEuiTheme.euiTheme.breakpoint;
49
49
 
50
- var _useState = (0, _react.useState)((typeof window === "undefined" ? "undefined" : _typeof(window)) !== undefined ? (0, _breakpoint.getBreakpoint)(window.innerWidth, breakpoints) : undefined),
50
+ var _useState = (0, _react.useState)(typeof window !== 'undefined' ? (0, _breakpoint.getBreakpoint)(window.innerWidth, breakpoints) : undefined),
51
51
  _useState2 = _slicedToArray(_useState, 2),
52
52
  currentBreakpoint = _useState2[0],
53
53
  setCurrentBreakpoint = _useState2[1];
@@ -65,16 +65,5 @@ var CurrentEuiBreakpointProvider = function CurrentEuiBreakpointProvider(_ref) {
65
65
  value: currentBreakpoint
66
66
  }, children);
67
67
  };
68
- /**
69
- * Hook util / syntactical sugar
70
- */
71
-
72
-
73
- exports.CurrentEuiBreakpointProvider = CurrentEuiBreakpointProvider;
74
-
75
- var useCurrentEuiBreakpoint = function useCurrentEuiBreakpoint() {
76
- var currentBreakpoint = (0, _react.useContext)(CurrentEuiBreakpointContext);
77
- return currentBreakpoint;
78
- };
79
68
 
80
- exports.useCurrentEuiBreakpoint = useCurrentEuiBreakpoint;
69
+ exports.CurrentEuiBreakpointProvider = CurrentEuiBreakpointProvider;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useCurrentEuiBreakpoint = void 0;
7
+
8
+ var _react = require("react");
9
+
10
+ var _current_breakpoint = require("./current_breakpoint");
11
+
12
+ /*
13
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
+ * or more contributor license agreements. Licensed under the Elastic License
15
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
17
+ * Side Public License, v 1.
18
+ */
19
+
20
+ /**
21
+ * Hook util / syntactical sugar for useContext()
22
+ *
23
+ * This hook is in its own separate file to make mocking it
24
+ * as a testenv easy for Jest unit tests
25
+ */
26
+ var useCurrentEuiBreakpoint = function useCurrentEuiBreakpoint() {
27
+ var currentBreakpoint = (0, _react.useContext)(_current_breakpoint.CurrentEuiBreakpointContext);
28
+ return currentBreakpoint;
29
+ };
30
+
31
+ exports.useCurrentEuiBreakpoint = useCurrentEuiBreakpoint;
@@ -17,15 +17,28 @@ Object.keys(_breakpoint).forEach(function (key) {
17
17
  });
18
18
  });
19
19
 
20
- var _currentEuiBreakpoint = require("./currentEuiBreakpoint");
20
+ var _current_breakpoint = require("./current_breakpoint");
21
21
 
22
- Object.keys(_currentEuiBreakpoint).forEach(function (key) {
22
+ Object.keys(_current_breakpoint).forEach(function (key) {
23
23
  if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _currentEuiBreakpoint[key]) return;
24
+ if (key in exports && exports[key] === _current_breakpoint[key]) return;
25
25
  Object.defineProperty(exports, key, {
26
26
  enumerable: true,
27
27
  get: function get() {
28
- return _currentEuiBreakpoint[key];
28
+ return _current_breakpoint[key];
29
+ }
30
+ });
31
+ });
32
+
33
+ var _current_breakpoint_hook = require("./current_breakpoint_hook");
34
+
35
+ Object.keys(_current_breakpoint_hook).forEach(function (key) {
36
+ if (key === "default" || key === "__esModule") return;
37
+ if (key in exports && exports[key] === _current_breakpoint_hook[key]) return;
38
+ Object.defineProperty(exports, key, {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _current_breakpoint_hook[key];
29
42
  }
30
43
  });
31
44
  });
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useIsWithinBreakpoints = void 0;
7
7
 
8
- var _currentEuiBreakpoint = require("./currentEuiBreakpoint");
8
+ var _current_breakpoint_hook = require("./current_breakpoint_hook");
9
9
 
10
10
  /*
11
11
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -27,7 +27,7 @@ var _currentEuiBreakpoint = require("./currentEuiBreakpoint");
27
27
  */
28
28
  var useIsWithinBreakpoints = function useIsWithinBreakpoints(sizes) {
29
29
  var isResponsive = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
30
- var currentBreakpoint = (0, _currentEuiBreakpoint.useCurrentEuiBreakpoint)();
30
+ var currentBreakpoint = (0, _current_breakpoint_hook.useCurrentEuiBreakpoint)();
31
31
  return currentBreakpoint && isResponsive ? sizes.includes(currentBreakpoint) : false;
32
32
  };
33
33
 
@@ -81,8 +81,7 @@ export var CollapsedItemActions = /*#__PURE__*/function (_Component) {
81
81
  _defineProperty(_assertThisInitialized(_this), "registerPopoverDiv", function (popoverDiv) {
82
82
  if (!_this.popoverDiv) {
83
83
  _this.popoverDiv = popoverDiv;
84
-
85
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
84
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
86
85
  }
87
86
  });
88
87
 
@@ -14,7 +14,8 @@ import React, { useContext } from 'react';
14
14
  import classNames from 'classnames';
15
15
  import { useEuiTheme } from '../../services';
16
16
  import { euiDescriptionListDescriptionStyles } from './description_list_description.styles';
17
- import { EuiDescriptionListContext } from './description_list_context';
17
+ import { EuiDescriptionListContext } from './description_list_context'; // Export required for correct inference by HOCs
18
+
18
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
20
  export var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref) {
20
21
  var children = _ref.children,
@@ -14,7 +14,8 @@ import React, { useContext } from 'react';
14
14
  import classNames from 'classnames';
15
15
  import { useEuiTheme } from '../../services';
16
16
  import { euiDescriptionListTitleStyles } from './description_list_title.styles';
17
- import { EuiDescriptionListContext } from './description_list_context';
17
+ import { EuiDescriptionListContext } from './description_list_context'; // Export required for correct inference by HOCs
18
+
18
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
20
  export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
20
21
  var children = _ref.children,
@@ -1,4 +1,3 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
2
 
4
3
  /*
@@ -8,7 +7,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
8
7
  * in compliance with, at your election, the Elastic License 2.0 or the Server
9
8
  * Side Public License, v 1.
10
9
  */
11
- import React, { createContext, useContext, useState, useEffect } from 'react';
10
+ import React, { createContext, useState, useEffect } from 'react';
12
11
  import { useEuiTheme } from '../theme';
13
12
  import { throttle } from '../throttle';
14
13
  import { getBreakpoint } from './breakpoint';
@@ -25,7 +24,7 @@ export var CurrentEuiBreakpointProvider = function CurrentEuiBreakpointProvider(
25
24
  var _useEuiTheme = useEuiTheme(),
26
25
  breakpoints = _useEuiTheme.euiTheme.breakpoint;
27
26
 
28
- var _useState = useState((typeof window === "undefined" ? "undefined" : _typeof(window)) !== undefined ? getBreakpoint(window.innerWidth, breakpoints) : undefined),
27
+ var _useState = useState(typeof window !== 'undefined' ? getBreakpoint(window.innerWidth, breakpoints) : undefined),
29
28
  _useState2 = _slicedToArray(_useState, 2),
30
29
  currentBreakpoint = _useState2[0],
31
30
  setCurrentBreakpoint = _useState2[1];
@@ -42,12 +41,4 @@ export var CurrentEuiBreakpointProvider = function CurrentEuiBreakpointProvider(
42
41
  return ___EmotionJSX(CurrentEuiBreakpointContext.Provider, {
43
42
  value: currentBreakpoint
44
43
  }, children);
45
- };
46
- /**
47
- * Hook util / syntactical sugar
48
- */
49
-
50
- export var useCurrentEuiBreakpoint = function useCurrentEuiBreakpoint() {
51
- var currentBreakpoint = useContext(CurrentEuiBreakpointContext);
52
- return currentBreakpoint;
53
44
  };
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { useContext } from 'react';
9
+ import { CurrentEuiBreakpointContext } from './current_breakpoint';
10
+ /**
11
+ * Hook util / syntactical sugar for useContext()
12
+ *
13
+ * This hook is in its own separate file to make mocking it
14
+ * as a testenv easy for Jest unit tests
15
+ */
16
+
17
+ export var useCurrentEuiBreakpoint = function useCurrentEuiBreakpoint() {
18
+ var currentBreakpoint = useContext(CurrentEuiBreakpointContext);
19
+ return currentBreakpoint;
20
+ };
@@ -6,5 +6,6 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  export * from './breakpoint';
9
- export * from './currentEuiBreakpoint';
9
+ export * from './current_breakpoint';
10
+ export * from './current_breakpoint_hook';
10
11
  export * from './useIsWithinBreakpoints';
@@ -5,7 +5,7 @@
5
5
  * in compliance with, at your election, the Elastic License 2.0 or the Server
6
6
  * Side Public License, v 1.
7
7
  */
8
- import { useCurrentEuiBreakpoint } from './currentEuiBreakpoint';
8
+ import { useCurrentEuiBreakpoint } from './current_breakpoint_hook';
9
9
  /**
10
10
  * Given the current window.innerWidth and an array of breakpoint keys,
11
11
  * this hook stores state and returns true or false if the window.innerWidth
@@ -96,8 +96,7 @@ var CollapsedItemActions = /*#__PURE__*/function (_Component) {
96
96
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "registerPopoverDiv", function (popoverDiv) {
97
97
  if (!_this.popoverDiv) {
98
98
  _this.popoverDiv = popoverDiv;
99
-
100
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
99
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
101
100
  }
102
101
  });
103
102
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClickItem", function (onClickAction) {