@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
@@ -47,7 +47,7 @@ export var useSpreadsheetEdit = function useSpreadsheetEdit(_ref) {
47
47
  cellEditorRef.current.style.display = 'block';
48
48
  cellEditorRef.current.style.height = activeCellRef === null || activeCellRef === void 0 ? void 0 : activeCellRef.current.style.height;
49
49
  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
50
- 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';
50
+ 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';
51
51
  (_cellEditorRef$curren = cellEditorRef.current) === null || _cellEditorRef$curren === void 0 ? void 0 : _cellEditorRef$curren.focus();
52
52
  if (rulerWidth < cellEditorCurrentWidth) {
53
53
  var _visibleColumns$nextI;
@@ -11,10 +11,10 @@ export var checkSelectedHeaderCell = function checkSelectedHeaderCell(headerInde
11
11
  var isSelectedHeader = areasCloned.some(function (area) {
12
12
  var _area$point, _area$point2, _area$point3, _area$point4, _area$point5, _area$point6, _area$point7, _area$point8;
13
13
  var oppositeType = headerType === 'column' ? 'row' : 'column';
14
- 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]);
15
- 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]);
16
- 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]);
17
- 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]);
14
+ 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]);
15
+ 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]);
16
+ 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]);
17
+ 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]);
18
18
  var isTrueSelectedState = (items === null || items === void 0 ? void 0 : items.length) - 1 === maxOppositeSelection && minOppositeSelection === 0;
19
19
  // console.log({minSelection, maxSelection});
20
20
  // Iterate over all columns included in the selection area
@@ -26,10 +26,10 @@ export var handleCellDeletion = function handleCellDeletion(_ref) {
26
26
  return item.matcher === currentMatcher;
27
27
  });
28
28
  var selectionAreaToEmptyContents = selectionAreaClone[indexOfCurrentSelectionArea];
29
- 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);
30
- 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);
31
- 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);
32
- 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);
29
+ 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);
30
+ 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);
31
+ 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);
32
+ 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);
33
33
  rangeWithCallback(lowestColumnIndex, greatestColumnIndex, function (columnIndex) {
34
34
  rangeWithCallback(lowestRowIndex, greatestRowIndex, function (rowIndex) {
35
35
  var cellProps = rows[rowIndex].cells[columnIndex];
@@ -91,7 +91,7 @@ export var handleHeaderCellSelection = function handleHeaderCellSelection(_ref2)
91
91
  return [].concat(_toConsumableArray(prev), [newSelectionArea]);
92
92
  }
93
93
  if (isHoldingShiftKey) {
94
- var _selectionAreasClone$, _selectionAreasClone$2;
94
+ var _selectionAreasClone$;
95
95
  var _selectionsFromHeaderCell = selectionsClone.filter(function (item) {
96
96
  var _item$header3;
97
97
  return (_item$header3 = item.header) === null || _item$header3 === void 0 ? void 0 : _item$header3.type;
@@ -111,7 +111,7 @@ export var handleHeaderCellSelection = function handleHeaderCellSelection(_ref2)
111
111
  return item.matcher === currentMatcher;
112
112
  });
113
113
  var newIndexList = getSelectedItemIndexList({
114
- 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],
114
+ indexList: ((_selectionAreasClone$ = selectionAreasClone[indexOfCurrentArea]) === null || _selectionAreasClone$ === void 0 || (_selectionAreasClone$ = _selectionAreasClone$.header) === null || _selectionAreasClone$ === void 0 ? void 0 : _selectionAreasClone$.selectedIndexList) || [type === 'column' ? columnValue : rowValue],
115
115
  newIndex: newIndexValue,
116
116
  activeCellIndex: activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates[type]
117
117
  });
@@ -34,7 +34,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
34
34
  return /*#__PURE__*/React.createElement(TableHeader, _extends({}, header.getHeaderProps({
35
35
  role: false
36
36
  }), {
37
- className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), _defineProperty(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), _defineProperty(_cx, "".concat(blockClass, "__sortableColumn"), header.canSort), _defineProperty(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
37
+ className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__resizableColumn"), header.getResizerProps), _defineProperty(_cx, "".concat(blockClass, "__isResizing"), header.isResizing), _defineProperty(_cx, "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable), _defineProperty(_cx, "".concat(blockClass, "__isSorted"), header.isSorted), _cx), header.getHeaderProps().className),
38
38
  key: header.id
39
39
  }), header.render('Header'), header.getResizerProps && /*#__PURE__*/React.createElement("div", _extends({}, header.getResizerProps(), {
40
40
  className: "".concat(blockClass, "__resizer")
@@ -51,9 +51,9 @@ var DatagridRow = function DatagridRow(datagridState) {
51
51
  hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.classList.add("".concat(blockClass, "__carbon-row-expanded-hover-active"));
52
52
  var rowExpanderButton = hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.querySelector(".".concat(blockClass, "__row-expander"));
53
53
  var rowSizeValue = rowSize || 'lg';
54
- 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);
55
- 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"), px(rowHeights[rowSizeValue]));
56
- 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"), px((rowExpanderButton === null || rowExpanderButton === void 0 ? void 0 : rowExpanderButton.offsetLeft) || 0));
54
+ hoverRow === null || hoverRow === void 0 || (_hoverRow$style = hoverRow.style) === null || _hoverRow$style === void 0 ? void 0 : _hoverRow$style.setProperty("--".concat(blockClass, "--indicator-height"), totalNestedRowIndicatorHeight);
55
+ hoverRow === null || hoverRow === void 0 || (_hoverRow$style2 = hoverRow.style) === null || _hoverRow$style2 === void 0 ? void 0 : _hoverRow$style2.setProperty("--".concat(blockClass, "--row-height"), px(rowHeights[rowSizeValue]));
56
+ hoverRow === null || hoverRow === void 0 || (_hoverRow$style3 = hoverRow.style) === null || _hoverRow$style3 === void 0 ? void 0 : _hoverRow$style3.setProperty("--".concat(blockClass, "--indicator-offset-amount"), px((rowExpanderButton === null || rowExpanderButton === void 0 ? void 0 : rowExpanderButton.offsetLeft) || 0));
57
57
  };
58
58
  var focusRemover = function focusRemover() {
59
59
  var elements = document.querySelectorAll(".".concat(blockClass, "__carbon-row-expanded"));
@@ -32,17 +32,17 @@ export var DraggableItemsList = function DraggableItemsList(_ref) {
32
32
  }).filter(function (colDef) {
33
33
  return !colDef.isAction;
34
34
  }).filter(function (colDef) {
35
- var _colDef$Header$props$2, _colDef$Header$props2, _colDef$Header$props3;
35
+ var _colDef$Header$props$2, _colDef$Header$props2;
36
36
  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);
37
- 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';
37
+ 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';
38
38
  }).map(function (colDef, i) {
39
- var _colDef$Header$props$3, _colDef$Header$props4, _colDef$Header$props5, _colDef$Header$props6, _colDef$Header$props7;
39
+ var _colDef$Header$props$3, _colDef$Header$props3, _colDef$Header$props4, _colDef$Header$props5, _colDef$Header$props6;
40
40
  var isSortableColumn = !!colDef.canSort && !!isTableSortable;
41
41
  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);
42
42
  var searchString = new RegExp('(' + filterString + ')');
43
43
  var res = filterString.length ? isSortableColumn ? sortableTitle.toLowerCase().split(searchString) : colDef.Header.props.title.toLowerCase().split(searchString) : null;
44
44
  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;
45
- 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;
45
+ 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;
46
46
  var isFrozenColumn = !!colDef.sticky;
47
47
  var listContents = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Checkbox, {
48
48
  wrapperClassName: "".concat(blockClass, "__customize-columns-checkbox-wrapper"),
@@ -53,8 +53,8 @@ export var DraggableItemsList = function DraggableItemsList(_ref) {
53
53
  return onSelectColumn(colDef, checked);
54
54
  },
55
55
  id: "".concat(blockClass, "__customization-column-").concat(colDef.id),
56
- labelText: isSortableColumn ? sortableTitle : (_colDef$Header$props5 = colDef.Header.props) === null || _colDef$Header$props5 === void 0 ? void 0 : _colDef$Header$props5.title,
57
- title: isSortableColumn ? sortableTitle : (_colDef$Header$props6 = colDef.Header.props) === null || _colDef$Header$props6 === void 0 ? void 0 : _colDef$Header$props6.title,
56
+ labelText: isSortableColumn ? sortableTitle : (_colDef$Header$props4 = colDef.Header.props) === null || _colDef$Header$props4 === void 0 ? void 0 : _colDef$Header$props4.title,
57
+ title: isSortableColumn ? sortableTitle : (_colDef$Header$props5 = colDef.Header.props) === null || _colDef$Header$props5 === void 0 ? void 0 : _colDef$Header$props5.title,
58
58
  className: "".concat(blockClass, "__customize-columns-checkbox"),
59
59
  hideLabel: true
60
60
  }), /*#__PURE__*/React.createElement("div", {
@@ -71,7 +71,7 @@ export var DraggableItemsList = function DraggableItemsList(_ref) {
71
71
  id: "dnd-datagrid-columns-".concat(colDef.id),
72
72
  type: "column-customization",
73
73
  disabled: filterString.length > 0 || isFrozenColumn,
74
- ariaLabel: isSortableColumn ? sortableTitle : (_colDef$Header$props7 = colDef.Header.props) === null || _colDef$Header$props7 === void 0 ? void 0 : _colDef$Header$props7.title,
74
+ ariaLabel: isSortableColumn ? sortableTitle : (_colDef$Header$props6 = colDef.Header.props) === null || _colDef$Header$props6 === void 0 ? void 0 : _colDef$Header$props6.title,
75
75
  onGrab: setAriaRegionText,
76
76
  isFocused: focusIndex === i,
77
77
  moveElement: moveElement,
@@ -286,7 +286,7 @@ export var InlineEditCell = function InlineEditCell(_ref) {
286
286
  });
287
287
  setInEditMode(false);
288
288
  sendFocusBackToGrid();
289
- inputProps === null || inputProps === void 0 ? void 0 : (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 ? void 0 : _inputProps$onChange.call(inputProps, item.selectedItem);
289
+ inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 ? void 0 : _inputProps$onChange.call(inputProps, item.selectedItem);
290
290
  },
291
291
  downshiftProps: {
292
292
  onStateChange: function onStateChange(downshiftState) {
@@ -324,9 +324,9 @@ export var InlineEditCell = function InlineEditCell(_ref) {
324
324
  var renderDateCell = function renderDateCell() {
325
325
  var _config$inputProps, _outerButtonElement$c;
326
326
  var datePickerPreparedProps = prepareProps(config.inputProps, ['datePickerInputProps']);
327
- var datePickerInputProps = config === null || config === void 0 ? void 0 : (_config$inputProps = config.inputProps) === null || _config$inputProps === void 0 ? void 0 : _config$inputProps.datePickerInputProps;
327
+ var datePickerInputProps = config === null || config === void 0 || (_config$inputProps = config.inputProps) === null || _config$inputProps === void 0 ? void 0 : _config$inputProps.datePickerInputProps;
328
328
  return /*#__PURE__*/React.createElement(DatePicker, _extends({}, datePickerPreparedProps, {
329
- appendTo: outerButtonElement === null || outerButtonElement === void 0 ? void 0 : (_outerButtonElement$c = outerButtonElement.current) === null || _outerButtonElement$c === void 0 ? void 0 : _outerButtonElement$c.parentElement,
329
+ appendTo: outerButtonElement === null || outerButtonElement === void 0 || (_outerButtonElement$c = outerButtonElement.current) === null || _outerButtonElement$c === void 0 ? void 0 : _outerButtonElement$c.parentElement,
330
330
  ref: datePickerRef,
331
331
  style: {
332
332
  width: cell.column.totalWidth
@@ -336,7 +336,7 @@ export var InlineEditCell = function InlineEditCell(_ref) {
336
336
  onChange: function onChange(newDate) {
337
337
  var _datePickerPreparedPr;
338
338
  var newDateObj = newDate[0];
339
- datePickerPreparedProps === null || datePickerPreparedProps === void 0 ? void 0 : (_datePickerPreparedPr = datePickerPreparedProps.onChange) === null || _datePickerPreparedPr === void 0 ? void 0 : _datePickerPreparedPr.call(datePickerPreparedProps, newDateObj, cell);
339
+ datePickerPreparedProps === null || datePickerPreparedProps === void 0 || (_datePickerPreparedPr = datePickerPreparedProps.onChange) === null || _datePickerPreparedPr === void 0 ? void 0 : _datePickerPreparedPr.call(datePickerPreparedProps, newDateObj, cell);
340
340
  var newCellId = getNewCellId('Enter');
341
341
  saveCellData(newDateObj);
342
342
  setCellValue(newDateObj);
@@ -368,7 +368,7 @@ export var InlineEditCell = function InlineEditCell(_ref) {
368
368
  };
369
369
  var buildDate = function buildDate(value) {
370
370
  var _config$inputProps2;
371
- var dateFormat = config === null || config === void 0 ? void 0 : (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
371
+ var dateFormat = config === null || config === void 0 || (_config$inputProps2 = config.inputProps) === null || _config$inputProps2 === void 0 ? void 0 : _config$inputProps2.dateFormat;
372
372
  if (value instanceof Date) {
373
373
  var maskedFullYear = value.getFullYear();
374
374
  var maskedMonth = padTo2Digits(value.getMonth() + 1);
@@ -440,7 +440,7 @@ export var InlineEditCell = function InlineEditCell(_ref) {
440
440
  "data-inline-type": type,
441
441
  onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
442
442
  onKeyDown: !nonEditCell ? handleKeyDown : null,
443
- className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), (_cx3 = {}, _defineProperty(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), _defineProperty(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), _defineProperty(_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))
443
+ className: cx("".concat(blockClass, "__inline-edit--outer-cell-button"), (_cx3 = {}, _defineProperty(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), _defineProperty(_cx3, "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), _defineProperty(_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))
444
444
  }, !inEditMode && /*#__PURE__*/React.createElement(InlineEditButton, {
445
445
  isActiveCell: cellId === activeCellId,
446
446
  renderIcon: setRenderIcon(),
@@ -24,7 +24,16 @@ var useActionsColumn = function useActionsColumn(hooks) {
24
24
  var useAttachActionsOnInstance = function useAttachActionsOnInstance(instance) {
25
25
  var rowActions = instance.rowActions,
26
26
  isFetching = instance.isFetching,
27
- selectedFlatRows = instance.selectedFlatRows;
27
+ selectedRowIds = instance.state.selectedRowIds;
28
+ var getDisabledState = function getDisabledState(rowIndex) {
29
+ var selectedRowIndexes = Object.keys(selectedRowIds).map(function (n) {
30
+ return Number(n);
31
+ });
32
+ if (selectedRowIndexes.includes(rowIndex)) {
33
+ return true;
34
+ }
35
+ return false;
36
+ };
28
37
  if (rowActions && Array.isArray(rowActions)) {
29
38
  var addActionsMenu = function addActionsMenu(props, cellData) {
30
39
  var cell = cellData.cell;
@@ -53,11 +62,8 @@ var useActionsColumn = function useActionsColumn(hooks) {
53
62
  if (hidden) {
54
63
  return null;
55
64
  }
56
- var selectedRowId = selectedFlatRows === null || selectedFlatRows === void 0 ? void 0 : selectedFlatRows.filter(function (item) {
57
- return item.id === row.id ? item.id : null;
58
- });
59
65
  return /*#__PURE__*/React.createElement("div", {
60
- className: cx("".concat(blockClass, "__actions-column-button"), _defineProperty({}, "".concat(blockClass, "__disabled-row-action-button"), selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length)),
66
+ className: cx("".concat(blockClass, "__actions-column-button"), _defineProperty({}, "".concat(blockClass, "__disabled-row-action-button"), getDisabledState(row.index))),
61
67
  key: "".concat(itemText, "__").concat(index)
62
68
  }, /*#__PURE__*/React.createElement(OverflowMenu, _extends({}, rest, {
63
69
  renderIcon: icon,
@@ -65,9 +71,9 @@ var useActionsColumn = function useActionsColumn(hooks) {
65
71
  light: true,
66
72
  iconDescription: itemText,
67
73
  kind: "ghost",
68
- className: cx(_defineProperty({}, "".concat(blockClass, "__disabled-row-action"), selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length)),
74
+ className: cx(_defineProperty({}, "".concat(blockClass, "__disabled-row-action"), getDisabledState(row.index))),
69
75
  onClick: function onClick(e) {
70
- if (selectedFlatRows && selectedFlatRows.length && selectedRowId && selectedRowId.length) {
76
+ if (getDisabledState(row.index)) {
71
77
  // Row actions should be disabled if row is selected and batchActions toolbar is active
72
78
  return;
73
79
  }
@@ -20,7 +20,7 @@ var useDisableSelectRows = function useDisableSelectRows(hooks) {
20
20
  };
21
21
  var updateSelectAll = function updateSelectAll(hooks) {
22
22
  var getToggleAllRowsSelectedProps = function getToggleAllRowsSelectedProps(props, _ref2) {
23
- var _instance$disableSele, _instance$disableSele2;
23
+ var _instance$disableSele;
24
24
  var instance = _ref2.instance;
25
25
  var selectableRows = instance.rows.filter(function (row) {
26
26
  return !(instance.shouldDisableSelectRow && instance.shouldDisableSelectRow(row));
@@ -40,7 +40,7 @@ var updateSelectAll = function updateSelectAll(hooks) {
40
40
  },
41
41
  checked: isAllRowsSelected,
42
42
  disabled: instance.disableSelectAll,
43
- title: (instance === null || instance === void 0 ? void 0 : (_instance$disableSele = instance.disableSelectRowsProps) === null || _instance$disableSele === void 0 ? void 0 : (_instance$disableSele2 = _instance$disableSele.labels) === null || _instance$disableSele2 === void 0 ? void 0 : _instance$disableSele2.toggleAllRowsLabel) || 'Toggle All Rows Selected',
43
+ title: (instance === null || instance === void 0 || (_instance$disableSele = instance.disableSelectRowsProps) === null || _instance$disableSele === void 0 || (_instance$disableSele = _instance$disableSele.labels) === null || _instance$disableSele === void 0 ? void 0 : _instance$disableSele.toggleAllRowsLabel) || 'Toggle All Rows Selected',
44
44
  indeterminate: Boolean(!isAllRowsSelected && Object.keys(instance.state.selectedRowIds).length)
45
45
  }];
46
46
  };
@@ -48,7 +48,7 @@ var updateSelectAll = function updateSelectAll(hooks) {
48
48
  };
49
49
  var updatePageSelectAll = function updatePageSelectAll(hooks) {
50
50
  var getToggleAllPageRowsSelectedProps = function getToggleAllPageRowsSelectedProps(props, _ref4) {
51
- var _instance$disableSele3, _instance$disableSele4;
51
+ var _instance$disableSele2;
52
52
  var instance = _ref4.instance;
53
53
  var selectableRows = instance.page.filter(function (row) {
54
54
  return !(instance.shouldDisableSelectRow && instance.shouldDisableSelectRow(row));
@@ -68,7 +68,7 @@ var updatePageSelectAll = function updatePageSelectAll(hooks) {
68
68
  },
69
69
  checked: isAllRowsSelected,
70
70
  disabled: instance.disableSelectAll,
71
- title: (instance === null || instance === void 0 ? void 0 : (_instance$disableSele3 = instance.disableSelectRowsProps) === null || _instance$disableSele3 === void 0 ? void 0 : (_instance$disableSele4 = _instance$disableSele3.labels) === null || _instance$disableSele4 === void 0 ? void 0 : _instance$disableSele4.toggleAllRowsLabel) || 'Toggle All Rows Selected',
71
+ title: (instance === null || instance === void 0 || (_instance$disableSele2 = instance.disableSelectRowsProps) === null || _instance$disableSele2 === void 0 || (_instance$disableSele2 = _instance$disableSele2.labels) === null || _instance$disableSele2 === void 0 ? void 0 : _instance$disableSele2.toggleAllRowsLabel) || 'Toggle All Rows Selected',
72
72
  indeterminate: Boolean(!isAllRowsSelected && instance.page.some(function (_ref6) {
73
73
  var id = _ref6.id;
74
74
  return instance.state.selectedRowIds[id];
@@ -21,11 +21,11 @@ var useInlineEdit = function useInlineEdit(hooks, usingEditableCell) {
21
21
  }
22
22
  }, [usingEditableCell]);
23
23
  var addInlineEdit = function addInlineEdit(props, _ref) {
24
- var _cell$column, _cell$column$inlineEd, _instance$columns$fil;
24
+ var _cell$column, _instance$columns$fil;
25
25
  var cell = _ref.cell,
26
26
  instance = _ref.instance;
27
27
  var columnInlineEditConfig = cell.column.inlineEdit;
28
- var inlineEditType = (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : (_cell$column$inlineEd = _cell$column.inlineEdit) === null || _cell$column$inlineEd === void 0 ? void 0 : _cell$column$inlineEd.type;
28
+ var inlineEditType = (_cell$column = cell.column) === null || _cell$column === void 0 || (_cell$column = _cell$column.inlineEdit) === null || _cell$column === void 0 ? void 0 : _cell$column.type;
29
29
  var totalInlineEditColumns = (_instance$columns$fil = instance.columns.filter(function (item) {
30
30
  return item.inlineEdit;
31
31
  })) === null || _instance$columns$fil === void 0 ? void 0 : _instance$columns$fil.length;
@@ -6,6 +6,7 @@
6
6
  * restricted by GSA ADP Schedule Contract with IBM Corp.
7
7
  */
8
8
 
9
+ import { pkg, carbon } from '../../settings';
9
10
  var useOnRowClick = function useOnRowClick(hooks) {
10
11
  var useInstance = function useInstance(rowInstance) {
11
12
  var onRowClick = rowInstance.onRowClick;
@@ -15,13 +16,28 @@ var useOnRowClick = function useOnRowClick(hooks) {
15
16
  instance = datagridState.instance;
16
17
  var id = row.id,
17
18
  toggleRowSelected = row.toggleRowSelected;
19
+ var withSelectRows = instance.withSelectRows,
20
+ tableId = instance.tableId;
18
21
  var onClick = function onClick(event) {
19
22
  if (!isFetching && onRowClick) {
20
23
  onRowClick(row, event);
21
- instance.selectedFlatRows && instance.selectedFlatRows.map(function (toggleRow) {
22
- return toggleRow.toggleRowSelected(false);
23
- });
24
- toggleRowSelected(id, true);
24
+ // We do not want to change the list of selected rows if using the useSelectedRows hook, otherwise clicking on an entire row will mark the row as checked
25
+
26
+ // Remove selected class from all other clickable rows as only one clickable row can be selected at a time
27
+ var clickableSelectedRows = document.querySelectorAll("#".concat(tableId, ".").concat(pkg.prefix, "--datagrid .").concat(carbon.prefix, "--data-table--selected:not(.").concat(pkg.prefix, "--datagrid__active-row)"));
28
+ if (clickableSelectedRows.length) {
29
+ Array.from(clickableSelectedRows).forEach(function (row) {
30
+ row.classList.remove("".concat(carbon.prefix, "--data-table--selected"));
31
+ });
32
+ }
33
+ var closestRow = event.target.closest(".".concat(pkg.prefix, "--datagrid__carbon-row"));
34
+ closestRow.classList.add("".concat(carbon.prefix, "--data-table--selected"));
35
+ if (!withSelectRows) {
36
+ instance.selectedFlatRows && instance.selectedFlatRows.map(function (toggleRow) {
37
+ return toggleRow.toggleRowSelected(false);
38
+ });
39
+ toggleRowSelected(id, true);
40
+ }
25
41
  }
26
42
  };
27
43
  var onKeyDown = function onKeyDown(event) {
@@ -21,11 +21,37 @@ var ordering = {
21
21
  DESC: 'DESC',
22
22
  NONE: 'NONE'
23
23
  };
24
+ var getAriaSortValue = function getAriaSortValue(col, _ref) {
25
+ var ascendingSortableLabelText = _ref.ascendingSortableLabelText,
26
+ descendingSortableLabelText = _ref.descendingSortableLabelText,
27
+ defaultSortableLabelText = _ref.defaultSortableLabelText;
28
+ var isSorted = col.isSorted,
29
+ isSortedDesc = col.isSortedDesc;
30
+ if (!isSorted) {
31
+ return defaultSortableLabelText || 'none';
32
+ }
33
+ if (isSorted && !isSortedDesc) {
34
+ return ascendingSortableLabelText || 'ascending';
35
+ }
36
+ if (isSorted && isSortedDesc) {
37
+ return descendingSortableLabelText || 'descending';
38
+ }
39
+ };
40
+ var getAriaPressedValue = function getAriaPressedValue(col) {
41
+ var isSorted = col.isSorted;
42
+ if (isSorted) {
43
+ return 'true';
44
+ }
45
+ return 'false';
46
+ };
24
47
  var useSortableColumns = function useSortableColumns(hooks) {
25
- var sortableVisibleColumns = function sortableVisibleColumns(visibleColumns, _ref) {
48
+ var sortableVisibleColumns = function sortableVisibleColumns(visibleColumns, _ref2) {
26
49
  var _instance$customizeCo;
27
- var instance = _ref.instance;
28
- var onSort = instance.onSort;
50
+ var instance = _ref2.instance;
51
+ var onSort = instance.onSort,
52
+ ascendingSortableLabelText = instance.ascendingSortableLabelText,
53
+ descendingSortableLabelText = instance.descendingSortableLabelText,
54
+ defaultSortableLabelText = instance.defaultSortableLabelText;
29
55
  var onSortClick = function onSortClick(column) {
30
56
  var key = column.id;
31
57
  var sortDesc = column.isSortedDesc;
@@ -70,6 +96,12 @@ var useSortableColumns = function useSortableColumns(hooks) {
70
96
  var Header = function Header(headerProp) {
71
97
  var _cx;
72
98
  return column.disableSortBy === true ? column.Header : /*#__PURE__*/React.createElement(Button, {
99
+ "aria-sort": getAriaSortValue(headerProp === null || headerProp === void 0 ? void 0 : headerProp.column, {
100
+ ascendingSortableLabelText: ascendingSortableLabelText,
101
+ descendingSortableLabelText: descendingSortableLabelText,
102
+ defaultSortableLabelText: defaultSortableLabelText
103
+ }),
104
+ "aria-pressed": getAriaPressedValue(headerProp === null || headerProp === void 0 ? void 0 : headerProp.column),
73
105
  onClick: function onClick() {
74
106
  return onSortClick(headerProp === null || headerProp === void 0 ? void 0 : headerProp.column);
75
107
  },
@@ -149,7 +149,7 @@ var changeProps = function changeProps(elementName, headerCellRef, windowSize, p
149
149
  if (column.sticky === 'left') {
150
150
  var _data$instance, _cx2;
151
151
  return [props, _objectSpread({
152
- className: cx((_cx2 = {}, _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true && windowSize > 671), _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), (data === null || data === void 0 ? void 0 : (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows) && windowSize > 671), _cx2))
152
+ className: cx((_cx2 = {}, _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true && windowSize > 671), _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), (data === null || data === void 0 || (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows) && windowSize > 671), _cx2))
153
153
  }, headerCellRef && {
154
154
  ref: headerCellRef
155
155
  })];
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["actionIcons", "actionsPlacement", "className", "description", "editChildren", "editMode", "label", "previewChildren", "title", "titleSize"];
4
+ var _excluded = ["actionIcons", "actionsPlacement", "className", "description", "editChildren", "editMode", "label", "onPrimaryButtonClick", "onSecondaryButtonClick", "previewChildren", "title", "titleSize", "primaryButtonIcon", "primaryButtonText", "secondaryButtonIcon", "secondaryButtonText"];
5
5
  /**
6
6
  * Copyright IBM Corp. 2022, 2022
7
7
  *
@@ -56,12 +56,30 @@ export var EditUpdateCards = /*#__PURE__*/React.forwardRef(function (_ref, ref)
56
56
  editChildren = _ref.editChildren,
57
57
  editMode = _ref.editMode,
58
58
  label = _ref.label,
59
+ onPrimaryButtonClick = _ref.onPrimaryButtonClick,
60
+ onSecondaryButtonClick = _ref.onSecondaryButtonClick,
59
61
  previewChildren = _ref.previewChildren,
60
62
  title = _ref.title,
61
63
  titleSize = _ref.titleSize,
64
+ primaryButtonIcon = _ref.primaryButtonIcon,
65
+ primaryButtonText = _ref.primaryButtonText,
66
+ secondaryButtonIcon = _ref.secondaryButtonIcon,
67
+ secondaryButtonText = _ref.secondaryButtonText,
62
68
  rest = _objectWithoutProperties(_ref, _excluded);
63
- // const [editMode, setEditMode] = useState(false);
69
+ // const [editCardMode, setEditCardMode] = useState(editMode);
64
70
 
71
+ var conditionalProps = {
72
+ onPrimaryButtonClick: onPrimaryButtonClick,
73
+ onSecondaryButtonClick: onSecondaryButtonClick,
74
+ primaryButtonIcon: primaryButtonIcon,
75
+ primaryButtonKind: 'ghost',
76
+ primaryButtonPlacement: 'top',
77
+ primaryButtonText: primaryButtonText,
78
+ secondaryButtonIcon: secondaryButtonIcon,
79
+ secondaryButtonKind: 'ghost',
80
+ secondaryButtonPlacement: 'top',
81
+ secondaryButtonText: secondaryButtonText
82
+ };
65
83
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
66
84
  className: cx(blockClass,
67
85
  // Apply the block class to the main HTML element
@@ -70,7 +88,7 @@ export var EditUpdateCards = /*#__PURE__*/React.forwardRef(function (_ref, ref)
70
88
  _defineProperty({}, "".concat(blockClass, "__actions-bottom"), actionsPlacement === 'bottom')),
71
89
  ref: ref,
72
90
  role: "main"
73
- }, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(ProductiveCard, {
91
+ }, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(ProductiveCard, _extends({
74
92
  actionIcons: actionIcons,
75
93
  actionsPlacement: actionsPlacement,
76
94
  className: className,
@@ -78,7 +96,7 @@ export var EditUpdateCards = /*#__PURE__*/React.forwardRef(function (_ref, ref)
78
96
  label: label,
79
97
  title: title,
80
98
  titleSize: titleSize
81
- }, editMode === false && /*#__PURE__*/React.createElement("div", null, previewChildren), editMode && /*#__PURE__*/React.createElement("div", null, editChildren)));
99
+ }, editMode && conditionalProps), editMode === false && /*#__PURE__*/React.createElement("div", null, previewChildren), editMode && /*#__PURE__*/React.createElement("div", null, editChildren)));
82
100
  });
83
101
 
84
102
  // Return a placeholder if not released and not enabled by feature flag
@@ -127,10 +145,54 @@ EditUpdateCards.propTypes = {
127
145
  * Optional label for the top of the card
128
146
  */
129
147
  label: PropTypes.string,
148
+ /**
149
+ * Function that's called from the primary button or action icon
150
+ */
151
+ onPrimaryButtonClick: PropTypes.func,
152
+ /**
153
+ * Function that's called from the secondary button or action icon
154
+ */
155
+ onSecondaryButtonClick: PropTypes.func,
130
156
  /**
131
157
  * Preview mode children
132
158
  */
133
159
  previewChildren: PropTypes.node,
160
+ /**
161
+ * Optional prop to allow overriding the icon rendering. Can be a React component class
162
+ */
163
+ primaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
164
+ /**
165
+ * Establishes the kind of button displayed for the primary button
166
+ */
167
+ primaryButtonKind: PropTypes.oneOf(['primary', 'ghost']),
168
+ /**
169
+ * Determines if the primary button is on the top or bottom of the card
170
+ */
171
+ primaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
172
+ /**
173
+ * The text that's displayed in the primary button
174
+ */
175
+ primaryButtonText: PropTypes.string,
176
+ /**
177
+ * Optionally specify an href for your Button to become an <a> element
178
+ */
179
+ secondaryButtonHref: PropTypes.string,
180
+ /**
181
+ * Optional prop to allow overriding the icon rendering. Can be a React component class
182
+ */
183
+ secondaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
184
+ /**
185
+ * Establishes the kind of button displayed for the secondary button
186
+ */
187
+ secondaryButtonKind: PropTypes.oneOf(['secondary', 'ghost']),
188
+ /**
189
+ * Determines if the secondary button is on the top or bottom of the card
190
+ */
191
+ secondaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
192
+ /**
193
+ * The text that's displayed in the secondary button
194
+ */
195
+ secondaryButtonText: PropTypes.string,
134
196
  /**
135
197
  * Title that's displayed at the top of the card
136
198
  */
@@ -76,7 +76,7 @@ export var ExportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
76
76
  useEffect(function () {
77
77
  var _preformattedExtensio;
78
78
  setName(filename);
79
- setExtension(preformattedExtensions === null || preformattedExtensions === void 0 ? void 0 : (_preformattedExtensio = preformattedExtensions[0]) === null || _preformattedExtensio === void 0 ? void 0 : _preformattedExtensio.extension);
79
+ setExtension(preformattedExtensions === null || preformattedExtensions === void 0 || (_preformattedExtensio = preformattedExtensions[0]) === null || _preformattedExtensio === void 0 ? void 0 : _preformattedExtensio.extension);
80
80
  }, [filename, preformattedExtensions, open]);
81
81
  var onNameChangeHandler = function onNameChangeHandler(evt) {
82
82
  setName(evt.target.value);
@@ -297,10 +297,10 @@ export var NotificationsPanel = /*#__PURE__*/React.forwardRef(function (_ref, re
297
297
  nowText: nowText
298
298
  })), /*#__PURE__*/React.createElement("h6", {
299
299
  className: notificationHeaderClassName
300
- }, notification.title), notification.description && notification.description.length && renderDescription(notification.id), notification.link && notification.link.text && notification.link.url && /*#__PURE__*/React.createElement(Link, {
300
+ }, notification.title), notification.description && notification.description.length && renderDescription(notification.id), notification.link && notification.link.text && notification.link.url && /*#__PURE__*/React.createElement(Link, _extends({
301
301
  href: notification.link.url,
302
302
  className: "".concat(blockClass, "__notifications-link")
303
- }, notification.link.text)), /*#__PURE__*/React.createElement(IconButton, {
303
+ }, notification.link.optional), notification.link.text)), /*#__PURE__*/React.createElement(IconButton, {
304
304
  align: "left",
305
305
  kind: "ghost",
306
306
  size: "sm",
@@ -420,7 +420,10 @@ NotificationsPanel.propTypes = {
420
420
  description: PropTypes.string,
421
421
  link: PropTypes.shape({
422
422
  url: PropTypes.string,
423
- text: PropTypes.string
423
+ text: PropTypes.string,
424
+ optional: PropTypes.shape({
425
+ // Add optional props here
426
+ })
424
427
  }),
425
428
  unread: PropTypes.bool,
426
429
  onNotificationClick: PropTypes.func
@@ -27,7 +27,7 @@ export var ProductiveCard = /*#__PURE__*/forwardRef(function (_ref, ref) {
27
27
  var _ref$actionsPlacement = _ref.actionsPlacement,
28
28
  actionsPlacement = _ref$actionsPlacement === void 0 ? defaults.actionsPlacement : _ref$actionsPlacement,
29
29
  rest = _objectWithoutProperties(_ref, _excluded);
30
- var validProps = prepareProps(rest, ['media', 'mediaPosition', 'onSecondaryButtonClick', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind', 'secondaryButtonText']);
30
+ var validProps = prepareProps(rest, ['media', 'mediaPosition', 'pictogram', 'primaryButtonClick', 'productive', 'secondaryButtonKind']);
31
31
  return /*#__PURE__*/React.createElement(Card, _extends({}, _objectSpread(_objectSpread({}, validProps), {}, {
32
32
  actionsPlacement: actionsPlacement,
33
33
  ref: ref
@@ -82,6 +82,10 @@ ProductiveCard.propTypes = {
82
82
  * Function that's called from the primary button or action icon
83
83
  */
84
84
  onPrimaryButtonClick: PropTypes.func,
85
+ /**
86
+ * Function that's called from the secondary button or action icon
87
+ */
88
+ onSecondaryButtonClick: PropTypes.func,
85
89
  /**
86
90
  * Use an overflow menu instead of action icons. Refer to design documentation for implementation guidelines
87
91
  */
@@ -111,6 +115,22 @@ ProductiveCard.propTypes = {
111
115
  * The text that's displayed in the primary button
112
116
  */
113
117
  primaryButtonText: PropTypes.node,
118
+ /**
119
+ * Optionally specify an href for your Button to become an <a> element
120
+ */
121
+ secondaryButtonHref: PropTypes.string,
122
+ /**
123
+ * Optional prop to allow overriding the icon rendering. Can be a React component class
124
+ */
125
+ secondaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
126
+ /**
127
+ * Determines if the secondary button is on the top or bottom of the card
128
+ */
129
+ secondaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
130
+ /**
131
+ * The text that's displayed in the secondary button
132
+ */
133
+ secondaryButtonText: PropTypes.node,
114
134
  /**
115
135
  * Title that's displayed at the top of the card
116
136
  */