@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.
- package/README.md +19 -1
- package/es/components/button/button_display/_button_display.styles.js +2 -2
- package/es/components/datagrid/body/data_grid_body_custom.js +48 -31
- package/es/components/date_picker/date_picker_range.styles.js +1 -1
- package/es/components/link/external_link_icon.js +10 -8
- package/eui.d.ts +13 -1
- package/i18ntokens.json +16 -16
- package/lib/components/button/button_display/_button_display.styles.js +1 -1
- package/lib/components/datagrid/body/data_grid_body_custom.js +47 -30
- package/lib/components/date_picker/date_picker_range.styles.js +1 -1
- package/lib/components/link/external_link_icon.js +9 -7
- package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +47 -30
- package/optimize/es/components/date_picker/date_picker_range.styles.js +1 -1
- package/optimize/es/components/link/external_link_icon.js +10 -8
- package/optimize/lib/components/button/button_display/_button_display.styles.js +1 -1
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +46 -29
- package/optimize/lib/components/date_picker/date_picker_range.styles.js +1 -1
- package/optimize/lib/components/link/external_link_icon.js +9 -7
- package/package.json +1 -1
- package/src/global_styling/mixins/_index.scss +1 -4
- package/src/global_styling/mixins/_tool_tip.scss +0 -7
- package/src/themes/amsterdam/global_styling/mixins/_index.scss +1 -4
- package/test-env/components/button/button_display/_button_display.styles.js +1 -1
- package/test-env/components/datagrid/body/data_grid_body_custom.js +47 -30
- package/test-env/components/date_picker/date_picker_range.styles.js +1 -1
- package/test-env/components/link/external_link_icon.js +9 -7
- package/src/global_styling/mixins/_button.scss +0 -149
- package/src/global_styling/mixins/_form.scss +0 -28
- package/src/global_styling/mixins/_panel.scss +0 -55
package/README.md
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Note: this README is what renders to our published NPM package, and should remain nice-looking & have useful links without repeating too much information from the top-level README -->
|
|
2
|
+
<img src="https://repository-images.githubusercontent.com/107422373/b6180480-a1d7-11eb-8a3c-902086232aa7" alt="" />
|
|
3
|
+
|
|
4
|
+
# Elastic UI Framework
|
|
5
|
+
|
|
6
|
+
**The Elastic UI Framework is a collection of React UI components for quickly building user interfaces at Elastic.**
|
|
7
|
+
|
|
8
|
+
## Resources
|
|
9
|
+
|
|
10
|
+
- Check out our [full documentation site](https://eui.elastic.co), which contains many examples of components in the EUI framework aesthetic, and how to use them in your products.
|
|
11
|
+
- [Our FAQ](https://github.com/elastic/eui#frequently-asked-questions) covers common usage questions — for other general questions regarding EUI, check out the [Discussions tab](https://github.com/elastic/eui/discussions).
|
|
12
|
+
- For technical instructions and guidelines on usage and development, please [refer to our wiki](https://github.com/elastic/eui/tree/main/wiki).
|
|
13
|
+
|
|
14
|
+
## License
|
|
15
|
+
|
|
16
|
+
[Dual-licensed under Elastic v2 and Server Side Public License, v1][license]. See Elastic's [licensing FAQ][licensing-faq] for details.
|
|
17
|
+
|
|
18
|
+
[license]: LICENSE.txt
|
|
19
|
+
[licensing-faq]: https://www.elastic.co/pricing/faq/licensing#im-using-eui-or-elastic-charts-in-my-application-outside-of-kibana-how-does-this-affect-me
|
|
@@ -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,
|
|
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(
|
|
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",
|
|
@@ -26,7 +26,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
26
26
|
* Side Public License, v 1.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import React, { useState, useMemo,
|
|
29
|
+
import React, { useState, useMemo, memo } from 'react';
|
|
30
30
|
import PropTypes from "prop-types";
|
|
31
31
|
import classNames from 'classnames';
|
|
32
32
|
import { useDefaultColumnWidth, useColumnWidths } from '../utils/col_widths';
|
|
@@ -35,7 +35,7 @@ import { useDataGridHeader } from './header';
|
|
|
35
35
|
import { useDataGridFooter } from './footer';
|
|
36
36
|
import { CellWrapper } from './cell';
|
|
37
37
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
38
|
-
export var EuiDataGridBodyCustomRender = function
|
|
38
|
+
export var EuiDataGridBodyCustomRender = /*#__PURE__*/memo(function (_ref) {
|
|
39
39
|
var renderCustomGridBody = _ref.renderCustomGridBody,
|
|
40
40
|
renderCellValue = _ref.renderCellValue,
|
|
41
41
|
cellContext = _ref.cellContext,
|
|
@@ -91,27 +91,31 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
91
91
|
}),
|
|
92
92
|
setRowHeight = _useDefaultRowHeight.setRowHeight,
|
|
93
93
|
getRowHeight = _useDefaultRowHeight.getRowHeight;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
* Header & footer
|
|
97
|
-
*/
|
|
98
|
-
var _useDataGridHeader = useDataGridHeader({
|
|
94
|
+
var headerRowProps = useMemo(function () {
|
|
95
|
+
return {
|
|
99
96
|
leadingControlColumns: leadingControlColumns,
|
|
100
97
|
trailingControlColumns: trailingControlColumns,
|
|
101
98
|
columns: columns,
|
|
102
99
|
columnWidths: columnWidths,
|
|
103
100
|
defaultColumnWidth: defaultColumnWidth,
|
|
104
101
|
setColumnWidth: setColumnWidth,
|
|
105
|
-
visibleColCount: visibleColCount,
|
|
106
102
|
setVisibleColumns: setVisibleColumns,
|
|
103
|
+
visibleColCount: visibleColCount,
|
|
107
104
|
switchColumnPos: switchColumnPos,
|
|
108
105
|
sorting: sorting,
|
|
109
106
|
schema: schema,
|
|
110
107
|
schemaDetectors: schemaDetectors,
|
|
111
108
|
gridStyles: gridStyles
|
|
112
|
-
}
|
|
109
|
+
};
|
|
110
|
+
}, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Header & footer
|
|
114
|
+
*/
|
|
115
|
+
var _useDataGridHeader = useDataGridHeader(headerRowProps),
|
|
113
116
|
headerRow = _useDataGridHeader.headerRow;
|
|
114
|
-
var
|
|
117
|
+
var footerRowProps = useMemo(function () {
|
|
118
|
+
return {
|
|
115
119
|
renderFooterCellValue: renderFooterCellValue,
|
|
116
120
|
renderCellPopover: renderCellPopover,
|
|
117
121
|
rowIndex: visibleRows.visibleRowCount,
|
|
@@ -125,7 +129,9 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
125
129
|
defaultColumnWidth: defaultColumnWidth,
|
|
126
130
|
schema: schema,
|
|
127
131
|
gridStyles: gridStyles
|
|
128
|
-
}
|
|
132
|
+
};
|
|
133
|
+
}, [renderFooterCellValue, renderCellPopover, visibleRows.visibleRowCount, visibleColCount, interactiveCellId, leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, schema, gridStyles]);
|
|
134
|
+
var _useDataGridFooter = useDataGridFooter(footerRowProps),
|
|
129
135
|
footerRow = _useDataGridFooter.footerRow;
|
|
130
136
|
|
|
131
137
|
/**
|
|
@@ -152,19 +158,22 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
152
158
|
gridStyles: gridStyles
|
|
153
159
|
};
|
|
154
160
|
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
|
|
155
|
-
var Cell =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
var Cell = useMemo(function () {
|
|
162
|
+
return function (_ref2) {
|
|
163
|
+
var _rest$rowHeightsOptio;
|
|
164
|
+
var colIndex = _ref2.colIndex,
|
|
165
|
+
visibleRowIndex = _ref2.visibleRowIndex,
|
|
166
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
167
|
+
var style = {
|
|
168
|
+
height: rowHeightUtils.isAutoHeight(visibleRowIndex, (_rest$rowHeightsOptio = rest.rowHeightsOptions) !== null && _rest$rowHeightsOptio !== void 0 ? _rest$rowHeightsOptio : rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
|
|
169
|
+
};
|
|
170
|
+
var props = _objectSpread({
|
|
171
|
+
colIndex: colIndex,
|
|
172
|
+
visibleRowIndex: visibleRowIndex,
|
|
173
|
+
style: style
|
|
174
|
+
}, cellProps);
|
|
175
|
+
return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
|
|
161
176
|
};
|
|
162
|
-
var props = _objectSpread({
|
|
163
|
-
colIndex: colIndex,
|
|
164
|
-
visibleRowIndex: visibleRowIndex,
|
|
165
|
-
style: style
|
|
166
|
-
}, cellProps);
|
|
167
|
-
return ___EmotionJSX(CellWrapper, _extends({}, props, rest));
|
|
168
177
|
}, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
|
|
169
178
|
|
|
170
179
|
// Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
|
|
@@ -172,15 +181,22 @@ export var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_r
|
|
|
172
181
|
_useState2 = _slicedToArray(_useState, 2),
|
|
173
182
|
customGridBodyProps = _useState2[0],
|
|
174
183
|
setCustomGridBodyProps = _useState2[1];
|
|
184
|
+
var customDataGridBodyProps = useMemo(function () {
|
|
185
|
+
return {
|
|
186
|
+
gridWidth: gridWidth,
|
|
187
|
+
visibleColumns: visibleColumns,
|
|
188
|
+
visibleRowData: visibleRows,
|
|
189
|
+
Cell: Cell,
|
|
190
|
+
setCustomGridBodyProps: setCustomGridBodyProps,
|
|
191
|
+
headerRow: headerRow,
|
|
192
|
+
footerRow: footerRow
|
|
193
|
+
};
|
|
194
|
+
}, [gridWidth, visibleColumns, visibleRows, Cell, setCustomGridBodyProps, headerRow, footerRow]);
|
|
195
|
+
var BodyElement = renderCustomGridBody;
|
|
175
196
|
return ___EmotionJSX("div", _extends({}, customGridBodyProps, {
|
|
176
197
|
className: classNames('euiDataGrid__customRenderBody', className, customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
|
|
177
|
-
}),
|
|
178
|
-
|
|
179
|
-
visibleRowData: visibleRows,
|
|
180
|
-
Cell: Cell,
|
|
181
|
-
setCustomGridBodyProps: setCustomGridBodyProps
|
|
182
|
-
}), footerRow);
|
|
183
|
-
};
|
|
198
|
+
}), ___EmotionJSX(BodyElement, customDataGridBodyProps));
|
|
199
|
+
});
|
|
184
200
|
EuiDataGridBodyCustomRender.propTypes = {
|
|
185
201
|
leadingControlColumns: PropTypes.arrayOf(PropTypes.shape({
|
|
186
202
|
/**
|
|
@@ -801,4 +817,5 @@ EuiDataGridBodyCustomRender.propTypes = {
|
|
|
801
817
|
gridItemsRendered: PropTypes.any.isRequired,
|
|
802
818
|
wrapperRef: PropTypes.any.isRequired,
|
|
803
819
|
className: PropTypes.string
|
|
804
|
-
};
|
|
820
|
+
};
|
|
821
|
+
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",
|
|
@@ -15,7 +15,7 @@ import PropTypes from "prop-types";
|
|
|
15
15
|
import { useEuiMemoizedStyles } from '../../services';
|
|
16
16
|
import { logicalStyle } from '../../global_styling';
|
|
17
17
|
import { EuiIcon } from '../icon';
|
|
18
|
-
import { EuiI18n
|
|
18
|
+
import { EuiI18n } from '../i18n';
|
|
19
19
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -33,16 +33,18 @@ export var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref2) {
|
|
|
33
33
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
34
34
|
var iconCssStyle = useEuiMemoizedStyles(iconStyle);
|
|
35
35
|
var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
|
|
36
|
-
|
|
37
|
-
return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(EuiIcon, _extends({
|
|
36
|
+
return ___EmotionJSX(React.Fragment, null, showExternalLinkIcon && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiIcon, _extends({
|
|
38
37
|
css: iconCssStyle,
|
|
39
|
-
"aria-label": iconAriaLabel,
|
|
40
38
|
size: "s",
|
|
41
|
-
type: "popout"
|
|
42
|
-
|
|
39
|
+
type: "popout",
|
|
40
|
+
role: "presentation"
|
|
41
|
+
}, rest)), target === '_blank' ? ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
|
|
43
42
|
token: "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
|
|
44
|
-
default: "(opens in a new tab or window)"
|
|
45
|
-
})))
|
|
43
|
+
default: "(external, opens in a new tab or window)"
|
|
44
|
+
}))) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, ___EmotionJSX(EuiI18n, {
|
|
45
|
+
token: "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
|
|
46
|
+
default: "(external)"
|
|
47
|
+
}))))));
|
|
46
48
|
};
|
|
47
49
|
EuiExternalLinkIcon.propTypes = {
|
|
48
50
|
target: PropTypes.any,
|
package/eui.d.ts
CHANGED
|
@@ -14913,6 +14913,18 @@ declare module '@elastic/eui/src/components/datagrid/data_grid_types' {
|
|
|
14913
14913
|
* It's best to wrap calls to `setCustomGridBodyProps` in a `useEffect` hook
|
|
14914
14914
|
*/
|
|
14915
14915
|
setCustomGridBodyProps: (props: EuiDataGridSetCustomGridBodyProps) => void;
|
|
14916
|
+
/**
|
|
14917
|
+
* The width of the grid, can be used by consumer as a layout utility
|
|
14918
|
+
*/
|
|
14919
|
+
gridWidth: number;
|
|
14920
|
+
/**
|
|
14921
|
+
* Header row component to render by custom renderer
|
|
14922
|
+
* */
|
|
14923
|
+
headerRow: React.JSX.Element;
|
|
14924
|
+
/**
|
|
14925
|
+
* Footer row component to render by custom renderer
|
|
14926
|
+
* */
|
|
14927
|
+
footerRow: React.JSX.Element | null;
|
|
14916
14928
|
}
|
|
14917
14929
|
export type EuiDataGridSetCustomGridBodyProps = CommonProps & HTMLAttributes<HTMLDivElement> & {
|
|
14918
14930
|
ref?: MutableRefObject<HTMLDivElement> | Ref<HTMLDivElement>;
|
|
@@ -31362,8 +31374,8 @@ declare module '@elastic/eui' {
|
|
|
31362
31374
|
"euiInlineEditForm.cancelButtonAriaLabel": any;
|
|
31363
31375
|
"euiInlineEditForm.inputKeyboardInstructions": any;
|
|
31364
31376
|
"euiInlineEditForm.activateEditModeDescription": any;
|
|
31365
|
-
"euiExternalLinkIcon.ariaLabel": any;
|
|
31366
31377
|
"euiExternalLinkIcon.newTarget.screenReaderOnlyText": any;
|
|
31378
|
+
"euiExternalLinkIcon.externalTarget.screenReaderOnlyText": any;
|
|
31367
31379
|
"euiPinnableListGroup.pinExtraActionLabel": any;
|
|
31368
31380
|
"euiPinnableListGroup.pinnedExtraActionLabel": any;
|
|
31369
31381
|
"euiLoadingStrings.ariaLabel": any;
|
package/i18ntokens.json
CHANGED
|
@@ -5256,37 +5256,37 @@
|
|
|
5256
5256
|
"filepath": "src/components/inline_edit/inline_edit_form.tsx"
|
|
5257
5257
|
},
|
|
5258
5258
|
{
|
|
5259
|
-
"token": "euiExternalLinkIcon.
|
|
5260
|
-
"defString": "
|
|
5259
|
+
"token": "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
|
|
5260
|
+
"defString": "(external, opens in a new tab or window)",
|
|
5261
5261
|
"highlighting": "string",
|
|
5262
5262
|
"loc": {
|
|
5263
5263
|
"start": {
|
|
5264
|
-
"line":
|
|
5265
|
-
"column":
|
|
5266
|
-
"index":
|
|
5264
|
+
"line": 56,
|
|
5265
|
+
"column": 16,
|
|
5266
|
+
"index": 1824
|
|
5267
5267
|
},
|
|
5268
5268
|
"end": {
|
|
5269
|
-
"line":
|
|
5270
|
-
"column":
|
|
5271
|
-
"index":
|
|
5269
|
+
"line": 59,
|
|
5270
|
+
"column": 18,
|
|
5271
|
+
"index": 1997
|
|
5272
5272
|
}
|
|
5273
5273
|
},
|
|
5274
5274
|
"filepath": "src/components/link/external_link_icon.tsx"
|
|
5275
5275
|
},
|
|
5276
5276
|
{
|
|
5277
|
-
"token": "euiExternalLinkIcon.
|
|
5278
|
-
"defString": "(
|
|
5277
|
+
"token": "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
|
|
5278
|
+
"defString": "(external)",
|
|
5279
5279
|
"highlighting": "string",
|
|
5280
5280
|
"loc": {
|
|
5281
5281
|
"start": {
|
|
5282
|
-
"line":
|
|
5283
|
-
"column":
|
|
5284
|
-
"index":
|
|
5282
|
+
"line": 66,
|
|
5283
|
+
"column": 18,
|
|
5284
|
+
"index": 2163
|
|
5285
5285
|
},
|
|
5286
5286
|
"end": {
|
|
5287
|
-
"line":
|
|
5288
|
-
"column":
|
|
5289
|
-
"index":
|
|
5287
|
+
"line": 69,
|
|
5288
|
+
"column": 20,
|
|
5289
|
+
"index": 2317
|
|
5290
5290
|
}
|
|
5291
5291
|
},
|
|
5292
5292
|
"filepath": "src/components/link/external_link_icon.tsx"
|
|
@@ -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.
|
|
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",
|
|
@@ -42,7 +42,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
42
42
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
43
43
|
* Side Public License, v 1.
|
|
44
44
|
*/
|
|
45
|
-
var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
45
|
+
var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
46
46
|
var renderCustomGridBody = _ref.renderCustomGridBody,
|
|
47
47
|
renderCellValue = _ref.renderCellValue,
|
|
48
48
|
cellContext = _ref.cellContext,
|
|
@@ -98,27 +98,31 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
98
98
|
}),
|
|
99
99
|
setRowHeight = _useDefaultRowHeight.setRowHeight,
|
|
100
100
|
getRowHeight = _useDefaultRowHeight.getRowHeight;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* Header & footer
|
|
104
|
-
*/
|
|
105
|
-
var _useDataGridHeader = (0, _header.useDataGridHeader)({
|
|
101
|
+
var headerRowProps = (0, _react.useMemo)(function () {
|
|
102
|
+
return {
|
|
106
103
|
leadingControlColumns: leadingControlColumns,
|
|
107
104
|
trailingControlColumns: trailingControlColumns,
|
|
108
105
|
columns: columns,
|
|
109
106
|
columnWidths: columnWidths,
|
|
110
107
|
defaultColumnWidth: defaultColumnWidth,
|
|
111
108
|
setColumnWidth: setColumnWidth,
|
|
112
|
-
visibleColCount: visibleColCount,
|
|
113
109
|
setVisibleColumns: setVisibleColumns,
|
|
110
|
+
visibleColCount: visibleColCount,
|
|
114
111
|
switchColumnPos: switchColumnPos,
|
|
115
112
|
sorting: sorting,
|
|
116
113
|
schema: schema,
|
|
117
114
|
schemaDetectors: schemaDetectors,
|
|
118
115
|
gridStyles: gridStyles
|
|
119
|
-
}
|
|
116
|
+
};
|
|
117
|
+
}, [leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, setColumnWidth, visibleColCount, setVisibleColumns, switchColumnPos, sorting, schema, schemaDetectors, gridStyles]);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Header & footer
|
|
121
|
+
*/
|
|
122
|
+
var _useDataGridHeader = (0, _header.useDataGridHeader)(headerRowProps),
|
|
120
123
|
headerRow = _useDataGridHeader.headerRow;
|
|
121
|
-
var
|
|
124
|
+
var footerRowProps = (0, _react.useMemo)(function () {
|
|
125
|
+
return {
|
|
122
126
|
renderFooterCellValue: renderFooterCellValue,
|
|
123
127
|
renderCellPopover: renderCellPopover,
|
|
124
128
|
rowIndex: visibleRows.visibleRowCount,
|
|
@@ -132,7 +136,9 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
132
136
|
defaultColumnWidth: defaultColumnWidth,
|
|
133
137
|
schema: schema,
|
|
134
138
|
gridStyles: gridStyles
|
|
135
|
-
}
|
|
139
|
+
};
|
|
140
|
+
}, [renderFooterCellValue, renderCellPopover, visibleRows.visibleRowCount, visibleColCount, interactiveCellId, leadingControlColumns, trailingControlColumns, columns, columnWidths, defaultColumnWidth, schema, gridStyles]);
|
|
141
|
+
var _useDataGridFooter = (0, _footer.useDataGridFooter)(footerRowProps),
|
|
136
142
|
footerRow = _useDataGridFooter.footerRow;
|
|
137
143
|
|
|
138
144
|
/**
|
|
@@ -159,19 +165,22 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
159
165
|
gridStyles: gridStyles
|
|
160
166
|
};
|
|
161
167
|
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
|
|
162
|
-
var Cell = (0, _react.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
var Cell = (0, _react.useMemo)(function () {
|
|
169
|
+
return function (_ref2) {
|
|
170
|
+
var _rest$rowHeightsOptio;
|
|
171
|
+
var colIndex = _ref2.colIndex,
|
|
172
|
+
visibleRowIndex = _ref2.visibleRowIndex,
|
|
173
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
174
|
+
var style = {
|
|
175
|
+
height: rowHeightUtils.isAutoHeight(visibleRowIndex, (_rest$rowHeightsOptio = rest.rowHeightsOptions) !== null && _rest$rowHeightsOptio !== void 0 ? _rest$rowHeightsOptio : rowHeightsOptions) ? 'auto' : getRowHeight(visibleRowIndex)
|
|
176
|
+
};
|
|
177
|
+
var props = _objectSpread({
|
|
178
|
+
colIndex: colIndex,
|
|
179
|
+
visibleRowIndex: visibleRowIndex,
|
|
180
|
+
style: style
|
|
181
|
+
}, cellProps);
|
|
182
|
+
return (0, _react2.jsx)(_cell.CellWrapper, _extends({}, props, rest));
|
|
168
183
|
};
|
|
169
|
-
var props = _objectSpread({
|
|
170
|
-
colIndex: colIndex,
|
|
171
|
-
visibleRowIndex: visibleRowIndex,
|
|
172
|
-
style: style
|
|
173
|
-
}, cellProps);
|
|
174
|
-
return (0, _react2.jsx)(_cell.CellWrapper, _extends({}, props, rest));
|
|
175
184
|
}, [cellProps, getRowHeight, rowHeightUtils, rowHeightsOptions]);
|
|
176
185
|
|
|
177
186
|
// Allow consumers to pass custom props/attributes/listeners etc. to the wrapping div
|
|
@@ -179,15 +188,22 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
179
188
|
_useState2 = _slicedToArray(_useState, 2),
|
|
180
189
|
customGridBodyProps = _useState2[0],
|
|
181
190
|
setCustomGridBodyProps = _useState2[1];
|
|
191
|
+
var customDataGridBodyProps = (0, _react.useMemo)(function () {
|
|
192
|
+
return {
|
|
193
|
+
gridWidth: gridWidth,
|
|
194
|
+
visibleColumns: visibleColumns,
|
|
195
|
+
visibleRowData: visibleRows,
|
|
196
|
+
Cell: Cell,
|
|
197
|
+
setCustomGridBodyProps: setCustomGridBodyProps,
|
|
198
|
+
headerRow: headerRow,
|
|
199
|
+
footerRow: footerRow
|
|
200
|
+
};
|
|
201
|
+
}, [gridWidth, visibleColumns, visibleRows, Cell, setCustomGridBodyProps, headerRow, footerRow]);
|
|
202
|
+
var BodyElement = renderCustomGridBody;
|
|
182
203
|
return (0, _react2.jsx)("div", _extends({}, customGridBodyProps, {
|
|
183
204
|
className: (0, _classnames.default)('euiDataGrid__customRenderBody', className, customGridBodyProps === null || customGridBodyProps === void 0 ? void 0 : customGridBodyProps.className)
|
|
184
|
-
}),
|
|
185
|
-
|
|
186
|
-
visibleRowData: visibleRows,
|
|
187
|
-
Cell: Cell,
|
|
188
|
-
setCustomGridBodyProps: setCustomGridBodyProps
|
|
189
|
-
}), footerRow);
|
|
190
|
-
};
|
|
205
|
+
}), (0, _react2.jsx)(BodyElement, customDataGridBodyProps));
|
|
206
|
+
});
|
|
191
207
|
EuiDataGridBodyCustomRender.propTypes = {
|
|
192
208
|
leadingControlColumns: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
193
209
|
/**
|
|
@@ -808,4 +824,5 @@ EuiDataGridBodyCustomRender.propTypes = {
|
|
|
808
824
|
gridItemsRendered: _propTypes.default.any.isRequired,
|
|
809
825
|
wrapperRef: _propTypes.default.any.isRequired,
|
|
810
826
|
className: _propTypes.default.string
|
|
811
|
-
};
|
|
827
|
+
};
|
|
828
|
+
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",
|
|
@@ -38,16 +38,18 @@ var EuiExternalLinkIcon = exports.EuiExternalLinkIcon = function EuiExternalLink
|
|
|
38
38
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
39
39
|
var iconCssStyle = (0, _services.useEuiMemoizedStyles)(iconStyle);
|
|
40
40
|
var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
|
|
41
|
-
|
|
42
|
-
return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_icon.EuiIcon, _extends({
|
|
41
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_icon.EuiIcon, _extends({
|
|
43
42
|
css: iconCssStyle,
|
|
44
|
-
"aria-label": iconAriaLabel,
|
|
45
43
|
size: "s",
|
|
46
|
-
type: "popout"
|
|
47
|
-
|
|
44
|
+
type: "popout",
|
|
45
|
+
role: "presentation"
|
|
46
|
+
}, rest)), target === '_blank' ? (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
48
47
|
token: "euiExternalLinkIcon.newTarget.screenReaderOnlyText",
|
|
49
|
-
default: "(opens in a new tab or window)"
|
|
50
|
-
}))))
|
|
48
|
+
default: "(external, opens in a new tab or window)"
|
|
49
|
+
}))) : (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
50
|
+
token: "euiExternalLinkIcon.externalTarget.screenReaderOnlyText",
|
|
51
|
+
default: "(external)"
|
|
52
|
+
}))))));
|
|
51
53
|
};
|
|
52
54
|
EuiExternalLinkIcon.propTypes = {
|
|
53
55
|
target: _propTypes.default.any,
|
|
@@ -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,
|
|
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(
|
|
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,
|
|
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
|
|
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
|
|
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 =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
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
|
-
}),
|
|
165
|
-
|
|
166
|
-
|
|
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",
|