@carbon/ibm-products 2.33.0 → 2.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. package/css/index-full-carbon.css +31990 -32061
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +38 -17
  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 +636 -24096
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +2342 -17830
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/ActionSet/ActionSet.d.ts +38 -2
  18. package/es/components/ActionSet/ActionSet.js +3 -5
  19. package/es/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
  20. package/es/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
  21. package/es/components/ConditionBuilder/ConditionBuilder.js +125 -0
  22. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
  23. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +92 -0
  24. package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
  25. package/es/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +88 -0
  26. package/es/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
  27. package/es/components/ConditionBuilder/index.d.ts +1 -0
  28. package/es/components/CreateFullPage/CreateFullPage.js +3 -19
  29. package/es/components/CreateFullPage/CreateFullPageStep.js +22 -7
  30. package/es/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
  31. package/es/components/CreateSidePanel/CreateSidePanel.js +5 -2
  32. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
  33. package/es/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
  34. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
  35. package/es/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
  36. package/es/components/DataSpreadsheet/utils/commonEventHandlers.js +304 -0
  37. package/es/components/Datagrid/Datagrid/DatagridContent.js +2 -1
  38. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
  39. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
  40. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  41. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +6 -2
  42. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
  43. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
  44. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
  45. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
  46. package/es/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
  47. package/es/components/Datagrid/useEditableCell.js +15 -0
  48. package/es/components/DelimitedList/DelimitedList.d.ts +27 -2
  49. package/es/components/DelimitedList/DelimitedList.js +0 -1
  50. package/es/components/EditInPlace/EditInPlace.d.ts +97 -5
  51. package/es/components/EditInPlace/EditInPlace.js +10 -6
  52. package/es/components/EditSidePanel/EditSidePanel.d.ts +92 -2
  53. package/es/components/EditSidePanel/EditSidePanel.js +8 -10
  54. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
  55. package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
  56. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
  57. package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
  58. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
  59. package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
  60. package/es/components/ExportModal/ExportModal.d.ts +110 -2
  61. package/es/components/ExportModal/ExportModal.js +10 -4
  62. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
  63. package/es/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +83 -0
  64. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
  65. package/es/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +94 -0
  66. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
  67. package/es/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
  68. package/es/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
  69. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
  70. package/es/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +157 -0
  71. package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
  72. package/es/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +72 -0
  73. package/es/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
  74. package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
  75. package/es/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +92 -0
  76. package/es/components/FilterPanel/index.d.ts +5 -0
  77. package/es/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
  78. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
  79. package/es/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
  80. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
  81. package/es/components/ImportModal/ImportModal.d.ts +136 -2
  82. package/es/components/ImportModal/ImportModal.js +3 -2
  83. package/es/components/InlineTip/InlineTip.d.ts +90 -2
  84. package/es/components/InlineTip/InlineTip.js +3 -2
  85. package/es/components/Nav/Nav.js +1 -1
  86. package/es/components/Nav/NavList.js +7 -7
  87. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  88. package/es/components/OptionsTile/OptionsTile.d.ts +77 -3
  89. package/es/components/OptionsTile/OptionsTile.js +9 -20
  90. package/es/components/PageHeader/PageHeader.js +3 -3
  91. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  92. package/es/components/PageHeader/PageHeaderUtils.js +4 -3
  93. package/es/components/RemoveModal/RemoveModal.d.ts +81 -7
  94. package/es/components/RemoveModal/RemoveModal.js +1 -0
  95. package/es/components/ScrollGradient/ScrollGradient.d.ts +5 -0
  96. package/es/components/ScrollGradient/ScrollGradient.js +156 -0
  97. package/es/components/ScrollGradient/constants.d.ts +15 -0
  98. package/es/components/ScrollGradient/constants.js +121 -0
  99. package/es/components/ScrollGradient/index.d.ts +1 -0
  100. package/es/components/SidePanel/SidePanel.d.ts +144 -2
  101. package/es/components/SidePanel/SidePanel.js +100 -75
  102. package/es/components/StatusIcon/StatusIcon.d.ts +34 -2
  103. package/es/components/StatusIcon/StatusIcon.js +97 -95
  104. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
  105. package/es/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
  106. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  107. package/es/components/TagOverflow/TagOverflow.js +209 -0
  108. package/es/components/TagOverflow/constants.d.ts +14 -0
  109. package/es/components/TagOverflow/constants.js +30 -0
  110. package/es/components/TagOverflow/index.d.ts +1 -0
  111. package/es/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
  112. package/es/components/Tearsheet/TearsheetNarrow.js +6 -1
  113. package/es/components/Toolbar/Toolbar.d.ts +23 -5
  114. package/es/components/Toolbar/Toolbar.js +30 -26
  115. package/es/components/TruncatedList/TruncatedList.js +5 -3
  116. package/es/components/UserAvatar/UserAvatar.js +7 -4
  117. package/es/components/index.d.ts +5 -2
  118. package/es/global/js/package-settings.d.ts +8 -0
  119. package/es/global/js/package-settings.js +8 -0
  120. package/es/index.js +9 -0
  121. package/es/settings.d.ts +8 -0
  122. package/lib/components/ActionSet/ActionSet.d.ts +38 -2
  123. package/lib/components/ActionSet/ActionSet.js +3 -5
  124. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +1 -1
  125. package/lib/components/ConditionBuilder/ConditionBuilder.d.ts +5 -0
  126. package/lib/components/ConditionBuilder/ConditionBuilder.js +132 -0
  127. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +10 -0
  128. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +100 -0
  129. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.d.ts +38 -0
  130. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataTreeContext.js +98 -0
  131. package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +58 -0
  132. package/lib/components/ConditionBuilder/index.d.ts +1 -0
  133. package/lib/components/CreateFullPage/CreateFullPage.js +2 -18
  134. package/lib/components/CreateFullPage/CreateFullPageStep.js +20 -5
  135. package/lib/components/CreateSidePanel/CreateSidePanel.d.ts +81 -2
  136. package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -2
  137. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.d.ts +82 -2
  138. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +5 -117
  139. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +12 -111
  140. package/lib/components/DataSpreadsheet/utils/commonEventHandlers.d.ts +4 -0
  141. package/lib/components/DataSpreadsheet/utils/commonEventHandlers.js +311 -0
  142. package/lib/components/Datagrid/Datagrid/DatagridContent.js +2 -1
  143. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +4 -1
  144. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +3 -1
  145. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +4 -1
  146. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  147. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.d.ts +1 -1
  148. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +4 -0
  149. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.d.ts +2 -1
  150. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +4 -3
  151. package/lib/components/Datagrid/Datagrid/addons/stateReducer.js +2 -1
  152. package/lib/components/Datagrid/useEditableCell.js +19 -0
  153. package/lib/components/DelimitedList/DelimitedList.d.ts +27 -2
  154. package/lib/components/DelimitedList/DelimitedList.js +0 -1
  155. package/lib/components/EditInPlace/EditInPlace.d.ts +97 -5
  156. package/lib/components/EditInPlace/EditInPlace.js +10 -6
  157. package/lib/components/EditSidePanel/EditSidePanel.d.ts +92 -2
  158. package/lib/components/EditSidePanel/EditSidePanel.js +8 -10
  159. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.d.ts +61 -2
  160. package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -3
  161. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.d.ts +61 -2
  162. package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -2
  163. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.d.ts +61 -2
  164. package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -3
  165. package/lib/components/ExportModal/ExportModal.d.ts +110 -2
  166. package/lib/components/ExportModal/ExportModal.js +10 -4
  167. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.d.ts +5 -0
  168. package/lib/components/FilterPanel/FilterPanelAccordion/FilterPanelAccordion.js +90 -0
  169. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.d.ts +5 -0
  170. package/lib/components/FilterPanel/FilterPanelAccordionItem/FilterPanelAccordionItem.js +101 -0
  171. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.d.ts +5 -0
  172. package/lib/components/FilterPanel/FilterPanelCheckbox/FilterPanelCheckbox.js +8 -10
  173. package/lib/components/FilterPanel/FilterPanelCheckbox/index.d.ts +1 -0
  174. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.d.ts +10 -0
  175. package/lib/components/FilterPanel/FilterPanelCheckboxWithOverflow/FilterPanelCheckboxWithOverflow.js +164 -0
  176. package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.d.ts +5 -0
  177. package/lib/components/FilterPanel/FilterPanelGroup/FilterPanelGroup.js +79 -0
  178. package/lib/components/FilterPanel/FilterPanelLabel/FilterPanelLabel.js +2 -2
  179. package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.d.ts +5 -0
  180. package/lib/components/FilterPanel/FilterPanelSearch/FilterPanelSearch.js +99 -0
  181. package/lib/components/FilterPanel/index.d.ts +5 -0
  182. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.d.ts +40 -2
  183. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +1 -1
  184. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.d.ts +40 -2
  185. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +1 -1
  186. package/lib/components/ImportModal/ImportModal.d.ts +136 -2
  187. package/lib/components/ImportModal/ImportModal.js +3 -2
  188. package/lib/components/InlineTip/InlineTip.d.ts +90 -2
  189. package/lib/components/InlineTip/InlineTip.js +3 -2
  190. package/lib/components/Nav/Nav.js +1 -1
  191. package/lib/components/Nav/NavList.js +7 -7
  192. package/lib/components/NotificationsPanel/NotificationsPanel.js +1 -1
  193. package/lib/components/OptionsTile/OptionsTile.d.ts +77 -3
  194. package/lib/components/OptionsTile/OptionsTile.js +9 -20
  195. package/lib/components/PageHeader/PageHeader.js +3 -3
  196. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  197. package/lib/components/PageHeader/PageHeaderUtils.js +4 -3
  198. package/lib/components/RemoveModal/RemoveModal.d.ts +81 -7
  199. package/lib/components/RemoveModal/RemoveModal.js +1 -0
  200. package/lib/components/ScrollGradient/ScrollGradient.d.ts +5 -0
  201. package/lib/components/ScrollGradient/ScrollGradient.js +163 -0
  202. package/lib/components/ScrollGradient/constants.d.ts +15 -0
  203. package/lib/components/ScrollGradient/constants.js +128 -0
  204. package/lib/components/ScrollGradient/index.d.ts +1 -0
  205. package/lib/components/SidePanel/SidePanel.d.ts +144 -2
  206. package/lib/components/SidePanel/SidePanel.js +100 -75
  207. package/lib/components/StatusIcon/StatusIcon.d.ts +34 -2
  208. package/lib/components/StatusIcon/StatusIcon.js +97 -95
  209. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.d.ts +23 -2
  210. package/lib/components/SteppedAnimatedMedia/SteppedAnimatedMedia.js +6 -5
  211. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  212. package/lib/components/TagOverflow/TagOverflow.js +216 -0
  213. package/lib/components/TagOverflow/constants.d.ts +14 -0
  214. package/lib/components/TagOverflow/constants.js +34 -0
  215. package/lib/components/TagOverflow/index.d.ts +1 -0
  216. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +105 -6
  217. package/lib/components/Tearsheet/TearsheetNarrow.js +6 -1
  218. package/lib/components/Toolbar/Toolbar.d.ts +23 -5
  219. package/lib/components/Toolbar/Toolbar.js +30 -26
  220. package/lib/components/TruncatedList/TruncatedList.js +5 -3
  221. package/lib/components/UserAvatar/UserAvatar.js +7 -4
  222. package/lib/components/index.d.ts +5 -2
  223. package/lib/global/js/package-settings.d.ts +8 -0
  224. package/lib/global/js/package-settings.js +8 -0
  225. package/lib/index.js +42 -0
  226. package/lib/settings.d.ts +8 -0
  227. package/package.json +3 -3
  228. package/scss/components/Coachmark/_coachmark-dragbar.scss +0 -1
  229. package/scss/components/Coachmark/_coachmark-tagline.scss +2 -2
  230. package/scss/components/ConditionBuilder/_carbon-imports.scss +9 -0
  231. package/scss/components/ConditionBuilder/_condition-builder.scss +25 -0
  232. package/scss/components/ConditionBuilder/_index-with-carbon.scss +9 -0
  233. package/scss/components/ConditionBuilder/_index.scss +8 -0
  234. package/scss/components/CreateFullPage/_create-full-page.scss +10 -10
  235. package/scss/components/Datagrid/styles/_useNestedRows.scss +5 -1
  236. package/scss/components/FilterPanel/_carbon-imports.scss +5 -0
  237. package/scss/components/FilterPanel/_filter-panel-accordion-item.scss +54 -0
  238. package/scss/components/FilterPanel/_filter-panel-accordion.scss +6 -0
  239. package/scss/components/FilterPanel/_filter-panel-checkbox-with-overflow.scss +60 -0
  240. package/scss/components/FilterPanel/_filter-panel-checkbox.scss +24 -3
  241. package/scss/components/FilterPanel/_filter-panel-group.scss +39 -0
  242. package/scss/components/FilterPanel/_filter-panel-label.scss +0 -8
  243. package/scss/components/FilterPanel/_filter-panel-search.scss +38 -0
  244. package/scss/components/FilterPanel/_filter-panel.scss +2 -0
  245. package/scss/components/FilterPanel/_index-with-carbon.scss +5 -0
  246. package/scss/components/FilterPanel/_index.scss +5 -0
  247. package/scss/components/Guidebanner/_guidebanner.scss +1 -1
  248. package/scss/components/InlineTip/_inline-tip.scss +1 -1
  249. package/scss/components/ProductiveCard/_productive-card.scss +13 -0
  250. package/scss/components/ScrollGradient/_carbon-imports.scss +9 -0
  251. package/scss/components/ScrollGradient/_index-with-carbon.scss +9 -0
  252. package/scss/components/ScrollGradient/_index.scss +8 -0
  253. package/scss/components/ScrollGradient/_scroll-gradient.scss +102 -0
  254. package/scss/components/SidePanel/_side-panel.scss +9 -9
  255. package/scss/components/TagOverflow/_carbon-imports.scss +9 -0
  256. package/scss/components/TagOverflow/_index-with-carbon.scss +9 -0
  257. package/scss/components/TagOverflow/_index.scss +8 -0
  258. package/scss/components/TagOverflow/_tag-overflow.scss +55 -0
  259. package/scss/components/Tearsheet/_tearsheet.scss +10 -0
  260. package/scss/components/UserAvatar/_user-avatar.scss +38 -4
  261. package/scss/components/_index-with-carbon.scss +3 -0
  262. package/scss/components/_index.scss +3 -0
@@ -92,6 +92,24 @@ exports.CreateFullPageStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
92
92
  span: 50
93
93
  }; // Half.
94
94
 
95
+ var renderDescription = function renderDescription() {
96
+ if (description) {
97
+ var common = _rollupPluginBabelHelpers.objectSpread2({
98
+ children: description,
99
+ className: "".concat(blockClass, "-description")
100
+ }, span);
101
+ if (typeof description === 'string') {
102
+ return /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({}, common, {
103
+ as: "p"
104
+ }));
105
+ } else if ( /*#__PURE__*/React.isValidElement(description)) {
106
+ return /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({}, common, {
107
+ as: "div"
108
+ }));
109
+ }
110
+ }
111
+ return null;
112
+ };
95
113
  return stepsContext ? /*#__PURE__*/React__default["default"].createElement("section", _rollupPluginBabelHelpers["extends"]({}, rest, {
96
114
  className: cx__default["default"](blockClass, className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__step--hidden-step"), stepNumber !== (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)), "".concat(blockClass, "__step--visible-step"), stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep))),
97
115
  ref: ref
@@ -101,10 +119,7 @@ exports.CreateFullPageStep = /*#__PURE__*/React.forwardRef(function (_ref, ref)
101
119
  }, span), title), subtitle && /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({
102
120
  className: "".concat(blockClass, "-subtitle"),
103
121
  as: "h6"
104
- }, span), subtitle), description && /*#__PURE__*/React__default["default"].createElement(react.Column, _rollupPluginBabelHelpers["extends"]({
105
- className: "".concat(blockClass, "-description"),
106
- as: "p"
107
- }, span), description)))), hasFieldset ? /*#__PURE__*/React__default["default"].createElement(react.FormGroup, {
122
+ }, span), subtitle), renderDescription()))), hasFieldset ? /*#__PURE__*/React__default["default"].createElement(react.FormGroup, {
108
123
  legendText: fieldsetLegendText,
109
124
  className: "".concat(blockClass, "-fieldset")
110
125
  }, children) : children) : pconsole["default"].warn("You have tried using a ".concat(componentName, " component outside of a CreateFullPage. This is not allowed. ").concat(componentName, "s should always be children of the CreateFullPage"));
@@ -124,7 +139,7 @@ exports.CreateFullPageStep.propTypes = {
124
139
  /**
125
140
  * Sets an optional description on the progress step component
126
141
  */
127
- description: index["default"].string,
142
+ description: index["default"].node,
128
143
  /**
129
144
  * This will conditionally disable the submit button in the multi step CreateFullPage
130
145
  */
@@ -1,5 +1,84 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 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 CreateSidePanelProps {
9
+ /**
10
+ * Provide an optional class to be applied to the containing node.
11
+ */
12
+ className?: string;
13
+ /**
14
+ * The description of the CreateSidePanel serves to provide more information about the form within the panel.
15
+ */
16
+ description?: ReactNode;
17
+ /**
18
+ * Specifies a boolean for disabling or enabling the primary button. This is important for form validation
19
+ * Returning `true` prevents the primary button from being clicked until required fields are completed.
20
+ */
21
+ disableSubmit?: boolean;
22
+ /**
23
+ * Specifies an optional field that provides a additional context for a form
24
+ */
25
+ formDescription?: ReactNode;
26
+ /**
27
+ * Specifies a required field that provides a title for a form
28
+ */
29
+ formTitle: ReactNode;
30
+ /**
31
+ * Unique identifier
32
+ */
33
+ id?: string;
34
+ /**
35
+ * Specifies an optional handler which is called when the CreateSidePanel
36
+ * is closed.
37
+ */
38
+ onRequestClose?(): void;
39
+ /**
40
+ * Specifies an optional handler which is called when the CreateSidePanel
41
+ * primary button is pressed.
42
+ */
43
+ onRequestSubmit?(): void;
44
+ /**
45
+ * Specifies whether the CreateSidePanel is open or not.
46
+ */
47
+ open: boolean;
48
+ /**
49
+ * Specifies the primary button's text in the modal.
50
+ */
51
+ primaryButtonText: string;
52
+ /**
53
+ * Specifies the secondary button's text in the modal.
54
+ */
55
+ secondaryButtonText: string;
56
+ /**
57
+ * This is the selector to the element that contains all of the page content that will shrink when the panel is a slide in.
58
+ * This prop is required since create flows use the `slideIn` variant of the side panel.
59
+ */
60
+ selectorPageContent: string;
61
+ /**
62
+ * Specifies which DOM element in the form should be focused.
63
+ */
64
+ selectorPrimaryFocus: string;
65
+ /**
66
+ * **Experimental:** Provide a `Slug` component to be rendered inside the `SidePanel` component
67
+ */
68
+ slug?: ReactNode;
69
+ /**
70
+ * The subtitle of the CreateSidePanel is optional and serves to provide more information about the modal.
71
+ */
72
+ subtitle?: ReactNode;
73
+ /**
74
+ * The title of the CreateSidePanel is usually the product or service name.
75
+ */
76
+ title: string;
77
+ }
1
78
  /**
2
79
  * Use with medium complexity creations if the user needs page context. On-page content can be seen and interacted with.
3
80
  */
4
- export let CreateSidePanel: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
- import React from 'react';
81
+ export declare let CreateSidePanel: React.ForwardRefExoticComponent<CreateSidePanelProps & {
82
+ children?: React.ReactNode;
83
+ } & React.RefAttributes<HTMLDivElement>>;
84
+ export {};
@@ -56,7 +56,7 @@ exports.CreateSidePanel = /*#__PURE__*/React__default["default"].forwardRef(func
56
56
  label: primaryButtonText,
57
57
  onClick: function onClick(event) {
58
58
  event.preventDefault();
59
- onRequestSubmit();
59
+ onRequestSubmit === null || onRequestSubmit === void 0 || onRequestSubmit();
60
60
  },
61
61
  kind: 'primary',
62
62
  disabled: disableSubmit,
@@ -99,6 +99,7 @@ exports.CreateSidePanel.propTypes = {
99
99
  /**
100
100
  * Sets the body content of the create side panel
101
101
  */
102
+ /**@ts-ignore*/
102
103
  children: index["default"].oneOfType([index["default"].arrayOf(index["default"].node), index["default"].node]).isRequired,
103
104
  /**
104
105
  * Provide an optional class to be applied to the containing node.
@@ -138,6 +139,7 @@ exports.CreateSidePanel.propTypes = {
138
139
  /**
139
140
  * Specifies whether the CreateSidePanel is open or not.
140
141
  */
142
+ /**@ts-ignore*/
141
143
  open: index["default"].bool,
142
144
  /**
143
145
  * Specifies the primary button's text in the modal.
@@ -155,6 +157,7 @@ exports.CreateSidePanel.propTypes = {
155
157
  /**
156
158
  * Specifies which DOM element in the form should be focused.
157
159
  */
160
+ /**@ts-ignore*/
158
161
  selectorPrimaryFocus: index["default"].node.isRequired,
159
162
  /**
160
163
  * **Experimental:** Provide a `Slug` component to be rendered inside the `SidePanel` component
@@ -167,5 +170,5 @@ exports.CreateSidePanel.propTypes = {
167
170
  /**
168
171
  * The title of the CreateSidePanel is usually the product or service name.
169
172
  */
170
- title: index["default"].node.isRequired
173
+ title: index["default"].string.isRequired
171
174
  };
@@ -1,6 +1,86 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 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
+ import React, { PropsWithChildren, ReactNode } from 'react';
8
+ type VerticalPosition = 'normal' | 'lower';
9
+ interface CreateTearsheetNarrowProps extends PropsWithChildren {
10
+ /**
11
+ * Provide the contents of the CreateTearsheetNarrow.
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * A description of the flow, displayed in the header area of the tearsheet.
20
+ */
21
+ description?: ReactNode;
22
+ /**
23
+ * Specifies a boolean for disabling or enabling the primary button. This is important for form validation
24
+ * Returning `true` prevents the primary button from being clicked until required fields are completed.
25
+ */
26
+ disableSubmit?: boolean;
27
+ /**
28
+ * Specifies an optional field that provides a additional context for a form
29
+ */
30
+ formDescription?: ReactNode;
31
+ /**
32
+ * Specifies a field that provides a title for a form
33
+ */
34
+ formTitle?: ReactNode;
35
+ /**
36
+ * A label for the tearsheet, displayed in the header area of the tearsheet
37
+ * to maintain context for the tearsheet (e.g. as the title changes from page
38
+ * to page of a multi-page task).
39
+ */
40
+ label?: ReactNode;
41
+ /**
42
+ * An optional handler that is called when the user closes the tearsheet (by
43
+ * clicking the close button, if enabled, or clicking outside, if enabled).
44
+ * Returning `false` here prevents the modal from closing.
45
+ */
46
+ onRequestClose?: () => void;
47
+ /**
48
+ * Specifies an optional handler which is called when the CreateTearsheetNarrow
49
+ * primary button is pressed.
50
+ */
51
+ onRequestSubmit?: () => void;
52
+ /**
53
+ * Specifies whether the tearsheet is currently open.
54
+ */
55
+ open?: boolean;
56
+ /**
57
+ * Specifies the primary button's text in the CreateTearsheetNarrow.
58
+ */
59
+ primaryButtonText: string;
60
+ /**
61
+ * Specifies the secondary button's text in the CreateTearsheetNarrow.
62
+ */
63
+ secondaryButtonText: string;
64
+ /**
65
+ * Specifies which DOM element in the form should be focused.
66
+ */
67
+ selectorPrimaryFocus?: ReactNode;
68
+ /**
69
+ * The main title of the tearsheet, displayed in the header area.
70
+ */
71
+ title?: ReactNode;
72
+ /**
73
+ * The position of the top of tearsheet in the viewport. The 'normal'
74
+ * position (the default) is a short distance down from the top of the
75
+ * viewport, leaving room at the top for a global header bar to show through
76
+ * from below. The 'lower' position provides a little extra room at the top
77
+ * to allow an action bar navigation or breadcrumbs to also show through.
78
+ */
79
+ verticalPosition?: VerticalPosition;
80
+ }
1
81
  /**
2
82
  * Use a narrow tearsheet as an alternative to a modal when there is scrolling.
3
83
  * Use when the form fields can be broken down into sections using section headers.
4
84
  */
5
- export let CreateTearsheetNarrow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
6
- import React from 'react';
85
+ export declare let CreateTearsheetNarrow: React.ForwardRefExoticComponent<CreateTearsheetNarrowProps & React.RefAttributes<unknown>>;
86
+ export {};
@@ -23,14 +23,11 @@ var uuidv4 = require('../../global/js/utils/uuidv4.js');
23
23
  var deepCloneObject = require('../../global/js/utils/deepCloneObject.js');
24
24
  var createActiveCellFn = require('./utils/createActiveCellFn.js');
25
25
  var getCellSize = require('./utils/getCellSize.js');
26
- var handleMultipleKeys = require('./utils/handleMultipleKeys.js');
27
26
  var handleHeaderCellSelection = require('./utils/handleHeaderCellSelection.js');
28
27
  var removeCellSelections = require('./utils/removeCellSelections.js');
29
28
  var selectAllCells = require('./utils/selectAllCells.js');
30
29
  var handleEditSubmit = require('./utils/handleEditSubmit.js');
31
- var handleActiveCellInSelectionEnter = require('./utils/handleActiveCellInSelectionEnter.js');
32
- var handleActiveCellInSelectionTab = require('./utils/handleActiveCellInSelectionTab.js');
33
- var handleCellDeletion = require('./utils/handleCellDeletion.js');
30
+ var commonEventHandlers = require('./utils/commonEventHandlers.js');
34
31
  var useActiveElement = require('../../global/js/hooks/useActiveElement.js');
35
32
  var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
36
33
  var useMultipleKeyTracking = require('./hooks/useMultipleKeyTracking.js');
@@ -45,7 +42,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
45
42
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
46
43
 
47
44
  var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
48
- // cspell:words rowcount colcount
49
45
 
50
46
  // The block part of our conventional BEM class names (blockClass__E--M).
51
47
  var blockClass = "".concat(settings.pkg.prefix, "--data-spreadsheet");
@@ -413,117 +409,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
413
409
  });
414
410
  }
415
411
  }, [handleInitialArrowPress, updateActiveCellCoordinates, activeCellCoordinates, columns, rows]);
416
- var handleKeyPress = React.useCallback(function (event) {
417
- var key = event.key;
418
- // Command keys need to be returned as there is default browser behavior with these keys
419
- // Needs to be returned in editing mode
420
- if (checkForReturnCondition(key)) {
421
- return;
422
- }
423
-
424
- // Clear out all cell selection areas if user uses any arrow key, except if the shift key is being held
425
- if (['ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown'].indexOf(key) > -1) {
426
- if (selectionAreas !== null && selectionAreas !== void 0 && selectionAreas.length && keysPressedList.length < 2 && !handleMultipleKeys.includesShift(keysPressedList)) {
427
- setSelectionAreas([]);
428
- setSelectionAreaData([]);
429
- removeCellSelections.removeCellSelections({
430
- spreadsheetRef: spreadsheetRef
431
- });
432
- }
433
- }
434
- if ((keysPressedList === null || keysPressedList === void 0 ? void 0 : keysPressedList.length) > 1) {
435
- handleMultipleKeys.handleMultipleKeys({
436
- activeCellCoordinates: activeCellCoordinates,
437
- event: event,
438
- keysPressedList: keysPressedList,
439
- selectionAreas: selectionAreas,
440
- currentMatcher: currentMatcher,
441
- rows: rows,
442
- setSelectionAreas: setSelectionAreas,
443
- columns: columns,
444
- updateActiveCellCoordinates: updateActiveCellCoordinates,
445
- spreadsheetRef: spreadsheetRef,
446
- removeCellSelections: removeCellSelections.removeCellSelections,
447
- blockClass: blockClass,
448
- setCurrentMatcher: setCurrentMatcher,
449
- usingMac: usingMac
450
- });
451
- }
452
-
453
- // Allow arrow key navigation if there are less than two activeKeys OR
454
- // if one of the activeCellCoordinates is in a header position
455
- // Prevent arrow keys, home key, and end key from scrolling the page when the data spreadsheet container has focus
456
-
457
- if (keysPressedList.length < 2 && !handleMultipleKeys.includesShift(keysPressedList) || activeCellCoordinates.row === 'header' || activeCellCoordinates.column === 'header') {
458
- switch (key) {
459
- case 'Backspace':
460
- case 'Delete':
461
- {
462
- var deleteParams = {
463
- selectionAreas: selectionAreas,
464
- currentMatcher: currentMatcher,
465
- rows: rows,
466
- setActiveCellContent: setActiveCellContent,
467
- updateData: updateData,
468
- activeCellCoordinates: activeCellCoordinates
469
- };
470
- handleCellDeletion.handleCellDeletion(deleteParams);
471
- break;
472
- }
473
- // Enter
474
- case 'Enter':
475
- {
476
- handleActiveCellInSelectionEnter.handleActiveCellInSelectionEnter({
477
- activeCellInsideSelectionArea: activeCellInsideSelectionArea,
478
- activeCellCoordinates: activeCellCoordinates,
479
- activeCellRef: activeCellRef,
480
- selectionAreas: selectionAreas,
481
- updateActiveCellCoordinates: updateActiveCellCoordinates
482
- });
483
- break;
484
- }
485
- // HOME
486
- case 'Home':
487
- case 'End':
488
- {
489
- event.preventDefault();
490
- if (handleMultipleKeys.includesResourceKey(keysPressedList, usingMac)) {
491
- return;
492
- }
493
- handleHomeEndKey({
494
- type: key
495
- });
496
- break;
497
- }
498
- // Tab
499
- case 'Tab':
500
- {
501
- if (activeCellInsideSelectionArea) {
502
- event.preventDefault();
503
- return handleActiveCellInSelectionTab.handleActiveCellInSelectionTab({
504
- activeCellInsideSelectionArea: activeCellInsideSelectionArea,
505
- activeCellCoordinates: activeCellCoordinates,
506
- activeCellRef: activeCellRef,
507
- selectionAreas: selectionAreas,
508
- updateActiveCellCoordinates: updateActiveCellCoordinates
509
- });
510
- }
511
- setSelectionAreas([]);
512
- removeActiveCell();
513
- removeCellEditor();
514
- setContainerHasFocus(false);
515
- setActiveCellCoordinates(null);
516
- break;
517
- }
518
- case 'ArrowLeft':
519
- case 'ArrowUp':
520
- case 'ArrowRight':
521
- case 'ArrowDown':
522
- {
523
- handleArrowKeyPress(key);
524
- }
525
- }
526
- }
412
+ var handleKeyPressEvent = React.useCallback(function (event) {
413
+ commonEventHandlers.handleKeyPress(event, activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress, setSelectionAreas, setSelectionAreaData, setCurrentMatcher, activeCellRef, setActiveCellCoordinates, setContainerHasFocus, setActiveCellContent);
527
414
  }, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress]);
528
415
  var startEditMode = function startEditMode() {
529
416
  setIsEditing(true);
@@ -687,6 +574,7 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
687
574
  var handleActiveCellMouseEnter = React.useCallback(function () {
688
575
  handleActiveCellMouseEnterCallback(selectionAreas, clickAndHoldActive);
689
576
  }, [clickAndHoldActive, selectionAreas, handleActiveCellMouseEnterCallback]);
577
+ // cspell:words rowcount colcount
690
578
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, getTableProps(), devtools.getDevtoolsProps(componentName), {
691
579
  className: cx__default["default"](blockClass, className, "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__container-has-focus"), containerHasFocus), "".concat(blockClass, "__").concat(theme), theme === 'dark')),
692
580
  ref: spreadsheetRef,
@@ -695,7 +583,7 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
695
583
  "aria-rowcount": (rows === null || rows === void 0 ? void 0 : rows.length) || 0,
696
584
  "aria-colcount": (columns === null || columns === void 0 ? void 0 : columns.length) || 0,
697
585
  "aria-label": spreadsheetAriaLabel,
698
- onKeyDown: handleKeyPress,
586
+ onKeyDown: handleKeyPressEvent,
699
587
  onFocus: function onFocus() {
700
588
  return setContainerHasFocus(true);
701
589
  }
@@ -17,14 +17,12 @@ var cx = require('classnames');
17
17
  var layout = require('@carbon/layout');
18
18
  var settings = require('../../settings.js');
19
19
  var deepCloneObject = require('../../global/js/utils/deepCloneObject.js');
20
- var uuidv4 = require('../../global/js/utils/uuidv4.js');
21
20
  var removeCellSelections = require('./utils/removeCellSelections.js');
22
21
  var createCellSelectionArea = require('./utils/createCellSelectionArea.js');
23
22
  var checkActiveHeaderCell = require('./utils/checkActiveHeaderCell.js');
24
23
  var checkSelectedHeaderCell = require('./utils/checkSelectedHeaderCell.js');
25
- var handleHeaderCellSelection = require('./utils/handleHeaderCellSelection.js');
26
24
  var getSpreadsheetWidth = require('./utils/getSpreadsheetWidth.js');
27
- var checkForHoldingKey = require('./utils/checkForHoldingKey.js');
25
+ var commonEventHandlers = require('./utils/commonEventHandlers.js');
28
26
  var usePreviousValue = require('../../global/js/hooks/usePreviousValue.js');
29
27
  var useSpreadsheetMouseUp = require('./hooks/useSpreadsheetMouseUp.js');
30
28
 
@@ -250,71 +248,10 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
250
248
 
251
249
  // onClick fn for each cell in the data spreadsheet body,
252
250
  // adds the active cell highlight
253
- var handleBodyCellClick = React.useCallback(function (cell, columnIndex) {
254
- return function (event) {
255
- event.preventDefault();
256
- var closestBodyCell = event.target.closest(".".concat(blockClass, "__body--td"));
257
- var isValidSelectionAreaStart = closestBodyCell.classList.contains("".concat(blockClass, "__body--td"));
258
- setValidStartingPoint(isValidSelectionAreaStart);
259
- var isHoldingCommandKey = checkForHoldingKey.checkForHoldingKey(event, 'cmd');
260
- var isHoldingShiftKey = checkForHoldingKey.checkForHoldingKey(event, 'shiftKey');
261
- setContainerHasFocus(true);
262
- var activeCoordinates = {
263
- row: cell.row.index,
264
- column: columnIndex
265
- };
266
- var tempMatcher = uuidv4["default"]();
267
- setClickAndHoldActive(true);
268
251
 
269
- // prevent multiple selections unless cmd key is held
270
- // meaning that selectionAreas should only have one item by default
271
- if (isHoldingCommandKey) {
272
- var activeCellElement = ref.current.querySelector(".".concat(blockClass, "__active-cell--highlight"));
273
- activeCellElement.setAttribute('data-selection-id', tempMatcher);
274
- setActiveCellInsideSelectionArea(true);
275
- setActiveCellCoordinates(activeCoordinates);
276
- setCurrentMatcher(tempMatcher);
277
- setSelectionAreas(function (prev) {
278
- return [].concat(_rollupPluginBabelHelpers.toConsumableArray(prev), [{
279
- point1: activeCoordinates,
280
- matcher: tempMatcher
281
- }]);
282
- });
283
- } else if (isHoldingShiftKey) {
284
- setContainerHasFocus(true);
285
- var selectionAreaClone = deepCloneObject.deepCloneObject(selectionAreas);
286
- var indexOfItemToUpdate = selectionAreaClone.findIndex(function (item) {
287
- return item.matcher === currentMatcher;
288
- });
289
- if (indexOfItemToUpdate === -1) {
290
- // There is always a selectionArea with a point1 object that updates
291
- // whenever the activeCellCoordinates update, we should always be able
292
- // to find an index, but if we do not for some reason we should return
293
- // at this point.
294
- return;
295
- } else {
296
- // Update the selectionArea that was found, do not update currentMatcher
297
- selectionAreaClone[indexOfItemToUpdate].point1 = activeCellCoordinates;
298
- selectionAreaClone[indexOfItemToUpdate].point2 = activeCoordinates;
299
- selectionAreaClone[indexOfItemToUpdate].areaCreated = false;
300
- selectionAreaClone[indexOfItemToUpdate].matcher = currentMatcher;
301
- setSelectionAreas(selectionAreaClone);
302
- }
303
- } else {
304
- activeCellRef.current.style.display = 'none';
305
- setActiveCellInsideSelectionArea(false);
306
- setActiveCellCoordinates(activeCoordinates);
307
- // remove all previous cell selections
308
- removeCellSelections.removeCellSelections({
309
- spreadsheetRef: ref
310
- });
311
- setSelectionAreas([{
312
- point1: activeCoordinates,
313
- matcher: tempMatcher
314
- }]);
315
- setCurrentMatcher(tempMatcher);
316
- setSelectionAreaData([]);
317
- }
252
+ var handleBodyCellClickEvent = React.useCallback(function (cell, columnIndex) {
253
+ return function (event) {
254
+ commonEventHandlers.handleBodyCellClick(cell, columnIndex, event, currentMatcher, activeCellCoordinates, selectionAreas, setActiveCellCoordinates, setSelectionAreas, setContainerHasFocus, setClickAndHoldActive, setCurrentMatcher, ref, setSelectionAreaData, setActiveCellInsideSelectionArea, activeCellRef, setValidStartingPoint);
318
255
  };
319
256
  }, [currentMatcher, activeCellCoordinates, selectionAreas, setActiveCellCoordinates, setSelectionAreas, setContainerHasFocus, setClickAndHoldActive, setCurrentMatcher, ref, setSelectionAreaData, setActiveCellInsideSelectionArea, activeCellRef]);
320
257
  var handleBodyScroll = function handleBodyScroll() {
@@ -330,50 +267,14 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
330
267
  contentScrollElementRef.removeEventListener('scroll', handleBodyScroll);
331
268
  };
332
269
  });
333
- var handleBodyCellHover = React.useCallback(function (cell, columnIndex) {
270
+ var handleBodyCellHoverEvent = React.useCallback(function (cell, columnIndex) {
334
271
  return function () {
335
- if (clickAndHoldActive) {
336
- var cellCoordinates = {
337
- row: cell.row.index,
338
- column: columnIndex
339
- };
340
- setSelectionAreas(function (prev) {
341
- var _selectionAreaClone$i, _selectionAreaClone$i2;
342
- var selectionAreaClone = deepCloneObject.deepCloneObject(prev);
343
- var indexOfItemToUpdate = selectionAreaClone.findIndex(function (item) {
344
- return item.matcher === currentMatcher;
345
- });
346
- // No items in the array match up with the currentMatcher value
347
- if (indexOfItemToUpdate === -1) {
348
- return prev;
349
- }
350
- // Do not update state if you're still hovering on the same cell
351
- if (((_selectionAreaClone$i = selectionAreaClone[indexOfItemToUpdate].point2) === null || _selectionAreaClone$i === void 0 ? void 0 : _selectionAreaClone$i.row) === cellCoordinates.row && ((_selectionAreaClone$i2 = selectionAreaClone[indexOfItemToUpdate].point2) === null || _selectionAreaClone$i2 === void 0 ? void 0 : _selectionAreaClone$i2.column) === cellCoordinates.column) {
352
- return prev;
353
- }
354
- selectionAreaClone[indexOfItemToUpdate].point2 = cellCoordinates;
355
- selectionAreaClone[indexOfItemToUpdate].areaCreated = false;
356
- return selectionAreaClone;
357
- });
358
- }
272
+ commonEventHandlers.handleBodyCellHover(cell, columnIndex, clickAndHoldActive, currentMatcher, setSelectionAreas);
359
273
  };
360
274
  }, [clickAndHoldActive, currentMatcher, setSelectionAreas]);
361
- var handleRowHeaderClick = React.useCallback(function (index) {
275
+ var handleRowHeaderClickEvent = React.useCallback(function (index) {
362
276
  return function (event) {
363
- var isHoldingCommandKey = checkForHoldingKey.checkForHoldingKey(event, 'cmd');
364
- handleHeaderCellSelection.handleHeaderCellSelection({
365
- type: 'row',
366
- activeCellCoordinates: activeCellCoordinates,
367
- rows: rows,
368
- columns: columns,
369
- setActiveCellCoordinates: setActiveCellCoordinates,
370
- setCurrentMatcher: setCurrentMatcher,
371
- setSelectionAreas: setSelectionAreas,
372
- spreadsheetRef: ref,
373
- index: index,
374
- setSelectionAreaData: setSelectionAreaData,
375
- isHoldingCommandKey: isHoldingCommandKey
376
- });
277
+ commonEventHandlers.handleRowHeaderClick(index, event, columns, ref, setSelectionAreas, setCurrentMatcher, setActiveCellCoordinates, activeCellCoordinates, rows, setSelectionAreaData);
377
278
  };
378
279
  }, [columns, ref, setSelectionAreas, setCurrentMatcher, setActiveCellCoordinates, activeCellCoordinates, rows, setSelectionAreaData]);
379
280
 
@@ -423,7 +324,7 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
423
324
  "data-row-index": index,
424
325
  "data-column-index": "header",
425
326
  type: "button",
426
- onClick: handleRowHeaderClick(index),
327
+ onClick: handleRowHeaderClickEvent(index),
427
328
  className: cx__default["default"]("".concat(blockClass, "__td"), "".concat(blockClass, "__td-th"), "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__td-th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === index || checkActiveHeaderCell.checkActiveHeaderCell(index, selectionAreas, 'row')), "".concat(blockClass, "__td-th--selected-header"), checkSelectedHeaderCell.checkSelectedHeaderCell(index, selectionAreas, 'row', columns))),
428
329
  style: {
429
330
  width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
@@ -445,14 +346,14 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
445
346
  "data-row-index": cell.row.index,
446
347
  "data-column-index": index,
447
348
  className: cx__default["default"]("".concat(blockClass, "__td"), "".concat(blockClass, "__body--td"), "".concat(blockClass, "--interactive-cell-element")),
448
- onMouseDown: handleBodyCellClick(cell, index),
449
- onMouseOver: handleBodyCellHover(cell, index),
349
+ onMouseDown: handleBodyCellClickEvent(cell, index),
350
+ onMouseOver: handleBodyCellHoverEvent(cell, index),
450
351
  onFocus: function onFocus() {},
451
352
  type: "button"
452
353
  }, cell.render('Cell')));
453
354
  }));
454
355
  }
455
- }, [prepareRow, rows, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClick, handleBodyCellClick, handleBodyCellHover, defaultColumn, columns]);
356
+ }, [prepareRow, rows, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClickEvent, handleBodyCellClickEvent, handleBodyCellHoverEvent, defaultColumn, columns]);
456
357
  var spreadsheetBodyRef = React.useRef();
457
358
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
458
359
  ref: spreadsheetBodyRef,
@@ -0,0 +1,4 @@
1
+ export function handleBodyCellClick(cell: any, columnIndex: any, event: any, ...rest: any[]): void;
2
+ export function handleBodyCellHover(cell: any, columnIndex: any, ...rest: any[]): void;
3
+ export function handleRowHeaderClick(index: any, event: any, ...rest: any[]): void;
4
+ export function handleKeyPress(event: any, ...rest: any[]): any;