@carbon/ibm-products 2.43.2-canary.7 → 2.43.2-canary.70

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 (293) hide show
  1. package/css/index-full-carbon.css +167 -15
  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 +215 -5
  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 +167 -15
  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 +167 -15
  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/Coachmark/Coachmark.js +12 -7
  18. package/es/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
  19. package/es/components/CoachmarkStack/CoachmarkStack.js +7 -3
  20. package/es/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
  21. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +57 -42
  22. package/es/components/ConditionBuilder/ConditionBuilder.js +81 -24
  23. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  24. package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +151 -0
  25. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
  26. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +27 -13
  27. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
  28. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +29 -7
  29. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +10 -6
  30. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +19 -11
  31. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  32. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +58 -41
  33. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -7
  34. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +26 -8
  35. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
  36. package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +35 -24
  37. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +37 -36
  38. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +37 -36
  39. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +4 -2
  40. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +67 -33
  41. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
  42. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
  43. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +27 -9
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  45. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +114 -0
  46. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  47. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +66 -36
  48. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
  49. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +19 -7
  50. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  51. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +74 -23
  52. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  53. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +45 -19
  54. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
  55. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +120 -29
  56. package/es/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
  57. package/es/components/ConditionBuilder/utils/useTranslations.js +26 -0
  58. package/es/components/ConditionBuilder/utils/util.d.ts +1 -0
  59. package/es/components/ConditionBuilder/utils/util.js +8 -1
  60. package/es/components/CreateFullPage/CreateFullPage.js +2 -2
  61. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +20 -0
  62. package/es/components/DataSpreadsheet/DataSpreadsheet.js +58 -16
  63. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +12 -0
  64. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +22 -6
  65. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  66. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
  67. package/es/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  68. package/es/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  69. package/es/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
  70. package/es/components/Datagrid/Datagrid/Datagrid.js +4 -9
  71. package/es/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  72. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
  73. package/es/components/Datagrid/Datagrid/DatagridRow.js +21 -8
  74. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
  75. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
  76. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  77. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  78. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  79. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
  80. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  81. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  82. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
  83. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +74 -11
  84. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  85. package/es/components/Datagrid/types/index.d.ts +44 -8
  86. package/es/components/Datagrid/useActionsColumn.d.ts +8 -1
  87. package/es/components/Datagrid/useActionsColumn.js +7 -6
  88. package/es/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  89. package/es/components/Datagrid/useColumnRightAlign.js +4 -3
  90. package/es/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  91. package/es/components/Datagrid/useCustomizeColumns.js +4 -3
  92. package/es/components/Datagrid/useDefaultStringRenderer.js +0 -1
  93. package/es/components/Datagrid/useInlineEdit.js +12 -2
  94. package/es/components/Datagrid/useNestedRowExpander.js +1 -3
  95. package/es/components/Datagrid/useNestedRows.js +32 -13
  96. package/es/components/Datagrid/useRowExpander.js +1 -3
  97. package/es/components/Datagrid/useSelectRows.js +2 -1
  98. package/es/components/Datagrid/useStickyColumn.d.ts +8 -1
  99. package/es/components/Datagrid/useStickyColumn.js +12 -9
  100. package/es/components/Decorator/Decorator.js +2 -1
  101. package/es/components/DecoratorBase/DecoratorBase.js +3 -5
  102. package/es/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  103. package/es/components/DecoratorLink/DecoratorLink.js +2 -1
  104. package/es/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  105. package/es/components/EditInPlace/EditInPlace.d.ts +4 -0
  106. package/es/components/EditInPlace/EditInPlace.js +21 -10
  107. package/es/components/EditTearsheet/EditTearsheet.d.ts +7 -2
  108. package/es/components/EditTearsheet/EditTearsheet.js +44 -10
  109. package/es/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  110. package/es/components/EditTearsheet/EditTearsheetForm.js +3 -0
  111. package/es/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  112. package/es/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  113. package/es/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  114. package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
  115. package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
  116. package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
  117. package/es/components/Nav/NavItem.js +12 -3
  118. package/es/components/OptionsTile/OptionsTile.js +11 -6
  119. package/es/components/PageHeader/PageHeader.js +1 -0
  120. package/es/components/RemoveModal/RemoveModal.d.ts +4 -0
  121. package/es/components/RemoveModal/RemoveModal.js +7 -1
  122. package/es/components/SearchBar/SearchBar.d.ts +1 -1
  123. package/es/components/SearchBar/SearchBar.js +2 -2
  124. package/es/components/SidePanel/SidePanel.js +17 -21
  125. package/es/components/SidePanel/motion/variants.d.ts +4 -6
  126. package/es/components/SidePanel/motion/variants.js +10 -11
  127. package/es/components/StatusIndicator/StatusIndicatorStep.js +87 -0
  128. package/es/components/Tearsheet/Tearsheet.d.ts +8 -1
  129. package/es/components/Tearsheet/Tearsheet.js +9 -1
  130. package/es/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  131. package/es/components/Tearsheet/TearsheetNarrow.js +12 -0
  132. package/es/components/Tearsheet/TearsheetShell.d.ts +11 -1
  133. package/es/components/Tearsheet/TearsheetShell.js +24 -6
  134. package/es/components/Toolbar/ToolbarButton.js +1 -1
  135. package/es/components/WebTerminal/WebTerminal.js +10 -12
  136. package/es/components/index.d.ts +1 -1
  137. package/es/global/js/hooks/useFocus.d.ts +1 -0
  138. package/es/global/js/hooks/useFocus.js +5 -2
  139. package/es/global/js/hooks/usePrefersReducedMotion.js +14 -8
  140. package/es/global/js/package-settings.d.ts +1 -1
  141. package/es/global/js/package-settings.js +1 -1
  142. package/es/index.js +1 -0
  143. package/es/settings.d.ts +1 -1
  144. package/lib/components/Coachmark/Coachmark.js +12 -7
  145. package/lib/components/CoachmarkFixed/CoachmarkFixed.js +13 -11
  146. package/lib/components/CoachmarkStack/CoachmarkStack.js +7 -3
  147. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +8 -4
  148. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +56 -41
  149. package/lib/components/ConditionBuilder/ConditionBuilder.js +81 -24
  150. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.d.ts +15 -0
  151. package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +160 -0
  152. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +3 -1
  153. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +26 -11
  154. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +8 -1
  155. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +28 -6
  156. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +8 -4
  157. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +18 -10
  158. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +9 -11
  159. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +57 -40
  160. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +12 -7
  161. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +26 -8
  162. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +8 -2
  163. package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +34 -24
  164. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +37 -36
  165. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +37 -36
  166. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +4 -2
  167. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +66 -32
  168. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +3 -1
  169. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +24 -9
  170. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +28 -10
  171. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +13 -0
  172. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +122 -0
  173. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.d.ts → ItemOptionForValueField.d.ts} +2 -2
  174. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/{ConditionBuilderItemOption.js → ItemOptionForValueField.js} +63 -33
  175. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +5 -1
  176. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +18 -6
  177. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +1 -1
  178. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +72 -21
  179. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  180. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +44 -17
  181. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
  182. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +120 -29
  183. package/lib/components/ConditionBuilder/utils/useTranslations.d.ts +1 -0
  184. package/lib/components/ConditionBuilder/utils/useTranslations.js +30 -0
  185. package/lib/components/ConditionBuilder/utils/util.d.ts +1 -0
  186. package/lib/components/ConditionBuilder/utils/util.js +8 -0
  187. package/lib/components/CreateFullPage/CreateFullPage.js +2 -2
  188. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +20 -0
  189. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +58 -16
  190. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +12 -0
  191. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +22 -6
  192. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +8 -0
  193. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +16 -3
  194. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetMouseMove.js +4 -1
  195. package/lib/components/DataSpreadsheet/utils/moveColumnIndicatorLine.js +34 -2
  196. package/lib/components/Datagrid/Datagrid/Datagrid.d.ts +0 -4
  197. package/lib/components/Datagrid/Datagrid/Datagrid.js +4 -9
  198. package/lib/components/Datagrid/Datagrid/DatagridContent.js +1 -1
  199. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +23 -8
  200. package/lib/components/Datagrid/Datagrid/DatagridRow.js +21 -8
  201. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +2 -1
  202. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +3 -2
  203. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +6 -1
  204. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -1
  205. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -1
  206. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +7 -4
  207. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.d.ts +1 -1
  208. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +21 -16
  209. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +2 -3
  210. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +73 -10
  211. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +10 -2
  212. package/lib/components/Datagrid/types/index.d.ts +44 -8
  213. package/lib/components/Datagrid/useActionsColumn.d.ts +8 -1
  214. package/lib/components/Datagrid/useActionsColumn.js +7 -6
  215. package/lib/components/Datagrid/useColumnRightAlign.d.ts +8 -1
  216. package/lib/components/Datagrid/useColumnRightAlign.js +4 -3
  217. package/lib/components/Datagrid/useCustomizeColumns.d.ts +8 -1
  218. package/lib/components/Datagrid/useCustomizeColumns.js +4 -3
  219. package/lib/components/Datagrid/useDefaultStringRenderer.js +0 -1
  220. package/lib/components/Datagrid/useInlineEdit.js +12 -2
  221. package/lib/components/Datagrid/useNestedRowExpander.js +1 -3
  222. package/lib/components/Datagrid/useNestedRows.js +32 -13
  223. package/lib/components/Datagrid/useRowExpander.js +1 -3
  224. package/lib/components/Datagrid/useSelectRows.js +2 -1
  225. package/lib/components/Datagrid/useStickyColumn.d.ts +8 -1
  226. package/lib/components/Datagrid/useStickyColumn.js +12 -9
  227. package/lib/components/Decorator/Decorator.js +2 -1
  228. package/lib/components/DecoratorBase/DecoratorBase.js +3 -5
  229. package/lib/components/DecoratorDualButton/DecoratorDualButton.js +2 -1
  230. package/lib/components/DecoratorLink/DecoratorLink.js +2 -1
  231. package/lib/components/DecoratorSingleButton/DecoratorSingleButton.js +2 -1
  232. package/lib/components/EditInPlace/EditInPlace.d.ts +4 -0
  233. package/lib/components/EditInPlace/EditInPlace.js +21 -10
  234. package/lib/components/EditTearsheet/EditTearsheet.d.ts +7 -2
  235. package/lib/components/EditTearsheet/EditTearsheet.js +43 -9
  236. package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +45 -2
  237. package/lib/components/EditTearsheet/EditTearsheetForm.js +3 -0
  238. package/lib/components/HTTPErrors/HTTPError403/HTTPError403.js +6 -0
  239. package/lib/components/HTTPErrors/HTTPError404/HTTPError404.js +6 -0
  240. package/lib/components/HTTPErrors/HTTPErrorOther/HTTPErrorOther.js +6 -0
  241. package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +204 -200
  242. package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +116 -112
  243. package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +110 -106
  244. package/lib/components/Nav/NavItem.js +10 -1
  245. package/lib/components/OptionsTile/OptionsTile.js +11 -6
  246. package/lib/components/PageHeader/PageHeader.js +1 -0
  247. package/lib/components/RemoveModal/RemoveModal.d.ts +4 -0
  248. package/lib/components/RemoveModal/RemoveModal.js +7 -1
  249. package/lib/components/SearchBar/SearchBar.d.ts +1 -1
  250. package/lib/components/SearchBar/SearchBar.js +2 -2
  251. package/lib/components/SidePanel/SidePanel.js +16 -20
  252. package/lib/components/SidePanel/motion/variants.d.ts +4 -6
  253. package/lib/components/SidePanel/motion/variants.js +10 -11
  254. package/lib/components/StatusIndicator/StatusIndicatorStep.js +94 -0
  255. package/lib/components/Tearsheet/Tearsheet.d.ts +8 -1
  256. package/lib/components/Tearsheet/Tearsheet.js +9 -1
  257. package/lib/components/Tearsheet/TearsheetNarrow.d.ts +11 -0
  258. package/lib/components/Tearsheet/TearsheetNarrow.js +12 -0
  259. package/lib/components/Tearsheet/TearsheetShell.d.ts +11 -1
  260. package/lib/components/Tearsheet/TearsheetShell.js +22 -4
  261. package/lib/components/Toolbar/ToolbarButton.js +1 -1
  262. package/lib/components/WebTerminal/WebTerminal.js +10 -12
  263. package/lib/components/index.d.ts +1 -1
  264. package/lib/global/js/hooks/useFocus.d.ts +1 -0
  265. package/lib/global/js/hooks/useFocus.js +5 -1
  266. package/lib/global/js/hooks/usePrefersReducedMotion.js +13 -7
  267. package/lib/global/js/package-settings.d.ts +1 -1
  268. package/lib/global/js/package-settings.js +1 -1
  269. package/lib/index.js +5 -0
  270. package/lib/settings.d.ts +1 -1
  271. package/package.json +7 -6
  272. package/scss/components/ConditionBuilder/_condition-builder.scss +1 -1
  273. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +14 -2
  274. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +31 -2
  275. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +17 -2
  276. package/scss/components/Datagrid/_datagrid.scss +0 -4
  277. package/scss/components/Datagrid/styles/_useInlineEdit.scss +13 -0
  278. package/scss/components/HTTPErrors/_http-errors.scss +77 -0
  279. package/scss/components/OptionsTile/_options-tile.scss +6 -6
  280. package/scss/components/SidePanel/_side-panel.scss +1 -1
  281. package/scss/components/StatusIcon/_status-icon.scss +4 -4
  282. package/scss/components/StringFormatter/_string-formatter.scss +2 -2
  283. package/scss/components/UserProfileImage/_user-profile-image.scss +6 -2
  284. package/scss/components/_index-released-only.scss +1 -0
  285. package/telemetry.yml +27 -5
  286. package/es/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  287. package/es/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -16
  288. package/es/global/js/utils/window.d.ts +0 -2
  289. package/es/global/js/utils/window.js +0 -12
  290. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.d.ts +0 -1
  291. package/lib/components/ConditionBuilder/utils/checkForHoldingKey.js +0 -20
  292. package/lib/global/js/utils/window.d.ts +0 -2
  293. package/lib/global/js/utils/window.js +0 -16
@@ -20,6 +20,10 @@ interface DataSpreadsheetProps {
20
20
  * The data that will build the column headers
21
21
  */
22
22
  columns?: readonly Column<object>[];
23
+ /**
24
+ * Disable column swapping, default false
25
+ */
26
+ disableColumnSwapping?: boolean;
23
27
  /**
24
28
  * The spreadsheet data that will be rendered in the body of the spreadsheet component
25
29
  */
@@ -28,6 +32,10 @@ interface DataSpreadsheetProps {
28
32
  * Sets the number of empty rows to be created when there is no data provided
29
33
  */
30
34
  defaultEmptyRowCount?: number;
35
+ /**
36
+ * Check if has custom row header component attached
37
+ */
38
+ hasCustomRowHeader?: boolean;
31
39
  /**
32
40
  * The spreadsheet id
33
41
  */
@@ -46,6 +54,18 @@ interface DataSpreadsheetProps {
46
54
  * The event handler that is called when the selection area values change
47
55
  */
48
56
  onSelectionAreaChange?: () => void;
57
+ /**
58
+ * Read-only table
59
+ */
60
+ readOnlyTable?: boolean;
61
+ /**
62
+ * Position of the custom row numbering component
63
+ */
64
+ renderRowHeaderDirection?: 'left' | 'right';
65
+ /**
66
+ * Component next to numbering rows
67
+ */
68
+ renderRowHeader?: (index: number) => any[];
49
69
  /**
50
70
  * The aria label applied to the Select all button
51
71
  */
@@ -41,7 +41,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
41
41
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
42
42
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
43
43
 
44
- var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
44
+ var _excluded = ["cellSize", "className", "columns", "data", "defaultEmptyRowCount", "onDataUpdate", "id", "onActiveCellChange", "onSelectionAreaChange", "renderRowHeader", "renderRowHeaderDirection", "disableColumnSwapping", "readOnlyTable", "selectAllAriaLabel", "spreadsheetAriaLabel", "theme", "totalVisibleColumns"];
45
45
  // The block part of our conventional BEM class names (blockClass__E--M).
46
46
  var blockClass = "".concat(settings.pkg.prefix, "--data-spreadsheet");
47
47
  var componentName = 'DataSpreadsheet';
@@ -76,6 +76,12 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
76
76
  onActiveCellChange = _ref$onActiveCellChan === void 0 ? defaults.onActiveCellChange : _ref$onActiveCellChan,
77
77
  _ref$onSelectionAreaC = _ref.onSelectionAreaChange,
78
78
  onSelectionAreaChange = _ref$onSelectionAreaC === void 0 ? defaults.onSelectionAreaChange : _ref$onSelectionAreaC,
79
+ renderRowHeader = _ref.renderRowHeader,
80
+ renderRowHeaderDirection = _ref.renderRowHeaderDirection,
81
+ _ref$disableColumnSwa = _ref.disableColumnSwapping,
82
+ disableColumnSwapping = _ref$disableColumnSwa === void 0 ? false : _ref$disableColumnSwa,
83
+ _ref$readOnlyTable = _ref.readOnlyTable,
84
+ readOnlyTable = _ref$readOnlyTable === void 0 ? false : _ref$readOnlyTable,
79
85
  selectAllAriaLabel = _ref.selectAllAriaLabel,
80
86
  spreadsheetAriaLabel = _ref.spreadsheetAriaLabel,
81
87
  theme = _ref.theme,
@@ -147,13 +153,15 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
147
153
  setActiveCellContent = _useState26[1];
148
154
  var activeCellRef = React.useRef();
149
155
  var cellEditorRulerRef = React.useRef();
156
+ var hasCustomRowHeader = typeof renderRowHeader === 'function';
157
+ var maxNumRowsCount = data.length.toString().length;
150
158
  var defaultColumn = React.useMemo(function () {
151
159
  return {
152
160
  width: 150,
153
- rowHeaderWidth: 64,
161
+ rowHeaderWidth: hasCustomRowHeader ? 40 + maxNumRowsCount * 8.56 : 64,
154
162
  rowHeight: cellSizeValue
155
163
  };
156
- }, [cellSizeValue]);
164
+ }, [cellSizeValue, hasCustomRowHeader, maxNumRowsCount]);
157
165
  var _useMultipleKeyTracki = useMultipleKeyTracking.useMultipleKeyTracking({
158
166
  ref: multiKeyTrackingRef,
159
167
  containerHasFocus: containerHasFocus,
@@ -220,9 +228,12 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
220
228
  }
221
229
  if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) {
222
230
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
223
- var _activeCellFullData$r;
224
231
  var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
225
- setActiveCellContent((_activeCellFullData$r = activeCellFullData === null || activeCellFullData === void 0 ? void 0 : activeCellFullData.render('Cell')) !== null && _activeCellFullData$r !== void 0 ? _activeCellFullData$r : null);
232
+ if (activeCellFullData) {
233
+ setActiveCellContent(activeCellFullData.render('Cell'));
234
+ } else {
235
+ setActiveCellContent(null);
236
+ }
226
237
  }
227
238
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
228
239
  setActiveCellContent(null);
@@ -429,16 +440,16 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
429
440
  }
430
441
  }, [handleInitialArrowPress, updateActiveCellCoordinates, activeCellCoordinates, columns, rows]);
431
442
  var handleKeyPressEvent = React.useCallback(function (event) {
432
- 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);
433
- }, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress]);
443
+ 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, readOnlyTable);
444
+ }, [activeCellInsideSelectionArea, updateActiveCellCoordinates, activeCellCoordinates, removeActiveCell, columns, rows, spreadsheetRef, currentMatcher, removeCellEditor, selectionAreas, handleHomeEndKey, keysPressedList, usingMac, updateData, checkForReturnCondition, handleArrowKeyPress, readOnlyTable]);
434
445
  var startEditMode = function startEditMode() {
435
446
  setIsEditing(true);
436
447
  setClickAndHoldActive(false);
437
448
  var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
438
449
  var activeCellValue;
439
450
  if (activeCellFullData && activeCellCoordinates !== null && activeCellCoordinates !== void 0 && activeCellCoordinates.column) {
440
- var _activeCellFullData$r2;
441
- activeCellValue = activeCellFullData ? (_activeCellFullData$r2 = activeCellFullData.row.cells) === null || _activeCellFullData$r2 === void 0 || (_activeCellFullData$r2 = _activeCellFullData$r2[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r2 === void 0 ? void 0 : _activeCellFullData$r2.value : null;
451
+ var _activeCellFullData$r;
452
+ activeCellValue = activeCellFullData ? (_activeCellFullData$r = activeCellFullData.row.cells) === null || _activeCellFullData$r === void 0 || (_activeCellFullData$r = _activeCellFullData$r[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r === void 0 ? void 0 : _activeCellFullData$r.value : null;
442
453
  }
443
454
  setCellEditorValue(activeCellValue || '');
444
455
  if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
@@ -501,7 +512,7 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
501
512
  // Go into edit mode if 'Enter' key is pressed on activeCellRef
502
513
  var handleActiveCellKeyDown = function handleActiveCellKeyDown(event) {
503
514
  var key = event.key;
504
- if (key === 'Enter' && !activeCellInsideSelectionArea) {
515
+ if (key === 'Enter' && !activeCellInsideSelectionArea && !readOnlyTable) {
505
516
  if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header') {
506
517
  startEditMode();
507
518
  }
@@ -557,8 +568,10 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
557
568
  };
558
569
 
559
570
  // Go into edit mode if double click is detected on activeCellRef
560
- var handleActiveCellDoubleClick = function handleActiveCellDoubleClick() {
561
- startEditMode();
571
+ var handleActiveCellDoubleClick = function handleActiveCellDoubleClick(readOnlyTable) {
572
+ if (!readOnlyTable) {
573
+ startEditMode();
574
+ }
562
575
  };
563
576
  useSpreadsheetEdit.useSpreadsheetEdit({
564
577
  isEditing: isEditing,
@@ -638,6 +651,8 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
638
651
  setSelectionAreas: setSelectionAreas,
639
652
  setCurrentMatcher: setCurrentMatcher,
640
653
  setSelectionAreaData: setSelectionAreaData,
654
+ disableColumnSwapping: disableColumnSwapping,
655
+ readOnlyTable: readOnlyTable,
641
656
  totalVisibleColumns: totalVisibleColumns,
642
657
  updateActiveCellCoordinates: updateActiveCellCoordinates,
643
658
  setHeaderCellHoldActive: setHeaderCellHoldActive,
@@ -660,7 +675,10 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
660
675
  headerGroups: headerGroups,
661
676
  defaultColumn: defaultColumn,
662
677
  getTableBodyProps: getTableBodyProps,
678
+ hasCustomRowHeader: hasCustomRowHeader,
663
679
  onDataUpdate: onDataUpdate,
680
+ renderRowHeaderDirection: renderRowHeaderDirection,
681
+ renderRowHeader: renderRowHeader,
664
682
  onActiveCellChange: onActiveCellChange,
665
683
  onSelectionAreaChange: onSelectionAreaChange,
666
684
  prepareRow: prepareRow,
@@ -683,7 +701,9 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
683
701
  onMouseUp: handleActiveCellMouseUp,
684
702
  onClick: handleActiveCellClick,
685
703
  onKeyDown: handleActiveCellKeyDown,
686
- onDoubleClick: handleActiveCellDoubleClick,
704
+ onDoubleClick: function onDoubleClick() {
705
+ return handleActiveCellDoubleClick(readOnlyTable);
706
+ },
687
707
  onMouseEnter: handleActiveCellMouseEnter,
688
708
  ref: activeCellRef,
689
709
  className: cx__default["default"]("".concat(blockClass, "--interactive-cell-element"), "".concat(blockClass, "__active-cell--highlight"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__active-cell--with-selection"), activeCellInsideSelectionArea)),
@@ -705,9 +725,11 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
705
725
  updateData: updateData
706
726
  }),
707
727
  onChange: function onChange(event) {
708
- setCellEditorValue(event.target.value);
709
- if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
710
- cellEditorRulerRef.current.textContent = event.target.value;
728
+ if (previousState.isEditing) {
729
+ setCellEditorValue(event.target.value);
730
+ if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
731
+ cellEditorRulerRef.current.textContent = event.target.value;
732
+ }
711
733
  }
712
734
  },
713
735
  ref: cellEditorRef,
@@ -757,6 +779,14 @@ exports.DataSpreadsheet.propTypes = {
757
779
  * Sets the number of empty rows to be created when there is no data provided
758
780
  */
759
781
  defaultEmptyRowCount: index["default"].number,
782
+ /**
783
+ * Disable column swapping, default false
784
+ */
785
+ disableColumnSwapping: index["default"].bool,
786
+ /**
787
+ * Check if spreadsheet is using custom row header component attached
788
+ */
789
+ hasCustomRowHeader: index["default"].bool,
760
790
  /**
761
791
  * The spreadsheet id
762
792
  */
@@ -773,6 +803,18 @@ exports.DataSpreadsheet.propTypes = {
773
803
  * The event handler that is called when the selection area values change
774
804
  */
775
805
  onSelectionAreaChange: index["default"].func,
806
+ /**
807
+ * Read-only table
808
+ */
809
+ readOnlyTable: index["default"].bool,
810
+ /**
811
+ * Component next to numbering rows
812
+ */
813
+ renderRowHeader: index["default"].func,
814
+ /**
815
+ * Component next to numbering rows
816
+ */
817
+ renderRowHeaderDirection: index["default"].oneOf(['left', 'right']),
776
818
  /**
777
819
  * The aria label applied to the Select all button
778
820
  */
@@ -52,6 +52,18 @@ interface DataSpreadsheetBodyProps {
52
52
  * The event handler that is called when the active cell changes
53
53
  */
54
54
  onActiveCellChange?: () => void;
55
+ /**
56
+ * Check if user is using custom component
57
+ */
58
+ hasCustomRowHeader?: boolean;
59
+ /**
60
+ * Component next to numbering rows
61
+ */
62
+ renderRowHeader?: (index: number) => any[];
63
+ /**
64
+ * Component next to numbering rows
65
+ */
66
+ renderRowHeaderDirection?: string;
55
67
  /**
56
68
  * The event handler that is called to set the rows for the empty spreadsheet
57
69
  */
@@ -44,6 +44,9 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
44
44
  headerGroups = _ref.headerGroups,
45
45
  id = _ref.id,
46
46
  onDataUpdate = _ref.onDataUpdate,
47
+ renderRowHeader = _ref.renderRowHeader,
48
+ renderRowHeaderDirection = _ref.renderRowHeaderDirection,
49
+ hasCustomRowHeader = _ref.hasCustomRowHeader,
47
50
  prepareRow = _ref.prepareRow,
48
51
  rows = _ref.rows,
49
52
  selectionAreaData = _ref.selectionAreaData,
@@ -147,7 +150,7 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
147
150
  return;
148
151
  });
149
152
  }
150
- }, [selectionAreas, setSelectionAreas, defaultColumn, onSelectionAreaChange, setSelectionAreaData, ref, activeCellCoordinates, setActiveCellInsideSelectionArea, visibleColumns]);
153
+ }, [selectionAreas, setSelectionAreas, defaultColumn, onSelectionAreaChange, setSelectionAreaData, ref, activeCellCoordinates, setActiveCellInsideSelectionArea, visibleColumns, hasCustomRowHeader]);
151
154
  var populateSelectionAreaCellData = function populateSelectionAreaCellData(_ref2) {
152
155
  var rowStart = _ref2.rowStart,
153
156
  rowEnd = _ref2.rowEnd,
@@ -221,7 +224,7 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
221
224
  });
222
225
  }
223
226
  }
224
- }, [defaultColumn, ref, activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.rowHeight, selectionAreas, setActiveCellInsideSelectionArea, setSelectionAreas, visibleColumns]);
227
+ }, [defaultColumn, ref, activeCellCoordinates, previousState === null || previousState === void 0 ? void 0 : previousState.rowHeight, selectionAreas, setActiveCellInsideSelectionArea, setSelectionAreas, visibleColumns, hasCustomRowHeader]);
225
228
 
226
229
  //this method will check for any duplicate selection area and remove.
227
230
  //same selections are those have the same height, width, top, left styles. These inline styles are being set in createCellSelection util.
@@ -347,11 +350,12 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
347
350
  "data-column-index": "header",
348
351
  type: "button",
349
352
  onClick: handleRowHeaderClickEvent(index),
350
- 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))),
353
+ className: cx__default["default"]("".concat(blockClass, "__td"), "".concat(blockClass, "__td-th"), "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__td_custom"), hasCustomRowHeader ? true : false), "".concat(blockClass, "__td-th--active-header"), !hasCustomRowHeader && ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === index || checkActiveHeaderCell.checkActiveHeaderCell(index, selectionAreas, 'row'))), "".concat(blockClass, "__td-th--selected-header"), !hasCustomRowHeader && checkSelectedHeaderCell.checkSelectedHeaderCell(index, selectionAreas, 'row', columns))),
351
354
  style: {
352
- width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
355
+ width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth,
356
+ flexDirection: hasCustomRowHeader ? renderRowHeaderDirection === 'Left' ? 'row-reverse' : row : undefined
353
357
  }
354
- }, index + 1)), row.cells.map(function (cell, index) {
358
+ }, index + 1, hasCustomRowHeader && typeof renderRowHeader === 'function' && renderRowHeader(index))), row.cells.map(function (cell, index) {
355
359
  var _cell$column;
356
360
  var cellProps = propsHelper.prepareProps(cell.getCellProps(), 'key');
357
361
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
@@ -376,7 +380,7 @@ var DataSpreadsheetBody = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
376
380
  }, cell.render('Cell')));
377
381
  }));
378
382
  }
379
- }, [prepareRow, rows, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClickEvent, handleBodyCellClickEvent, handleBodyCellHoverEvent, defaultColumn, columns]);
383
+ }, [prepareRow, renderRowHeader, renderRowHeaderDirection, rows, hasCustomRowHeader, activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row, selectionAreas, handleRowHeaderClickEvent, handleBodyCellClickEvent, handleBodyCellHoverEvent, defaultColumn, columns]);
380
384
  var spreadsheetBodyRef = React.useRef();
381
385
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
382
386
  ref: spreadsheetBodyRef,
@@ -442,6 +446,10 @@ DataSpreadsheetBody.propTypes = {
442
446
  */
443
447
  /**@ts-ignore */
444
448
  getTableBodyProps: index["default"].func,
449
+ /**
450
+ * Check if spreadsheet is using custom row header component attached
451
+ */
452
+ hasCustomRowHeader: index["default"].bool,
445
453
  /**
446
454
  * Headers provided from useTable hook
447
455
  */
@@ -466,6 +474,14 @@ DataSpreadsheetBody.propTypes = {
466
474
  * Prepare row function from react-table
467
475
  */
468
476
  prepareRow: index["default"].func,
477
+ /**
478
+ * Component next to numbering rows
479
+ */
480
+ renderRowHeader: index["default"].func,
481
+ /**
482
+ * Component next to numbering rows
483
+ */
484
+ renderRowHeaderDirection: index["default"].string,
469
485
  /**
470
486
  * All of the spreadsheet row data
471
487
  */
@@ -16,6 +16,10 @@ interface DataSpreadsheetHeaderProps {
16
16
  * Specifies the cell height
17
17
  */
18
18
  cellSize?: Size;
19
+ /**
20
+ * Disable column swapping, default false
21
+ */
22
+ disableColumnSwapping?: boolean;
19
23
  /**
20
24
  * All of the spreadsheet columns
21
25
  */
@@ -36,6 +40,10 @@ interface DataSpreadsheetHeaderProps {
36
40
  * Headers provided from useTable hook
37
41
  */
38
42
  headerGroups?: any[];
43
+ /**
44
+ * Read-only table
45
+ */
46
+ readOnlyTable?: boolean;
39
47
  /**
40
48
  * All of the spreadsheet row data
41
49
  */
@@ -45,6 +45,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
45
45
  setActiveCellCoordinates = _ref.setActiveCellCoordinates,
46
46
  setCurrentMatcher = _ref.setCurrentMatcher,
47
47
  setSelectionAreas = _ref.setSelectionAreas,
48
+ readOnlyTable = _ref.readOnlyTable,
49
+ disableColumnSwapping = _ref.disableColumnSwapping,
48
50
  setSelectionAreaData = _ref.setSelectionAreaData,
49
51
  rows = _ref.rows,
50
52
  totalVisibleColumns = _ref.totalVisibleColumns,
@@ -184,6 +186,9 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
184
186
  "data-row-index": "header",
185
187
  "data-column-index": "header",
186
188
  type: "button",
189
+ style: {
190
+ width: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth
191
+ },
187
192
  tabIndex: -1,
188
193
  "aria-label": selectAllAriaLabel,
189
194
  onClick: handleSelectAllClick,
@@ -200,8 +205,8 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
200
205
  "data-row-index": "header",
201
206
  "data-column-index": index,
202
207
  tabIndex: -1,
203
- onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : undefined,
204
- onMouseUp: selectedHeader && typeof setSelectedHeaderReorderActive === 'function' ? function () {
208
+ onMouseDown: selectedHeader && !readOnlyTable && !disableColumnSwapping ? handleHeaderMouseDown(index) : undefined,
209
+ onMouseUp: selectedHeader && !readOnlyTable && !disableColumnSwapping && typeof setSelectedHeaderReorderActive === 'function' ? function () {
205
210
  return setSelectedHeaderReorderActive(false);
206
211
  } : undefined,
207
212
  onClick: !selectedHeader ? handleColumnHeaderClick(index) : undefined,
@@ -209,7 +214,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
209
214
  height: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeight,
210
215
  width: (column === null || column === void 0 ? void 0 : column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
211
216
  },
212
- className: cx__default["default"]("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === index || checkActiveHeaderCell.checkActiveHeaderCell(index, selectionAreas, 'column')), "".concat(blockClass, "__th--selected-header"), selectedHeader), "".concat(blockClass, "__th--selected-header-reorder-active"), selectedHeaderReorderActive)),
217
+ className: cx__default["default"]("".concat(blockClass, "__th"), "".concat(blockClass, "--interactive-cell-element"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__th--active-header"), (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === index || checkActiveHeaderCell.checkActiveHeaderCell(index, selectionAreas, 'column')), "".concat(blockClass, "__th--active-header-disabledSwapping"), disableColumnSwapping || readOnlyTable), "".concat(blockClass, "__th--selected-header"), selectedHeader), "".concat(blockClass, "__th--selected-header-reorder-active"), selectedHeaderReorderActive)),
213
218
  type: "button"
214
219
  }, column.render('Header')));
215
220
  }));
@@ -245,6 +250,10 @@ DataSpreadsheetHeader.propTypes = {
245
250
  rowHeaderWidth: index["default"].number,
246
251
  width: index["default"].number
247
252
  }),
253
+ /**
254
+ * Disable column swapping, default false
255
+ */
256
+ disableColumnSwapping: index["default"].bool,
248
257
  /**
249
258
  * Whether or not a click/hold is active on a header cell
250
259
  */
@@ -253,6 +262,10 @@ DataSpreadsheetHeader.propTypes = {
253
262
  * Headers provided from useTable hook
254
263
  */
255
264
  headerGroups: index["default"].arrayOf(index["default"].object),
265
+ /**
266
+ * Read-only table
267
+ */
268
+ readOnlyTable: index["default"].bool,
256
269
  /**
257
270
  * All of the spreadsheet row data
258
271
  */
@@ -44,9 +44,12 @@ var useSpreadsheetMouseMove = function useSpreadsheetMouseMove(_ref) {
44
44
  var totalSpreadsheetScrollingWidth = listContainer.scrollWidth;
45
45
  var clonedSelectionWidth = clonedSelectionElement.offsetWidth;
46
46
  var clonePlacement = Math.max(xPositionRelativeToSpreadsheet - offsetXValue, defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeaderWidth);
47
+ var leftPosition = totalSpreadsheetScrollingWidth - clonedSelectionWidth >= clonePlacement ? clonePlacement + scrollAmount : totalSpreadsheetScrollingWidth - clonedSelectionWidth;
47
48
  // Moves the position of the cloned selection area to follow mouse, and
48
49
  // add the amount horizontally scrolled
49
- clonedSelectionElement.style.left = layout.px(totalSpreadsheetScrollingWidth - clonedSelectionWidth >= clonePlacement ? clonePlacement + scrollAmount : totalSpreadsheetScrollingWidth - clonedSelectionWidth);
50
+ if (leftPosition < spreadsheetCoords.right - 40) {
51
+ clonedSelectionElement.style.left = layout.px(leftPosition);
52
+ }
50
53
  };
51
54
  if (headerCellHoldActive) {
52
55
  ref.current.addEventListener('mousemove', handleMouseMove);
@@ -26,11 +26,43 @@ var moveColumnIndicatorLine = function moveColumnIndicatorLine(_ref) {
26
26
  var indicatorLineElement = ref.current.querySelector(".".concat(blockClass, "__reorder-indicator-line"));
27
27
  var matcherId = clonedSelectionElement === null || clonedSelectionElement === void 0 ? void 0 : clonedSelectionElement.getAttribute('data-matcher-id');
28
28
  var selectionAreaOrigin = ref.current.querySelector("[data-matcher-id=\"".concat(matcherId, "\"]"));
29
+ var listContainer = ref.current.querySelector(".".concat(blockClass, "__list--container"));
30
+ var scrollSpeed = 10; // Scrolling speed
31
+ var leftEdgeThreshold = 120; // Distance from the left edge to start scrolling
32
+ var rightEdgeThreshold = 100; // Distance from the right edge to start scrolling
33
+
34
+ var _event = event,
35
+ clientX = _event.clientX;
36
+ var _listContainer$getBou = listContainer.getBoundingClientRect(),
37
+ left = _listContainer$getBou.left,
38
+ right = _listContainer$getBou.right;
39
+
40
+ // Is near left side of viewport
41
+ if (clientX < leftEdgeThreshold) {
42
+ window.scrollBy(-scrollSpeed, 0);
43
+ }
44
+
45
+ // Is near right side of viewport
46
+ if (clientX > window.innerWidth - rightEdgeThreshold) {
47
+ window.scrollBy(scrollSpeed, 0);
48
+ }
49
+
50
+ // Is near left edge of table
51
+ if (clientX > left && clientX < left + leftEdgeThreshold) {
52
+ listContainer.scrollBy(-scrollSpeed, 0);
53
+ }
54
+
55
+ // Is near right edge of table
56
+ if (clientX < right && clientX > right - rightEdgeThreshold) {
57
+ listContainer.scrollBy(scrollSpeed, 0);
58
+ }
29
59
  if (Number(newColumnIndex) > Number(originalColumnIndex)) {
30
- indicatorLineElement.style.left = layout.px(closestCellCoords.left - spreadsheetCoords.left + closestCell.offsetWidth - 2 + leftScrollAmount);
60
+ var leftPosition = closestCellCoords.left - spreadsheetCoords.left + closestCell.offsetWidth - 2 + leftScrollAmount;
61
+ indicatorLineElement.style.left = layout.px(leftPosition);
31
62
  }
32
63
  if (Number(newColumnIndex) < Number(originalColumnIndex)) {
33
- indicatorLineElement.style.left = layout.px(closestCellCoords.left - spreadsheetCoords.left + leftScrollAmount);
64
+ var _leftPosition = closestCellCoords.left - spreadsheetCoords.left + leftScrollAmount;
65
+ indicatorLineElement.style.left = layout.px(_leftPosition);
34
66
  }
35
67
  if (Number(newColumnIndex) === Number(originalColumnIndex)) {
36
68
  indicatorLineElement.style.left = selectionAreaOrigin.style.left;
@@ -16,10 +16,6 @@ export interface DatagridProps {
16
16
  * The data grid state, much of it being supplied by the useDatagrid hook
17
17
  */
18
18
  datagridState: DataGridState;
19
- /**
20
- * Table title
21
- */
22
- title?: string;
23
19
  }
24
20
  /**
25
21
  * The `Datagrid` component is an extension of Carbon's DataTable component. At the most basic level, the `Datagrid` component takes in columns and rows and renders a data table. There is a set of data table extensions which this component provides support for, these can be found [here](https://pages.github.ibm.com/cdai-design/pal/components/data-table/overview/). This component is data driven and allows you to choose what pieces will be included based on the hooks/plugins that are provided.
@@ -25,7 +25,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
25
25
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
26
26
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
27
27
 
28
- var _excluded = ["datagridState", "title", "ariaToolbarLabel"];
28
+ var _excluded = ["datagridState", "ariaToolbarLabel"];
29
29
  var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
30
30
  var componentName = 'Datagrid';
31
31
  /**
@@ -33,7 +33,6 @@ var componentName = 'Datagrid';
33
33
  */
34
34
  exports.Datagrid = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
35
35
  var datagridState = _ref.datagridState,
36
- title = _ref.title,
37
36
  ariaToolbarLabel = _ref.ariaToolbarLabel,
38
37
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
39
38
  if (!datagridState) {
@@ -49,13 +48,13 @@ exports.Datagrid = /*#__PURE__*/React__default["default"].forwardRef(function (_
49
48
  state = datagridState.state;
50
49
  var rows = DatagridPagination && datagridState.page || datagridState.rows;
51
50
  var props = {
52
- title: title,
53
51
  datagridState: datagridState,
54
52
  ariaToolbarLabel: ariaToolbarLabel
55
53
  };
56
54
  return /*#__PURE__*/React__default["default"].createElement(FilterProvider.FilterProvider, {
57
55
  filters: state === null || state === void 0 ? void 0 : state.filters,
58
- filterProps: filterProps
56
+ filterProps: filterProps,
57
+ tableId: tableId
59
58
  }, /*#__PURE__*/React__default["default"].createElement(InlineEditContext.InlineEditProvider, null, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
60
59
  id: tableId,
61
60
  ref: ref,
@@ -81,9 +80,5 @@ exports.Datagrid.propTypes = {
81
80
  * The data grid state, much of it being supplied by the useDatagrid hook
82
81
  */
83
82
  /**@ts-ignore */
84
- datagridState: index["default"].object.isRequired,
85
- /**
86
- * Table title
87
- */
88
- title: index["default"].string
83
+ datagridState: index["default"].object.isRequired
89
84
  };
@@ -167,7 +167,7 @@ var DatagridContent = function DatagridContent(_ref) {
167
167
  className: "".concat(blockClass, "__filter-summary"),
168
168
  filters: filterTags,
169
169
  clearFilters: function clearFilters() {
170
- return EventEmitter.dispatch(constants.CLEAR_FILTERS);
170
+ return EventEmitter.dispatch(constants.CLEAR_FILTERS, tableId);
171
171
  },
172
172
  renderLabel: filterProps === null || filterProps === void 0 ? void 0 : filterProps.renderLabel,
173
173
  overflowType: "tag"
@@ -32,10 +32,8 @@ var _excluded = ["className"],
32
32
  var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
33
33
  var getAccessibilityProps = function getAccessibilityProps(header) {
34
34
  var props = {};
35
- var title = getNodeTextContent.getNodeTextContent(header.Header);
36
- if (title) {
37
- props.title = title;
38
- } else {
35
+ var content = getNodeTextContent.getNodeTextContent(header.Header);
36
+ if (!content) {
39
37
  props['aria-hidden'] = true;
40
38
  }
41
39
  return props;
@@ -91,6 +89,7 @@ var ResizeHeader = function ResizeHeader(_ref) {
91
89
  "aria-label": resizerAriaLabel || 'Resize column',
92
90
  disabled: isFetching
93
91
  })), /*#__PURE__*/React__default["default"].createElement("span", {
92
+ role: "separator",
94
93
  className: "".concat(blockClass, "__col-resize-indicator")
95
94
  }));
96
95
  };
@@ -99,7 +98,8 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
99
98
  var resizerAriaLabel = datagridState.resizerAriaLabel,
100
99
  isTableSortable = datagridState.isTableSortable,
101
100
  rows = datagridState.rows,
102
- isFetching = datagridState.isFetching;
101
+ isFetching = datagridState.isFetching,
102
+ headers = datagridState.headers;
103
103
  useInitialColumnSort.useInitialColumnSort(datagridState);
104
104
  // Used to measure the height of the table and uses that value
105
105
  // to display a vertical line to indicate the column you are resizing
@@ -144,7 +144,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
144
144
  }
145
145
  onMouseDown === null || onMouseDown === void 0 || onMouseDown(event);
146
146
  };
147
- var _headerGroup$getHeade = headerGroup.getHeaderGroupProps(),
147
+ var _headerGroup$getHeade = headerGroup.getHeaderGroupProps({
148
+ role: undefined
149
+ }),
148
150
  headerGroupClassName = _headerGroup$getHeade.className,
149
151
  headerGroupProps = _rollupPluginBabelHelpers.objectWithoutProperties(_headerGroup$getHeade, _excluded);
150
152
  var renderSlug = function renderSlug(slug) {
@@ -161,6 +163,9 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
161
163
  });
162
164
  var key = headerGroupProps.key,
163
165
  rowProps = _rollupPluginBabelHelpers.objectWithoutProperties(headerGroupProps, _excluded2);
166
+ var withActionsColumn = headers ? !!headers.filter(function (header) {
167
+ return header.isAction;
168
+ }).length : false;
164
169
  return /*#__PURE__*/React__default["default"].createElement(react.TableRow, _rollupPluginBabelHelpers["extends"]({
165
170
  key: key
166
171
  }, rowProps, {
@@ -190,9 +195,19 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
190
195
  var _ref5 = columnResizing || {},
191
196
  columnWidths = _ref5.columnWidths;
192
197
  var originalCol = visibleColumns[index];
193
- var _header$getHeaderProp = header.getHeaderProps(),
198
+ var _header$getHeaderProp = header.getHeaderProps({
199
+ role: undefined
200
+ }),
194
201
  headerProps = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
195
- var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
202
+ var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header, {
203
+ role: undefined
204
+ });
205
+ var headerStyle = headerProps === null || headerProps === void 0 ? void 0 : headerProps.style;
206
+ var lastVisibleIndex = withActionsColumn ? 2 : 1;
207
+ var lastVisibleFlexStyle = index === visibleColumns.length - lastVisibleIndex ? '1 1 0' : '0 0 auto';
208
+ if (headerStyle) {
209
+ headerStyle.flex = lastVisibleFlexStyle;
210
+ }
196
211
  return /*#__PURE__*/React__default["default"].createElement(react.TableHeader, _rollupPluginBabelHelpers["extends"]({}, headerProps, {
197
212
  className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
198
213
  key: header.id,