@carbon/ibm-products 2.4.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. package/css/index-full-carbon.css +27 -4
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +2 -2
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +16 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +27 -4
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +2 -2
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +23 -4
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +2 -2
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/AddSelect/AddSelectRow.js +1 -1
  18. package/es/components/AddSelect/AddSelectSidebar.js +1 -1
  19. package/es/components/AddSelect/add-select-utils.js +2 -2
  20. package/es/components/Card/Card.js +11 -1
  21. package/es/components/Card/CardFooter.js +4 -2
  22. package/es/components/Card/CardHeader.js +20 -2
  23. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -2
  24. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +1 -1
  25. package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +1 -1
  26. package/es/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +4 -4
  27. package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +4 -4
  28. package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +2 -2
  29. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  30. package/es/components/Datagrid/Datagrid/DatagridRow.js +3 -3
  31. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +7 -7
  32. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +6 -6
  33. package/es/components/Datagrid/useActionsColumn.js +13 -7
  34. package/es/components/Datagrid/useDisableSelectRows.js +4 -4
  35. package/es/components/Datagrid/useInlineEdit.js +2 -2
  36. package/es/components/Datagrid/useOnRowClick.js +20 -4
  37. package/es/components/Datagrid/useSortableColumns.js +35 -3
  38. package/es/components/Datagrid/useStickyColumn.js +1 -1
  39. package/es/components/EditUpdateCards/EditUpdateCards.js +66 -4
  40. package/es/components/ExportModal/ExportModal.js +1 -1
  41. package/es/components/NotificationsPanel/NotificationsPanel.js +6 -3
  42. package/es/components/ProductiveCard/ProductiveCard.js +21 -1
  43. package/es/components/SidePanel/SidePanel.js +3 -3
  44. package/es/components/TagSet/TagSetModal.js +3 -3
  45. package/es/global/js/utils/StoryDocsPage.js +2 -2
  46. package/es/global/js/utils/Wrap.js +1 -1
  47. package/es/global/js/utils/props-helper.js +1 -1
  48. package/es/global/js/utils/story-helper.js +3 -3
  49. package/lib/components/AddSelect/AddSelectRow.js +1 -1
  50. package/lib/components/AddSelect/AddSelectSidebar.js +1 -1
  51. package/lib/components/AddSelect/add-select-utils.js +2 -2
  52. package/lib/components/Card/Card.js +11 -1
  53. package/lib/components/Card/CardFooter.js +4 -2
  54. package/lib/components/Card/CardHeader.js +20 -2
  55. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -2
  56. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +1 -1
  57. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +1 -1
  58. package/lib/components/DataSpreadsheet/utils/checkSelectedHeaderCell.js +4 -4
  59. package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +4 -4
  60. package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +2 -2
  61. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  62. package/lib/components/Datagrid/Datagrid/DatagridRow.js +3 -3
  63. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +7 -7
  64. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +6 -6
  65. package/lib/components/Datagrid/useActionsColumn.js +13 -7
  66. package/lib/components/Datagrid/useDisableSelectRows.js +4 -4
  67. package/lib/components/Datagrid/useInlineEdit.js +2 -2
  68. package/lib/components/Datagrid/useOnRowClick.js +20 -4
  69. package/lib/components/Datagrid/useSortableColumns.js +35 -3
  70. package/lib/components/Datagrid/useStickyColumn.js +1 -1
  71. package/lib/components/EditUpdateCards/EditUpdateCards.js +66 -4
  72. package/lib/components/ExportModal/ExportModal.js +1 -1
  73. package/lib/components/NotificationsPanel/NotificationsPanel.js +6 -3
  74. package/lib/components/ProductiveCard/ProductiveCard.js +21 -1
  75. package/lib/components/SidePanel/SidePanel.js +3 -3
  76. package/lib/components/TagSet/TagSetModal.js +3 -3
  77. package/lib/global/js/utils/StoryDocsPage.js +2 -2
  78. package/lib/global/js/utils/Wrap.js +1 -1
  79. package/lib/global/js/utils/props-helper.js +1 -1
  80. package/lib/global/js/utils/story-helper.js +3 -3
  81. package/package.json +11 -11
  82. package/scss/components/Datagrid/_storybook-styles.scss +5 -0
  83. package/scss/components/Datagrid/styles/_datagrid.scss +0 -8
  84. package/scss/components/EditUpdateCards/_edit-update-cards.scss +10 -0
  85. package/scss/components/ProductiveCard/_productive-card.scss +15 -0
  86. package/scss/components/Tearsheet/_tearsheet.scss +6 -0
@@ -121,7 +121,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
121
121
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.size) !== size) {
122
122
  var _sidePanelOuter$style;
123
123
  scrollableSection.scrollTop = 0;
124
- sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : (_sidePanelOuter$style = sidePanelOuter.style) === null || _sidePanelOuter$style === void 0 ? void 0 : _sidePanelOuter$style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
124
+ sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style = sidePanelOuter.style) === null || _sidePanelOuter$style === void 0 ? void 0 : _sidePanelOuter$style.setProperty("--".concat(blockClass, "--title-container-height"), "".concat(Number(initialTitleHeight), "px"));
125
125
  }
126
126
  }
127
127
  }, [currentStep, ref, size, previousState === null || previousState === void 0 ? void 0 : previousState.size]);
@@ -152,7 +152,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
152
152
  var actionsContainer = getActionsContainerElement();
153
153
  var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
154
154
  actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
155
- sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : (_sidePanelOuter$style2 = sidePanelOuter.style) === null || _sidePanelOuter$style2 === void 0 ? void 0 : _sidePanelOuter$style2.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
155
+ sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style2 = sidePanelOuter.style) === null || _sidePanelOuter$style2 === void 0 ? void 0 : _sidePanelOuter$style2.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
156
156
  }
157
157
  }, [actions, condensedActions, open, animationComplete]);
158
158
 
@@ -173,7 +173,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
173
173
  var actionsContainer = getActionsContainerElement();
174
174
  var actionsHeight = (actionsContainer === null || actionsContainer === void 0 ? void 0 : actionsContainer.offsetHeight) + 16; // add additional 1rem spacing to bottom padding
175
175
  actionsHeight = "".concat(Math.round(actionsHeight / 16), "rem");
176
- sidePanelOuter === null || sidePanelOuter === void 0 ? void 0 : (_sidePanelOuter$style3 = sidePanelOuter.style) === null || _sidePanelOuter$style3 === void 0 ? void 0 : _sidePanelOuter$style3.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
176
+ sidePanelOuter === null || sidePanelOuter === void 0 || (_sidePanelOuter$style3 = sidePanelOuter.style) === null || _sidePanelOuter$style3 === void 0 ? void 0 : _sidePanelOuter$style3.setProperty("--".concat(blockClass, "--content-bottom-padding"), actionsHeight);
177
177
  };
178
178
  var getActionsContainerElement = function getActionsContainerElement() {
179
179
  var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
@@ -53,9 +53,9 @@ export var TagSetModal = function TagSetModal(_ref) {
53
53
  } else {
54
54
  var lCaseSearch = search.toLocaleLowerCase();
55
55
  allTags.forEach(function (tag) {
56
- var _tag$dataSearch, _tag$dataSearch$toLoc, _tag$label, _tag$label$toLocaleLo;
57
- var dataSearch = (_tag$dataSearch = tag['data-search']) === null || _tag$dataSearch === void 0 ? void 0 : (_tag$dataSearch$toLoc = _tag$dataSearch.toLocaleLowerCase()) === null || _tag$dataSearch$toLoc === void 0 ? void 0 : _tag$dataSearch$toLoc.indexOf(lCaseSearch);
58
- var labelSearch = (_tag$label = tag.label) === null || _tag$label === void 0 ? void 0 : (_tag$label$toLocaleLo = _tag$label.toLocaleLowerCase()) === null || _tag$label$toLocaleLo === void 0 ? void 0 : _tag$label$toLocaleLo.indexOf(lCaseSearch);
56
+ var _tag$dataSearch, _tag$label;
57
+ var dataSearch = (_tag$dataSearch = tag['data-search']) === null || _tag$dataSearch === void 0 || (_tag$dataSearch = _tag$dataSearch.toLocaleLowerCase()) === null || _tag$dataSearch === void 0 ? void 0 : _tag$dataSearch.indexOf(lCaseSearch);
58
+ var labelSearch = (_tag$label = tag.label) === null || _tag$label === void 0 || (_tag$label = _tag$label.toLocaleLowerCase()) === null || _tag$label === void 0 ? void 0 : _tag$label.indexOf(lCaseSearch);
59
59
  if (dataSearch > -1 || labelSearch > -1) {
60
60
  newFilteredModalTags.push(tag);
61
61
  }
@@ -69,7 +69,7 @@ var processBlocks = function processBlocks(blocks, stories, omitUnreferencedStor
69
69
  * @returns
70
70
  */
71
71
  export var StoryDocsPage = function StoryDocsPage(_ref2) {
72
- var _csfFile$meta, _csfFile$meta$paramet, _processedBlocks$filt;
72
+ var _csfFile$meta, _processedBlocks$filt;
73
73
  var altTitle = _ref2.altTitle,
74
74
  altDescription = _ref2.altDescription,
75
75
  altGuidelinesHref = _ref2.altGuidelinesHref,
@@ -80,7 +80,7 @@ export var StoryDocsPage = function StoryDocsPage(_ref2) {
80
80
  csfFile = _useOf.csfFile;
81
81
  var storyInfo = storyDocsPageInfo(csfFile);
82
82
  var guidelinesHref = altGuidelinesHref !== null && altGuidelinesHref !== void 0 ? altGuidelinesHref : storyInfo.guidelinesHref;
83
- var isFullScreen = (csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 ? void 0 : (_csfFile$meta$paramet = _csfFile$meta.parameters) === null || _csfFile$meta$paramet === void 0 ? void 0 : _csfFile$meta$paramet.layout) === 'fullscreen' || false;
83
+ var isFullScreen = (csfFile === null || csfFile === void 0 || (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 || (_csfFile$meta = _csfFile$meta.parameters) === null || _csfFile$meta === void 0 ? void 0 : _csfFile$meta.layout) === 'fullscreen' || false;
84
84
  var storyHelperClass = isFullScreen ? 'c4p--story-docs-page--fullscreen' : '';
85
85
  var processedBlocks = processBlocks(blocks, csfFile.stories, omitUnreferencedStories);
86
86
  console.log(processBlocks);
@@ -22,7 +22,7 @@ var isEmpty = function isEmpty(children) {
22
22
  React.Children.forEach(children, function (child) {
23
23
  if (child) {
24
24
  var _child$type, _child$props;
25
- result && (result = (child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'Wrap' && isEmpty(child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children));
25
+ result && (result = (child === null || child === void 0 || (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) === 'Wrap' && isEmpty(child === null || child === void 0 || (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children));
26
26
  }
27
27
  });
28
28
  return result;
@@ -151,7 +151,7 @@ export var getDeprecatedArgTypes = function getDeprecatedArgTypes(deprecatedProp
151
151
  export var extractShapesArray = function extractShapesArray(items) {
152
152
  var _items$, _items$2;
153
153
  // unwrap if items or the first index looks like a React element or fragment
154
- if (items && (items !== null && items !== void 0 && (_items$ = items[0]) !== null && _items$ !== void 0 && _items$.props || (items === null || items === void 0 ? void 0 : (_items$2 = items[0]) === null || _items$2 === void 0 ? void 0 : _items$2.type) === React.Fragment || items.type === React.Fragment)) {
154
+ if (items && (items !== null && items !== void 0 && (_items$ = items[0]) !== null && _items$ !== void 0 && _items$.props || (items === null || items === void 0 || (_items$2 = items[0]) === null || _items$2 === void 0 ? void 0 : _items$2.type) === React.Fragment || items.type === React.Fragment)) {
155
155
  var unwrappedItems = unwrapIfFragment(items);
156
156
  return unwrappedItems.map(function (item) {
157
157
  return _objectSpread({
@@ -107,7 +107,7 @@ StackblitzLink.propTypes = {
107
107
  };
108
108
  export var palUsageHref = function palUsageHref(csfFile) {
109
109
  var _csfFile$meta;
110
- var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 ? void 0 : _csfFile$meta.title;
110
+ var title = csfFile === null || csfFile === void 0 || (_csfFile$meta = csfFile.meta) === null || _csfFile$meta === void 0 ? void 0 : _csfFile$meta.title;
111
111
  var _title$split = title.split('/'),
112
112
  _title$split2 = _slicedToArray(_title$split, 3),
113
113
  _pkg = _title$split2[0],
@@ -119,7 +119,7 @@ export var palUsageHref = function palUsageHref(csfFile) {
119
119
  };
120
120
  export var storyDocsPageTitle = function storyDocsPageTitle(csfFile) {
121
121
  var _csfFile$meta2;
122
- var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta2 = csfFile.meta) === null || _csfFile$meta2 === void 0 ? void 0 : _csfFile$meta2.title;
122
+ var title = csfFile === null || csfFile === void 0 || (_csfFile$meta2 = csfFile.meta) === null || _csfFile$meta2 === void 0 ? void 0 : _csfFile$meta2.title;
123
123
  var _title$split3 = title.split('/'),
124
124
  _title$split4 = _toArray(_title$split3),
125
125
  _pkg = _title$split4[0],
@@ -148,7 +148,7 @@ export var storyDocsPageTitle = function storyDocsPageTitle(csfFile) {
148
148
  };
149
149
  export var storyDocsPageInfo = function storyDocsPageInfo(csfFile) {
150
150
  var _csfFile$meta3;
151
- var title = csfFile === null || csfFile === void 0 ? void 0 : (_csfFile$meta3 = csfFile.meta) === null || _csfFile$meta3 === void 0 ? void 0 : _csfFile$meta3.title;
151
+ var title = csfFile === null || csfFile === void 0 || (_csfFile$meta3 = csfFile.meta) === null || _csfFile$meta3 === void 0 ? void 0 : _csfFile$meta3.title;
152
152
  var _title$split5 = title.split('/'),
153
153
  _title$split6 = _toArray(_title$split5),
154
154
  pkg = _title$split6[0],
@@ -127,7 +127,7 @@ var AddSelectRow = function AddSelectRow(_ref) {
127
127
  var isInMetaPanel = function isInMetaPanel(id) {
128
128
  return id === (displayMetalPanel === null || displayMetalPanel === void 0 ? void 0 : displayMetalPanel.id);
129
129
  };
130
- var hasModifiers = (modifiers === null || modifiers === void 0 ? void 0 : (_modifiers$options = modifiers.options) === null || _modifiers$options === void 0 ? void 0 : _modifiers$options.length) > 0;
130
+ var hasModifiers = (modifiers === null || modifiers === void 0 || (_modifiers$options = modifiers.options) === null || _modifiers$options === void 0 ? void 0 : _modifiers$options.length) > 0;
131
131
  var tabIndex = getTabIndex();
132
132
  var selected = isSelected();
133
133
  var expanded = parentSelected === item.id;
@@ -34,7 +34,7 @@ var AddSelectSidebar = function AddSelectSidebar(_ref) {
34
34
  noSelectionDescription = _ref.noSelectionDescription,
35
35
  noSelectionTitle = _ref.noSelectionTitle,
36
36
  setDisplayMetaPanel = _ref.setDisplayMetaPanel;
37
- var hasModifiers = (modifiers === null || modifiers === void 0 ? void 0 : (_modifiers$options = modifiers.options) === null || _modifiers$options === void 0 ? void 0 : _modifiers$options.length) > 0;
37
+ var hasModifiers = (modifiers === null || modifiers === void 0 || (_modifiers$options = modifiers.options) === null || _modifiers$options === void 0 ? void 0 : _modifiers$options.length) > 0;
38
38
  var hasSelections = multiSelection.length > 0;
39
39
  var getNewItem = function getNewItem(item) {
40
40
  // certain properties should not be displayed in the sidebar
@@ -114,14 +114,14 @@ var getFilteredItems = function getFilteredItems(useNormalizedItems, normalizedI
114
114
  */
115
115
  if (path.length > 1) {
116
116
  return path.reduce(function (prev, cur, curIdx) {
117
- var _prev$find, _prev$find$children;
117
+ var _prev$find;
118
118
  // because the root of the path never changes we can skip it
119
119
  if (curIdx === 0) {
120
120
  return prev;
121
121
  }
122
122
  var item = (_prev$find = prev.find(function (item) {
123
123
  return item.id === cur.id;
124
- })) === null || _prev$find === void 0 ? void 0 : (_prev$find$children = _prev$find.children) === null || _prev$find$children === void 0 ? void 0 : _prev$find$children.entries;
124
+ })) === null || _prev$find === void 0 || (_prev$find = _prev$find.children) === null || _prev$find === void 0 ? void 0 : _prev$find.entries;
125
125
  return item;
126
126
  }, items.entries);
127
127
  }
@@ -16,7 +16,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
16
16
  var _CardHeader = require("./CardHeader");
17
17
  var _CardFooter = require("./CardFooter");
18
18
  var _settings = require("../../settings");
19
- var _excluded = ["actionIcons", "actionsPlacement", "children", "className", "clickZone", "description", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonText", "title", "titleSize"],
19
+ var _excluded = ["actionIcons", "actionsPlacement", "children", "className", "clickZone", "description", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "overflowAriaLabel", "onSecondaryButtonClick", "pictogram", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonPlacement", "primaryButtonText", "productive", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonPlacement", "secondaryButtonText", "title", "titleSize"],
20
20
  _excluded2 = ["id"],
21
21
  _excluded3 = ["id", "icon", "onClick", "iconDescription", "href"]; //
22
22
  // Copyright IBM Corp. 2020, 2023
@@ -41,6 +41,7 @@ var defaults = {
41
41
  primaryButtonPlacement: 'bottom',
42
42
  productive: false,
43
43
  secondaryButtonKind: 'secondary',
44
+ secondaryButtonPlacement: 'bottom',
44
45
  titleSize: 'default'
45
46
  };
46
47
  var Card = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
@@ -78,6 +79,8 @@ var Card = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
78
79
  secondaryButtonIcon = _ref.secondaryButtonIcon,
79
80
  _ref$secondaryButtonK = _ref.secondaryButtonKind,
80
81
  secondaryButtonKind = _ref$secondaryButtonK === void 0 ? defaults.secondaryButtonKind : _ref$secondaryButtonK,
82
+ _ref$secondaryButtonP = _ref.secondaryButtonPlacement,
83
+ secondaryButtonPlacement = _ref$secondaryButtonP === void 0 ? defaults.secondaryButtonPlacement : _ref$secondaryButtonP,
81
84
  secondaryButtonText = _ref.secondaryButtonText,
82
85
  title = _ref.title,
83
86
  _ref$titleSize = _ref.titleSize,
@@ -182,12 +185,17 @@ var Card = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
182
185
  noActionIcons: actionIcons.length > 0 && actionsPlacement === 'top' ? false : true,
183
186
  actionsPlacement: actionsPlacement,
184
187
  onPrimaryButtonClick: onPrimaryButtonClick,
188
+ onSecondaryButtonClick: onSecondaryButtonClick,
185
189
  primaryButtonIcon: primaryButtonIcon,
186
190
  primaryButtonPlacement: primaryButtonPlacement,
187
191
  primaryButtonText: primaryButtonText,
188
192
  description: description,
189
193
  hasActions: hasActions,
190
194
  label: label,
195
+ secondaryButtonHref: secondaryButtonHref,
196
+ secondaryButtonIcon: secondaryButtonIcon,
197
+ secondaryButtonPlacement: secondaryButtonPlacement,
198
+ secondaryButtonText: secondaryButtonText,
191
199
  title: title,
192
200
  titleSize: titleSize
193
201
  };
@@ -216,6 +224,7 @@ var Card = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
216
224
  secondaryButtonHref: secondaryButtonHref,
217
225
  secondaryButtonIcon: secondaryButtonIcon,
218
226
  secondaryButtonKind: secondaryButtonKind,
227
+ secondaryButtonPlacement: secondaryButtonPlacement,
219
228
  secondaryButtonText: secondaryButtonText
220
229
  };
221
230
  };
@@ -266,6 +275,7 @@ Card.propTypes = {
266
275
  secondaryButtonHref: _propTypes.default.string,
267
276
  secondaryButtonIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
268
277
  secondaryButtonKind: _propTypes.default.oneOf(['secondary', 'ghost']),
278
+ secondaryButtonPlacement: _propTypes.default.oneOf(['top', 'bottom']),
269
279
  secondaryButtonText: _propTypes.default.string,
270
280
  title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.node]),
271
281
  titleSize: _propTypes.default.oneOf(['default', 'large'])
@@ -44,14 +44,15 @@ var CardFooter = function CardFooter(_ref) {
44
44
  secondaryButtonIcon = _ref.secondaryButtonIcon,
45
45
  _ref$secondaryButtonK = _ref.secondaryButtonKind,
46
46
  secondaryButtonKind = _ref$secondaryButtonK === void 0 ? defaults.secondaryButtonKind : _ref$secondaryButtonK,
47
+ secondaryButtonPlacement = _ref.secondaryButtonPlacement,
47
48
  secondaryButtonText = _ref.secondaryButtonText;
48
49
  var blockClass = "".concat(_settings.pkg.prefix, "--card");
49
50
  var footerClass = "".concat(_settings.pkg.prefix, "--card__footer");
50
51
  var footerClasses = (0, _classnames.default)(footerClass, (0, _defineProperty2.default)({}, "".concat(footerClass, "-no-button"), !hasButton));
51
52
  return /*#__PURE__*/_react.default.createElement("div", {
52
53
  className: footerClasses
53
- }, secondaryButtonText && /*#__PURE__*/_react.default.createElement(_react2.Button, {
54
- kind: secondaryButtonKind,
54
+ }, secondaryButtonText && secondaryButtonPlacement === 'bottom' && /*#__PURE__*/_react.default.createElement(_react2.Button, {
55
+ kind: productive ? 'ghost' : secondaryButtonKind,
55
56
  onClick: onSecondaryButtonClick,
56
57
  size: "md",
57
58
  renderIcon: secondaryButtonIcon,
@@ -82,6 +83,7 @@ CardFooter.propTypes = {
82
83
  secondaryButtonHref: _propTypes.default.string,
83
84
  secondaryButtonIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
84
85
  secondaryButtonKind: _propTypes.default.oneOf(['secondary', 'ghost']),
86
+ secondaryButtonPlacement: _propTypes.default.oneOf(['top', 'bottom']),
85
87
  secondaryButtonText: _propTypes.default.string
86
88
  };
87
89
  CardFooter.displayName = componentName;
@@ -28,6 +28,7 @@ var CardHeader = function CardHeader(_ref) {
28
28
  var actions = _ref.actions,
29
29
  noActionIcons = _ref.noActionIcons,
30
30
  onPrimaryButtonClick = _ref.onPrimaryButtonClick,
31
+ onSecondaryButtonClick = _ref.onSecondaryButtonClick,
31
32
  primaryButtonIcon = _ref.primaryButtonIcon,
32
33
  primaryButtonPlacement = _ref.primaryButtonPlacement,
33
34
  primaryButtonText = _ref.primaryButtonText,
@@ -35,6 +36,10 @@ var CardHeader = function CardHeader(_ref) {
35
36
  _ref$hasActions = _ref.hasActions,
36
37
  hasActions = _ref$hasActions === void 0 ? defaults.hasActions : _ref$hasActions,
37
38
  label = _ref.label,
39
+ secondaryButtonHref = _ref.secondaryButtonHref,
40
+ secondaryButtonIcon = _ref.secondaryButtonIcon,
41
+ secondaryButtonPlacement = _ref.secondaryButtonPlacement,
42
+ secondaryButtonText = _ref.secondaryButtonText,
38
43
  title = _ref.title,
39
44
  _ref$titleSize = _ref.titleSize,
40
45
  titleSize = _ref$titleSize === void 0 ? defaults.titleSize : _ref$titleSize;
@@ -57,9 +62,16 @@ var CardHeader = function CardHeader(_ref) {
57
62
  className: "".concat(blockClass, "__description")
58
63
  }, description)), hasActions && /*#__PURE__*/_react.default.createElement("div", {
59
64
  className: "".concat(blockClass, "__actions ").concat(blockClass, "__actions-header")
60
- }, actions, primaryButtonText && primaryButtonPlacement === 'top' && /*#__PURE__*/_react.default.createElement(_react2.Button, {
65
+ }, actions, secondaryButtonText && secondaryButtonPlacement === 'top' && /*#__PURE__*/_react.default.createElement(_react2.Button, {
61
66
  kind: "ghost",
62
- size: "small",
67
+ onClick: onSecondaryButtonClick,
68
+ size: "sm",
69
+ renderIcon: secondaryButtonIcon,
70
+ href: secondaryButtonHref,
71
+ className: actionGhostButtonClass
72
+ }, secondaryButtonText), primaryButtonText && primaryButtonPlacement === 'top' && /*#__PURE__*/_react.default.createElement(_react2.Button, {
73
+ kind: "ghost",
74
+ size: "sm",
63
75
  renderIcon: primaryButtonIcon,
64
76
  onClick: onPrimaryButtonClick,
65
77
  className: actionGhostButtonClass
@@ -73,9 +85,15 @@ CardHeader.propTypes = {
73
85
  label: _propTypes.default.string,
74
86
  noActionIcons: _propTypes.default.bool,
75
87
  onPrimaryButtonClick: _propTypes.default.func,
88
+ onSecondaryButtonClick: _propTypes.default.func,
76
89
  primaryButtonIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
77
90
  primaryButtonPlacement: _propTypes.default.oneOf(['top', 'bottom']),
78
91
  primaryButtonText: _propTypes.default.string,
92
+ secondaryButtonHref: _propTypes.default.string,
93
+ secondaryButtonIcon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
94
+ secondaryButtonKind: _propTypes.default.oneOf(['secondary', 'ghost']),
95
+ secondaryButtonPlacement: _propTypes.default.oneOf(['top', 'bottom']),
96
+ secondaryButtonText: _propTypes.default.string,
79
97
  title: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.node]),
80
98
  titleSize: _propTypes.default.oneOf(['default', 'large'])
81
99
  };
@@ -86,7 +86,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
86
86
  (0, _react.useEffect)(function () {
87
87
  if (selectionAreaData.length) {
88
88
  var _previousState$select;
89
- if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || (previousState === null || previousState === void 0 ? void 0 : (_previousState$select = previousState.selectionAreaData) === null || _previousState$select === void 0 ? void 0 : _previousState$select.length) !== (selectionAreaData === null || selectionAreaData === void 0 ? void 0 : selectionAreaData.length)) {
89
+ if (!clickAndHoldActive && previousState !== null && previousState !== void 0 && previousState.clickAndHoldActive || (previousState === null || previousState === void 0 || (_previousState$select = previousState.selectionAreaData) === null || _previousState$select === void 0 ? void 0 : _previousState$select.length) !== (selectionAreaData === null || selectionAreaData === void 0 ? void 0 : selectionAreaData.length)) {
90
90
  onSelectionAreaChange(selectionAreaData);
91
91
  }
92
92
  }
@@ -396,7 +396,7 @@ var DataSpreadsheetBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
396
396
  role: "gridcell",
397
397
  style: _objectSpread(_objectSpread({}, cell.getCellProps().style), {}, {
398
398
  display: 'grid',
399
- minWidth: (cell === null || cell === void 0 ? void 0 : (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
399
+ minWidth: (cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
400
400
  })
401
401
  }), /*#__PURE__*/_react.default.createElement("button", {
402
402
  id: "".concat(blockClass, "__cell--").concat(cell.row.index, "--").concat(index),
@@ -65,7 +65,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
65
65
  (0, _react.useEffect)(function () {
66
66
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.cellSize) !== cellSize) {
67
67
  var _ref$current;
68
- var scrollContainer = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(blockClass, "__list--container"));
68
+ var scrollContainer = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(blockClass, "__list--container"));
69
69
  var hasScrollBar = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) > (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight);
70
70
  var scrollBarValue = hasScrollBar ? 0 : scrollBarSize;
71
71
  setScrollBarSizeValue(scrollBarValue);
@@ -54,7 +54,7 @@ var useSpreadsheetEdit = function useSpreadsheetEdit(_ref) {
54
54
  cellEditorRef.current.style.display = 'block';
55
55
  cellEditorRef.current.style.height = activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height;
56
56
  cellEditorRef.current.style.paddingTop = "".concat((parseInt(activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height) - 16) / 2 - 1, "px"); // calculate paddingTop based on cellHeight which could be variable depending on the cellSize prop
57
- cellEditorRef.current.style.textAlign = (cellProps === null || cellProps === void 0 ? void 0 : (_cellProps$column = cellProps.column) === null || _cellProps$column === void 0 ? void 0 : _cellProps$column.placement) === 'right' ? 'right' : 'left';
57
+ cellEditorRef.current.style.textAlign = (cellProps === null || cellProps === void 0 || (_cellProps$column = cellProps.column) === null || _cellProps$column === void 0 ? void 0 : _cellProps$column.placement) === 'right' ? 'right' : 'left';
58
58
  (_cellEditorRef$curren = cellEditorRef.current) === null || _cellEditorRef$curren === void 0 ? void 0 : _cellEditorRef$curren.focus();
59
59
  if (rulerWidth < cellEditorCurrentWidth) {
60
60
  var _visibleColumns$nextI;
@@ -17,10 +17,10 @@ var checkSelectedHeaderCell = function checkSelectedHeaderCell(headerIndex, sele
17
17
  var isSelectedHeader = areasCloned.some(function (area) {
18
18
  var _area$point, _area$point2, _area$point3, _area$point4, _area$point5, _area$point6, _area$point7, _area$point8;
19
19
  var oppositeType = headerType === 'column' ? 'row' : 'column';
20
- var minOppositeSelection = Math.min(area === null || area === void 0 ? void 0 : (_area$point = area.point1) === null || _area$point === void 0 ? void 0 : _area$point[oppositeType], area === null || area === void 0 ? void 0 : (_area$point2 = area.point2) === null || _area$point2 === void 0 ? void 0 : _area$point2[oppositeType]);
21
- var maxOppositeSelection = Math.max(area === null || area === void 0 ? void 0 : (_area$point3 = area.point1) === null || _area$point3 === void 0 ? void 0 : _area$point3[oppositeType], area === null || area === void 0 ? void 0 : (_area$point4 = area.point2) === null || _area$point4 === void 0 ? void 0 : _area$point4[oppositeType]);
22
- var minSelection = Math.min(area === null || area === void 0 ? void 0 : (_area$point5 = area.point1) === null || _area$point5 === void 0 ? void 0 : _area$point5[headerType], area === null || area === void 0 ? void 0 : (_area$point6 = area.point2) === null || _area$point6 === void 0 ? void 0 : _area$point6[headerType]);
23
- var maxSelection = Math.max(area === null || area === void 0 ? void 0 : (_area$point7 = area.point1) === null || _area$point7 === void 0 ? void 0 : _area$point7[headerType], area === null || area === void 0 ? void 0 : (_area$point8 = area.point2) === null || _area$point8 === void 0 ? void 0 : _area$point8[headerType]);
20
+ var minOppositeSelection = Math.min(area === null || area === void 0 || (_area$point = area.point1) === null || _area$point === void 0 ? void 0 : _area$point[oppositeType], area === null || area === void 0 || (_area$point2 = area.point2) === null || _area$point2 === void 0 ? void 0 : _area$point2[oppositeType]);
21
+ var maxOppositeSelection = Math.max(area === null || area === void 0 || (_area$point3 = area.point1) === null || _area$point3 === void 0 ? void 0 : _area$point3[oppositeType], area === null || area === void 0 || (_area$point4 = area.point2) === null || _area$point4 === void 0 ? void 0 : _area$point4[oppositeType]);
22
+ var minSelection = Math.min(area === null || area === void 0 || (_area$point5 = area.point1) === null || _area$point5 === void 0 ? void 0 : _area$point5[headerType], area === null || area === void 0 || (_area$point6 = area.point2) === null || _area$point6 === void 0 ? void 0 : _area$point6[headerType]);
23
+ var maxSelection = Math.max(area === null || area === void 0 || (_area$point7 = area.point1) === null || _area$point7 === void 0 ? void 0 : _area$point7[headerType], area === null || area === void 0 || (_area$point8 = area.point2) === null || _area$point8 === void 0 ? void 0 : _area$point8[headerType]);
24
24
  var isTrueSelectedState = (items === null || items === void 0 ? void 0 : items.length) - 1 === maxOppositeSelection && minOppositeSelection === 0;
25
25
  // console.log({minSelection, maxSelection});
26
26
  // Iterate over all columns included in the selection area
@@ -32,10 +32,10 @@ var handleCellDeletion = function handleCellDeletion(_ref) {
32
32
  return item.matcher === currentMatcher;
33
33
  });
34
34
  var selectionAreaToEmptyContents = selectionAreaClone[indexOfCurrentSelectionArea];
35
- var lowestColumnIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty === void 0 ? void 0 : _selectionAreaToEmpty.column, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty2 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty2 === void 0 ? void 0 : _selectionAreaToEmpty2.column);
36
- var greatestColumnIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty3 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty3 === void 0 ? void 0 : _selectionAreaToEmpty3.column, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty4 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty4 === void 0 ? void 0 : _selectionAreaToEmpty4.column);
37
- var lowestRowIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty5 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty5 === void 0 ? void 0 : _selectionAreaToEmpty5.row, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty6 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty6 === void 0 ? void 0 : _selectionAreaToEmpty6.row);
38
- var greatestRowIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty7 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty7 === void 0 ? void 0 : _selectionAreaToEmpty7.row, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 ? void 0 : (_selectionAreaToEmpty8 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty8 === void 0 ? void 0 : _selectionAreaToEmpty8.row);
35
+ var lowestColumnIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty === void 0 ? void 0 : _selectionAreaToEmpty.column, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty2 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty2 === void 0 ? void 0 : _selectionAreaToEmpty2.column);
36
+ var greatestColumnIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty3 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty3 === void 0 ? void 0 : _selectionAreaToEmpty3.column, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty4 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty4 === void 0 ? void 0 : _selectionAreaToEmpty4.column);
37
+ var lowestRowIndex = Math.min(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty5 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty5 === void 0 ? void 0 : _selectionAreaToEmpty5.row, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty6 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty6 === void 0 ? void 0 : _selectionAreaToEmpty6.row);
38
+ var greatestRowIndex = Math.max(selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty7 = selectionAreaToEmptyContents.point1) === null || _selectionAreaToEmpty7 === void 0 ? void 0 : _selectionAreaToEmpty7.row, selectionAreaToEmptyContents === null || selectionAreaToEmptyContents === void 0 || (_selectionAreaToEmpty8 = selectionAreaToEmptyContents.point2) === null || _selectionAreaToEmpty8 === void 0 ? void 0 : _selectionAreaToEmpty8.row);
39
39
  (0, _rangeWithCallback.rangeWithCallback)(lowestColumnIndex, greatestColumnIndex, function (columnIndex) {
40
40
  (0, _rangeWithCallback.rangeWithCallback)(lowestRowIndex, greatestRowIndex, function (rowIndex) {
41
41
  var cellProps = rows[rowIndex].cells[columnIndex];
@@ -98,7 +98,7 @@ var handleHeaderCellSelection = function handleHeaderCellSelection(_ref2) {
98
98
  return [].concat((0, _toConsumableArray2.default)(prev), [newSelectionArea]);
99
99
  }
100
100
  if (isHoldingShiftKey) {
101
- var _selectionAreasClone$, _selectionAreasClone$2;
101
+ var _selectionAreasClone$;
102
102
  var _selectionsFromHeaderCell = selectionsClone.filter(function (item) {
103
103
  var _item$header3;
104
104
  return (_item$header3 = item.header) === null || _item$header3 === void 0 ? void 0 : _item$header3.type;
@@ -118,7 +118,7 @@ var handleHeaderCellSelection = function handleHeaderCellSelection(_ref2) {
118
118
  return item.matcher === currentMatcher;
119
119
  });
120
120
  var newIndexList = getSelectedItemIndexList({
121
- indexList: ((_selectionAreasClone$ = selectionAreasClone[indexOfCurrentArea]) === null || _selectionAreasClone$ === void 0 ? void 0 : (_selectionAreasClone$2 = _selectionAreasClone$.header) === null || _selectionAreasClone$2 === void 0 ? void 0 : _selectionAreasClone$2.selectedIndexList) || [type === 'column' ? columnValue : rowValue],
121
+ indexList: ((_selectionAreasClone$ = selectionAreasClone[indexOfCurrentArea]) === null || _selectionAreasClone$ === void 0 || (_selectionAreasClone$ = _selectionAreasClone$.header) === null || _selectionAreasClone$ === void 0 ? void 0 : _selectionAreasClone$.selectedIndexList) || [type === 'column' ? columnValue : rowValue],
122
122
  newIndex: newIndexValue,
123
123
  activeCellIndex: activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates[type]
124
124
  });
@@ -42,7 +42,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
42
42
  return /*#__PURE__*/_react.default.createElement(_react2.TableHeader, (0, _extends2.default)({}, header.getHeaderProps({
43
43
  role: false
44
44
  }), {
45
- 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"), header.canSort), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
45
+ 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), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
46
46
  key: header.id
47
47
  }), header.render('Header'), header.getResizerProps && /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, header.getResizerProps(), {
48
48
  className: "".concat(blockClass, "__resizer")
@@ -58,9 +58,9 @@ var DatagridRow = function DatagridRow(datagridState) {
58
58
  hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.classList.add("".concat(blockClass, "__carbon-row-expanded-hover-active"));
59
59
  var rowExpanderButton = hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.querySelector(".".concat(blockClass, "__row-expander"));
60
60
  var rowSizeValue = rowSize || 'lg';
61
- hoverRow === null || hoverRow === void 0 ? void 0 : (_hoverRow$style = hoverRow.style) === null || _hoverRow$style === void 0 ? void 0 : _hoverRow$style.setProperty("--".concat(blockClass, "--indicator-height"), totalNestedRowIndicatorHeight);
62
- hoverRow === null || hoverRow === void 0 ? void 0 : (_hoverRow$style2 = hoverRow.style) === null || _hoverRow$style2 === void 0 ? void 0 : _hoverRow$style2.setProperty("--".concat(blockClass, "--row-height"), (0, _layout.px)(rowHeights[rowSizeValue]));
63
- hoverRow === null || hoverRow === void 0 ? void 0 : (_hoverRow$style3 = hoverRow.style) === null || _hoverRow$style3 === void 0 ? void 0 : _hoverRow$style3.setProperty("--".concat(blockClass, "--indicator-offset-amount"), (0, _layout.px)((rowExpanderButton === null || rowExpanderButton === void 0 ? void 0 : rowExpanderButton.offsetLeft) || 0));
61
+ hoverRow === null || hoverRow === void 0 || (_hoverRow$style = hoverRow.style) === null || _hoverRow$style === void 0 ? void 0 : _hoverRow$style.setProperty("--".concat(blockClass, "--indicator-height"), totalNestedRowIndicatorHeight);
62
+ hoverRow === null || hoverRow === void 0 || (_hoverRow$style2 = hoverRow.style) === null || _hoverRow$style2 === void 0 ? void 0 : _hoverRow$style2.setProperty("--".concat(blockClass, "--row-height"), (0, _layout.px)(rowHeights[rowSizeValue]));
63
+ hoverRow === null || hoverRow === void 0 || (_hoverRow$style3 = hoverRow.style) === null || _hoverRow$style3 === void 0 ? void 0 : _hoverRow$style3.setProperty("--".concat(blockClass, "--indicator-offset-amount"), (0, _layout.px)((rowExpanderButton === null || rowExpanderButton === void 0 ? void 0 : rowExpanderButton.offsetLeft) || 0));
64
64
  };
65
65
  var focusRemover = function focusRemover() {
66
66
  var elements = document.querySelectorAll(".".concat(blockClass, "__carbon-row-expanded"));
@@ -39,17 +39,17 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
39
39
  }).filter(function (colDef) {
40
40
  return !colDef.isAction;
41
41
  }).filter(function (colDef) {
42
- var _colDef$Header$props$2, _colDef$Header$props2, _colDef$Header$props3;
42
+ var _colDef$Header$props$2, _colDef$Header$props2;
43
43
  var sortableTitle = isTableSortable && ((_colDef$Header$props$2 = colDef.Header().props.children.props) === null || _colDef$Header$props$2 === void 0 ? void 0 : _colDef$Header$props$2.title);
44
- return filterString.length === 0 || (isTableSortable ? sortableTitle === null || sortableTitle === void 0 ? void 0 : sortableTitle.toLowerCase().includes(filterString) : (_colDef$Header$props2 = colDef.Header.props) === null || _colDef$Header$props2 === void 0 ? void 0 : (_colDef$Header$props3 = _colDef$Header$props2.title) === null || _colDef$Header$props3 === void 0 ? void 0 : _colDef$Header$props3.toLowerCase().includes(filterString)) && colDef.id !== 'spacer';
44
+ return filterString.length === 0 || (isTableSortable ? sortableTitle === null || sortableTitle === void 0 ? void 0 : sortableTitle.toLowerCase().includes(filterString) : (_colDef$Header$props2 = colDef.Header.props) === null || _colDef$Header$props2 === void 0 || (_colDef$Header$props2 = _colDef$Header$props2.title) === null || _colDef$Header$props2 === void 0 ? void 0 : _colDef$Header$props2.toLowerCase().includes(filterString)) && colDef.id !== 'spacer';
45
45
  }).map(function (colDef, i) {
46
- var _colDef$Header$props$3, _colDef$Header$props4, _colDef$Header$props5, _colDef$Header$props6, _colDef$Header$props7;
46
+ var _colDef$Header$props$3, _colDef$Header$props3, _colDef$Header$props4, _colDef$Header$props5, _colDef$Header$props6;
47
47
  var isSortableColumn = !!colDef.canSort && !!isTableSortable;
48
48
  var sortableTitle = isTableSortable && ((_colDef$Header$props$3 = colDef.Header().props.children.props) === null || _colDef$Header$props$3 === void 0 ? void 0 : _colDef$Header$props$3.title);
49
49
  var searchString = new RegExp('(' + filterString + ')');
50
50
  var res = filterString.length ? isSortableColumn ? sortableTitle.toLowerCase().split(searchString) : colDef.Header.props.title.toLowerCase().split(searchString) : null;
51
51
  var firstWord = res !== null ? res[0] === '' ? res[1].charAt(0).toUpperCase() + res[1].substring(1) : res[0].charAt(0).toUpperCase() + res[0].substring(1) : null;
52
- var highlightedText = res !== null ? res[0] === '' ? "<strong>".concat(firstWord, "</strong>") + res[2] : firstWord + "<strong>".concat(res[1], "</strong>") + res[2] : isSortableColumn ? sortableTitle : (_colDef$Header$props4 = colDef.Header.props) === null || _colDef$Header$props4 === void 0 ? void 0 : _colDef$Header$props4.title;
52
+ var highlightedText = res !== null ? res[0] === '' ? "<strong>".concat(firstWord, "</strong>") + res[2] : firstWord + "<strong>".concat(res[1], "</strong>") + res[2] : isSortableColumn ? sortableTitle : (_colDef$Header$props3 = colDef.Header.props) === null || _colDef$Header$props3 === void 0 ? void 0 : _colDef$Header$props3.title;
53
53
  var isFrozenColumn = !!colDef.sticky;
54
54
  var listContents = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_react2.Checkbox, {
55
55
  wrapperClassName: "".concat(blockClass, "__customize-columns-checkbox-wrapper"),
@@ -60,8 +60,8 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
60
60
  return onSelectColumn(colDef, checked);
61
61
  },
62
62
  id: "".concat(blockClass, "__customization-column-").concat(colDef.id),
63
- labelText: isSortableColumn ? sortableTitle : (_colDef$Header$props5 = colDef.Header.props) === null || _colDef$Header$props5 === void 0 ? void 0 : _colDef$Header$props5.title,
64
- title: isSortableColumn ? sortableTitle : (_colDef$Header$props6 = colDef.Header.props) === null || _colDef$Header$props6 === void 0 ? void 0 : _colDef$Header$props6.title,
63
+ labelText: isSortableColumn ? sortableTitle : (_colDef$Header$props4 = colDef.Header.props) === null || _colDef$Header$props4 === void 0 ? void 0 : _colDef$Header$props4.title,
64
+ title: isSortableColumn ? sortableTitle : (_colDef$Header$props5 = colDef.Header.props) === null || _colDef$Header$props5 === void 0 ? void 0 : _colDef$Header$props5.title,
65
65
  className: "".concat(blockClass, "__customize-columns-checkbox"),
66
66
  hideLabel: true
67
67
  }), /*#__PURE__*/_react.default.createElement("div", {
@@ -78,7 +78,7 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
78
78
  id: "dnd-datagrid-columns-".concat(colDef.id),
79
79
  type: "column-customization",
80
80
  disabled: filterString.length > 0 || isFrozenColumn,
81
- ariaLabel: isSortableColumn ? sortableTitle : (_colDef$Header$props7 = colDef.Header.props) === null || _colDef$Header$props7 === void 0 ? void 0 : _colDef$Header$props7.title,
81
+ ariaLabel: isSortableColumn ? sortableTitle : (_colDef$Header$props6 = colDef.Header.props) === null || _colDef$Header$props6 === void 0 ? void 0 : _colDef$Header$props6.title,
82
82
  onGrab: setAriaRegionText,
83
83
  isFocused: focusIndex === i,
84
84
  moveElement: moveElement,
@@ -294,7 +294,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
294
294
  });
295
295
  setInEditMode(false);
296
296
  sendFocusBackToGrid();
297
- inputProps === null || inputProps === void 0 ? void 0 : (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 ? void 0 : _inputProps$onChange.call(inputProps, item.selectedItem);
297
+ inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 ? void 0 : _inputProps$onChange.call(inputProps, item.selectedItem);
298
298
  },
299
299
  downshiftProps: {
300
300
  onStateChange: function onStateChange(downshiftState) {
@@ -332,9 +332,9 @@ var InlineEditCell = function InlineEditCell(_ref) {
332
332
  var renderDateCell = function renderDateCell() {
333
333
  var _config$inputProps, _outerButtonElement$c;
334
334
  var datePickerPreparedProps = (0, _propsHelper.prepareProps)(config.inputProps, ['datePickerInputProps']);
335
- var datePickerInputProps = config === null || config === void 0 ? void 0 : (_config$inputProps = config.inputProps) === null || _config$inputProps === void 0 ? void 0 : _config$inputProps.datePickerInputProps;
335
+ var datePickerInputProps = config === null || config === void 0 || (_config$inputProps = config.inputProps) === null || _config$inputProps === void 0 ? void 0 : _config$inputProps.datePickerInputProps;
336
336
  return /*#__PURE__*/_react.default.createElement(_react2.DatePicker, (0, _extends2.default)({}, datePickerPreparedProps, {
337
- appendTo: outerButtonElement === null || outerButtonElement === void 0 ? void 0 : (_outerButtonElement$c = outerButtonElement.current) === null || _outerButtonElement$c === void 0 ? void 0 : _outerButtonElement$c.parentElement,
337
+ appendTo: outerButtonElement === null || outerButtonElement === void 0 || (_outerButtonElement$c = outerButtonElement.current) === null || _outerButtonElement$c === void 0 ? void 0 : _outerButtonElement$c.parentElement,
338
338
  ref: datePickerRef,
339
339
  style: {
340
340
  width: cell.column.totalWidth
@@ -344,7 +344,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
344
344
  onChange: function onChange(newDate) {
345
345
  var _datePickerPreparedPr;
346
346
  var newDateObj = newDate[0];
347
- datePickerPreparedProps === null || datePickerPreparedProps === void 0 ? void 0 : (_datePickerPreparedPr = datePickerPreparedProps.onChange) === null || _datePickerPreparedPr === void 0 ? void 0 : _datePickerPreparedPr.call(datePickerPreparedProps, newDateObj, cell);
347
+ datePickerPreparedProps === null || datePickerPreparedProps === void 0 || (_datePickerPreparedPr = datePickerPreparedProps.onChange) === null || _datePickerPreparedPr === void 0 ? void 0 : _datePickerPreparedPr.call(datePickerPreparedProps, newDateObj, cell);
348
348
  var newCellId = getNewCellId('Enter');
349
349
  saveCellData(newDateObj);
350
350
  setCellValue(newDateObj);
@@ -376,7 +376,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
376
376
  };
377
377
  var buildDate = function buildDate(value) {
378
378
  var _config$inputProps2;
379
- var dateFormat = config === null || config === void 0 ? void 0 : (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
379
+ var dateFormat = config === null || config === void 0 || (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
380
380
  if (value instanceof Date) {
381
381
  var maskedFullYear = value.getFullYear();
382
382
  var maskedMonth = padTo2Digits(value.getMonth() + 1);
@@ -448,7 +448,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
448
448
  "data-inline-type": type,
449
449
  onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
450
450
  onKeyDown: !nonEditCell ? handleKeyDown : null,
451
- className: (0, _classnames.default)("".concat(blockClass, "__inline-edit--outer-cell-button"), (_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 ? void 0 : (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)), _cx3))
451
+ className: (0, _classnames.default)("".concat(blockClass, "__inline-edit--outer-cell-button"), (_cx3 = {}, (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), (0, _defineProperty2.default)(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)), _cx3))
452
452
  }, !inEditMode && /*#__PURE__*/_react.default.createElement(_InlineEditButton.InlineEditButton, {
453
453
  isActiveCell: cellId === activeCellId,
454
454
  renderIcon: setRenderIcon(),
@@ -33,7 +33,16 @@ var useActionsColumn = function useActionsColumn(hooks) {
33
33
  var useAttachActionsOnInstance = function useAttachActionsOnInstance(instance) {
34
34
  var rowActions = instance.rowActions,
35
35
  isFetching = instance.isFetching,
36
- selectedFlatRows = instance.selectedFlatRows;
36
+ selectedRowIds = instance.state.selectedRowIds;
37
+ var getDisabledState = function getDisabledState(rowIndex) {
38
+ var selectedRowIndexes = Object.keys(selectedRowIds).map(function (n) {
39
+ return Number(n);
40
+ });
41
+ if (selectedRowIndexes.includes(rowIndex)) {
42
+ return true;
43
+ }
44
+ return false;
45
+ };
37
46
  if (rowActions && Array.isArray(rowActions)) {
38
47
  var addActionsMenu = function addActionsMenu(props, cellData) {
39
48
  var cell = cellData.cell;
@@ -62,11 +71,8 @@ var useActionsColumn = function useActionsColumn(hooks) {
62
71
  if (hidden) {
63
72
  return null;
64
73
  }
65
- var selectedRowId = selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.filter(function (item) {
66
- return item.id === row.id ? item.id : null;
67
- });
68
74
  return /*#__PURE__*/_react.default.createElement("div", {
69
- className: (0, _classnames.default)("".concat(blockClass, "__actions-column-button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action-button"), selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length)),
75
+ className: (0, _classnames.default)("".concat(blockClass, "__actions-column-button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action-button"), getDisabledState(row.index))),
70
76
  key: "".concat(itemText, "__").concat(index)
71
77
  }, /*#__PURE__*/_react.default.createElement(_react2.OverflowMenu, (0, _extends2.default)({}, rest, {
72
78
  renderIcon: icon,
@@ -74,9 +80,9 @@ var useActionsColumn = function useActionsColumn(hooks) {
74
80
  light: true,
75
81
  iconDescription: itemText,
76
82
  kind: "ghost",
77
- className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action"), selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length)),
83
+ className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__disabled-row-action"), getDisabledState(row.index))),
78
84
  onClick: function onClick(e) {
79
- if (selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length) {
85
+ if (getDisabledState(row.index)) {
80
86
  // Row actions should be disabled if row is selected and batchActions toolbar is active
81
87
  return;
82
88
  }