@elastic/eui 121.0.0-snapshot.1788869799640 → 121.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/dist/eui-icons.json +10 -10
- package/es/components/datagrid/body/cell/data_grid_cell.js +5 -8
- package/es/components/datagrid/body/cell/data_grid_cell.styles.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +2 -4
- package/es/components/datagrid/body/footer/data_grid_footer_row.js +0 -4
- package/es/components/datagrid/body/header/column_resizer.js +87 -74
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +1 -2
- package/es/components/datagrid/body/header/data_grid_header_cell.js +0 -1
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -9
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -1
- package/es/components/datagrid/controls/keyboard_shortcuts.js +1 -17
- package/es/components/datagrid/data_grid.js +0 -2
- package/es/components/form/super_select/super_select.js +351 -247
- package/eui.d.ts +55 -30
- package/i18ntokens.json +205 -277
- package/lib/components/datagrid/body/cell/data_grid_cell.js +5 -8
- package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +2 -4
- package/lib/components/datagrid/body/footer/data_grid_footer_row.js +0 -4
- package/lib/components/datagrid/body/header/column_resizer.js +85 -73
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +0 -1
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -9
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -1
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -17
- package/lib/components/datagrid/data_grid.js +0 -2
- package/lib/components/form/super_select/super_select.js +355 -253
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +4 -5
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +1 -1
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +2 -4
- package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +0 -4
- package/optimize/es/components/datagrid/body/header/column_resizer.js +81 -69
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +0 -1
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -7
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -1
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +1 -17
- package/optimize/es/components/datagrid/data_grid.js +0 -2
- package/optimize/es/components/form/super_select/super_select.js +265 -242
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +4 -5
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +1 -1
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +2 -4
- package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +0 -4
- package/optimize/lib/components/datagrid/body/header/column_resizer.js +79 -69
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +0 -1
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -7
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -1
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +1 -17
- package/optimize/lib/components/datagrid/data_grid.js +0 -2
- package/optimize/lib/components/form/super_select/super_select.js +265 -243
- package/package.json +7 -8
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +5 -8
- package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +2 -4
- package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +0 -4
- package/test-env/components/datagrid/body/header/column_resizer.js +79 -69
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +0 -1
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +3 -9
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.styles.js +1 -1
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +1 -17
- package/test-env/components/datagrid/data_grid.js +0 -2
- package/test-env/components/form/super_select/super_select.js +345 -243
- package/es/components/datagrid/utils/copy_focused_cell.js +0 -34
- package/lib/components/datagrid/utils/copy_focused_cell.js +0 -39
- package/optimize/es/components/datagrid/utils/copy_focused_cell.js +0 -34
- package/optimize/lib/components/datagrid/utils/copy_focused_cell.js +0 -39
- package/test-env/components/datagrid/utils/copy_focused_cell.js +0 -16
|
@@ -8,7 +8,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
8
8
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
9
9
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
10
10
|
var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "rowHeightsOptions", "rowHeightUtils", "isControlColumn"],
|
|
11
|
-
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"
|
|
11
|
+
_excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
|
|
12
12
|
_excluded3 = ["isExpandable", "style", "className", "data-test-subj"],
|
|
13
13
|
_excluded4 = ["columnId", "columnIndex", "rowIndex", "visibleRowIndex"];
|
|
14
14
|
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; }
|
|
@@ -416,8 +416,6 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
416
416
|
rowHeightsOptions = _this$props9.rowHeightsOptions,
|
|
417
417
|
rowManager = _this$props9.rowManager,
|
|
418
418
|
pagination = _this$props9.pagination,
|
|
419
|
-
_this$props9$isLastCo = _this$props9.isLastCopyColumn,
|
|
420
|
-
isLastCopyColumn = _this$props9$isLastCo === void 0 ? false : _this$props9$isLastCo,
|
|
421
419
|
rest = _objectWithoutProperties(_this$props9, _excluded2);
|
|
422
420
|
var rowIndex = rest.rowIndex,
|
|
423
421
|
visibleRowIndex = rest.visibleRowIndex,
|
|
@@ -429,6 +427,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
429
427
|
|
|
430
428
|
// classNames set by EuiDataGridCellWrapper
|
|
431
429
|
var isControlColumn = cellClasses.includes('euiDataGridRowCell--controlColumn');
|
|
430
|
+
var isLastColumn = cellClasses.includes('euiDataGridRowCell--lastColumn');
|
|
432
431
|
var ariaRowIndex = pagination ? visibleRowIndex + 1 + pagination.pageSize * pagination.pageIndex : visibleRowIndex + 1;
|
|
433
432
|
var _this$state$cellProps2 = this.state.cellProps,
|
|
434
433
|
_ = _this$state$cellProps2.isExpandable,
|
|
@@ -468,7 +467,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
468
467
|
onKeyDown: this.handleCellKeyDown,
|
|
469
468
|
onMouseEnter: this.onMouseEnter,
|
|
470
469
|
onMouseLeave: this.onMouseLeave
|
|
471
|
-
}),
|
|
470
|
+
}), ___EmotionJSX(HandleInteractiveChildren, {
|
|
472
471
|
cellEl: this.cellRef.current,
|
|
473
472
|
updateCellFocusContext: this.updateCellFocusContext,
|
|
474
473
|
renderFocusTrap: !isExpandable
|
|
@@ -484,7 +483,7 @@ export var EuiDataGridCell = /*#__PURE__*/function (_Component) {
|
|
|
484
483
|
isControlColumn: isControlColumn,
|
|
485
484
|
rowIndex: rowIndex,
|
|
486
485
|
colIndex: colIndex
|
|
487
|
-
}))),
|
|
486
|
+
}))), isLastColumn ? tabularCopyMarkers.hiddenNewline : tabularCopyMarkers.hiddenTab, this.state.isFocused && ___EmotionJSX(CellScreenReaderDescription, {
|
|
488
487
|
columnName: (column === null || column === void 0 ? void 0 : column.displayAsText) || this.props.columnId,
|
|
489
488
|
columnIndex: colIndex + 1,
|
|
490
489
|
rowIndex: ariaRowIndex,
|
|
@@ -104,7 +104,7 @@ export var euiDataGridRowCellStyles = function euiDataGridRowCellStyles(euiTheme
|
|
|
104
104
|
var _euiDataGridCellOutli = euiDataGridCellOutlineSelectors(),
|
|
105
105
|
outlineSelectors = _euiDataGridCellOutli.outline;
|
|
106
106
|
return {
|
|
107
|
-
euiDataGridRowCell: /*#__PURE__*/css("position:relative;", outlineSelectors.show, "{", cellOutline.focusStyles, ";}", outlineSelectors.hover, "{", cellOutline.hoverStyles, ";}", outlineSelectors.focusTrapped, "{", cellOutline.hoverStyles, ";}&>[data-focus-lock-disabled]{", logicalCSS('height', '100%'), ";}&:where(.euiDataGridRowCell--numeric, .euiDataGridRowCell--currency){", logicalTextAlignCSS('right'), ";}&:where(.euiDataGridRowCell--uppercase){text-transform:uppercase;}&:where(.euiDataGridRowCell--lowercase){text-transform:lowercase;}&:where(.euiDataGridRowCell--capitalize){text-transform:capitalize;}
|
|
107
|
+
euiDataGridRowCell: /*#__PURE__*/css("position:relative;", outlineSelectors.show, "{", cellOutline.focusStyles, ";}", outlineSelectors.hover, "{", cellOutline.hoverStyles, ";}", outlineSelectors.focusTrapped, "{", cellOutline.hoverStyles, ";}&>[data-focus-lock-disabled]{", logicalCSS('height', '100%'), ";}&:where(.euiDataGridRowCell--numeric, .euiDataGridRowCell--currency){", logicalTextAlignCSS('right'), ";}&:where(.euiDataGridRowCell--uppercase){text-transform:uppercase;}&:where(.euiDataGridRowCell--lowercase){text-transform:lowercase;}&:where(.euiDataGridRowCell--capitalize){text-transform:capitalize;};label:euiDataGridRowCell;"),
|
|
108
108
|
content: {
|
|
109
109
|
euiDataGridRowCell__content: _ref,
|
|
110
110
|
autoHeight: /*#__PURE__*/css(logicalCSS('height', 'auto'), ";;label:autoHeight;"),
|
|
@@ -48,7 +48,6 @@ export var CellWrapper = /*#__PURE__*/memo(function (_ref) {
|
|
|
48
48
|
getCorrectRowIndex = _useContext.getCorrectRowIndex;
|
|
49
49
|
var isFirstColumn = colIndex === 0;
|
|
50
50
|
var isLastColumn = colIndex === visibleColCount - 1;
|
|
51
|
-
var isLastCopyColumn = columns.length > 0 && colIndex === leadingControlColumns.length + columns.length - 1;
|
|
52
51
|
var isLeadingControlColumn = colIndex < leadingControlColumns.length;
|
|
53
52
|
var isTrailingControlColumn = colIndex >= leadingControlColumns.length + columns.length;
|
|
54
53
|
var datacolIndex = colIndex - leadingControlColumns.length;
|
|
@@ -79,10 +78,9 @@ export var CellWrapper = /*#__PURE__*/memo(function (_ref) {
|
|
|
79
78
|
rowManager: rowManager,
|
|
80
79
|
popoverContext: popoverContext,
|
|
81
80
|
pagination: pagination,
|
|
82
|
-
cellContext: cellContext
|
|
83
|
-
isLastCopyColumn: isLastCopyColumn
|
|
81
|
+
cellContext: cellContext
|
|
84
82
|
};
|
|
85
|
-
}, [colIndex, setRowHeight, visibleRowIndex, getCorrectRowIndex, interactiveCellId, style, rowHeightsOptions, rowHeightUtils, rowManager, popoverContext, pagination, cellContext, isFirstColumn, isLastColumn,
|
|
83
|
+
}, [colIndex, setRowHeight, visibleRowIndex, getCorrectRowIndex, interactiveCellId, style, rowHeightsOptions, rowHeightUtils, rowManager, popoverContext, pagination, cellContext, isFirstColumn, isLastColumn, isLeadingControlColumn, isTrailingControlColumn, textTransform]);
|
|
86
84
|
if (isLeadingControlColumn) {
|
|
87
85
|
var leadingColumn = leadingControlColumns[colIndex];
|
|
88
86
|
var id = leadingColumn.id,
|
|
@@ -40,7 +40,6 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
40
40
|
var cssStyles = [styles.euiDataGridFooter, gridStyles.stickyFooter && styles.sticky, gridStyles.footer === 'striped' ? visibleRowIndex % 2 !== 0 && styles.striped : styles[gridStyles.footer]];
|
|
41
41
|
var classes = classNames('euiDataGridFooter', className);
|
|
42
42
|
var dataTestSubj = classNames('dataGridRow', 'dataGridFooterRow', _dataTestSubj);
|
|
43
|
-
var lastCopyColumnIndex = columns.length > 0 ? leadingControlColumns.length + columns.length - 1 : -1;
|
|
44
43
|
var getCellClasses = useCallback(function (columnIndex, classes) {
|
|
45
44
|
return classNames('euiDataGridFooterCell', {
|
|
46
45
|
'euiDataGridRowCell--firstColumn': columnIndex === 0,
|
|
@@ -74,7 +73,6 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
74
73
|
width: width,
|
|
75
74
|
renderCellValue: footerCellRender !== null && footerCellRender !== void 0 ? footerCellRender : renderEmpty,
|
|
76
75
|
isExpandable: false,
|
|
77
|
-
isLastCopyColumn: i === lastCopyColumnIndex,
|
|
78
76
|
className: getCellClasses(i, classNames('euiDataGridRowCell--controlColumn', footerCellProps === null || footerCellProps === void 0 ? void 0 : footerCellProps.className))
|
|
79
77
|
}));
|
|
80
78
|
}), columns.map(function (_ref3, i) {
|
|
@@ -92,7 +90,6 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
92
90
|
renderCellValue: renderCellValue,
|
|
93
91
|
renderCellPopover: renderCellPopover,
|
|
94
92
|
isExpandable: true,
|
|
95
|
-
isLastCopyColumn: columnPosition === lastCopyColumnIndex,
|
|
96
93
|
className: getCellClasses(columnPosition)
|
|
97
94
|
}));
|
|
98
95
|
}), trailingControlColumns.map(function (_ref4, i) {
|
|
@@ -108,7 +105,6 @@ var EuiDataGridFooterRow = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (
|
|
|
108
105
|
width: width,
|
|
109
106
|
renderCellValue: footerCellRender !== null && footerCellRender !== void 0 ? footerCellRender : renderEmpty,
|
|
110
107
|
isExpandable: false,
|
|
111
|
-
isLastCopyColumn: colIndex === lastCopyColumnIndex,
|
|
112
108
|
className: getCellClasses(colIndex, classNames('euiDataGridRowCell--controlColumn', footerCellProps === null || footerCellProps === void 0 ? void 0 : footerCellProps.className))
|
|
113
109
|
}));
|
|
114
110
|
}));
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2
9
|
/*
|
|
3
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -7,77 +14,82 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
7
14
|
* Side Public License, v 1.
|
|
8
15
|
*/
|
|
9
16
|
|
|
10
|
-
import React, {
|
|
11
|
-
import {
|
|
17
|
+
import React, { Component } from 'react';
|
|
18
|
+
import { RenderWithEuiStylesMemoizer } from '../../../../services';
|
|
12
19
|
import { logicalStyle } from '../../../../global_styling';
|
|
13
20
|
import { DragOverlay } from './draggable_columns';
|
|
14
21
|
import { euiDataGridColumnResizerStyles } from './column_resizer.styles';
|
|
15
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
23
|
var MINIMUM_COLUMN_WIDTH = 40;
|
|
17
|
-
export var EuiDataGridColumnResizer = function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
export var EuiDataGridColumnResizer = /*#__PURE__*/function (_Component) {
|
|
25
|
+
function EuiDataGridColumnResizer() {
|
|
26
|
+
var _this;
|
|
27
|
+
_classCallCheck(this, EuiDataGridColumnResizer);
|
|
28
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
29
|
+
args[_key] = arguments[_key];
|
|
30
|
+
}
|
|
31
|
+
_this = _callSuper(this, EuiDataGridColumnResizer, [].concat(args));
|
|
32
|
+
_defineProperty(_this, "state", {
|
|
33
|
+
initialX: 0,
|
|
34
|
+
offset: 0
|
|
35
|
+
});
|
|
36
|
+
_defineProperty(_this, "onMouseDown", function (e) {
|
|
37
|
+
_this.setState({
|
|
38
|
+
initialX: e.pageX
|
|
39
|
+
});
|
|
40
|
+
window.addEventListener('mouseup', _this.onMouseUp);
|
|
41
|
+
window.addEventListener('blur', _this.onMouseUp);
|
|
42
|
+
window.addEventListener('mousemove', _this.onMouseMove);
|
|
28
43
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
cursor: "ew-resize"
|
|
82
|
-
}));
|
|
83
|
-
};
|
|
44
|
+
// don't let this action steal focus
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(_this, "onMouseUp", function () {
|
|
48
|
+
var offset = _this.state.offset;
|
|
49
|
+
var _this$props = _this.props,
|
|
50
|
+
columnId = _this$props.columnId,
|
|
51
|
+
columnWidth = _this$props.columnWidth,
|
|
52
|
+
setColumnWidth = _this$props.setColumnWidth;
|
|
53
|
+
setColumnWidth(columnId, Math.max(MINIMUM_COLUMN_WIDTH, columnWidth + offset));
|
|
54
|
+
_this.setState({
|
|
55
|
+
offset: 0
|
|
56
|
+
});
|
|
57
|
+
window.removeEventListener('mouseup', _this.onMouseUp);
|
|
58
|
+
window.removeEventListener('blur', _this.onMouseUp);
|
|
59
|
+
window.removeEventListener('mousemove', _this.onMouseMove);
|
|
60
|
+
});
|
|
61
|
+
_defineProperty(_this, "onMouseMove", function (e) {
|
|
62
|
+
var columnWidth = _this.props.columnWidth;
|
|
63
|
+
_this.setState(function (_ref) {
|
|
64
|
+
var initialX = _ref.initialX;
|
|
65
|
+
return {
|
|
66
|
+
offset: Math.max(e.pageX - initialX, -(columnWidth - MINIMUM_COLUMN_WIDTH))
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
return _this;
|
|
71
|
+
}
|
|
72
|
+
_inherits(EuiDataGridColumnResizer, _Component);
|
|
73
|
+
return _createClass(EuiDataGridColumnResizer, [{
|
|
74
|
+
key: "render",
|
|
75
|
+
value: function render() {
|
|
76
|
+
var _this2 = this;
|
|
77
|
+
var offset = this.state.offset;
|
|
78
|
+
var isLastColumn = this.props.isLastColumn;
|
|
79
|
+
return ___EmotionJSX(RenderWithEuiStylesMemoizer, null, function (stylesMemoizer) {
|
|
80
|
+
var styles = stylesMemoizer(euiDataGridColumnResizerStyles);
|
|
81
|
+
var cssStyles = [styles.euiDataGridColumnResizer, isLastColumn && styles.isLastColumn, offset && styles.isDragging];
|
|
82
|
+
return ___EmotionJSX("div", {
|
|
83
|
+
css: cssStyles,
|
|
84
|
+
className: "euiDataGridColumnResizer",
|
|
85
|
+
"data-test-subj": "dataGridColumnResizer",
|
|
86
|
+
style: offset ? logicalStyle('margin-right', "".concat(-offset, "px")) : undefined,
|
|
87
|
+
onMouseDown: _this2.onMouseDown
|
|
88
|
+
}, ___EmotionJSX(DragOverlay, {
|
|
89
|
+
isDragging: !!offset,
|
|
90
|
+
cursor: "ew-resize"
|
|
91
|
+
}));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}]);
|
|
95
|
+
}(Component);
|
|
@@ -24,8 +24,7 @@ export var EuiDataGridControlHeaderCell = /*#__PURE__*/memo(function (_ref) {
|
|
|
24
24
|
id: id,
|
|
25
25
|
index: index,
|
|
26
26
|
width: width,
|
|
27
|
-
isLastColumn: isLastColumn
|
|
28
|
-
isControlColumn: true
|
|
27
|
+
isLastColumn: isLastColumn
|
|
29
28
|
}), ___EmotionJSX(HeaderCellRender, null));
|
|
30
29
|
});
|
|
31
30
|
EuiDataGridControlHeaderCell.displayName = 'EuiDataGridControlHeaderCell';
|
|
@@ -87,7 +87,6 @@ export var EuiDataGridHeaderCell = /*#__PURE__*/memo(function (_ref) {
|
|
|
87
87
|
id: id,
|
|
88
88
|
index: index,
|
|
89
89
|
isLastColumn: isLastColumn,
|
|
90
|
-
isLastCopyColumn: columns.length > 0 ? columns[columns.length - 1].id === id : isLastColumn,
|
|
91
90
|
width: width,
|
|
92
91
|
"aria-sort": ariaSort,
|
|
93
92
|
"aria-labelledby": cellContentId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["id", "index", "isLastColumn", "
|
|
4
|
+
var _excluded = ["id", "index", "isLastColumn", "width", "className", "children", "hasColumnActions", "isDragging", "onKeyDown", "aria-label", "aria-labelledby"];
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -27,10 +27,6 @@ export var EuiDataGridHeaderCellWrapper = function EuiDataGridHeaderCellWrapper(
|
|
|
27
27
|
var id = _ref.id,
|
|
28
28
|
index = _ref.index,
|
|
29
29
|
isLastColumn = _ref.isLastColumn,
|
|
30
|
-
_ref$isLastCopyColumn = _ref.isLastCopyColumn,
|
|
31
|
-
isLastCopyColumn = _ref$isLastCopyColumn === void 0 ? isLastColumn : _ref$isLastCopyColumn,
|
|
32
|
-
_ref$isControlColumn = _ref.isControlColumn,
|
|
33
|
-
isControlColumn = _ref$isControlColumn === void 0 ? false : _ref$isControlColumn,
|
|
34
30
|
width = _ref.width,
|
|
35
31
|
className = _ref.className,
|
|
36
32
|
children = _ref.children,
|
|
@@ -106,10 +102,10 @@ export var EuiDataGridHeaderCellWrapper = function EuiDataGridHeaderCellWrapper(
|
|
|
106
102
|
} : {},
|
|
107
103
|
"aria-label": renderFocusTrap ? ariaLabel : undefined,
|
|
108
104
|
"aria-labelledby": renderFocusTrap ? ariaLabelledby : undefined
|
|
109
|
-
}, rest),
|
|
105
|
+
}, rest), ___EmotionJSX(HandleInteractiveChildren, {
|
|
110
106
|
cellEl: isDragging ? null : headerEl,
|
|
111
107
|
renderFocusTrap: isDragging ? false : renderFocusTrap,
|
|
112
108
|
updateCellFocusContext: updateCellFocusContext,
|
|
113
109
|
onInteractiveChildrenFound: setInteractiveChildren
|
|
114
|
-
}, typeof children === 'function' ? children(renderFocusTrap) : children),
|
|
110
|
+
}, typeof children === 'function' ? children(renderFocusTrap) : children), isLastColumn ? tabularCopyMarkers.hiddenNewline : tabularCopyMarkers.hiddenTab);
|
|
115
111
|
};
|
|
@@ -21,6 +21,6 @@ export var euiDataGridHeaderCellWrapperStyles = function euiDataGridHeaderCellWr
|
|
|
21
21
|
var _euiDataGridCellOutli2 = euiDataGridCellOutlineSelectors(),
|
|
22
22
|
outlineSelectors = _euiDataGridCellOutli2.header;
|
|
23
23
|
return {
|
|
24
|
-
euiDataGridHeaderCell: /*#__PURE__*/css("position:relative;display:flex;align-items:center;flex:0 0 auto;font-weight:", euiTheme.font.weight.bold, ";", outlineSelectors.focus, "{", focusStyles, ";}", outlineSelectors.focusTrapped, "{", hoverStyles, ";}", outlineSelectors.showActions, "{&,&>[data-focus-lock-disabled]{gap:", euiTheme.size.xxs, ";}}&>[data-focus-lock-disabled]{display:flex;align-items:center;", logicalCSS('width', '100%'), ";}
|
|
24
|
+
euiDataGridHeaderCell: /*#__PURE__*/css("position:relative;display:flex;align-items:center;flex:0 0 auto;font-weight:", euiTheme.font.weight.bold, ";", outlineSelectors.focus, "{", focusStyles, ";}", outlineSelectors.focusTrapped, "{", hoverStyles, ";}", outlineSelectors.showActions, "{&,&>[data-focus-lock-disabled]{gap:", euiTheme.size.xxs, ";}}&>[data-focus-lock-disabled]{display:flex;align-items:center;", logicalCSS('width', '100%'), ";};label:euiDataGridHeaderCell;")
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -24,7 +24,6 @@ export var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts(
|
|
|
24
24
|
setIsOpen = _useState2[1];
|
|
25
25
|
var title = useEuiI18n('euiKeyboardShortcuts.title', 'Keyboard shortcuts');
|
|
26
26
|
var titleId = useGeneratedHtmlId();
|
|
27
|
-
var copyModifier = typeof navigator !== 'undefined' && /Mac|iP(hone|od|ad)/.test(navigator.platform) ? 'Cmd' : 'Ctrl';
|
|
28
27
|
var styles = useEuiMemoizedStyles(euiDataGridKeyboardShortcutsStyles);
|
|
29
28
|
var keyboardShortcuts = useMemo(function () {
|
|
30
29
|
return ___EmotionJSX(EuiPopover, {
|
|
@@ -176,24 +175,9 @@ export var useDataGridKeyboardShortcuts = function useDataGridKeyboardShortcuts(
|
|
|
176
175
|
token: "euiKeyboardShortcuts.escapeDescription",
|
|
177
176
|
default: "Close cell details and actions"
|
|
178
177
|
})
|
|
179
|
-
}, {
|
|
180
|
-
title: ___EmotionJSX(React.Fragment, null, ___EmotionJSX("kbd", null, copyModifier === 'Cmd' ? ___EmotionJSX(EuiI18n, {
|
|
181
|
-
token: "euiKeyboardShortcuts.cmd",
|
|
182
|
-
default: "Cmd"
|
|
183
|
-
}) : ___EmotionJSX(EuiI18n, {
|
|
184
|
-
token: "euiKeyboardShortcuts.ctrl",
|
|
185
|
-
default: "Ctrl"
|
|
186
|
-
})), ' ', ___EmotionJSX("kbd", null, ___EmotionJSX(EuiI18n, {
|
|
187
|
-
token: "euiKeyboardShortcuts.copyTitle",
|
|
188
|
-
default: "C"
|
|
189
|
-
}))),
|
|
190
|
-
description: ___EmotionJSX(EuiI18n, {
|
|
191
|
-
token: "euiKeyboardShortcuts.copyDescription",
|
|
192
|
-
default: "Copy the focused cell value"
|
|
193
|
-
})
|
|
194
178
|
}]
|
|
195
179
|
})));
|
|
196
|
-
}, [isOpen, title, titleId, styles
|
|
180
|
+
}, [isOpen, title, titleId, styles]);
|
|
197
181
|
return {
|
|
198
182
|
keyboardShortcuts: keyboardShortcuts
|
|
199
183
|
};
|
|
@@ -31,7 +31,6 @@ import { useInMemoryValues, EuiDataGridInMemoryRenderer } from './utils/in_memor
|
|
|
31
31
|
import { DataGridCellPopoverContext, useCellPopover } from './body/cell';
|
|
32
32
|
import { computeVisibleRows } from './utils/row_count';
|
|
33
33
|
import { schemaDetectors as providedSchemaDetectors, useMergedSchema } from './utils/data_grid_schema';
|
|
34
|
-
import { useCopyFocusedDataGridCell } from './utils/copy_focused_cell';
|
|
35
34
|
import { useImperativeGridRef } from './utils/ref';
|
|
36
35
|
import { emptyControlColumns } from './data_grid_types';
|
|
37
36
|
import { euiDataGridStyles } from './data_grid.styles';
|
|
@@ -248,7 +247,6 @@ export var EuiDataGrid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (pr
|
|
|
248
247
|
var showToolbar = !!toolbarVisibility;
|
|
249
248
|
var _useDataGridKeyboardS = useDataGridKeyboardShortcuts(),
|
|
250
249
|
keyboardShortcuts = _useDataGridKeyboardS.keyboardShortcuts;
|
|
251
|
-
useCopyFocusedDataGridCell();
|
|
252
250
|
var _useDataGridFullScree = useDataGridFullScreenSelector(onFullScreenChange),
|
|
253
251
|
isFullScreen = _useDataGridFullScree.isFullScreen,
|
|
254
252
|
setIsFullScreen = _useDataGridFullScree.setIsFullScreen,
|