@carbon/ibm-products 2.41.1-canary.8 → 2.42.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/es/components/CreateFullPage/CreateFullPage.d.ts +2 -1
  2. package/es/components/CreateFullPage/CreateFullPageStep.d.ts +71 -2
  3. package/es/components/CreateFullPage/CreateFullPageStep.js +3 -0
  4. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +3 -2
  5. package/es/components/DataSpreadsheet/DataSpreadsheet.js +28 -28
  6. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +7 -8
  7. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +1 -0
  8. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +4 -3
  9. package/es/components/DataSpreadsheet/types/index.d.ts +1 -4
  10. package/es/components/Datagrid/Datagrid/Datagrid.d.ts +24 -2
  11. package/es/components/Datagrid/Datagrid/Datagrid.js +4 -4
  12. package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +2 -1
  13. package/es/components/Datagrid/Datagrid/DatagridBody.js +1 -2
  14. package/es/components/Datagrid/Datagrid/DatagridContent.d.ts +16 -13
  15. package/es/components/Datagrid/Datagrid/DatagridContent.js +12 -13
  16. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.d.ts +8 -1
  17. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -4
  18. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.d.ts +9 -1
  19. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +10 -5
  20. package/es/components/Datagrid/Datagrid/DatagridHead.d.ts +8 -1
  21. package/es/components/Datagrid/Datagrid/DatagridHead.js +3 -5
  22. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.d.ts +8 -1
  23. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +41 -36
  24. package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +2 -1
  25. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +4 -4
  26. package/es/components/Datagrid/Datagrid/DatagridRow.d.ts +8 -1
  27. package/es/components/Datagrid/Datagrid/DatagridRow.js +12 -16
  28. package/es/components/Datagrid/Datagrid/DatagridSelectAll.d.ts +9 -1
  29. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -8
  30. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.d.ts +23 -27
  31. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -9
  32. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +2 -1
  33. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +3 -3
  34. package/es/components/Datagrid/Datagrid/DatagridToolbar.d.ts +17 -10
  35. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +15 -11
  36. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +8 -1
  37. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +29 -17
  38. package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +23 -21
  39. package/es/components/Datagrid/Datagrid/DraggableElement.js +2 -4
  40. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
  41. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  42. package/es/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +12 -2
  43. package/es/components/Datagrid/Datagrid/index.d.ts +7 -1
  44. package/es/components/Datagrid/types/index.d.ts +210 -0
  45. package/es/components/Datagrid/useColumnOrder.d.ts +1 -0
  46. package/es/components/Datagrid/useDatagrid.d.ts +1 -1
  47. package/es/components/Datagrid/useFocusRowExpander.js +1 -1
  48. package/es/components/Datagrid/useInfiniteScroll.d.ts +8 -1
  49. package/es/components/Datagrid/useInfiniteScroll.js +10 -9
  50. package/es/components/Datagrid/useSelectRows.js +5 -1
  51. package/es/components/EditUpdateCards/EditUpdateCards.d.ts +4 -3
  52. package/es/components/FilterSummary/FilterSummary.d.ts +21 -2
  53. package/es/components/FilterSummary/FilterSummary.js +10 -11
  54. package/es/components/Guidebanner/Guidebanner.js +7 -2
  55. package/es/components/ProductiveCard/ProductiveCard.d.ts +115 -2
  56. package/es/components/ProductiveCard/ProductiveCard.js +9 -9
  57. package/es/components/WebTerminal/WebTerminal.js +1 -1
  58. package/es/global/js/hooks/usePreviousValue.d.ts +1 -1
  59. package/es/global/js/hooks/usePreviousValue.js +3 -2
  60. package/es/global/js/hooks/useRetrieveStepData.d.ts +5 -5
  61. package/es/global/js/hooks/useRetrieveStepData.js +5 -5
  62. package/lib/components/CreateFullPage/CreateFullPage.d.ts +2 -1
  63. package/lib/components/CreateFullPage/CreateFullPageStep.d.ts +71 -2
  64. package/lib/components/CreateFullPage/CreateFullPageStep.js +3 -0
  65. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +3 -2
  66. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +28 -28
  67. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +7 -8
  68. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +1 -0
  69. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +4 -3
  70. package/lib/components/DataSpreadsheet/types/index.d.ts +1 -4
  71. package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +24 -2
  72. package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -4
  73. package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +2 -1
  74. package/lib/components/Datagrid/Datagrid/DatagridBody.js +1 -2
  75. package/lib/components/Datagrid/Datagrid/DatagridContent.d.ts +16 -13
  76. package/lib/components/Datagrid/Datagrid/DatagridContent.js +44 -45
  77. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.d.ts +8 -1
  78. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +3 -4
  79. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.d.ts +9 -1
  80. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -4
  81. package/lib/components/Datagrid/Datagrid/DatagridHead.d.ts +8 -1
  82. package/lib/components/Datagrid/Datagrid/DatagridHead.js +3 -5
  83. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.d.ts +8 -1
  84. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +40 -35
  85. package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +2 -1
  86. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +4 -4
  87. package/lib/components/Datagrid/Datagrid/DatagridRow.d.ts +8 -1
  88. package/lib/components/Datagrid/Datagrid/DatagridRow.js +12 -16
  89. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.d.ts +9 -1
  90. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -8
  91. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.d.ts +23 -27
  92. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +9 -9
  93. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +2 -1
  94. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +3 -3
  95. package/lib/components/Datagrid/Datagrid/DatagridToolbar.d.ts +17 -10
  96. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +15 -11
  97. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +8 -1
  98. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +29 -17
  99. package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +23 -21
  100. package/lib/components/Datagrid/Datagrid/DraggableElement.js +2 -4
  101. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.d.ts +1 -1
  102. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  103. package/lib/components/Datagrid/Datagrid/addons/Slug/DatagridSlug.d.ts +12 -2
  104. package/lib/components/Datagrid/Datagrid/index.d.ts +7 -1
  105. package/lib/components/Datagrid/types/index.d.ts +210 -0
  106. package/lib/components/Datagrid/useColumnOrder.d.ts +1 -0
  107. package/lib/components/Datagrid/useDatagrid.d.ts +1 -1
  108. package/lib/components/Datagrid/useFocusRowExpander.js +1 -1
  109. package/lib/components/Datagrid/useInfiniteScroll.d.ts +8 -1
  110. package/lib/components/Datagrid/useInfiniteScroll.js +10 -9
  111. package/lib/components/Datagrid/useSelectRows.js +5 -1
  112. package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +4 -3
  113. package/lib/components/FilterSummary/FilterSummary.d.ts +21 -2
  114. package/lib/components/FilterSummary/FilterSummary.js +10 -11
  115. package/lib/components/Guidebanner/Guidebanner.js +7 -2
  116. package/lib/components/ProductiveCard/ProductiveCard.d.ts +115 -2
  117. package/lib/components/ProductiveCard/ProductiveCard.js +9 -9
  118. package/lib/components/WebTerminal/WebTerminal.js +1 -1
  119. package/lib/global/js/hooks/usePreviousValue.d.ts +1 -1
  120. package/lib/global/js/hooks/usePreviousValue.js +3 -2
  121. package/lib/global/js/hooks/useRetrieveStepData.d.ts +5 -5
  122. package/lib/global/js/hooks/useRetrieveStepData.js +5 -5
  123. package/package.json +5 -4
  124. package/telemetry.yml +67 -6
@@ -24,8 +24,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
25
 
26
26
  var _SkeletonText;
27
- var _excluded = ["role", "className"],
28
- _excluded2 = ["children", "role"];
27
+ var _excluded = ["className"],
28
+ _excluded2 = ["children"];
29
29
  var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
30
30
  var rowHeights = {
31
31
  xs: 24,
@@ -67,7 +67,7 @@ var DatagridRow = function DatagridRow(datagridState) {
67
67
  return;
68
68
  }
69
69
  var subRowCount = getVisibleNestedRowCount(row);
70
- var totalNestedRowIndicatorHeight = layout.px(subRowCount * rowHeights[rowSize]);
70
+ var totalNestedRowIndicatorHeight = layout.px(subRowCount * rowHeights[Number(rowSize)]);
71
71
  var hoverRow = event.target.closest(".".concat(blockClass, "__carbon-row-expanded"));
72
72
  hoverRow === null || hoverRow === void 0 || hoverRow.classList.add("".concat(blockClass, "__carbon-row-expanded-hover-active"));
73
73
  var rowExpanderButton = hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.querySelector(".".concat(blockClass, "__row-expander"));
@@ -94,7 +94,7 @@ var DatagridRow = function DatagridRow(datagridState) {
94
94
  };
95
95
  var handleMouseLeave = function handleMouseLeave(event) {
96
96
  if (withMouseHover) {
97
- setMouseOverRowIndex(null);
97
+ setMouseOverRowIndex === null || setMouseOverRowIndex === void 0 || setMouseOverRowIndex(null);
98
98
  }
99
99
  var hoverRow = event.target.closest(".".concat(blockClass, "__carbon-row-expanded"));
100
100
  hoverRow === null || hoverRow === void 0 || hoverRow.classList.remove("".concat(blockClass, "__carbon-row-expanded-hover-active"));
@@ -116,11 +116,8 @@ var DatagridRow = function DatagridRow(datagridState) {
116
116
  }
117
117
  return {};
118
118
  };
119
-
120
- // eslint-disable-next-line no-unused-vars
121
- var _row$getRowProps = row.getRowProps();
122
- _row$getRowProps.role;
123
- var className = _row$getRowProps.className,
119
+ var _row$getRowProps = row.getRowProps(),
120
+ className = _row$getRowProps.className,
124
121
  rowProps = _rollupPluginBabelHelpers.objectWithoutProperties(_row$getRowProps, _excluded);
125
122
  var foundAIRow = rows.some(function (r) {
126
123
  var _r$original;
@@ -147,9 +144,9 @@ var DatagridRow = function DatagridRow(datagridState) {
147
144
  var _cell$column, _cell$column2, _content$props, _associatedHeader$;
148
145
  var cellProps = cell.getCellProps();
149
146
  // eslint-disable-next-line no-unused-vars
150
- var children = cellProps.children;
151
- cellProps.role;
152
- var restProps = _rollupPluginBabelHelpers.objectWithoutProperties(cellProps, _excluded2);
147
+ var _ref2 = cellProps,
148
+ children = _ref2.children,
149
+ restProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
153
150
  var columnClassname = cell === null || cell === void 0 || (_cell$column = cell.column) === null || _cell$column === void 0 ? void 0 : _cell$column.className;
154
151
  var content = children || /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !row.isSkeleton && cell.render('Cell'), row.isSkeleton && (_SkeletonText || (_SkeletonText = /*#__PURE__*/React__default["default"].createElement(react.SkeletonText, null))));
155
152
  if ((cell === null || cell === void 0 || (_cell$column2 = cell.column) === null || _cell$column2 === void 0 ? void 0 : _cell$column2.id) === commonColumnIds.selectionColumnId) {
@@ -159,7 +156,7 @@ var DatagridRow = function DatagridRow(datagridState) {
159
156
  });
160
157
  }
161
158
  var title = content === null || content === void 0 || (_content$props = content.props) === null || _content$props === void 0 || (_content$props = _content$props.children[0]) === null || _content$props === void 0 || (_content$props = _content$props.props) === null || _content$props === void 0 ? void 0 : _content$props.value;
162
- var associatedHeader = headers.filter(function (h) {
159
+ var associatedHeader = headers === null || headers === void 0 ? void 0 : headers.filter(function (h) {
163
160
  return h.id === cell.column.id;
164
161
  });
165
162
  return /*#__PURE__*/React__default["default"].createElement(react.TableCell, _rollupPluginBabelHelpers["extends"]({
@@ -168,8 +165,7 @@ var DatagridRow = function DatagridRow(datagridState) {
168
165
  key: cell.column.id,
169
166
  title: title
170
167
  }), content);
171
- })), renderExpandedRow());
168
+ })), (renderExpandedRow === null || renderExpandedRow === void 0 ? void 0 : renderExpandedRow()) || undefined);
172
169
  };
173
- var DatagridRow$1 = DatagridRow;
174
170
 
175
- exports["default"] = DatagridRow$1;
171
+ exports["default"] = DatagridRow;
@@ -1 +1,9 @@
1
- export function SelectAll(datagridState: any): import("react/jsx-runtime").JSX.Element;
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { DataGridState } from '../types';
8
+ declare const SelectAll: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
9
+ export { SelectAll };
@@ -59,13 +59,13 @@ var SelectAll = function SelectAll(datagridState) {
59
59
  if (hideSelectAll || radio) {
60
60
  return /*#__PURE__*/React__default["default"].createElement("div", {
61
61
  className: cx__default["default"]("".concat(blockClass, "__head-hidden-select-all"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), /* istanbul ignore next */
62
- isFirstColumnStickyLeft && windowSize > 671))
62
+ isFirstColumnStickyLeft && Number(windowSize) > 671))
63
63
  });
64
64
  }
65
65
  var getProps = DatagridPagination ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
66
- var _getProps = getProps(),
67
- onChange = _getProps.onChange,
68
- selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(_getProps, _excluded);
66
+ var _ref = getProps(),
67
+ onChange = _ref.onChange,
68
+ selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
69
69
  var indeterminate = selectProps.indeterminate;
70
70
  var handleSelectAllChange = function handleSelectAllChange(event) {
71
71
  if (indeterminate) {
@@ -73,7 +73,8 @@ var SelectAll = function SelectAll(datagridState) {
73
73
  dispatch: dispatch,
74
74
  rows: rows,
75
75
  getRowId: getRowId,
76
- indeterminate: true
76
+ indeterminate: true,
77
+ isChecked: undefined
77
78
  });
78
79
  toggleAllRowsSelected(false);
79
80
  onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
@@ -87,18 +88,19 @@ var SelectAll = function SelectAll(datagridState) {
87
88
  dispatch: dispatch,
88
89
  rows: rows,
89
90
  getRowId: getRowId,
90
- isChecked: event.target.checked
91
+ isChecked: event.target.checked,
92
+ indeterminate: indeterminate
91
93
  });
92
94
  onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
93
95
  return onChange === null || onChange === void 0 ? void 0 : onChange(event);
94
96
  };
95
97
  return /*#__PURE__*/React__default["default"].createElement("div", {
96
98
  className: cx__default["default"]("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
97
- isFirstColumnStickyLeft && windowSize > 671))
99
+ isFirstColumnStickyLeft && Number(windowSize) > 671))
98
100
  }, /*#__PURE__*/React__default["default"].createElement(react.TableSelectAll, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
99
101
  name: "".concat(tableId, "-select-all-checkbox-name"),
100
102
  onSelect: handleSelectAllChange,
101
- disabled: isFetching || selectProps.disabled,
103
+ disabled: isFetching || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled),
102
104
  id: "".concat(tableId, "-select-all-checkbox-id")
103
105
  })));
104
106
  };
@@ -1,28 +1,24 @@
1
- export default SelectAllWithToggle;
2
- declare function SelectAllWithToggle({ tableId, isFetching, isAllRowsSelected, selectAllToggle, getToggleAllPageRowsSelectedProps, getToggleAllRowsSelectedProps, allPageRowsLabel, allRowsLabel, columns, withStickyColumn, }: {
3
- tableId: any;
4
- isFetching: any;
5
- isAllRowsSelected: any;
6
- selectAllToggle: any;
7
- getToggleAllPageRowsSelectedProps: any;
8
- getToggleAllRowsSelectedProps: any;
9
- allPageRowsLabel?: string | undefined;
10
- allRowsLabel?: string | undefined;
11
- columns: any;
12
- withStickyColumn: any;
13
- }): import("react/jsx-runtime").JSX.Element;
14
- declare namespace SelectAllWithToggle {
15
- namespace propTypes {
16
- let allPageRowsLabel: PropTypes.Requireable<string>;
17
- let allRowsLabel: PropTypes.Requireable<string>;
18
- let columns: PropTypes.Requireable<(object | null | undefined)[]>;
19
- let getToggleAllPageRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
20
- let getToggleAllRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
21
- let isAllRowsSelected: PropTypes.Validator<boolean>;
22
- let isFetching: PropTypes.Requireable<boolean>;
23
- let selectAllToggle: PropTypes.Requireable<object>;
24
- let tableId: PropTypes.Validator<string>;
25
- let withStickyColumn: PropTypes.Requireable<boolean>;
26
- }
27
- }
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
28
7
  import PropTypes from 'prop-types';
8
+ import { DataGridState } from '../types';
9
+ declare const SelectAllWithToggle: {
10
+ ({ tableId, isFetching, isAllRowsSelected, selectAllToggle, getToggleAllPageRowsSelectedProps, getToggleAllRowsSelectedProps, allPageRowsLabel, allRowsLabel, columns, withStickyColumn, }: DataGridState): import("react/jsx-runtime").JSX.Element;
11
+ propTypes: {
12
+ allPageRowsLabel: PropTypes.Requireable<string>;
13
+ allRowsLabel: PropTypes.Requireable<string>;
14
+ columns: PropTypes.Requireable<(object | null | undefined)[]>;
15
+ getToggleAllPageRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
16
+ getToggleAllRowsSelectedProps: PropTypes.Validator<(...args: any[]) => any>;
17
+ isAllRowsSelected: PropTypes.Validator<boolean>;
18
+ isFetching: PropTypes.Requireable<boolean>;
19
+ selectAllToggle: PropTypes.Requireable<object>;
20
+ tableId: PropTypes.Validator<string>;
21
+ withStickyColumn: PropTypes.Requireable<boolean>;
22
+ };
23
+ };
24
+ export default SelectAllWithToggle;
@@ -66,22 +66,22 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
66
66
  };
67
67
  }, []);
68
68
  if (labels) {
69
- allPageRowsLabel = labels.allPageRows || allPageRowsLabel;
69
+ allPageRowsLabel = (labels === null || labels === void 0 ? void 0 : labels.allPageRows) || allPageRowsLabel;
70
70
  allRowsLabel = labels.allRows || allRowsLabel;
71
71
  }
72
72
  var getProps = selectAllMode === SELECT_ALL_PAGE_ROWS ? getToggleAllPageRowsSelectedProps : getToggleAllRowsSelectedProps;
73
- var _getProps = getProps(),
74
- onChange = _getProps.onChange,
75
- selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(_getProps, _excluded);
73
+ var _ref3 = getProps(),
74
+ onChange = _ref3.onChange,
75
+ selectProps = _rollupPluginBabelHelpers.objectWithoutProperties(_ref3, _excluded);
76
76
  var disabled = isFetching || selectProps.disabled;
77
- var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
77
+ var isFirstColumnStickyLeft = (columns === null || columns === void 0 || (_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
78
78
  return /*#__PURE__*/React__default["default"].createElement("th", {
79
79
  scope: "col",
80
80
  className: cx__default["default"]("".concat(blockClass, "__select-all-toggle-on"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), isFirstColumnStickyLeft && windowSize > 671))
81
81
  }, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(react.Checkbox, _rollupPluginBabelHelpers["extends"]({}, selectProps, {
82
82
  name: "".concat(tableId, "-select-all-checkbox-name"),
83
83
  onClick: function onClick(e) {
84
- onChange(e);
84
+ onChange === null || onChange === void 0 || onChange(e);
85
85
  },
86
86
  disabled: disabled,
87
87
  id: "".concat(tableId, "-select-all-checkbox-id"),
@@ -101,9 +101,10 @@ var SelectAllWithToggle = function SelectAllWithToggle(_ref) {
101
101
  requireTitle: true,
102
102
  disabled: disabled,
103
103
  onClick: function onClick() {
104
+ var _ref4;
104
105
  setSelectAllMode(SELECT_ALL_PAGE_ROWS);
105
106
  // deselect all rows first
106
- getToggleAllRowsSelectedProps().onChange({
107
+ getToggleAllRowsSelectedProps === null || getToggleAllRowsSelectedProps === void 0 || (_ref4 = getToggleAllRowsSelectedProps()) === null || _ref4 === void 0 || _ref4.onChange({
107
108
  target: {
108
109
  checked: false
109
110
  }
@@ -141,6 +142,5 @@ SelectAllWithToggle.propTypes = {
141
142
  tableId: index["default"].string.isRequired,
142
143
  withStickyColumn: index["default"].bool
143
144
  };
144
- var SelectAllWithToggle$1 = SelectAllWithToggle;
145
145
 
146
- exports["default"] = SelectAllWithToggle$1;
146
+ exports["default"] = SelectAllWithToggle;
@@ -1,2 +1,3 @@
1
+ import { DataGridState } from '../types';
2
+ declare const DatagridSimpleBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
1
3
  export default DatagridSimpleBody;
2
- declare function DatagridSimpleBody(datagridState: any): import("react/jsx-runtime").JSX.Element;
@@ -31,15 +31,15 @@ var DatagridSimpleBody = function DatagridSimpleBody(datagridState) {
31
31
  "aria-live": null,
32
32
  className: cx__default["default"]("".concat(blockClass, "__simple-body"), getTableBodyProps().className)
33
33
  }), rows.map(function (row) {
34
+ var _row$RowRenderer;
34
35
  prepareRow(row);
35
36
  var _row$getRowProps = row.getRowProps(),
36
37
  key = _row$getRowProps.key;
37
- return row.RowRenderer(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
38
+ return row === null || row === void 0 || (_row$RowRenderer = row.RowRenderer) === null || _row$RowRenderer === void 0 ? void 0 : _row$RowRenderer.call(row, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
38
39
  row: row,
39
40
  key: key
40
41
  }));
41
42
  }));
42
43
  };
43
- var DatagridSimpleBody$1 = DatagridSimpleBody;
44
44
 
45
- exports["default"] = DatagridSimpleBody$1;
45
+ exports["default"] = DatagridSimpleBody;
@@ -1,11 +1,18 @@
1
- export default DatagridToolbar;
2
- declare function DatagridToolbar({ ariaToolbarLabel, ...datagridState }: {
3
- [x: string]: any;
4
- ariaToolbarLabel: any;
5
- }): import("react/jsx-runtime").JSX.Element | null;
6
- declare namespace DatagridToolbar {
7
- namespace propTypes {
8
- let ariaToolbarLabel: PropTypes.Requireable<string>;
9
- }
10
- }
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
11
7
  import PropTypes from 'prop-types';
8
+ import { DataGridState } from '../types';
9
+ interface DatagridToolbarProps {
10
+ ariaToolbarLabel?: string;
11
+ }
12
+ declare const DatagridToolbar: {
13
+ ({ ariaToolbarLabel, ...datagridState }: DatagridToolbarProps & DataGridState): import("react/jsx-runtime").JSX.Element | null;
14
+ propTypes: {
15
+ ariaToolbarLabel: PropTypes.Requireable<string>;
16
+ };
17
+ };
18
+ export default DatagridToolbar;
@@ -57,13 +57,14 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
57
57
  // the ButtonMenu
58
58
  React.useEffect(function () {
59
59
  if (totalSelected === 1 && !receivedInitialWidth) {
60
- var batchActionListWidth = ref.current.querySelector(".".concat(settings.carbon.prefix, "--action-list")).offsetWidth;
60
+ var _ref$current;
61
+ var batchActionListWidth = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(settings.carbon.prefix, "--action-list")).offsetWidth;
61
62
  setInitialListWidth(batchActionListWidth);
62
63
  setReceivedInitialWidth(true);
63
64
  }
64
65
  }, [totalSelected, receivedInitialWidth, ref]);
65
66
  React.useEffect(function () {
66
- var summaryWidth = ref.current.querySelector(".".concat(settings.carbon.prefix, "--batch-summary")).offsetWidth;
67
+ var summaryWidth = ref === null || ref === void 0 ? void 0 : ref.current.querySelector(".".concat(settings.carbon.prefix, "--batch-summary")).offsetWidth;
67
68
  if (width < summaryWidth + initialListWidth + 32) {
68
69
  setDisplayAllInMenu(true);
69
70
  } else {
@@ -88,7 +89,7 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
88
89
  var minWidthBeforeOverflowIcon = 380;
89
90
  // Do not render ButtonMenu when there are 3 or less items
90
91
  // and if there is enough available space to render all the items
91
- if ((toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
92
+ if (toolbarBatchActions && (toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.length) <= 3 && !displayAllInMenu) {
92
93
  return;
93
94
  }
94
95
  var renderItem = function renderItem(batchAction, index) {
@@ -103,7 +104,8 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
103
104
  return /*#__PURE__*/React__default["default"].createElement(react.MenuButton, {
104
105
  label: batchActionMenuButtonLabelText,
105
106
  className: cx__default["default"]([menuClass, _rollupPluginBabelHelpers.defineProperty({}, "".concat(menuClass, "-icon-only"), width <= minWidthBeforeOverflowIcon)]),
106
- tabIndex: totalSelected > 0 ? 0 : -1
107
+ tabIndex: totalSelected > 0 ? 0 : -1,
108
+ menuAlignment: "bottom"
107
109
  }, toolbarBatchActions === null || toolbarBatchActions === void 0 ? void 0 : toolbarBatchActions.map(function (batchAction, index) {
108
110
  var hidden = index < 2 && !displayAllInMenu;
109
111
  if (!hidden) {
@@ -122,10 +124,11 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
122
124
  dispatch: dispatch,
123
125
  rows: [],
124
126
  getRowId: getRowId,
125
- isChecked: false
127
+ isChecked: false,
128
+ indeterminate: undefined
126
129
  });
127
130
  toggleAllRowsSelected(false);
128
- setGlobalFilter(null);
131
+ setGlobalFilter === null || setGlobalFilter === void 0 || setGlobalFilter(null);
129
132
  };
130
133
  var onSelectAllHandler = function onSelectAllHandler() {
131
134
  toggleAllRowsSelected(true);
@@ -133,7 +136,9 @@ var DatagridBatchActionsToolbar = function DatagridBatchActionsToolbar(datagridS
133
136
  stateReducer.handleSelectAllRowData({
134
137
  dispatch: dispatch,
135
138
  rows: rows,
136
- getRowId: getRowId
139
+ getRowId: getRowId,
140
+ indeterminate: undefined,
141
+ isChecked: undefined
137
142
  });
138
143
  };
139
144
 
@@ -177,15 +182,14 @@ var DatagridToolbar = function DatagridToolbar(_ref2) {
177
182
  className: cx__default["default"]([blockClass, "".concat(blockClass, "--").concat(getRowHeight)])
178
183
  }, /*#__PURE__*/React__default["default"].createElement(react.TableToolbar, {
179
184
  "aria-label": ariaToolbarLabel
180
- }, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActionsToolbar && DatagridBatchActionsToolbar(datagridState, width, ref))) : DatagridActions ? /*#__PURE__*/React__default["default"].createElement("div", {
185
+ }, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActionsToolbar === null || DatagridBatchActionsToolbar === void 0 ? void 0 : DatagridBatchActionsToolbar(datagridState, width, ref))) : DatagridActions ? /*#__PURE__*/React__default["default"].createElement("div", {
181
186
  className: blockClass
182
187
  }, /*#__PURE__*/React__default["default"].createElement(react.TableToolbar, {
183
188
  "aria-label": ariaToolbarLabel
184
- }, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActions && DatagridBatchActions(datagridState))) : null;
189
+ }, DatagridActions && /*#__PURE__*/React__default["default"].createElement(DatagridActions, datagridState), DatagridBatchActions === null || DatagridBatchActions === void 0 ? void 0 : DatagridBatchActions(datagridState))) : null;
185
190
  };
186
191
  DatagridToolbar.propTypes = {
187
192
  ariaToolbarLabel: index["default"].string
188
193
  };
189
- var DatagridToolbar$1 = DatagridToolbar;
190
194
 
191
- exports["default"] = DatagridToolbar$1;
195
+ exports["default"] = DatagridToolbar;
@@ -1,2 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { DataGridState } from '../types';
8
+ declare const DatagridVirtualBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
1
9
  export default DatagridVirtualBody;
2
- declare function DatagridVirtualBody(datagridState: any): import("react/jsx-runtime").JSX.Element;
@@ -53,37 +53,48 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
53
53
  /* istanbul ignore next */
54
54
  var handleVirtualGridResize = function handleVirtualGridResize() {
55
55
  var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
56
- gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 ? void 0 : gridRefElement.clientWidth;
56
+ if (gridRefElement) {
57
+ var _gridRefElement$clien;
58
+ gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 || (_gridRefElement$clien = gridRefElement.clientWidth) === null || _gridRefElement$clien === void 0 ? void 0 : _gridRefElement$clien.toString();
59
+ }
57
60
  };
58
61
  useResizeObserver.useResizeObserver(gridRef, handleVirtualGridResize);
59
62
  React.useEffect(function () {
60
- handleResize();
63
+ handleResize === null || handleResize === void 0 || handleResize();
61
64
  }, [handleResize]);
62
65
  var rowHeight = rowSize && rowSizeMap[rowSize] || defaultRowHeight;
63
- if (listRef && listRef.current) {
64
- listRef.current.resetAfterIndex(0);
65
- }
66
+ React.useEffect(function () {
67
+ if (listRef && listRef.current) {
68
+ listRef.current.resetAfterIndex(0);
69
+ }
70
+ }, [listRef]);
66
71
  var visibleRows = DatagridPagination && page || rows;
67
- var testRef = React.useRef();
72
+ var testRef = React.useRef(null);
68
73
 
69
74
  // Sync the scrollLeft position of the virtual body to the table header
70
75
  React.useEffect(function () {
71
76
  function handleScroll(event) {
77
+ var _document;
72
78
  var virtualBody = event.target;
73
- document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap")).scrollLeft = virtualBody.scrollLeft;
79
+ var headWrapEl = (_document = document) === null || _document === void 0 ? void 0 : _document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap"));
80
+ if (headWrapEl) {
81
+ headWrapEl.scrollLeft = virtualBody === null || virtualBody === void 0 ? void 0 : virtualBody.scrollLeft;
82
+ }
74
83
  var spacerColumn = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap thead th:last-child"));
75
- spacerColumn.style.width = layout.px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
84
+ if (spacerColumn) {
85
+ spacerColumn.style.width = layout.px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
86
+ }
76
87
  }
77
- var testRefValue = testRef.current;
78
- testRefValue.addEventListener('scroll', handleScroll);
88
+ var testRefValue = testRef === null || testRef === void 0 ? void 0 : testRef.current;
89
+ testRefValue === null || testRefValue === void 0 || testRefValue.addEventListener('scroll', handleScroll);
79
90
  return function () {
80
- testRefValue.removeEventListener('scroll', handleScroll);
91
+ testRefValue === null || testRefValue === void 0 || testRefValue.removeEventListener('scroll', handleScroll);
81
92
  };
82
93
  });
83
94
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
84
95
  className: "".concat(blockClass, "__head-wrap"),
85
96
  style: {
86
- width: (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
97
+ width: gridRef === null || gridRef === void 0 || (_gridRef$current = gridRef.current) === null || _gridRef$current === void 0 ? void 0 : _gridRef$current.clientWidth,
87
98
  overflow: 'hidden'
88
99
  }
89
100
  }, /*#__PURE__*/React__default["default"].createElement(DatagridHead["default"], datagridState)), /*#__PURE__*/React__default["default"].createElement(react.TableBody, _rollupPluginBabelHelpers["extends"]({}, getTableBodyProps({
@@ -94,7 +105,8 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
94
105
  height: virtualHeight || tableHeight,
95
106
  itemCount: visibleRows.length,
96
107
  itemSize: function itemSize(index) {
97
- return visibleRows[index].isExpanded ? (visibleRows[index].expandedContentHeight || 0) + rowHeight : rowHeight;
108
+ var _visibleRows$index;
109
+ return (_visibleRows$index = visibleRows[index]) !== null && _visibleRows$index !== void 0 && _visibleRows$index.isExpanded ? (visibleRows[index].expandedContentHeight || 0) + rowHeight : rowHeight;
98
110
  },
99
111
  estimatedItemSize: rowHeight,
100
112
  onScroll: onScroll,
@@ -106,9 +118,10 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
106
118
  ref: listRef,
107
119
  className: "".concat(blockClass, "__virtual-scrollbar"),
108
120
  style: {
109
- width: (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.clientWidth
121
+ width: gridRef === null || gridRef === void 0 || (_gridRef$current2 = gridRef.current) === null || _gridRef$current2 === void 0 ? void 0 : _gridRef$current2.clientWidth
110
122
  }
111
123
  }, function (_ref) {
124
+ var _row$RowRenderer;
112
125
  var index = _ref.index,
113
126
  style = _ref.style;
114
127
  var row = visibleRows[index];
@@ -117,12 +130,11 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
117
130
  key = _row$getRowProps.key;
118
131
  return /*#__PURE__*/React__default["default"].createElement("div", {
119
132
  style: _rollupPluginBabelHelpers.objectSpread2({}, style)
120
- }, row.RowRenderer(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
133
+ }, row === null || row === void 0 || (_row$RowRenderer = row.RowRenderer) === null || _row$RowRenderer === void 0 ? void 0 : _row$RowRenderer.call(row, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, datagridState), {}, {
121
134
  row: row,
122
135
  key: key
123
136
  })));
124
137
  })));
125
138
  };
126
- var DatagridVirtualBody$1 = DatagridVirtualBody;
127
139
 
128
- exports["default"] = DatagridVirtualBody$1;
140
+ exports["default"] = DatagridVirtualBody;
@@ -1,22 +1,24 @@
1
- export default DraggableElement;
2
- declare function DraggableElement({ id, children, classList, disabled, ariaLabel, isSticky, selected, }: {
3
- id: any;
4
- children: any;
5
- classList: any;
6
- disabled: any;
7
- ariaLabel: any;
8
- isSticky: any;
9
- selected: any;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- declare namespace DraggableElement {
12
- namespace propTypes {
13
- let ariaLabel: PropTypes.Validator<string>;
14
- let children: PropTypes.Validator<PropTypes.ReactElementLike>;
15
- let classList: PropTypes.Requireable<string>;
16
- let disabled: PropTypes.Requireable<boolean>;
17
- let id: PropTypes.Validator<string>;
18
- let isSticky: PropTypes.Requireable<boolean>;
19
- let selected: PropTypes.Requireable<boolean>;
20
- }
21
- }
1
+ import { PropsWithChildren, ReactNode } from 'react';
22
2
  import PropTypes from 'prop-types';
3
+ interface DraggableElementProps extends PropsWithChildren {
4
+ ariaLabel: string;
5
+ children: ReactNode;
6
+ classList?: string;
7
+ disabled?: boolean;
8
+ id: string;
9
+ isSticky?: boolean;
10
+ selected?: boolean;
11
+ }
12
+ declare const DraggableElement: {
13
+ ({ id, children, classList, disabled, ariaLabel, isSticky, selected, }: DraggableElementProps): import("react/jsx-runtime").JSX.Element;
14
+ propTypes: {
15
+ ariaLabel: PropTypes.Validator<string>;
16
+ children: PropTypes.Validator<PropTypes.ReactElementLike>;
17
+ classList: PropTypes.Requireable<string>;
18
+ disabled: PropTypes.Requireable<boolean>;
19
+ id: PropTypes.Validator<string>;
20
+ isSticky: PropTypes.Requireable<boolean>;
21
+ selected: PropTypes.Requireable<boolean>;
22
+ };
23
+ };
24
+ export default DraggableElement;
@@ -53,7 +53,7 @@ var DraggableElement = function DraggableElement(_ref) {
53
53
  size: 16
54
54
  }))), children);
55
55
  var style = {
56
- transform: !disabled ? utilities.CSS.Transform.toString(transform) : {},
56
+ transform: !disabled ? utilities.CSS.Transform.toString(transform) : undefined,
57
57
  transition: transition
58
58
  };
59
59
  return /*#__PURE__*/React__default["default"].createElement("li", _rollupPluginBabelHelpers["extends"]({
@@ -62,7 +62,6 @@ var DraggableElement = function DraggableElement(_ref) {
62
62
  ref: setNodeRef,
63
63
  style: style
64
64
  }, attributes, listeners, {
65
- disabled: disabled,
66
65
  "aria-selected": selected,
67
66
  role: "option"
68
67
  }), /*#__PURE__*/React__default["default"].createElement("span", {
@@ -80,6 +79,5 @@ DraggableElement.propTypes = {
80
79
  isSticky: index["default"].bool,
81
80
  selected: index["default"].bool
82
81
  };
83
- var DraggableElement$1 = DraggableElement;
84
82
 
85
- exports["default"] = DraggableElement$1;
83
+ exports["default"] = DraggableElement;
@@ -41,7 +41,7 @@ declare namespace FilterPanel {
41
41
  let searchLabelText: PropTypes.Requireable<string>;
42
42
  let searchPlaceholder: PropTypes.Requireable<string>;
43
43
  let secondaryActionLabel: PropTypes.Requireable<string>;
44
- let setAllFilters: PropTypes.Validator<(...args: any[]) => any>;
44
+ let setAllFilters: PropTypes.Requireable<(...args: any[]) => any>;
45
45
  let showFilterSearch: PropTypes.Requireable<boolean>;
46
46
  let title: PropTypes.Requireable<string>;
47
47
  let updateMethod: PropTypes.Requireable<string>;
@@ -292,7 +292,7 @@ FilterPanel.propTypes = {
292
292
  searchLabelText: index["default"].string,
293
293
  searchPlaceholder: index["default"].string,
294
294
  secondaryActionLabel: index["default"].string,
295
- setAllFilters: index["default"].func.isRequired,
295
+ setAllFilters: index["default"].func,
296
296
  showFilterSearch: index["default"].bool,
297
297
  title: index["default"].string,
298
298
  updateMethod: index["default"].oneOf([constants.BATCH, constants.INSTANT])
@@ -1,2 +1,12 @@
1
- export const DatagridSlug: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- import React from 'react';
1
+ /**
2
+ * Copyright IBM Corp. 2024, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ReactNode } from 'react';
8
+ interface DatagridSlugProps {
9
+ slug?: ReactNode;
10
+ }
11
+ export declare const DatagridSlug: React.ForwardRefExoticComponent<DatagridSlugProps & React.RefAttributes<HTMLDivElement>>;
12
+ export {};
@@ -1 +1,7 @@
1
- export { Datagrid } from "./Datagrid";
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2022
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export { Datagrid } from './Datagrid';