@elastic/eui 63.0.0 → 63.0.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
@@ -6655,7 +6655,7 @@ declare module '@elastic/eui/src/services/throttle' {
6655
6655
  export const throttle: (fn: (...args: any[]) => void, wait?: number) => (...args: any[]) => void;
6656
6656
 
6657
6657
  }
6658
- declare module '@elastic/eui/src/services/breakpoint/currentEuiBreakpoint' {
6658
+ declare module '@elastic/eui/src/services/breakpoint/current_breakpoint' {
6659
6659
  import React, { FunctionComponent } from 'react';
6660
6660
  import { _EuiThemeBreakpoint } from '@elastic/eui/src/global_styling/variables/breakpoint'; type CurrentEuiBreakpoint = _EuiThemeBreakpoint | undefined;
6661
6661
  export const CurrentEuiBreakpointContext: React.Context<CurrentEuiBreakpoint>;
@@ -6664,11 +6664,17 @@ declare module '@elastic/eui/src/services/breakpoint/currentEuiBreakpoint' {
6664
6664
  * resize listener that returns the current breakpoint based on window width
6665
6665
  */
6666
6666
  export const CurrentEuiBreakpointProvider: FunctionComponent;
6667
+ export {};
6668
+
6669
+ }
6670
+ declare module '@elastic/eui/src/services/breakpoint/current_breakpoint_hook' {
6667
6671
  /**
6668
- * Hook util / syntactical sugar
6672
+ * Hook util / syntactical sugar for useContext()
6673
+ *
6674
+ * This hook is in its own separate file to make mocking it
6675
+ * as a testenv easy for Jest unit tests
6669
6676
  */
6670
- export const useCurrentEuiBreakpoint: () => CurrentEuiBreakpoint;
6671
- export {};
6677
+ export const useCurrentEuiBreakpoint: () => "s" | "xs" | "m" | "l" | "xl" | undefined;
6672
6678
 
6673
6679
  }
6674
6680
  declare module '@elastic/eui/src/services/breakpoint/useIsWithinBreakpoints' {
@@ -6688,7 +6694,8 @@ declare module '@elastic/eui/src/services/breakpoint/useIsWithinBreakpoints' {
6688
6694
  }
6689
6695
  declare module '@elastic/eui/src/services/breakpoint' {
6690
6696
  export * from '@elastic/eui/src/services/breakpoint/breakpoint';
6691
- export * from '@elastic/eui/src/services/breakpoint/currentEuiBreakpoint';
6697
+ export * from '@elastic/eui/src/services/breakpoint/current_breakpoint';
6698
+ export * from '@elastic/eui/src/services/breakpoint/current_breakpoint_hook';
6692
6699
  export * from '@elastic/eui/src/services/breakpoint/useIsWithinBreakpoints';
6693
6700
 
6694
6701
  }
@@ -13002,10 +13009,9 @@ declare module '@elastic/eui/src/components/description_list/description_list_co
13002
13009
  declare module '@elastic/eui/src/components/description_list/description_list_title' {
13003
13010
  import { HTMLAttributes, FunctionComponent } from 'react';
13004
13011
  import { CommonProps } from '@elastic/eui/src/components/common';
13005
- interface EuiDescriptionListTitleProps extends CommonProps, HTMLAttributes<HTMLElement> {
13012
+ export interface EuiDescriptionListTitleProps extends CommonProps, HTMLAttributes<HTMLElement> {
13006
13013
  }
13007
13014
  export const EuiDescriptionListTitle: FunctionComponent<EuiDescriptionListTitleProps>;
13008
- export {};
13009
13015
 
13010
13016
  }
13011
13017
  declare module '@elastic/eui/src/components/description_list/description_list_description.styles' {
@@ -13032,10 +13038,9 @@ declare module '@elastic/eui/src/components/description_list/description_list_de
13032
13038
  declare module '@elastic/eui/src/components/description_list/description_list_description' {
13033
13039
  import { HTMLAttributes, FunctionComponent } from 'react';
13034
13040
  import { CommonProps } from '@elastic/eui/src/components/common';
13035
- interface EuiDescriptionListDescriptionProps extends CommonProps, HTMLAttributes<HTMLElement> {
13041
+ export interface EuiDescriptionListDescriptionProps extends CommonProps, HTMLAttributes<HTMLElement> {
13036
13042
  }
13037
13043
  export const EuiDescriptionListDescription: FunctionComponent<EuiDescriptionListDescriptionProps>;
13038
- export {};
13039
13044
 
13040
13045
  }
13041
13046
  declare module '@elastic/eui/src/components/description_list/description_list.styles' {
@@ -18483,7 +18488,7 @@ declare module '@elastic/eui/src/components/basic_table/collapsed_item_actions'
18483
18488
  togglePopover: () => void;
18484
18489
  closePopover: () => void;
18485
18490
  onPopoverBlur: () => void;
18486
- registerPopoverDiv: (popoverDiv: HTMLDivElement) => void;
18491
+ registerPopoverDiv: (popoverDiv: HTMLDivElement | null) => void;
18487
18492
  componentWillUnmount(): void;
18488
18493
  onClickItem: (onClickAction: (() => void) | undefined) => void;
18489
18494
  render(): JSX.Element;
@@ -19435,56 +19440,6 @@ declare module '@elastic/eui' {
19435
19440
  export * from '@elastic/eui/src/themes';
19436
19441
  export * from '@elastic/eui/src/global_styling';
19437
19442
 
19438
- }
19439
- declare module '@elastic/eui/src/test/internal/render_with_styles' {
19440
- import { ReactElement } from 'react';
19441
- /**
19442
- * Use this function to add the `@emotion` Jest serializer to a single test.
19443
- * The resulting snapshot will include the styles of elements in the component that use `@emotion` for styling.
19444
- *
19445
- * This function must be run outside of a `test` block:
19446
-
19447
- ```
19448
- describe('EuiMark', () => {
19449
- renderWithStyles(<EuiMark>Marked</EuiMark>);
19450
-
19451
- test('is rendered', () => {});
19452
- });
19453
- ```
19454
- */
19455
- export const renderWithStyles: (component: ReactElement) => never;
19456
-
19457
- }
19458
- declare module '@elastic/eui/src/test/internal/render_custom_styles' {
19459
- import { ReactElement } from 'react';
19460
- /**
19461
- * Use this test helper to quickly check that the component supports custom
19462
- * `className`, `css`, and `style` properties.
19463
- *
19464
- * Example usage:
19465
- *
19466
- * shouldRenderCustomStyles(<EuiMark {...requiredProps} />Marked</EuiMark>);
19467
- */
19468
- export const shouldRenderCustomStyles: (component: ReactElement) => void;
19469
-
19470
- }
19471
- declare module '@elastic/eui/src/test/internal/test_custom_hook' {
19472
-
19473
- export const HookWrapper: (props: {
19474
- hook?: Function;
19475
- }) => JSX.Element;
19476
- export const testCustomHook: <T>(hook?: Function | undefined, args?: unknown) => {
19477
- return: T;
19478
- getUpdatedState: () => T;
19479
- updateHookArgs: (args: unknown) => void;
19480
- };
19481
-
19482
- }
19483
- declare module '@elastic/eui/src/test/internal' {
19484
- export * from '@elastic/eui/src/test/internal/render_with_styles';
19485
- export * from '@elastic/eui/src/test/internal/render_custom_styles';
19486
- export * from '@elastic/eui/src/test/internal/test_custom_hook';
19487
-
19488
19443
  }
19489
19444
  declare module '@elastic/eui/src/components/icon/assets/videoPlayer' {
19490
19445
  import * as React from 'react';
@@ -24029,96 +23984,6 @@ declare module 'mdast-util-to-hast/lib/all' {
24029
23984
  const all: (h: H, node: Node) => Node[];
24030
23985
  export = all;
24031
23986
  }
24032
- declare module '@elastic/eui/src/test/rtl/component_helpers' {
24033
- import '@testing-library/jest-dom';
24034
- /**
24035
- * Ensure the EuiPopover being tested is open/closed before continuing
24036
- * Note: Because EuiPopover is portalled, we want to query `document`
24037
- * instead of the `container` returned by RTL's render()
24038
- */
24039
- export const waitForEuiPopoverOpen: () => Promise<void>;
24040
- export const waitForEuiPopoverClose: () => Promise<void>;
24041
- /**
24042
- * Ensure the EuiToolTip being tested is open and visible before continuing
24043
- */
24044
- export const waitForEuiToolTipVisible: () => Promise<void>;
24045
- export const waitForEuiToolTipHidden: () => Promise<void>;
24046
-
24047
- }
24048
- declare module '@elastic/eui/src/test/rtl/data_test_subj_queries' {
24049
- 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]>;
24050
- export { queryByTestSubject, queryAllByTestSubject, getByTestSubject, getAllByTestSubject, findAllByTestSubject, findByTestSubject, };
24051
-
24052
- }
24053
- declare module '@elastic/eui/src/test/rtl/custom_render' {
24054
- import { ReactElement } from 'react';
24055
- import { queries, RenderOptions, Screen } from '@testing-library/react';
24056
- 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<{
24057
- getByLabelText: typeof queries.getByLabelText;
24058
- getAllByLabelText: typeof queries.getAllByLabelText;
24059
- queryByLabelText: typeof queries.queryByLabelText;
24060
- queryAllByLabelText: typeof queries.queryAllByLabelText;
24061
- findByLabelText: typeof queries.findByLabelText;
24062
- findAllByLabelText: typeof queries.findAllByLabelText;
24063
- getByPlaceholderText: typeof queries.getByPlaceholderText;
24064
- getAllByPlaceholderText: typeof queries.getAllByPlaceholderText;
24065
- queryByPlaceholderText: typeof queries.queryByPlaceholderText;
24066
- queryAllByPlaceholderText: typeof queries.queryAllByPlaceholderText;
24067
- findByPlaceholderText: typeof queries.findByPlaceholderText;
24068
- findAllByPlaceholderText: typeof queries.findAllByPlaceholderText;
24069
- getByText: typeof queries.getByText;
24070
- getAllByText: typeof queries.getAllByText;
24071
- queryByText: typeof queries.queryByText;
24072
- queryAllByText: typeof queries.queryAllByText;
24073
- findByText: typeof queries.findByText;
24074
- findAllByText: typeof queries.findAllByText;
24075
- getByAltText: typeof queries.getByAltText;
24076
- getAllByAltText: typeof queries.getAllByAltText;
24077
- queryByAltText: typeof queries.queryByAltText;
24078
- queryAllByAltText: typeof queries.queryAllByAltText;
24079
- findByAltText: typeof queries.findByAltText;
24080
- findAllByAltText: typeof queries.findAllByAltText;
24081
- getByTitle: typeof queries.getByTitle;
24082
- getAllByTitle: typeof queries.getAllByTitle;
24083
- queryByTitle: typeof queries.queryByTitle;
24084
- queryAllByTitle: typeof queries.queryAllByTitle;
24085
- findByTitle: typeof queries.findByTitle;
24086
- findAllByTitle: typeof queries.findAllByTitle;
24087
- getByDisplayValue: typeof queries.getByDisplayValue;
24088
- getAllByDisplayValue: typeof queries.getAllByDisplayValue;
24089
- queryByDisplayValue: typeof queries.queryByDisplayValue;
24090
- queryAllByDisplayValue: typeof queries.queryAllByDisplayValue;
24091
- findByDisplayValue: typeof queries.findByDisplayValue;
24092
- findAllByDisplayValue: typeof queries.findAllByDisplayValue;
24093
- getByRole: typeof queries.getByRole;
24094
- getAllByRole: typeof queries.getAllByRole;
24095
- queryByRole: typeof queries.queryByRole;
24096
- queryAllByRole: typeof queries.queryAllByRole;
24097
- findByRole: typeof queries.findByRole;
24098
- findAllByRole: typeof queries.findAllByRole;
24099
- getByTestId: typeof queries.getByTestId;
24100
- getAllByTestId: typeof queries.getAllByTestId;
24101
- queryByTestId: typeof queries.queryByTestId;
24102
- queryAllByTestId: typeof queries.queryAllByTestId;
24103
- findByTestId: typeof queries.findByTestId;
24104
- findAllByTestId: typeof queries.findAllByTestId;
24105
- queryByTestSubject: import("@testing-library/react").QueryBy<[import("@testing-library/react").Matcher]>;
24106
- queryAllByTestSubject: (container: HTMLElement, id: import("@testing-library/react").Matcher, options?: import("@testing-library/react").MatcherOptions | undefined) => HTMLElement[];
24107
- getByTestSubject: import("@testing-library/react").GetBy<[import("@testing-library/react").Matcher]>;
24108
- getAllByTestSubject: import("@testing-library/react").GetAllBy<[import("@testing-library/react").Matcher]>;
24109
- findAllByTestSubject: import("@testing-library/react").FindAllBy<[import("@testing-library/react").Matcher]>;
24110
- findByTestSubject: import("@testing-library/react").FindBy<[import("@testing-library/react").Matcher]>;
24111
- }, HTMLElement, HTMLElement>;
24112
- export { customRender as render }; const customScreen: Screen<typeof queries & typeof dataTestSubjQueries>;
24113
- export { customScreen as screen };
24114
-
24115
- }
24116
- declare module '@elastic/eui/src/test/rtl' {
24117
- export * from '@elastic/eui/src/test/rtl/component_helpers';
24118
- export { queryByTestSubject, queryAllByTestSubject, getByTestSubject, getAllByTestSubject, findAllByTestSubject, findByTestSubject, } from '@elastic/eui/src/test/rtl/data_test_subj_queries';
24119
- export { render, screen } from '@elastic/eui/src/test/rtl/custom_render';
24120
-
24121
- }
24122
23987
  declare module '@elastic/eui/src/components/table/mobile' {
24123
23988
  export { EuiTableHeaderMobile } from '@elastic/eui/src/components/table/mobile/table_header_mobile';
24124
23989
  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) {