@elastic/eui 96.0.0 → 97.0.0-backport.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +19 -1
  2. package/es/components/button/button_display/_button_display.styles.js +2 -2
  3. package/es/components/datagrid/body/data_grid_body_custom.js +48 -31
  4. package/es/components/date_picker/date_picker_range.styles.js +1 -1
  5. package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
  6. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
  7. package/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
  8. package/es/components/date_picker/super_date_picker/super_date_picker.js +27 -5
  9. package/es/components/link/external_link_icon.js +10 -8
  10. package/eui.d.ts +31 -5
  11. package/i18ntokens.json +64 -64
  12. package/lib/components/button/button_display/_button_display.styles.js +1 -1
  13. package/lib/components/datagrid/body/data_grid_body_custom.js +47 -30
  14. package/lib/components/date_picker/date_picker_range.styles.js +1 -1
  15. package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
  16. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
  17. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
  18. package/lib/components/date_picker/super_date_picker/super_date_picker.js +27 -5
  19. package/lib/components/link/external_link_icon.js +9 -7
  20. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  21. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +47 -30
  22. package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
  23. package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +5 -1
  24. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  25. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +6 -2
  26. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +11 -5
  27. package/optimize/es/components/link/external_link_icon.js +10 -8
  28. package/optimize/lib/components/button/button_display/_button_display.styles.js +1 -1
  29. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +46 -29
  30. package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
  31. package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +5 -1
  32. package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  33. package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +6 -2
  34. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +11 -5
  35. package/optimize/lib/components/link/external_link_icon.js +9 -7
  36. package/package.json +3 -2
  37. package/src/global_styling/mixins/_index.scss +1 -4
  38. package/src/global_styling/mixins/_tool_tip.scss +0 -7
  39. package/src/themes/amsterdam/global_styling/mixins/_index.scss +1 -4
  40. package/test-env/components/button/button_display/_button_display.styles.js +1 -1
  41. package/test-env/components/datagrid/body/data_grid_body_custom.js +47 -30
  42. package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
  43. package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +8 -2
  44. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +8 -2
  45. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_content.js +8 -2
  46. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +27 -5
  47. package/test-env/components/link/external_link_icon.js +9 -7
  48. package/src/global_styling/mixins/_button.scss +0 -149
  49. package/src/global_styling/mixins/_form.scss +0 -28
  50. package/src/global_styling/mixins/_panel.scss +0 -55
@@ -7,12 +7,12 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
7
7
  * Side Public License, v 1.
8
8
  */
9
9
  import { css } from '@emotion/react';
10
- import { euiFontSize, logicalCSS, logicalShorthandCSS, logicalTextAlignStyle } from '../../../global_styling';
10
+ import { euiFontSize, logicalCSS, logicalShorthandCSS, logicalTextAlignCSS } from '../../../global_styling';
11
11
  import { euiButtonSizeMap } from '../../../themes/amsterdam/global_styling/mixins';
12
12
  // Provides a solid reset and base for handling sizing layout
13
13
  // Does not include any visual styles
14
14
  export var euiButtonBaseCSS = function euiButtonBaseCSS() {
15
- return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat(logicalTextAlignStyle('center'), ";\n white-space: nowrap;\n ").concat(logicalCSS('max-width', '100%'), ";\n vertical-align: middle;\n ");
15
+ return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat(logicalTextAlignCSS('center'), ";\n white-space: nowrap;\n ").concat(logicalCSS('max-width', '100%'), ";\n vertical-align: middle;\n ");
16
16
  };
17
17
  var _ref = process.env.NODE_ENV === "production" ? {
18
18
  name: "8595p9-isDisabled",
@@ -14,7 +14,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
14
14
  * Side Public License, v 1.
15
15
  */
16
16
 
17
- import React, { useState, useMemo, useCallback } from 'react';
17
+ import React, { useState, useMemo, memo } from 'react';
18
18
  import classNames from 'classnames';
19
19
  import { useDefaultColumnWidth, useColumnWidths } from '../utils/col_widths';
20
20
  import { useRowHeightUtils, useDefaultRowHeight } from '../utils/row_heights';
@@ -22,7 +22,7 @@ import { useDataGridHeader } from './header';
22
22
  import { useDataGridFooter } from './footer';
23
23
  import { CellWrapper } from './cell';
24
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
25
- export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
25
+ export var EuiDataGridBodyCustomRender = /*#__PURE__*/memo(function (_ref) {
26
26
  var renderCustomGridBody = _ref.renderCustomGridBody,
27
27
  renderCellValue = _ref.renderCellValue,
28
28
  cellContext = _ref.cellContext,
@@ -78,27 +78,31 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
78
78
  }),
79
79
  setRowHeight = _useDefaultRowHeight.setRowHeight,
80
80
  getRowHeight = _useDefaultRowHeight.getRowHeight;
81
-
82
- /**
83
- * Header & footer
84
- */
85
- var _useDataGridHeader = useDataGridHeader({
81
+ var headerRowProps = useMemo(function () {
82
+ return {
86
83
  leadingControlColumns: leadingControlColumns,
87
84
  trailingControlColumns: trailingControlColumns,
88
85
  columns: columns,
89
86
  columnWidths: columnWidths,
90
87
  defaultColumnWidth: defaultColumnWidth,
91
88
  setColumnWidth: setColumnWidth,
92
- visibleColCount: visibleColCount,
93
89
  setVisibleColumns: setVisibleColumns,
90
+ visibleColCount: visibleColCount,
94
91
  switchColumnPos: switchColumnPos,
95
92
  sorting: sorting,
96
93
  schema: schema,
97
94
  schemaDetectors: schemaDetectors,
98
95
  gridStyles: gridStyles
99
- }),
96
+ };
97
+ }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
98
+
99
+ /**
100
+ * Header & footer
101
+ */
102
+ var _useDataGridHeader = useDataGridHeader(headerRowProps),
100
103
  headerRow = _useDataGridHeader.headerRow;
101
- var _useDataGridFooter = useDataGridFooter({
104
+ var footerRowProps = useMemo(function () {
105
+ return {
102
106
  renderFooterCellValue: renderFooterCellValue,
103
107
  renderCellPopover: renderCellPopover,
104
108
  rowIndex: visibleRows.visibleRowCount,
@@ -112,7 +116,9 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
112
116
  defaultColumnWidth: defaultColumnWidth,
113
117
  schema: schema,
114
118
  gridStyles: gridStyles
115
- }),
119
+ };
120
+ }, [renderFooterCellValue, renderCellPopover, visibleRows.visibleRowCount, visibleColCount, interactiveCellId, leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, schema, gridStyles]);
121
+ var _useDataGridFooter = useDataGridFooter(footerRowProps),
116
122
  footerRow = _useDataGridFooter.footerRow;
117
123
 
118
124
  /**
@@ -139,19 +145,22 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
139
145
  gridStyles: gridStyles
140
146
  };
141
147
  }, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
142
- var Cell = useCallback(function (_ref2) {
143
- var colIndex = _ref2.colIndex,
144
- visibleRowIndex = _ref2.visibleRowIndex,
145
- rest = _objectWithoutProperties(_ref2, _excluded);
146
- var style = {
147
- height: rowHeightUtils.isAutoHeight(visibleRowIndex, rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
148
+ var Cell = useMemo(function () {
149
+ return function (_ref2) {
150
+ var _rest$rowHeightsOptio;
151
+ var colIndex = _ref2.colIndex,
152
+ visibleRowIndex = _ref2.visibleRowIndex,
153
+ rest = _objectWithoutProperties(_ref2, _excluded);
154
+ var style = {
155
+ height: rowHeightUtils.isAutoHeight(visibleRowIndex, (_rest$rowHeightsOptio = rest.rowHeightsOptions) !== null && _rest$rowHeightsOptio !== void 0 ? _rest$rowHeightsOptio : rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
156
+ };
157
+ var props = _objectSpread({
158
+ colIndex: colIndex,
159
+ visibleRowIndex: visibleRowIndex,
160
+ style: style
161
+ }, cellProps);
162
+ return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
148
163
  };
149
- var props = _objectSpread({
150
- colIndex: colIndex,
151
- visibleRowIndex: visibleRowIndex,
152
- style: style
153
- }, cellProps);
154
- return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
155
164
  }, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
156
165
 
157
166
  // Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
@@ -159,12 +168,20 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
159
168
  _useState2 = _slicedToArray(_useState, 2),
160
169
  customGridBodyProps = _useState2[0],
161
170
  setCustomGridBodyProps = _useState2[1];
171
+ var customDataGridBodyProps = useMemo(function () {
172
+ return {
173
+ gridWidth: gridWidth,
174
+ visibleColumns: visibleColumns,
175
+ visibleRowData: visibleRows,
176
+ Cell: Cell,
177
+ setCustomGridBodyProps: setCustomGridBodyProps,
178
+ headerRow: headerRow,
179
+ footerRow: footerRow
180
+ };
181
+ }, [gridWidth, visibleColumns, visibleRows, Cell, setCustomGridBodyProps, headerRow, footerRow]);
182
+ var BodyElement = renderCustomGridBody;
162
183
  return ___EmotionJSX("div", _extends({}, customGridBodyProps, {
163
184
  className: classNames('euiDataGrid__customRenderBody', className, customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
164
- }), headerRow, renderCustomGridBody({
165
- visibleColumns: visibleColumns,
166
- visibleRowData: visibleRows,
167
- Cell: Cell,
168
- setCustomGridBodyProps: setCustomGridBodyProps
169
- }), footerRow);
170
- };
185
+ }), ___EmotionJSX(BodyElement, customDataGridBodyProps));
186
+ });
187
+ EuiDataGridBodyCustomRender.displayName = 'EuiDataGridBodyCustomRender';
@@ -11,7 +11,7 @@ import { css } from '@emotion/react';
11
11
  import { logicalCSS } from '../../global_styling';
12
12
  import { euiShadowMedium } from '../../themes/amsterdam/global_styling/mixins';
13
13
  export var euiDatePickerRangeStyles = {
14
- euiDatePickerRange: /*#__PURE__*/css(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", logicalCSS('height', '100%'), ";};label:euiDatePickerRange;")
14
+ euiDatePickerRange: /*#__PURE__*/css(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", logicalCSS('height', '100%'), ";}.euiPopover{flex:1;};label:euiDatePickerRange;")
15
15
  };
16
16
  var _ref = process.env.NODE_ENV === "production" ? {
17
17
  name: "bicgs9-noShadow",
@@ -32,6 +32,8 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
32
32
  locale = _ref.locale,
33
33
  roundUp = _ref.roundUp,
34
34
  utcOffset = _ref.utcOffset,
35
+ minDate = _ref.minDate,
36
+ maxDate = _ref.maxDate,
35
37
  labelPrefix = _ref.labelPrefix;
36
38
  var styles = useEuiMemoizedStyles(euiAbsoluteTabDateFormStyles);
37
39
  var _useState = useState(function () {
@@ -125,7 +127,9 @@ export var EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
125
127
  dateFormat: dateFormat,
126
128
  timeFormat: timeFormat,
127
129
  locale: locale,
128
- utcOffset: utcOffset
130
+ utcOffset: utcOffset,
131
+ minDate: minDate,
132
+ maxDate: maxDate
129
133
  }), ___EmotionJSX(EuiFlexGroup, {
130
134
  component: "form",
131
135
  onSubmit: function onSubmit(e) {
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
3
+ var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "minDate", "maxDate", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
4
4
  /*
5
5
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
6
  * or more contributor license agreements. Licensed under the Elastic License
@@ -33,6 +33,8 @@ export var EuiDatePopoverButton = function EuiDatePopoverButton(props) {
33
33
  locale = props.locale,
34
34
  dateFormat = props.dateFormat,
35
35
  utcOffset = props.utcOffset,
36
+ minDate = props.minDate,
37
+ maxDate = props.maxDate,
36
38
  timeFormat = props.timeFormat,
37
39
  isOpen = props.isOpen,
38
40
  onPopoverToggle = props.onPopoverToggle,
@@ -93,7 +95,9 @@ export var EuiDatePopoverButton = function EuiDatePopoverButton(props) {
93
95
  locale: locale,
94
96
  position: position,
95
97
  utcOffset: utcOffset,
96
- timeOptions: timeOptions
98
+ timeOptions: timeOptions,
99
+ minDate: minDate,
100
+ maxDate: maxDate
97
101
  }));
98
102
  };
99
103
  EuiDatePopoverButton.displayName = 'EuiDatePopoverButton';
@@ -30,7 +30,9 @@ export var EuiDatePopoverContent = function EuiDatePopoverContent(_ref) {
30
30
  locale = _ref.locale,
31
31
  position = _ref.position,
32
32
  utcOffset = _ref.utcOffset,
33
- timeOptions = _ref.timeOptions;
33
+ timeOptions = _ref.timeOptions,
34
+ minDate = _ref.minDate,
35
+ maxDate = _ref.maxDate;
34
36
  var styles = useEuiMemoizedStyles(euiDatePopoverContentStyles);
35
37
  var onTabClick = function onTabClick(selectedTab) {
36
38
  switch (selectedTab.id) {
@@ -59,7 +61,9 @@ export var EuiDatePopoverContent = function EuiDatePopoverContent(_ref) {
59
61
  onChange: onChange,
60
62
  roundUp: roundUp,
61
63
  labelPrefix: labelPrefix,
62
- utcOffset: utcOffset
64
+ utcOffset: utcOffset,
65
+ minDate: minDate,
66
+ maxDate: maxDate
63
67
  }),
64
68
  'data-test-subj': 'superDatePickerAbsoluteTab',
65
69
  'aria-label': "".concat(labelPrefix, ": ").concat(absoluteLabel)
@@ -37,7 +37,7 @@ import { EuiDatePopoverButton } from './date_popover/date_popover_button';
37
37
  import { EuiAutoRefresh, EuiAutoRefreshButton } from '../auto_refresh/auto_refresh';
38
38
  import { euiSuperDatePickerStyles } from './super_date_picker.styles';
39
39
  import { jsx as ___EmotionJSX } from "@emotion/react";
40
- function isRangeInvalid(start, end) {
40
+ function isRangeInvalid(start, end, minDate, maxDate) {
41
41
  if (start === 'now' && end === 'now') {
42
42
  return true;
43
43
  }
@@ -45,7 +45,7 @@ function isRangeInvalid(start, end) {
45
45
  var endMoment = dateMath.parse(end, {
46
46
  roundUp: true
47
47
  });
48
- var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !moment(startMoment).isValid() || !moment(endMoment).isValid() || startMoment.isAfter(endMoment);
48
+ var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !moment(startMoment).isValid() || !moment(endMoment).isValid() || startMoment.isAfter(endMoment) || endMoment.isBefore(startMoment) || minDate != null && startMoment.isBefore(minDate) || maxDate != null && endMoment.isAfter(maxDate);
49
49
  return isInvalid;
50
50
  }
51
51
  export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
@@ -64,7 +64,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
64
64
  },
65
65
  start: _this.props.start,
66
66
  end: _this.props.end,
67
- isInvalid: isRangeInvalid(_this.props.start, _this.props.end),
67
+ isInvalid: isRangeInvalid(_this.props.start, _this.props.end, _this.props.minDate, _this.props.maxDate),
68
68
  hasChanged: false,
69
69
  showPrettyDuration: showPrettyDuration(_this.props.start, _this.props.end, _this.props.commonlyUsedRanges),
70
70
  isStartDatePopoverOpen: false,
@@ -73,7 +73,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
73
73
  _defineProperty(_this, "setTime", function (_ref) {
74
74
  var end = _ref.end,
75
75
  start = _ref.start;
76
- var isInvalid = isRangeInvalid(start, end);
76
+ var isInvalid = isRangeInvalid(start, end, _this.props.minDate, _this.props.maxDate);
77
77
  _this.setState({
78
78
  start: start,
79
79
  end: end,
@@ -262,6 +262,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
262
262
  locale = _this$props3.locale,
263
263
  timeFormat = _this$props3.timeFormat,
264
264
  utcOffset = _this$props3.utcOffset,
265
+ minDate = _this$props3.minDate,
266
+ maxDate = _this$props3.maxDate,
265
267
  compressed = _this$props3.compressed,
266
268
  onFocus = _this$props3.onFocus,
267
269
  styles = _this$props3.memoizedStyles;
@@ -336,6 +338,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
336
338
  utcOffset: utcOffset,
337
339
  timeFormat: timeFormat,
338
340
  locale: locale || contextLocale,
341
+ minDate: minDate,
342
+ maxDate: maxDate,
339
343
  canRoundRelativeUnits: canRoundRelativeUnits,
340
344
  isOpen: _this.state.isStartDatePopoverOpen,
341
345
  onPopoverToggle: _this.onStartDatePopoverToggle,
@@ -358,6 +362,8 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
358
362
  utcOffset: utcOffset,
359
363
  timeFormat: timeFormat,
360
364
  locale: locale || contextLocale,
365
+ minDate: minDate,
366
+ maxDate: maxDate,
361
367
  canRoundRelativeUnits: canRoundRelativeUnits,
362
368
  roundUp: true,
363
369
  isOpen: _this.state.isEndDatePopoverOpen,
@@ -463,7 +469,7 @@ export var EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
463
469
  },
464
470
  start: nextProps.start,
465
471
  end: nextProps.end,
466
- isInvalid: isRangeInvalid(nextProps.start, nextProps.end),
472
+ isInvalid: isRangeInvalid(nextProps.start, nextProps.end, nextProps.minDate, nextProps.maxDate),
467
473
  hasChanged: false,
468
474
  showPrettyDuration: showPrettyDuration(nextProps.start, nextProps.end, nextProps.commonlyUsedRanges)
469
475
  };
@@ -13,7 +13,7 @@ import React from 'react';
13
13
  import { useEuiMemoizedStyles } from '../../services';
14
14
  import { logicalStyle } from '../../global_styling';
15
15
  import { EuiIcon } from '../icon';
16
- import { EuiI18n, useEuiI18n } from '../i18n';
16
+ import { EuiI18n } from '../i18n';
17
17
  import { EuiScreenReaderOnly } from '../accessibility';
18
18
 
19
19
  /**
@@ -31,14 +31,16 @@ export var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref2) {
31
31
  rest = _objectWithoutProperties(_ref2, _excluded);
32
32
  var iconCssStyle = useEuiMemoizedStyles(iconStyle);
33
33
  var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
34
- var iconAriaLabel = useEuiI18n('euiExternalLinkIcon.ariaLabel', 'External link');
35
- return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(EuiIcon, _extends({
34
+ return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiIcon, _extends({
36
35
  css: iconCssStyle,
37
- "aria-label": iconAriaLabel,
38
36
  size: "s",
39
- type: "popout"
40
- }, rest)), target === '_blank' && ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
37
+ type: "popout",
38
+ role: "presentation"
39
+ }, rest)), target === '_blank' ? ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
41
40
  token: "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
42
- default: "(opens in a new tab or window)"
43
- }))));
41
+ default: "(external, opens in a new tab or window)"
42
+ }))) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
43
+ token: "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
44
+ default: "(external)"
45
+ }))))));
44
46
  };
@@ -17,7 +17,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
17
17
  // Provides a solid reset and base for handling sizing layout
18
18
  // Does not include any visual styles
19
19
  var euiButtonBaseCSS = exports.euiButtonBaseCSS = function euiButtonBaseCSS() {
20
- return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat((0, _global_styling.logicalTextAlignStyle)('center'), ";\n white-space: nowrap;\n ").concat((0, _global_styling.logicalCSS)('max-width', '100%'), ";\n vertical-align: middle;\n ");
20
+ return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat((0, _global_styling.logicalTextAlignCSS)('center'), ";\n white-space: nowrap;\n ").concat((0, _global_styling.logicalCSS)('max-width', '100%'), ";\n vertical-align: middle;\n ");
21
21
  };
22
22
  var _ref = process.env.NODE_ENV === "production" ? {
23
23
  name: "8595p9-isDisabled",
@@ -31,7 +31,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
31
31
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
32
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
33
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34
- var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
34
+ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PURE__*/(0, _react.memo)(function (_ref) {
35
35
  var renderCustomGridBody = _ref.renderCustomGridBody,
36
36
  renderCellValue = _ref.renderCellValue,
37
37
  cellContext = _ref.cellContext,
@@ -87,27 +87,31 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
87
87
  }),
88
88
  setRowHeight = _useDefaultRowHeight.setRowHeight,
89
89
  getRowHeight = _useDefaultRowHeight.getRowHeight;
90
-
91
- /**
92
- * Header & footer
93
- */
94
- var _useDataGridHeader = (0, _header.useDataGridHeader)({
90
+ var headerRowProps = (0, _react.useMemo)(function () {
91
+ return {
95
92
  leadingControlColumns: leadingControlColumns,
96
93
  trailingControlColumns: trailingControlColumns,
97
94
  columns: columns,
98
95
  columnWidths: columnWidths,
99
96
  defaultColumnWidth: defaultColumnWidth,
100
97
  setColumnWidth: setColumnWidth,
101
- visibleColCount: visibleColCount,
102
98
  setVisibleColumns: setVisibleColumns,
99
+ visibleColCount: visibleColCount,
103
100
  switchColumnPos: switchColumnPos,
104
101
  sorting: sorting,
105
102
  schema: schema,
106
103
  schemaDetectors: schemaDetectors,
107
104
  gridStyles: gridStyles
108
- }),
105
+ };
106
+ }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
107
+
108
+ /**
109
+ * Header & footer
110
+ */
111
+ var _useDataGridHeader = (0, _header.useDataGridHeader)(headerRowProps),
109
112
  headerRow = _useDataGridHeader.headerRow;
110
- var _useDataGridFooter = (0, _footer.useDataGridFooter)({
113
+ var footerRowProps = (0, _react.useMemo)(function () {
114
+ return {
111
115
  renderFooterCellValue: renderFooterCellValue,
112
116
  renderCellPopover: renderCellPopover,
113
117
  rowIndex: visibleRows.visibleRowCount,
@@ -121,7 +125,9 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
121
125
  defaultColumnWidth: defaultColumnWidth,
122
126
  schema: schema,
123
127
  gridStyles: gridStyles
124
- }),
128
+ };
129
+ }, [renderFooterCellValue, renderCellPopover, visibleRows.visibleRowCount, visibleColCount, interactiveCellId, leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, schema, gridStyles]);
130
+ var _useDataGridFooter = (0, _footer.useDataGridFooter)(footerRowProps),
125
131
  footerRow = _useDataGridFooter.footerRow;
126
132
 
127
133
  /**
@@ -148,19 +154,22 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
148
154
  gridStyles: gridStyles
149
155
  };
150
156
  }, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
151
- var Cell = (0, _react.useCallback)(function (_ref2) {
152
- var colIndex = _ref2.colIndex,
153
- visibleRowIndex = _ref2.visibleRowIndex,
154
- rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
155
- var style = {
156
- height: rowHeightUtils.isAutoHeight(visibleRowIndex, rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
157
+ var Cell = (0, _react.useMemo)(function () {
158
+ return function (_ref2) {
159
+ var _rest$rowHeightsOptio;
160
+ var colIndex = _ref2.colIndex,
161
+ visibleRowIndex = _ref2.visibleRowIndex,
162
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
163
+ var style = {
164
+ height: rowHeightUtils.isAutoHeight(visibleRowIndex, (_rest$rowHeightsOptio = rest.rowHeightsOptions) !== null && _rest$rowHeightsOptio !== void 0 ? _rest$rowHeightsOptio : rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
165
+ };
166
+ var props = _objectSpread({
167
+ colIndex: colIndex,
168
+ visibleRowIndex: visibleRowIndex,
169
+ style: style
170
+ }, cellProps);
171
+ return (0, _react2.jsx)(_cell.CellWrapper, (0, _extends2.default)({}, props, rest));
157
172
  };
158
- var props = _objectSpread({
159
- colIndex: colIndex,
160
- visibleRowIndex: visibleRowIndex,
161
- style: style
162
- }, cellProps);
163
- return (0, _react2.jsx)(_cell.CellWrapper, (0, _extends2.default)({}, props, rest));
164
173
  }, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
165
174
 
166
175
  // Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
@@ -168,12 +177,20 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
168
177
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
169
178
  customGridBodyProps = _useState2[0],
170
179
  setCustomGridBodyProps = _useState2[1];
180
+ var customDataGridBodyProps = (0, _react.useMemo)(function () {
181
+ return {
182
+ gridWidth: gridWidth,
183
+ visibleColumns: visibleColumns,
184
+ visibleRowData: visibleRows,
185
+ Cell: Cell,
186
+ setCustomGridBodyProps: setCustomGridBodyProps,
187
+ headerRow: headerRow,
188
+ footerRow: footerRow
189
+ };
190
+ }, [gridWidth, visibleColumns, visibleRows, Cell, setCustomGridBodyProps, headerRow, footerRow]);
191
+ var BodyElement = renderCustomGridBody;
171
192
  return (0, _react2.jsx)("div", (0, _extends2.default)({}, customGridBodyProps, {
172
193
  className: (0, _classnames.default)('euiDataGrid__customRenderBody', className, customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
173
- }), headerRow, renderCustomGridBody({
174
- visibleColumns: visibleColumns,
175
- visibleRowData: visibleRows,
176
- Cell: Cell,
177
- setCustomGridBodyProps: setCustomGridBodyProps
178
- }), footerRow);
179
- };
194
+ }), (0, _react2.jsx)(BodyElement, customDataGridBodyProps));
195
+ });
196
+ EuiDataGridBodyCustomRender.displayName = 'EuiDataGridBodyCustomRender';
@@ -15,7 +15,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
15
15
  * Side Public License, v 1.
16
16
  */
17
17
  var euiDatePickerRangeStyles = exports.euiDatePickerRangeStyles = {
18
- euiDatePickerRange: /*#__PURE__*/(0, _react.css)(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", (0, _global_styling.logicalCSS)('height', '100%'), ";};label:euiDatePickerRange;")
18
+ euiDatePickerRange: /*#__PURE__*/(0, _react.css)(".euiPopover,.react-datepicker__input-container,.euiDatePicker{", (0, _global_styling.logicalCSS)('height', '100%'), ";}.euiPopover{flex:1;};label:euiDatePickerRange;")
19
19
  };
20
20
  var _ref = process.env.NODE_ENV === "production" ? {
21
21
  name: "bicgs9-noShadow",
@@ -41,6 +41,8 @@ var EuiAbsoluteTab = exports.EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
41
41
  locale = _ref.locale,
42
42
  roundUp = _ref.roundUp,
43
43
  utcOffset = _ref.utcOffset,
44
+ minDate = _ref.minDate,
45
+ maxDate = _ref.maxDate,
44
46
  labelPrefix = _ref.labelPrefix;
45
47
  var styles = (0, _services.useEuiMemoizedStyles)(_absolute_tab.euiAbsoluteTabDateFormStyles);
46
48
  var _useState = (0, _react.useState)(function () {
@@ -134,7 +136,9 @@ var EuiAbsoluteTab = exports.EuiAbsoluteTab = function EuiAbsoluteTab(_ref) {
134
136
  dateFormat: dateFormat,
135
137
  timeFormat: timeFormat,
136
138
  locale: locale,
137
- utcOffset: utcOffset
139
+ utcOffset: utcOffset,
140
+ minDate: minDate,
141
+ maxDate: maxDate
138
142
  }), (0, _react2.jsx)(_flex.EuiFlexGroup, {
139
143
  component: "form",
140
144
  onSubmit: function onSubmit(e) {
@@ -16,7 +16,7 @@ var _pretty_duration = require("../pretty_duration");
16
16
  var _date_popover_content = require("./date_popover_content");
17
17
  var _date_popover_button = require("./date_popover_button.styles");
18
18
  var _react2 = require("@emotion/react");
19
- var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
19
+ var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value", "buttonProps", "canRoundRelativeUnits", "roundUp", "onChange", "locale", "dateFormat", "utcOffset", "minDate", "maxDate", "timeFormat", "isOpen", "onPopoverToggle", "onPopoverClose", "compressed", "timeOptions"];
20
20
  /*
21
21
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
22
22
  * or more contributor license agreements. Licensed under the Elastic License
@@ -38,6 +38,8 @@ var EuiDatePopoverButton = exports.EuiDatePopoverButton = function EuiDatePopove
38
38
  locale = props.locale,
39
39
  dateFormat = props.dateFormat,
40
40
  utcOffset = props.utcOffset,
41
+ minDate = props.minDate,
42
+ maxDate = props.maxDate,
41
43
  timeFormat = props.timeFormat,
42
44
  isOpen = props.isOpen,
43
45
  onPopoverToggle = props.onPopoverToggle,
@@ -98,7 +100,9 @@ var EuiDatePopoverButton = exports.EuiDatePopoverButton = function EuiDatePopove
98
100
  locale: locale,
99
101
  position: position,
100
102
  utcOffset: utcOffset,
101
- timeOptions: timeOptions
103
+ timeOptions: timeOptions,
104
+ minDate: minDate,
105
+ maxDate: maxDate
102
106
  }));
103
107
  };
104
108
  EuiDatePopoverButton.displayName = 'EuiDatePopoverButton';
@@ -37,7 +37,9 @@ var EuiDatePopoverContent = exports.EuiDatePopoverContent = function EuiDatePopo
37
37
  locale = _ref.locale,
38
38
  position = _ref.position,
39
39
  utcOffset = _ref.utcOffset,
40
- timeOptions = _ref.timeOptions;
40
+ timeOptions = _ref.timeOptions,
41
+ minDate = _ref.minDate,
42
+ maxDate = _ref.maxDate;
41
43
  var styles = (0, _services.useEuiMemoizedStyles)(_date_popover_content.euiDatePopoverContentStyles);
42
44
  var onTabClick = function onTabClick(selectedTab) {
43
45
  switch (selectedTab.id) {
@@ -66,7 +68,9 @@ var EuiDatePopoverContent = exports.EuiDatePopoverContent = function EuiDatePopo
66
68
  onChange: onChange,
67
69
  roundUp: roundUp,
68
70
  labelPrefix: labelPrefix,
69
- utcOffset: utcOffset
71
+ utcOffset: utcOffset,
72
+ minDate: minDate,
73
+ maxDate: maxDate
70
74
  }),
71
75
  'data-test-subj': 'superDatePickerAbsoluteTab',
72
76
  'aria-label': "".concat(labelPrefix, ": ").concat(absoluteLabel)
@@ -45,7 +45,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
45
45
  * in compliance with, at your election, the Elastic License 2.0 or the Server
46
46
  * Side Public License, v 1.
47
47
  */ // eslint-disable-line import/named
48
- function isRangeInvalid(start, end) {
48
+ function isRangeInvalid(start, end, minDate, maxDate) {
49
49
  if (start === 'now' && end === 'now') {
50
50
  return true;
51
51
  }
@@ -53,7 +53,7 @@ function isRangeInvalid(start, end) {
53
53
  var endMoment = _datemath.default.parse(end, {
54
54
  roundUp: true
55
55
  });
56
- var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !(0, _moment.default)(startMoment).isValid() || !(0, _moment.default)(endMoment).isValid() || startMoment.isAfter(endMoment);
56
+ var isInvalid = !startMoment || !endMoment || !startMoment.isValid() || !endMoment.isValid() || !(0, _moment.default)(startMoment).isValid() || !(0, _moment.default)(endMoment).isValid() || startMoment.isAfter(endMoment) || endMoment.isBefore(startMoment) || minDate != null && startMoment.isBefore(minDate) || maxDate != null && endMoment.isAfter(maxDate);
57
57
  return isInvalid;
58
58
  }
59
59
  var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE__*/function (_Component) {
@@ -72,7 +72,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
72
72
  },
73
73
  start: _this.props.start,
74
74
  end: _this.props.end,
75
- isInvalid: isRangeInvalid(_this.props.start, _this.props.end),
75
+ isInvalid: isRangeInvalid(_this.props.start, _this.props.end, _this.props.minDate, _this.props.maxDate),
76
76
  hasChanged: false,
77
77
  showPrettyDuration: (0, _pretty_duration.showPrettyDuration)(_this.props.start, _this.props.end, _this.props.commonlyUsedRanges),
78
78
  isStartDatePopoverOpen: false,
@@ -81,7 +81,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
81
81
  (0, _defineProperty2.default)(_this, "setTime", function (_ref) {
82
82
  var end = _ref.end,
83
83
  start = _ref.start;
84
- var isInvalid = isRangeInvalid(start, end);
84
+ var isInvalid = isRangeInvalid(start, end, _this.props.minDate, _this.props.maxDate);
85
85
  _this.setState({
86
86
  start: start,
87
87
  end: end,
@@ -270,6 +270,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
270
270
  locale = _this$props3.locale,
271
271
  timeFormat = _this$props3.timeFormat,
272
272
  utcOffset = _this$props3.utcOffset,
273
+ minDate = _this$props3.minDate,
274
+ maxDate = _this$props3.maxDate,
273
275
  compressed = _this$props3.compressed,
274
276
  onFocus = _this$props3.onFocus,
275
277
  styles = _this$props3.memoizedStyles;
@@ -344,6 +346,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
344
346
  utcOffset: utcOffset,
345
347
  timeFormat: timeFormat,
346
348
  locale: locale || contextLocale,
349
+ minDate: minDate,
350
+ maxDate: maxDate,
347
351
  canRoundRelativeUnits: canRoundRelativeUnits,
348
352
  isOpen: _this.state.isStartDatePopoverOpen,
349
353
  onPopoverToggle: _this.onStartDatePopoverToggle,
@@ -366,6 +370,8 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
366
370
  utcOffset: utcOffset,
367
371
  timeFormat: timeFormat,
368
372
  locale: locale || contextLocale,
373
+ minDate: minDate,
374
+ maxDate: maxDate,
369
375
  canRoundRelativeUnits: canRoundRelativeUnits,
370
376
  roundUp: true,
371
377
  isOpen: _this.state.isEndDatePopoverOpen,
@@ -471,7 +477,7 @@ var EuiSuperDatePickerInternal = exports.EuiSuperDatePickerInternal = /*#__PURE_
471
477
  },
472
478
  start: nextProps.start,
473
479
  end: nextProps.end,
474
- isInvalid: isRangeInvalid(nextProps.start, nextProps.end),
480
+ isInvalid: isRangeInvalid(nextProps.start, nextProps.end, nextProps.minDate, nextProps.maxDate),
475
481
  hasChanged: false,
476
482
  showPrettyDuration: (0, _pretty_duration.showPrettyDuration)(nextProps.start, nextProps.end, nextProps.commonlyUsedRanges)
477
483
  };