@carbon/ibm-products 2.46.0 → 2.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/css/config-dev.css +6 -1
  2. package/css/config-dev.css.map +1 -1
  3. package/css/config.css +6 -1
  4. package/css/config.css.map +1 -1
  5. package/css/index-full-carbon.css +1323 -264
  6. package/css/index-full-carbon.css.map +1 -1
  7. package/css/index-full-carbon.min.css +1 -1
  8. package/css/index-full-carbon.min.css.map +1 -1
  9. package/css/index-without-carbon-released-only.css +49 -60
  10. package/css/index-without-carbon-released-only.css.map +1 -1
  11. package/css/index-without-carbon-released-only.min.css +1 -1
  12. package/css/index-without-carbon-released-only.min.css.map +1 -1
  13. package/css/index-without-carbon.css +1323 -264
  14. package/css/index-without-carbon.css.map +1 -1
  15. package/css/index-without-carbon.min.css +1 -1
  16. package/css/index-without-carbon.min.css.map +1 -1
  17. package/css/index.css +1323 -264
  18. package/css/index.css.map +1 -1
  19. package/css/index.min.css +1 -1
  20. package/css/index.min.css.map +1 -1
  21. package/es/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
  22. package/es/components/ActionBar/ActionBar.d.ts +58 -2
  23. package/es/components/ActionBar/ActionBar.js +14 -9
  24. package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
  25. package/es/components/ActionBar/ActionBarItem.js +7 -4
  26. package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
  27. package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
  28. package/es/components/AddSelect/types/index.d.ts +6 -0
  29. package/es/components/Card/Card.d.ts +68 -2
  30. package/es/components/Card/Card.js +28 -35
  31. package/es/components/Card/CardFooter.d.ts +51 -48
  32. package/es/components/Card/CardFooter.js +4 -2
  33. package/es/components/Card/CardHeader.d.ts +67 -49
  34. package/es/components/Card/CardHeader.js +4 -2
  35. package/es/components/Coachmark/utils/enums.d.ts +6 -0
  36. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
  37. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -4
  38. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
  39. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +6 -4
  40. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
  41. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
  42. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
  43. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
  45. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
  46. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  47. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
  48. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
  49. package/es/components/DataSpreadsheet/types/index.d.ts +6 -0
  50. package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
  51. package/es/components/Datagrid/Datagrid/DatagridContent.js +3 -2
  52. package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
  53. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
  54. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
  55. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
  56. package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
  57. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  58. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
  59. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
  60. package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
  61. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
  62. package/es/components/Datagrid/common-column-ids.d.ts +6 -0
  63. package/es/components/Datagrid/types/index.d.ts +6 -0
  64. package/es/components/Datagrid/useDatagrid.d.ts +6 -0
  65. package/es/components/Datagrid/useDisableSelectRows.d.ts +6 -0
  66. package/es/components/Datagrid/useInitialColumnSort.js +4 -0
  67. package/es/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
  68. package/es/components/Datagrid/useSortableColumns.d.ts +5 -4
  69. package/es/components/Datagrid/useSortableColumns.js +18 -13
  70. package/es/components/EmptyStates/EmptyState.d.ts +72 -5
  71. package/es/components/EmptyStates/EmptyState.js +8 -5
  72. package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  73. package/es/components/EmptyStates/EmptyStateV2.js +3 -2
  74. package/es/components/FullPageError/FullPageError.d.ts +36 -2
  75. package/es/components/FullPageError/FullPageError.js +0 -3
  76. package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
  77. package/es/components/GetStartedCard/GetStartedCard.js +11 -10
  78. package/es/components/PageHeader/PageHeaderUtils.js +1 -1
  79. package/es/components/StringFormatter/utils/enums.js +7 -0
  80. package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
  81. package/es/components/TagOverflow/TagOverflow.js +47 -64
  82. package/es/components/TagOverflow/TagOverflowModal.js +4 -6
  83. package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  84. package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
  85. package/es/components/Tearsheet/TearsheetShell.js +4 -1
  86. package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
  87. package/es/components/UserAvatar/UserAvatar.js +7 -23
  88. package/es/global/js/utils/scrollableAncestor.js +7 -0
  89. package/es/global/js/utils/uuidv4.d.ts +6 -0
  90. package/es/global/js/utils/uuidv4.js +2 -0
  91. package/es/global/js/utils/wait.d.ts +6 -0
  92. package/es/global/js/utils/wait.js +2 -0
  93. package/flags.js +7 -0
  94. package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
  95. package/lib/components/ActionBar/ActionBar.d.ts +58 -2
  96. package/lib/components/ActionBar/ActionBar.js +14 -9
  97. package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
  98. package/lib/components/ActionBar/ActionBarItem.js +6 -3
  99. package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
  100. package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
  101. package/lib/components/AddSelect/types/index.d.ts +6 -0
  102. package/lib/components/Card/Card.d.ts +68 -2
  103. package/lib/components/Card/Card.js +28 -35
  104. package/lib/components/Card/CardFooter.d.ts +51 -48
  105. package/lib/components/Card/CardFooter.js +4 -2
  106. package/lib/components/Card/CardHeader.d.ts +67 -49
  107. package/lib/components/Card/CardHeader.js +4 -2
  108. package/lib/components/Coachmark/utils/enums.d.ts +6 -0
  109. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
  110. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +16 -3
  111. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
  112. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +5 -3
  113. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
  114. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
  115. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
  116. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
  117. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
  118. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
  119. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  120. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
  121. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
  122. package/lib/components/DataSpreadsheet/types/index.d.ts +6 -0
  123. package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
  124. package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -2
  125. package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
  126. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
  127. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
  128. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
  129. package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
  130. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  131. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
  132. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
  133. package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
  134. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
  135. package/lib/components/Datagrid/common-column-ids.d.ts +6 -0
  136. package/lib/components/Datagrid/types/index.d.ts +6 -0
  137. package/lib/components/Datagrid/useDatagrid.d.ts +6 -0
  138. package/lib/components/Datagrid/useDisableSelectRows.d.ts +6 -0
  139. package/lib/components/Datagrid/useInitialColumnSort.js +4 -0
  140. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
  141. package/lib/components/Datagrid/useSortableColumns.d.ts +5 -4
  142. package/lib/components/Datagrid/useSortableColumns.js +18 -13
  143. package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
  144. package/lib/components/EmptyStates/EmptyState.js +8 -5
  145. package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  146. package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
  147. package/lib/components/FullPageError/FullPageError.d.ts +36 -2
  148. package/lib/components/FullPageError/FullPageError.js +0 -3
  149. package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
  150. package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
  151. package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
  152. package/lib/components/StringFormatter/utils/enums.js +7 -0
  153. package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
  154. package/lib/components/TagOverflow/TagOverflow.js +46 -63
  155. package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
  156. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  157. package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
  158. package/lib/components/Tearsheet/TearsheetShell.js +4 -1
  159. package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
  160. package/lib/components/UserAvatar/UserAvatar.js +7 -23
  161. package/lib/global/js/utils/scrollableAncestor.js +7 -0
  162. package/lib/global/js/utils/uuidv4.d.ts +6 -0
  163. package/lib/global/js/utils/uuidv4.js +2 -0
  164. package/lib/global/js/utils/wait.d.ts +6 -0
  165. package/lib/global/js/utils/wait.js +2 -0
  166. package/package.json +4 -4
  167. package/scss/components/ConditionBuilder/_condition-builder.scss +3 -0
  168. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +18 -2
  169. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +48 -31
  170. package/scss/components/ConditionBuilder/styles/_index.scss +7 -0
  171. package/scss/components/CreateModal/_create-modal.scss +0 -4
  172. package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
  173. package/scss/components/Datagrid/styles/_useActionsColumn.scss +6 -7
  174. package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +6 -7
  175. package/scss/components/Datagrid/styles/_useExpandedRow.scss +6 -7
  176. package/scss/components/Datagrid/styles/_useInlineEdit.scss +6 -7
  177. package/scss/components/Datagrid/styles/_useNestedRows.scss +6 -7
  178. package/scss/components/Datagrid/styles/_useNestedTable.scss +6 -7
  179. package/scss/components/Datagrid/styles/_useStickyColumn.scss +6 -7
  180. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +6 -7
  181. package/scss/config-dev.scss +7 -0
  182. package/scss/config.scss +7 -0
  183. package/telemetry.yml +2 -0
@@ -18,7 +18,8 @@ import { Bee } from '@carbon/react/icons';
18
18
  var ConditionPreview = function ConditionPreview(_ref) {
19
19
  var _ConditionBuilderItem, _ConditionBuilderItem2, _ConditionBuilderItem3;
20
20
  var previewType = _ref.previewType,
21
- group = _ref.group;
21
+ group = _ref.group,
22
+ colorIndex = _ref.colorIndex;
22
23
  var _useState = useState(false),
23
24
  _useState2 = _slicedToArray(_useState, 2),
24
25
  animate = _useState2[0],
@@ -50,6 +51,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
50
51
  className: "".concat(blockClass, "__statement-button"),
51
52
  label: group.groupOperator
52
53
  })), /*#__PURE__*/React__default.createElement("div", {
54
+ "data-color-index": colorIndex,
53
55
  "aria-hidden": true,
54
56
  className: cx(["".concat(blockClass, "__group ").concat(blockClass, "__condition-wrapper ").concat(blockClass, "__group-preview ").concat(blockClass, "__group-wrapper "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
55
57
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -58,7 +60,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
58
60
  className: "".concat(blockClass, "__statement-button"),
59
61
  label: ifText
60
62
  })), getConditionSection())), previewType == 'subGroup' && /*#__PURE__*/React__default.createElement("div", {
61
- className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
63
+ className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview ").concat(blockClass, "__gap-bottom"), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
62
64
  }, /*#__PURE__*/React__default.createElement("div", {
63
65
  className: "".concat(blockClass, "__condition-block ").concat(blockClass, "__gap")
64
66
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
@@ -71,7 +73,7 @@ var ConditionPreview = function ConditionPreview(_ref) {
71
73
  className: "".concat(blockClass, "__gap ").concat(blockClass, "__groupConnector"),
72
74
  operator: ifText
73
75
  }), getConditionSection()))), previewType == 'condition' && /*#__PURE__*/React__default.createElement("div", {
74
- className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview "), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
76
+ className: cx(["".concat(blockClass, "__group__row ").concat(blockClass, "__group-preview ").concat(blockClass, "__gap-bottom"), _defineProperty({}, "".concat(blockClass, "__group-preview-animate"), animate)])
75
77
  }, /*#__PURE__*/React__default.createElement("div", {
76
78
  className: "".concat(blockClass, "__condition-block ").concat(blockClass, "__gap")
77
79
  }, /*#__PURE__*/React__default.createElement(ConditionBuilderItem, {
@@ -82,6 +84,10 @@ var ConditionPreview = function ConditionPreview(_ref) {
82
84
  };
83
85
  var ConditionPreview$1 = ConditionPreview;
84
86
  ConditionPreview.propTypes = {
87
+ /**
88
+ * index of the color for next group
89
+ */
90
+ colorIndex: PropTypes.number,
85
91
  /**
86
92
  * current conditional group
87
93
  */
@@ -35,12 +35,18 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
35
35
  var allItems = [];
36
36
  switch (key) {
37
37
  case 'ArrowUp':
38
+ evt.preventDefault();
38
39
  //traverse through the popover options, search box, selectAll button
39
40
  parentContainer.querySelectorAll("[role=\"option\"]").forEach(function (eachElem, index, allElements) {
40
41
  traverseReverse(eachElem, index, allElements, null, null, conditionBuilderRef);
41
42
  });
43
+ //scroll to top when we reach a the top of the list to make search box visible
44
+ if (Array.from(evt.target.closest('ul').querySelectorAll('li')).indexOf(evt.target) === 1) {
45
+ parentContainer.querySelector(".".concat(blockClass, "__popover-content-wrapper")).scrollTop = 0;
46
+ }
42
47
  break;
43
48
  case 'ArrowDown':
49
+ evt.preventDefault();
44
50
  //traverse through the popover options, search box, selectAll button
45
51
  parentContainer.querySelectorAll("[role=\"option\"]").forEach(function (eachElem, index, allElements) {
46
52
  traverseClockVise(eachElem, index, allElements, null, null, conditionBuilderRef);
@@ -68,12 +74,19 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
68
74
  }
69
75
  break;
70
76
  case 'Enter':
71
- if (isMultiSelect !== 'true') {
77
+ if (isMultiSelect === 'true') {
72
78
  if (document.activeElement.type !== 'button') {
73
79
  var _document$activeEleme2;
80
+ //for button , enter key is click which already handled by framework, for other elements trigger click
81
+ (_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
82
+ }
83
+ evt.preventDefault();
84
+ } else {
85
+ if (document.activeElement.type !== 'button') {
86
+ var _document$activeEleme3;
74
87
  //for button , enter key is click which already handled by framework, else trigger click
75
88
  focusThisField(evt, conditionBuilderRef);
76
- (_document$activeEleme2 = document.activeElement) === null || _document$activeEleme2 === void 0 || _document$activeEleme2.click();
89
+ (_document$activeEleme3 = document.activeElement) === null || _document$activeEleme3 === void 0 || _document$activeEleme3.click();
77
90
  }
78
91
  }
79
92
  break;
@@ -84,7 +97,7 @@ var handleKeyPressForPopover = function handleKeyPressForPopover(evt, parentCont
84
97
  }
85
98
  };
86
99
  var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, conditionBuilderRef, variant) {
87
- var _document$activeEleme3;
100
+ var _document$activeEleme4;
88
101
  switch (evt.key) {
89
102
  case 'ArrowRight':
90
103
  evt.preventDefault();
@@ -144,9 +157,9 @@ var handleKeyPressForMainContent = function handleKeyPressForMainContent(evt, co
144
157
  }
145
158
  break;
146
159
  case 'Enter':
147
- if (((_document$activeEleme3 = document.activeElement) === null || _document$activeEleme3 === void 0 || (_document$activeEleme3 = _document$activeEleme3.querySelectorAll("button")) === null || _document$activeEleme3 === void 0 ? void 0 : _document$activeEleme3.length) === 1) {
148
- var _document$activeEleme4;
149
- (_document$activeEleme4 = document.activeElement) === null || _document$activeEleme4 === void 0 || (_document$activeEleme4 = _document$activeEleme4.querySelectorAll("button")[0]) === null || _document$activeEleme4 === void 0 || _document$activeEleme4.click();
160
+ if (((_document$activeEleme4 = document.activeElement) === null || _document$activeEleme4 === void 0 || (_document$activeEleme4 = _document$activeEleme4.querySelectorAll("button")) === null || _document$activeEleme4 === void 0 ? void 0 : _document$activeEleme4.length) === 1) {
161
+ var _document$activeEleme5;
162
+ (_document$activeEleme5 = document.activeElement) === null || _document$activeEleme5 === void 0 || (_document$activeEleme5 = _document$activeEleme5.querySelectorAll("button")[0]) === null || _document$activeEleme5 === void 0 || _document$activeEleme5.click();
150
163
  }
151
164
  break;
152
165
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  export type Size = 'xs' | 'sm' | 'md' | 'lg';
2
8
  export type Theme = 'light' | 'dark';
3
9
  export interface SpreadsheetColumn {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  import { DataGridState } from '../types';
2
8
  declare const DatagridBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
3
9
  export default DatagridBody;
@@ -40,7 +40,8 @@ var DatagridContent = function DatagridContent(_ref) {
40
40
  var _useContext2 = useContext(FilterContext),
41
41
  filterTags = _useContext2.filterTags,
42
42
  EventEmitter = _useContext2.EventEmitter,
43
- panelOpen = _useContext2.panelOpen;
43
+ panelOpen = _useContext2.panelOpen,
44
+ contextTableId = _useContext2.tableId;
44
45
  var activeCellId = inlineEditState.activeCellId,
45
46
  gridActive = inlineEditState.gridActive,
46
47
  editId = inlineEditState.editId,
@@ -151,7 +152,7 @@ var DatagridContent = function DatagridContent(_ref) {
151
152
  }
152
153
  }, [withInlineEdit, tableId, totalColumnsWidth, datagridState, gridActive]);
153
154
  useSubscribeToEventEmitter(CLEAR_SINGLE_FILTER, function (id) {
154
- return clearSingleFilter(id, setAllFilters, state);
155
+ return clearSingleFilter(id, setAllFilters, state, contextTableId);
155
156
  });
156
157
  var renderFilterSummary = function renderFilterSummary() {
157
158
  return state.filters.length > 0 && /*#__PURE__*/React__default.createElement(FilterSummary, {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  import { DataGridState } from '../types';
2
8
  declare const DatagridRefBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
3
9
  export default DatagridRefBody;
@@ -49,7 +49,7 @@ var SelectAll = function SelectAll(datagridState) {
49
49
  onAllRowSelect = datagridState.onAllRowSelect;
50
50
  var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
51
51
  if (hideSelectAll || radio) {
52
- return /*#__PURE__*/React__default.createElement("div", {
52
+ return /*#__PURE__*/React__default.createElement("th", {
53
53
  className: cx("".concat(blockClass, "__head-hidden-select-all"), _defineProperty({}, "".concat(blockClass, "__select-all-sticky-left"), /* istanbul ignore next */
54
54
  isFirstColumnStickyLeft && Number(windowSize) > 671))
55
55
  });
@@ -86,15 +86,14 @@ var SelectAll = function SelectAll(datagridState) {
86
86
  onAllRowSelect === null || onAllRowSelect === void 0 || onAllRowSelect(rows, event);
87
87
  return onChange === null || onChange === void 0 ? void 0 : onChange(event);
88
88
  };
89
- return /*#__PURE__*/React__default.createElement("div", {
89
+ return /*#__PURE__*/React__default.createElement(TableSelectAll, _extends({}, selectProps, {
90
90
  className: cx("".concat(blockClass, "__head-select-all"), "".concat(blockClass, "__checkbox-cell"), _defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), /* istanbul ignore next */
91
- isFirstColumnStickyLeft && Number(windowSize) > 671))
92
- }, /*#__PURE__*/React__default.createElement(TableSelectAll, _extends({}, selectProps, {
91
+ isFirstColumnStickyLeft && Number(windowSize) > 671)),
93
92
  name: "".concat(tableId, "-select-all-checkbox-name"),
94
93
  onSelect: handleSelectAllChange,
95
94
  disabled: isFetching || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled),
96
95
  id: "".concat(tableId, "-select-all-checkbox-id")
97
- })));
96
+ }));
98
97
  };
99
98
 
100
99
  export { SelectAll };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  import { DataGridState } from '../types';
2
8
  declare const DatagridSimpleBody: (datagridState: DataGridState) => import("react/jsx-runtime").JSX.Element;
3
9
  export default DatagridSimpleBody;
@@ -44,7 +44,9 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
44
44
  /* istanbul ignore next */
45
45
  var handleVirtualGridResize = function handleVirtualGridResize() {
46
46
  var gridRefElement = gridRef === null || gridRef === void 0 ? void 0 : gridRef.current;
47
- if (gridRefElement) {
47
+ // isHidden checks for an edge case where if the table is hidden by something like a Tab that the width can't be calculated to 0
48
+ var isHidden = (gridRefElement === null || gridRefElement === void 0 ? void 0 : gridRefElement.offsetParent) === null;
49
+ if (gridRefElement && !isHidden) {
48
50
  var _gridRefElement$clien;
49
51
  gridRefElement.style.width = gridRefElement === null || gridRefElement === void 0 || (_gridRefElement$clien = gridRefElement.clientWidth) === null || _gridRefElement$clien === void 0 ? void 0 : _gridRefElement$clien.toString();
50
52
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  import { PropsWithChildren, ReactNode } from 'react';
2
8
  import PropTypes from 'prop-types';
3
9
  interface DraggableElementProps extends PropsWithChildren {
@@ -185,7 +185,7 @@ var FilterPanel = function FilterPanel(_ref) {
185
185
  }, [filterPanelMinHeight]);
186
186
 
187
187
  // tableId is passed in from the event emitter from the FilterSummary component
188
- // in DatagridContent
188
+ // in DatagridContent
189
189
  useSubscribeToEventEmitter(CLEAR_FILTERS, function (tableId) {
190
190
  reset(tableId);
191
191
  });
@@ -1,8 +1,9 @@
1
1
  export const FilterContext: React.Context<any>;
2
- export function clearSingleFilter({ key, value }: {
2
+ export function clearSingleFilter({ key, value, tableId }: {
3
3
  key: any;
4
4
  value: any;
5
- }, setAllFilters: any, state: any): void;
5
+ tableId: any;
6
+ }, setAllFilters: any, state: any, contextTableId: any): void;
6
7
  export function FilterProvider({ children, filters, filterProps, tableId }: {
7
8
  children: any;
8
9
  filters: any;
@@ -47,9 +47,13 @@ var updateFilterState = function updateFilterState(state, type, value) {
47
47
  });
48
48
  return removeFilterItem(state, filterTagIndex);
49
49
  };
50
- var clearSingleFilter = function clearSingleFilter(_ref, setAllFilters, state) {
50
+ var clearSingleFilter = function clearSingleFilter(_ref, setAllFilters, state, contextTableId) {
51
51
  var key = _ref.key,
52
- value = _ref.value;
52
+ value = _ref.value,
53
+ tableId = _ref.tableId;
54
+ if (tableId !== contextTableId) {
55
+ return;
56
+ }
53
57
  var tempState = _toConsumableArray(state.filters);
54
58
  tempState.forEach(function (f, filterIndex) {
55
59
  if (f.id === key) {
@@ -85,10 +89,11 @@ var clearSingleFilter = function clearSingleFilter(_ref, setAllFilters, state) {
85
89
  });
86
90
  setAllFilters(tempState);
87
91
  };
88
- var handleSingleFilterRemoval = function handleSingleFilterRemoval(key, value) {
92
+ var handleSingleFilterRemoval = function handleSingleFilterRemoval(key, value, tableId) {
89
93
  EventEmitter.dispatch(CLEAR_SINGLE_FILTER, {
90
94
  key: key,
91
- value: value
95
+ value: value,
96
+ tableId: tableId
92
97
  });
93
98
  };
94
99
  var formatDateRange = function formatDateRange(startDate, endDate) {
@@ -96,7 +101,7 @@ var formatDateRange = function formatDateRange(startDate, endDate) {
96
101
  var endDateObj = new Date(endDate);
97
102
  return "".concat(startDateObj.toLocaleDateString(), " - ").concat(endDateObj.toLocaleDateString());
98
103
  };
99
- var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLabel) {
104
+ var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLabel, tableId) {
100
105
  var tags = [];
101
106
  filters.forEach(function (_ref2) {
102
107
  var id = _ref2.id,
@@ -105,7 +110,7 @@ var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLa
105
110
  var sharedFilterProps = {
106
111
  filter: true,
107
112
  onClose: function onClose() {
108
- return handleSingleFilterRemoval(id, value);
113
+ return handleSingleFilterRemoval(id, value, tableId);
109
114
  }
110
115
  };
111
116
  if (type === DROPDOWN || type === RADIO || type === NUMBER) {
@@ -130,7 +135,7 @@ var prepareFiltersForTags = function prepareFiltersForTags(filters, renderDateLa
130
135
  value: option.value
131
136
  }, sharedFilterProps), {}, {
132
137
  onClose: function onClose() {
133
- return handleSingleFilterRemoval(id, option.value);
138
+ return handleSingleFilterRemoval(id, option.value, tableId);
134
139
  }
135
140
  }));
136
141
  }
@@ -160,7 +165,7 @@ var FilterProvider = function FilterProvider(_ref4) {
160
165
  tableId = _ref4.tableId;
161
166
  var _ref5 = filterProps || {},
162
167
  renderDateLabel = _ref5.renderDateLabel;
163
- var filterTags = prepareFiltersForTags(filters, renderDateLabel);
168
+ var filterTags = prepareFiltersForTags(filters, renderDateLabel, tableId);
164
169
  var _useState = useState(false),
165
170
  _useState2 = _slicedToArray(_useState, 2),
166
171
  panelOpen = _useState2[0],
@@ -7,6 +7,13 @@
7
7
 
8
8
  import { objectSpread2 as _objectSpread2, defineProperty as _defineProperty, toConsumableArray as _toConsumableArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
9
9
 
10
+ /**
11
+ * Copyright IBM Corp. 2024
12
+ *
13
+ * This source code is licensed under the Apache-2.0 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+
10
17
  var handleCheckboxChange = function handleCheckboxChange(_ref) {
11
18
  var _option$onChange;
12
19
  var checked = _ref.checked,
@@ -203,7 +203,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
203
203
  };
204
204
  var getNewCellId = function getNewCellId(key) {
205
205
  var totalRows = instance.rows.length;
206
- var newCellId = key === 'Enter' ? "column-".concat(columnIndex, "-row-").concat(cell.row.index < totalRows - 1 ? cell.row.index + 1 : cell.row.index) : "column-".concat(columnIndex < instance.columns.length - 1 ? columnIndex + 1 : columnIndex, "-row-").concat(cell.row.index);
206
+ var newCellId = key === 'Enter' ? "column-".concat(columnIndex, "-row-").concat(cell.row.index < totalRows - 1 && type === 'checkbox' ? cell.row.index + 1 : cell.row.index) : "column-".concat(columnIndex < instance.columns.length - 1 ? columnIndex + 1 : columnIndex, "-row-").concat(cell.row.index);
207
207
  return newCellId;
208
208
  };
209
209
  var handleKeyDown = function handleKeyDown(event) {
@@ -1 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  export const selectionColumnId: "datagridSelection";
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  /// <reference path="../../../../src/custom-typings/index.d.ts" />
2
8
  import { MultiSelectProps } from '@carbon/react/lib/components/MultiSelect/MultiSelect';
3
9
  import { FormGroupProps } from '@carbon/react/lib/components/FormGroup/FormGroup';
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  import { TableInstance } from 'react-table';
2
8
  declare const useDatagrid: (params: any, ...plugins: any[]) => TableInstance;
3
9
  export default useDatagrid;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+ */
1
7
  import { Hooks } from 'react-table';
2
8
  declare const useDisableSelectRows: (hooks: Hooks) => void;
3
9
  export default useDisableSelectRows;
@@ -29,6 +29,10 @@ var useInitialColumnSort = function useInitialColumnSort(instance) {
29
29
  if (sortableColumn) {
30
30
  var columnId = sortableColumn.id,
31
31
  order = sortableColumn.order;
32
+ // prevents edge case where initial sort state of none actually starts out as ascending
33
+ if (order !== 'ASC' && order !== 'DESC') {
34
+ return;
35
+ }
32
36
  var _getNewSortOrder = getNewSortOrder(order),
33
37
  newSortDesc = _getNewSortOrder.newSortDesc,
34
38
  newOrder = _getNewSortOrder.newOrder;
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ */
1
7
  import { Hooks } from 'react-table';
2
8
  declare const useRowIsMouseOver: (hooks: Hooks) => void;
3
9
  export default useRowIsMouseOver;
@@ -5,9 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { Hooks } from 'react-table';
8
- export declare const getNewSortOrder: (sortOrder?: boolean | string) => {
9
- newSortDesc: boolean;
10
- newOrder: string;
11
- };
8
+ interface Order {
9
+ newOrder: 'ASC' | 'DESC' | 'NONE';
10
+ newSortDesc: undefined | boolean;
11
+ }
12
+ export declare const getNewSortOrder: (currentOrder?: boolean | string) => Order;
12
13
  declare const useSortableColumns: (hooks: Hooks) => void;
13
14
  export default useSortableColumns;
@@ -15,23 +15,28 @@ import { SelectAll } from './Datagrid/DatagridSelectAll.js';
15
15
  import { DatagridSlug } from './Datagrid/addons/Slug/DatagridSlug.js';
16
16
 
17
17
  var blockClass = "".concat(pkg.prefix, "--datagrid");
18
- var ordering = {
19
- ASC: 'ASC',
20
- DESC: 'DESC',
21
- NONE: 'NONE'
22
- };
23
- var getNewSortOrder = function getNewSortOrder(sortOrder) {
18
+ var getNewSortOrder = function getNewSortOrder(currentOrder) {
24
19
  var order = {
25
- newSortDesc: false,
26
- newOrder: ordering.NONE
20
+ newOrder: 'NONE',
21
+ newSortDesc: undefined
27
22
  };
28
- if (sortOrder === false || sortOrder === ordering.DESC) {
29
- order.newOrder = ordering.DESC;
23
+
24
+ // NONE => ASC
25
+ if (currentOrder === undefined) {
26
+ order.newOrder = 'ASC';
27
+ order.newSortDesc = false;
28
+ }
29
+
30
+ // ACS => DESC
31
+ if (currentOrder === false || currentOrder === 'DESC') {
32
+ order.newOrder = 'DESC';
30
33
  order.newSortDesc = true;
31
34
  }
32
- if (sortOrder === undefined || sortOrder === ordering.ASC) {
33
- order.newOrder = ordering.ASC;
34
- order.newSortDesc = false;
35
+
36
+ // DESC => NONE
37
+ if (currentOrder === true || currentOrder === 'ASC') {
38
+ order.newOrder = 'NONE';
39
+ order.newSortDesc = undefined;
35
40
  }
36
41
  return order;
37
42
  };
@@ -1,9 +1,76 @@
1
- export namespace defaults {
2
- let position: string;
3
- let size: string;
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2021
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
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
8
+ import React, { ReactNode } from 'react';
9
+ import '../../global/js/utils/props-helper';
10
+ import { ButtonProps } from '@carbon/react';
11
+ import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
12
+ declare enum sizes {
13
+ lg = "lg",
14
+ sm = "sm"
15
+ }
16
+ export declare const defaults: {
17
+ position: string;
18
+ size: sizes;
19
+ };
20
+ interface EmptyStateProps {
21
+ /**
22
+ * Empty state action button
23
+ */
24
+ action?: {
25
+ kind?: 'primary' | 'secondary' | 'tertiary';
26
+ renderIcon?: CarbonIconType;
27
+ onClick?: ButtonProps['onClick'];
28
+ text?: string;
29
+ };
30
+ /**
31
+ * Provide an optional class to be applied to the containing node.
32
+ */
33
+ className?: string;
34
+ /**
35
+ * Empty state illustration, specify the `src` for a provided illustration to be displayed. In the case of requiring a light and dark illustration of your own, simply pass the corresponding illustration based on the current theme of your application.
36
+ * For example: `illustration={appTheme === 'dark' ? darkIllustration : lightIllustration}`
37
+ */
38
+ illustration?: string;
39
+ /**
40
+ * The alt text for empty state svg images. If not provided , title will be used.
41
+ */
42
+ illustrationDescription?: string;
43
+ /**
44
+ * Designates the position of the illustration relative to the content
45
+ */
46
+ illustrationPosition?: 'top' | 'right' | 'bottom' | 'left';
47
+ /**
48
+ * Empty state link object
49
+ */
50
+ link?: {
51
+ text?: string | ReactNode;
52
+ href?: string;
53
+ };
54
+ /**
55
+ * Empty state size
56
+ */
57
+ size?: 'lg' | 'sm';
58
+ /**
59
+ * Empty state subtitle
60
+ */
61
+ subtitle?: string | ReactNode;
62
+ /**
63
+ * Empty state title
64
+ */
65
+ title: string | ReactNode;
66
+ /**
67
+ * Designates which version of the EmptyState component is being used.
68
+ * Refer to V2 documentation separately.
69
+ */
70
+ v2?: boolean;
4
71
  }
5
72
  /**
6
73
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
7
74
  */
8
- export let EmptyState: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
9
- import React from 'react';
75
+ export declare let EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
76
+ export {};
@@ -22,13 +22,15 @@ var _excluded = ["v2"],
22
22
  // The block part of our conventional BEM class names (blockClass__E--M).
23
23
  var blockClass = "".concat(pkg.prefix, "--empty-state");
24
24
  var componentName = 'EmptyState';
25
-
26
- // Default values for props
25
+ var sizes = /*#__PURE__*/function (sizes) {
26
+ sizes["lg"] = "lg";
27
+ sizes["sm"] = "sm";
28
+ return sizes;
29
+ }(sizes || {}); // Default values for props
27
30
  var defaults = {
28
31
  position: 'top',
29
- size: 'lg'
32
+ size: sizes.lg
30
33
  };
31
-
32
34
  /**
33
35
  * The `EmptyState` component follows the Carbon guidelines for empty states with some added specifications around illustration usage. For additional usage guidelines and documentation please refer to the links above.
34
36
  */
@@ -64,7 +66,7 @@ var EmptyState = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
64
66
  link: link,
65
67
  size: size,
66
68
  subtitle: subtitle,
67
- title: title
69
+ title: title !== null && title !== void 0 ? title : ''
68
70
  }));
69
71
  });
70
72
 
@@ -92,6 +94,7 @@ EmptyState.propTypes = {
92
94
  /**
93
95
  * The alt text for custom provided illustrations
94
96
  */
97
+ /**@ts-ignore*/
95
98
  illustrationDescription: PropTypes.string.isRequired.if(function (_ref2) {
96
99
  var illustration = _ref2.illustration;
97
100
  return illustration;