@elastic/eui 94.5.0 → 94.5.2

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 (72) hide show
  1. package/NOTICE.txt +1 -1
  2. package/es/components/badge/badge.js +12 -4
  3. package/es/components/badge/badge.styles.js +13 -10
  4. package/es/components/date_picker/date_picker.js +4 -1
  5. package/es/components/date_picker/react-datepicker/src/calendar.js +6 -2
  6. package/es/components/date_picker/react-datepicker/src/index.js +7 -2
  7. package/es/components/date_picker/react-datepicker/src/time.js +5 -4
  8. package/es/components/drag_and_drop/drag_drop_context.js +0 -2
  9. package/es/components/flex/flex_group.js +4 -3
  10. package/es/components/flex/flex_item.js +4 -3
  11. package/es/components/form/range/dual_range.js +2 -2
  12. package/es/components/selectable/selectable_list/selectable_list.js +6 -6
  13. package/es/components/table/table_header_cell.js +1 -1
  14. package/es/components/table/table_header_cell_checkbox.js +2 -1
  15. package/es/components/table/table_header_cell_shared.js +9 -0
  16. package/eui.d.ts +29 -24
  17. package/i18ntokens.json +8 -8
  18. package/lib/components/badge/badge.js +12 -4
  19. package/lib/components/badge/badge.styles.js +13 -10
  20. package/lib/components/date_picker/date_picker.js +4 -1
  21. package/lib/components/date_picker/react-datepicker/src/calendar.js +6 -2
  22. package/lib/components/date_picker/react-datepicker/src/index.js +7 -2
  23. package/lib/components/date_picker/react-datepicker/src/time.js +5 -4
  24. package/lib/components/drag_and_drop/drag_drop_context.js +0 -1
  25. package/lib/components/flex/flex_group.js +4 -3
  26. package/lib/components/flex/flex_item.js +4 -3
  27. package/lib/components/form/range/dual_range.js +2 -2
  28. package/lib/components/selectable/selectable_list/selectable_list.js +6 -6
  29. package/lib/components/table/table_header_cell.js +1 -1
  30. package/lib/components/table/table_header_cell_checkbox.js +2 -1
  31. package/lib/components/table/table_header_cell_shared.js +16 -0
  32. package/optimize/es/components/badge/badge.js +7 -4
  33. package/optimize/es/components/badge/badge.styles.js +13 -10
  34. package/optimize/es/components/date_picker/date_picker.js +4 -1
  35. package/optimize/es/components/date_picker/react-datepicker/src/calendar.js +6 -2
  36. package/optimize/es/components/date_picker/react-datepicker/src/index.js +7 -2
  37. package/optimize/es/components/date_picker/react-datepicker/src/time.js +5 -4
  38. package/optimize/es/components/drag_and_drop/drag_drop_context.js +0 -2
  39. package/optimize/es/components/flex/flex_group.js +4 -3
  40. package/optimize/es/components/flex/flex_item.js +4 -3
  41. package/optimize/es/components/form/range/dual_range.js +2 -2
  42. package/optimize/es/components/selectable/selectable_list/selectable_list.js +6 -6
  43. package/optimize/es/components/table/table_header_cell_checkbox.js +1 -0
  44. package/optimize/es/components/table/table_header_cell_shared.js +9 -0
  45. package/optimize/lib/components/badge/badge.js +7 -4
  46. package/optimize/lib/components/badge/badge.styles.js +13 -10
  47. package/optimize/lib/components/date_picker/date_picker.js +4 -1
  48. package/optimize/lib/components/date_picker/react-datepicker/src/calendar.js +6 -2
  49. package/optimize/lib/components/date_picker/react-datepicker/src/index.js +7 -2
  50. package/optimize/lib/components/date_picker/react-datepicker/src/time.js +5 -4
  51. package/optimize/lib/components/drag_and_drop/drag_drop_context.js +0 -1
  52. package/optimize/lib/components/flex/flex_group.js +4 -3
  53. package/optimize/lib/components/flex/flex_item.js +4 -3
  54. package/optimize/lib/components/form/range/dual_range.js +2 -2
  55. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +6 -6
  56. package/optimize/lib/components/table/table_header_cell_checkbox.js +1 -0
  57. package/optimize/lib/components/table/table_header_cell_shared.js +16 -0
  58. package/package.json +1 -1
  59. package/test-env/components/badge/badge.js +7 -4
  60. package/test-env/components/badge/badge.styles.js +13 -10
  61. package/test-env/components/date_picker/date_picker.js +4 -1
  62. package/test-env/components/date_picker/react-datepicker/src/calendar.js +6 -2
  63. package/test-env/components/date_picker/react-datepicker/src/index.js +7 -2
  64. package/test-env/components/date_picker/react-datepicker/src/time.js +5 -4
  65. package/test-env/components/drag_and_drop/drag_drop_context.js +0 -1
  66. package/test-env/components/flex/flex_group.js +4 -3
  67. package/test-env/components/flex/flex_item.js +4 -3
  68. package/test-env/components/form/range/dual_range.js +2 -2
  69. package/test-env/components/selectable/selectable_list/selectable_list.js +6 -6
  70. package/test-env/components/table/table_header_cell.js +1 -1
  71. package/test-env/components/table/table_header_cell_checkbox.js +2 -1
  72. package/test-env/components/table/table_header_cell_shared.js +16 -0
@@ -496,18 +496,18 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
496
496
  }
497
497
  }
498
498
  }
499
+ var optionArray = visibleOptions || options;
499
500
  if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
500
- var optionArray = visibleOptions || options;
501
501
  this.setState(_objectSpread({
502
502
  optionArray: optionArray,
503
503
  itemData: _objectSpread({}, optionArray)
504
504
  }, this.calculateAriaSetAttrs(optionArray)));
505
- }
506
-
507
- // ensure that ListRow updates based on item props
508
- if (isVirtualized) {
505
+ } else if (isVirtualized) {
506
+ // ensure that ListRow updates based on item props
509
507
  if (prevProps.allowExclusions !== allowExclusions || prevProps.showIcons !== showIcons || prevProps.paddingSize !== paddingSize || prevProps.textWrap !== textWrap || prevProps.onFocusBadge !== onFocusBadge || prevProps.searchable !== searchable) {
510
- this.forceVirtualizedListRowRerender();
508
+ this.setState({
509
+ itemData: _objectSpread({}, optionArray)
510
+ });
511
511
  }
512
512
  }
513
513
  }
@@ -137,7 +137,7 @@ EuiTableHeaderCell.propTypes = {
137
137
  isSorted: _propTypes.default.bool,
138
138
  mobileOptions: _propTypes.default.any,
139
139
  onSort: _propTypes.default.func,
140
- scope: _propTypes.default.oneOf(["col", "row", "colgroup", "rowgroup"]),
140
+ scope: _propTypes.default.any,
141
141
  width: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired]),
142
142
  description: _propTypes.default.string,
143
143
  /**
@@ -34,6 +34,7 @@ var EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(_ref) {
34
34
  var classes = (0, _classnames.default)('euiTableHeaderCellCheckbox', className);
35
35
  var styles = (0, _services.useEuiMemoizedStyles)(_table_cells_shared.euiTableCellCheckboxStyles);
36
36
  var inlineStyles = (0, _utils.resolveWidthAsStyle)(style, width);
37
+ console.log('inlineStyles', inlineStyles);
37
38
  return (0, _react2.jsx)("th", _extends({
38
39
  css: styles.euiTableHeaderCellCheckbox,
39
40
  className: classes,
@@ -50,5 +51,5 @@ EuiTableHeaderCellCheckbox.propTypes = {
50
51
  "data-test-subj": _propTypes.default.string,
51
52
  css: _propTypes.default.any,
52
53
  width: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.number.isRequired]),
53
- scope: _propTypes.default.oneOf(["col", "row", "colgroup", "rowgroup"])
54
+ scope: _propTypes.default.any
54
55
  };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HEADER_CELL_SCOPE = void 0;
7
+ /*
8
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
+ * or more contributor license agreements. Licensed under the Elastic License
10
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
11
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
12
+ * Side Public License, v 1.
13
+ */
14
+
15
+ var HEADER_CELL_SCOPE = ['col', 'row', 'colgroup', 'rowgroup'];
16
+ exports.HEADER_CELL_SCOPE = HEADER_CELL_SCOPE;
@@ -1,4 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
5
  var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
@@ -47,6 +48,8 @@ export var EuiBadge = function EuiBadge(_ref) {
47
48
  var isNamedColor = COLORS.includes(color);
48
49
  var euiTheme = useEuiTheme();
49
50
  var customColorStyles = useMemo(function () {
51
+ // Disabled badges should not have custom colors
52
+ if (isDisabled) return style;
50
53
  // Named colors set their styles via Emotion CSS and not inline styles
51
54
  if (isNamedColor) return style;
52
55
 
@@ -61,17 +64,17 @@ export var EuiBadge = function EuiBadge(_ref) {
61
64
  console.warn("Warning: ".concat(color, " badge has a low contrast of ").concat(contrastRatio.toFixed(2), ". Should be above ").concat(wcagContrastMin, "."));
62
65
  }
63
66
  return _objectSpread({
64
- backgroundColor: color,
65
- color: textColor
67
+ '--euiBadgeBackgroundColor': color,
68
+ '--euiBadgeTextColor': textColor
66
69
  }, style);
67
70
  } catch (err) {
68
71
  if (!getIsValidColor(color)) {
69
72
  console.warn('EuiBadge expects a valid color. This can either be a three or six ' + "character hex value, rgb(a) value, hsv value, hollow, or one of the following: ".concat(COLORS, ". ") + "Instead got ".concat(color, "."));
70
73
  }
71
74
  }
72
- }, [color, isNamedColor, style, euiTheme]);
75
+ }, [color, isNamedColor, isDisabled, style, euiTheme]);
73
76
  var styles = useEuiMemoizedStyles(euiBadgeStyles);
74
- var cssStyles = [styles.euiBadge, isNamedColor && styles[color], (onClick || href) && !iconOnClick && styles.clickable, isDisabled && styles.disabled];
77
+ var cssStyles = [styles.euiBadge].concat(_toConsumableArray(isDisabled ? [styles.disabled] : [isNamedColor && styles[color], !iconOnClick && (onClick || href) && styles.clickable]));
75
78
  var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
76
79
  var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
77
80
  var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
@@ -22,24 +22,27 @@ var _ref = process.env.NODE_ENV === "production" ? {
22
22
  export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
23
23
  var euiTheme = euiThemeContext.euiTheme;
24
24
  var badgeColors = euiBadgeColors(euiThemeContext);
25
+ var setBadgeColorVars = function setBadgeColorVars(colors) {
26
+ return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ");
27
+ };
25
28
  return {
26
29
  euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.s)), " ", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", mathWithUnits(
27
30
  // Account for the border
28
31
  [euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
29
32
  return x + y * 2;
30
- }), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
33
+ }), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
31
34
  return x / 2;
32
- }), ";", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
35
+ }), ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
33
36
  clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
34
37
  // Colors
35
- default: /*#__PURE__*/css(badgeColors.default, ";label:default;"),
36
- hollow: /*#__PURE__*/css("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
37
- primary: /*#__PURE__*/css(badgeColors.primary, ";label:primary;"),
38
- accent: /*#__PURE__*/css(badgeColors.accent, ";label:accent;"),
39
- warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
40
- danger: /*#__PURE__*/css(badgeColors.danger, ";label:danger;"),
41
- success: /*#__PURE__*/css(badgeColors.success, ";label:success;"),
42
- disabled: /*#__PURE__*/css("color:", badgeColors.disabled.color, "!important;background-color:", badgeColors.disabled.backgroundColor, "!important;;label:disabled;"),
38
+ default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.default), ";label:default;"),
39
+ hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
40
+ primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
41
+ accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
42
+ warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
43
+ danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
44
+ success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.success), ";label:success;"),
45
+ disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), "*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
43
46
  // Content wrapper
44
47
  euiBadge__content: /*#__PURE__*/css(logicalCSS(
45
48
  // Ensure proper height in case of just displaying an icon
@@ -69,7 +69,7 @@ export var EuiDatePicker = function EuiDatePicker(_ref) {
69
69
  injectTimes = _ref.injectTimes,
70
70
  inline = _ref.inline,
71
71
  inputRef = _ref.inputRef,
72
- isInvalid = _ref.isInvalid,
72
+ _isInvalid = _ref.isInvalid,
73
73
  isLoading = _ref.isLoading,
74
74
  locale = _ref.locale,
75
75
  maxDate = _ref.maxDate,
@@ -102,6 +102,9 @@ export var EuiDatePicker = function EuiDatePicker(_ref) {
102
102
  'euiDatePicker--inline': inline,
103
103
  'euiDatePicker--shadow': inline && shadow
104
104
  });
105
+
106
+ // Check for whether the passed `selected` moment date is valid
107
+ var isInvalid = _isInvalid || ((selected === null || selected === void 0 ? void 0 : selected.isValid()) === false ? true : undefined);
105
108
  var numIconsClass = controlOnly ? false : getFormControlClassNameForIconCount({
106
109
  isInvalid: isInvalid,
107
110
  isLoading: isLoading
@@ -44,8 +44,9 @@ import React from "react";
44
44
  import PropTypes from "prop-types";
45
45
  import classnames from "classnames";
46
46
  import CalendarContainer from "./calendar_container";
47
- import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, formatDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils";
48
47
  import { EuiFocusTrap } from '../../../focus_trap';
48
+ import { EuiScreenReaderOnly } from '../../../accessibility/screen_reader_only';
49
+ import { now, setMonth, getMonth, addMonths, subtractMonths, getStartOfWeek, getStartOfDate, getStartOfMonth, addDays, cloneDate, formatDate, localizeDate, setYear, getYear, isBefore, isAfter, getLocaleData, getFormattedWeekdayInLocale, getWeekdayShortInLocale, getWeekdayMinInLocale, isSameDay, allDaysDisabledBefore, allDaysDisabledAfter, getEffectiveMinDate, getEffectiveMaxDate } from "./date_utils";
49
50
  import { jsx as ___EmotionJSX } from "@emotion/react";
50
51
  var FocusTrapContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
51
52
  return ___EmotionJSX("div", _extends({
@@ -212,10 +213,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
212
213
  var day = addDays(cloneDate(startOfWeek), offset);
213
214
  var localeData = getLocaleData(day);
214
215
  var weekDayName = _this.formatWeekday(localeData, day);
216
+ var weekDayNameLong = localeData.weekdays(day);
215
217
  return ___EmotionJSX("div", {
216
218
  key: offset,
217
219
  className: "react-datepicker__day-name"
218
- }, weekDayName);
220
+ }, ___EmotionJSX("span", {
221
+ "aria-hidden": "true"
222
+ }, weekDayName), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, weekDayNameLong)));
219
223
  }));
220
224
  });
221
225
  _defineProperty(_assertThisInitialized(_this), "formatWeekday", function (localeData, day) {
@@ -52,6 +52,9 @@ function hasPreSelectionChanged(date1, date2) {
52
52
  }
53
53
  function hasSelectionChanged(date1, date2) {
54
54
  if (date1 && date2) {
55
+ if (date1._isValid === false && date2._isValid === false) {
56
+ return false;
57
+ }
55
58
  return !equals(date1, date2);
56
59
  }
57
60
  return false;
@@ -72,6 +75,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
72
75
  return _this.props.openToDate ? newDate(_this.props.openToDate) : _this.props.selectsEnd && _this.props.startDate ? newDate(_this.props.startDate) : _this.props.selectsStart && _this.props.endDate ? newDate(_this.props.endDate) : now(_this.props.utcOffset);
73
76
  });
74
77
  _defineProperty(_assertThisInitialized(_this), "calcInitialState", function () {
78
+ var _this$props$selected;
75
79
  var defaultPreSelection = _this.getPreSelection();
76
80
  var minDate = getEffectiveMinDate(_this.props);
77
81
  var maxDate = getEffectiveMaxDate(_this.props);
@@ -79,7 +83,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
79
83
  return {
80
84
  open: _this.props.startOpen || false,
81
85
  preventFocus: false,
82
- preSelection: _this.props.selected ? newDate(_this.props.selected) : boundedPreSelection,
86
+ preSelection: (_this$props$selected = _this.props.selected) !== null && _this$props$selected !== void 0 && _this$props$selected._isValid ? newDate(_this.props.selected) : boundedPreSelection,
83
87
  // transforming highlighted days (perhaps nested array)
84
88
  // to flat Map for faster access in day.jsx
85
89
  highlightDates: getHightLightDaysMap(_this.props.highlightDates),
@@ -431,6 +435,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
431
435
  _this.onClearClick();
432
436
  });
433
437
  _defineProperty(_assertThisInitialized(_this), "renderCalendar", function () {
438
+ var _this$props$selected2;
434
439
  if (!_this.props.inline && !_this.isCalendarOpen()) {
435
440
  return null;
436
441
  }
@@ -446,7 +451,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
446
451
  useWeekdaysShort: _this.props.useWeekdaysShort,
447
452
  formatWeekDay: _this.props.formatWeekDay,
448
453
  dropdownMode: _this.props.dropdownMode,
449
- selected: _this.props.selected,
454
+ selected: (_this$props$selected2 = _this.props.selected) !== null && _this$props$selected2 !== void 0 && _this$props$selected2._isValid ? _this.props.selected : undefined,
450
455
  preSelection: _this.state.preSelection,
451
456
  onSelect: _this.handleSelect,
452
457
  onWeekSelect: _this.props.onWeekSelect,
@@ -247,9 +247,7 @@ var Time = /*#__PURE__*/function (_React$Component) {
247
247
  });
248
248
  var screenReaderInstructions;
249
249
  if (this.state.readInstructions) {
250
- screenReaderInstructions = ___EmotionJSX("p", {
251
- "aria-live": true
252
- }, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", this.state.preSelection ? "".concat(formatDate(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused.");
250
+ screenReaderInstructions = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("p", null, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm."), ___EmotionJSX("p", null, this.state.preSelection ? "".concat(formatDate(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused."));
253
251
  }
254
252
  return ___EmotionJSX("div", {
255
253
  className: classNames
@@ -260,7 +258,10 @@ var Time = /*#__PURE__*/function (_React$Component) {
260
258
  }
261
259
  }, ___EmotionJSX("div", {
262
260
  className: "react-datepicker-time__header"
263
- }, this.props.timeCaption), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, screenReaderInstructions))), ___EmotionJSX("div", {
261
+ }, this.props.timeCaption), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", {
262
+ "aria-live": "polite",
263
+ "aria-atomic": "false"
264
+ }, screenReaderInstructions))), ___EmotionJSX("div", {
264
265
  className: "react-datepicker__time"
265
266
  }, ___EmotionJSX("div", {
266
267
  className: timeBoxClassNames,
@@ -12,8 +12,6 @@ var _excluded = ["onBeforeDragStart", "onDragStart", "onDragUpdate", "onDragEnd"
12
12
 
13
13
  import React, { useState, createContext } from 'react';
14
14
  import { DragDropContext } from '@hello-pangea/dnd';
15
-
16
- // export interface EuiDragDropContextProps extends DragDropContextProps {}
17
15
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
16
  export var EuiDragDropContextContext = /*#__PURE__*/createContext({
19
17
  isDraggingType: null
@@ -39,9 +39,10 @@ var EuiFlexGroupInternal = function EuiFlexGroupInternal(_ref, ref) {
39
39
  var cssStyles = [styles.euiFlexGroup, responsive && !direction.includes('column') && styles.responsive, wrap && styles.wrap, styles.gutterSizes[gutterSize], styles.justifyContent[justifyContent], styles.alignItems[alignItems], styles.direction[direction]];
40
40
  var classes = classNames('euiFlexGroup', className);
41
41
 
42
- // Cast the resolved component prop type to ComponentType to help TS
43
- // process multiple infers and the overall type complexity.
44
- // This might not be needed in TypeScript 5
42
+ // Cast `component` to FunctionComponent to simplify its type.
43
+ // Note that FunctionComponent type is used here for purely typing
44
+ // convenience since we specify the return type above, and function
45
+ // components don't support `ref`s, but that doesn't matter in this case.
45
46
  var Component = component;
46
47
  return ___EmotionJSX(Component, _extends({}, rest, {
47
48
  ref: ref,
@@ -30,9 +30,10 @@ var EuiFlexItemInternal = function EuiFlexItemInternal(_ref, ref) {
30
30
  var cssStyles = [styles.euiFlexItem, !grow ? styles.growZero : styles.grow, grow && (typeof grow === 'number' ? styles.growSizes[grow] : styles.growSizes['1'])];
31
31
  var classes = classNames('euiFlexItem', className);
32
32
 
33
- // Cast the resolved component prop type to ComponentType to help TS
34
- // process multiple infers and the overall type complexity.
35
- // This might not be needed in TypeScript 5
33
+ // Cast `component` to FunctionComponent to simplify its type.
34
+ // Note that FunctionComponent type is used here for purely typing
35
+ // convenience since we specify the return type above, and function
36
+ // components don't support `ref`s, but that doesn't matter in this case.
36
37
  var Component = component;
37
38
  return ___EmotionJSX(Component, _extends({}, rest, {
38
39
  ref: ref,
@@ -379,7 +379,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
379
379
  // Non-overridable props
380
380
  side: "min",
381
381
  min: min,
382
- max: Number(this.upperValue),
382
+ max: this.upperValue === '' ? max : Number(this.upperValue),
383
383
  step: step,
384
384
  compressed: compressed,
385
385
  autoSize: !showInputOnly,
@@ -434,7 +434,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
434
434
  }, maxInputProps, {
435
435
  // Non-overridable props
436
436
  side: "max",
437
- min: Number(this.lowerValue),
437
+ min: this.lowerValue === '' ? min : Number(this.lowerValue),
438
438
  max: max,
439
439
  step: step,
440
440
  compressed: compressed,
@@ -485,18 +485,18 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
485
485
  }
486
486
  }
487
487
  }
488
+ var optionArray = visibleOptions || options;
488
489
  if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
489
- var optionArray = visibleOptions || options;
490
490
  this.setState(_objectSpread({
491
491
  optionArray: optionArray,
492
492
  itemData: _objectSpread({}, optionArray)
493
493
  }, this.calculateAriaSetAttrs(optionArray)));
494
- }
495
-
496
- // ensure that ListRow updates based on item props
497
- if (isVirtualized) {
494
+ } else if (isVirtualized) {
495
+ // ensure that ListRow updates based on item props
498
496
  if (prevProps.allowExclusions !== allowExclusions || prevProps.showIcons !== showIcons || prevProps.paddingSize !== paddingSize || prevProps.textWrap !== textWrap || prevProps.onFocusBadge !== onFocusBadge || prevProps.searchable !== searchable) {
499
- this.forceVirtualizedListRowRerender();
497
+ this.setState({
498
+ itemData: _objectSpread({}, optionArray)
499
+ });
500
500
  }
501
501
  }
502
502
  }
@@ -26,6 +26,7 @@ export var EuiTableHeaderCellCheckbox = function EuiTableHeaderCellCheckbox(_ref
26
26
  var classes = classNames('euiTableHeaderCellCheckbox', className);
27
27
  var styles = useEuiMemoizedStyles(euiTableCellCheckboxStyles);
28
28
  var inlineStyles = resolveWidthAsStyle(style, width);
29
+ console.log('inlineStyles', inlineStyles);
29
30
  return ___EmotionJSX("th", _extends({
30
31
  css: styles.euiTableHeaderCellCheckbox,
31
32
  className: classes,
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ export var HEADER_CELL_SCOPE = ['col', 'row', 'colgroup', 'rowgroup'];
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.ICON_SIDES = exports.EuiBadge = exports.COLORS = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
13
  var _react = _interopRequireWildcard(require("react"));
@@ -58,6 +59,8 @@ var EuiBadge = function EuiBadge(_ref) {
58
59
  var isNamedColor = COLORS.includes(color);
59
60
  var euiTheme = (0, _services.useEuiTheme)();
60
61
  var customColorStyles = (0, _react.useMemo)(function () {
62
+ // Disabled badges should not have custom colors
63
+ if (isDisabled) return style;
61
64
  // Named colors set their styles via Emotion CSS and not inline styles
62
65
  if (isNamedColor) return style;
63
66
 
@@ -72,17 +75,17 @@ var EuiBadge = function EuiBadge(_ref) {
72
75
  console.warn("Warning: ".concat(color, " badge has a low contrast of ").concat(contrastRatio.toFixed(2), ". Should be above ").concat(_services.wcagContrastMin, "."));
73
76
  }
74
77
  return _objectSpread({
75
- backgroundColor: color,
76
- color: textColor
78
+ '--euiBadgeBackgroundColor': color,
79
+ '--euiBadgeTextColor': textColor
77
80
  }, style);
78
81
  } catch (err) {
79
82
  if (!(0, _color_utils.getIsValidColor)(color)) {
80
83
  console.warn('EuiBadge expects a valid color. This can either be a three or six ' + "character hex value, rgb(a) value, hsv value, hollow, or one of the following: ".concat(COLORS, ". ") + "Instead got ".concat(color, "."));
81
84
  }
82
85
  }
83
- }, [color, isNamedColor, style, euiTheme]);
86
+ }, [color, isNamedColor, isDisabled, style, euiTheme]);
84
87
  var styles = (0, _services.useEuiMemoizedStyles)(_badge.euiBadgeStyles);
85
- var cssStyles = [styles.euiBadge, isNamedColor && styles[color], (onClick || href) && !iconOnClick && styles.clickable, isDisabled && styles.disabled];
88
+ var cssStyles = [styles.euiBadge].concat((0, _toConsumableArray2.default)(isDisabled ? [styles.disabled] : [isNamedColor && styles[color], !iconOnClick && (onClick || href) && styles.clickable]));
86
89
  var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
87
90
  var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
88
91
  var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
@@ -26,24 +26,27 @@ var _ref = process.env.NODE_ENV === "production" ? {
26
26
  var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
27
27
  var euiTheme = euiThemeContext.euiTheme;
28
28
  var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
29
+ var setBadgeColorVars = function setBadgeColorVars(colors) {
30
+ return "\n --euiBadgeTextColor: ".concat(colors.color, ";\n --euiBadgeBackgroundColor: ").concat(colors.backgroundColor, ";\n ");
31
+ };
29
32
  return {
30
33
  euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;", (0, _global_styling.logicalShorthandCSS)('padding', "0 ".concat(euiTheme.size.s)), " ", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs').fontSize, ";line-height:", (0, _global_styling.mathWithUnits)(
31
34
  // Account for the border
32
35
  [euiTheme.size.base, euiTheme.border.width.thin], function (x, y) {
33
36
  return x + y * 2;
34
- }), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
37
+ }), ";font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
35
38
  return x / 2;
36
- }), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " &:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
39
+ }), ";", (0, _global_styling.logicalTextAlignCSS)('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
37
40
  clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
38
41
  // Colors
39
- default: /*#__PURE__*/(0, _react.css)(badgeColors.default, ";label:default;"),
40
- hollow: /*#__PURE__*/(0, _react.css)("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
41
- primary: /*#__PURE__*/(0, _react.css)(badgeColors.primary, ";label:primary;"),
42
- accent: /*#__PURE__*/(0, _react.css)(badgeColors.accent, ";label:accent;"),
43
- warning: /*#__PURE__*/(0, _react.css)(badgeColors.warning, ";label:warning;"),
44
- danger: /*#__PURE__*/(0, _react.css)(badgeColors.danger, ";label:danger;"),
45
- success: /*#__PURE__*/(0, _react.css)(badgeColors.success, ";label:success;"),
46
- disabled: /*#__PURE__*/(0, _react.css)("color:", badgeColors.disabled.color, "!important;background-color:", badgeColors.disabled.backgroundColor, "!important;;label:disabled;"),
42
+ default: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.default), ";label:default;"),
43
+ hollow: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
44
+ primary: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
45
+ accent: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
46
+ warning: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
47
+ danger: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
48
+ success: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.success), ";label:success;"),
49
+ disabled: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.disabled), "*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
47
50
  // Content wrapper
48
51
  euiBadge__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)(
49
52
  // Ensure proper height in case of just displaying an icon
@@ -79,7 +79,7 @@ var EuiDatePicker = function EuiDatePicker(_ref) {
79
79
  injectTimes = _ref.injectTimes,
80
80
  inline = _ref.inline,
81
81
  inputRef = _ref.inputRef,
82
- isInvalid = _ref.isInvalid,
82
+ _isInvalid = _ref.isInvalid,
83
83
  isLoading = _ref.isLoading,
84
84
  locale = _ref.locale,
85
85
  maxDate = _ref.maxDate,
@@ -112,6 +112,9 @@ var EuiDatePicker = function EuiDatePicker(_ref) {
112
112
  'euiDatePicker--inline': inline,
113
113
  'euiDatePicker--shadow': inline && shadow
114
114
  });
115
+
116
+ // Check for whether the passed `selected` moment date is valid
117
+ var isInvalid = _isInvalid || ((selected === null || selected === void 0 ? void 0 : selected.isValid()) === false ? true : undefined);
115
118
  var numIconsClass = controlOnly ? false : (0, _num_icons.getFormControlClassNameForIconCount)({
116
119
  isInvalid: isInvalid,
117
120
  isLoading: isLoading
@@ -22,8 +22,9 @@ var _react = _interopRequireDefault(require("react"));
22
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
23
23
  var _classnames = _interopRequireDefault(require("classnames"));
24
24
  var _calendar_container = _interopRequireDefault(require("./calendar_container"));
25
- var _date_utils = require("./date_utils");
26
25
  var _focus_trap = require("../../../focus_trap");
26
+ var _screen_reader_only = require("../../../accessibility/screen_reader_only");
27
+ var _date_utils = require("./date_utils");
27
28
  var _react2 = require("@emotion/react");
28
29
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
30
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -217,10 +218,13 @@ var Calendar = /*#__PURE__*/function (_React$Component) {
217
218
  var day = (0, _date_utils.addDays)((0, _date_utils.cloneDate)(startOfWeek), offset);
218
219
  var localeData = (0, _date_utils.getLocaleData)(day);
219
220
  var weekDayName = _this.formatWeekday(localeData, day);
221
+ var weekDayNameLong = localeData.weekdays(day);
220
222
  return (0, _react2.jsx)("div", {
221
223
  key: offset,
222
224
  className: "react-datepicker__day-name"
223
- }, weekDayName);
225
+ }, (0, _react2.jsx)("span", {
226
+ "aria-hidden": "true"
227
+ }, weekDayName), (0, _react2.jsx)(_screen_reader_only.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, weekDayNameLong)));
224
228
  }));
225
229
  });
226
230
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatWeekday", function (localeData, day) {
@@ -63,6 +63,9 @@ function hasPreSelectionChanged(date1, date2) {
63
63
  }
64
64
  function hasSelectionChanged(date1, date2) {
65
65
  if (date1 && date2) {
66
+ if (date1._isValid === false && date2._isValid === false) {
67
+ return false;
68
+ }
66
69
  return !(0, _date_utils.equals)(date1, date2);
67
70
  }
68
71
  return false;
@@ -83,6 +86,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
83
86
  return _this.props.openToDate ? (0, _date_utils.newDate)(_this.props.openToDate) : _this.props.selectsEnd && _this.props.startDate ? (0, _date_utils.newDate)(_this.props.startDate) : _this.props.selectsStart && _this.props.endDate ? (0, _date_utils.newDate)(_this.props.endDate) : (0, _date_utils.now)(_this.props.utcOffset);
84
87
  });
85
88
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcInitialState", function () {
89
+ var _this$props$selected;
86
90
  var defaultPreSelection = _this.getPreSelection();
87
91
  var minDate = (0, _date_utils.getEffectiveMinDate)(_this.props);
88
92
  var maxDate = (0, _date_utils.getEffectiveMaxDate)(_this.props);
@@ -90,7 +94,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
90
94
  return {
91
95
  open: _this.props.startOpen || false,
92
96
  preventFocus: false,
93
- preSelection: _this.props.selected ? (0, _date_utils.newDate)(_this.props.selected) : boundedPreSelection,
97
+ preSelection: (_this$props$selected = _this.props.selected) !== null && _this$props$selected !== void 0 && _this$props$selected._isValid ? (0, _date_utils.newDate)(_this.props.selected) : boundedPreSelection,
94
98
  // transforming highlighted days (perhaps nested array)
95
99
  // to flat Map for faster access in day.jsx
96
100
  highlightDates: (0, _date_utils.getHightLightDaysMap)(_this.props.highlightDates),
@@ -442,6 +446,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
442
446
  _this.onClearClick();
443
447
  });
444
448
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderCalendar", function () {
449
+ var _this$props$selected2;
445
450
  if (!_this.props.inline && !_this.isCalendarOpen()) {
446
451
  return null;
447
452
  }
@@ -457,7 +462,7 @@ var DatePicker = /*#__PURE__*/function (_React$Component) {
457
462
  useWeekdaysShort: _this.props.useWeekdaysShort,
458
463
  formatWeekDay: _this.props.formatWeekDay,
459
464
  dropdownMode: _this.props.dropdownMode,
460
- selected: _this.props.selected,
465
+ selected: (_this$props$selected2 = _this.props.selected) !== null && _this$props$selected2 !== void 0 && _this$props$selected2._isValid ? _this.props.selected : undefined,
461
466
  preSelection: _this.state.preSelection,
462
467
  onSelect: _this.handleSelect,
463
468
  onWeekSelect: _this.props.onWeekSelect,
@@ -252,9 +252,7 @@ var Time = /*#__PURE__*/function (_React$Component) {
252
252
  });
253
253
  var screenReaderInstructions;
254
254
  if (this.state.readInstructions) {
255
- screenReaderInstructions = (0, _react2.jsx)("p", {
256
- "aria-live": true
257
- }, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm.", this.state.preSelection ? "".concat((0, _date_utils.formatDate)(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused.");
255
+ screenReaderInstructions = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("p", null, "You are a in a time selector. Use the up and down keys to select from other common times then press enter to confirm."), (0, _react2.jsx)("p", null, this.state.preSelection ? "".concat((0, _date_utils.formatDate)(this.state.preSelection, this.timeFormat), " is currently\n focused.") : "No time is currently focused."));
258
256
  }
259
257
  return (0, _react2.jsx)("div", {
260
258
  className: classNames
@@ -265,7 +263,10 @@ var Time = /*#__PURE__*/function (_React$Component) {
265
263
  }
266
264
  }, (0, _react2.jsx)("div", {
267
265
  className: "react-datepicker-time__header"
268
- }, this.props.timeCaption), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, screenReaderInstructions))), (0, _react2.jsx)("div", {
266
+ }, this.props.timeCaption), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", {
267
+ "aria-live": "polite",
268
+ "aria-atomic": "false"
269
+ }, screenReaderInstructions))), (0, _react2.jsx)("div", {
269
270
  className: "react-datepicker__time"
270
271
  }, (0, _react2.jsx)("div", {
271
272
  className: timeBoxClassNames,
@@ -20,7 +20,6 @@ var _excluded = ["onBeforeDragStart", "onDragStart", "onDragUpdate", "onDragEnd"
20
20
  * in compliance with, at your election, the Elastic License 2.0 or the Server
21
21
  * Side Public License, v 1.
22
22
  */
23
- // export interface EuiDragDropContextProps extends DragDropContextProps {}
24
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
26
25
  var EuiDragDropContextContext = /*#__PURE__*/(0, _react.createContext)({
@@ -52,9 +52,10 @@ var EuiFlexGroupInternal = function EuiFlexGroupInternal(_ref, ref) {
52
52
  var cssStyles = [styles.euiFlexGroup, responsive && !direction.includes('column') && styles.responsive, wrap && styles.wrap, styles.gutterSizes[gutterSize], styles.justifyContent[justifyContent], styles.alignItems[alignItems], styles.direction[direction]];
53
53
  var classes = (0, _classnames.default)('euiFlexGroup', className);
54
54
 
55
- // Cast the resolved component prop type to ComponentType to help TS
56
- // process multiple infers and the overall type complexity.
57
- // This might not be needed in TypeScript 5
55
+ // Cast `component` to FunctionComponent to simplify its type.
56
+ // Note that FunctionComponent type is used here for purely typing
57
+ // convenience since we specify the return type above, and function
58
+ // components don't support `ref`s, but that doesn't matter in this case.
58
59
  var Component = component;
59
60
  return (0, _react2.jsx)(Component, (0, _extends2.default)({}, rest, {
60
61
  ref: ref,
@@ -39,9 +39,10 @@ var EuiFlexItemInternal = function EuiFlexItemInternal(_ref, ref) {
39
39
  var cssStyles = [_flex_item.euiFlexItemStyles.euiFlexItem, !grow ? _flex_item.euiFlexItemStyles.growZero : _flex_item.euiFlexItemStyles.grow, grow && (typeof grow === 'number' ? _flex_item.euiFlexItemStyles.growSizes[grow] : _flex_item.euiFlexItemStyles.growSizes['1'])];
40
40
  var classes = (0, _classnames.default)('euiFlexItem', className);
41
41
 
42
- // Cast the resolved component prop type to ComponentType to help TS
43
- // process multiple infers and the overall type complexity.
44
- // This might not be needed in TypeScript 5
42
+ // Cast `component` to FunctionComponent to simplify its type.
43
+ // Note that FunctionComponent type is used here for purely typing
44
+ // convenience since we specify the return type above, and function
45
+ // components don't support `ref`s, but that doesn't matter in this case.
45
46
  var Component = component;
46
47
  return (0, _react2.jsx)(Component, (0, _extends2.default)({}, rest, {
47
48
  ref: ref,