@elastic/eui 97.3.1 → 98.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 (27) hide show
  1. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +1 -0
  2. package/es/components/color_picker/color_picker.js +0 -1
  3. package/es/components/datagrid/body/header/draggable_columns.js +21 -8
  4. package/es/components/form/form_row/form_row.js +2 -7
  5. package/es/components/form/form_row/form_row.styles.js +1 -7
  6. package/eui.d.ts +1 -3
  7. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +1 -0
  8. package/lib/components/color_picker/color_picker.js +0 -1
  9. package/lib/components/datagrid/body/header/draggable_columns.js +29 -18
  10. package/lib/components/form/form_row/form_row.js +2 -7
  11. package/lib/components/form/form_row/form_row.styles.js +1 -7
  12. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +1 -0
  13. package/optimize/es/components/color_picker/color_picker.js +0 -1
  14. package/optimize/es/components/datagrid/body/header/draggable_columns.js +16 -8
  15. package/optimize/es/components/form/form_row/form_row.js +2 -5
  16. package/optimize/es/components/form/form_row/form_row.styles.js +1 -7
  17. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +1 -0
  18. package/optimize/lib/components/color_picker/color_picker.js +0 -1
  19. package/optimize/lib/components/datagrid/body/header/draggable_columns.js +16 -8
  20. package/optimize/lib/components/form/form_row/form_row.js +2 -5
  21. package/optimize/lib/components/form/form_row/form_row.styles.js +1 -7
  22. package/package.json +1 -1
  23. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +1 -0
  24. package/test-env/components/color_picker/color_picker.js +0 -1
  25. package/test-env/components/datagrid/body/header/draggable_columns.js +16 -8
  26. package/test-env/components/form/form_row/form_row.js +2 -7
  27. package/test-env/components/form/form_row/form_row.styles.js +1 -7
@@ -59,6 +59,7 @@ export var EuiCollapsedNavPopover = function EuiCollapsedNavPopover(_ref) {
59
59
  display: "block",
60
60
  anchorPosition: "rightUp",
61
61
  panelPaddingSize: "none",
62
+ repositionOnScroll: true,
62
63
  button: ___EmotionJSX(EuiCollapsedNavButton, {
63
64
  title: title,
64
65
  icon: icon || 'boxesHorizontal',
@@ -312,7 +312,6 @@ export var EuiColorPicker = function EuiColorPicker(_ref) {
312
312
  };
313
313
  var showSecondaryInput = mode === 'secondaryInput' || secondaryInputDisplay !== 'none';
314
314
  var inlineInput = showSecondaryInput && ___EmotionJSX(EuiFormRow, {
315
- display: "rowCompressed",
316
315
  isInvalid: isInvalid,
317
316
  error: isInvalid ? colorErrorMessage : null
318
317
  }, ___EmotionJSX(EuiFormControlLayout, {
@@ -10,6 +10,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
10
10
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
11
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
12
12
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
13
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
14
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
17
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
18
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
19
  /*
14
20
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
15
21
  * or more contributor license agreements. Licensed under the Elastic License
@@ -97,15 +103,22 @@ export var DraggableColumn = /*#__PURE__*/memo(function (_ref3) {
97
103
  var _useContext2 = useContext(DataGridFocusContext),
98
104
  setFocusedCell = _useContext2.setFocusedCell;
99
105
  var handleOnMouseDown = useCallback(function (e) {
100
- var openFocusTrap = document.querySelector('[data-focus-lock-disabled="false"]');
101
- if (!!openFocusTrap &&
102
- // If a focus trap is open somewhere on the page
103
- !openFocusTrap.contains(e.target) &&
104
- // & the focus trap doesn't belong to this header
105
- e.target !== actionsPopoverToggle // & we're not closing the actions popover toggle
106
- ) {
106
+ var openFocusTraps = document.querySelectorAll('[data-focus-lock-disabled="false"]');
107
+ var validOpenFocusTraps = _toConsumableArray(openFocusTraps).filter(function (focusTrap) {
108
+ return !focusTrap.contains(e.currentTarget);
109
+ } // remove containing focus traps (e.g. modals or flyouts)
110
+ );
111
+ var shouldDispatchEvent = validOpenFocusTraps.some(function (focusTrap) {
112
+ return !!focusTrap &&
113
+ // If there is a focus trap open
114
+ !focusTrap.contains(e.target) &&
115
+ // & if it doesn't contain the target
116
+ e.target !== actionsPopoverToggle;
117
+ } // & we're not closing the actions popover toggle
118
+ );
119
+ if (shouldDispatchEvent) {
107
120
  // Trick the focus trap lib into registering an outside click -
108
- // the drag/drop lib otherwise otherwise prevents the event 💀
121
+ // the drag/drop lib otherwise prevents the event 💀
109
122
  document.dispatchEvent(new MouseEvent('mousedown'));
110
123
  }
111
124
  setTimeout(function () {
@@ -33,11 +33,8 @@ import { euiFormRowStyles } from './form_row.styles';
33
33
  import { jsx as ___EmotionJSX } from "@emotion/react";
34
34
  export var DISPLAYS = ['row', 'columnCompressed', 'center', 'centerCompressed',
35
35
  /**
36
- * @deprecated
37
- */
38
- 'columnCompressedSwitch',
39
- /**
40
- * @deprecated
36
+ * This currently does not affect styles/appearances
37
+ * in EUI's present primary theme, but may in the future.
41
38
  */
42
39
  'rowCompressed'];
43
40
  export var EuiFormRow = function EuiFormRow(_ref) {
@@ -175,13 +172,11 @@ EuiFormRow.propTypes = {
175
172
  css: PropTypes.any,
176
173
  /**
177
174
  * - `columnCompressed` creates a compressed and horizontal layout
178
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
179
175
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
180
176
  * - `rowCompressed` - **deprecated**, does not currently affect styling
181
177
  */
182
178
  /**
183
179
  * - `columnCompressed` creates a compressed and horizontal layout
184
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
185
180
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
186
181
  * - `rowCompressed` - **deprecated**, does not currently affect styling
187
182
  */
@@ -22,17 +22,11 @@ export var euiFormRowStyles = function euiFormRowStyles(euiThemeContext) {
22
22
  fullWidth: /*#__PURE__*/css(logicalCSS('max-width', '100%'), ";;label:fullWidth;"),
23
23
  // Skip css`` to avoid generating an extra className
24
24
  row: "\n flex-direction: column;\n row-gap: ".concat(euiTheme.size.xs, ";\n\n .euiFormRow__labelWrapper {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n\n + .euiFormRow {\n ").concat(logicalCSS('margin-top', euiTheme.size.base), "\n }\n "),
25
- // No difference from the uncompressed row for this current theme AFAICT
26
- // TODO: Deprecate prop
25
+ // No difference from the uncompressed row for the current EUI theme
27
26
  get rowCompressed() {
28
27
  return this.row;
29
28
  },
30
29
  columnCompressed: /*#__PURE__*/css("flex-direction:row;align-items:stretch;column-gap:", euiTheme.size.s, ";.euiFormRow__label{hyphens:auto;}.euiFormRow__labelWrapper{flex-basis:calc(33% - ", euiTheme.size.s, ");", logicalCSS('min-width', 0), " line-height:", controlCompressedHeight, ";}.euiFormRow__fieldWrapper{flex-basis:67%;", logicalCSS('min-width', 0), ";}+.euiFormRow{", logicalCSS('margin-top', euiTheme.size.s), ";}&:has(.euiSwitch){&:not(:first-child){", logicalCSS('margin-top', euiTheme.size.m), ";}&:not(:last-child){", logicalCSS('margin-bottom', euiTheme.size.m), ";}.euiFormRow__labelWrapper{line-height:", euiTheme.size.base, ";}};label:columnCompressed;"),
31
- // Handled by :has CSS now rather than a separate modifier/prop
32
- // TODO: Deprecate prop
33
- get columnCompressedSwitch() {
34
- return this.columnCompressed;
35
- },
36
30
  // Center display is primarily for inline form rows, which may have have
37
31
  // field content that is shorter than form controls (e.g. switches, text),
38
32
  // and should vertically center said content
package/eui.d.ts CHANGED
@@ -9900,7 +9900,6 @@ declare module '@elastic/eui/src/components/form/form_row/form_row.styles' {
9900
9900
  row: string;
9901
9901
  readonly rowCompressed: string;
9902
9902
  columnCompressed: import("@emotion/utils").SerializedStyles;
9903
- readonly columnCompressedSwitch: import("@emotion/utils").SerializedStyles;
9904
9903
  centerDisplayCss: (compressed: boolean) => string;
9905
9904
  readonly center: import("@emotion/utils").SerializedStyles;
9906
9905
  readonly centerCompressed: import("@emotion/utils").SerializedStyles;
@@ -9910,11 +9909,10 @@ declare module '@elastic/eui/src/components/form/form_row/form_row.styles' {
9910
9909
  declare module '@elastic/eui/src/components/form/form_row/form_row' {
9911
9910
  import { FunctionComponent, HTMLAttributes, ReactElement, ReactNode } from 'react';
9912
9911
  import { ExclusiveUnion, CommonProps } from '@elastic/eui/src/components/common';
9913
- export const DISPLAYS: readonly ["row", "columnCompressed", "center", "centerCompressed", "columnCompressedSwitch", "rowCompressed"];
9912
+ export const DISPLAYS: readonly ["row", "columnCompressed", "center", "centerCompressed", "rowCompressed"];
9914
9913
  export type EuiFormRowDisplayKeys = (typeof DISPLAYS)[number]; type EuiFormRowCommonProps = CommonProps & {
9915
9914
  /**
9916
9915
  * - `columnCompressed` creates a compressed and horizontal layout
9917
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
9918
9916
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
9919
9917
  * - `rowCompressed` - **deprecated**, does not currently affect styling
9920
9918
  */
@@ -67,6 +67,7 @@ var EuiCollapsedNavPopover = exports.EuiCollapsedNavPopover = function EuiCollap
67
67
  display: "block",
68
68
  anchorPosition: "rightUp",
69
69
  panelPaddingSize: "none",
70
+ repositionOnScroll: true,
70
71
  button: (0, _react2.jsx)(_collapsed_nav_button.EuiCollapsedNavButton, {
71
72
  title: title,
72
73
  icon: icon || 'boxesHorizontal',
@@ -319,7 +319,6 @@ var EuiColorPicker = exports.EuiColorPicker = function EuiColorPicker(_ref) {
319
319
  };
320
320
  var showSecondaryInput = mode === 'secondaryInput' || secondaryInputDisplay !== 'none';
321
321
  var inlineInput = showSecondaryInput && (0, _react2.jsx)(_form.EuiFormRow, {
322
- display: "rowCompressed",
323
322
  isInvalid: isInvalid,
324
323
  error: isInvalid ? colorErrorMessage : null
325
324
  }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
@@ -17,16 +17,6 @@ var _react2 = require("@emotion/react");
17
17
  var _excluded = ["role", "tabIndex"],
18
18
  _excluded2 = ["canDragAndDropColumns", "children"],
19
19
  _excluded3 = ["canDragAndDropColumns", "children"];
20
- /*
21
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
- * or more contributor license agreements. Licensed under the Elastic License
23
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
24
- * in compliance with, at your election, the Elastic License 2.0 or the Server
25
- * Side Public License, v 1.
26
- */
27
- /**
28
- * Parent context + EuiDroppable wrapper
29
- */
30
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
31
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
32
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -38,6 +28,20 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
38
28
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
39
29
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
40
30
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
31
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
32
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
34
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
35
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
36
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /*
37
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
38
+ * or more contributor license agreements. Licensed under the Elastic License
39
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
40
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
41
+ * Side Public License, v 1.
42
+ */ /**
43
+ * Parent context + EuiDroppable wrapper
44
+ */
41
45
  var DroppableColumns = exports.DroppableColumns = /*#__PURE__*/(0, _react.memo)(function (_ref) {
42
46
  var columns = _ref.columns,
43
47
  switchColumnPos = _ref.switchColumnPos,
@@ -104,15 +108,22 @@ var DraggableColumn = exports.DraggableColumn = /*#__PURE__*/(0, _react.memo)(fu
104
108
  var _useContext2 = (0, _react.useContext)(_focus.DataGridFocusContext),
105
109
  setFocusedCell = _useContext2.setFocusedCell;
106
110
  var handleOnMouseDown = (0, _react.useCallback)(function (e) {
107
- var openFocusTrap = document.querySelector('[data-focus-lock-disabled="false"]');
108
- if (!!openFocusTrap &&
109
- // If a focus trap is open somewhere on the page
110
- !openFocusTrap.contains(e.target) &&
111
- // & the focus trap doesn't belong to this header
112
- e.target !== actionsPopoverToggle // & we're not closing the actions popover toggle
113
- ) {
111
+ var openFocusTraps = document.querySelectorAll('[data-focus-lock-disabled="false"]');
112
+ var validOpenFocusTraps = _toConsumableArray(openFocusTraps).filter(function (focusTrap) {
113
+ return !focusTrap.contains(e.currentTarget);
114
+ } // remove containing focus traps (e.g. modals or flyouts)
115
+ );
116
+ var shouldDispatchEvent = validOpenFocusTraps.some(function (focusTrap) {
117
+ return !!focusTrap &&
118
+ // If there is a focus trap open
119
+ !focusTrap.contains(e.target) &&
120
+ // & if it doesn't contain the target
121
+ e.target !== actionsPopoverToggle;
122
+ } // & we're not closing the actions popover toggle
123
+ );
124
+ if (shouldDispatchEvent) {
114
125
  // Trick the focus trap lib into registering an outside click -
115
- // the drag/drop lib otherwise otherwise prevents the event 💀
126
+ // the drag/drop lib otherwise prevents the event 💀
116
127
  document.dispatchEvent(new MouseEvent('mousedown'));
117
128
  }
118
129
  setTimeout(function () {
@@ -42,11 +42,8 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
42
42
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
43
43
  var DISPLAYS = exports.DISPLAYS = ['row', 'columnCompressed', 'center', 'centerCompressed',
44
44
  /**
45
- * @deprecated
46
- */
47
- 'columnCompressedSwitch',
48
- /**
49
- * @deprecated
45
+ * This currently does not affect styles/appearances
46
+ * in EUI's present primary theme, but may in the future.
50
47
  */
51
48
  'rowCompressed'];
52
49
  var EuiFormRow = exports.EuiFormRow = function EuiFormRow(_ref) {
@@ -184,13 +181,11 @@ EuiFormRow.propTypes = {
184
181
  css: _propTypes.default.any,
185
182
  /**
186
183
  * - `columnCompressed` creates a compressed and horizontal layout
187
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
188
184
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
189
185
  * - `rowCompressed` - **deprecated**, does not currently affect styling
190
186
  */
191
187
  /**
192
188
  * - `columnCompressed` creates a compressed and horizontal layout
193
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
194
189
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
195
190
  * - `rowCompressed` - **deprecated**, does not currently affect styling
196
191
  */
@@ -28,17 +28,11 @@ var euiFormRowStyles = exports.euiFormRowStyles = function euiFormRowStyles(euiT
28
28
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), ";;label:fullWidth;"),
29
29
  // Skip css`` to avoid generating an extra className
30
30
  row: "\n flex-direction: column;\n row-gap: ".concat(euiTheme.size.xs, ";\n\n .euiFormRow__labelWrapper {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n\n + .euiFormRow {\n ").concat((0, _global_styling.logicalCSS)('margin-top', euiTheme.size.base), "\n }\n "),
31
- // No difference from the uncompressed row for this current theme AFAICT
32
- // TODO: Deprecate prop
31
+ // No difference from the uncompressed row for the current EUI theme
33
32
  get rowCompressed() {
34
33
  return this.row;
35
34
  },
36
35
  columnCompressed: /*#__PURE__*/(0, _react.css)("flex-direction:row;align-items:stretch;column-gap:", euiTheme.size.s, ";.euiFormRow__label{hyphens:auto;}.euiFormRow__labelWrapper{flex-basis:calc(33% - ", euiTheme.size.s, ");", (0, _global_styling.logicalCSS)('min-width', 0), " line-height:", controlCompressedHeight, ";}.euiFormRow__fieldWrapper{flex-basis:67%;", (0, _global_styling.logicalCSS)('min-width', 0), ";}+.euiFormRow{", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), ";}&:has(.euiSwitch){&:not(:first-child){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.m), ";}&:not(:last-child){", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.m), ";}.euiFormRow__labelWrapper{line-height:", euiTheme.size.base, ";}};label:columnCompressed;"),
37
- // Handled by :has CSS now rather than a separate modifier/prop
38
- // TODO: Deprecate prop
39
- get columnCompressedSwitch() {
40
- return this.columnCompressed;
41
- },
42
36
  // Center display is primarily for inline form rows, which may have have
43
37
  // field content that is shorter than form controls (e.g. switches, text),
44
38
  // and should vertically center said content
@@ -49,6 +49,7 @@ export var EuiCollapsedNavPopover = function EuiCollapsedNavPopover(_ref) {
49
49
  display: "block",
50
50
  anchorPosition: "rightUp",
51
51
  panelPaddingSize: "none",
52
+ repositionOnScroll: true,
52
53
  button: ___EmotionJSX(EuiCollapsedNavButton, {
53
54
  title: title,
54
55
  icon: icon || 'boxesHorizontal',
@@ -303,7 +303,6 @@ export var EuiColorPicker = function EuiColorPicker(_ref) {
303
303
  };
304
304
  var showSecondaryInput = mode === 'secondaryInput' || secondaryInputDisplay !== 'none';
305
305
  var inlineInput = showSecondaryInput && ___EmotionJSX(EuiFormRow, {
306
- display: "rowCompressed",
307
306
  isInvalid: isInvalid,
308
307
  error: isInvalid ? colorErrorMessage : null
309
308
  }, ___EmotionJSX(EuiFormControlLayout, {
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
4
  var _excluded = ["role", "tabIndex"],
4
5
  _excluded2 = ["canDragAndDropColumns", "children"],
5
6
  _excluded3 = ["canDragAndDropColumns", "children"];
@@ -88,15 +89,22 @@ export var DraggableColumn = /*#__PURE__*/memo(function (_ref3) {
88
89
  var _useContext2 = useContext(DataGridFocusContext),
89
90
  setFocusedCell = _useContext2.setFocusedCell;
90
91
  var handleOnMouseDown = useCallback(function (e) {
91
- var openFocusTrap = document.querySelector('[data-focus-lock-disabled="false"]');
92
- if (!!openFocusTrap &&
93
- // If a focus trap is open somewhere on the page
94
- !openFocusTrap.contains(e.target) &&
95
- // & the focus trap doesn't belong to this header
96
- e.target !== actionsPopoverToggle // & we're not closing the actions popover toggle
97
- ) {
92
+ var openFocusTraps = document.querySelectorAll('[data-focus-lock-disabled="false"]');
93
+ var validOpenFocusTraps = _toConsumableArray(openFocusTraps).filter(function (focusTrap) {
94
+ return !focusTrap.contains(e.currentTarget);
95
+ } // remove containing focus traps (e.g. modals or flyouts)
96
+ );
97
+ var shouldDispatchEvent = validOpenFocusTraps.some(function (focusTrap) {
98
+ return !!focusTrap &&
99
+ // If there is a focus trap open
100
+ !focusTrap.contains(e.target) &&
101
+ // & if it doesn't contain the target
102
+ e.target !== actionsPopoverToggle;
103
+ } // & we're not closing the actions popover toggle
104
+ );
105
+ if (shouldDispatchEvent) {
98
106
  // Trick the focus trap lib into registering an outside click -
99
- // the drag/drop lib otherwise otherwise prevents the event 💀
107
+ // the drag/drop lib otherwise prevents the event 💀
100
108
  document.dispatchEvent(new MouseEvent('mousedown'));
101
109
  }
102
110
  setTimeout(function () {
@@ -23,11 +23,8 @@ import { euiFormRowStyles } from './form_row.styles';
23
23
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
24
  export var DISPLAYS = ['row', 'columnCompressed', 'center', 'centerCompressed',
25
25
  /**
26
- * @deprecated
27
- */
28
- 'columnCompressedSwitch',
29
- /**
30
- * @deprecated
26
+ * This currently does not affect styles/appearances
27
+ * in EUI's present primary theme, but may in the future.
31
28
  */
32
29
  'rowCompressed'];
33
30
  export var EuiFormRow = function EuiFormRow(_ref) {
@@ -22,17 +22,11 @@ export var euiFormRowStyles = function euiFormRowStyles(euiThemeContext) {
22
22
  fullWidth: /*#__PURE__*/css(logicalCSS('max-width', '100%'), ";;label:fullWidth;"),
23
23
  // Skip css`` to avoid generating an extra className
24
24
  row: "\n flex-direction: column;\n row-gap: ".concat(euiTheme.size.xs, ";\n\n .euiFormRow__labelWrapper {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n\n + .euiFormRow {\n ").concat(logicalCSS('margin-top', euiTheme.size.base), "\n }\n "),
25
- // No difference from the uncompressed row for this current theme AFAICT
26
- // TODO: Deprecate prop
25
+ // No difference from the uncompressed row for the current EUI theme
27
26
  get rowCompressed() {
28
27
  return this.row;
29
28
  },
30
29
  columnCompressed: /*#__PURE__*/css("flex-direction:row;align-items:stretch;column-gap:", euiTheme.size.s, ";.euiFormRow__label{hyphens:auto;}.euiFormRow__labelWrapper{flex-basis:calc(33% - ", euiTheme.size.s, ");", logicalCSS('min-width', 0), " line-height:", controlCompressedHeight, ";}.euiFormRow__fieldWrapper{flex-basis:67%;", logicalCSS('min-width', 0), ";}+.euiFormRow{", logicalCSS('margin-top', euiTheme.size.s), ";}&:has(.euiSwitch){&:not(:first-child){", logicalCSS('margin-top', euiTheme.size.m), ";}&:not(:last-child){", logicalCSS('margin-bottom', euiTheme.size.m), ";}.euiFormRow__labelWrapper{line-height:", euiTheme.size.base, ";}};label:columnCompressed;"),
31
- // Handled by :has CSS now rather than a separate modifier/prop
32
- // TODO: Deprecate prop
33
- get columnCompressedSwitch() {
34
- return this.columnCompressed;
35
- },
36
30
  // Center display is primarily for inline form rows, which may have have
37
31
  // field content that is shorter than form controls (e.g. switches, text),
38
32
  // and should vertically center said content
@@ -58,6 +58,7 @@ var EuiCollapsedNavPopover = exports.EuiCollapsedNavPopover = function EuiCollap
58
58
  display: "block",
59
59
  anchorPosition: "rightUp",
60
60
  panelPaddingSize: "none",
61
+ repositionOnScroll: true,
61
62
  button: (0, _react2.jsx)(_collapsed_nav_button.EuiCollapsedNavButton, {
62
63
  title: title,
63
64
  icon: icon || 'boxesHorizontal',
@@ -313,7 +313,6 @@ var EuiColorPicker = exports.EuiColorPicker = function EuiColorPicker(_ref) {
313
313
  };
314
314
  var showSecondaryInput = mode === 'secondaryInput' || secondaryInputDisplay !== 'none';
315
315
  var inlineInput = showSecondaryInput && (0, _react2.jsx)(_form.EuiFormRow, {
316
- display: "rowCompressed",
317
316
  isInvalid: isInvalid,
318
317
  error: isInvalid ? colorErrorMessage : null
319
318
  }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.DroppableColumns = exports.DraggableColumn = exports.DragOverlay = exports.ConditionalDroppableColumns = exports.ConditionalDraggableColumn = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
12
  var _react = _interopRequireWildcard(require("react"));
12
13
  var _services = require("../../../../services");
13
14
  var _drag_and_drop = require("../../../drag_and_drop");
@@ -96,15 +97,22 @@ var DraggableColumn = exports.DraggableColumn = /*#__PURE__*/(0, _react.memo)(fu
96
97
  var _useContext2 = (0, _react.useContext)(_focus.DataGridFocusContext),
97
98
  setFocusedCell = _useContext2.setFocusedCell;
98
99
  var handleOnMouseDown = (0, _react.useCallback)(function (e) {
99
- var openFocusTrap = document.querySelector('[data-focus-lock-disabled="false"]');
100
- if (!!openFocusTrap &&
101
- // If a focus trap is open somewhere on the page
102
- !openFocusTrap.contains(e.target) &&
103
- // & the focus trap doesn't belong to this header
104
- e.target !== actionsPopoverToggle // & we're not closing the actions popover toggle
105
- ) {
100
+ var openFocusTraps = document.querySelectorAll('[data-focus-lock-disabled="false"]');
101
+ var validOpenFocusTraps = (0, _toConsumableArray2.default)(openFocusTraps).filter(function (focusTrap) {
102
+ return !focusTrap.contains(e.currentTarget);
103
+ } // remove containing focus traps (e.g. modals or flyouts)
104
+ );
105
+ var shouldDispatchEvent = validOpenFocusTraps.some(function (focusTrap) {
106
+ return !!focusTrap &&
107
+ // If there is a focus trap open
108
+ !focusTrap.contains(e.target) &&
109
+ // & if it doesn't contain the target
110
+ e.target !== actionsPopoverToggle;
111
+ } // & we're not closing the actions popover toggle
112
+ );
113
+ if (shouldDispatchEvent) {
106
114
  // Trick the focus trap lib into registering an outside click -
107
- // the drag/drop lib otherwise otherwise prevents the event 💀
115
+ // the drag/drop lib otherwise prevents the event 💀
108
116
  document.dispatchEvent(new MouseEvent('mousedown'));
109
117
  }
110
118
  setTimeout(function () {
@@ -32,11 +32,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
32
32
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
33
33
  var DISPLAYS = exports.DISPLAYS = ['row', 'columnCompressed', 'center', 'centerCompressed',
34
34
  /**
35
- * @deprecated
36
- */
37
- 'columnCompressedSwitch',
38
- /**
39
- * @deprecated
35
+ * This currently does not affect styles/appearances
36
+ * in EUI's present primary theme, but may in the future.
40
37
  */
41
38
  'rowCompressed'];
42
39
  var EuiFormRow = exports.EuiFormRow = function EuiFormRow(_ref) {
@@ -28,17 +28,11 @@ var euiFormRowStyles = exports.euiFormRowStyles = function euiFormRowStyles(euiT
28
28
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), ";;label:fullWidth;"),
29
29
  // Skip css`` to avoid generating an extra className
30
30
  row: "\n flex-direction: column;\n row-gap: ".concat(euiTheme.size.xs, ";\n\n .euiFormRow__labelWrapper {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n\n + .euiFormRow {\n ").concat((0, _global_styling.logicalCSS)('margin-top', euiTheme.size.base), "\n }\n "),
31
- // No difference from the uncompressed row for this current theme AFAICT
32
- // TODO: Deprecate prop
31
+ // No difference from the uncompressed row for the current EUI theme
33
32
  get rowCompressed() {
34
33
  return this.row;
35
34
  },
36
35
  columnCompressed: /*#__PURE__*/(0, _react.css)("flex-direction:row;align-items:stretch;column-gap:", euiTheme.size.s, ";.euiFormRow__label{hyphens:auto;}.euiFormRow__labelWrapper{flex-basis:calc(33% - ", euiTheme.size.s, ");", (0, _global_styling.logicalCSS)('min-width', 0), " line-height:", controlCompressedHeight, ";}.euiFormRow__fieldWrapper{flex-basis:67%;", (0, _global_styling.logicalCSS)('min-width', 0), ";}+.euiFormRow{", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), ";}&:has(.euiSwitch){&:not(:first-child){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.m), ";}&:not(:last-child){", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.m), ";}.euiFormRow__labelWrapper{line-height:", euiTheme.size.base, ";}};label:columnCompressed;"),
37
- // Handled by :has CSS now rather than a separate modifier/prop
38
- // TODO: Deprecate prop
39
- get columnCompressedSwitch() {
40
- return this.columnCompressed;
41
- },
42
36
  // Center display is primarily for inline form rows, which may have have
43
37
  // field content that is shorter than form controls (e.g. switches, text),
44
38
  // and should vertically center said content
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "97.3.1",
4
+ "version": "98.0.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -59,6 +59,7 @@ var EuiCollapsedNavPopover = exports.EuiCollapsedNavPopover = function EuiCollap
59
59
  display: "block",
60
60
  anchorPosition: "rightUp",
61
61
  panelPaddingSize: "none",
62
+ repositionOnScroll: true,
62
63
  button: (0, _react2.jsx)(_collapsed_nav_button.EuiCollapsedNavButton, {
63
64
  title: title,
64
65
  icon: icon || 'boxesHorizontal',
@@ -314,7 +314,6 @@ var EuiColorPicker = exports.EuiColorPicker = function EuiColorPicker(_ref) {
314
314
  };
315
315
  var showSecondaryInput = mode === 'secondaryInput' || secondaryInputDisplay !== 'none';
316
316
  var inlineInput = showSecondaryInput && (0, _react2.jsx)(_form.EuiFormRow, {
317
- display: "rowCompressed",
318
317
  isInvalid: isInvalid,
319
318
  error: isInvalid ? colorErrorMessage : null
320
319
  }, (0, _react2.jsx)(_form.EuiFormControlLayout, {
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.DroppableColumns = exports.DraggableColumn = exports.DragOverlay = exports.ConditionalDroppableColumns = exports.ConditionalDraggableColumn = void 0;
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
12
  var _react = _interopRequireWildcard(require("react"));
12
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
14
  var _services = require("../../../../services");
@@ -101,15 +102,22 @@ var DraggableColumn = exports.DraggableColumn = /*#__PURE__*/(0, _react.memo)(fu
101
102
  var _useContext2 = (0, _react.useContext)(_focus.DataGridFocusContext),
102
103
  setFocusedCell = _useContext2.setFocusedCell;
103
104
  var handleOnMouseDown = (0, _react.useCallback)(function (e) {
104
- var openFocusTrap = document.querySelector('[data-focus-lock-disabled="false"]');
105
- if (!!openFocusTrap &&
106
- // If a focus trap is open somewhere on the page
107
- !openFocusTrap.contains(e.target) &&
108
- // & the focus trap doesn't belong to this header
109
- e.target !== actionsPopoverToggle // & we're not closing the actions popover toggle
110
- ) {
105
+ var openFocusTraps = document.querySelectorAll('[data-focus-lock-disabled="false"]');
106
+ var validOpenFocusTraps = (0, _toConsumableArray2.default)(openFocusTraps).filter(function (focusTrap) {
107
+ return !focusTrap.contains(e.currentTarget);
108
+ } // remove containing focus traps (e.g. modals or flyouts)
109
+ );
110
+ var shouldDispatchEvent = validOpenFocusTraps.some(function (focusTrap) {
111
+ return !!focusTrap &&
112
+ // If there is a focus trap open
113
+ !focusTrap.contains(e.target) &&
114
+ // & if it doesn't contain the target
115
+ e.target !== actionsPopoverToggle;
116
+ } // & we're not closing the actions popover toggle
117
+ );
118
+ if (shouldDispatchEvent) {
111
119
  // Trick the focus trap lib into registering an outside click -
112
- // the drag/drop lib otherwise otherwise prevents the event 💀
120
+ // the drag/drop lib otherwise prevents the event 💀
113
121
  document.dispatchEvent(new MouseEvent('mousedown'));
114
122
  }
115
123
  setTimeout(function () {
@@ -33,11 +33,8 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
33
33
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
34
34
  var DISPLAYS = exports.DISPLAYS = ['row', 'columnCompressed', 'center', 'centerCompressed',
35
35
  /**
36
- * @deprecated
37
- */
38
- 'columnCompressedSwitch',
39
- /**
40
- * @deprecated
36
+ * This currently does not affect styles/appearances
37
+ * in EUI's present primary theme, but may in the future.
41
38
  */
42
39
  'rowCompressed'];
43
40
  var EuiFormRow = exports.EuiFormRow = function EuiFormRow(_ref) {
@@ -175,13 +172,11 @@ EuiFormRow.propTypes = {
175
172
  css: _propTypes.default.any,
176
173
  /**
177
174
  * - `columnCompressed` creates a compressed and horizontal layout
178
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
179
175
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
180
176
  * - `rowCompressed` - **deprecated**, does not currently affect styling
181
177
  */
182
178
  /**
183
179
  * - `columnCompressed` creates a compressed and horizontal layout
184
- * - `columnCompressedSwitch` - **deprecated**, use `columnCompressed` instead
185
180
  * - `center`/`centerCompressed` helps align non-input content better with inline form layouts
186
181
  * - `rowCompressed` - **deprecated**, does not currently affect styling
187
182
  */
@@ -28,17 +28,11 @@ var euiFormRowStyles = exports.euiFormRowStyles = function euiFormRowStyles(euiT
28
28
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), ";;label:fullWidth;"),
29
29
  // Skip css`` to avoid generating an extra className
30
30
  row: "\n flex-direction: column;\n row-gap: ".concat(euiTheme.size.xs, ";\n\n .euiFormRow__labelWrapper {\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n }\n\n + .euiFormRow {\n ").concat((0, _global_styling.logicalCSS)('margin-top', euiTheme.size.base), "\n }\n "),
31
- // No difference from the uncompressed row for this current theme AFAICT
32
- // TODO: Deprecate prop
31
+ // No difference from the uncompressed row for the current EUI theme
33
32
  get rowCompressed() {
34
33
  return this.row;
35
34
  },
36
35
  columnCompressed: /*#__PURE__*/(0, _react.css)("flex-direction:row;align-items:stretch;column-gap:", euiTheme.size.s, ";.euiFormRow__label{hyphens:auto;}.euiFormRow__labelWrapper{flex-basis:calc(33% - ", euiTheme.size.s, ");", (0, _global_styling.logicalCSS)('min-width', 0), " line-height:", controlCompressedHeight, ";}.euiFormRow__fieldWrapper{flex-basis:67%;", (0, _global_styling.logicalCSS)('min-width', 0), ";}+.euiFormRow{", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), ";}&:has(.euiSwitch){&:not(:first-child){", (0, _global_styling.logicalCSS)('margin-top', euiTheme.size.m), ";}&:not(:last-child){", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.m), ";}.euiFormRow__labelWrapper{line-height:", euiTheme.size.base, ";}};label:columnCompressed;"),
37
- // Handled by :has CSS now rather than a separate modifier/prop
38
- // TODO: Deprecate prop
39
- get columnCompressedSwitch() {
40
- return this.columnCompressed;
41
- },
42
36
  // Center display is primarily for inline form rows, which may have have
43
37
  // field content that is shorter than form controls (e.g. switches, text),
44
38
  // and should vertically center said content