@elastic/eui 95.11.0 → 95.12.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 +1 -69
- package/es/components/basic_table/basic_table.js +39 -32
- package/es/components/datagrid/body/cell/data_grid_cell.js +121 -15
- package/es/components/datagrid/body/cell/data_grid_cell.styles.js +5 -2
- package/es/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/es/components/datagrid/body/data_grid_body_virtualized.js +5 -2
- package/es/components/datagrid/body/footer/data_grid_footer_row.js +17 -9
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -2
- package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -1
- package/es/components/datagrid/body/header/data_grid_header_cell.styles.js +0 -2
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +6 -3
- package/es/components/datagrid/body/header/data_grid_header_row.js +5 -1
- package/es/components/datagrid/data_grid.js +3 -3
- package/es/components/datagrid/data_grid.stories.utils.js +65 -29
- package/es/components/datagrid/utils/row_heights.js +9 -33
- package/es/components/date_picker/date_picker.js +1 -1
- package/es/components/provider/provider.js +16 -13
- package/es/components/provider/system_color_mode/index.js +9 -0
- package/es/components/provider/system_color_mode/system_color_mode_provider.js +49 -0
- package/es/components/resizable_container/resizable_button.js +9 -2
- package/es/components/resizable_container/resizable_button.styles.js +19 -6
- package/es/components/table/table_header_cell.js +10 -3
- package/es/components/table/table_header_cell_checkbox.js +5 -3
- package/es/components/table/table_row_cell.js +10 -3
- package/es/components/table/table_row_cell_checkbox.js +5 -3
- package/es/services/copy/index.js +10 -0
- package/es/services/copy/tabular_copy.js +103 -0
- package/es/services/index.js +1 -1
- package/eui.d.ts +162 -67
- package/i18ntokens.json +90 -90
- package/lib/components/basic_table/basic_table.js +38 -31
- package/lib/components/datagrid/body/cell/data_grid_cell.js +120 -14
- package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +5 -2
- package/lib/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +5 -2
- package/lib/components/datagrid/body/footer/data_grid_footer_row.js +13 -5
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +5 -2
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -1
- package/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +0 -2
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +5 -2
- package/lib/components/datagrid/body/header/data_grid_header_row.js +5 -1
- package/lib/components/datagrid/data_grid.js +2 -2
- package/lib/components/datagrid/data_grid.stories.utils.js +66 -31
- package/lib/components/datagrid/utils/row_heights.js +8 -32
- package/lib/components/date_picker/date_picker.js +1 -1
- package/lib/components/provider/provider.js +16 -13
- package/lib/components/provider/system_color_mode/index.js +12 -0
- package/lib/components/provider/system_color_mode/system_color_mode_provider.js +54 -0
- package/lib/components/resizable_container/resizable_button.js +9 -2
- package/lib/components/resizable_container/resizable_button.styles.js +19 -6
- package/lib/components/table/table_header_cell.js +10 -3
- package/lib/components/table/table_header_cell_checkbox.js +5 -3
- package/lib/components/table/table_row_cell.js +10 -3
- package/lib/components/table/table_row_cell_checkbox.js +5 -3
- package/lib/services/copy/index.js +25 -0
- package/lib/services/copy/tabular_copy.js +111 -0
- package/lib/services/index.js +12 -8
- package/optimize/es/components/basic_table/basic_table.js +39 -32
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +18 -14
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +5 -2
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +5 -2
- package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +17 -9
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -1
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.styles.js +0 -2
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +5 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +5 -1
- package/optimize/es/components/datagrid/data_grid.js +3 -3
- package/optimize/es/components/datagrid/data_grid.stories.utils.js +65 -29
- package/optimize/es/components/datagrid/utils/row_heights.js +9 -33
- package/optimize/es/components/date_picker/date_picker.js +1 -1
- package/optimize/es/components/provider/provider.js +16 -13
- package/optimize/es/components/provider/system_color_mode/index.js +9 -0
- package/optimize/es/components/provider/system_color_mode/system_color_mode_provider.js +40 -0
- package/optimize/es/components/resizable_container/resizable_button.js +3 -2
- package/optimize/es/components/resizable_container/resizable_button.styles.js +19 -6
- package/optimize/es/components/table/table_header_cell.js +3 -2
- package/optimize/es/components/table/table_header_cell_checkbox.js +3 -2
- package/optimize/es/components/table/table_row_cell.js +4 -3
- package/optimize/es/components/table/table_row_cell_checkbox.js +3 -2
- package/optimize/es/services/copy/index.js +10 -0
- package/optimize/es/services/copy/tabular_copy.js +103 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +38 -31
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +17 -13
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +5 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +5 -2
- package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +13 -5
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +4 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -1
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.styles.js +0 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +4 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +5 -1
- package/optimize/lib/components/datagrid/data_grid.js +2 -2
- package/optimize/lib/components/datagrid/data_grid.stories.utils.js +70 -37
- package/optimize/lib/components/datagrid/utils/row_heights.js +8 -32
- package/optimize/lib/components/date_picker/date_picker.js +1 -1
- package/optimize/lib/components/provider/provider.js +16 -13
- package/optimize/lib/components/provider/system_color_mode/index.js +12 -0
- package/optimize/lib/components/provider/system_color_mode/system_color_mode_provider.js +47 -0
- package/optimize/lib/components/resizable_container/resizable_button.js +3 -2
- package/optimize/lib/components/resizable_container/resizable_button.styles.js +19 -6
- package/optimize/lib/components/table/table_header_cell.js +3 -2
- package/optimize/lib/components/table/table_header_cell_checkbox.js +3 -2
- package/optimize/lib/components/table/table_row_cell.js +4 -3
- package/optimize/lib/components/table/table_row_cell_checkbox.js +3 -2
- package/optimize/lib/services/copy/index.js +25 -0
- package/optimize/lib/services/copy/tabular_copy.js +111 -0
- package/optimize/lib/services/index.js +12 -8
- package/package.json +1 -1
- package/test-env/components/basic_table/basic_table.js +38 -31
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +120 -14
- package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +5 -2
- package/test-env/components/datagrid/body/data_grid_body_custom.js +5 -2
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +5 -2
- package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +13 -5
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +5 -2
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -1
- package/test-env/components/datagrid/body/header/data_grid_header_cell.styles.js +0 -2
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +5 -2
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +5 -1
- package/test-env/components/datagrid/data_grid.js +2 -2
- package/test-env/components/datagrid/data_grid.stories.utils.js +70 -37
- package/test-env/components/datagrid/utils/row_heights.js +8 -32
- package/test-env/components/date_picker/date_picker.js +1 -1
- package/test-env/components/provider/provider.js +16 -13
- package/test-env/components/provider/system_color_mode/index.js +12 -0
- package/test-env/components/provider/system_color_mode/system_color_mode_provider.js +51 -0
- package/test-env/components/resizable_container/resizable_button.js +9 -2
- package/test-env/components/resizable_container/resizable_button.styles.js +19 -6
- package/test-env/components/table/table_header_cell.js +10 -3
- package/test-env/components/table/table_header_cell_checkbox.js +5 -3
- package/test-env/components/table/table_row_cell.js +10 -3
- package/test-env/components/table/table_row_cell_checkbox.js +5 -3
- package/test-env/services/copy/index.js +25 -0
- package/test-env/services/copy/tabular_copy.js +30 -0
- package/test-env/services/index.js +12 -8
- /package/es/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/lib/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/optimize/es/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/optimize/lib/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
- /package/test-env/services/{copy_to_clipboard.js → copy/copy_to_clipboard.js} +0 -0
|
@@ -82,10 +82,7 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
82
82
|
});
|
|
83
83
|
}, [cellHeightType, isControlColumn]);
|
|
84
84
|
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_cell.euiDataGridRowCellStyles);
|
|
85
|
-
var cssStyles = [styles.content.euiDataGridRowCell__content].concat(_toConsumableArray(isControlColumn ? [
|
|
86
|
-
// Control column cells should not be vertically centered (defaultHeight) except
|
|
87
|
-
// on single rows. They should be top-aligned for auto and lineCount heights
|
|
88
|
-
styles.content.controlColumn, cellHeightType === 'default' ? styles.content.defaultHeight : styles.content.autoHeight] : [
|
|
85
|
+
var cssStyles = [styles.content.euiDataGridRowCell__content].concat(_toConsumableArray(isControlColumn ? [styles.content.controlColumn, styles.content.autoHeight] : [
|
|
89
86
|
// Regular data cells should always inherit height from the row wrapper,
|
|
90
87
|
// except for auto height
|
|
91
88
|
cellHeightType === 'auto' ? styles.content.autoHeight : styles.content.defaultHeight]));
|
|
@@ -549,6 +546,57 @@ EuiDataGridCellContent.propTypes = {
|
|
|
549
546
|
}),
|
|
550
547
|
rowHeightUtils: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
|
|
551
548
|
pagination: _propTypes.default.any,
|
|
549
|
+
gridStyles: _propTypes.default.shape({
|
|
550
|
+
/**
|
|
551
|
+
* Size of fonts used within the row and column cells
|
|
552
|
+
* @default m
|
|
553
|
+
*/
|
|
554
|
+
fontSize: _propTypes.default.oneOf(["s", "m", "l"]),
|
|
555
|
+
/**
|
|
556
|
+
* Defines the padding with the row and column cells
|
|
557
|
+
* @default m
|
|
558
|
+
*/
|
|
559
|
+
cellPadding: _propTypes.default.oneOf(["s", "m", "l"]),
|
|
560
|
+
/**
|
|
561
|
+
* Border used for the row and column cells
|
|
562
|
+
* @default all
|
|
563
|
+
*/
|
|
564
|
+
border: _propTypes.default.oneOf(["all", "horizontal", "none"]),
|
|
565
|
+
/**
|
|
566
|
+
* If set to true, rows will alternate zebra striping for clarity
|
|
567
|
+
* @default false
|
|
568
|
+
*/
|
|
569
|
+
stripes: _propTypes.default.bool,
|
|
570
|
+
/**
|
|
571
|
+
* Visual style for the column headers. Recommendation is to use the `underline` style in times when #EuiDataGrid `toolbarVisibility` is set to `false`.
|
|
572
|
+
* @default shade
|
|
573
|
+
*/
|
|
574
|
+
header: _propTypes.default.oneOf(["shade", "underline"]),
|
|
575
|
+
/**
|
|
576
|
+
* Visual style for the column footers.
|
|
577
|
+
* @default overline
|
|
578
|
+
*/
|
|
579
|
+
footer: _propTypes.default.oneOf(["shade", "overline", "striped"]),
|
|
580
|
+
/**
|
|
581
|
+
* If set to true, the footer row will be sticky
|
|
582
|
+
* @default true
|
|
583
|
+
*/
|
|
584
|
+
stickyFooter: _propTypes.default.bool,
|
|
585
|
+
/**
|
|
586
|
+
* Will define what visual style to show on row hover
|
|
587
|
+
* @default hover
|
|
588
|
+
*/
|
|
589
|
+
rowHover: _propTypes.default.oneOf(["highlight", "none"]),
|
|
590
|
+
/**
|
|
591
|
+
* Optionally pass custom classes to highlight or customize certain rows
|
|
592
|
+
*/
|
|
593
|
+
rowClasses: _propTypes.default.shape({}),
|
|
594
|
+
/**
|
|
595
|
+
* Optional callback returning the current `gridStyle` config when changes occur from user input (e.g. toolbar display controls).
|
|
596
|
+
* Can be used for, e.g. storing user `gridStyle` in a local storage object.
|
|
597
|
+
*/
|
|
598
|
+
onChange: _propTypes.default.func
|
|
599
|
+
}).isRequired,
|
|
552
600
|
setCellProps: _propTypes.default.func.isRequired,
|
|
553
601
|
setCellContentsRef: _propTypes.default.func.isRequired,
|
|
554
602
|
isExpanded: _propTypes.default.bool.isRequired,
|
|
@@ -616,7 +664,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
616
664
|
var lineCount = isSingleLine ? 1 : rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.getLineCount(rowHeightOption);
|
|
617
665
|
if (lineCount) {
|
|
618
666
|
var shouldUseHeightsCache = rowHeightUtils === null || rowHeightUtils === void 0 ? void 0 : rowHeightUtils.isRowHeightOverride(rowIndex, rowHeightsOptions);
|
|
619
|
-
var height = rowHeightUtils.calculateHeightForLineCount(_this.cellContentsRef, lineCount
|
|
667
|
+
var height = rowHeightUtils.calculateHeightForLineCount(_this.cellContentsRef, lineCount);
|
|
620
668
|
if (shouldUseHeightsCache) {
|
|
621
669
|
var _this$props4 = _this.props,
|
|
622
670
|
columnId = _this$props4.columnId,
|
|
@@ -808,12 +856,12 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
808
856
|
}, {
|
|
809
857
|
key: "componentDidUpdate",
|
|
810
858
|
value: function componentDidUpdate(prevProps) {
|
|
811
|
-
var _this$props$rowHeight, _prevProps$rowHeights, _this$props$rowHeight2, _this$props$rowHeight3, _this$props$style, _prevProps$style;
|
|
859
|
+
var _this$props$rowHeight, _prevProps$rowHeights, _this$props$rowHeight2, _prevProps$rowHeights2, _this$props$rowHeight3, _prevProps$rowHeights3, _this$props$gridStyle, _prevProps$gridStyles, _this$props$gridStyle2, _prevProps$gridStyles2, _this$props$rowHeight4, _this$props$rowHeight5, _this$props$style, _prevProps$style;
|
|
812
860
|
this.recalculateAutoHeight();
|
|
813
|
-
if (((_this$props$rowHeight = this.props.rowHeightsOptions) === null || _this$props$rowHeight === void 0 ? void 0 : _this$props$rowHeight.defaultHeight) !== ((_prevProps$rowHeights = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights === void 0 ? void 0 : _prevProps$rowHeights.defaultHeight)) {
|
|
861
|
+
if (((_this$props$rowHeight = this.props.rowHeightsOptions) === null || _this$props$rowHeight === void 0 ? void 0 : _this$props$rowHeight.defaultHeight) !== ((_prevProps$rowHeights = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights === void 0 ? void 0 : _prevProps$rowHeights.defaultHeight) || ((_this$props$rowHeight2 = this.props.rowHeightsOptions) === null || _this$props$rowHeight2 === void 0 || (_this$props$rowHeight2 = _this$props$rowHeight2.rowHeights) === null || _this$props$rowHeight2 === void 0 ? void 0 : _this$props$rowHeight2[this.props.rowIndex]) !== ((_prevProps$rowHeights2 = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights2 === void 0 || (_prevProps$rowHeights2 = _prevProps$rowHeights2.rowHeights) === null || _prevProps$rowHeights2 === void 0 ? void 0 : _prevProps$rowHeights2[prevProps.rowIndex]) || ((_this$props$rowHeight3 = this.props.rowHeightsOptions) === null || _this$props$rowHeight3 === void 0 ? void 0 : _this$props$rowHeight3.lineHeight) !== ((_prevProps$rowHeights3 = prevProps.rowHeightsOptions) === null || _prevProps$rowHeights3 === void 0 ? void 0 : _prevProps$rowHeights3.lineHeight) || ((_this$props$gridStyle = this.props.gridStyles) === null || _this$props$gridStyle === void 0 ? void 0 : _this$props$gridStyle.fontSize) !== ((_prevProps$gridStyles = prevProps.gridStyles) === null || _prevProps$gridStyles === void 0 ? void 0 : _prevProps$gridStyles.fontSize) || ((_this$props$gridStyle2 = this.props.gridStyles) === null || _this$props$gridStyle2 === void 0 ? void 0 : _this$props$gridStyle2.cellPadding) !== ((_prevProps$gridStyles2 = prevProps.gridStyles) === null || _prevProps$gridStyles2 === void 0 ? void 0 : _prevProps$gridStyles2.cellPadding)) {
|
|
814
862
|
this.recalculateLineHeight();
|
|
815
863
|
}
|
|
816
|
-
if ((_this$props$
|
|
864
|
+
if ((_this$props$rowHeight4 = this.props.rowHeightUtils) !== null && _this$props$rowHeight4 !== void 0 && _this$props$rowHeight4.compensateForLayoutShift && (_this$props$rowHeight5 = this.props.rowHeightsOptions) !== null && _this$props$rowHeight5 !== void 0 && _this$props$rowHeight5.scrollAnchorRow && this.props.colIndex === 0 &&
|
|
817
865
|
// once per row
|
|
818
866
|
this.props.columnId === prevProps.columnId &&
|
|
819
867
|
// if this is still the same column
|
|
@@ -821,12 +869,12 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
821
869
|
// if this is still the same row
|
|
822
870
|
((_this$props$style = this.props.style) === null || _this$props$style === void 0 ? void 0 : _this$props$style.top) !== ((_prevProps$style = prevProps.style) === null || _prevProps$style === void 0 ? void 0 : _prevProps$style.top) // if the top position has changed
|
|
823
871
|
) {
|
|
824
|
-
var _prevProps$style2, _this$props$style2, _this$props$
|
|
872
|
+
var _prevProps$style2, _this$props$style2, _this$props$rowHeight6;
|
|
825
873
|
var previousTop = parseFloat((_prevProps$style2 = prevProps.style) === null || _prevProps$style2 === void 0 ? void 0 : _prevProps$style2.top);
|
|
826
874
|
var currentTop = parseFloat((_this$props$style2 = this.props.style) === null || _this$props$style2 === void 0 ? void 0 : _this$props$style2.top);
|
|
827
875
|
|
|
828
876
|
// @ts-ignore We've already checked that this virtualization util is available above
|
|
829
|
-
this.props.rowHeightUtils.compensateForLayoutShift(this.props.rowIndex, currentTop - previousTop, (_this$props$
|
|
877
|
+
this.props.rowHeightUtils.compensateForLayoutShift(this.props.rowIndex, currentTop - previousTop, (_this$props$rowHeight6 = this.props.rowHeightsOptions) === null || _this$props$rowHeight6 === void 0 ? void 0 : _this$props$rowHeight6.scrollAnchorRow);
|
|
830
878
|
}
|
|
831
879
|
if (this.props.popoverContext.popoverIsOpen !== prevProps.popoverContext.popoverIsOpen || this.props.popoverContext.cellLocation !== prevProps.popoverContext.cellLocation || this.props.renderCellPopover !== prevProps.renderCellPopover) {
|
|
832
880
|
this.handleCellPopover();
|
|
@@ -838,6 +886,7 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
838
886
|
}, {
|
|
839
887
|
key: "shouldComponentUpdate",
|
|
840
888
|
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
889
|
+
var _nextProps$gridStyles, _this$props$gridStyle3, _nextProps$gridStyles2, _this$props$gridStyle4;
|
|
841
890
|
if (nextProps.rowIndex !== this.props.rowIndex) return true;
|
|
842
891
|
if (nextProps.visibleRowIndex !== this.props.visibleRowIndex) return true;
|
|
843
892
|
if (nextProps.colIndex !== this.props.colIndex) return true;
|
|
@@ -845,6 +894,8 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
845
894
|
if (nextProps.columnType !== this.props.columnType) return true;
|
|
846
895
|
if (nextProps.width !== this.props.width) return true;
|
|
847
896
|
if (nextProps.rowHeightsOptions !== this.props.rowHeightsOptions) return true;
|
|
897
|
+
if (((_nextProps$gridStyles = nextProps.gridStyles) === null || _nextProps$gridStyles === void 0 ? void 0 : _nextProps$gridStyles.fontSize) !== ((_this$props$gridStyle3 = this.props.gridStyles) === null || _this$props$gridStyle3 === void 0 ? void 0 : _this$props$gridStyle3.fontSize)) return true;
|
|
898
|
+
if (((_nextProps$gridStyles2 = nextProps.gridStyles) === null || _nextProps$gridStyles2 === void 0 ? void 0 : _nextProps$gridStyles2.cellPadding) !== ((_this$props$gridStyle4 = this.props.gridStyles) === null || _this$props$gridStyle4 === void 0 ? void 0 : _this$props$gridStyle4.cellPadding)) return true;
|
|
848
899
|
if (nextProps.renderCellValue !== this.props.renderCellValue) return true;
|
|
849
900
|
if (nextProps.renderCellPopover !== this.props.renderCellPopover) return true;
|
|
850
901
|
if (nextProps.interactiveCellId !== this.props.interactiveCellId) return true;
|
|
@@ -890,6 +941,10 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
890
941
|
var popoverIsOpen = this.isPopoverOpen();
|
|
891
942
|
var showCellActions = isExpandable && (popoverIsOpen || this.state.isFocused || this.state.isHovered);
|
|
892
943
|
var cellClasses = (0, _classnames.default)('euiDataGridRowCell', _defineProperty(_defineProperty({}, "euiDataGridRowCell--".concat(columnType), columnType), 'euiDataGridRowCell--open', popoverIsOpen), className);
|
|
944
|
+
|
|
945
|
+
// classNames set by EuiDataGridCellWrapper
|
|
946
|
+
var isControlColumn = cellClasses.includes('euiDataGridRowCell--controlColumn');
|
|
947
|
+
var isLastColumn = cellClasses.includes('euiDataGridRowCell--lastColumn');
|
|
893
948
|
var ariaRowIndex = pagination ? visibleRowIndex + 1 + pagination.pageSize * pagination.pageIndex : visibleRowIndex + 1;
|
|
894
949
|
var _this$state$cellProps2 = this.state.cellProps,
|
|
895
950
|
_ = _this$state$cellProps2.isExpandable,
|
|
@@ -943,10 +998,10 @@ var EuiDataGridCell = exports.EuiDataGridCell = /*#__PURE__*/function (_Componen
|
|
|
943
998
|
setCellContentsRef: this.setCellContentsRef,
|
|
944
999
|
rowHeight: rowHeight,
|
|
945
1000
|
rowHeightUtils: rowHeightUtils,
|
|
946
|
-
isControlColumn:
|
|
1001
|
+
isControlColumn: isControlColumn,
|
|
947
1002
|
rowIndex: rowIndex,
|
|
948
1003
|
colIndex: colIndex
|
|
949
|
-
}))), this.state.isFocused && (0, _react2.jsx)(CellScreenReaderDescription, {
|
|
1004
|
+
}))), isLastColumn ? _services.tabularCopyMarkers.hiddenNewline : _services.tabularCopyMarkers.hiddenTab, this.state.isFocused && (0, _react2.jsx)(CellScreenReaderDescription, {
|
|
950
1005
|
columnName: (column === null || column === void 0 ? void 0 : column.displayAsText) || this.props.columnId,
|
|
951
1006
|
columnIndex: colIndex + 1,
|
|
952
1007
|
rowIndex: ariaRowIndex,
|
|
@@ -1353,7 +1408,58 @@ EuiDataGridCell.propTypes = {
|
|
|
1353
1408
|
rowManager: _propTypes.default.shape({
|
|
1354
1409
|
getRow: _propTypes.default.func.isRequired
|
|
1355
1410
|
}),
|
|
1356
|
-
pagination: _propTypes.default.any
|
|
1411
|
+
pagination: _propTypes.default.any,
|
|
1412
|
+
gridStyles: _propTypes.default.shape({
|
|
1413
|
+
/**
|
|
1414
|
+
* Size of fonts used within the row and column cells
|
|
1415
|
+
* @default m
|
|
1416
|
+
*/
|
|
1417
|
+
fontSize: _propTypes.default.oneOf(["s", "m", "l"]),
|
|
1418
|
+
/**
|
|
1419
|
+
* Defines the padding with the row and column cells
|
|
1420
|
+
* @default m
|
|
1421
|
+
*/
|
|
1422
|
+
cellPadding: _propTypes.default.oneOf(["s", "m", "l"]),
|
|
1423
|
+
/**
|
|
1424
|
+
* Border used for the row and column cells
|
|
1425
|
+
* @default all
|
|
1426
|
+
*/
|
|
1427
|
+
border: _propTypes.default.oneOf(["all", "horizontal", "none"]),
|
|
1428
|
+
/**
|
|
1429
|
+
* If set to true, rows will alternate zebra striping for clarity
|
|
1430
|
+
* @default false
|
|
1431
|
+
*/
|
|
1432
|
+
stripes: _propTypes.default.bool,
|
|
1433
|
+
/**
|
|
1434
|
+
* Visual style for the column headers. Recommendation is to use the `underline` style in times when #EuiDataGrid `toolbarVisibility` is set to `false`.
|
|
1435
|
+
* @default shade
|
|
1436
|
+
*/
|
|
1437
|
+
header: _propTypes.default.oneOf(["shade", "underline"]),
|
|
1438
|
+
/**
|
|
1439
|
+
* Visual style for the column footers.
|
|
1440
|
+
* @default overline
|
|
1441
|
+
*/
|
|
1442
|
+
footer: _propTypes.default.oneOf(["shade", "overline", "striped"]),
|
|
1443
|
+
/**
|
|
1444
|
+
* If set to true, the footer row will be sticky
|
|
1445
|
+
* @default true
|
|
1446
|
+
*/
|
|
1447
|
+
stickyFooter: _propTypes.default.bool,
|
|
1448
|
+
/**
|
|
1449
|
+
* Will define what visual style to show on row hover
|
|
1450
|
+
* @default hover
|
|
1451
|
+
*/
|
|
1452
|
+
rowHover: _propTypes.default.oneOf(["highlight", "none"]),
|
|
1453
|
+
/**
|
|
1454
|
+
* Optionally pass custom classes to highlight or customize certain rows
|
|
1455
|
+
*/
|
|
1456
|
+
rowClasses: _propTypes.default.shape({}),
|
|
1457
|
+
/**
|
|
1458
|
+
* Optional callback returning the current `gridStyle` config when changes occur from user input (e.g. toolbar display controls).
|
|
1459
|
+
* Can be used for, e.g. storing user `gridStyle` in a local storage object.
|
|
1460
|
+
*/
|
|
1461
|
+
onChange: _propTypes.default.func
|
|
1462
|
+
}).isRequired
|
|
1357
1463
|
};
|
|
1358
1464
|
var RenderCellInRow = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
|
1359
1465
|
var row = _ref2.row,
|
|
@@ -1425,7 +1531,7 @@ var CellScreenReaderDescription = /*#__PURE__*/(0, _react.memo)(function (_ref5)
|
|
|
1425
1531
|
rowIndex: rowIndex
|
|
1426
1532
|
});
|
|
1427
1533
|
var enterKeyPrompt = (0, _i18n.useEuiI18n)('euiDataGridCell.expansionEnterPrompt', 'Press the Enter key to expand this cell.');
|
|
1428
|
-
return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, " - ".concat(cellPosition).concat(canExpandCell ? ". ".concat(enterKeyPrompt) : '')));
|
|
1534
|
+
return (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, _services.tabularCopyMarkers.hiddenNoCopyBoundary, " - ".concat(cellPosition).concat(canExpandCell ? ". ".concat(enterKeyPrompt) : ''), _services.tabularCopyMarkers.hiddenNoCopyBoundary));
|
|
1429
1535
|
});
|
|
1430
1536
|
CellScreenReaderDescription.propTypes = {
|
|
1431
1537
|
columnName: _propTypes.default.string.isRequired,
|
|
@@ -96,6 +96,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
96
96
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
97
97
|
};
|
|
98
98
|
var euiDataGridRowCellStyles = exports.euiDataGridRowCellStyles = function euiDataGridRowCellStyles(euiThemeContext) {
|
|
99
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
99
100
|
var cellOutline = euiDataGridCellOutlineStyles(euiThemeContext);
|
|
100
101
|
var _euiDataGridCellOutli = euiDataGridCellOutlineSelectors(),
|
|
101
102
|
outlineSelectors = _euiDataGridCellOutli.outline;
|
|
@@ -103,9 +104,11 @@ var euiDataGridRowCellStyles = exports.euiDataGridRowCellStyles = function euiDa
|
|
|
103
104
|
euiDataGridRowCell: /*#__PURE__*/(0, _react.css)("position:relative;", outlineSelectors.show, "{", cellOutline.focusStyles, ";}", outlineSelectors.hover, "{", cellOutline.hoverStyles, ";}", outlineSelectors.focusTrapped, "{", cellOutline.hoverStyles, ";}&>[data-focus-lock-disabled]{", (0, _global_styling.logicalCSS)('height', '100%'), ";}&:where(.euiDataGridRowCell--numeric, .euiDataGridRowCell--currency){", (0, _global_styling.logicalTextAlignCSS)('right'), ";}&:where(.euiDataGridRowCell--uppercase){text-transform:uppercase;}&:where(.euiDataGridRowCell--lowercase){text-transform:lowercase;}&:where(.euiDataGridRowCell--capitalize){text-transform:capitalize;};label:euiDataGridRowCell;"),
|
|
104
105
|
content: {
|
|
105
106
|
euiDataGridRowCell__content: _ref,
|
|
106
|
-
controlColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-height', '100%'), " display:flex;align-items:center;;label:controlColumn;"),
|
|
107
107
|
autoHeight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), ";;label:autoHeight;"),
|
|
108
|
-
defaultHeight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";;label:defaultHeight;")
|
|
108
|
+
defaultHeight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";;label:defaultHeight;"),
|
|
109
|
+
// Control columns should be vertically centered with the *first line* of text
|
|
110
|
+
// for both single and multi-line heights (see https://github.com/elastic/eui/issues/7897)
|
|
111
|
+
controlColumn: /*#__PURE__*/(0, _react.css)("display:inline-flex;align-items:start;gap:", euiTheme.size.xxs, ";vertical-align:-webkit-baseline-middle;vertical-align:-moz-middle-with-baseline;.euiDataGrid--fontSizeSmall &:where(.euiDataGridRowCell__content--defaultHeight){", (0, _global_styling.logicalCSS)('height', '100%'), " align-items:center;}.euiCheckbox:not(:has(label)){display:inline;.euiCheckbox__square{display:inline-flex;vertical-align:text-bottom;@supports (vertical-align: -moz-middle-with-baseline){vertical-align:sub;}}};label:controlColumn;")
|
|
109
112
|
}
|
|
110
113
|
};
|
|
111
114
|
};
|
|
@@ -109,6 +109,7 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
109
109
|
columnWidths: columnWidths,
|
|
110
110
|
defaultColumnWidth: defaultColumnWidth,
|
|
111
111
|
setColumnWidth: setColumnWidth,
|
|
112
|
+
visibleColCount: visibleColCount,
|
|
112
113
|
setVisibleColumns: setVisibleColumns,
|
|
113
114
|
switchColumnPos: switchColumnPos,
|
|
114
115
|
sorting: sorting,
|
|
@@ -122,6 +123,7 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
122
123
|
renderCellPopover: renderCellPopover,
|
|
123
124
|
rowIndex: visibleRows.visibleRowCount,
|
|
124
125
|
visibleRowIndex: visibleRows.visibleRowCount,
|
|
126
|
+
visibleColCount: visibleColCount,
|
|
125
127
|
interactiveCellId: interactiveCellId,
|
|
126
128
|
leadingControlColumns: leadingControlColumns,
|
|
127
129
|
trailingControlColumns: trailingControlColumns,
|
|
@@ -153,9 +155,10 @@ var EuiDataGridBodyCustomRender = exports.EuiDataGridBodyCustomRender = function
|
|
|
153
155
|
interactiveCellId: interactiveCellId,
|
|
154
156
|
setRowHeight: setRowHeight,
|
|
155
157
|
rowHeightsOptions: rowHeightsOptions,
|
|
156
|
-
rowHeightUtils: rowHeightUtils
|
|
158
|
+
rowHeightUtils: rowHeightUtils,
|
|
159
|
+
gridStyles: gridStyles
|
|
157
160
|
};
|
|
158
|
-
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils]);
|
|
161
|
+
}, [schema, schemaDetectors, pagination, columns, leadingControlColumns, trailingControlColumns, visibleColCount, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, setRowHeight, rowHeightsOptions, rowHeightUtils, gridStyles]);
|
|
159
162
|
var Cell = (0, _react.useCallback)(function (_ref2) {
|
|
160
163
|
var colIndex = _ref2.colIndex,
|
|
161
164
|
visibleRowIndex = _ref2.visibleRowIndex,
|
|
@@ -161,6 +161,7 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
|
|
|
161
161
|
columnWidths: columnWidths,
|
|
162
162
|
defaultColumnWidth: defaultColumnWidth,
|
|
163
163
|
setColumnWidth: setColumnWidth,
|
|
164
|
+
visibleColCount: visibleColCount,
|
|
164
165
|
setVisibleColumns: setVisibleColumns,
|
|
165
166
|
switchColumnPos: switchColumnPos,
|
|
166
167
|
sorting: sorting,
|
|
@@ -175,6 +176,7 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
|
|
|
175
176
|
renderCellPopover: renderCellPopover,
|
|
176
177
|
rowIndex: visibleRowCount,
|
|
177
178
|
visibleRowIndex: visibleRowCount,
|
|
179
|
+
visibleColCount: visibleColCount,
|
|
178
180
|
interactiveCellId: interactiveCellId,
|
|
179
181
|
leadingControlColumns: leadingControlColumns,
|
|
180
182
|
trailingControlColumns: trailingControlColumns,
|
|
@@ -297,9 +299,10 @@ var EuiDataGridBodyVirtualized = exports.EuiDataGridBodyVirtualized = /*#__PURE_
|
|
|
297
299
|
rowHeightUtils: rowHeightUtils,
|
|
298
300
|
rowManager: rowManager,
|
|
299
301
|
pagination: pagination,
|
|
300
|
-
headerRowHeight: headerRowHeight
|
|
302
|
+
headerRowHeight: headerRowHeight,
|
|
303
|
+
gridStyles: gridStyles
|
|
301
304
|
};
|
|
302
|
-
}, [schemaDetectors, setRowHeight, leadingControlColumns, trailingControlColumns, columns, visibleColCount, schema, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, rowHeightsOptions, rowHeightUtils, rowManager, pagination, headerRowHeight]);
|
|
305
|
+
}, [schemaDetectors, setRowHeight, leadingControlColumns, trailingControlColumns, columns, visibleColCount, schema, columnWidths, defaultColumnWidth, renderCellValue, cellContext, renderCellPopover, interactiveCellId, rowHeightsOptions, rowHeightUtils, rowManager, pagination, headerRowHeight, gridStyles]);
|
|
303
306
|
var rowWrapperContextValue = (0, _react.useMemo)(function () {
|
|
304
307
|
return {
|
|
305
308
|
headerRowHeight: headerRowHeight,
|
|
@@ -11,7 +11,7 @@ var _services = require("../../../../services");
|
|
|
11
11
|
var _cell = require("../cell");
|
|
12
12
|
var _data_grid_footer = require("./data_grid_footer.styles");
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
|
-
var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "schema", "columnWidths", "defaultColumnWidth", "className", "renderCellValue", "renderCellPopover", "rowIndex", "interactiveCellId", "data-test-subj", "visibleRowIndex", "gridStyles"];
|
|
14
|
+
var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "schema", "columnWidths", "defaultColumnWidth", "className", "renderCellValue", "renderCellPopover", "rowIndex", "interactiveCellId", "data-test-subj", "visibleRowIndex", "visibleColCount", "gridStyles"];
|
|
15
15
|
/*
|
|
16
16
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
17
17
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -43,19 +43,27 @@ var EuiDataGridFooterRow = exports.EuiDataGridFooterRow = /*#__PURE__*/(0, _reac
|
|
|
43
43
|
_dataTestSubj = _ref['data-test-subj'],
|
|
44
44
|
_ref$visibleRowIndex = _ref.visibleRowIndex,
|
|
45
45
|
visibleRowIndex = _ref$visibleRowIndex === void 0 ? rowIndex : _ref$visibleRowIndex,
|
|
46
|
+
visibleColCount = _ref.visibleColCount,
|
|
46
47
|
gridStyles = _ref.gridStyles,
|
|
47
48
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
49
|
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_footer.euiDataGridFooterStyles);
|
|
49
50
|
var cssStyles = [styles.euiDataGridFooter, gridStyles.stickyFooter && styles.sticky, gridStyles.footer === 'striped' ? visibleRowIndex % 2 !== 0 && styles.striped : styles[gridStyles.footer]];
|
|
50
51
|
var classes = (0, _classnames.default)('euiDataGridFooter', className);
|
|
51
52
|
var dataTestSubj = (0, _classnames.default)('dataGridRow', 'dataGridFooterRow', _dataTestSubj);
|
|
53
|
+
var getCellClasses = (0, _react.useCallback)(function (columnIndex, classes) {
|
|
54
|
+
return (0, _classnames.default)('euiDataGridFooterCell', {
|
|
55
|
+
'euiDataGridRowCell--firstColumn': columnIndex === 0,
|
|
56
|
+
'euiDataGridRowCell--lastColumn': columnIndex === visibleColCount - 1
|
|
57
|
+
}, classes);
|
|
58
|
+
}, [visibleColCount]);
|
|
52
59
|
var popoverContext = (0, _react.useContext)(_cell.DataGridCellPopoverContext);
|
|
53
60
|
var sharedCellProps = {
|
|
54
61
|
css: styles.euiDataGridFooterCell,
|
|
55
62
|
rowIndex: rowIndex,
|
|
56
63
|
visibleRowIndex: visibleRowIndex,
|
|
57
64
|
interactiveCellId: interactiveCellId,
|
|
58
|
-
popoverContext: popoverContext
|
|
65
|
+
popoverContext: popoverContext,
|
|
66
|
+
gridStyles: gridStyles
|
|
59
67
|
};
|
|
60
68
|
return (0, _react2.jsx)("div", _extends({
|
|
61
69
|
ref: ref,
|
|
@@ -75,7 +83,7 @@ var EuiDataGridFooterRow = exports.EuiDataGridFooterRow = /*#__PURE__*/(0, _reac
|
|
|
75
83
|
width: width,
|
|
76
84
|
renderCellValue: footerCellRender !== null && footerCellRender !== void 0 ? footerCellRender : renderEmpty,
|
|
77
85
|
isExpandable: false,
|
|
78
|
-
className: (0, _classnames.default)('
|
|
86
|
+
className: getCellClasses(i, (0, _classnames.default)('euiDataGridRowCell--controlColumn', footerCellProps === null || footerCellProps === void 0 ? void 0 : footerCellProps.className))
|
|
79
87
|
}));
|
|
80
88
|
}), columns.map(function (_ref3, i) {
|
|
81
89
|
var id = _ref3.id;
|
|
@@ -92,7 +100,7 @@ var EuiDataGridFooterRow = exports.EuiDataGridFooterRow = /*#__PURE__*/(0, _reac
|
|
|
92
100
|
renderCellValue: renderCellValue,
|
|
93
101
|
renderCellPopover: renderCellPopover,
|
|
94
102
|
isExpandable: true,
|
|
95
|
-
className:
|
|
103
|
+
className: getCellClasses(columnPosition)
|
|
96
104
|
}));
|
|
97
105
|
}), trailingControlColumns.map(function (_ref4, i) {
|
|
98
106
|
var id = _ref4.id,
|
|
@@ -107,7 +115,7 @@ var EuiDataGridFooterRow = exports.EuiDataGridFooterRow = /*#__PURE__*/(0, _reac
|
|
|
107
115
|
width: width,
|
|
108
116
|
renderCellValue: footerCellRender !== null && footerCellRender !== void 0 ? footerCellRender : renderEmpty,
|
|
109
117
|
isExpandable: false,
|
|
110
|
-
className: (0, _classnames.default)('
|
|
118
|
+
className: getCellClasses(colIndex, (0, _classnames.default)('euiDataGridRowCell--controlColumn', footerCellProps === null || footerCellProps === void 0 ? void 0 : footerCellProps.className))
|
|
111
119
|
}));
|
|
112
120
|
}));
|
|
113
121
|
}));
|
|
@@ -22,7 +22,8 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
22
22
|
*/
|
|
23
23
|
var EuiDataGridControlHeaderCell = exports.EuiDataGridControlHeaderCell = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
24
24
|
var controlColumn = _ref.controlColumn,
|
|
25
|
-
index = _ref.index
|
|
25
|
+
index = _ref.index,
|
|
26
|
+
visibleColCount = _ref.visibleColCount;
|
|
26
27
|
var HeaderCellRender = controlColumn.headerCellRender,
|
|
27
28
|
headerCellProps = controlColumn.headerCellProps,
|
|
28
29
|
width = controlColumn.width,
|
|
@@ -31,11 +32,13 @@ var EuiDataGridControlHeaderCell = exports.EuiDataGridControlHeaderCell = /*#__P
|
|
|
31
32
|
className: (0, _classnames.default)('euiDataGridHeaderCell--controlColumn', headerCellProps === null || headerCellProps === void 0 ? void 0 : headerCellProps.className),
|
|
32
33
|
id: id,
|
|
33
34
|
index: index,
|
|
34
|
-
width: width
|
|
35
|
+
width: width,
|
|
36
|
+
visibleColCount: visibleColCount
|
|
35
37
|
}), (0, _react2.jsx)(HeaderCellRender, null));
|
|
36
38
|
});
|
|
37
39
|
EuiDataGridControlHeaderCell.propTypes = {
|
|
38
40
|
index: _propTypes.default.number.isRequired,
|
|
41
|
+
visibleColCount: _propTypes.default.number.isRequired,
|
|
39
42
|
controlColumn: _propTypes.default.shape({
|
|
40
43
|
/**
|
|
41
44
|
* Used as the React `key` when rendering content
|
|
@@ -47,6 +47,7 @@ var EuiDataGridHeaderCell = exports.EuiDataGridHeaderCell = /*#__PURE__*/(0, _re
|
|
|
47
47
|
columnWidths = _ref.columnWidths,
|
|
48
48
|
defaultColumnWidth = _ref.defaultColumnWidth,
|
|
49
49
|
setColumnWidth = _ref.setColumnWidth,
|
|
50
|
+
visibleColCount = _ref.visibleColCount,
|
|
50
51
|
setVisibleColumns = _ref.setVisibleColumns,
|
|
51
52
|
switchColumnPos = _ref.switchColumnPos,
|
|
52
53
|
sorting = _ref.sorting,
|
|
@@ -131,11 +132,12 @@ var EuiDataGridHeaderCell = exports.EuiDataGridHeaderCell = /*#__PURE__*/(0, _re
|
|
|
131
132
|
*/
|
|
132
133
|
var classes = (0, _classnames2.default)(_defineProperty(_defineProperty(_defineProperty({}, "euiDataGridHeaderCell--".concat(columnType), columnType), 'euiDataGridHeaderCell--hasColumnActions', showColumnActions), 'euiDataGridHeaderCell--isActionsPopoverOpen', isPopoverOpen), displayHeaderCellProps === null || displayHeaderCellProps === void 0 ? void 0 : displayHeaderCellProps.className);
|
|
133
134
|
var styles = (0, _services.useEuiMemoizedStyles)(_data_grid_header_cell.euiDataGridHeaderCellStyles);
|
|
134
|
-
var contentStyles = [styles.euiDataGridHeaderCell__content, columnType === 'numeric' || columnType === 'currency'
|
|
135
|
+
var contentStyles = [styles.euiDataGridHeaderCell__content, (columnType === 'numeric' || columnType === 'currency') && styles.right];
|
|
135
136
|
return (0, _react2.jsx)(_data_grid_header_cell_wrapper.EuiDataGridHeaderCellWrapper, _extends({}, displayHeaderCellProps, {
|
|
136
137
|
className: classes,
|
|
137
138
|
id: id,
|
|
138
139
|
index: index,
|
|
140
|
+
visibleColCount: visibleColCount,
|
|
139
141
|
width: width,
|
|
140
142
|
"aria-sort": ariaSort,
|
|
141
143
|
hasActionsPopover: showColumnActions,
|
|
@@ -24,8 +24,6 @@ var euiDataGridHeaderCellStyles = exports.euiDataGridHeaderCellStyles = function
|
|
|
24
24
|
header = _euiDataGridCellOutli.header;
|
|
25
25
|
return {
|
|
26
26
|
euiDataGridHeaderCell__content: /*#__PURE__*/(0, _react.css)("flex-grow:1;", (0, _global_styling.euiTextTruncate)(), ";;label:euiDataGridHeaderCell__content;"),
|
|
27
|
-
// Overwrite inherited 'center' styles from <button>
|
|
28
|
-
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;"),
|
|
29
27
|
// Numeric and currency schemas are aligned to the right
|
|
30
28
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";;label:right;"),
|
|
31
29
|
euiDataGridHeaderCell__popover: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-left', 'auto'), "line-height:0;;label:euiDataGridHeaderCell__popover;"),
|
|
@@ -13,7 +13,7 @@ var _focus = require("../../utils/focus");
|
|
|
13
13
|
var _focus_utils = require("../cell/focus_utils");
|
|
14
14
|
var _data_grid_header_cell_wrapper = require("./data_grid_header_cell_wrapper.styles");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["id", "index", "width", "className", "children", "hasActionsPopover", "openActionsPopover", "aria-label"];
|
|
16
|
+
var _excluded = ["id", "index", "visibleColCount", "width", "className", "children", "hasActionsPopover", "openActionsPopover", "aria-label"];
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -41,6 +41,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
41
41
|
var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = function EuiDataGridHeaderCellWrapper(_ref) {
|
|
42
42
|
var id = _ref.id,
|
|
43
43
|
index = _ref.index,
|
|
44
|
+
visibleColCount = _ref.visibleColCount,
|
|
44
45
|
width = _ref.width,
|
|
45
46
|
className = _ref.className,
|
|
46
47
|
children = _ref.children,
|
|
@@ -96,6 +97,7 @@ var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = functi
|
|
|
96
97
|
openActionsPopover === null || openActionsPopover === void 0 || openActionsPopover();
|
|
97
98
|
}
|
|
98
99
|
}, [hasActionsPopover, openActionsPopover, renderFocusTrap, headerEl]);
|
|
100
|
+
var isLastColumn = index === visibleColCount - 1;
|
|
99
101
|
return (0, _react2.jsx)("div", _extends({
|
|
100
102
|
role: "columnheader",
|
|
101
103
|
ref: setHeaderEl,
|
|
@@ -117,12 +119,13 @@ var EuiDataGridHeaderCellWrapper = exports.EuiDataGridHeaderCellWrapper = functi
|
|
|
117
119
|
updateCellFocusContext: updateCellFocusContext,
|
|
118
120
|
renderFocusTrap: renderFocusTrap,
|
|
119
121
|
onInteractiveChildrenFound: setInteractiveChildren
|
|
120
|
-
}, typeof children === 'function' ? children(renderFocusTrap) : children));
|
|
122
|
+
}, typeof children === 'function' ? children(renderFocusTrap) : children), isLastColumn ? _services.tabularCopyMarkers.hiddenNewline : _services.tabularCopyMarkers.hiddenTab);
|
|
121
123
|
};
|
|
122
124
|
EuiDataGridHeaderCellWrapper.propTypes = {
|
|
123
125
|
children: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.func.isRequired]).isRequired,
|
|
124
126
|
id: _propTypes.default.string.isRequired,
|
|
125
127
|
index: _propTypes.default.number.isRequired,
|
|
128
|
+
visibleColCount: _propTypes.default.number.isRequired,
|
|
126
129
|
width: _propTypes.default.oneOfType([_propTypes.default.number.isRequired, _propTypes.default.oneOf([null])]),
|
|
127
130
|
className: _propTypes.default.string,
|
|
128
131
|
"aria-label": _propTypes.default.any,
|
|
@@ -13,7 +13,7 @@ var _data_grid_control_header_cell = require("./data_grid_control_header_cell");
|
|
|
13
13
|
var _data_grid_header_cell = require("./data_grid_header_cell");
|
|
14
14
|
var _data_grid_header_row = require("./data_grid_header_row.styles");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["className", "data-test-subj", "leadingControlColumns", "trailingControlColumns", "columns", "columnWidths", "defaultColumnWidth", "setColumnWidth", "setVisibleColumns", "switchColumnPos", "sorting", "schema", "schemaDetectors", "gridStyles"];
|
|
16
|
+
var _excluded = ["className", "data-test-subj", "leadingControlColumns", "trailingControlColumns", "columns", "columnWidths", "defaultColumnWidth", "setColumnWidth", "visibleColCount", "setVisibleColumns", "switchColumnPos", "sorting", "schema", "schemaDetectors", "gridStyles"];
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -38,6 +38,7 @@ var EuiDataGridHeaderRow = exports.EuiDataGridHeaderRow = /*#__PURE__*/(0, _reac
|
|
|
38
38
|
columnWidths = props.columnWidths,
|
|
39
39
|
defaultColumnWidth = props.defaultColumnWidth,
|
|
40
40
|
setColumnWidth = props.setColumnWidth,
|
|
41
|
+
visibleColCount = props.visibleColCount,
|
|
41
42
|
setVisibleColumns = props.setVisibleColumns,
|
|
42
43
|
switchColumnPos = props.switchColumnPos,
|
|
43
44
|
sorting = props.sorting,
|
|
@@ -59,6 +60,7 @@ var EuiDataGridHeaderRow = exports.EuiDataGridHeaderRow = /*#__PURE__*/(0, _reac
|
|
|
59
60
|
return (0, _react2.jsx)(_data_grid_control_header_cell.EuiDataGridControlHeaderCell, {
|
|
60
61
|
key: controlColumn.id,
|
|
61
62
|
index: index,
|
|
63
|
+
visibleColCount: visibleColCount,
|
|
62
64
|
controlColumn: controlColumn
|
|
63
65
|
});
|
|
64
66
|
}), columns.map(function (column, index) {
|
|
@@ -70,6 +72,7 @@ var EuiDataGridHeaderRow = exports.EuiDataGridHeaderRow = /*#__PURE__*/(0, _reac
|
|
|
70
72
|
columnWidths: columnWidths,
|
|
71
73
|
defaultColumnWidth: defaultColumnWidth,
|
|
72
74
|
setColumnWidth: setColumnWidth,
|
|
75
|
+
visibleColCount: visibleColCount,
|
|
73
76
|
setVisibleColumns: setVisibleColumns,
|
|
74
77
|
switchColumnPos: switchColumnPos,
|
|
75
78
|
sorting: sorting,
|
|
@@ -80,6 +83,7 @@ var EuiDataGridHeaderRow = exports.EuiDataGridHeaderRow = /*#__PURE__*/(0, _reac
|
|
|
80
83
|
return (0, _react2.jsx)(_data_grid_control_header_cell.EuiDataGridControlHeaderCell, {
|
|
81
84
|
key: controlColumn.id,
|
|
82
85
|
index: index + leadingControlColumns.length + columns.length,
|
|
86
|
+
visibleColCount: visibleColCount,
|
|
83
87
|
controlColumn: controlColumn
|
|
84
88
|
});
|
|
85
89
|
}));
|
|
@@ -383,7 +383,7 @@ var EuiDataGrid = exports.EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE
|
|
|
383
383
|
role: "grid",
|
|
384
384
|
"aria-rowcount": rowCount,
|
|
385
385
|
id: gridId
|
|
386
|
-
}, wrappingDivFocusProps, gridAriaProps), (0, _react2.jsx)(_body.EuiDataGridBody, {
|
|
386
|
+
}, wrappingDivFocusProps, gridAriaProps), (0, _react2.jsx)(_services.OverrideCopiedTabularContent, null, (0, _react2.jsx)(_body.EuiDataGridBody, {
|
|
387
387
|
columns: orderedVisibleColumns,
|
|
388
388
|
visibleColCount: visibleColCount,
|
|
389
389
|
leadingControlColumns: leadingControlColumns,
|
|
@@ -411,7 +411,7 @@ var EuiDataGrid = exports.EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE
|
|
|
411
411
|
gridItemsRendered: gridItemsRendered,
|
|
412
412
|
wrapperRef: contentRef,
|
|
413
413
|
renderCustomGridBody: renderCustomGridBody
|
|
414
|
-
})), showPagination && props['aria-labelledby'] && (0, _react2.jsx)("p", {
|
|
414
|
+
}))), showPagination && props['aria-labelledby'] && (0, _react2.jsx)("p", {
|
|
415
415
|
id: ariaLabelledById,
|
|
416
416
|
hidden: true
|
|
417
417
|
}, ariaLabelledBy), showPagination && (0, _react2.jsx)(_pagination2.EuiDataGridPagination, _extends({}, pagination, {
|