@elastic/eui 96.0.0 → 97.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) 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/link/external_link_icon.js +10 -8
  6. package/eui.d.ts +13 -1
  7. package/i18ntokens.json +16 -16
  8. package/lib/components/button/button_display/_button_display.styles.js +1 -1
  9. package/lib/components/datagrid/body/data_grid_body_custom.js +47 -30
  10. package/lib/components/date_picker/date_picker_range.styles.js +1 -1
  11. package/lib/components/link/external_link_icon.js +9 -7
  12. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  13. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +47 -30
  14. package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
  15. package/optimize/es/components/link/external_link_icon.js +10 -8
  16. package/optimize/lib/components/button/button_display/_button_display.styles.js +1 -1
  17. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +46 -29
  18. package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
  19. package/optimize/lib/components/link/external_link_icon.js +9 -7
  20. package/package.json +1 -1
  21. package/src/global_styling/mixins/_index.scss +1 -4
  22. package/src/global_styling/mixins/_tool_tip.scss +0 -7
  23. package/src/themes/amsterdam/global_styling/mixins/_index.scss +1 -4
  24. package/test-env/components/button/button_display/_button_display.styles.js +1 -1
  25. package/test-env/components/datagrid/body/data_grid_body_custom.js +47 -30
  26. package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
  27. package/test-env/components/link/external_link_icon.js +9 -7
  28. package/src/global_styling/mixins/_button.scss +0 -149
  29. package/src/global_styling/mixins/_form.scss +0 -28
  30. package/src/global_styling/mixins/_panel.scss +0 -55
@@ -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",
@@ -36,14 +36,16 @@ var EuiExternalLinkIcon = exports.EuiExternalLinkIcon = function EuiExternalLink
36
36
  rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
37
37
  var iconCssStyle = (0, _services.useEuiMemoizedStyles)(iconStyle);
38
38
  var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
39
- var iconAriaLabel = (0, _i18n.useEuiI18n)('euiExternalLinkIcon.ariaLabel', 'External link');
40
- return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
39
+ return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
41
40
  css: iconCssStyle,
42
- "aria-label": iconAriaLabel,
43
41
  size: "s",
44
- type: "popout"
45
- }, rest)), target === '_blank' && (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
42
+ type: "popout",
43
+ role: "presentation"
44
+ }, rest)), target === '_blank' ? (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
46
45
  token: "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
47
- default: "(opens in a new tab or window)"
48
- }))));
46
+ default: "(external, opens in a new tab or window)"
47
+ }))) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
48
+ token: "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
49
+ default: "(external)"
50
+ }))))));
49
51
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "96.0.0",
4
+ "version": "97.0.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -5,7 +5,4 @@
5
5
  @import 'helpers';
6
6
  @import 'states';
7
7
 
8
- @import 'button';
9
- @import 'form';
10
- @import 'panel';
11
- @import 'tool_tip';
8
+ @import 'tool_tip'; // Needed by Elastic Charts
@@ -16,10 +16,3 @@
16
16
  background-color: $euiTooltipBorderColor;
17
17
  }
18
18
  }
19
-
20
- @mixin euiToolTipTitle {
21
- font-weight: $euiFontWeightBold;
22
- border-bottom: solid $euiBorderWidthThin $euiTooltipBorderColor;
23
- padding-bottom: $euiSizeXS;
24
- margin-bottom: $euiSizeXS;
25
- }
@@ -7,7 +7,4 @@
7
7
  @import '../../../../global_styling/mixins/helpers';
8
8
  @import 'states';
9
9
 
10
- @import '../../../../global_styling/mixins/button';
11
- @import '../../../../global_styling/mixins/form';
12
- @import '../../../../global_styling/mixins/panel';
13
- @import '../../../../global_styling/mixins/tool_tip';
10
+ @import '../../../../global_styling/mixins/tool_tip'; // Needed by Elastic Charts
@@ -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",
@@ -32,7 +32,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
32
32
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
33
33
  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; }
34
34
  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; }
35
- var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
35
+ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PURE__*/(0, _react.memo)(function (_ref) {
36
36
  var renderCustomGridBody = _ref.renderCustomGridBody,
37
37
  renderCellValue = _ref.renderCellValue,
38
38
  cellContext = _ref.cellContext,
@@ -88,27 +88,31 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
88
88
  }),
89
89
  setRowHeight = _useDefaultRowHeight.setRowHeight,
90
90
  getRowHeight = _useDefaultRowHeight.getRowHeight;
91
-
92
- /**
93
- * Header & footer
94
- */
95
- var _useDataGridHeader = (0, _header.useDataGridHeader)({
91
+ var headerRowProps = (0, _react.useMemo)(function () {
92
+ return {
96
93
  leadingControlColumns: leadingControlColumns,
97
94
  trailingControlColumns: trailingControlColumns,
98
95
  columns: columns,
99
96
  columnWidths: columnWidths,
100
97
  defaultColumnWidth: defaultColumnWidth,
101
98
  setColumnWidth: setColumnWidth,
102
- visibleColCount: visibleColCount,
103
99
  setVisibleColumns: setVisibleColumns,
100
+ visibleColCount: visibleColCount,
104
101
  switchColumnPos: switchColumnPos,
105
102
  sorting: sorting,
106
103
  schema: schema,
107
104
  schemaDetectors: schemaDetectors,
108
105
  gridStyles: gridStyles
109
- }),
106
+ };
107
+ }, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
108
+
109
+ /**
110
+ * Header & footer
111
+ */
112
+ var _useDataGridHeader = (0, _header.useDataGridHeader)(headerRowProps),
110
113
  headerRow = _useDataGridHeader.headerRow;
111
- var _useDataGridFooter = (0, _footer.useDataGridFooter)({
114
+ var footerRowProps = (0, _react.useMemo)(function () {
115
+ return {
112
116
  renderFooterCellValue: renderFooterCellValue,
113
117
  renderCellPopover: renderCellPopover,
114
118
  rowIndex: visibleRows.visibleRowCount,
@@ -122,7 +126,9 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
122
126
  defaultColumnWidth: defaultColumnWidth,
123
127
  schema: schema,
124
128
  gridStyles: gridStyles
125
- }),
129
+ };
130
+ }, [renderFooterCellValue, renderCellPopover, visibleRows.visibleRowCount, visibleColCount, interactiveCellId, leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, schema, gridStyles]);
131
+ var _useDataGridFooter = (0, _footer.useDataGridFooter)(footerRowProps),
126
132
  footerRow = _useDataGridFooter.footerRow;
127
133
 
128
134
  /**
@@ -149,19 +155,22 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
149
155
  gridStyles: gridStyles
150
156
  };
151
157
  }, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
152
- var Cell = (0, _react.useCallback)(function (_ref2) {
153
- var colIndex = _ref2.colIndex,
154
- visibleRowIndex = _ref2.visibleRowIndex,
155
- rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
156
- var style = {
157
- height: rowHeightUtils.isAutoHeight(visibleRowIndex, rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
158
+ var Cell = (0, _react.useMemo)(function () {
159
+ return function (_ref2) {
160
+ var _rest$rowHeightsOptio;
161
+ var colIndex = _ref2.colIndex,
162
+ visibleRowIndex = _ref2.visibleRowIndex,
163
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
164
+ var style = {
165
+ height: rowHeightUtils.isAutoHeight(visibleRowIndex, (_rest$rowHeightsOptio = rest.rowHeightsOptions) !== null && _rest$rowHeightsOptio !== void 0 ? _rest$rowHeightsOptio : rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
166
+ };
167
+ var props = _objectSpread({
168
+ colIndex: colIndex,
169
+ visibleRowIndex: visibleRowIndex,
170
+ style: style
171
+ }, cellProps);
172
+ return (0, _react2.jsx)(_cell.CellWrapper, (0, _extends2.default)({}, props, rest));
158
173
  };
159
- var props = _objectSpread({
160
- colIndex: colIndex,
161
- visibleRowIndex: visibleRowIndex,
162
- style: style
163
- }, cellProps);
164
- return (0, _react2.jsx)(_cell.CellWrapper, (0, _extends2.default)({}, props, rest));
165
174
  }, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
166
175
 
167
176
  // Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
@@ -169,15 +178,22 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
169
178
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
170
179
  customGridBodyProps = _useState2[0],
171
180
  setCustomGridBodyProps = _useState2[1];
181
+ var customDataGridBodyProps = (0, _react.useMemo)(function () {
182
+ return {
183
+ gridWidth: gridWidth,
184
+ visibleColumns: visibleColumns,
185
+ visibleRowData: visibleRows,
186
+ Cell: Cell,
187
+ setCustomGridBodyProps: setCustomGridBodyProps,
188
+ headerRow: headerRow,
189
+ footerRow: footerRow
190
+ };
191
+ }, [gridWidth, visibleColumns, visibleRows, Cell, setCustomGridBodyProps, headerRow, footerRow]);
192
+ var BodyElement = renderCustomGridBody;
172
193
  return (0, _react2.jsx)("div", (0, _extends2.default)({}, customGridBodyProps, {
173
194
  className: (0, _classnames.default)('euiDataGrid__customRenderBody', className, customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
174
- }), headerRow, renderCustomGridBody({
175
- visibleColumns: visibleColumns,
176
- visibleRowData: visibleRows,
177
- Cell: Cell,
178
- setCustomGridBodyProps: setCustomGridBodyProps
179
- }), footerRow);
180
- };
195
+ }), (0, _react2.jsx)(BodyElement, customDataGridBodyProps));
196
+ });
181
197
  EuiDataGridBodyCustomRender.propTypes = {
182
198
  leadingControlColumns: _propTypes.default.arrayOf(_propTypes.default.shape({
183
199
  /**
@@ -798,4 +814,5 @@ EuiDataGridBodyCustomRender.propTypes = {
798
814
  gridItemsRendered: _propTypes.default.any.isRequired,
799
815
  wrapperRef: _propTypes.default.any.isRequired,
800
816
  className: _propTypes.default.string
801
- };
817
+ };
818
+ 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",
@@ -37,16 +37,18 @@ var EuiExternalLinkIcon = exports.EuiExternalLinkIcon = function EuiExternalLink
37
37
  rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
38
38
  var iconCssStyle = (0, _services.useEuiMemoizedStyles)(iconStyle);
39
39
  var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
40
- var iconAriaLabel = (0, _i18n.useEuiI18n)('euiExternalLinkIcon.ariaLabel', 'External link');
41
- return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
40
+ return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
42
41
  css: iconCssStyle,
43
- "aria-label": iconAriaLabel,
44
42
  size: "s",
45
- type: "popout"
46
- }, rest)), target === '_blank' && (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
43
+ type: "popout",
44
+ role: "presentation"
45
+ }, rest)), target === '_blank' ? (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
47
46
  token: "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
48
- default: "(opens in a new tab or window)"
49
- }))));
47
+ default: "(external, opens in a new tab or window)"
48
+ }))) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
49
+ token: "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
50
+ default: "(external)"
51
+ }))))));
50
52
  };
51
53
  EuiExternalLinkIcon.propTypes = {
52
54
  target: _propTypes.default.any,
@@ -1,149 +0,0 @@
1
- // Provides a solid reset and base for handling sizing layout
2
- // Does not include any visual styles
3
- @mixin euiButtonBase {
4
- display: inline-block;
5
- appearance: none;
6
- cursor: pointer;
7
- height: $euiButtonHeight;
8
- line-height: $euiButtonHeight; // prevents descenders from getting cut off
9
- text-align: center;
10
- white-space: nowrap;
11
- max-width: 100%;
12
- vertical-align: middle;
13
- }
14
-
15
- // Adds the focus (and hover) animation for translating up 1px
16
- @mixin euiButtonFocus {
17
- @include euiCanAnimate {
18
- transition: transform $euiAnimSpeedNormal ease-in-out, background-color $euiAnimSpeedNormal ease-in-out;
19
-
20
- &:hover:not(:disabled) {
21
- transform: translateY(-1px);
22
- }
23
-
24
- &:focus {
25
- animation: euiButtonActive $euiAnimSpeedNormal $euiAnimSlightBounce;
26
- }
27
-
28
- &:active:not(:disabled) {
29
- transform: translateY(1px);
30
- }
31
- }
32
- }
33
-
34
- // All of the button base styles including the base, focus, font, and initial styles
35
- // Does not include individual alterations like color or sizes
36
- @mixin euiButton {
37
- @include euiButtonBase;
38
- @include euiFont;
39
- @include euiFontSize;
40
- @include euiButtonFocus;
41
-
42
- font-weight: $euiButtonFontWeight;
43
- text-decoration: none;
44
- outline-offset: -1px;
45
-
46
- &:hover:not(:disabled),
47
- &:focus {
48
- text-decoration: underline;
49
- }
50
- }
51
-
52
- // Correctly lays out the contents of a button when using the proper dom elements of:
53
- // <button>
54
- // <span className="__content">
55
- // {icon/spinner}
56
- // {child}
57
- // </span>
58
- // </button>
59
- // 1. Apply margin to all but last item in the flex.
60
- // 2. Margin gets flipped because of the row-reverse.
61
- @mixin euiButtonContent($isReverse: false) {
62
- height: 100%;
63
- width: 100%;
64
- vertical-align: middle;
65
-
66
- .euiButtonContent__icon,
67
- .euiButtonContent__spinner {
68
- flex-shrink: 0; // Ensures the icons/spinner don't scale down below their intended size
69
- }
70
-
71
- @if ($isReverse) {
72
- flex-direction: row-reverse;
73
-
74
- > * + * {
75
- margin-inline-start: 0; // 1, 2
76
- margin-inline-end: $euiSizeS; // 1, 2
77
- }
78
- } @else {
79
- display: flex;
80
- justify-content: center;
81
- align-items: center;
82
-
83
- > * + * {
84
- margin-inline-start: $euiSizeS; // 1
85
- }
86
- }
87
- }
88
-
89
- @mixin euiButtonContentDisabled {
90
- pointer-events: auto;
91
- cursor: not-allowed;
92
-
93
- &:hover,
94
- &:focus,
95
- &:focus-within {
96
- text-decoration: none;
97
- }
98
-
99
- .euiButtonContent__spinner {
100
- border-color: euiLoadingSpinnerBorderColors(currentColor);
101
- }
102
- }
103
-
104
- /*
105
- * Creates the Amsterdam style of button with a transparent background
106
- */
107
- @mixin euiButtonDefaultStyle($color: 'primary', $includeStates: true, $transparency: $euiButtonDefaultTransparency) {
108
- $backgroundColor: $color;
109
-
110
- @if (map-has-key($euiButtonTypes, $color)) {
111
- $backgroundColor: map-get($euiButtonTypes, $color);
112
- }
113
-
114
- $percentConversion: $transparency * 100%;
115
- // This variable simulates the possibly darkest background the button could be on
116
- // Simulates the 20% opaque color on top of the page background color
117
- $backgroundColorSimulated: mix($euiPageBackgroundColor, $backgroundColor, $percentConversion);
118
- // Then we can calculate the darkest text color needed
119
- color: makeHighContrastColor($backgroundColor, $backgroundColorSimulated);
120
- // But still use transparency
121
- background-color: transparentize($backgroundColor, $transparency);
122
-
123
- @if ($includeStates) {
124
- &:not([class*='isDisabled']) {
125
- &:hover,
126
- &:focus {
127
- // Duplicated from inert state simply to override default theme
128
- background-color: transparentize($backgroundColor, $transparency);
129
- }
130
- }
131
- }
132
- }
133
-
134
- /*
135
- * Creates the Amsterdam style of fill button
136
- */
137
- @mixin euiButtonFillStyle($color: 'primary') {
138
- $backgroundColor: $color;
139
-
140
- @if (map-has-key($euiButtonTypes, $color)) {
141
- $backgroundColor: map-get($euiButtonTypes, $color);
142
- }
143
-
144
- background-color: $backgroundColor;
145
- color: chooseLightOrDarkText($backgroundColor);
146
- }
147
-
148
- // Keyframe animation declarations can be found in
149
- // utility/animations.scss
@@ -1,28 +0,0 @@
1
- // 1. Must supply both values to background-size or some browsers apply the single value to both directions
2
-
3
- @mixin euiFormControlDefaultShadow($borderOnly: false) {
4
- background-color: $euiFormBackgroundColor;
5
- background-repeat: no-repeat;
6
- background-size: 0% 100%; // 1
7
-
8
- @if ($borderOnly) {
9
- box-shadow: inset 0 0 0 1px $euiFormBorderColor;
10
- } @else {
11
- box-shadow:
12
- #{$euiFormControlBoxShadow},
13
- inset 0 0 0 1px $euiFormBorderColor;
14
- }
15
-
16
- transition:
17
- box-shadow $euiAnimSpeedFast ease-in,
18
- background-image $euiAnimSpeedFast ease-in,
19
- background-size $euiAnimSpeedFast ease-in,
20
- background-color $euiAnimSpeedFast ease-in;
21
-
22
- // Fixes bug in Firefox where adding a transition to the background-color
23
- // caused a flash of differently styled dropdown.
24
- @supports (-moz-appearance: none) {
25
- // List *must* be in the same order as the above.
26
- transition-property: box-shadow, background-image, background-size;
27
- }
28
- }