@carbon/ibm-products 1.61.0 → 1.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/css/index-full-carbon.css +154 -79
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +3 -3
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +1753 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +3 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +154 -79
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +3 -3
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +154 -79
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +3 -3
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Coachmark/Coachmark.js +17 -5
  18. package/es/components/Coachmark/CoachmarkDragbar.js +12 -5
  19. package/es/components/Coachmark/CoachmarkHeader.js +2 -1
  20. package/es/components/Coachmark/CoachmarkOverlay.js +105 -9
  21. package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +5 -2
  22. package/es/components/CoachmarkFixed/CoachmarkFixed.js +26 -6
  23. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +28 -3
  24. package/es/components/CoachmarkStack/CoachmarkStack.js +19 -4
  25. package/es/components/CoachmarkStack/CoachmarkStackHome.js +45 -11
  26. package/es/components/Datagrid/Datagrid/DatagridContent.js +12 -9
  27. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +4 -4
  28. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +45 -73
  29. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +4 -1
  30. package/es/components/Datagrid/Datagrid/DatagridRow.js +5 -2
  31. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -11
  32. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  33. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +29 -23
  34. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +18 -18
  35. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +73 -24
  36. package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +1 -1
  37. package/es/components/Datagrid/useActionsColumn.js +9 -9
  38. package/es/components/Datagrid/useColumnCenterAlign.js +6 -6
  39. package/es/components/Datagrid/useColumnRightAlign.js +6 -6
  40. package/es/components/Datagrid/useDatagrid.js +13 -1
  41. package/es/components/Datagrid/useFlexResize.js +19 -9
  42. package/es/components/Datagrid/useInfiniteScroll.js +10 -9
  43. package/es/components/Datagrid/useNestedRowExpander.js +10 -1
  44. package/es/components/Datagrid/useOnRowClick.js +6 -7
  45. package/es/components/Datagrid/useParentDimensions.js +6 -6
  46. package/es/components/Datagrid/useResizeTable.js +7 -7
  47. package/es/components/Datagrid/useRowExpander.js +11 -1
  48. package/es/components/Datagrid/useSelectAllToggle.js +2 -2
  49. package/es/components/Datagrid/useSelectRows.js +31 -21
  50. package/es/components/Datagrid/useSkeletonRows.js +6 -6
  51. package/es/components/Datagrid/useSortableColumns.js +5 -6
  52. package/es/components/Datagrid/useStickyColumn.js +13 -6
  53. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -0
  54. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -0
  55. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -0
  56. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -0
  57. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -0
  58. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -0
  59. package/es/components/EmptyStates/assets/ErrorIllustration.js +6 -4
  60. package/es/components/EmptyStates/assets/NoDataIllustration.js +6 -4
  61. package/es/components/EmptyStates/assets/NoTagsIllustration.js +6 -4
  62. package/es/components/EmptyStates/assets/NotFoundIllustration.js +6 -4
  63. package/es/components/EmptyStates/assets/NotificationsIllustration.js +6 -4
  64. package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +6 -4
  65. package/es/components/Guidebanner/Guidebanner.js +3 -3
  66. package/es/components/Guidebanner/GuidebannerElement.js +9 -3
  67. package/es/components/Guidebanner/GuidebannerElementButton.js +9 -4
  68. package/es/components/Guidebanner/GuidebannerElementLink.js +9 -3
  69. package/es/components/InlineTip/InlineTipButton.js +7 -0
  70. package/es/components/InlineTip/InlineTipLink.js +7 -0
  71. package/es/components/index.js +2 -2
  72. package/es/global/js/hooks/index.js +3 -2
  73. package/es/global/js/hooks/usePrefix.js +11 -0
  74. package/es/global/js/package-settings.js +6 -2
  75. package/lib/components/Coachmark/Coachmark.js +16 -4
  76. package/lib/components/Coachmark/CoachmarkDragbar.js +12 -5
  77. package/lib/components/Coachmark/CoachmarkHeader.js +2 -1
  78. package/lib/components/Coachmark/CoachmarkOverlay.js +105 -8
  79. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +5 -2
  80. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +25 -5
  81. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +28 -3
  82. package/lib/components/CoachmarkStack/CoachmarkStack.js +18 -3
  83. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +44 -10
  84. package/lib/components/Datagrid/Datagrid/DatagridContent.js +12 -9
  85. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +4 -4
  86. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +44 -80
  87. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +4 -1
  88. package/lib/components/Datagrid/Datagrid/DatagridRow.js +5 -2
  89. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -4
  90. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  91. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +29 -23
  92. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +12 -12
  93. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +75 -33
  94. package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +1 -1
  95. package/lib/components/Datagrid/useActionsColumn.js +9 -12
  96. package/lib/components/Datagrid/useDatagrid.js +13 -1
  97. package/lib/components/Datagrid/useFlexResize.js +19 -9
  98. package/lib/components/Datagrid/useInfiniteScroll.js +9 -9
  99. package/lib/components/Datagrid/useNestedRowExpander.js +10 -9
  100. package/lib/components/Datagrid/useOnRowClick.js +6 -7
  101. package/lib/components/Datagrid/useParentDimensions.js +5 -6
  102. package/lib/components/Datagrid/useResizeTable.js +6 -7
  103. package/lib/components/Datagrid/useRowExpander.js +11 -9
  104. package/lib/components/Datagrid/useSelectAllToggle.js +2 -2
  105. package/lib/components/Datagrid/useSelectRows.js +31 -21
  106. package/lib/components/Datagrid/useSkeletonRows.js +6 -6
  107. package/lib/components/Datagrid/useSortableColumns.js +5 -6
  108. package/lib/components/Datagrid/useStickyColumn.js +8 -0
  109. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -0
  110. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -0
  111. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -0
  112. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -0
  113. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -0
  114. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -0
  115. package/lib/components/EmptyStates/assets/ErrorIllustration.js +6 -4
  116. package/lib/components/EmptyStates/assets/NoDataIllustration.js +6 -4
  117. package/lib/components/EmptyStates/assets/NoTagsIllustration.js +6 -4
  118. package/lib/components/EmptyStates/assets/NotFoundIllustration.js +6 -4
  119. package/lib/components/EmptyStates/assets/NotificationsIllustration.js +6 -4
  120. package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +6 -4
  121. package/lib/components/Guidebanner/Guidebanner.js +3 -3
  122. package/lib/components/Guidebanner/GuidebannerElement.js +8 -1
  123. package/lib/components/Guidebanner/GuidebannerElementButton.js +8 -1
  124. package/lib/components/Guidebanner/GuidebannerElementLink.js +8 -1
  125. package/lib/components/InlineTip/InlineTipButton.js +8 -1
  126. package/lib/components/InlineTip/InlineTipLink.js +8 -1
  127. package/lib/components/index.js +30 -0
  128. package/lib/global/js/hooks/index.js +8 -1
  129. package/lib/global/js/hooks/usePrefix.js +19 -0
  130. package/lib/global/js/package-settings.js +6 -2
  131. package/package.json +2 -2
  132. package/scss/components/Checklist/_checklist.scss +13 -25
  133. package/scss/components/Coachmark/styles/_coachmark-dragbar.scss +1 -45
  134. package/scss/components/Coachmark/styles/_coachmark-header.scss +0 -33
  135. package/scss/components/Coachmark/styles/_coachmark-overlay.scss +113 -5
  136. package/scss/components/Coachmark/styles/_coachmark-tagline.scss +18 -0
  137. package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +16 -13
  138. package/scss/components/CoachmarkOverlayElement/_coachmark-overlay-element.scss +2 -0
  139. package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -0
  140. package/scss/components/CoachmarkStack/_coachmark-stack.scss +3 -0
  141. package/scss/components/Datagrid/_storybook-styles.scss +15 -0
  142. package/scss/components/Datagrid/styles/_datagrid.scss +31 -5
  143. package/scss/components/Datagrid/styles/_useNestedRows.scss +1 -1
  144. package/scss/components/_index-released-only.scss +1 -0
@@ -31,7 +31,7 @@ var TableContainer = DataTable.TableContainer,
31
31
  Table = DataTable.Table;
32
32
  var blockClass = "".concat(pkg.prefix, "--datagrid");
33
33
  export var DatagridContent = function DatagridContent(_ref) {
34
- var _cx4;
34
+ var _cx5;
35
35
  var datagridState = _ref.datagridState,
36
36
  title = _ref.title;
37
37
  var _useContext = useContext(InlineEditContext),
@@ -44,8 +44,7 @@ export var DatagridContent = function DatagridContent(_ref) {
44
44
  var activeCellId = inlineEditState.activeCellId,
45
45
  gridActive = inlineEditState.gridActive,
46
46
  editId = inlineEditState.editId;
47
- var _datagridState$getTab = datagridState.getTableProps,
48
- getTableProps = _datagridState$getTab === void 0 ? function () {} : _datagridState$getTab,
47
+ var getTableProps = datagridState.getTableProps,
49
48
  getFilterFlyoutProps = datagridState.getFilterFlyoutProps,
50
49
  withVirtualScroll = datagridState.withVirtualScroll,
51
50
  DatagridPagination = datagridState.DatagridPagination,
@@ -68,6 +67,7 @@ export var DatagridContent = function DatagridContent(_ref) {
68
67
  state = datagridState.state,
69
68
  page = datagridState.page,
70
69
  rows = datagridState.rows;
70
+ var columnResizing = state.columnResizing;
71
71
  var contentRows = DatagridPagination && page || rows;
72
72
  var gridAreaRef = useRef();
73
73
  var multiKeyTrackingRef = useRef();
@@ -89,10 +89,11 @@ export var DatagridContent = function DatagridContent(_ref) {
89
89
  var renderTable = function renderTable() {
90
90
  var _getTableProps;
91
91
  return /*#__PURE__*/React.createElement(Table, _extends({}, getTableProps(), {
92
- className: cx(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
92
+ className: cx(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), _defineProperty({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), _defineProperty({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), _defineProperty({}, "".concat(blockClass, "__table-grid-active"), gridActive), _defineProperty({}, "".concat(blockClass, "__table-is-resizing"), typeof columnResizing.isResizingColumn === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
93
93
  role: withInlineEdit && 'grid',
94
94
  tabIndex: withInlineEdit && 0,
95
- onKeyDown: withInlineEdit ? function (event) {
95
+ onKeyDown: /* istanbul ignore next */
96
+ withInlineEdit && function (event) {
96
97
  return handleGridKeyPress({
97
98
  event: event,
98
99
  dispatch: dispatch,
@@ -101,10 +102,10 @@ export var DatagridContent = function DatagridContent(_ref) {
101
102
  state: inlineEditState,
102
103
  usingMac: usingMac
103
104
  });
104
- } : null,
105
- onFocus: withInlineEdit ? function () {
105
+ },
106
+ onFocus: withInlineEdit && function () {
106
107
  return handleGridFocus(inlineEditState, dispatch);
107
- } : null,
108
+ },
108
109
  title: title
109
110
  }), !withVirtualScroll && /*#__PURE__*/React.createElement(DatagridHead, datagridState), /*#__PURE__*/React.createElement(DatagridBody, _extends({}, datagridState, {
110
111
  rows: contentRows
@@ -133,6 +134,8 @@ export var DatagridContent = function DatagridContent(_ref) {
133
134
  useSubscribeToEventEmitter(CLEAR_SINGLE_FILTER, function (id) {
134
135
  return clearSingleFilter(id, setAllFilters, state);
135
136
  });
137
+
138
+ /* istanbul ignore next */
136
139
  var renderFilterSummary = function renderFilterSummary() {
137
140
  return state.filters.length > 0 && /*#__PURE__*/React.createElement(FilterSummary, {
138
141
  className: "".concat(blockClass, "__filter-summary"),
@@ -145,7 +148,7 @@ export var DatagridContent = function DatagridContent(_ref) {
145
148
  });
146
149
  };
147
150
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableContainer, {
148
- className: cx("".concat(blockClass, "__grid-container"), withVirtualScroll || fullHeightDatagrid ? "".concat(blockClass, "__full-height") : '', DatagridPagination ? "".concat(blockClass, "__with-pagination") : '', useDenseHeader ? "".concat(blockClass, "__dense-header") : '', (_cx4 = {}, _defineProperty(_cx4, "".concat(blockClass, "__grid-container-grid-active"), gridActive), _defineProperty(_cx4, "".concat(blockClass, "__grid-container-inline-edit"), withInlineEdit), _defineProperty(_cx4, "".concat(blockClass, "__grid-container-grid-active--without-toolbar"), withInlineEdit && !DatagridActions), _cx4)),
151
+ className: cx("".concat(blockClass, "__grid-container"), withVirtualScroll || fullHeightDatagrid ? "".concat(blockClass, "__full-height") : '', DatagridPagination ? "".concat(blockClass, "__with-pagination") : '', useDenseHeader ? "".concat(blockClass, "__dense-header") : '', (_cx5 = {}, _defineProperty(_cx5, "".concat(blockClass, "__grid-container-grid-active"), gridActive), _defineProperty(_cx5, "".concat(blockClass, "__grid-container-inline-edit"), withInlineEdit), _defineProperty(_cx5, "".concat(blockClass, "__grid-container-grid-active--without-toolbar"), withInlineEdit && !DatagridActions), _cx5)),
149
152
  title: gridTitle,
150
153
  description: gridDescription
151
154
  }, /*#__PURE__*/React.createElement(DatagridToolbar, datagridState), /*#__PURE__*/React.createElement("div", {
@@ -13,10 +13,10 @@ var blockClass = "".concat(pkg.prefix, "--datagrid");
13
13
  var DatagridExpandedRow = function DatagridExpandedRow(ExpandedRowContentComponent) {
14
14
  return function (datagridState) {
15
15
  var row = datagridState.row;
16
- var _ref = row || {},
17
- expandedContentHeight = _ref.expandedContentHeight;
16
+ var expandedContentHeight = row.expandedContentHeight;
18
17
  var toggleParentHoverClass = function toggleParentHoverClass(event, eventType) {
19
18
  var _event$target, _event$target$parentN;
19
+ /* istanbul ignore else */
20
20
  if (event !== null && event !== void 0 && (_event$target = event.target) !== null && _event$target !== void 0 && (_event$target$parentN = _event$target.parentNode) !== null && _event$target$parentN !== void 0 && _event$target$parentN.previousElementSibling) {
21
21
  var parentNode = event.target.parentNode.previousElementSibling;
22
22
  if (eventType === 'enter') {
@@ -37,9 +37,9 @@ var DatagridExpandedRow = function DatagridExpandedRow(ExpandedRowContentCompone
37
37
  }, /*#__PURE__*/React.createElement("div", {
38
38
  className: "".concat(blockClass, "__expanded-row-content"),
39
39
  style: {
40
- height: expandedContentHeight ? expandedContentHeight : null
40
+ height: expandedContentHeight && expandedContentHeight
41
41
  }
42
- }, ExpandedRowContentComponent(datagridState)));
42
+ }, /*#__PURE__*/React.createElement(ExpandedRowContentComponent, datagridState)));
43
43
  };
44
44
  };
45
45
  export default DatagridExpandedRow;
@@ -1,6 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
6
  /**
5
7
  * Copyright IBM Corp. 2020, 2023
6
8
  *
@@ -8,14 +10,13 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
8
10
  * LICENSE file in the root directory of this source tree.
9
11
  */
10
12
 
11
- // @flow
12
13
  import React, { useState, useEffect } from 'react';
13
14
  import cx from 'classnames';
14
15
  import { DataTable } from 'carbon-components-react';
15
16
  import { px } from '@carbon/layout';
16
17
  import { selectionColumnId } from '../common-column-ids';
17
18
  import { pkg } from '../../../settings';
18
- import { handleColumnResizeEndEvent, handleColumnResizeStartEvent, handleColumnResizingEvent } from './addons/stateReducer';
19
+ import { handleColumnResizeEndEvent, handleColumnResizingEvent } from './addons/stateReducer';
19
20
  import { getNodeTextContent } from '../../../global/js/utils/getNodeTextContent';
20
21
  var blockClass = "".concat(pkg.prefix, "--datagrid");
21
22
  var getAccessibilityProps = function getAccessibilityProps(header) {
@@ -29,67 +30,45 @@ var getAccessibilityProps = function getAccessibilityProps(header) {
29
30
  return props;
30
31
  };
31
32
  var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
33
+ var resizerAriaLabel = datagridState.resizerAriaLabel;
32
34
  // Used to measure the height of the table and uses that value
33
35
  // to display a vertical line to indicate the column you are resizing
34
36
  useEffect(function () {
35
37
  var tableId = datagridState.tableId;
36
- if (tableId) {
37
- var gridElement = document.querySelector("#".concat(tableId));
38
- var tableElement = gridElement.querySelector('table');
39
- var headerRowElement = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head"));
40
- var hasHorizontalScrollbar = tableElement.scrollWidth > tableElement.clientWidth;
41
- var scrollBuffer = hasHorizontalScrollbar ? 18 : 2;
42
- var tableToolbar = gridElement.querySelector(".".concat(blockClass, "__table-toolbar"));
43
- var tableToolbarHeight = (tableToolbar === null || tableToolbar === void 0 ? void 0 : tableToolbar.offsetHeight) || 0;
44
- var setCustomValues = function setCustomValues(_ref) {
45
- var _ref$rowHeight = _ref.rowHeight,
46
- rowHeight = _ref$rowHeight === void 0 ? 48 : _ref$rowHeight,
47
- gridHeight = _ref.gridHeight;
48
- headerRowElement.style.setProperty("--".concat(blockClass, "--row-height"), px(rowHeight));
49
- headerRowElement.style.setProperty("--".concat(blockClass, "--grid-height"), px(gridHeight - scrollBuffer - tableToolbarHeight));
50
- headerRowElement.style.setProperty("--".concat(blockClass, "--header-height"), px(headerRowElement.offsetHeight));
51
- };
52
- setCustomValues({
53
- gridHeight: gridElement.offsetHeight,
54
- rowHeight: headerRowElement.clientHeight
55
- });
56
- }
38
+ var gridElement = document.querySelector("#".concat(tableId));
39
+ var tableElement = gridElement.querySelector('table');
40
+ var headerRowElement = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head"));
41
+ var hasHorizontalScrollbar = tableElement.scrollWidth > tableElement.clientWidth;
42
+ var scrollBuffer = hasHorizontalScrollbar ? 18 : 2;
43
+ var tableToolbar = gridElement.querySelector(".".concat(blockClass, "__table-toolbar"));
44
+ var tableToolbarHeight = (tableToolbar === null || tableToolbar === void 0 ? void 0 : tableToolbar.offsetHeight) || 0;
45
+ var setCustomValues = function setCustomValues(_ref) {
46
+ var _ref$rowHeight = _ref.rowHeight,
47
+ rowHeight = _ref$rowHeight === void 0 ? 48 : _ref$rowHeight,
48
+ gridHeight = _ref.gridHeight;
49
+ headerRowElement.style.setProperty("--".concat(blockClass, "--row-height"), px(rowHeight));
50
+ headerRowElement.style.setProperty("--".concat(blockClass, "--grid-height"), px(gridHeight - scrollBuffer - tableToolbarHeight));
51
+ headerRowElement.style.setProperty("--".concat(blockClass, "--header-height"), px(headerRowElement.offsetHeight));
52
+ };
53
+ setCustomValues({
54
+ gridHeight: gridElement.offsetHeight,
55
+ rowHeight: headerRowElement.clientHeight
56
+ });
57
57
  }, [datagridState.rowSize, datagridState.tableId, datagridState]);
58
58
  var _useState = useState(2),
59
59
  _useState2 = _slicedToArray(_useState, 1),
60
60
  incrementAmount = _useState2[0];
61
- var getClientXPosition = function getClientXPosition(event) {
62
- var isTouchEvent = false;
63
- if (event.type === 'touchstart') {
64
- // Do not respond to multiple touches (e.g. 2 or 3 fingers)
65
- if (event.touches && event.touches.length > 1) {
66
- return;
67
- }
68
- isTouchEvent = true;
61
+ var handleOnMouseDownResize = function handleOnMouseDownResize(event, resizeProps) {
62
+ var _resizeProps = _objectSpread({}, resizeProps()),
63
+ onMouseDown = _resizeProps.onMouseDown;
64
+ // When event.button is 2, that is a right click
65
+ // and we do not want to resize
66
+ if (event.button === 2 || event.ctrlKey) {
67
+ event.target.blur();
68
+ return;
69
69
  }
70
- var clientX = isTouchEvent ? Math.round(event.touches[0].clientX) : event.clientX;
71
- var closestHeader = event.target.closest('th');
72
- var closestHeaderCoords = closestHeader.getBoundingClientRect();
73
- var headerOffset = closestHeaderCoords.left;
74
- var offsetValue = clientX - headerOffset;
75
- return offsetValue;
70
+ onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
76
71
  };
77
- useEffect(function () {
78
- var isResizing = datagridState.state.isResizing;
79
- if (isResizing) {
80
- var onColResizeEnd = datagridState.onColResizeEnd;
81
- document.addEventListener('mouseup', function () {
82
- handleColumnResizeEndEvent(datagridState.dispatch, onColResizeEnd, isResizing);
83
- document.activeElement.blur();
84
- });
85
- }
86
- return function () {
87
- document.removeEventListener('mouseup', function () {
88
- return handleColumnResizeEndEvent(datagridState.dispatch);
89
- });
90
- };
91
- // eslint-disable-next-line react-hooks/exhaustive-deps
92
- }, [datagridState.state.isResizing]);
93
72
  return /*#__PURE__*/React.createElement(TableRow, _extends({}, headerGroup.getHeaderGroupProps({
94
73
  role: false
95
74
  }), {
@@ -112,32 +91,25 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
112
91
  state = datagridState.state,
113
92
  dispatch = datagridState.dispatch,
114
93
  onColResizeEnd = datagridState.onColResizeEnd;
115
- var columnResizing = state.columnResizing,
116
- isResizing = state.isResizing;
117
- var columnWidths = columnResizing.columnWidths;
94
+ var columnResizing = state.columnResizing;
95
+ var _ref4 = columnResizing || {},
96
+ columnWidths = _ref4.columnWidths;
118
97
  var originalCol = visibleColumns[index];
119
98
  return /*#__PURE__*/React.createElement(TableHeader, _extends({}, header.getHeaderProps({
120
99
  role: false
121
100
  }), {
122
- className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), _defineProperty(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), _defineProperty(_cx, "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable), _defineProperty(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
123
- key: header.id
124
- }, getAccessibilityProps(header)), header.render('Header'), header.getResizerProps && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, header.getResizerProps(), {
125
- onMouseMove: function onMouseMove(event) {
126
- if (isResizing) {
127
- var newWidth = getClientXPosition(event);
128
- // Sets a min width for resizing so at least one character from the column header is visible
129
- if (newWidth >= 50) {
130
- handleColumnResizingEvent(dispatch, header, newWidth);
131
- }
132
- }
133
- },
134
- onMouseDown: function onMouseDown() {
135
- return handleColumnResizeStartEvent(dispatch, header.id);
101
+ className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), _defineProperty(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), _defineProperty(_cx, "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), _defineProperty(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _defineProperty(_cx, "".concat(blockClass, "__header-actions-column"), header.isAction), _cx), header.getHeaderProps().className),
102
+ key: header.id,
103
+ "aria-hidden": header.id === 'spacer' && 'true'
104
+ }, getAccessibilityProps(header)), header.render('Header'), header.getResizerProps && !header.isAction && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, header.getResizerProps(), {
105
+ onMouseDown: function onMouseDown(event) {
106
+ return handleOnMouseDownResize(event, header.getResizerProps);
136
107
  },
137
108
  onKeyDown: function onKeyDown(event) {
138
109
  var key = event.key;
139
110
  if (key === 'ArrowLeft' || key === 'ArrowRight') {
140
- var currentColumnWidth = columnWidths[header.id] || (datagridState.isTableSortable && originalCol.width < 90 ? 90 : originalCol.width);
111
+ var originalColMinWidth = originalCol.minWidth || 90;
112
+ var currentColumnWidth = columnWidths[header.id] || (datagridState.isTableSortable && originalCol.width < originalColMinWidth ? originalColMinWidth : originalCol.width);
141
113
  if (key === 'ArrowLeft') {
142
114
  if (currentColumnWidth - incrementAmount > Math.max(minWidth, 50)) {
143
115
  var newWidth = currentColumnWidth - incrementAmount;
@@ -151,12 +123,12 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
151
123
  }
152
124
  },
153
125
  onKeyUp: function onKeyUp() {
154
- return handleColumnResizeEndEvent(dispatch, onColResizeEnd, header.id);
126
+ return handleColumnResizeEndEvent(dispatch, onColResizeEnd, header.id, true);
155
127
  },
156
128
  className: cx("".concat(blockClass, "__col-resizer-range")),
157
129
  type: "range",
158
130
  defaultValue: originalCol.width,
159
- "aria-label": "Resize column"
131
+ "aria-label": resizerAriaLabel || 'Resize column'
160
132
  })), /*#__PURE__*/React.createElement("span", {
161
133
  className: "".concat(blockClass, "__col-resize-indicator")
162
134
  })));
@@ -28,8 +28,11 @@ var DatagridRefBody = function DatagridRefBody(datagridState) {
28
28
  className: cx("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
29
29
  }), rows.map(function (row) {
30
30
  prepareRow(row);
31
+ var _row$getRowProps = row.getRowProps(),
32
+ key = _row$getRowProps.key;
31
33
  return row.RowRenderer(_objectSpread(_objectSpread({}, datagridState), {}, {
32
- row: row
34
+ row: row,
35
+ key: key
33
36
  }));
34
37
  }));
35
38
  };
@@ -35,7 +35,8 @@ var DatagridRow = function DatagridRow(datagridState) {
35
35
  var row = datagridState.row,
36
36
  rowSize = datagridState.rowSize,
37
37
  withNestedRows = datagridState.withNestedRows,
38
- prepareRow = datagridState.prepareRow;
38
+ prepareRow = datagridState.prepareRow,
39
+ key = datagridState.key;
39
40
  var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
40
41
  var isExpanded = _ref.isExpanded,
41
42
  subRows = _ref.subRows;
@@ -93,7 +94,9 @@ var DatagridRow = function DatagridRow(datagridState) {
93
94
  }
94
95
  };
95
96
  var rowClassNames = cx("".concat(blockClass, "__carbon-row"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), _defineProperty(_cx, "".concat(carbon.prefix, "--data-table--selected"), row.isSelected), _cx));
96
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableRow, _extends({
97
+ return /*#__PURE__*/React.createElement(React.Fragment, {
98
+ key: key
99
+ }, /*#__PURE__*/React.createElement(TableRow, _extends({
97
100
  className: rowClassNames
98
101
  }, row.getRowProps({
99
102
  role: false
@@ -3,14 +3,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
5
  var _excluded = ["onChange"];
6
- /*
7
- * Licensed Materials - Property of IBM
8
- * 5724-Q36
9
- * (c) Copyright IBM Corp. 2023
10
- * US Government Users Restricted Rights - Use, duplication or disclosure
11
- * restricted by GSA ADP Schedule Contract with IBM Corp.
6
+ /**
7
+ * Copyright IBM Corp. 2020, 2023
8
+ *
9
+ * This source code is licensed under the Apache-2.0 license found in the
10
+ * LICENSE file in the root directory of this source tree.
12
11
  */
13
- // @flow
12
+
14
13
  import React, { useLayoutEffect, useState } from 'react';
15
14
  import { DataTable } from 'carbon-components-react';
16
15
  import cx from 'classnames';
@@ -23,6 +22,7 @@ var SelectAll = function SelectAll(datagridState) {
23
22
  windowSize = _useState2[0],
24
23
  setWindowSize = _useState2[1];
25
24
  useLayoutEffect(function () {
25
+ /* istanbul ignore next */
26
26
  function updateSize() {
27
27
  setWindowSize(window.innerWidth);
28
28
  }
@@ -43,15 +43,15 @@ var SelectAll = function SelectAll(datagridState) {
43
43
  var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
44
44
  if (hideSelectAll || radio) {
45
45
  return /*#__PURE__*/React.createElement("div", {
46
- className: cx("".concat(blockClass, "__head-hidden-select-all"), _defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
46
+ className: cx("".concat(blockClass, "__head-hidden-select-all"), _defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), /* istanbul ignore next */
47
+ isFirstColumnStickyLeft && windowSize > 671))
47
48
  });
48
49
  }
49
50
  var getProps = DatagridPagination ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
50
51
  var _getProps = getProps(),
51
52
  onChange = _getProps.onChange,
52
53
  selectProps = _objectWithoutProperties(_getProps, _excluded);
53
- var _ref = selectProps || {},
54
- indeterminate = _ref.indeterminate;
54
+ var indeterminate = selectProps.indeterminate;
55
55
  var handleSelectAllChange = function handleSelectAllChange(event) {
56
56
  if (indeterminate) {
57
57
  return onChange === null || onChange === void 0 ? void 0 : onChange({
@@ -63,7 +63,8 @@ var SelectAll = function SelectAll(datagridState) {
63
63
  return onChange === null || onChange === void 0 ? void 0 : onChange(event);
64
64
  };
65
65
  return /*#__PURE__*/React.createElement("div", {
66
- className: cx("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
66
+ className: cx("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
67
+ isFirstColumnStickyLeft && windowSize > 671))
67
68
  }, /*#__PURE__*/React.createElement(TableSelectAll, _extends({}, selectProps, {
68
69
  name: "".concat(tableId, "-select-all-checkbox-name"),
69
70
  onSelect: handleSelectAllChange,
@@ -25,8 +25,11 @@ var DatagridSimpleBody = function DatagridSimpleBody(datagridState) {
25
25
  className: cx("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
26
26
  }), rows.map(function (row) {
27
27
  prepareRow(row);
28
+ var _row$getRowProps = row.getRowProps(),
29
+ key = _row$getRowProps.key;
28
30
  return row.RowRenderer(_objectSpread(_objectSpread({}, datagridState), {}, {
29
- row: row
31
+ row: row,
32
+ key: key
30
33
  }));
31
34
  }));
32
35
  };
@@ -15,9 +15,10 @@ import { ButtonMenu, ButtonMenuItem } from '../../ButtonMenu';
15
15
  import { pkg, carbon } from '../../../settings';
16
16
  import cx from 'classnames';
17
17
  var blockClass = "".concat(pkg.prefix, "--datagrid");
18
+ var toolbarClass = "".concat(blockClass, "__table-toolbar");
19
+ var menuClass = "".concat(blockClass, "__button-menu");
18
20
  var TableToolbar = DataTable.TableToolbar;
19
21
  var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridState, width, ref) {
20
- var _Object$keys;
21
22
  var _useState = useState(false),
22
23
  _useState2 = _slicedToArray(_useState, 2),
23
24
  displayAllInMenu = _useState2[0],
@@ -33,8 +34,12 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
33
34
  var selectedRowIds = datagridState.state.selectedRowIds,
34
35
  toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
35
36
  toolbarBatchActions = datagridState.toolbarBatchActions,
36
- setGlobalFilter = datagridState.setGlobalFilter;
37
- var totalSelected = (_Object$keys = Object.keys(selectedRowIds || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length;
37
+ setGlobalFilter = datagridState.setGlobalFilter,
38
+ batchActionMenuButtonLabel = datagridState.batchActionMenuButtonLabel,
39
+ translateWithIdBatchActions = datagridState.translateWithIdBatchActions;
40
+ var batchActionMenuButtonLabelText = batchActionMenuButtonLabel !== null && batchActionMenuButtonLabel !== void 0 ? batchActionMenuButtonLabel : 'More';
41
+ var selectedKeys = Object.keys(selectedRowIds || {});
42
+ var totalSelected = selectedKeys.length;
38
43
 
39
44
  // Get initial width of batch actions container,
40
45
  // used to measure when all items are put inside
@@ -64,25 +69,25 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
64
69
  return null;
65
70
  }
66
71
  return /*#__PURE__*/React.createElement(ButtonMenu, {
67
- label: width > minWidthBeforeOverflowIcon ? 'More' : null,
72
+ label: width > minWidthBeforeOverflowIcon ? batchActionMenuButtonLabelText : null,
68
73
  renderIcon: width > minWidthBeforeOverflowIcon ? Add16 : OverflowMenuVertical16,
69
- className: cx("".concat(blockClass, "__button-menu"), _defineProperty({}, "".concat(blockClass, "__button-menu--icon-only"), width <= minWidthBeforeOverflowIcon)),
70
- menuOptionsClass: "".concat(blockClass, "__button-menu-options"),
74
+ className: cx([menuClass, _defineProperty({}, "".concat(menuClass, "--icon-only"), width <= minWidthBeforeOverflowIcon)]),
75
+ menuOptionsClass: "".concat(menuClass, "-options"),
71
76
  flipped: true
72
- }, toolbarBatchActions && toolbarBatchActions.map(function (batchAction, index) {
73
- if (index < 2 && !displayAllInMenu) {
74
- return;
75
- }
76
- return /*#__PURE__*/React.createElement(ButtonMenuItem, {
77
- key: "".concat(batchAction.label, "-").concat(index),
78
- itemText: batchAction.label,
79
- onClick: function onClick() {
80
- batchAction.onClick();
81
- if (batchAction.type === 'select_all') {
82
- toggleAllRowsSelected(true);
77
+ }, toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
78
+ var hidden = index < 2 && !displayAllInMenu;
79
+ if (!hidden) {
80
+ return /*#__PURE__*/React.createElement(ButtonMenuItem, {
81
+ key: "".concat(batchAction.label, "-").concat(index),
82
+ itemText: batchAction.label,
83
+ onClick: function onClick() {
84
+ batchAction.onClick();
85
+ if (batchAction.type === 'select_all') {
86
+ toggleAllRowsSelected(true);
87
+ }
83
88
  }
84
- }
85
- });
89
+ });
90
+ }
86
91
  }));
87
92
  };
88
93
 
@@ -95,7 +100,8 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
95
100
  onCancel: function onCancel() {
96
101
  toggleAllRowsSelected(false);
97
102
  setGlobalFilter(null);
98
- }
103
+ },
104
+ translateWithId: translateWithIdBatchActions
99
105
  }, !displayAllInMenu && toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
100
106
  if (index < 2 && toolbarBatchActions.length > 3 || index < 3 && toolbarBatchActions.length <= 3) {
101
107
  return /*#__PURE__*/React.createElement(TableBatchAction, {
@@ -120,12 +126,12 @@ var DatagridToolbar = function DatagridToolbar(datagridState) {
120
126
  DatagridBatchActions = datagridState.DatagridBatchActions,
121
127
  batchActions = datagridState.batchActions,
122
128
  rowSize = datagridState.rowSize;
123
- var getRowHeight = rowSize ? rowSize : 'lg';
129
+ var getRowHeight = rowSize || 'lg';
124
130
  return batchActions && DatagridActions ? /*#__PURE__*/React.createElement("div", {
125
131
  ref: ref,
126
- className: cx("".concat(blockClass, "__table-toolbar"), "".concat(blockClass, "__table-toolbar--").concat(getRowHeight))
132
+ className: cx([toolbarClass, "".concat(toolbarClass, "--").concat(getRowHeight)])
127
133
  }, /*#__PURE__*/React.createElement(TableToolbar, null, DatagridActions && DatagridActions(datagridState), DatagridBatchActionsToolbar && DatagridBatchActionsToolbar(datagridState, width, ref))) : DatagridActions ? /*#__PURE__*/React.createElement("div", {
128
- className: "".concat(blockClass, "__table-toolbar")
134
+ className: toolbarClass
129
135
  }, /*#__PURE__*/React.createElement(TableToolbar, null, DatagridActions && DatagridActions(datagridState), DatagridBatchActions && DatagridBatchActions(datagridState))) : null;
130
136
  };
131
137
  export default DatagridToolbar;
@@ -2,13 +2,13 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- /*
6
- * Licensed Materials - Property of IBM
7
- * 5724-Q36
8
- * (c) Copyright IBM Corp. 2020 - 2023
9
- * US Government Users Restricted Rights - Use, duplication or disclosure
10
- * restricted by GSA ADP Schedule Contract with IBM Corp.
5
+ /**
6
+ * Copyright IBM Corp. 2020, 2023
7
+ *
8
+ * This source code is licensed under the Apache-2.0 license found in the
9
+ * LICENSE file in the root directory of this source tree.
11
10
  */
11
+
12
12
  import React, { useEffect } from 'react';
13
13
  import { VariableSizeList } from 'react-window';
14
14
  import { DataTable } from 'carbon-components-react';
@@ -23,12 +23,7 @@ var rowSizeMap = {
23
23
  sm: 32,
24
24
  md: 40,
25
25
  lg: 48,
26
- xl: 64,
27
- // TODO: deprecate the below values in next major release (v8) on carbon-components-react
28
- short: 32,
29
- compact: 24,
30
- normal: 48,
31
- tall: 64
26
+ xl: 64
32
27
  };
33
28
  var defaultRowHeight = rowSizeMap.lg;
34
29
  var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
@@ -47,13 +42,17 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
47
42
  page = datagridState.page,
48
43
  handleResize = datagridState.handleResize,
49
44
  gridRef = datagridState.gridRef;
45
+
46
+ /* istanbul ignore next */
50
47
  var handleVirtualGridResize = function handleVirtualGridResize() {
51
48
  var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
52
49
  gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 ? void 0 : gridRefElement.clientWidth;
53
50
  };
54
51
  useResizeObserver(gridRef, handleVirtualGridResize);
55
- var syncScroll = function syncScroll(e) {
56
- var virtualBody = e.target;
52
+
53
+ /* istanbul ignore next */
54
+ var syncScroll = function syncScroll(event) {
55
+ var virtualBody = event.target;
57
56
  document.querySelector(".".concat(blockClass, "__head-wrap")).scrollLeft = virtualBody.scrollLeft;
58
57
  var spacerColumn = document.querySelector(".".concat(blockClass, "__head-wrap thead th:last-child"));
59
58
  spacerColumn.style.width = px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
@@ -76,9 +75,7 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
76
75
  }, /*#__PURE__*/React.createElement(DatagridHead, datagridState)), /*#__PURE__*/React.createElement(TableBody, _extends({}, getTableBodyProps({
77
76
  role: false
78
77
  }), {
79
- onScroll: function onScroll(e) {
80
- return syncScroll(e);
81
- }
78
+ onScroll: syncScroll
82
79
  }), /*#__PURE__*/React.createElement(VariableSizeList, {
83
80
  height: virtualHeight || tableHeight,
84
81
  itemCount: visibleRows.length,
@@ -98,10 +95,13 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
98
95
  style = _ref.style;
99
96
  var row = visibleRows[index];
100
97
  prepareRow(row);
98
+ var _row$getRowProps = row.getRowProps(),
99
+ key = _row$getRowProps.key;
101
100
  return /*#__PURE__*/React.createElement("div", {
102
101
  style: _objectSpread({}, style)
103
102
  }, row.RowRenderer(_objectSpread(_objectSpread({}, datagridState), {}, {
104
- row: row
103
+ row: row,
104
+ key: key
105
105
  })));
106
106
  })));
107
107
  };