@elastic/eui 86.0.0-rc1.0 → 86.0.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.
Files changed (50) hide show
  1. package/es/components/datagrid/controls/display_selector.js +0 -1
  2. package/es/components/inline_edit/inline_edit_form.js +52 -0
  3. package/es/components/inline_edit/inline_edit_text.js +2 -3
  4. package/es/components/inline_edit/inline_edit_title.js +2 -3
  5. package/es/components/portal/portal.js +3 -2
  6. package/es/components/tour/tour_step.js +7 -1
  7. package/es/services/theme/provider.js +0 -7
  8. package/es/test/index.d.ts +0 -36
  9. package/es/test/index.js +1 -2
  10. package/eui.d.ts +3 -6
  11. package/i18ntokens.json +56 -56
  12. package/lib/components/datagrid/controls/display_selector.js +0 -1
  13. package/lib/components/inline_edit/inline_edit_form.js +52 -0
  14. package/lib/components/inline_edit/inline_edit_text.js +2 -3
  15. package/lib/components/inline_edit/inline_edit_title.js +2 -3
  16. package/lib/components/portal/portal.js +3 -2
  17. package/lib/components/tour/tour_step.js +7 -1
  18. package/lib/services/theme/provider.js +1 -10
  19. package/lib/test/index.d.ts +0 -36
  20. package/lib/test/index.js +0 -12
  21. package/optimize/es/components/datagrid/controls/display_selector.js +0 -1
  22. package/optimize/es/components/inline_edit/inline_edit_text.js +2 -3
  23. package/optimize/es/components/inline_edit/inline_edit_title.js +2 -3
  24. package/optimize/es/components/portal/portal.js +3 -2
  25. package/optimize/es/components/tour/tour_step.js +7 -1
  26. package/optimize/es/services/theme/provider.js +0 -7
  27. package/optimize/es/test/index.d.ts +0 -36
  28. package/optimize/es/test/index.js +1 -2
  29. package/optimize/lib/components/datagrid/controls/display_selector.js +0 -1
  30. package/optimize/lib/components/inline_edit/inline_edit_text.js +2 -3
  31. package/optimize/lib/components/inline_edit/inline_edit_title.js +2 -3
  32. package/optimize/lib/components/portal/portal.js +3 -2
  33. package/optimize/lib/components/tour/tour_step.js +7 -1
  34. package/optimize/lib/services/theme/provider.js +1 -10
  35. package/optimize/lib/test/index.d.ts +0 -36
  36. package/optimize/lib/test/index.js +0 -12
  37. package/package.json +1 -1
  38. package/test-env/components/datagrid/controls/display_selector.js +0 -1
  39. package/test-env/components/inline_edit/inline_edit_form.js +52 -0
  40. package/test-env/components/inline_edit/inline_edit_text.js +2 -3
  41. package/test-env/components/inline_edit/inline_edit_title.js +2 -3
  42. package/test-env/components/portal/portal.js +3 -2
  43. package/test-env/components/tour/tour_step.js +7 -1
  44. package/test-env/services/theme/provider.js +1 -10
  45. package/test-env/test/index.js +0 -12
  46. package/es/test/react_version.js +0 -71
  47. package/lib/test/react_version.js +0 -84
  48. package/optimize/es/test/react_version.js +0 -71
  49. package/optimize/lib/test/react_version.js +0 -84
  50. package/test-env/test/react_version.js +0 -84
@@ -132,7 +132,6 @@ export var useDataGridDisplaySelector = function useDataGridDisplaySelector(show
132
132
  setUserRowHeightsOptions(rowHeightsOptions);
133
133
  }, [lineCount]);
134
134
  var setLineCountHeight = useCallback(function (event) {
135
- if (!event.currentTarget) return;
136
135
  var newLineCount = Number(event.currentTarget.value);
137
136
  if (newLineCount < 1) return; // Don't let users set a 0 or negative line count
138
137
 
@@ -288,6 +288,58 @@ export var EuiInlineEditForm = function EuiInlineEditForm(_ref) {
288
288
  }, isEditing ? editModeForm : readModeElement);
289
289
  };
290
290
  EuiInlineEditForm.propTypes = {
291
+ className: PropTypes.string,
292
+ "aria-label": PropTypes.string,
293
+ "data-test-subj": PropTypes.string,
294
+ css: PropTypes.any,
295
+ defaultValue: PropTypes.string.isRequired,
296
+ placeholder: PropTypes.string,
297
+ /**
298
+ * Callback that fires when a user clicks the save button.
299
+ * Passes the current edited text value as an argument.
300
+ *
301
+ * To validate the value of the edited text, pass back a boolean flag.
302
+ * If `false`, EuiInlineEdit will remain in edit mode, where loading or invalid states can be set.
303
+ * If `true`, EuiInlineEdit will return to read mode.
304
+ */
305
+ onSave: PropTypes.func,
306
+ /**
307
+ * Form label that appears above the form control.
308
+ * This is required for accessibility because there is no visual label on the input.
309
+ */
310
+ inputAriaLabel: PropTypes.string.isRequired,
311
+ /**
312
+ * Starts the component in edit mode
313
+ */
314
+ startWithEditOpen: PropTypes.bool,
315
+ /**
316
+ * Props that will be applied directly to the `EuiEmptyButton` displayed in read mode
317
+ */
318
+ readModeProps: PropTypes.any,
319
+ /**
320
+ * Multiple props objects that can be applied directly to various child components displayed in edit mode.
321
+ * - `formRowProps` will be passed to `EuiFormRow`
322
+ * - `inputProps` will be passed to `EuiFieldText`
323
+ * - `saveButtonProps` & `cancelButtonProps` will be passed to their respective `EuiIconButton`s
324
+ */
325
+ editModeProps: PropTypes.shape({
326
+ formRowProps: PropTypes.any,
327
+ inputProps: PropTypes.any,
328
+ saveButtonProps: PropTypes.any,
329
+ cancelButtonProps: PropTypes.any
330
+ }),
331
+ /**
332
+ * Loading state - only displayed in edit mode
333
+ */
334
+ isLoading: PropTypes.bool,
335
+ /**
336
+ * Invalid state - only displayed edit mode
337
+ */
338
+ isInvalid: PropTypes.bool,
339
+ /**
340
+ * Locks inline edit in read mode and displays the text value
341
+ */
342
+ isReadOnly: PropTypes.bool,
291
343
  /**
292
344
  * Form sizes
293
345
  */
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["children", "className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
2
+ var _excluded = ["className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -25,8 +25,7 @@ import { useEuiTheme } from '../../services';
25
25
  import { euiInlineEditTextStyles } from './inline_edit_text.styles';
26
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
27
27
  export var EuiInlineEditText = function EuiInlineEditText(_ref) {
28
- var children = _ref.children,
29
- className = _ref.className,
28
+ var className = _ref.className,
30
29
  _ref$size = _ref.size,
31
30
  size = _ref$size === void 0 ? 'm' : _ref$size,
32
31
  defaultValue = _ref.defaultValue,
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["children", "className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
2
+ var _excluded = ["className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -26,8 +26,7 @@ import { euiInlineEditTitleStyles } from './inline_edit_title.styles';
26
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
27
27
  export var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span'];
28
28
  export var EuiInlineEditTitle = function EuiInlineEditTitle(_ref) {
29
- var children = _ref.children,
30
- className = _ref.className,
29
+ var className = _ref.className,
31
30
  _ref$size = _ref.size,
32
31
  size = _ref$size === void 0 ? 'm' : _ref$size,
33
32
  heading = _ref.heading,
@@ -50,8 +50,6 @@ export var EuiPortal = /*#__PURE__*/function (_Component) {
50
50
  _createClass(EuiPortal, [{
51
51
  key: "componentDidMount",
52
52
  value: function componentDidMount() {
53
- if (typeof window === 'undefined') return; // Prevent SSR errors
54
-
55
53
  var insert = this.props.insert;
56
54
  var portalNode = document.createElement('div');
57
55
  portalNode.dataset.euiportal = 'true';
@@ -66,6 +64,9 @@ export var EuiPortal = /*#__PURE__*/function (_Component) {
66
64
  }
67
65
  this.setThemeColor(portalNode);
68
66
  this.updatePortalRef(portalNode);
67
+
68
+ // Update state with portalNode to intentionally trigger component rerender
69
+ // and call createPortal with correct root element in render()
69
70
  this.setState({
70
71
  portalNode: portalNode
71
72
  });
@@ -85,6 +85,12 @@ export var EuiTourStep = function EuiTourStep(_ref) {
85
85
  useEffect(function () {
86
86
  var timeout;
87
87
  if (anchor) {
88
+ // Wait until next tick to find anchor node in case it's not already
89
+ // in DOM requestAnimationFrame isn't used here because we don't need to
90
+ // synchronize with repainting ticks and the updated value still
91
+ // needs to go through a react DOM rerender which may take more than
92
+ // 1 frame (16ms) of time.
93
+ // TODO: It would be ideal to have some kind of intersection observer here instead
88
94
  timeout = window.setTimeout(function () {
89
95
  setAnchorNode(findElementBySelectorOrRef(anchor));
90
96
  });
@@ -92,7 +98,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
92
98
  return function () {
93
99
  timeout && window.clearTimeout(timeout);
94
100
  };
95
- }, [anchor, setAnchorNode]);
101
+ }, [anchor]);
96
102
  var classes = classNames('euiTour', className);
97
103
  var euiTheme = useEuiTheme();
98
104
  var tourStyles = euiTourStyles(euiTheme);
@@ -30,13 +30,6 @@ import { EuiSystemContext, EuiThemeContext, EuiNestedThemeContext, EuiModificati
30
30
  import { EuiEmotionThemeProvider } from './emotion';
31
31
  import { buildTheme, getColorMode, getComputed, mergeDeep } from './utils';
32
32
  import { jsx as ___EmotionJSX } from "@emotion/react";
33
- var providerWarning = undefined;
34
- export var setEuiDevProviderWarning = function setEuiDevProviderWarning(level) {
35
- return providerWarning = level;
36
- };
37
- export var getEuiDevProviderWarning = function getEuiDevProviderWarning() {
38
- return providerWarning;
39
- };
40
33
  export var EuiThemeProvider = function EuiThemeProvider(_ref) {
41
34
  var _system = _ref.theme,
42
35
  _colorMode = _ref.colorMode,
@@ -41,41 +41,6 @@ declare module '@elastic/eui/es/test/sleep' {
41
41
  declare module '@elastic/eui/es/test/emotion-prefix' {
42
42
  export const replaceEmotionPrefix: (selector: string) => string;
43
43
 
44
- }
45
- declare module '@elastic/eui/es/test/react_version' {
46
- /// <reference types="jest" />
47
- export type ReactVersion = '16' | '17' | '18';
48
- export const SUPPORTED_REACT_VERSIONS: ReactVersion[];
49
- /**
50
- * Get major version of React that's currently used.
51
- *
52
- */
53
- export const getReactVersion: () => ReactVersion;
54
- export const isReactVersion: (versionOrVersions: ReactVersion | ReactVersion[]) => boolean;
55
- /**
56
- * Invoke passed function when running on specified version(s) of React
57
- */
58
- export const invokeOnReactVersion: (versionOrVersions: ReactVersion | ReactVersion[], func: Function) => void;
59
- /**
60
- * Jest describe wrapper calling describe() for every supported React version
61
- * and prefixing the name with version numbers. Only the currently running
62
- * version isn't skipped.
63
- *
64
- * It's primary use is to separate snapshots by React version in case there are
65
- * differences with, for example, unique ID generation.
66
- */
67
- export const describeByReactVersion: (name: string, func: () => void) => void;
68
- /**
69
- * Jest test wrapper calling test() for every supported React version
70
- * and prefixing the name with version numbers. Only the currently running
71
- * version isn't skipped.
72
- *
73
- * It's primary use is to separate snapshots by React version in case there
74
- * are differences with, for example, unique ID generation.
75
- */
76
- export const testByReactVersion: (name: string, func: () => void) => void;
77
- export const testOnReactVersion: (versionOrVersions: ReactVersion | ReactVersion[]) => typeof test;
78
-
79
44
  }
80
45
  declare module '@elastic/eui/es/test' {
81
46
  export { requiredProps } from '@elastic/eui/es/test/required_props';
@@ -84,6 +49,5 @@ declare module '@elastic/eui/es/test' {
84
49
  export { startThrowingReactWarnings, stopThrowingReactWarnings, } from '@elastic/eui/es/test/react_warnings';
85
50
  export { sleep } from '@elastic/eui/es/test/sleep';
86
51
  export * from '@elastic/eui/es/test/emotion-prefix';
87
- export * from '@elastic/eui/es/test/react_version';
88
52
 
89
53
  }
package/es/test/index.js CHANGED
@@ -11,5 +11,4 @@ export { takeMountedSnapshot } from './take_mounted_snapshot';
11
11
  export { findTestSubject } from './find_test_subject';
12
12
  export { startThrowingReactWarnings, stopThrowingReactWarnings } from './react_warnings';
13
13
  export { sleep } from './sleep';
14
- export * from './emotion-prefix';
15
- export * from './react_version';
14
+ export * from './emotion-prefix';
package/eui.d.ts CHANGED
@@ -7446,9 +7446,7 @@ declare module '@elastic/eui/src/services/theme/emotion' {
7446
7446
  declare module '@elastic/eui/src/services/theme/provider' {
7447
7447
  import React, { PropsWithChildren, HTMLAttributes } from 'react';
7448
7448
  import type { CommonProps } from '@elastic/eui/src/components/common';
7449
- import { EuiThemeColorMode, EuiThemeSystem, EuiThemeModifications } from '@elastic/eui/src/services/theme/types'; type LEVELS = 'log' | 'warn' | 'error';
7450
- export const setEuiDevProviderWarning: (level: LEVELS | undefined) => LEVELS | undefined;
7451
- export const getEuiDevProviderWarning: () => LEVELS | undefined;
7449
+ import { EuiThemeColorMode, EuiThemeSystem, EuiThemeModifications } from '@elastic/eui/src/services/theme/types';
7452
7450
  export interface EuiThemeProviderProps<T> extends PropsWithChildren {
7453
7451
  theme?: EuiThemeSystem<T>;
7454
7452
  colorMode?: EuiThemeColorMode;
@@ -7469,7 +7467,6 @@ declare module '@elastic/eui/src/services/theme/provider' {
7469
7467
  };
7470
7468
  }
7471
7469
  export const EuiThemeProvider: <T extends {} = {}>({ theme: _system, colorMode: _colorMode, modify: _modifications, children, wrapperProps, }: EuiThemeProviderProps<T>) => React.JSX.Element;
7472
- export {};
7473
7470
 
7474
7471
  }
7475
7472
  declare module '@elastic/eui/src/services/theme' {
@@ -16241,7 +16238,7 @@ declare module '@elastic/eui/src/components/inline_edit/inline_edit_form' {
16241
16238
  import { EuiFormRowProps, EuiFieldTextProps } from '@elastic/eui/src/components/form';
16242
16239
  import { EuiButtonIconPropsForButton } from '@elastic/eui/src/components/button/button_icon';
16243
16240
  import { EuiButtonEmptyPropsForButton } from '@elastic/eui/src/components/button/button_empty/button_empty';
16244
- export type EuiInlineEditCommonProps = HTMLAttributes<HTMLDivElement> & CommonProps & {
16241
+ export type EuiInlineEditCommonProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & CommonProps & {
16245
16242
  defaultValue: string;
16246
16243
  placeholder?: string;
16247
16244
  /**
@@ -16291,7 +16288,7 @@ declare module '@elastic/eui/src/components/inline_edit/inline_edit_form' {
16291
16288
  */
16292
16289
  isReadOnly?: boolean;
16293
16290
  };
16294
- export type EuiInlineEditFormProps = Omit<EuiInlineEditCommonProps, 'children'> & {
16291
+ export type EuiInlineEditFormProps = EuiInlineEditCommonProps & {
16295
16292
  /**
16296
16293
  * Form sizes
16297
16294
  */
package/i18ntokens.json CHANGED
@@ -1589,14 +1589,14 @@
1589
1589
  "highlighting": "string",
1590
1590
  "loc": {
1591
1591
  "start": {
1592
- "line": 212,
1592
+ "line": 210,
1593
1593
  "column": 22,
1594
- "index": 6913
1594
+ "index": 6874
1595
1595
  },
1596
1596
  "end": {
1597
- "line": 215,
1597
+ "line": 213,
1598
1598
  "column": 3,
1599
- "index": 6987
1599
+ "index": 6948
1600
1600
  }
1601
1601
  },
1602
1602
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1607,14 +1607,14 @@
1607
1607
  "highlighting": "string",
1608
1608
  "loc": {
1609
1609
  "start": {
1610
- "line": 216,
1610
+ "line": 214,
1611
1611
  "column": 27,
1612
- "index": 7016
1612
+ "index": 6977
1613
1613
  },
1614
1614
  "end": {
1615
- "line": 219,
1615
+ "line": 217,
1616
1616
  "column": 3,
1617
- "index": 7096
1617
+ "index": 7057
1618
1618
  }
1619
1619
  },
1620
1620
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1625,14 +1625,14 @@
1625
1625
  "highlighting": "string",
1626
1626
  "loc": {
1627
1627
  "start": {
1628
- "line": 249,
1628
+ "line": 247,
1629
1629
  "column": 10,
1630
- "index": 8081
1630
+ "index": 8042
1631
1631
  },
1632
1632
  "end": {
1633
- "line": 257,
1633
+ "line": 255,
1634
1634
  "column": 11,
1635
- "index": 8402
1635
+ "index": 8363
1636
1636
  }
1637
1637
  },
1638
1638
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1643,14 +1643,14 @@
1643
1643
  "highlighting": "string",
1644
1644
  "loc": {
1645
1645
  "start": {
1646
- "line": 249,
1646
+ "line": 247,
1647
1647
  "column": 10,
1648
- "index": 8081
1648
+ "index": 8042
1649
1649
  },
1650
1650
  "end": {
1651
- "line": 257,
1651
+ "line": 255,
1652
1652
  "column": 11,
1653
- "index": 8402
1653
+ "index": 8363
1654
1654
  }
1655
1655
  },
1656
1656
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1661,14 +1661,14 @@
1661
1661
  "highlighting": "string",
1662
1662
  "loc": {
1663
1663
  "start": {
1664
- "line": 249,
1664
+ "line": 247,
1665
1665
  "column": 10,
1666
- "index": 8081
1666
+ "index": 8042
1667
1667
  },
1668
1668
  "end": {
1669
- "line": 257,
1669
+ "line": 255,
1670
1670
  "column": 11,
1671
- "index": 8402
1671
+ "index": 8363
1672
1672
  }
1673
1673
  },
1674
1674
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1679,14 +1679,14 @@
1679
1679
  "highlighting": "string",
1680
1680
  "loc": {
1681
1681
  "start": {
1682
- "line": 249,
1682
+ "line": 247,
1683
1683
  "column": 10,
1684
- "index": 8081
1684
+ "index": 8042
1685
1685
  },
1686
1686
  "end": {
1687
- "line": 257,
1687
+ "line": 255,
1688
1688
  "column": 11,
1689
- "index": 8402
1689
+ "index": 8363
1690
1690
  }
1691
1691
  },
1692
1692
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1697,14 +1697,14 @@
1697
1697
  "highlighting": "string",
1698
1698
  "loc": {
1699
1699
  "start": {
1700
- "line": 292,
1700
+ "line": 290,
1701
1701
  "column": 10,
1702
- "index": 9509
1702
+ "index": 9470
1703
1703
  },
1704
1704
  "end": {
1705
- "line": 307,
1705
+ "line": 305,
1706
1706
  "column": 11,
1707
- "index": 9982
1707
+ "index": 9943
1708
1708
  }
1709
1709
  },
1710
1710
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1715,14 +1715,14 @@
1715
1715
  "highlighting": "string",
1716
1716
  "loc": {
1717
1717
  "start": {
1718
- "line": 292,
1718
+ "line": 290,
1719
1719
  "column": 10,
1720
- "index": 9509
1720
+ "index": 9470
1721
1721
  },
1722
1722
  "end": {
1723
- "line": 307,
1723
+ "line": 305,
1724
1724
  "column": 11,
1725
- "index": 9982
1725
+ "index": 9943
1726
1726
  }
1727
1727
  },
1728
1728
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1733,14 +1733,14 @@
1733
1733
  "highlighting": "string",
1734
1734
  "loc": {
1735
1735
  "start": {
1736
- "line": 292,
1736
+ "line": 290,
1737
1737
  "column": 10,
1738
- "index": 9509
1738
+ "index": 9470
1739
1739
  },
1740
1740
  "end": {
1741
- "line": 307,
1741
+ "line": 305,
1742
1742
  "column": 11,
1743
- "index": 9982
1743
+ "index": 9943
1744
1744
  }
1745
1745
  },
1746
1746
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1751,14 +1751,14 @@
1751
1751
  "highlighting": "string",
1752
1752
  "loc": {
1753
1753
  "start": {
1754
- "line": 292,
1754
+ "line": 290,
1755
1755
  "column": 10,
1756
- "index": 9509
1756
+ "index": 9470
1757
1757
  },
1758
1758
  "end": {
1759
- "line": 307,
1759
+ "line": 305,
1760
1760
  "column": 11,
1761
- "index": 9982
1761
+ "index": 9943
1762
1762
  }
1763
1763
  },
1764
1764
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -1769,14 +1769,14 @@
1769
1769
  "highlighting": "string",
1770
1770
  "loc": {
1771
1771
  "start": {
1772
- "line": 292,
1772
+ "line": 290,
1773
1773
  "column": 10,
1774
- "index": 9509
1774
+ "index": 9470
1775
1775
  },
1776
1776
  "end": {
1777
- "line": 307,
1777
+ "line": 305,
1778
1778
  "column": 11,
1779
- "index": 9982
1779
+ "index": 9943
1780
1780
  }
1781
1781
  },
1782
1782
  "filepath": "src/components/datagrid/controls/display_selector.tsx"
@@ -7097,14 +7097,14 @@
7097
7097
  "highlighting": "string",
7098
7098
  "loc": {
7099
7099
  "start": {
7100
- "line": 250,
7100
+ "line": 256,
7101
7101
  "column": 10,
7102
- "index": 6369
7102
+ "index": 6776
7103
7103
  },
7104
7104
  "end": {
7105
- "line": 257,
7105
+ "line": 263,
7106
7106
  "column": 11,
7107
- "index": 6603
7107
+ "index": 7010
7108
7108
  }
7109
7109
  },
7110
7110
  "filepath": "src/components/tour/tour_step.tsx"
@@ -7115,14 +7115,14 @@
7115
7115
  "highlighting": "string",
7116
7116
  "loc": {
7117
7117
  "start": {
7118
- "line": 250,
7118
+ "line": 256,
7119
7119
  "column": 10,
7120
- "index": 6369
7120
+ "index": 6776
7121
7121
  },
7122
7122
  "end": {
7123
- "line": 257,
7123
+ "line": 263,
7124
7124
  "column": 11,
7125
- "index": 6603
7125
+ "index": 7010
7126
7126
  }
7127
7127
  },
7128
7128
  "filepath": "src/components/tour/tour_step.tsx"
@@ -7133,14 +7133,14 @@
7133
7133
  "highlighting": "string",
7134
7134
  "loc": {
7135
7135
  "start": {
7136
- "line": 250,
7136
+ "line": 256,
7137
7137
  "column": 10,
7138
- "index": 6369
7138
+ "index": 6776
7139
7139
  },
7140
7140
  "end": {
7141
- "line": 257,
7141
+ "line": 263,
7142
7142
  "column": 11,
7143
- "index": 6603
7143
+ "index": 7010
7144
7144
  }
7145
7145
  },
7146
7146
  "filepath": "src/components/tour/tour_step.tsx"
@@ -139,7 +139,6 @@ var useDataGridDisplaySelector = function useDataGridDisplaySelector(showDisplay
139
139
  setUserRowHeightsOptions(rowHeightsOptions);
140
140
  }, [lineCount]);
141
141
  var setLineCountHeight = (0, _react.useCallback)(function (event) {
142
- if (!event.currentTarget) return;
143
142
  var newLineCount = Number(event.currentTarget.value);
144
143
  if (newLineCount < 1) return; // Don't let users set a 0 or negative line count
145
144
 
@@ -295,6 +295,58 @@ var EuiInlineEditForm = function EuiInlineEditForm(_ref) {
295
295
  };
296
296
  exports.EuiInlineEditForm = EuiInlineEditForm;
297
297
  EuiInlineEditForm.propTypes = {
298
+ className: _propTypes.default.string,
299
+ "aria-label": _propTypes.default.string,
300
+ "data-test-subj": _propTypes.default.string,
301
+ css: _propTypes.default.any,
302
+ defaultValue: _propTypes.default.string.isRequired,
303
+ placeholder: _propTypes.default.string,
304
+ /**
305
+ * Callback that fires when a user clicks the save button.
306
+ * Passes the current edited text value as an argument.
307
+ *
308
+ * To validate the value of the edited text, pass back a boolean flag.
309
+ * If `false`, EuiInlineEdit will remain in edit mode, where loading or invalid states can be set.
310
+ * If `true`, EuiInlineEdit will return to read mode.
311
+ */
312
+ onSave: _propTypes.default.func,
313
+ /**
314
+ * Form label that appears above the form control.
315
+ * This is required for accessibility because there is no visual label on the input.
316
+ */
317
+ inputAriaLabel: _propTypes.default.string.isRequired,
318
+ /**
319
+ * Starts the component in edit mode
320
+ */
321
+ startWithEditOpen: _propTypes.default.bool,
322
+ /**
323
+ * Props that will be applied directly to the `EuiEmptyButton` displayed in read mode
324
+ */
325
+ readModeProps: _propTypes.default.any,
326
+ /**
327
+ * Multiple props objects that can be applied directly to various child components displayed in edit mode.
328
+ * - `formRowProps` will be passed to `EuiFormRow`
329
+ * - `inputProps` will be passed to `EuiFieldText`
330
+ * - `saveButtonProps` & `cancelButtonProps` will be passed to their respective `EuiIconButton`s
331
+ */
332
+ editModeProps: _propTypes.default.shape({
333
+ formRowProps: _propTypes.default.any,
334
+ inputProps: _propTypes.default.any,
335
+ saveButtonProps: _propTypes.default.any,
336
+ cancelButtonProps: _propTypes.default.any
337
+ }),
338
+ /**
339
+ * Loading state - only displayed in edit mode
340
+ */
341
+ isLoading: _propTypes.default.bool,
342
+ /**
343
+ * Invalid state - only displayed edit mode
344
+ */
345
+ isInvalid: _propTypes.default.bool,
346
+ /**
347
+ * Locks inline edit in read mode and displays the text value
348
+ */
349
+ isReadOnly: _propTypes.default.bool,
298
350
  /**
299
351
  * Form sizes
300
352
  */
@@ -13,7 +13,7 @@ var _inline_edit_form = require("./inline_edit_form");
13
13
  var _services = require("../../services");
14
14
  var _inline_edit_text = require("./inline_edit_text.styles");
15
15
  var _react2 = require("@emotion/react");
16
- var _excluded = ["children", "className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
16
+ var _excluded = ["className", "size", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
17
17
  /*
18
18
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
19
19
  * or more contributor license agreements. Licensed under the Elastic License
@@ -33,8 +33,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
33
33
  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; }
34
34
  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; }
35
35
  var EuiInlineEditText = function EuiInlineEditText(_ref) {
36
- var children = _ref.children,
37
- className = _ref.className,
36
+ var className = _ref.className,
38
37
  _ref$size = _ref.size,
39
38
  size = _ref$size === void 0 ? 'm' : _ref$size,
40
39
  defaultValue = _ref.defaultValue,
@@ -13,7 +13,7 @@ var _inline_edit_form = require("./inline_edit_form");
13
13
  var _services = require("../../services");
14
14
  var _inline_edit_title = require("./inline_edit_title.styles");
15
15
  var _react2 = require("@emotion/react");
16
- var _excluded = ["children", "className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
16
+ var _excluded = ["className", "size", "heading", "defaultValue", "placeholder", "inputAriaLabel", "startWithEditOpen", "readModeProps", "editModeProps", "isLoading", "isInvalid", "isReadOnly"];
17
17
  /*
18
18
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
19
19
  * or more contributor license agreements. Licensed under the Elastic License
@@ -35,8 +35,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
35
35
  var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span'];
36
36
  exports.HEADINGS = HEADINGS;
37
37
  var EuiInlineEditTitle = function EuiInlineEditTitle(_ref) {
38
- var children = _ref.children,
39
- className = _ref.className,
38
+ var className = _ref.className,
40
39
  _ref$size = _ref.size,
41
40
  size = _ref$size === void 0 ? 'm' : _ref$size,
42
41
  heading = _ref.heading,
@@ -55,8 +55,6 @@ var EuiPortal = /*#__PURE__*/function (_Component) {
55
55
  _createClass(EuiPortal, [{
56
56
  key: "componentDidMount",
57
57
  value: function componentDidMount() {
58
- if (typeof window === 'undefined') return; // Prevent SSR errors
59
-
60
58
  var insert = this.props.insert;
61
59
  var portalNode = document.createElement('div');
62
60
  portalNode.dataset.euiportal = 'true';
@@ -71,6 +69,9 @@ var EuiPortal = /*#__PURE__*/function (_Component) {
71
69
  }
72
70
  this.setThemeColor(portalNode);
73
71
  this.updatePortalRef(portalNode);
72
+
73
+ // Update state with portalNode to intentionally trigger component rerender
74
+ // and call createPortal with correct root element in render()
74
75
  this.setState({
75
76
  portalNode: portalNode
76
77
  });