@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
@@ -69,7 +69,8 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
69
69
  headerRowHeight = _ref.headerRowHeight,
70
70
  footerRowHeight = _ref.footerRowHeight,
71
71
  visibleRowCount = _ref.visibleRowCount,
72
- hasStickyFooter = _ref.hasStickyFooter;
72
+ hasStickyFooter = _ref.hasStickyFooter,
73
+ canDragAndDropColumns = _ref.canDragAndDropColumns;
73
74
  var scrollCellIntoView = (0, _react.useCallback)(
74
75
  /*#__PURE__*/
75
76
  // Note: in order for this UX to work correctly with react-window's APIs,
@@ -78,7 +79,7 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
78
79
  function () {
79
80
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
80
81
  var _adjustedScrollLeft;
81
- var rowIndex, colIndex, getCell, cell, cellIsInView, _outerGridRef$current, scrollTop, scrollLeft, adjustedScrollTop, adjustedScrollLeft, cellRightPos, rightScrollBound, rightWidthOutOfView, cellLeftPos, leftScrollBound, leftWidthOutOfView, isStickyHeader, isStickyFooter, _adjustedScrollTop, parentRow, cellBottomPos, bottomScrollBound, bottomHeightOutOfView, cellTopPos, topScrollBound, topHeightOutOfView, _adjustedScrollLeft2, _adjustedScrollTop2;
82
+ var rowIndex, colIndex, getCell, cell, cellIsInView, isStickyHeader, isStickyFooter, isDraggableHeader, isDraggableHeaderCell, _outerGridRef$current, scrollTop, scrollLeft, adjustedScrollTop, adjustedScrollLeft, cellLeftPos, cellRightPos, rightScrollBound, rightWidthOutOfView, leftScrollBound, leftWidthOutOfView, _adjustedScrollTop, parentRow, cellBottomPos, bottomScrollBound, bottomHeightOutOfView, cellTopPos, topScrollBound, topHeightOutOfView, _adjustedScrollLeft2, _adjustedScrollTop2;
82
83
  return _regeneratorRuntime().wrap(function _callee$(_context) {
83
84
  while (1) switch (_context.prev = _context.next) {
84
85
  case 0:
@@ -125,7 +126,10 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
125
126
  return _context.abrupt("return");
126
127
  case 15:
127
128
  // If for some reason we can't find a valid cell, short-circuit
128
- // We now manually adjust scroll positioning around the cell to ensure it's
129
+ isStickyHeader = rowIndex === -1;
130
+ isStickyFooter = hasStickyFooter && rowIndex === visibleRowCount;
131
+ isDraggableHeader = canDragAndDropColumns && isStickyHeader;
132
+ isDraggableHeaderCell = isDraggableHeader && cell.offsetLeft === 0 && colIndex !== 0; // We now manually adjust scroll positioning around the cell to ensure it's
129
133
  // fully in view on all sides. A couple of notes on this:
130
134
  // 1. We're avoiding relying on react-window's scrollToItem for this because it also
131
135
  // does not account for sticky items (see https://github.com/bvaughn/react-window/issues/586)
@@ -134,8 +138,10 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
134
138
  // halfway there, but doesn't guarantee the *full* cell in view, or account for
135
139
  // sticky positioned rows or OS scrollbars, hence these workarounds
136
140
  _outerGridRef$current = outerGridRef.current, scrollTop = _outerGridRef$current.scrollTop, scrollLeft = _outerGridRef$current.scrollLeft;
137
- // Check if the cell's right side is outside the current scrolling bounds
138
- cellRightPos = cell.offsetLeft + cell.offsetWidth;
141
+ // Draggable header columns are nested within EuiDraggables,
142
+ // and their offsetLeft needs to go up a wrapper as a result
143
+ cellLeftPos = isDraggableHeaderCell ? cell.offsetParent.offsetLeft : cell.offsetLeft; // Check if the cell's right side is outside the current scrolling bounds
144
+ cellRightPos = cellLeftPos + cell.offsetWidth;
139
145
  rightScrollBound = scrollLeft + outerGridRef.current.clientWidth; // Note: We specifically want clientWidth and not offsetWidth here to account for scrollbars
140
146
  rightWidthOutOfView = cellRightPos - rightScrollBound;
141
147
  if (rightWidthOutOfView > 0) {
@@ -143,7 +149,6 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
143
149
  }
144
150
 
145
151
  // Check if the cell's left side is outside the current scrolling bounds
146
- cellLeftPos = cell.offsetLeft;
147
152
  leftScrollBound = (_adjustedScrollLeft = adjustedScrollLeft) !== null && _adjustedScrollLeft !== void 0 ? _adjustedScrollLeft : scrollLeft;
148
153
  leftWidthOutOfView = leftScrollBound - cellLeftPos;
149
154
  if (leftWidthOutOfView > 0) {
@@ -154,8 +159,6 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
154
159
 
155
160
  // Skip top/bottom scroll adjustments for sticky headers & footers
156
161
  // since they should always be in view vertically
157
- isStickyHeader = rowIndex === -1;
158
- isStickyFooter = hasStickyFooter && rowIndex === visibleRowCount;
159
162
  if (!isStickyHeader && !isStickyFooter) {
160
163
  parentRow = cell.parentNode; // Check if the cell's bottom side is outside the current scrolling bounds
161
164
  cellBottomPos = parentRow.offsetTop + cell.offsetHeight;
@@ -185,7 +188,7 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
185
188
  scrollTop: (_adjustedScrollTop2 = adjustedScrollTop) !== null && _adjustedScrollTop2 !== void 0 ? _adjustedScrollTop2 : scrollTop
186
189
  });
187
190
  }
188
- case 28:
191
+ case 30:
189
192
  case "end":
190
193
  return _context.stop();
191
194
  }
@@ -194,7 +197,7 @@ var useScrollCellIntoView = exports.useScrollCellIntoView = function useScrollCe
194
197
  return function (_x) {
195
198
  return _ref3.apply(this, arguments);
196
199
  };
197
- }(), [gridRef, outerGridRef, hasGridScrolling, headerRowHeight, footerRowHeight, visibleRowCount, hasStickyFooter]);
200
+ }(), [gridRef, outerGridRef, hasGridScrolling, headerRowHeight, footerRowHeight, visibleRowCount, hasStickyFooter, canDragAndDropColumns]);
198
201
  return {
199
202
  scrollCellIntoView: scrollCellIntoView
200
203
  };
@@ -44,6 +44,8 @@ var EuiAbsoluteTab = exports.EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
44
44
  locale = _ref.locale,
45
45
  roundUp = _ref.roundUp,
46
46
  utcOffset = _ref.utcOffset,
47
+ minDate = _ref.minDate,
48
+ maxDate = _ref.maxDate,
47
49
  labelPrefix = _ref.labelPrefix;
48
50
  var styles = (0, _services.useEuiMemoizedStyles)(_absolute_tab.euiAbsoluteTabDateFormStyles);
49
51
  var _useState = (0, _react.useState)(function () {
@@ -137,7 +139,9 @@ var EuiAbsoluteTab = exports.EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
137
139
  dateFormat: dateFormat,
138
140
  timeFormat: timeFormat,
139
141
  locale: locale,
140
- utcOffset: utcOffset
142
+ utcOffset: utcOffset,
143
+ minDate: minDate,
144
+ maxDate: maxDate
141
145
  }), (0, _react2.jsx)(_flex.EuiFlexGroup, {
142
146
  component: "form",
143
147
  onSubmit: function onSubmit(e) {
@@ -182,5 +186,7 @@ EuiAbsoluteTab.propTypes = {
182
186
  onChange: _propTypes.default.func.isRequired,
183
187
  roundUp: _propTypes.default.bool.isRequired,
184
188
  labelPrefix: _propTypes.default.string.isRequired,
185
- utcOffset: _propTypes.default.number
189
+ utcOffset: _propTypes.default.number,
190
+ minDate: _propTypes.default.any,
191
+ maxDate: _propTypes.default.any
186
192
  };
@@ -14,7 +14,7 @@ var _pretty_duration = require("../pretty_duration");
14
14
  var _date_popover_content = require("./date_popover_content");
15
15
  var _date_popover_button = require("./date_popover_button.styles");
16
16
  var _react2 = require("@emotion/react");
17
- var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
17
+ var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "minDate", "maxDate", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
18
18
  /*
19
19
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
20
20
  * or more contributor license agreements. Licensed under the Elastic License
@@ -40,6 +40,8 @@ var EuiDatePopoverButton = exports.EuiDatePopoverButton = function EuiDatePopove
40
40
  locale = props.locale,
41
41
  dateFormat = props.dateFormat,
42
42
  utcOffset = props.utcOffset,
43
+ minDate = props.minDate,
44
+ maxDate = props.maxDate,
43
45
  timeFormat = props.timeFormat,
44
46
  isOpen = props.isOpen,
45
47
  onPopoverToggle = props.onPopoverToggle,
@@ -100,7 +102,9 @@ var EuiDatePopoverButton = exports.EuiDatePopoverButton = function EuiDatePopove
100
102
  locale: locale,
101
103
  position: position,
102
104
  utcOffset: utcOffset,
103
- timeOptions: timeOptions
105
+ timeOptions: timeOptions,
106
+ minDate: minDate,
107
+ maxDate: maxDate
104
108
  }));
105
109
  };
106
110
  EuiDatePopoverButton.propTypes = {
@@ -126,6 +130,8 @@ EuiDatePopoverButton.propTypes = {
126
130
  timeFormat: _propTypes.default.string.isRequired,
127
131
  value: _propTypes.default.string.isRequired,
128
132
  utcOffset: _propTypes.default.number,
133
+ minDate: _propTypes.default.any,
134
+ maxDate: _propTypes.default.any,
129
135
  compressed: _propTypes.default.bool,
130
136
  timeOptions: _propTypes.default.shape({
131
137
  timeTenseOptions: _propTypes.default.arrayOf(_propTypes.default.any.isRequired).isRequired,
@@ -38,7 +38,9 @@ var EuiDatePopoverContent = exports.EuiDatePopoverContent = function EuiDatePopo
38
38
  locale = _ref.locale,
39
39
  position = _ref.position,
40
40
  utcOffset = _ref.utcOffset,
41
- timeOptions = _ref.timeOptions;
41
+ timeOptions = _ref.timeOptions,
42
+ minDate = _ref.minDate,
43
+ maxDate = _ref.maxDate;
42
44
  var styles = (0, _services.useEuiMemoizedStyles)(_date_popover_content.euiDatePopoverContentStyles);
43
45
  var onTabClick = function onTabClick(selectedTab) {
44
46
  switch (selectedTab.id) {
@@ -67,7 +69,9 @@ var EuiDatePopoverContent = exports.EuiDatePopoverContent = function EuiDatePopo
67
69
  onChange: onChange,
68
70
  roundUp: roundUp,
69
71
  labelPrefix: labelPrefix,
70
- utcOffset: utcOffset
72
+ utcOffset: utcOffset,
73
+ minDate: minDate,
74
+ maxDate: maxDate
71
75
  }),
72
76
  'data-test-subj': 'superDatePickerAbsoluteTab',
73
77
  'aria-label': "".concat(labelPrefix, ": ").concat(absoluteLabel)
@@ -137,6 +141,8 @@ EuiDatePopoverContent.propTypes = {
137
141
  locale: _propTypes.default.any,
138
142
  position: _propTypes.default.oneOf(["start", "end"]).isRequired,
139
143
  utcOffset: _propTypes.default.number,
144
+ minDate: _propTypes.default.any,
145
+ maxDate: _propTypes.default.any,
140
146
  timeOptions: _propTypes.default.shape({
141
147
  timeTenseOptions: _propTypes.default.arrayOf(_propTypes.default.any.isRequired).isRequired,
142
148
  timeUnitsOptions: _propTypes.default.arrayOf(_propTypes.default.any.isRequired).isRequired,
@@ -52,7 +52,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
52
52
  * in compliance with, at your election, the Elastic License 2.0 or the Server
53
53
  * Side Public License, v 1.
54
54
  */ // eslint-disable-line import/named
55
- function isRangeInvalid(start, end) {
55
+ function isRangeInvalid(start, end, minDate, maxDate) {
56
56
  if (start === 'now' && end === 'now') {
57
57
  return true;
58
58
  }
@@ -60,7 +60,7 @@ function isRangeInvalid(start, end) {
60
60
  var endMoment = _datemath.default.parse(end, {
61
61
  roundUp: true
62
62
  });
63
- var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !(0, _moment.default)(startMoment).isValid() || !(0, _moment.default)(endMoment).isValid() || startMoment.isAfter(endMoment);
63
+ 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);
64
64
  return isInvalid;
65
65
  }
66
66
  var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
@@ -79,7 +79,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
79
79
  },
80
80
  start: _this.props.start,
81
81
  end: _this.props.end,
82
- isInvalid: isRangeInvalid(_this.props.start, _this.props.end),
82
+ isInvalid: isRangeInvalid(_this.props.start, _this.props.end, _this.props.minDate, _this.props.maxDate),
83
83
  hasChanged: false,
84
84
  showPrettyDuration: (0, _pretty_duration.showPrettyDuration)(_this.props.start, _this.props.end, _this.props.commonlyUsedRanges),
85
85
  isStartDatePopoverOpen: false,
@@ -88,7 +88,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
88
88
  _defineProperty(_this, "setTime", function (_ref) {
89
89
  var end = _ref.end,
90
90
  start = _ref.start;
91
- var isInvalid = isRangeInvalid(start, end);
91
+ var isInvalid = isRangeInvalid(start, end, _this.props.minDate, _this.props.maxDate);
92
92
  _this.setState({
93
93
  start: start,
94
94
  end: end,
@@ -277,6 +277,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
277
277
  locale = _this$props3.locale,
278
278
  timeFormat = _this$props3.timeFormat,
279
279
  utcOffset = _this$props3.utcOffset,
280
+ minDate = _this$props3.minDate,
281
+ maxDate = _this$props3.maxDate,
280
282
  compressed = _this$props3.compressed,
281
283
  onFocus = _this$props3.onFocus,
282
284
  styles = _this$props3.memoizedStyles;
@@ -351,6 +353,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
351
353
  utcOffset: utcOffset,
352
354
  timeFormat: timeFormat,
353
355
  locale: locale || contextLocale,
356
+ minDate: minDate,
357
+ maxDate: maxDate,
354
358
  canRoundRelativeUnits: canRoundRelativeUnits,
355
359
  isOpen: _this.state.isStartDatePopoverOpen,
356
360
  onPopoverToggle: _this.onStartDatePopoverToggle,
@@ -373,6 +377,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
373
377
  utcOffset: utcOffset,
374
378
  timeFormat: timeFormat,
375
379
  locale: locale || contextLocale,
380
+ minDate: minDate,
381
+ maxDate: maxDate,
376
382
  canRoundRelativeUnits: canRoundRelativeUnits,
377
383
  roundUp: true,
378
384
  isOpen: _this.state.isEndDatePopoverOpen,
@@ -478,7 +484,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
478
484
  },
479
485
  start: nextProps.start,
480
486
  end: nextProps.end,
481
- isInvalid: isRangeInvalid(nextProps.start, nextProps.end),
487
+ isInvalid: isRangeInvalid(nextProps.start, nextProps.end, nextProps.minDate, nextProps.maxDate),
482
488
  hasChanged: false,
483
489
  showPrettyDuration: (0, _pretty_duration.showPrettyDuration)(nextProps.start, nextProps.end, nextProps.commonlyUsedRanges)
484
490
  };
@@ -609,6 +615,14 @@ EuiSuperDatePickerInternal.propTypes = {
609
615
  refreshIntervalUnits: _propTypes.default.any,
610
616
  start: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOf(["now"]), _propTypes.default.string.isRequired]), _propTypes.default.oneOfType([_propTypes.default.oneOf(["now"]), _propTypes.default.string.isRequired]).isRequired]),
611
617
  end: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOf(["now"]), _propTypes.default.string.isRequired]), _propTypes.default.oneOfType([_propTypes.default.oneOf(["now"]), _propTypes.default.string.isRequired]).isRequired]),
618
+ /**
619
+ * Defines min. date accepted as a selection (in moment format)
620
+ */
621
+ minDate: _propTypes.default.any,
622
+ /**
623
+ * Defines max. date accepted as a selection (in moment format)
624
+ */
625
+ maxDate: _propTypes.default.any,
612
626
  /**
613
627
  * Specifies the formatted used when displaying times
614
628
  * @default 'HH:mm'
@@ -792,6 +806,14 @@ EuiSuperDatePicker.propTypes = {
792
806
  */
793
807
  start: _propTypes.default.oneOfType([_propTypes.default.oneOf(["now"]), _propTypes.default.string.isRequired]),
794
808
  end: _propTypes.default.oneOfType([_propTypes.default.oneOf(["now"]), _propTypes.default.string.isRequired]),
809
+ /**
810
+ * Defines min. date accepted as a selection (in moment format)
811
+ */
812
+ minDate: _propTypes.default.any,
813
+ /**
814
+ * Defines max. date accepted as a selection (in moment format)
815
+ */
816
+ maxDate: _propTypes.default.any,
795
817
  /**
796
818
  * Specifies the formatted used when displaying times
797
819
  * @default 'HH:mm'
@@ -58,6 +58,7 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
58
58
  cloneItems = _useContext.cloneItems;
59
59
  var euiTheme = (0, _services.useEuiTheme)();
60
60
  var styles = (0, _draggable.euiDraggableStyles)(euiTheme);
61
+ var hasCustomDragHandle = customDragHandle !== false;
61
62
  return (0, _react2.jsx)(_dnd.Draggable, _extends({
62
63
  draggableId: draggableId,
63
64
  index: index,
@@ -65,13 +66,14 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
65
66
  }, rest), function (provided, snapshot, rubric) {
66
67
  var _provided$dragHandleP, _provided$dragHandleP2;
67
68
  var isDragging = snapshot.isDragging;
69
+ var isFullyCustomDragHandle = customDragHandle === 'custom';
68
70
  var cssStyles = [styles.euiDraggable, cloneItems && !isDragging && styles.hasClone, isDragging && styles.isDragging, isRemovable && styles.isRemovable, styles.spacing[spacing]];
69
71
  var classes = (0, _classnames.default)('euiDraggable', className);
70
72
  var childClasses = (0, _classnames.default)('euiDraggable__item', {
71
73
  'euiDraggable__item-isDisabled': isDragDisabled
72
74
  });
73
75
  var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children;
74
- var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", _extends({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
76
+ var content = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("div", _extends({}, provided.draggableProps, !hasCustomDragHandle ? provided.dragHandleProps : {}, {
75
77
  ref: provided.innerRef,
76
78
  "data-test-subj": dataTestSubj,
77
79
  className: classes,
@@ -81,11 +83,14 @@ var EuiDraggable = exports.EuiDraggable = function EuiDraggable(_ref) {
81
83
  // interactive element. Screen readers will cue users that this is a container
82
84
  // and has one or more elements inside that are part of a related group.
83
85
  ,
84
- role: hasInteractiveChildren ? 'group' : (_provided$dragHandleP = provided.dragHandleProps) === null || _provided$dragHandleP === void 0 ? void 0 : _provided$dragHandleP.role
86
+ role: isFullyCustomDragHandle ? undefined // prevent wrapper role from removing semantics of the children
87
+ : hasInteractiveChildren ? 'group' : (_provided$dragHandleP = provided.dragHandleProps) === null || _provided$dragHandleP === void 0 ? void 0 : _provided$dragHandleP.role
85
88
  // If the container includes an interactive element, we remove the tabindex=0
86
89
  // because [role="group"] does not permit or warrant a tab stop
90
+ // additionally we remove the tabindex when the child is a fully custom handle
91
+ // that has its own tabindex and handle props
87
92
  ,
88
- tabIndex: hasInteractiveChildren ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
93
+ tabIndex: hasInteractiveChildren || isFullyCustomDragHandle ? undefined : (_provided$dragHandleP2 = provided.dragHandleProps) === null || _provided$dragHandleP2 === void 0 ? void 0 : _provided$dragHandleP2.tabIndex
89
94
  }), (0, _services.cloneElementWithCss)(DraggableElement, {
90
95
  className: (0, _classnames.default)(DraggableElement.props.className, childClasses),
91
96
  css: [_draggable.euiDraggableItemStyles.euiDraggable__item, isDragDisabled && _draggable.euiDraggableItemStyles.disabled]
@@ -103,9 +108,12 @@ EuiDraggable.propTypes = {
103
108
  children: _propTypes.default.oneOfType([_propTypes.default.element.isRequired, _propTypes.default.any.isRequired]).isRequired,
104
109
  className: _propTypes.default.string,
105
110
  /**
106
- * Whether the `children` will provide and set up its own drag handle
111
+ * Whether the `children` will provide and set up its own drag handle.
112
+ * The `custom` value additionally removes the `role` from the draggable container.
113
+ * Use this if the `children` element is focusable and should keep its
114
+ * semantic role for accessibility purposes.
107
115
  */
108
- customDragHandle: _propTypes.default.bool,
116
+ customDragHandle: _propTypes.default.oneOfType([_propTypes.default.bool.isRequired, _propTypes.default.oneOf(["custom"])]),
109
117
  /**
110
118
  * Whether the container has interactive children and should have `role="group"` instead of `"button"`.
111
119
  * Setting this flag ensures your drag & drop container is keyboard and screen reader accessible.
@@ -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
  };
@@ -37,7 +37,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
37
37
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
38
38
  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; }
39
39
  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; }
40
- var GUTTER_SIZES = exports.GUTTER_SIZES = ['xs', 's', 'm', 'l'];
40
+ var GUTTER_SIZES = exports.GUTTER_SIZES = ['xxs', 'xs', 's', 'm', 'l'];
41
41
  var EuiHeaderLinks = exports.EuiHeaderLinks = function EuiHeaderLinks(_ref) {
42
42
  var children = _ref.children,
43
43
  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
  };
@@ -76,7 +76,7 @@ var EuiTab = exports.EuiTab = function EuiTab(_ref) {
76
76
  target: target,
77
77
  rel: secureRel
78
78
  }, rest), prependNode, (0, _react2.jsx)("span", {
79
- className: "euiTab__content",
79
+ className: "euiTab__content eui-textTruncate",
80
80
  css: cssTabContentStyles
81
81
  }, children), appendNode);
82
82
  }
@@ -43,6 +43,7 @@ export var euiDataGridCellOutlineSelectors = function euiDataGridCellOutlineSele
43
43
 
44
44
  // Cell header specific selectors
45
45
  var headerActionsOpen = '.euiDataGridHeaderCell--isActionsPopoverOpen';
46
+ var isMoving = '[data-column-moving]'; // prevents the header column actions hover animation from replaying on column move
46
47
 
47
48
  // Utils
48
49
  var selectors = function selectors() {
@@ -76,10 +77,11 @@ export var euiDataGridCellOutlineSelectors = function euiDataGridCellOutlineSele
76
77
  hoverAnimation: hoverNot(selectors(focus, isOpen, isClosing))
77
78
  },
78
79
  header: {
79
- focus: is(selectors(focus, focusWithin, headerActionsOpen)),
80
+ focus: is(selectors(focus, focusWithin, headerActionsOpen, isMoving)),
80
81
  // :focus-within here is primarily intended for when the column actions button has been clicked twice
81
82
  focusTrapped: _(isEntered),
82
- hideActions: not(selectors(hover, focusWithin, headerActionsOpen))
83
+ showActions: is(selectors(hover, focusWithin, headerActionsOpen, isMoving)),
84
+ hideActions: not(selectors(hover, focusWithin, headerActionsOpen, isMoving))
83
85
  }
84
86
  };
85
87
  };
@@ -1,3 +1,4 @@
1
+ import _toArray from "@babel/runtime/helpers/toArray";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  /*
3
4
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -92,16 +93,24 @@ export var FocusTrappedChildren = function FocusTrappedChildren(_ref2) {
92
93
 
93
94
  // direct DOM manipulation as workaround to attach required hints
94
95
  useEffect(function () {
96
+ var _currentAriaDescribed;
95
97
  var currentAriaDescribedbyId = cellEl.getAttribute('aria-describedby');
96
- cellEl.setAttribute('aria-describedby', classNames(currentAriaDescribedbyId, ariaDescribedById));
98
+ // A11y: splitting ids to be able to append the first hint (sorting)
99
+ // while other hints should follow the keyboard navigation hints
100
+ var _ref3 = (_currentAriaDescribed = currentAriaDescribedbyId === null || currentAriaDescribedbyId === void 0 ? void 0 : currentAriaDescribedbyId.split(' ')) !== null && _currentAriaDescribed !== void 0 ? _currentAriaDescribed : [],
101
+ _ref4 = _toArray(_ref3),
102
+ sortingId = _ref4[0],
103
+ rest = _ref4.slice(1);
104
+ var remainingIds = rest.join(' ');
105
+ cellEl.setAttribute('aria-describedby', classNames(sortingId, ariaDescribedById, !isCellEntered && remainingIds));
97
106
  return function () {
98
107
  if (currentAriaDescribedbyId) {
99
- cellEl.setAttribute('aria-descibedby', currentAriaDescribedbyId);
108
+ cellEl.setAttribute('aria-describedby', currentAriaDescribedbyId);
100
109
  } else {
101
110
  cellEl.removeAttribute('aria-describedby');
102
111
  }
103
112
  };
104
- }, [cellEl, ariaDescribedById]);
113
+ }, [cellEl, ariaDescribedById, isCellEntered]);
105
114
  useEffect(function () {
106
115
  if (isCellEntered) {
107
116
  enableAndFocusInteractives(cellEl);
@@ -129,7 +138,7 @@ export var FocusTrappedChildren = function FocusTrappedChildren(_ref2) {
129
138
  } else if (
130
139
  // when opened content is closed, we don't want Escape to return to the cell
131
140
  // immediately but instead return focus to a trigger as expected
132
- isCellEntered === false && isDOMNode(event.target) && isDOMNode(event.currentTarget) && event.currentTarget.contains(event.target)) {
141
+ isCellEntered === false && isDOMNode(event.target) && isDOMNode(event.currentTarget) && event.currentTarget !== event.target && event.currentTarget.contains(event.target)) {
133
142
  return true;
134
143
  }
135
144
  return isCellEntered;
@@ -36,6 +36,7 @@ export var EuiDataGridBodyCustomRender = /*#__PURE__*/memo(function (_ref) {
36
36
  columns = _ref.columns,
37
37
  setVisibleColumns = _ref.setVisibleColumns,
38
38
  switchColumnPos = _ref.switchColumnPos,
39
+ canDragAndDropColumns = _ref.canDragAndDropColumns,
39
40
  onColumnResize = _ref.onColumnResize,
40
41
  schema = _ref.schema,
41
42
  schemaDetectors = _ref.schemaDetectors,
@@ -89,12 +90,13 @@ export var EuiDataGridBodyCustomRender = /*#__PURE__*/memo(function (_ref) {
89
90
  setVisibleColumns: setVisibleColumns,
90
91
  visibleColCount: visibleColCount,
91
92
  switchColumnPos: switchColumnPos,
93
+ canDragAndDropColumns: canDragAndDropColumns,
92
94
  sorting: sorting,
93
95
  schema: schema,
94
96
  schemaDetectors: schemaDetectors,
95
97
  gridStyles: gridStyles
96
98
  };
97
- }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
99
+ }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, canDragAndDropColumns, sorting, schema, schemaDetectors, gridStyles]);
98
100
 
99
101
  /**
100
102
  * Header & footer
@@ -104,7 +104,8 @@ export var EuiDataGridBodyVirtualized = /*#__PURE__*/memo(function (_ref3) {
104
104
  gridRef = _ref3.gridRef,
105
105
  gridItemsRendered = _ref3.gridItemsRendered,
106
106
  wrapperRef = _ref3.wrapperRef,
107
- className = _ref3.className;
107
+ className = _ref3.className,
108
+ canDragAndDropColumns = _ref3.canDragAndDropColumns;
108
109
  /**
109
110
  * Grid refs & observers
110
111
  */
@@ -155,7 +156,8 @@ export var EuiDataGridBodyVirtualized = /*#__PURE__*/memo(function (_ref3) {
155
156
  sorting: sorting,
156
157
  schema: schema,
157
158
  schemaDetectors: schemaDetectors,
158
- gridStyles: gridStyles
159
+ gridStyles: gridStyles,
160
+ canDragAndDropColumns: canDragAndDropColumns
159
161
  }),
160
162
  headerRow = _useDataGridHeader.headerRow,
161
163
  headerRowHeight = _useDataGridHeader.headerRowHeight;
@@ -187,7 +189,8 @@ export var EuiDataGridBodyVirtualized = /*#__PURE__*/memo(function (_ref3) {
187
189
  headerRowHeight: headerRowHeight,
188
190
  footerRowHeight: footerRowHeight,
189
191
  visibleRowCount: visibleRowCount,
190
- hasStickyFooter: !!(renderFooterCellValue && gridStyles.stickyFooter)
192
+ hasStickyFooter: !!(renderFooterCellValue && gridStyles.stickyFooter),
193
+ canDragAndDropColumns: canDragAndDropColumns
191
194
  });
192
195
 
193
196
  /**