@carbon/ibm-products 1.61.1 → 1.62.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. package/css/index-full-carbon.css +156 -68
  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 +156 -68
  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 +156 -68
  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 +41 -25
  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 +50 -14
  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/useDatagrid.js +13 -1
  39. package/es/components/Datagrid/useFlexResize.js +19 -9
  40. package/es/components/Datagrid/useInfiniteScroll.js +10 -9
  41. package/es/components/Datagrid/useOnRowClick.js +6 -7
  42. package/es/components/Datagrid/useParentDimensions.js +6 -6
  43. package/es/components/Datagrid/useResizeTable.js +7 -7
  44. package/es/components/Datagrid/useSelectAllToggle.js +2 -2
  45. package/es/components/Datagrid/useSelectRows.js +31 -21
  46. package/es/components/Datagrid/useSkeletonRows.js +6 -6
  47. package/es/components/Datagrid/useSortableColumns.js +4 -5
  48. package/es/components/Datagrid/useStickyColumn.js +13 -6
  49. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -0
  50. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -0
  51. package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -0
  52. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -0
  53. package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -0
  54. package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -0
  55. package/es/components/EmptyStates/assets/ErrorIllustration.js +6 -4
  56. package/es/components/EmptyStates/assets/NoDataIllustration.js +6 -4
  57. package/es/components/EmptyStates/assets/NoTagsIllustration.js +6 -4
  58. package/es/components/EmptyStates/assets/NotFoundIllustration.js +6 -4
  59. package/es/components/EmptyStates/assets/NotificationsIllustration.js +6 -4
  60. package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +6 -4
  61. package/es/global/js/hooks/index.js +3 -2
  62. package/es/global/js/hooks/usePrefix.js +11 -0
  63. package/es/global/js/package-settings.js +1 -2
  64. package/lib/components/Coachmark/Coachmark.js +16 -4
  65. package/lib/components/Coachmark/CoachmarkDragbar.js +12 -5
  66. package/lib/components/Coachmark/CoachmarkHeader.js +2 -1
  67. package/lib/components/Coachmark/CoachmarkOverlay.js +105 -8
  68. package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +5 -2
  69. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +25 -5
  70. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +28 -3
  71. package/lib/components/CoachmarkStack/CoachmarkStack.js +18 -3
  72. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +44 -10
  73. package/lib/components/Datagrid/Datagrid/DatagridContent.js +12 -9
  74. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +4 -4
  75. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +41 -32
  76. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +4 -1
  77. package/lib/components/Datagrid/Datagrid/DatagridRow.js +5 -2
  78. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +6 -4
  79. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  80. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +29 -23
  81. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +12 -12
  82. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +52 -15
  83. package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +1 -1
  84. package/lib/components/Datagrid/useActionsColumn.js +9 -12
  85. package/lib/components/Datagrid/useDatagrid.js +13 -1
  86. package/lib/components/Datagrid/useFlexResize.js +19 -9
  87. package/lib/components/Datagrid/useInfiniteScroll.js +9 -9
  88. package/lib/components/Datagrid/useOnRowClick.js +6 -7
  89. package/lib/components/Datagrid/useParentDimensions.js +5 -6
  90. package/lib/components/Datagrid/useResizeTable.js +6 -7
  91. package/lib/components/Datagrid/useSelectAllToggle.js +2 -2
  92. package/lib/components/Datagrid/useSelectRows.js +31 -21
  93. package/lib/components/Datagrid/useSkeletonRows.js +6 -6
  94. package/lib/components/Datagrid/useSortableColumns.js +4 -5
  95. package/lib/components/Datagrid/useStickyColumn.js +8 -0
  96. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -0
  97. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -0
  98. package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -0
  99. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -0
  100. package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -0
  101. package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -0
  102. package/lib/components/EmptyStates/assets/ErrorIllustration.js +6 -4
  103. package/lib/components/EmptyStates/assets/NoDataIllustration.js +6 -4
  104. package/lib/components/EmptyStates/assets/NoTagsIllustration.js +6 -4
  105. package/lib/components/EmptyStates/assets/NotFoundIllustration.js +6 -4
  106. package/lib/components/EmptyStates/assets/NotificationsIllustration.js +6 -4
  107. package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +6 -4
  108. package/lib/global/js/hooks/index.js +8 -1
  109. package/lib/global/js/hooks/usePrefix.js +19 -0
  110. package/lib/global/js/package-settings.js +1 -2
  111. package/package.json +2 -2
  112. package/scss/components/Checklist/_checklist.scss +13 -25
  113. package/scss/components/Coachmark/styles/_coachmark-dragbar.scss +1 -45
  114. package/scss/components/Coachmark/styles/_coachmark-header.scss +0 -33
  115. package/scss/components/Coachmark/styles/_coachmark-overlay.scss +113 -5
  116. package/scss/components/Coachmark/styles/_coachmark-tagline.scss +18 -0
  117. package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +19 -1
  118. package/scss/components/CoachmarkOverlayElement/_coachmark-overlay-element.scss +2 -0
  119. package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -0
  120. package/scss/components/CoachmarkStack/_coachmark-stack.scss +3 -0
  121. package/scss/components/Datagrid/styles/_datagrid.scss +31 -5
  122. package/scss/components/Datagrid/styles/_useNestedRows.scss +1 -1
  123. package/scss/components/_index-released-only.scss +1 -0
@@ -20,13 +20,14 @@ var _Carousel = require("../Carousel");
20
20
  var _SteppedAnimatedMedia = require("../SteppedAnimatedMedia");
21
21
  var _devtools = require("../../global/js/utils/devtools");
22
22
  var _settings = require("../../settings");
23
- var _excluded = ["className", "children", "media", "nextButtonText", "previousButtonLabel", "closeButtonLabel"];
23
+ var _excluded = ["className", "children", "isVisible", "media", "nextButtonText", "previousButtonLabel", "closeButtonLabel"];
24
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
26
26
  // The block part of our conventional BEM class names (blockClass__E--M).
27
27
  var blockClass = "".concat(_settings.pkg.prefix, "--coachmark-overlay-elements");
28
28
  var componentName = 'CoachmarkOverlayElements';
29
29
  var defaults = {
30
+ isVisible: false,
30
31
  nextButtonText: 'Next',
31
32
  previousButtonLabel: 'Back',
32
33
  closeButtonLabel: 'Got it'
@@ -39,6 +40,8 @@ var defaults = {
39
40
  var CoachmarkOverlayElements = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
40
41
  var className = _ref.className,
41
42
  children = _ref.children,
43
+ _ref$isVisible = _ref.isVisible,
44
+ isVisible = _ref$isVisible === void 0 ? defaults.isVisible : _ref$isVisible,
42
45
  media = _ref.media,
43
46
  _ref$nextButtonText = _ref.nextButtonText,
44
47
  nextButtonText = _ref$nextButtonText === void 0 ? defaults.nextButtonText : _ref$nextButtonText,
@@ -56,8 +59,16 @@ var CoachmarkOverlayElements = /*#__PURE__*/_react.default.forwardRef(function (
56
59
  var _useState3 = (0, _react.useState)(0),
57
60
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
58
61
  currentProgStep = _useState4[0],
59
- setCurrentProgStep = _useState4[1];
62
+ _setCurrentProgStep = _useState4[1];
60
63
  var coachmark = (0, _Coachmark.useCoachmark)();
64
+ var setCurrentProgStep = function setCurrentProgStep(value) {
65
+ if (currentProgStep > 0 && value === 0 && buttonFocusRef.current) {
66
+ setTimeout(function () {
67
+ buttonFocusRef.current.focus();
68
+ }, 1000);
69
+ }
70
+ _setCurrentProgStep(value);
71
+ };
61
72
  var numProgSteps = _react.Children.count(children);
62
73
  var progStepFloor = 0;
63
74
  var progStepCeil = numProgSteps - 1;
@@ -68,6 +79,13 @@ var CoachmarkOverlayElements = /*#__PURE__*/_react.default.forwardRef(function (
68
79
  buttonFocusRef.current.focus();
69
80
  }
70
81
  }, []);
82
+ (0, _react.useEffect)(function () {
83
+ setTimeout(function () {
84
+ if (buttonFocusRef.current && isVisible) {
85
+ buttonFocusRef.current.focus();
86
+ }
87
+ }, 100);
88
+ }, [isVisible]);
71
89
  if (!coachmark) {
72
90
  return _pconsole.default.warn("The ".concat(componentName, " is a composable container element which should be used only within the scope of a Coachmark or a CoachmarkFixed component."));
73
91
  }
@@ -91,7 +109,9 @@ var CoachmarkOverlayElements = /*#__PURE__*/_react.default.forwardRef(function (
91
109
  className: (0, _classnames.default)("".concat(blockClass, "__footer"), 'coachmark-carousel-controls')
92
110
  }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, (0, _extends2.default)({
93
111
  size: "sm"
94
- }, coachmark.closeButtonProps), closeButtonLabel))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Carousel.Carousel, {
112
+ }, coachmark.closeButtonProps, {
113
+ ref: buttonFocusRef
114
+ }), closeButtonLabel))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Carousel.Carousel, {
95
115
  disableArrowScroll: true,
96
116
  ref: scrollRef
97
117
  }, children), /*#__PURE__*/_react.default.createElement("div", {
@@ -155,6 +175,11 @@ CoachmarkOverlayElements.propTypes = {
155
175
  * The label for the Close button.
156
176
  */
157
177
  closeButtonLabel: _propTypes.default.string,
178
+ /**
179
+ * The visibility of CoachmarkOverlayElements is
180
+ * managed in the parent component.
181
+ */
182
+ isVisible: _propTypes.default.bool,
158
183
  /**
159
184
  * The object describing an image in one of two shapes.
160
185
  * If a single media element is required, use `{render}`.
@@ -91,7 +91,18 @@ var CoachmarkStack = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
91
91
  var handleClickNavItem = function handleClickNavItem(itemNumber) {
92
92
  setSelectedItemNumber(itemNumber);
93
93
  };
94
- var handleClose = function handleClose(isParentCloseButton) {
94
+ var escFunction = (0, _react.useCallback)(function (event) {
95
+ if (event.key === 'Escape') {
96
+ selectedItemNumber === 0 ? handleClose(true) : handleClose(false);
97
+ }
98
+ }, [handleClose, selectedItemNumber]);
99
+ (0, _react.useEffect)(function () {
100
+ document.addEventListener('keydown', escFunction, false);
101
+ return function () {
102
+ document.removeEventListener('keydown', escFunction, false);
103
+ };
104
+ }, [escFunction]);
105
+ var handleClose = (0, _react.useCallback)(function (isParentCloseButton) {
95
106
  if (isParentCloseButton) {
96
107
  // Trigger slide-out animation
97
108
  setSelectedItemNumber(-1);
@@ -108,9 +119,10 @@ var CoachmarkStack = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
108
119
  // Unstack child
109
120
  setSelectedItemNumber(0);
110
121
  }
111
- };
122
+ }, [onClose]);
112
123
  var contextValue = {
113
124
  buttonProps: {
125
+ tabIndex: 0,
114
126
  'aria-expanded': isOpen,
115
127
  onClick: function onClick() {
116
128
  setIsOpen(true);
@@ -137,7 +149,7 @@ var CoachmarkStack = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
137
149
  (0, _react.useEffect)(function () {
138
150
  setTimeout(function () {
139
151
  if (stackHomeRef.current) {
140
- setParentHeight(stackHomeRef.current.clientHeight);
152
+ setParentHeight(stackHomeRef.current.clientHeight + 16);
141
153
  }
142
154
  }, 0);
143
155
  }, [stackHomeRef]);
@@ -148,10 +160,12 @@ var CoachmarkStack = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
148
160
  }
149
161
  stackHomeRef.current.style.height = "".concat(parentHeight, "px");
150
162
  if (!isOpen || targetSelectedItem < 0) {
163
+ stackHomeRef.current.focus();
151
164
  return;
152
165
  }
153
166
  var targetHomeHeight = stackedCoachmarkRefs.current[targetSelectedItem].clientHeight;
154
167
  stackHomeRef.current.style.height = "".concat(targetHomeHeight, "px");
168
+ stackedCoachmarkRefs.current[targetSelectedItem].focus();
155
169
  }, [selectedItemNumber, isOpen, parentHeight]);
156
170
  var wrappedChildren = _react.Children.map(childArray, function (child, idx) {
157
171
  var mountedClass = mountedRef.current ? "".concat(elementBlockClass, "--is-mounted") : '';
@@ -180,6 +194,7 @@ var CoachmarkStack = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
180
194
  }), /*#__PURE__*/_react.default.createElement(_CoachmarkStackHome.CoachmarkStackHome, {
181
195
  ref: stackHomeRef,
182
196
  className: (0, _classnames.default)("".concat(_settings.pkg.prefix, "--coachmark-overlay"), "".concat(_settings.pkg.prefix, "--coachmark-overlay__").concat(theme), elementBlockClass, selectedItemNumber > 0 && "".concat(elementBlockClass, "--is-stacked"), selectedItemNumber > 0 && "".concat(elementBlockClass, "--is-stacked__").concat(theme), isOpen && "".concat(elementBlockClass, "--is-visible"), mountedRef.current && "".concat(elementBlockClass, "--is-mounted")),
197
+ isOpen: isOpen && selectedItemNumber < 1,
183
198
  description: description,
184
199
  media: media,
185
200
  navLinkLabels: navLinkLabels,
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.CoachmarkStackHome = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
12
  var _react = _interopRequireWildcard(require("react"));
12
13
  var _pconsole = _interopRequireDefault(require("../../global/js/utils/pconsole"));
@@ -19,7 +20,7 @@ var _settings = require("../../settings");
19
20
  var _reactDom = require("react-dom");
20
21
  var _CoachmarkHeader = require("../Coachmark/CoachmarkHeader");
21
22
  var _SteppedAnimatedMedia = require("../SteppedAnimatedMedia");
22
- var _excluded = ["className", "description", "media", "navLinkLabels", "onClickNavItem", "onClose", "portalTarget", "closeButtonLabel", "title"];
23
+ var _excluded = ["className", "description", "isOpen", "media", "navLinkLabels", "onClickNavItem", "onClose", "portalTarget", "closeButtonLabel", "title"];
23
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
24
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
26
  // Carbon and package components we use.
@@ -38,14 +39,27 @@ var CoachmarkStackHome = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
38
39
  var _document$querySelect;
39
40
  var className = _ref.className,
40
41
  description = _ref.description,
42
+ isOpen = _ref.isOpen,
41
43
  media = _ref.media,
42
44
  navLinkLabels = _ref.navLinkLabels,
43
45
  onClickNavItem = _ref.onClickNavItem,
44
- onClose = _ref.onClose,
46
+ _onClose = _ref.onClose,
45
47
  portalTarget = _ref.portalTarget,
46
48
  closeButtonLabel = _ref.closeButtonLabel,
47
49
  title = _ref.title,
48
50
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
51
+ var buttonFocusRef = (0, _react.useRef)();
52
+ var _useState = (0, _react.useState)(0),
53
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
54
+ linkFocusIndex = _useState2[0],
55
+ setLinkFocusIndex = _useState2[1];
56
+ (0, _react.useEffect)(function () {
57
+ setTimeout(function () {
58
+ if (isOpen && buttonFocusRef.current) {
59
+ buttonFocusRef.current.focus();
60
+ }
61
+ }, 100);
62
+ }, [isOpen]);
49
63
  if (!navLinkLabels) {
50
64
  return _pconsole.default.warn("".concat(componentName, " is a Novice to Pro internal component and is not intended for general use."));
51
65
  }
@@ -55,7 +69,10 @@ var CoachmarkStackHome = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
55
69
  ref: ref,
56
70
  role: "main"
57
71
  }, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_CoachmarkHeader.CoachmarkHeader, {
58
- onClose: onClose
72
+ onClose: function onClose() {
73
+ setLinkFocusIndex(0);
74
+ _onClose();
75
+ }
59
76
  }), /*#__PURE__*/_react.default.createElement("div", {
60
77
  className: "".concat(overlayClass, "__body")
61
78
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -75,21 +92,34 @@ var CoachmarkStackHome = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref
75
92
  }, description)), /*#__PURE__*/_react.default.createElement("ul", {
76
93
  className: "".concat(blockClass, "__nav-links")
77
94
  }, navLinkLabels.map(function (label, index) {
95
+ if (index === linkFocusIndex) {
96
+ return renderNavLink(index, label, buttonFocusRef);
97
+ } else {
98
+ return renderNavLink(index, label);
99
+ }
100
+ })), closeButtonLabel && /*#__PURE__*/_react.default.createElement("div", {
101
+ className: "".concat(overlayClass, "__footer")
102
+ }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
103
+ size: "sm",
104
+ onClick: function onClick() {
105
+ setLinkFocusIndex(0);
106
+ _onClose();
107
+ }
108
+ }, closeButtonLabel))))), portalNode);
109
+ function renderNavLink(index, label) {
110
+ var ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
78
111
  return /*#__PURE__*/_react.default.createElement("li", {
79
112
  key: index
80
113
  }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
81
114
  kind: "ghost",
82
115
  size: "sm",
83
116
  onClick: function onClick() {
117
+ setLinkFocusIndex(index);
84
118
  onClickNavItem(index + 1);
85
- }
119
+ },
120
+ ref: ref
86
121
  }, label));
87
- })), closeButtonLabel && /*#__PURE__*/_react.default.createElement("div", {
88
- className: "".concat(overlayClass, "__footer")
89
- }, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
90
- size: "sm",
91
- onClick: onClose
92
- }, closeButtonLabel))))), portalNode);
122
+ }
93
123
  });
94
124
 
95
125
  // Return a placeholder if not released and not enabled by feature flag
@@ -116,6 +146,10 @@ CoachmarkStackHome.propTypes = {
116
146
  * The description of the Coachmark.
117
147
  */
118
148
  description: _propTypes.default.node.isRequired,
149
+ /**
150
+ * If the stack home is open.
151
+ */
152
+ isOpen: _propTypes.default.bool.isRequired,
119
153
  /**
120
154
  * The object describing an image in one of two shapes.
121
155
  *
@@ -41,7 +41,7 @@ var TableContainer = _carbonComponentsReact.DataTable.TableContainer,
41
41
  Table = _carbonComponentsReact.DataTable.Table;
42
42
  var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
43
43
  var DatagridContent = function DatagridContent(_ref) {
44
- var _cx4;
44
+ var _cx5;
45
45
  var datagridState = _ref.datagridState,
46
46
  title = _ref.title;
47
47
  var _useContext = (0, _react.useContext)(_InlineEditContext.InlineEditContext),
@@ -54,8 +54,7 @@ var DatagridContent = function DatagridContent(_ref) {
54
54
  var activeCellId = inlineEditState.activeCellId,
55
55
  gridActive = inlineEditState.gridActive,
56
56
  editId = inlineEditState.editId;
57
- var _datagridState$getTab = datagridState.getTableProps,
58
- getTableProps = _datagridState$getTab === void 0 ? function () {} : _datagridState$getTab,
57
+ var getTableProps = datagridState.getTableProps,
59
58
  getFilterFlyoutProps = datagridState.getFilterFlyoutProps,
60
59
  withVirtualScroll = datagridState.withVirtualScroll,
61
60
  DatagridPagination = datagridState.DatagridPagination,
@@ -78,6 +77,7 @@ var DatagridContent = function DatagridContent(_ref) {
78
77
  state = datagridState.state,
79
78
  page = datagridState.page,
80
79
  rows = datagridState.rows;
80
+ var columnResizing = state.columnResizing;
81
81
  var contentRows = DatagridPagination && page || rows;
82
82
  var gridAreaRef = (0, _react.useRef)();
83
83
  var multiKeyTrackingRef = (0, _react.useRef)();
@@ -99,10 +99,11 @@ var DatagridContent = function DatagridContent(_ref) {
99
99
  var renderTable = function renderTable() {
100
100
  var _getTableProps;
101
101
  return /*#__PURE__*/_react.default.createElement(Table, (0, _extends2.default)({}, getTableProps(), {
102
- className: (0, _classnames.default)(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), (0, _defineProperty2.default)({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-grid-active"), gridActive), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
102
+ className: (0, _classnames.default)(withVirtualScroll ? '' : "".concat(blockClass, "__table-simple"), "".concat(blockClass, "__vertical-align-").concat(verticalAlign), (0, _defineProperty2.default)({}, "".concat(blockClass, "__variable-row-height"), variableRowHeight), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-with-inline-edit"), withInlineEdit), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-grid-active"), gridActive), (0, _defineProperty2.default)({}, "".concat(blockClass, "__table-is-resizing"), typeof columnResizing.isResizingColumn === 'string'), (_getTableProps = getTableProps()) === null || _getTableProps === void 0 ? void 0 : _getTableProps.className),
103
103
  role: withInlineEdit && 'grid',
104
104
  tabIndex: withInlineEdit && 0,
105
- onKeyDown: withInlineEdit ? function (event) {
105
+ onKeyDown: /* istanbul ignore next */
106
+ withInlineEdit && function (event) {
106
107
  return (0, _handleGridKeyPress.handleGridKeyPress)({
107
108
  event: event,
108
109
  dispatch: dispatch,
@@ -111,10 +112,10 @@ var DatagridContent = function DatagridContent(_ref) {
111
112
  state: inlineEditState,
112
113
  usingMac: usingMac
113
114
  });
114
- } : null,
115
- onFocus: withInlineEdit ? function () {
115
+ },
116
+ onFocus: withInlineEdit && function () {
116
117
  return (0, _handleGridFocus.handleGridFocus)(inlineEditState, dispatch);
117
- } : null,
118
+ },
118
119
  title: title
119
120
  }), !withVirtualScroll && /*#__PURE__*/_react.default.createElement(_DatagridHead.default, datagridState), /*#__PURE__*/_react.default.createElement(_DatagridBody.default, (0, _extends2.default)({}, datagridState, {
120
121
  rows: contentRows
@@ -143,6 +144,8 @@ var DatagridContent = function DatagridContent(_ref) {
143
144
  (0, _hooks3.useSubscribeToEventEmitter)(_constants.CLEAR_SINGLE_FILTER, function (id) {
144
145
  return (0, _FilterProvider.clearSingleFilter)(id, setAllFilters, state);
145
146
  });
147
+
148
+ /* istanbul ignore next */
146
149
  var renderFilterSummary = function renderFilterSummary() {
147
150
  return state.filters.length > 0 && /*#__PURE__*/_react.default.createElement(_FilterSummary.FilterSummary, {
148
151
  className: "".concat(blockClass, "__filter-summary"),
@@ -155,7 +158,7 @@ var DatagridContent = function DatagridContent(_ref) {
155
158
  });
156
159
  };
157
160
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(TableContainer, {
158
- className: (0, _classnames.default)("".concat(blockClass, "__grid-container"), withVirtualScroll || fullHeightDatagrid ? "".concat(blockClass, "__full-height") : '', DatagridPagination ? "".concat(blockClass, "__with-pagination") : '', useDenseHeader ? "".concat(blockClass, "__dense-header") : '', (_cx4 = {}, (0, _defineProperty2.default)(_cx4, "".concat(blockClass, "__grid-container-grid-active"), gridActive), (0, _defineProperty2.default)(_cx4, "".concat(blockClass, "__grid-container-inline-edit"), withInlineEdit), (0, _defineProperty2.default)(_cx4, "".concat(blockClass, "__grid-container-grid-active--without-toolbar"), withInlineEdit && !DatagridActions), _cx4)),
161
+ className: (0, _classnames.default)("".concat(blockClass, "__grid-container"), withVirtualScroll || fullHeightDatagrid ? "".concat(blockClass, "__full-height") : '', DatagridPagination ? "".concat(blockClass, "__with-pagination") : '', useDenseHeader ? "".concat(blockClass, "__dense-header") : '', (_cx5 = {}, (0, _defineProperty2.default)(_cx5, "".concat(blockClass, "__grid-container-grid-active"), gridActive), (0, _defineProperty2.default)(_cx5, "".concat(blockClass, "__grid-container-inline-edit"), withInlineEdit), (0, _defineProperty2.default)(_cx5, "".concat(blockClass, "__grid-container-grid-active--without-toolbar"), withInlineEdit && !DatagridActions), _cx5)),
159
162
  title: gridTitle,
160
163
  description: gridDescription
161
164
  }, /*#__PURE__*/_react.default.createElement(_DatagridToolbar.default, datagridState), /*#__PURE__*/_react.default.createElement("div", {
@@ -20,10 +20,10 @@ var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
20
20
  var DatagridExpandedRow = function DatagridExpandedRow(ExpandedRowContentComponent) {
21
21
  return function (datagridState) {
22
22
  var row = datagridState.row;
23
- var _ref = row || {},
24
- expandedContentHeight = _ref.expandedContentHeight;
23
+ var expandedContentHeight = row.expandedContentHeight;
25
24
  var toggleParentHoverClass = function toggleParentHoverClass(event, eventType) {
26
25
  var _event$target, _event$target$parentN;
26
+ /* istanbul ignore else */
27
27
  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) {
28
28
  var parentNode = event.target.parentNode.previousElementSibling;
29
29
  if (eventType === 'enter') {
@@ -44,9 +44,9 @@ var DatagridExpandedRow = function DatagridExpandedRow(ExpandedRowContentCompone
44
44
  }, /*#__PURE__*/_react.default.createElement("div", {
45
45
  className: "".concat(blockClass, "__expanded-row-content"),
46
46
  style: {
47
- height: expandedContentHeight ? expandedContentHeight : null
47
+ height: expandedContentHeight && expandedContentHeight
48
48
  }
49
- }, ExpandedRowContentComponent(datagridState)));
49
+ }, /*#__PURE__*/_react.default.createElement(ExpandedRowContentComponent, datagridState)));
50
50
  };
51
51
  };
52
52
  var _default = DatagridExpandedRow;
@@ -19,13 +19,8 @@ var _stateReducer = require("./addons/stateReducer");
19
19
  var _getNodeTextContent = require("../../../global/js/utils/getNodeTextContent");
20
20
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
21
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
- /**
23
- * Copyright IBM Corp. 2020, 2023
24
- *
25
- * This source code is licensed under the Apache-2.0 license found in the
26
- * LICENSE file in the root directory of this source tree.
27
- */
28
-
22
+ 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; }
23
+ 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) { (0, _defineProperty2.default)(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; }
29
24
  var blockClass = "".concat(_settings.pkg.prefix, "--datagrid");
30
25
  var getAccessibilityProps = function getAccessibilityProps(header) {
31
26
  var props = {};
@@ -38,35 +33,45 @@ var getAccessibilityProps = function getAccessibilityProps(header) {
38
33
  return props;
39
34
  };
40
35
  var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
36
+ var resizerAriaLabel = datagridState.resizerAriaLabel;
41
37
  // Used to measure the height of the table and uses that value
42
38
  // to display a vertical line to indicate the column you are resizing
43
39
  (0, _react.useEffect)(function () {
44
40
  var tableId = datagridState.tableId;
45
- if (tableId) {
46
- var gridElement = document.querySelector("#".concat(tableId));
47
- var tableElement = gridElement.querySelector('table');
48
- var headerRowElement = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head"));
49
- var hasHorizontalScrollbar = tableElement.scrollWidth > tableElement.clientWidth;
50
- var scrollBuffer = hasHorizontalScrollbar ? 18 : 2;
51
- var tableToolbar = gridElement.querySelector(".".concat(blockClass, "__table-toolbar"));
52
- var tableToolbarHeight = (tableToolbar === null || tableToolbar === void 0 ? void 0 : tableToolbar.offsetHeight) || 0;
53
- var setCustomValues = function setCustomValues(_ref) {
54
- var _ref$rowHeight = _ref.rowHeight,
55
- rowHeight = _ref$rowHeight === void 0 ? 48 : _ref$rowHeight,
56
- gridHeight = _ref.gridHeight;
57
- headerRowElement.style.setProperty("--".concat(blockClass, "--row-height"), (0, _layout.px)(rowHeight));
58
- headerRowElement.style.setProperty("--".concat(blockClass, "--grid-height"), (0, _layout.px)(gridHeight - scrollBuffer - tableToolbarHeight));
59
- headerRowElement.style.setProperty("--".concat(blockClass, "--header-height"), (0, _layout.px)(headerRowElement.offsetHeight));
60
- };
61
- setCustomValues({
62
- gridHeight: gridElement.offsetHeight,
63
- rowHeight: headerRowElement.clientHeight
64
- });
65
- }
41
+ var gridElement = document.querySelector("#".concat(tableId));
42
+ var tableElement = gridElement.querySelector('table');
43
+ var headerRowElement = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head"));
44
+ var hasHorizontalScrollbar = tableElement.scrollWidth > tableElement.clientWidth;
45
+ var scrollBuffer = hasHorizontalScrollbar ? 18 : 2;
46
+ var tableToolbar = gridElement.querySelector(".".concat(blockClass, "__table-toolbar"));
47
+ var tableToolbarHeight = (tableToolbar === null || tableToolbar === void 0 ? void 0 : tableToolbar.offsetHeight) || 0;
48
+ var setCustomValues = function setCustomValues(_ref) {
49
+ var _ref$rowHeight = _ref.rowHeight,
50
+ rowHeight = _ref$rowHeight === void 0 ? 48 : _ref$rowHeight,
51
+ gridHeight = _ref.gridHeight;
52
+ headerRowElement.style.setProperty("--".concat(blockClass, "--row-height"), (0, _layout.px)(rowHeight));
53
+ headerRowElement.style.setProperty("--".concat(blockClass, "--grid-height"), (0, _layout.px)(gridHeight - scrollBuffer - tableToolbarHeight));
54
+ headerRowElement.style.setProperty("--".concat(blockClass, "--header-height"), (0, _layout.px)(headerRowElement.offsetHeight));
55
+ };
56
+ setCustomValues({
57
+ gridHeight: gridElement.offsetHeight,
58
+ rowHeight: headerRowElement.clientHeight
59
+ });
66
60
  }, [datagridState.rowSize, datagridState.tableId, datagridState]);
67
61
  var _useState = (0, _react.useState)(2),
68
62
  _useState2 = (0, _slicedToArray2.default)(_useState, 1),
69
63
  incrementAmount = _useState2[0];
64
+ var handleOnMouseDownResize = function handleOnMouseDownResize(event, resizeProps) {
65
+ var _resizeProps = _objectSpread({}, resizeProps()),
66
+ onMouseDown = _resizeProps.onMouseDown;
67
+ // When event.button is 2, that is a right click
68
+ // and we do not want to resize
69
+ if (event.button === 2 || event.ctrlKey) {
70
+ event.target.blur();
71
+ return;
72
+ }
73
+ onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
74
+ };
70
75
  return /*#__PURE__*/_react.default.createElement(TableRow, (0, _extends2.default)({}, headerGroup.getHeaderGroupProps({
71
76
  role: false
72
77
  }), {
@@ -90,15 +95,19 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
90
95
  dispatch = datagridState.dispatch,
91
96
  onColResizeEnd = datagridState.onColResizeEnd;
92
97
  var columnResizing = state.columnResizing;
93
- var columnWidths = columnResizing.columnWidths;
98
+ var _ref4 = columnResizing || {},
99
+ columnWidths = _ref4.columnWidths;
94
100
  var originalCol = visibleColumns[index];
95
101
  return /*#__PURE__*/_react.default.createElement(TableHeader, (0, _extends2.default)({}, header.getHeaderProps({
96
102
  role: false
97
103
  }), {
98
- className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
104
+ className: (0, _classnames.default)((_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__header-actions-column"), header.isAction), _cx), header.getHeaderProps().className),
99
105
  key: header.id,
100
106
  "aria-hidden": header.id === 'spacer' && 'true'
101
- }, getAccessibilityProps(header)), header.render('Header'), header.getResizerProps && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, header.getResizerProps(), {
107
+ }, getAccessibilityProps(header)), header.render('Header'), header.getResizerProps && !header.isAction && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, header.getResizerProps(), {
108
+ onMouseDown: function onMouseDown(event) {
109
+ return handleOnMouseDownResize(event, header.getResizerProps);
110
+ },
102
111
  onKeyDown: function onKeyDown(event) {
103
112
  var key = event.key;
104
113
  if (key === 'ArrowLeft' || key === 'ArrowRight') {
@@ -122,7 +131,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
122
131
  className: (0, _classnames.default)("".concat(blockClass, "__col-resizer-range")),
123
132
  type: "range",
124
133
  defaultValue: originalCol.width,
125
- "aria-label": "Resize column"
134
+ "aria-label": resizerAriaLabel || 'Resize column'
126
135
  })), /*#__PURE__*/_react.default.createElement("span", {
127
136
  className: "".concat(blockClass, "__col-resize-indicator")
128
137
  })));
@@ -28,8 +28,11 @@ var DatagridRefBody = function DatagridRefBody(datagridState) {
28
28
  className: (0, _classnames.default)("".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
  };
@@ -34,7 +34,8 @@ var DatagridRow = function DatagridRow(datagridState) {
34
34
  var row = datagridState.row,
35
35
  rowSize = datagridState.rowSize,
36
36
  withNestedRows = datagridState.withNestedRows,
37
- prepareRow = datagridState.prepareRow;
37
+ prepareRow = datagridState.prepareRow,
38
+ key = datagridState.key;
38
39
  var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
39
40
  var isExpanded = _ref.isExpanded,
40
41
  subRows = _ref.subRows;
@@ -92,7 +93,9 @@ var DatagridRow = function DatagridRow(datagridState) {
92
93
  }
93
94
  };
94
95
  var rowClassNames = (0, _classnames.default)("".concat(blockClass, "__carbon-row"), (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), (0, _defineProperty2.default)(_cx, "".concat(_settings.carbon.prefix, "--data-table--selected"), row.isSelected), _cx));
95
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(TableRow, (0, _extends2.default)({
96
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
97
+ key: key
98
+ }, /*#__PURE__*/_react.default.createElement(TableRow, (0, _extends2.default)({
96
99
  className: rowClassNames
97
100
  }, row.getRowProps({
98
101
  role: false
@@ -25,6 +25,7 @@ var SelectAll = function SelectAll(datagridState) {
25
25
  windowSize = _useState2[0],
26
26
  setWindowSize = _useState2[1];
27
27
  (0, _react.useLayoutEffect)(function () {
28
+ /* istanbul ignore next */
28
29
  function updateSize() {
29
30
  setWindowSize(window.innerWidth);
30
31
  }
@@ -45,15 +46,15 @@ var SelectAll = function SelectAll(datagridState) {
45
46
  var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
46
47
  if (hideSelectAll || radio) {
47
48
  return /*#__PURE__*/_react.default.createElement("div", {
48
- className: (0, _classnames.default)("".concat(blockClass, "__head-hidden-select-all"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
49
+ className: (0, _classnames.default)("".concat(blockClass, "__head-hidden-select-all"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__select-all-sticky-left"), /* istanbul ignore next */
50
+ isFirstColumnStickyLeft && windowSize > 671))
49
51
  });
50
52
  }
51
53
  var getProps = DatagridPagination ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
52
54
  var _getProps = getProps(),
53
55
  onChange = _getProps.onChange,
54
56
  selectProps = (0, _objectWithoutProperties2.default)(_getProps, _excluded);
55
- var _ref = selectProps || {},
56
- indeterminate = _ref.indeterminate;
57
+ var indeterminate = selectProps.indeterminate;
57
58
  var handleSelectAllChange = function handleSelectAllChange(event) {
58
59
  if (indeterminate) {
59
60
  return onChange === null || onChange === void 0 ? void 0 : onChange({
@@ -65,7 +66,8 @@ var SelectAll = function SelectAll(datagridState) {
65
66
  return onChange === null || onChange === void 0 ? void 0 : onChange(event);
66
67
  };
67
68
  return /*#__PURE__*/_react.default.createElement("div", {
68
- className: (0, _classnames.default)("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
69
+ className: (0, _classnames.default)("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
70
+ isFirstColumnStickyLeft && windowSize > 671))
69
71
  }, /*#__PURE__*/_react.default.createElement(TableSelectAll, (0, _extends2.default)({}, selectProps, {
70
72
  name: "".concat(tableId, "-select-all-checkbox-name"),
71
73
  onSelect: handleSelectAllChange,
@@ -25,8 +25,11 @@ var DatagridSimpleBody = function DatagridSimpleBody(datagridState) {
25
25
  className: (0, _classnames.default)("".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
  };