@elastic/eui 97.0.0 → 97.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/es/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
  2. package/es/components/datagrid/body/cell/focus_utils.js +14 -4
  3. package/es/components/datagrid/body/data_grid_body.js +2 -1
  4. package/es/components/datagrid/body/data_grid_body_custom.js +5 -2
  5. package/es/components/datagrid/body/data_grid_body_virtualized.js +8 -4
  6. package/es/components/datagrid/body/header/column_actions.js +262 -27
  7. package/es/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +10 -4
  8. package/es/components/datagrid/body/header/{data_grid_column_resizer.styles.js → column_resizer.styles.js} +6 -1
  9. package/es/components/datagrid/body/header/column_sorting.js +134 -0
  10. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +3 -3
  11. package/es/components/datagrid/body/header/data_grid_header_cell.js +86 -305
  12. package/es/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
  13. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +19 -17
  14. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
  15. package/es/components/datagrid/body/header/data_grid_header_row.js +25 -10
  16. package/es/components/datagrid/body/header/draggable_columns.js +301 -0
  17. package/es/components/datagrid/body/header/draggable_columns.styles.js +38 -0
  18. package/es/components/datagrid/data_grid.js +2 -1
  19. package/es/components/datagrid/data_grid.stories.utils.js +9 -6
  20. package/es/components/datagrid/utils/col_widths.js +4 -6
  21. package/es/components/datagrid/utils/focus.js +2 -2
  22. package/es/components/datagrid/utils/scrolling.js +13 -10
  23. package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
  24. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
  25. package/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
  26. package/es/components/date_picker/super_date_picker/super_date_picker.js +27 -5
  27. package/es/components/drag_and_drop/draggable.js +13 -5
  28. package/es/components/header/header.styles.js +6 -12
  29. package/es/components/header/header_links/header_links.js +1 -1
  30. package/es/components/header/header_links/header_links.styles.js +1 -0
  31. package/es/components/page_template/inner/page_inner.styles.js +3 -4
  32. package/es/components/tabs/tab.js +1 -1
  33. package/eui.d.ts +417 -307
  34. package/i18ntokens.json +175 -175
  35. package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
  36. package/lib/components/datagrid/body/cell/focus_utils.js +14 -4
  37. package/lib/components/datagrid/body/data_grid_body.js +2 -1
  38. package/lib/components/datagrid/body/data_grid_body_custom.js +5 -2
  39. package/lib/components/datagrid/body/data_grid_body_virtualized.js +8 -4
  40. package/lib/components/datagrid/body/header/column_actions.js +265 -29
  41. package/lib/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +11 -5
  42. package/{optimize/lib/components/datagrid/body/header/data_grid_column_resizer.styles.js → lib/components/datagrid/body/header/column_resizer.styles.js} +6 -1
  43. package/lib/components/datagrid/body/header/column_sorting.js +144 -0
  44. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +3 -3
  45. package/lib/components/datagrid/body/header/data_grid_header_cell.js +86 -305
  46. package/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
  47. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +19 -17
  48. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
  49. package/lib/components/datagrid/body/header/data_grid_header_row.js +24 -9
  50. package/lib/components/datagrid/body/header/draggable_columns.js +308 -0
  51. package/lib/components/datagrid/body/header/draggable_columns.styles.js +42 -0
  52. package/lib/components/datagrid/data_grid.js +2 -1
  53. package/lib/components/datagrid/data_grid.stories.utils.js +9 -6
  54. package/lib/components/datagrid/utils/col_widths.js +4 -6
  55. package/lib/components/datagrid/utils/focus.js +2 -2
  56. package/lib/components/datagrid/utils/scrolling.js +13 -10
  57. package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
  58. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
  59. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
  60. package/lib/components/date_picker/super_date_picker/super_date_picker.js +27 -5
  61. package/lib/components/drag_and_drop/draggable.js +13 -5
  62. package/lib/components/header/header.styles.js +6 -12
  63. package/lib/components/header/header_links/header_links.js +1 -1
  64. package/lib/components/header/header_links/header_links.styles.js +1 -0
  65. package/lib/components/page_template/inner/page_inner.styles.js +3 -4
  66. package/lib/components/tabs/tab.js +1 -1
  67. package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
  68. package/optimize/es/components/datagrid/body/cell/focus_utils.js +13 -4
  69. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +3 -1
  70. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +6 -3
  71. package/optimize/es/components/datagrid/body/header/column_actions.js +250 -26
  72. package/optimize/es/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +8 -3
  73. package/optimize/es/components/datagrid/body/header/{data_grid_column_resizer.styles.js → column_resizer.styles.js} +6 -1
  74. package/optimize/es/components/datagrid/body/header/column_sorting.js +134 -0
  75. package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  76. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +82 -302
  77. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
  78. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +15 -14
  79. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
  80. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +25 -10
  81. package/optimize/es/components/datagrid/body/header/draggable_columns.js +223 -0
  82. package/optimize/es/components/datagrid/body/header/draggable_columns.styles.js +38 -0
  83. package/optimize/es/components/datagrid/data_grid.js +2 -1
  84. package/optimize/es/components/datagrid/data_grid.stories.utils.js +7 -5
  85. package/optimize/es/components/datagrid/utils/col_widths.js +4 -6
  86. package/optimize/es/components/datagrid/utils/focus.js +2 -2
  87. package/optimize/es/components/datagrid/utils/scrolling.js +13 -10
  88. package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +5 -1
  89. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  90. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +6 -2
  91. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +11 -5
  92. package/optimize/es/components/drag_and_drop/draggable.js +8 -3
  93. package/optimize/es/components/header/header.styles.js +6 -12
  94. package/optimize/es/components/header/header_links/header_links.js +1 -1
  95. package/optimize/es/components/header/header_links/header_links.styles.js +1 -0
  96. package/optimize/es/components/page_template/inner/page_inner.styles.js +3 -4
  97. package/optimize/es/components/tabs/tab.js +1 -1
  98. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
  99. package/optimize/lib/components/datagrid/body/cell/focus_utils.js +13 -4
  100. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +3 -1
  101. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +6 -3
  102. package/optimize/lib/components/datagrid/body/header/column_actions.js +253 -27
  103. package/optimize/lib/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +9 -4
  104. package/{test-env/components/datagrid/body/header/data_grid_column_resizer.styles.js → optimize/lib/components/datagrid/body/header/column_resizer.styles.js} +6 -1
  105. package/optimize/lib/components/datagrid/body/header/column_sorting.js +144 -0
  106. package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
  107. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +80 -300
  108. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
  109. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +15 -14
  110. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
  111. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +24 -9
  112. package/optimize/lib/components/datagrid/body/header/draggable_columns.js +231 -0
  113. package/optimize/lib/components/datagrid/body/header/draggable_columns.styles.js +43 -0
  114. package/optimize/lib/components/datagrid/data_grid.js +2 -1
  115. package/optimize/lib/components/datagrid/data_grid.stories.utils.js +7 -5
  116. package/optimize/lib/components/datagrid/utils/col_widths.js +4 -6
  117. package/optimize/lib/components/datagrid/utils/focus.js +2 -2
  118. package/optimize/lib/components/datagrid/utils/scrolling.js +13 -10
  119. package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +5 -1
  120. package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  121. package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +6 -2
  122. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +11 -5
  123. package/optimize/lib/components/drag_and_drop/draggable.js +8 -3
  124. package/optimize/lib/components/header/header.styles.js +6 -12
  125. package/optimize/lib/components/header/header_links/header_links.js +1 -1
  126. package/optimize/lib/components/header/header_links/header_links.styles.js +1 -0
  127. package/optimize/lib/components/page_template/inner/page_inner.styles.js +3 -4
  128. package/optimize/lib/components/tabs/tab.js +1 -1
  129. package/package.json +1 -1
  130. package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +4 -2
  131. package/test-env/components/datagrid/body/cell/focus_utils.js +13 -4
  132. package/test-env/components/datagrid/body/data_grid_body.js +2 -1
  133. package/test-env/components/datagrid/body/data_grid_body_custom.js +5 -2
  134. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +8 -4
  135. package/test-env/components/datagrid/body/header/column_actions.js +261 -27
  136. package/test-env/components/datagrid/body/header/{data_grid_column_resizer.js → column_resizer.js} +11 -5
  137. package/{lib/components/datagrid/body/header/data_grid_column_resizer.styles.js → test-env/components/datagrid/body/header/column_resizer.styles.js} +6 -1
  138. package/test-env/components/datagrid/body/header/column_sorting.js +144 -0
  139. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +3 -3
  140. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +82 -301
  141. package/test-env/components/datagrid/body/header/data_grid_header_cell.styles.js +1 -1
  142. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +19 -17
  143. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -2
  144. package/test-env/components/datagrid/body/header/data_grid_header_row.js +24 -9
  145. package/test-env/components/datagrid/body/header/draggable_columns.js +305 -0
  146. package/test-env/components/datagrid/body/header/draggable_columns.styles.js +43 -0
  147. package/test-env/components/datagrid/data_grid.js +2 -1
  148. package/test-env/components/datagrid/data_grid.stories.utils.js +9 -6
  149. package/test-env/components/datagrid/utils/col_widths.js +4 -6
  150. package/test-env/components/datagrid/utils/focus.js +2 -2
  151. package/test-env/components/datagrid/utils/scrolling.js +13 -10
  152. package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
  153. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
  154. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
  155. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +27 -5
  156. package/test-env/components/drag_and_drop/draggable.js +13 -5
  157. package/test-env/components/header/header.styles.js +6 -12
  158. package/test-env/components/header/header_links/header_links.js +1 -1
  159. package/test-env/components/header/header_links/header_links.styles.js +1 -0
  160. package/test-env/components/page_template/inner/page_inner.styles.js +3 -4
  161. package/test-env/components/tabs/tab.js +1 -1
@@ -45,7 +45,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
45
45
  * in compliance with, at your election, the Elastic License 2.0 or the Server
46
46
  * Side Public License, v 1.
47
47
  */ // eslint-disable-line import/named
48
- function isRangeInvalid(start, end) {
48
+ function isRangeInvalid(start, end, minDate, maxDate) {
49
49
  if (start === 'now' && end === 'now') {
50
50
  return true;
51
51
  }
@@ -53,7 +53,7 @@ function isRangeInvalid(start, end) {
53
53
  var endMoment = _datemath.default.parse(end, {
54
54
  roundUp: true
55
55
  });
56
- var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !(0, _moment.default)(startMoment).isValid() || !(0, _moment.default)(endMoment).isValid() || startMoment.isAfter(endMoment);
56
+ var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !(0, _moment.default)(startMoment).isValid() || !(0, _moment.default)(endMoment).isValid() || startMoment.isAfter(endMoment) || endMoment.isBefore(startMoment) || minDate != null && startMoment.isBefore(minDate) || maxDate != null && endMoment.isAfter(maxDate);
57
57
  return isInvalid;
58
58
  }
59
59
  var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
@@ -72,7 +72,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
72
72
  },
73
73
  start: _this.props.start,
74
74
  end: _this.props.end,
75
- isInvalid: isRangeInvalid(_this.props.start, _this.props.end),
75
+ isInvalid: isRangeInvalid(_this.props.start, _this.props.end, _this.props.minDate, _this.props.maxDate),
76
76
  hasChanged: false,
77
77
  showPrettyDuration: (0, _pretty_duration.showPrettyDuration)(_this.props.start, _this.props.end, _this.props.commonlyUsedRanges),
78
78
  isStartDatePopoverOpen: false,
@@ -81,7 +81,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
81
81
  (0, _defineProperty2.default)(_this, "setTime", function (_ref) {
82
82
  var end = _ref.end,
83
83
  start = _ref.start;
84
- var isInvalid = isRangeInvalid(start, end);
84
+ var isInvalid = isRangeInvalid(start, end, _this.props.minDate, _this.props.maxDate);
85
85
  _this.setState({
86
86
  start: start,
87
87
  end: end,
@@ -270,6 +270,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
270
270
  locale = _this$props3.locale,
271
271
  timeFormat = _this$props3.timeFormat,
272
272
  utcOffset = _this$props3.utcOffset,
273
+ minDate = _this$props3.minDate,
274
+ maxDate = _this$props3.maxDate,
273
275
  compressed = _this$props3.compressed,
274
276
  onFocus = _this$props3.onFocus,
275
277
  styles = _this$props3.memoizedStyles;
@@ -344,6 +346,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
344
346
  utcOffset: utcOffset,
345
347
  timeFormat: timeFormat,
346
348
  locale: locale || contextLocale,
349
+ minDate: minDate,
350
+ maxDate: maxDate,
347
351
  canRoundRelativeUnits: canRoundRelativeUnits,
348
352
  isOpen: _this.state.isStartDatePopoverOpen,
349
353
  onPopoverToggle: _this.onStartDatePopoverToggle,
@@ -366,6 +370,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
366
370
  utcOffset: utcOffset,
367
371
  timeFormat: timeFormat,
368
372
  locale: locale || contextLocale,
373
+ minDate: minDate,
374
+ maxDate: maxDate,
369
375
  canRoundRelativeUnits: canRoundRelativeUnits,
370
376
  roundUp: true,
371
377
  isOpen: _this.state.isEndDatePopoverOpen,
@@ -471,7 +477,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
471
477
  },
472
478
  start: nextProps.start,
473
479
  end: nextProps.end,
474
- isInvalid: isRangeInvalid(nextProps.start, nextProps.end),
480
+ isInvalid: isRangeInvalid(nextProps.start, nextProps.end, nextProps.minDate, nextProps.maxDate),
475
481
  hasChanged: false,
476
482
  showPrettyDuration: (0, _pretty_duration.showPrettyDuration)(nextProps.start, nextProps.end, nextProps.commonlyUsedRanges)
477
483
  };
@@ -54,6 +54,7 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
54
54
  cloneItems = _useContext.cloneItems;
55
55
  var euiTheme = (0, _services.useEuiTheme)();
56
56
  var styles = (0, _draggable.euiDraggableStyles)(euiTheme);
57
+ var hasCustomDragHandle = customDragHandle !== false;
57
58
  return (0, _react2.jsx)(_dnd.Draggable, (0, _extends2.default)({
58
59
  draggableId: draggableId,
59
60
  index: index,
@@ -61,13 +62,14 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
61
62
  }, rest), function (provided, snapshot, rubric) {
62
63
  var _provided$dragHandleP, _provided$dragHandleP2;
63
64
  var isDragging = snapshot.isDragging;
65
+ var isFullyCustomDragHandle = customDragHandle === 'custom';
64
66
  var cssStyles = [styles.euiDraggable, cloneItems && !isDragging && styles.hasClone, isDragging && styles.isDragging, isRemovable && styles.isRemovable, styles.spacing[spacing]];
65
67
  var classes = (0, _classnames.default)('euiDraggable', className);
66
68
  var childClasses = (0, _classnames.default)('euiDraggable__item', {
67
69
  'euiDraggable__item-isDisabled': isDragDisabled
68
70
  });
69
71
  var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children;
70
- var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", (0, _extends2.default)({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
72
+ var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", (0, _extends2.default)({}, provided.draggableProps, !hasCustomDragHandle ? provided.dragHandleProps : {}, {
71
73
  ref: provided.innerRef,
72
74
  "data-test-subj": dataTestSubj,
73
75
  className: classes,
@@ -77,11 +79,14 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
77
79
  // interactive element. Screen readers will cue users that this is a container
78
80
  // and has one or more elements inside that are part of a related group.
79
81
  ,
80
- role: hasInteractiveChildren ? 'group' : (_provided$dragHandleP = provided.dragHandleProps) === null || _provided$dragHandleP === void 0 ? void 0 : _provided$dragHandleP.role
82
+ role: isFullyCustomDragHandle ? undefined // prevent wrapper role from removing semantics of the children
83
+ : hasInteractiveChildren ? 'group' : (_provided$dragHandleP = provided.dragHandleProps) === null || _provided$dragHandleP === void 0 ? void 0 : _provided$dragHandleP.role
81
84
  // If the container includes an interactive element, we remove the tabindex=0
82
85
  // because [role="group"] does not permit or warrant a tab stop
86
+ // additionally we remove the tabindex when the child is a fully custom handle
87
+ // that has its own tabindex and handle props
83
88
  ,
84
- tabIndex: hasInteractiveChildren ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
89
+ tabIndex: hasInteractiveChildren || isFullyCustomDragHandle ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
85
90
  }), (0, _services.cloneElementWithCss)(DraggableElement, {
86
91
  className: (0, _classnames.default)(DraggableElement.props.className, childClasses),
87
92
  css: [_draggable.euiDraggableItemStyles.euiDraggable__item, isDragDisabled && _draggable.euiDraggableItemStyles.disabled]
@@ -26,23 +26,18 @@ var euiHeaderVariables = exports.euiHeaderVariables = function euiHeaderVariable
26
26
  };
27
27
  };
28
28
  var euiHeaderStyles = exports.euiHeaderStyles = function euiHeaderStyles(euiThemeContext) {
29
- var euiTheme = euiThemeContext.euiTheme,
30
- colorMode = euiThemeContext.colorMode;
29
+ var euiTheme = euiThemeContext.euiTheme;
31
30
  var _euiHeaderVariables = euiHeaderVariables(euiThemeContext),
32
31
  height = _euiHeaderVariables.height,
33
32
  padding = _euiHeaderVariables.padding;
34
-
35
- // Curated border color to fade into the shadow without looking too much like a border
36
- // It adds separation between the header and flyout
37
- var borderColor = colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.emptyShade, 0.35) : (0, _services.shade)(euiTheme.border.color, 0.03);
38
33
  return {
39
- euiHeader: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:space-between;", (0, _global_styling.logicalCSS)('height', height), " ", (0, _global_styling.logicalCSS)('padding-horizontal', padding), " ", (0, _mixins.euiShadowSmall)(euiThemeContext), ";;label:euiHeader;"),
34
+ euiHeader: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:space-between;", (0, _global_styling.logicalCSS)('height', height), " ", (0, _global_styling.logicalCSS)('padding-horizontal', padding), " ", (0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), " ", (0, _mixins.euiShadowSmall)(euiThemeContext), ";;label:euiHeader;"),
40
35
  // Position
41
36
  static: /*#__PURE__*/(0, _react.css)("z-index:", Number(euiTheme.levels.header) - 1, ";position:relative;;label:static;"),
42
37
  fixed: /*#__PURE__*/(0, _react.css)("z-index:", euiTheme.levels.header, ";position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('horizontal', 0), ";;label:fixed;"),
43
38
  // Theme
44
- default: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(borderColor)), ";;label:default;"),
45
- dark: /*#__PURE__*/(0, _react.css)(euiHeaderDarkStyles(euiThemeContext, borderColor), ";label:dark;")
39
+ default: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";;label:default;"),
40
+ dark: /*#__PURE__*/(0, _react.css)(euiHeaderDarkStyles(euiThemeContext), ";label:dark;")
46
41
  };
47
42
  };
48
43
 
@@ -56,12 +51,11 @@ var euiHeaderStyles = exports.euiHeaderStyles = function euiHeaderStyles(euiThem
56
51
  * by Kibana in the near future, at which point we can remove this
57
52
  */
58
53
 
59
- var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext, defaultBorderColor) {
54
+ var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
60
55
  var euiTheme = euiThemeContext.euiTheme,
61
56
  colorMode = euiThemeContext.colorMode;
62
57
  var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
63
58
  controlPlaceholderText = _euiFormVariables.controlPlaceholderText;
64
59
  var backgroundColor = colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.lightestShade, 0.5) : (0, _services.shade)(euiTheme.colors.darkestShade, 0.28);
65
- var borderColor = colorMode === 'DARK' ? defaultBorderColor : backgroundColor;
66
- return "\n background-color: ".concat(backgroundColor, ";\n ").concat((0, _global_styling.logicalCSS)('border-bottom-color', borderColor), "\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat((0, _services.makeHighContrastColor)(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat((0, _services.shade)(euiTheme.colors.primary, 0.5), ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n &--group {\n border-color: ").concat((0, _services.transparentize)(euiTheme.colors.ghost, 0.3), ";\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(euiTheme.colors.ghost, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat((0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor), ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
60
+ return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat((0, _services.makeHighContrastColor)(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat((0, _services.shade)(euiTheme.colors.primary, 0.5), ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n &--group {\n border-color: ").concat((0, _services.transparentize)(euiTheme.colors.ghost, 0.3), ";\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(euiTheme.colors.ghost, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat((0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor), ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
67
61
  };
@@ -30,7 +30,7 @@ var _excluded = ["children", "className", "gutterSize", "popoverBreakpoints", "p
30
30
  */
31
31
  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
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
- var GUTTER_SIZES = exports.GUTTER_SIZES = ['xs', 's', 'm', 'l'];
33
+ var GUTTER_SIZES = exports.GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
34
34
  var EuiHeaderLinks = exports.EuiHeaderLinks = function EuiHeaderLinks(_ref) {
35
35
  var children = _ref.children,
36
36
  className = _ref.className,
@@ -35,6 +35,7 @@ var euiHeaderLinksStyles = exports.euiHeaderLinksStyles = function euiHeaderLink
35
35
  euiHeaderLinks: _ref2,
36
36
  euiHeaderLinks__list: _ref,
37
37
  gutterSizes: {
38
+ xxs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.xs, ";;label:xxs;"),
38
39
  xs: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.s, ";;label:xs;"),
39
40
  s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:s;"),
40
41
  m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
@@ -7,7 +7,6 @@ exports.euiPageInnerStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _mixins = require("../../../themes/amsterdam/global_styling/mixins");
9
9
  var _global_styling = require("../../../global_styling");
10
- var _services = require("../../../services");
11
10
  /*
12
11
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
12
  * or more contributor license agreements. Licensed under the Elastic License
@@ -17,13 +16,13 @@ var _services = require("../../../services");
17
16
  */
18
17
 
19
18
  var euiPageInnerStyles = exports.euiPageInnerStyles = function euiPageInnerStyles(euiThemeContext) {
20
- var borderColor = (0, _services.transparentize)(euiThemeContext.euiTheme.colors.lightShade, 0.7);
19
+ var euiTheme = euiThemeContext.euiTheme;
21
20
  return {
22
21
  euiPageInner: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:column;align-items:stretch;flex:1 1 100%;", (0, _global_styling.logicalCSS)('max-width', '100%'), " ", (0, _global_styling.logicalCSS)('min-width', '0'), ";;label:euiPageInner;"),
23
22
  panelled: /*#__PURE__*/(0, _react.css)("background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'plain'), ";", (0, _mixins.euiShadow)(euiThemeContext, 'm'), ";;label:panelled;"),
24
23
  border: {
25
- top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', "".concat(euiThemeContext.euiTheme.border.width.thin, " solid ").concat(borderColor)), ";;label:top;"),
26
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', "".concat(euiThemeContext.euiTheme.border.width.thin, " solid ").concat(borderColor)), ";;label:left;")
24
+ top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";;label:top;"),
25
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thin), ";;label:left;")
27
26
  }
28
27
  };
29
28
  };
@@ -74,7 +74,7 @@ var EuiTab = exports.EuiTab = function EuiTab(_ref) {
74
74
  target: target,
75
75
  rel: secureRel
76
76
  }, rest), prependNode, (0, _react2.jsx)("span", {
77
- className: "euiTab__content",
77
+ className: "euiTab__content eui-textTruncate",
78
78
  css: cssTabContentStyles
79
79
  }, children), appendNode);
80
80
  }
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.0.0",
4
+ "version": "97.2.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -47,6 +47,7 @@ var euiDataGridCellOutlineSelectors = exports.euiDataGridCellOutlineSelectors =
47
47
 
48
48
  // Cell header specific selectors
49
49
  var headerActionsOpen = '.euiDataGridHeaderCell--isActionsPopoverOpen';
50
+ var isMoving = '[data-column-moving]'; // prevents the header column actions hover animation from replaying on column move
50
51
 
51
52
  // Utils
52
53
  var selectors = function selectors() {
@@ -80,10 +81,11 @@ var euiDataGridCellOutlineSelectors = exports.euiDataGridCellOutlineSelectors =
80
81
  hoverAnimation: hoverNot(selectors(focus, isOpen, isClosing))
81
82
  },
82
83
  header: {
83
- focus: is(selectors(focus, focusWithin, headerActionsOpen)),
84
+ focus: is(selectors(focus, focusWithin, headerActionsOpen, isMoving)),
84
85
  // :focus-within here is primarily intended for when the column actions button has been clicked twice
85
86
  focusTrapped: _(isEntered),
86
- hideActions: not(selectors(hover, focusWithin, headerActionsOpen))
87
+ showActions: is(selectors(hover, focusWithin, headerActionsOpen, isMoving)),
88
+ hideActions: not(selectors(hover, focusWithin, headerActionsOpen, isMoving))
87
89
  }
88
90
  };
89
91
  };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.HandleInteractiveChildren = exports.FocusTrappedChildren = void 0;
9
+ var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
9
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -108,16 +109,24 @@ var FocusTrappedChildren = exports.FocusTrappedChildren = function FocusTrappedC
108
109
 
109
110
  // direct DOM manipulation as workaround to attach required hints
110
111
  (0, _react.useEffect)(function () {
112
+ var _currentAriaDescribed;
111
113
  var currentAriaDescribedbyId = cellEl.getAttribute('aria-describedby');
112
- cellEl.setAttribute('aria-describedby', (0, _classnames.default)(currentAriaDescribedbyId, ariaDescribedById));
114
+ // A11y: splitting ids to be able to append the first hint (sorting)
115
+ // while other hints should follow the keyboard navigation hints
116
+ var _ref3 = (_currentAriaDescribed = currentAriaDescribedbyId === null || currentAriaDescribedbyId === void 0 ? void 0 : currentAriaDescribedbyId.split(' ')) !== null && _currentAriaDescribed !== void 0 ? _currentAriaDescribed : [],
117
+ _ref4 = (0, _toArray2.default)(_ref3),
118
+ sortingId = _ref4[0],
119
+ rest = _ref4.slice(1);
120
+ var remainingIds = rest.join(' ');
121
+ cellEl.setAttribute('aria-describedby', (0, _classnames.default)(sortingId, ariaDescribedById, !isCellEntered && remainingIds));
113
122
  return function () {
114
123
  if (currentAriaDescribedbyId) {
115
- cellEl.setAttribute('aria-descibedby', currentAriaDescribedbyId);
124
+ cellEl.setAttribute('aria-describedby', currentAriaDescribedbyId);
116
125
  } else {
117
126
  cellEl.removeAttribute('aria-describedby');
118
127
  }
119
128
  };
120
- }, [cellEl, ariaDescribedById]);
129
+ }, [cellEl, ariaDescribedById, isCellEntered]);
121
130
  (0, _react.useEffect)(function () {
122
131
  if (isCellEntered) {
123
132
  enableAndFocusInteractives(cellEl);
@@ -145,7 +154,7 @@ var FocusTrappedChildren = exports.FocusTrappedChildren = function FocusTrappedC
145
154
  } else if (
146
155
  // when opened content is closed, we don't want Escape to return to the cell
147
156
  // immediately but instead return focus to a trigger as expected
148
- isCellEntered === false && (0, _utils.isDOMNode)(event.target) && (0, _utils.isDOMNode)(event.currentTarget) && event.currentTarget.contains(event.target)) {
157
+ isCellEntered === false && (0, _utils.isDOMNode)(event.target) && (0, _utils.isDOMNode)(event.currentTarget) && event.currentTarget !== event.target && event.currentTarget.contains(event.target)) {
149
158
  return true;
150
159
  }
151
160
  return isCellEntered;
@@ -658,5 +658,6 @@ EuiDataGridBody.propTypes = {
658
658
  gridRef: _propTypes.default.any.isRequired,
659
659
  gridItemsRendered: _propTypes.default.any.isRequired,
660
660
  wrapperRef: _propTypes.default.any.isRequired,
661
- className: _propTypes.default.string
661
+ className: _propTypes.default.string,
662
+ canDragAndDropColumns: _propTypes.default.bool
662
663
  };
@@ -46,6 +46,7 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PUR
46
46
  columns = _ref.columns,
47
47
  setVisibleColumns = _ref.setVisibleColumns,
48
48
  switchColumnPos = _ref.switchColumnPos,
49
+ canDragAndDropColumns = _ref.canDragAndDropColumns,
49
50
  onColumnResize = _ref.onColumnResize,
50
51
  schema = _ref.schema,
51
52
  schemaDetectors = _ref.schemaDetectors,
@@ -99,12 +100,13 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PUR
99
100
  setVisibleColumns: setVisibleColumns,
100
101
  visibleColCount: visibleColCount,
101
102
  switchColumnPos: switchColumnPos,
103
+ canDragAndDropColumns: canDragAndDropColumns,
102
104
  sorting: sorting,
103
105
  schema: schema,
104
106
  schemaDetectors: schemaDetectors,
105
107
  gridStyles: gridStyles
106
108
  };
107
- }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
109
+ }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, canDragAndDropColumns, sorting, schema, schemaDetectors, gridStyles]);
108
110
 
109
111
  /**
110
112
  * Header & footer
@@ -813,6 +815,7 @@ EuiDataGridBodyCustomRender.propTypes = {
813
815
  gridRef: _propTypes.default.any.isRequired,
814
816
  gridItemsRendered: _propTypes.default.any.isRequired,
815
817
  wrapperRef: _propTypes.default.any.isRequired,
816
- className: _propTypes.default.string
818
+ className: _propTypes.default.string,
819
+ canDragAndDropColumns: _propTypes.default.bool
817
820
  };
818
821
  EuiDataGridBodyCustomRender.displayName = 'EuiDataGridBodyCustomRender';
@@ -113,7 +113,8 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
113
113
  gridRef = _ref3.gridRef,
114
114
  gridItemsRendered = _ref3.gridItemsRendered,
115
115
  wrapperRef = _ref3.wrapperRef,
116
- className = _ref3.className;
116
+ className = _ref3.className,
117
+ canDragAndDropColumns = _ref3.canDragAndDropColumns;
117
118
  /**
118
119
  * Grid refs & observers
119
120
  */
@@ -164,7 +165,8 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
164
165
  sorting: sorting,
165
166
  schema: schema,
166
167
  schemaDetectors: schemaDetectors,
167
- gridStyles: gridStyles
168
+ gridStyles: gridStyles,
169
+ canDragAndDropColumns: canDragAndDropColumns
168
170
  }),
169
171
  headerRow = _useDataGridHeader.headerRow,
170
172
  headerRowHeight = _useDataGridHeader.headerRowHeight;
@@ -196,7 +198,8 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
196
198
  headerRowHeight: headerRowHeight,
197
199
  footerRowHeight: footerRowHeight,
198
200
  visibleRowCount: visibleRowCount,
199
- hasStickyFooter: !!(renderFooterCellValue && gridStyles.stickyFooter)
201
+ hasStickyFooter: !!(renderFooterCellValue && gridStyles.stickyFooter),
202
+ canDragAndDropColumns: canDragAndDropColumns
200
203
  });
201
204
 
202
205
  /**
@@ -944,6 +947,7 @@ EuiDataGridBodyVirtualized.propTypes = {
944
947
  gridRef: _propTypes.default.any.isRequired,
945
948
  gridItemsRendered: _propTypes.default.any.isRequired,
946
949
  wrapperRef: _propTypes.default.any.isRequired,
947
- className: _propTypes.default.string
950
+ className: _propTypes.default.string,
951
+ canDragAndDropColumns: _propTypes.default.bool
948
952
  };
949
953
  EuiDataGridBodyVirtualized.displayName = 'EuiDataGridBodyVirtualized';