@carbon/ibm-products 2.0.0-rc.0 → 2.0.0-rc.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (332) hide show
  1. package/README.md +2 -2
  2. package/css/index-full-carbon.css +1223 -325
  3. package/css/index-full-carbon.css.map +1 -1
  4. package/css/index-full-carbon.min.css +6 -8
  5. package/css/index-full-carbon.min.css.map +1 -1
  6. package/css/index-without-carbon-released-only.css +792 -174
  7. package/css/index-without-carbon-released-only.css.map +1 -1
  8. package/css/index-without-carbon-released-only.min.css +4 -8
  9. package/css/index-without-carbon-released-only.min.css.map +1 -1
  10. package/css/index-without-carbon.css +1109 -419
  11. package/css/index-without-carbon.css.map +1 -1
  12. package/css/index-without-carbon.min.css +6 -8
  13. package/css/index-without-carbon.min.css.map +1 -1
  14. package/css/index.css +1024 -274
  15. package/css/index.css.map +1 -1
  16. package/css/index.min.css +6 -8
  17. package/css/index.min.css.map +1 -1
  18. package/es/components/APIKeyModal/APIKeyModal.js +1 -1
  19. package/es/components/ActionBar/ActionBarOverflowItems.js +1 -0
  20. package/es/components/ActionSet/ActionSet.js +7 -3
  21. package/es/components/AddSelect/AddSelect.js +6 -6
  22. package/es/components/AddSelect/AddSelectBody.js +72 -31
  23. package/es/components/AddSelect/AddSelectBreadcrumbs.js +12 -4
  24. package/es/components/AddSelect/AddSelectColumn.js +8 -8
  25. package/es/components/AddSelect/AddSelectFilter.js +10 -7
  26. package/es/components/AddSelect/AddSelectList.js +64 -29
  27. package/es/components/AddSelect/AddSelectMetaPanel.js +7 -1
  28. package/es/components/AddSelect/AddSelectSidebar.js +5 -2
  29. package/es/components/AddSelect/AddSelectSort.js +2 -2
  30. package/es/components/AddSelect/add-select-utils.js +9 -2
  31. package/es/components/AddSelect/hooks/useItemSort.js +6 -0
  32. package/es/components/AddSelect/hooks/useParentSelect.js +6 -0
  33. package/es/components/AddSelect/hooks/usePath.js +15 -1
  34. package/es/components/AddSelect/index.js +1 -1
  35. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -6
  36. package/es/components/Card/Card.js +16 -6
  37. package/es/components/Card/CardFooter.js +3 -1
  38. package/es/components/Card/CardHeader.js +20 -1
  39. package/es/components/ComboButton/ComboButton.js +1 -1
  40. package/es/components/CreateFullPage/CreateFullPage.js +4 -1
  41. package/es/components/CreateTearsheet/CreateTearsheet.js +8 -1
  42. package/es/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  43. package/es/components/DataSpreadsheet/DataSpreadsheet.js +64 -11
  44. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  45. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  46. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  47. package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +40 -0
  48. package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  49. package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
  50. package/es/components/Datagrid/Datagrid/DatagridContent.js +154 -0
  51. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  52. package/es/components/Datagrid/Datagrid/DatagridRow.js +53 -6
  53. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
  54. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +13 -4
  55. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +142 -11
  56. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
  57. package/es/components/Datagrid/Datagrid/DraggableElement.js +6 -2
  58. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -45
  59. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +4 -1
  60. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +36 -10
  61. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +62 -26
  62. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  63. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
  64. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
  65. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +537 -0
  66. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
  67. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
  68. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
  69. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
  70. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +39 -0
  71. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
  72. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
  73. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
  74. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -14
  75. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -36
  76. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  77. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  78. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  79. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  80. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  81. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  82. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  83. package/es/components/Datagrid/index.js +3 -1
  84. package/es/components/Datagrid/useActionsColumn.js +53 -12
  85. package/es/components/Datagrid/useColumnOrder.js +8 -0
  86. package/es/components/Datagrid/useCustomizeColumns.js +5 -0
  87. package/es/components/Datagrid/useDefaultStringRenderer.js +4 -1
  88. package/es/components/Datagrid/useDisableSelectRows.js +6 -2
  89. package/es/components/Datagrid/useExpandedRow.js +0 -1
  90. package/es/components/Datagrid/useInfiniteScroll.js +5 -2
  91. package/es/components/Datagrid/useInlineEdit.js +71 -0
  92. package/es/components/Datagrid/useNestedRowExpander.js +47 -0
  93. package/es/components/Datagrid/useNestedRows.js +16 -4
  94. package/es/components/Datagrid/useRowExpander.js +12 -4
  95. package/es/components/Datagrid/useRowSize.js +17 -6
  96. package/es/components/Datagrid/useSelectAllToggle.js +17 -4
  97. package/es/components/Datagrid/useSelectRows.js +13 -3
  98. package/es/components/Datagrid/useSortableColumns.js +1 -1
  99. package/es/components/Datagrid/useStickyColumn.js +14 -0
  100. package/es/components/Datagrid/utils/DatagridActions.js +236 -0
  101. package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
  102. package/es/components/Datagrid/utils/Wrapper.js +21 -0
  103. package/es/components/Datagrid/utils/getArgTypes.js +89 -0
  104. package/es/components/Datagrid/utils/getInlineEditColumns.js +153 -0
  105. package/es/components/Datagrid/utils/makeData.js +47 -2
  106. package/es/components/EditUpdateCards/EditUpdateCards.js +144 -0
  107. package/es/components/EditUpdateCards/index.js +7 -0
  108. package/es/components/ExportModal/ExportModal.js +1 -1
  109. package/es/components/ImportModal/ImportModal.js +3 -3
  110. package/es/components/InlineEdit/InlineEdit.js +28 -426
  111. package/es/components/InlineEditV1/InlineEditV1.js +447 -0
  112. package/es/components/InlineEditV1/index.js +7 -0
  113. package/es/components/InlineEditV2/InlineEditV2.js +289 -0
  114. package/es/components/InlineEditV2/index.js +7 -0
  115. package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -1
  116. package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -1
  117. package/es/components/MultiAddSelect/MultiAddSelect.js +14 -7
  118. package/es/components/MultiAddSelect/index.js +6 -0
  119. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  120. package/es/components/OptionsTile/OptionsTile.js +29 -13
  121. package/es/components/PageHeader/PageHeader.js +4 -4
  122. package/es/components/PageHeader/PageHeaderTitle.js +1 -1
  123. package/es/components/ProductiveCard/ProductiveCard.js +5 -0
  124. package/es/components/RemoveModal/RemoveModal.js +20 -3
  125. package/es/components/Saving/Saving.js +1 -1
  126. package/es/components/SidePanel/SidePanel.js +45 -52
  127. package/es/components/SidePanel/motion/variants.js +45 -0
  128. package/es/components/SingleAddSelect/SingleAddSelect.js +6 -0
  129. package/es/components/SingleAddSelect/index.js +6 -0
  130. package/es/components/StatusIcon/StatusIcon.js +1 -1
  131. package/es/components/UserProfileImage/UserProfileImage.js +1 -1
  132. package/es/components/WebTerminal/WebTerminal.js +2 -2
  133. package/es/components/WebTerminal/WebTerminalContentWrapper.js +1 -1
  134. package/es/components/WebTerminal/hooks/index.js +6 -0
  135. package/es/components/WebTerminal/index.js +6 -0
  136. package/es/components/WebTerminal/preview-components/Navigation.js +7 -1
  137. package/es/components/WebTerminal/preview-components/documentationLinks.js +6 -0
  138. package/es/components/WebTerminal/preview-components/index.js +7 -0
  139. package/es/components/index.js +3 -2
  140. package/es/global/js/hooks/index.js +2 -1
  141. package/es/global/js/hooks/useClickOutside.js +1 -1
  142. package/es/global/js/hooks/useControllableState.js +83 -0
  143. package/es/global/js/hooks/useResetCreateComponent.js +6 -2
  144. package/es/global/js/package-settings.js +7 -4
  145. package/es/global/js/utils/getBezierValues.js +20 -0
  146. package/es/global/js/utils/getNumberOfHiddenSteps.js +19 -0
  147. package/es/global/js/utils/motionConstants.js +45 -0
  148. package/es/global/js/utils/rangeWithCallback.js +13 -0
  149. package/es/global/js/utils/story-helper.js +5 -1
  150. package/es/global/js/utils/uuidv4.spec.js +4 -0
  151. package/lib/components/APIKeyModal/APIKeyModal.js +4 -4
  152. package/lib/components/ActionBar/ActionBarOverflowItems.js +1 -0
  153. package/lib/components/ActionSet/ActionSet.js +7 -3
  154. package/lib/components/AddSelect/AddSelect.js +5 -6
  155. package/lib/components/AddSelect/AddSelectBody.js +67 -30
  156. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +15 -4
  157. package/lib/components/AddSelect/AddSelectColumn.js +7 -7
  158. package/lib/components/AddSelect/AddSelectFilter.js +9 -6
  159. package/lib/components/AddSelect/AddSelectList.js +65 -30
  160. package/lib/components/AddSelect/AddSelectMetaPanel.js +8 -2
  161. package/lib/components/AddSelect/AddSelectSidebar.js +4 -1
  162. package/lib/components/AddSelect/AddSelectSort.js +5 -5
  163. package/lib/components/AddSelect/add-select-utils.js +9 -2
  164. package/lib/components/AddSelect/hooks/useItemSort.js +6 -0
  165. package/lib/components/AddSelect/hooks/useParentSelect.js +6 -0
  166. package/lib/components/AddSelect/hooks/usePath.js +9 -1
  167. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -6
  168. package/lib/components/Card/Card.js +16 -6
  169. package/lib/components/Card/CardFooter.js +3 -1
  170. package/lib/components/Card/CardHeader.js +21 -1
  171. package/lib/components/ComboButton/ComboButton.js +3 -3
  172. package/lib/components/CreateFullPage/CreateFullPage.js +4 -1
  173. package/lib/components/CreateTearsheet/CreateTearsheet.js +9 -1
  174. package/lib/components/CreateTearsheetNarrow/CreateTearsheetNarrow.js +2 -2
  175. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +64 -10
  176. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  177. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  178. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  179. package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +51 -0
  180. package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  181. package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
  182. package/lib/components/Datagrid/Datagrid/DatagridContent.js +188 -0
  183. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  184. package/lib/components/Datagrid/Datagrid/DatagridRow.js +63 -6
  185. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
  186. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +16 -5
  187. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +151 -9
  188. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +2 -1
  189. package/lib/components/Datagrid/Datagrid/DraggableElement.js +7 -3
  190. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -47
  191. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +5 -2
  192. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +48 -25
  193. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +60 -25
  194. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  195. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
  196. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
  197. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +562 -0
  198. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
  199. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
  200. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
  201. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
  202. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
  203. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
  204. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
  205. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +100 -0
  206. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -13
  207. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -35
  208. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  209. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  210. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  211. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  212. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  213. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  214. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  215. package/lib/components/Datagrid/index.js +17 -1
  216. package/lib/components/Datagrid/useActionsColumn.js +53 -13
  217. package/lib/components/Datagrid/useColumnOrder.js +17 -0
  218. package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
  219. package/lib/components/Datagrid/useDefaultStringRenderer.js +5 -1
  220. package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
  221. package/lib/components/Datagrid/useExpandedRow.js +0 -1
  222. package/lib/components/Datagrid/useInfiniteScroll.js +5 -2
  223. package/lib/components/Datagrid/useInlineEdit.js +85 -0
  224. package/lib/components/Datagrid/useNestedRowExpander.js +63 -0
  225. package/lib/components/Datagrid/useNestedRows.js +17 -4
  226. package/lib/components/Datagrid/useRowExpander.js +17 -5
  227. package/lib/components/Datagrid/useRowSize.js +18 -13
  228. package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
  229. package/lib/components/Datagrid/useSelectRows.js +13 -3
  230. package/lib/components/Datagrid/useSortableColumns.js +5 -5
  231. package/lib/components/Datagrid/useStickyColumn.js +14 -0
  232. package/lib/components/Datagrid/utils/DatagridActions.js +260 -0
  233. package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
  234. package/lib/components/Datagrid/utils/Wrapper.js +33 -0
  235. package/lib/components/Datagrid/utils/getArgTypes.js +97 -0
  236. package/lib/components/Datagrid/utils/getInlineEditColumns.js +168 -0
  237. package/lib/components/Datagrid/utils/makeData.js +48 -2
  238. package/lib/components/EditUpdateCards/EditUpdateCards.js +152 -0
  239. package/lib/components/EditUpdateCards/index.js +13 -0
  240. package/lib/components/ExportModal/ExportModal.js +3 -3
  241. package/lib/components/ImportModal/ImportModal.js +4 -4
  242. package/lib/components/InlineEdit/InlineEdit.js +27 -426
  243. package/lib/components/InlineEditV1/InlineEditV1.js +464 -0
  244. package/lib/components/InlineEditV1/index.js +13 -0
  245. package/lib/components/InlineEditV2/InlineEditV2.js +309 -0
  246. package/lib/components/InlineEditV2/index.js +13 -0
  247. package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +2 -2
  248. package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +3 -3
  249. package/lib/components/MultiAddSelect/MultiAddSelect.js +14 -7
  250. package/lib/components/NotificationsPanel/NotificationsPanel.js +8 -8
  251. package/lib/components/OptionsTile/OptionsTile.js +34 -17
  252. package/lib/components/PageHeader/PageHeader.js +5 -5
  253. package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
  254. package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
  255. package/lib/components/RemoveModal/RemoveModal.js +20 -3
  256. package/lib/components/Saving/Saving.js +5 -5
  257. package/lib/components/SidePanel/SidePanel.js +48 -53
  258. package/lib/components/SidePanel/motion/variants.js +55 -0
  259. package/lib/components/SingleAddSelect/SingleAddSelect.js +6 -0
  260. package/lib/components/StatusIcon/StatusIcon.js +45 -45
  261. package/lib/components/UserProfileImage/UserProfileImage.js +7 -7
  262. package/lib/components/WebTerminal/WebTerminal.js +3 -3
  263. package/lib/components/WebTerminal/hooks/index.js +6 -0
  264. package/lib/components/WebTerminal/preview-components/Navigation.js +10 -4
  265. package/lib/components/WebTerminal/preview-components/documentationLinks.js +6 -0
  266. package/lib/components/index.js +21 -1
  267. package/lib/global/js/hooks/index.js +9 -1
  268. package/lib/global/js/hooks/useClickOutside.js +1 -1
  269. package/lib/global/js/hooks/useControllableState.js +94 -0
  270. package/lib/global/js/hooks/useResetCreateComponent.js +7 -2
  271. package/lib/global/js/package-settings.js +7 -4
  272. package/lib/global/js/utils/getBezierValues.js +29 -0
  273. package/lib/global/js/utils/getNumberOfHiddenSteps.js +28 -0
  274. package/lib/global/js/utils/motionConstants.js +55 -0
  275. package/lib/global/js/utils/rangeWithCallback.js +22 -0
  276. package/lib/global/js/utils/story-helper.js +5 -1
  277. package/lib/global/js/utils/uuidv4.spec.js +4 -0
  278. package/package.json +18 -16
  279. package/scss/components/AboutModal/_about-modal.scss +2 -1
  280. package/scss/components/ActionSet/_action-set.scss +9 -4
  281. package/scss/components/AddSelect/_add-select.scss +132 -34
  282. package/scss/components/AddSelect/_index.scss +1 -1
  283. package/scss/components/AddSelect/_storybook-styles.scss +1 -1
  284. package/scss/components/Card/_card.scss +1 -0
  285. package/scss/components/Cascade/_cascade.scss +1 -1
  286. package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -0
  287. package/scss/components/Datagrid/_datagrid.scss +15 -0
  288. package/scss/components/Datagrid/_storybook-styles.scss +17 -5
  289. package/scss/components/Datagrid/styles/_datagrid.scss +129 -20
  290. package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
  291. package/scss/components/Datagrid/styles/_index.scss +1 -0
  292. package/scss/components/Datagrid/styles/_useActionsColumn.scss +14 -0
  293. package/scss/components/Datagrid/styles/_useExpandedRow.scss +57 -11
  294. package/scss/components/Datagrid/styles/_useInlineEdit.scss +419 -0
  295. package/scss/components/Datagrid/styles/_useNestedRows.scss +33 -1
  296. package/scss/components/Datagrid/styles/_useStickyColumn.scss +31 -2
  297. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +47 -6
  298. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -1
  299. package/scss/components/EditUpdateCards/_carbon-imports.scss +9 -0
  300. package/scss/components/EditUpdateCards/_edit-update-cards.scss +85 -0
  301. package/scss/components/EditUpdateCards/_index-with-carbon.scss +9 -0
  302. package/scss/components/EditUpdateCards/_index.scss +8 -0
  303. package/scss/components/EditUpdateCards/_storybook-styles.scss +55 -0
  304. package/scss/components/{InlineEdit → InlineEditV1}/_carbon-imports.scss +0 -0
  305. package/scss/components/{InlineEdit → InlineEditV1}/_index-with-carbon.scss +1 -1
  306. package/scss/components/{InlineEdit → InlineEditV1}/_index.scss +1 -1
  307. package/scss/components/{InlineEdit/_inline-edit.scss → InlineEditV1/_inline-edit-v1.scss} +5 -3
  308. package/scss/components/{InlineEdit → InlineEditV1}/_storybook-styles.scss +0 -0
  309. package/scss/components/InlineEditV2/_carbon-imports.scss +9 -0
  310. package/scss/components/InlineEditV2/_index-with-carbon.scss +9 -0
  311. package/scss/components/InlineEditV2/_index.scss +10 -0
  312. package/scss/components/InlineEditV2/_inline-edit-v2.scss +83 -0
  313. package/scss/components/InlineEditV2/_storybook-styles.scss +9 -0
  314. package/scss/components/MultiAddSelect/_multi-add-select.scss +7 -0
  315. package/scss/components/MultiAddSelect/_storybook-styles.scss +1 -1
  316. package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -6
  317. package/scss/components/RemoveModal/_remove-modal.scss +0 -4
  318. package/scss/components/SidePanel/_side-panel.scss +3 -82
  319. package/scss/components/SidePanel/_storybook-styles.scss +6 -1
  320. package/scss/components/SingleAddSelect/_carbon-imports.scss +1 -1
  321. package/scss/components/SingleAddSelect/_index-with-carbon.scss +1 -1
  322. package/scss/components/SingleAddSelect/_index.scss +7 -0
  323. package/scss/components/SingleAddSelect/_single-add-select.scss +7 -0
  324. package/scss/components/SingleAddSelect/_storybook-styles.scss +1 -1
  325. package/scss/components/Tearsheet/_tearsheet.scss +2 -2
  326. package/scss/components/WebTerminal/_carbon-imports.scss +6 -0
  327. package/scss/components/WebTerminal/_index.scss +7 -0
  328. package/scss/components/WebTerminal/_storybook-styles.scss +7 -0
  329. package/scss/components/_index-released-only-with-carbon.scss +1 -1
  330. package/scss/components/_index-released-only.scss +2 -1
  331. package/scss/components/_index-with-carbon.scss +3 -1
  332. package/scss/components/_index.scss +3 -1
@@ -41,6 +41,11 @@ var useSelectRows = function useSelectRows(hooks) {
41
41
  };
42
42
 
43
43
  hooks.useInstance.push(useInstance);
44
+ hooks.useInstance.push(function (instance) {
45
+ Object.assign(instance, {
46
+ withSelectRows: true
47
+ });
48
+ });
44
49
  hooks.visibleColumns.push(function (columns) {
45
50
  return [{
46
51
  id: selectionColumnId,
@@ -58,7 +63,7 @@ var useHighlightSelection = function useHighlightSelection(hooks) {
58
63
  var getRowProps = function getRowProps(props, _ref) {
59
64
  var row = _ref.row;
60
65
  return [props, {
61
- className: cx("".concat(blockClass, "__carbon-row"), row.getToggleRowSelectedProps().checked ? "".concat(carbon.prefix, "--data-table--selected") : '')
66
+ className: cx("".concat(blockClass, "__carbon-row"), row.getToggleRowSelectedProps().checked ? "".concat(carbon.prefix, "--data-table--selected ").concat(blockClass, "__active-row") : '')
62
67
  }];
63
68
  };
64
69
 
@@ -66,6 +71,8 @@ var useHighlightSelection = function useHighlightSelection(hooks) {
66
71
  };
67
72
 
68
73
  var SelectRow = function SelectRow(datagridState) {
74
+ var _columns$;
75
+
69
76
  var _datagridState$isFetc = datagridState.isFetching,
70
77
  isFetching = _datagridState$isFetc === void 0 ? false : _datagridState$isFetc,
71
78
  tableId = datagridState.tableId,
@@ -73,7 +80,9 @@ var SelectRow = function SelectRow(datagridState) {
73
80
  cell = datagridState.cell,
74
81
  radio = datagridState.radio,
75
82
  toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
76
- onRadioSelect = datagridState.onRadioSelect;
83
+ onRadioSelect = datagridState.onRadioSelect,
84
+ columns = datagridState.columns,
85
+ withStickyColumn = datagridState.withStickyColumn;
77
86
  var selectDisabled = isFetching || row.getRowProps().selectDisabled;
78
87
 
79
88
  var _row$getToggleRowSele = row.getToggleRowSelectedProps(),
@@ -81,6 +90,7 @@ var SelectRow = function SelectRow(datagridState) {
81
90
  selectProps = _objectWithoutProperties(_row$getToggleRowSele, _excluded);
82
91
 
83
92
  var cellProps = cell.getCellProps();
93
+ var isFirstColumnStickyLeft = ((_columns$ = columns[0]) === null || _columns$ === void 0 ? void 0 : _columns$.sticky) === 'left' && withStickyColumn;
84
94
  return /*#__PURE__*/React.createElement(TableSelectRow, _extends({}, cellProps, selectProps, {
85
95
  radio: radio,
86
96
  onSelect: function onSelect(e) {
@@ -98,7 +108,7 @@ var SelectRow = function SelectRow(datagridState) {
98
108
  },
99
109
  id: "".concat(tableId, "-").concat(row.index),
100
110
  name: "".concat(tableId, "-").concat(row.index, "-name"),
101
- className: cx("".concat(blockClass, "__checkbox-cell"), cellProps.className),
111
+ className: cx("".concat(blockClass, "__checkbox-cell"), cellProps.className, _defineProperty({}, "".concat(blockClass, "__checkbox-cell-sticky-left"), isFirstColumnStickyLeft)),
102
112
  ariaLabel: "".concat(tableId, "-row-").concat(row.index) // TODO: aria label should be i18n'ed
103
113
  ,
104
114
  disabled: selectDisabled
@@ -15,7 +15,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
15
15
  */
16
16
  import React from 'react';
17
17
  import { Button } from '@carbon/react';
18
- import { ArrowUp, ArrowDown, ArrowsVertical } from '@carbon/icons-react';
18
+ import { ArrowUp, ArrowDown, ArrowsVertical } from '@carbon/react/icons';
19
19
  var ordering = {
20
20
  ASC: 'ASC',
21
21
  DESC: 'DESC',
@@ -17,6 +17,7 @@ import cx from 'classnames';
17
17
  import { pkg } from '../../settings';
18
18
  var blockClass = "".concat(pkg.prefix, "--datagrid");
19
19
  var styleClassPrefix = "".concat(blockClass, "__right-sticky-column");
20
+ var leftStickyStyleClassPrefix = "".concat(blockClass, "__left-sticky-column");
20
21
  var OFFSET_SCROLL_CLASS = "".concat(styleClassPrefix, "-offset-scroll");
21
22
 
22
23
  var useStickyColumn = function useStickyColumn(hooks) {
@@ -117,6 +118,9 @@ var useStickyColumn = function useStickyColumn(hooks) {
117
118
  if (spacerIdx >= 0 && stickyIdx >= 0 && stickyIdx < spacerIdx) {
118
119
  var _temp = newHeaders[spacerIdx];
119
120
  newHeaders[spacerIdx] = newHeaders[stickyIdx];
121
+ newHeaders[spacerIdx].canResize = false;
122
+ newHeaders[spacerIdx].disableResizing = true;
123
+ delete newHeaders[spacerIdx].getResizerProps;
120
124
  newHeaders[stickyIdx] = _temp;
121
125
  }
122
126
  });
@@ -141,6 +145,16 @@ var changeProps = function changeProps(elementName, headerCellRef, props, data)
141
145
  })];
142
146
  }
143
147
 
148
+ if (column.sticky === 'left') {
149
+ var _data$instance, _cx2;
150
+
151
+ return [props, _objectSpread({
152
+ className: cx((_cx2 = {}, _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName), true), _defineProperty(_cx2, "".concat(leftStickyStyleClassPrefix, "-").concat(elementName, "--with-extra-select-column"), data === null || data === void 0 ? void 0 : (_data$instance = data.instance) === null || _data$instance === void 0 ? void 0 : _data$instance.withSelectRows), _cx2))
153
+ }, headerCellRef && {
154
+ ref: headerCellRef
155
+ })];
156
+ }
157
+
144
158
  return [props];
145
159
  };
146
160
 
@@ -0,0 +1,236 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+
3
+ /**
4
+ * Copyright IBM Corp. 2020, 2022
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import React, { useLayoutEffect, useState } from 'react';
10
+ import { DataTable, Button, OverflowMenu, OverflowMenuItem, ComposedModal, ModalBody, ModalHeader, ModalFooter, Dropdown } from '@carbon/react';
11
+ import { Download, Filter, Add, Restart, ChevronDown } from '@carbon/react/icons';
12
+ import { action } from '@storybook/addon-actions';
13
+ import { pkg } from '../../../settings';
14
+ import { ButtonMenu, ButtonMenuItem } from '../../ButtonMenu';
15
+ var blockClass = "".concat(pkg.prefix, "--datagrid");
16
+ export var DatagridActions = function DatagridActions(datagridState) {
17
+ var selectedFlatRows = datagridState.selectedFlatRows,
18
+ setGlobalFilter = datagridState.setGlobalFilter,
19
+ CustomizeColumnsButton = datagridState.CustomizeColumnsButton,
20
+ RowSizeDropdown = datagridState.RowSizeDropdown,
21
+ rowSizeDropdownProps = datagridState.rowSizeDropdownProps,
22
+ useDenseHeader = datagridState.useDenseHeader;
23
+
24
+ var downloadCsv = function downloadCsv() {
25
+ alert('Downloading...');
26
+ };
27
+
28
+ var TableToolbarContent = DataTable.TableToolbarContent,
29
+ TableToolbarSearch = DataTable.TableToolbarSearch;
30
+
31
+ var refreshColumns = function refreshColumns() {
32
+ alert('refreshing...');
33
+ };
34
+
35
+ var leftPanelClick = function leftPanelClick() {
36
+ alert('open/close left panel...');
37
+ };
38
+
39
+ var searchForAColumn = 'Search';
40
+ var isNothingSelected = selectedFlatRows.length === 0;
41
+ var style = {
42
+ 'button:nthChild(1) > span:nthChild(1)': {
43
+ bottom: '-37px'
44
+ }
45
+ };
46
+
47
+ var _useState = useState(false),
48
+ _useState2 = _slicedToArray(_useState, 2),
49
+ modalOpen = _useState2[0],
50
+ setModalOpen = _useState2[1];
51
+
52
+ var _useState3 = useState(window.innerWidth),
53
+ _useState4 = _slicedToArray(_useState3, 2),
54
+ size = _useState4[0],
55
+ setSize = _useState4[1];
56
+
57
+ useLayoutEffect(function () {
58
+ function updateSize() {
59
+ setSize(window.innerWidth);
60
+ }
61
+
62
+ window.addEventListener('resize', updateSize);
63
+ return function () {
64
+ return window.removeEventListener('resize', updateSize);
65
+ };
66
+ }, []);
67
+ var mobileToolbar = size < 672 ? true : false;
68
+ var items = ['Option 1', 'Option 2', 'Option 3'];
69
+ return isNothingSelected && (useDenseHeader && useDenseHeader ? /*#__PURE__*/React.createElement(TableToolbarContent, {
70
+ size: "sm"
71
+ }, !mobileToolbar ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
72
+ style: style
73
+ }, /*#__PURE__*/React.createElement(Button, {
74
+ kind: "ghost",
75
+ hasIconOnly: true,
76
+ tooltipPosition: "bottom",
77
+ renderIcon: Download,
78
+ iconDescription: 'Download CSV',
79
+ onClick: downloadCsv
80
+ })), /*#__PURE__*/React.createElement("div", {
81
+ style: style
82
+ }, /*#__PURE__*/React.createElement(Button, {
83
+ kind: "ghost",
84
+ hasIconOnly: true,
85
+ tooltipPosition: "bottom",
86
+ renderIcon: Filter,
87
+ iconDescription: 'Left panel',
88
+ onClick: leftPanelClick
89
+ })), /*#__PURE__*/React.createElement(RowSizeDropdown, rowSizeDropdownProps), /*#__PURE__*/React.createElement("div", {
90
+ style: style,
91
+ className: "".concat(blockClass, "__toolbar-divider")
92
+ }, /*#__PURE__*/React.createElement(Button, {
93
+ kind: "ghost",
94
+ renderIcon: Add,
95
+ iconDescription: 'Action'
96
+ }, "Ghost button")), CustomizeColumnsButton && /*#__PURE__*/React.createElement("div", {
97
+ style: style
98
+ }, /*#__PURE__*/React.createElement(CustomizeColumnsButton, null))) : /*#__PURE__*/React.createElement(OverflowMenu, {
99
+ ariaLabel: "Tools",
100
+ size: "md",
101
+ flipped: true
102
+ }, /*#__PURE__*/React.createElement(OverflowMenuItem, {
103
+ itemText: "Filter",
104
+ hasDivider: true,
105
+ requireTitle: true,
106
+ onClick: function onClick() {
107
+ return setModalOpen(true);
108
+ }
109
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
110
+ itemText: "Export",
111
+ hasDivider: true,
112
+ requireTitle: true
113
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
114
+ itemText: "Settings",
115
+ hasDivider: true,
116
+ requireTitle: true
117
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
118
+ itemText: "Import items",
119
+ hasDivider: true,
120
+ requireTitle: true
121
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
122
+ itemText: "Create",
123
+ hasDivider: true,
124
+ requireTitle: true
125
+ }))) : !mobileToolbar ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
126
+ kind: "ghost",
127
+ hasIconOnly: true,
128
+ tooltipPosition: "bottom",
129
+ renderIcon: Filter,
130
+ iconDescription: 'Left panel',
131
+ onClick: leftPanelClick
132
+ }), /*#__PURE__*/React.createElement(TableToolbarContent, null, /*#__PURE__*/React.createElement(TableToolbarSearch, {
133
+ size: "xl",
134
+ id: "columnSearch",
135
+ persistent: true,
136
+ placeHolderText: searchForAColumn,
137
+ onChange: function onChange(e) {
138
+ return setGlobalFilter(e.target.value);
139
+ }
140
+ }), /*#__PURE__*/React.createElement(RowSizeDropdown, rowSizeDropdownProps), /*#__PURE__*/React.createElement("div", {
141
+ style: style
142
+ }, /*#__PURE__*/React.createElement(Button, {
143
+ kind: "ghost",
144
+ hasIconOnly: true,
145
+ tooltipPosition: "bottom",
146
+ renderIcon: Restart,
147
+ iconDescription: 'Refresh',
148
+ onClick: refreshColumns
149
+ })), /*#__PURE__*/React.createElement("div", {
150
+ style: style
151
+ }, /*#__PURE__*/React.createElement(Button, {
152
+ kind: "ghost",
153
+ hasIconOnly: true,
154
+ tooltipPosition: "bottom",
155
+ renderIcon: Download,
156
+ iconDescription: 'Download CSV',
157
+ onClick: downloadCsv
158
+ })), CustomizeColumnsButton && /*#__PURE__*/React.createElement("div", {
159
+ style: style
160
+ }, /*#__PURE__*/React.createElement(CustomizeColumnsButton, null)), /*#__PURE__*/React.createElement(ButtonMenu, {
161
+ label: "Primary button",
162
+ renderIcon: Add
163
+ }, /*#__PURE__*/React.createElement(ButtonMenuItem, {
164
+ itemText: "Option 1",
165
+ onClick: action("Click on ButtonMenu Option 1")
166
+ }), /*#__PURE__*/React.createElement(ButtonMenuItem, {
167
+ itemText: "Option 2",
168
+ onClick: action("Click on ButtonMenu Option 2")
169
+ }), /*#__PURE__*/React.createElement(ButtonMenuItem, {
170
+ itemText: "Option 3",
171
+ onClick: action("Click on ButtonMenu Option 3")
172
+ })))) : /*#__PURE__*/React.createElement(TableToolbarContent, null, /*#__PURE__*/React.createElement(TableToolbarSearch, {
173
+ size: "xl",
174
+ id: "columnSearch",
175
+ persistent: true,
176
+ placeHolderText: searchForAColumn,
177
+ onChange: function onChange(e) {
178
+ return setGlobalFilter(e.target.value);
179
+ }
180
+ }), /*#__PURE__*/React.createElement(OverflowMenu, {
181
+ ariaLabel: "Tools",
182
+ size: "lg",
183
+ flipped: true,
184
+ renderIcon: ChevronDown,
185
+ className: "".concat(blockClass, "__toolbar-menu__trigger"),
186
+ menuOptionsClass: "".concat(blockClass, "__toolbar-options")
187
+ }, /*#__PURE__*/React.createElement(OverflowMenuItem, {
188
+ itemText: "Filter",
189
+ hasDivider: true,
190
+ requireTitle: true,
191
+ onClick: function onClick() {
192
+ return setModalOpen(true);
193
+ }
194
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
195
+ itemText: "Export",
196
+ hasDivider: true,
197
+ requireTitle: true
198
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
199
+ itemText: "Settings",
200
+ hasDivider: true,
201
+ requireTitle: true
202
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
203
+ itemText: "Import items",
204
+ hasDivider: true,
205
+ requireTitle: true
206
+ }), /*#__PURE__*/React.createElement(OverflowMenuItem, {
207
+ itemText: "Create",
208
+ hasDivider: true,
209
+ requireTitle: true
210
+ })), modalOpen && /*#__PURE__*/React.createElement(ComposedModal, {
211
+ size: "lg",
212
+ open: modalOpen && modalOpen,
213
+ onClose: function onClose() {
214
+ return setModalOpen(false);
215
+ },
216
+ className: "".concat(blockClass, "__mobile-toolbar-modal")
217
+ }, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement("h4", null, "Filters")), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement(Dropdown, {
218
+ initialSelectedItem: items[2],
219
+ items: items,
220
+ titleText: "Label",
221
+ id: "filter1"
222
+ }), /*#__PURE__*/React.createElement(Dropdown, {
223
+ initialSelectedItem: items[2],
224
+ items: items,
225
+ titleText: "Label",
226
+ id: "filter2"
227
+ }), /*#__PURE__*/React.createElement(Dropdown, {
228
+ initialSelectedItem: items[2],
229
+ items: items,
230
+ titleText: "Label",
231
+ id: "filter3"
232
+ })), /*#__PURE__*/React.createElement(ModalFooter, {
233
+ primaryButtonText: "Apply",
234
+ secondaryButtonText: "Cancel"
235
+ }))));
236
+ };
@@ -0,0 +1,33 @@
1
+ /* eslint-disable react/prop-types */
2
+
3
+ /**
4
+ * Copyright IBM Corp. 2022, 2022
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import React from 'react';
10
+ import { Pagination } from '@carbon/react';
11
+ export var DatagridPagination = function DatagridPagination(_ref) {
12
+ var state = _ref.state,
13
+ setPageSize = _ref.setPageSize,
14
+ gotoPage = _ref.gotoPage,
15
+ rows = _ref.rows;
16
+
17
+ var updatePagination = function updatePagination(_ref2) {
18
+ var page = _ref2.page,
19
+ pageSize = _ref2.pageSize;
20
+ console.log(state);
21
+ setPageSize(pageSize);
22
+ gotoPage(page - 1); // Carbon is non-zero-based
23
+ };
24
+
25
+ return /*#__PURE__*/React.createElement(Pagination, {
26
+ page: state.pageIndex + 1 // react-table is zero-based
27
+ ,
28
+ pageSize: state.pageSize,
29
+ pageSizes: state.pageSizes || [10, 20, 30, 40, 50],
30
+ totalItems: rows.length,
31
+ onChange: updatePagination
32
+ });
33
+ };
@@ -0,0 +1,21 @@
1
+ /* eslint-disable react/prop-types */
2
+
3
+ /**
4
+ * Copyright IBM Corp. 2020, 2022
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import React from 'react';
10
+ export var Wrapper = function Wrapper(_ref) {
11
+ var children = _ref.children;
12
+ return /*#__PURE__*/React.createElement("div", {
13
+ style: {
14
+ height: '100vh',
15
+ width: '100%',
16
+ padding: '1rem',
17
+ margin: '0',
18
+ zIndex: '0'
19
+ }
20
+ }, children);
21
+ };
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright IBM Corp. 2022, 2022
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export var ARG_TYPES = {
8
+ gridTitle: {
9
+ name: 'gridTitle',
10
+ control: 'text',
11
+ description: 'This sets the title text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
12
+ type: {
13
+ name: 'string',
14
+ required: false
15
+ }
16
+ },
17
+ gridDescription: {
18
+ name: 'gridDescription',
19
+ control: 'text',
20
+ description: 'This sets the description text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
21
+ type: {
22
+ name: 'string',
23
+ required: false
24
+ }
25
+ },
26
+ emptyStateTitle: {
27
+ name: 'emptyStateTitle',
28
+ control: 'text',
29
+ description: 'This sets the empty state title text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
30
+ type: {
31
+ name: 'string',
32
+ required: false
33
+ }
34
+ },
35
+ emptyStateDescription: {
36
+ name: 'emptyStateDescription',
37
+ control: 'text',
38
+ description: 'This sets the empty state description text for the Datagrid component. _This value is set/passed inside of the `datagridState` object._',
39
+ type: {
40
+ name: 'string',
41
+ required: false
42
+ }
43
+ },
44
+ emptyStateSize: {
45
+ control: 'select',
46
+ options: ['sm', 'lg']
47
+ },
48
+ useDenseHeader: {
49
+ control: {
50
+ type: 'radio'
51
+ },
52
+ options: [true, false],
53
+ description: 'This sets the dense header option for the Datagrid component. _This value is set/passed inside of the `datagridState` object._'
54
+ },
55
+ rowSize: {
56
+ control: 'select',
57
+ options: ['xs', 'sm', 'md', 'lg', 'xl'],
58
+ description: 'This sets the height for each row of the Datagrid component. _This value is set/passed inside of the `datagridState` object._'
59
+ },
60
+ rowSizes: {
61
+ control: 'object',
62
+ description: 'This array of objects specifies the different row size options that will render from the settings icon in the table actions. _This value is set/passed inside of the `datagridState` object._'
63
+ },
64
+ onRowSizeChange: {
65
+ description: 'Callback function that is called on row size changes. _This value is set/passed inside of the `datagridState` object._'
66
+ },
67
+ rowActions: {
68
+ control: 'object',
69
+ description: 'This array of objects renders the action buttons for each row in the Datagrid. _This value is set/passed inside of the `datagridState` object._',
70
+ action: 'Row action onClick'
71
+ },
72
+ batchActions: {
73
+ control: {
74
+ type: 'radio'
75
+ },
76
+ options: [true, false],
77
+ description: 'This will allow the Datagrid component to use batch actions. _This value is set/passed inside of the `datagridState` object._'
78
+ },
79
+ expandedContentHeight: {
80
+ control: {
81
+ type: 'number'
82
+ },
83
+ description: 'This value controls the height of the expanded content area. _This value is set/passed inside of the `datagridState` object._'
84
+ },
85
+ customizeColumnsProps: {
86
+ control: 'object',
87
+ description: 'This is an object containing all of the props used with the column customization extension. _This value is set/passed inside of the `datagridState` object._'
88
+ }
89
+ };
@@ -0,0 +1,153 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /**
4
+ * Copyright IBM Corp. 2022, 2022
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import React from 'react';
10
+ import { ChartBubble, ChartColumnFloating, ChartVennDiagram } from '@carbon/react/icons';
11
+ export var inlineEditSelectItems = [{
12
+ id: 'option-0',
13
+ icon: function icon(props) {
14
+ return /*#__PURE__*/React.createElement(ChartColumnFloating, _extends({
15
+ size: 16
16
+ }, props));
17
+ },
18
+ text: 'Column Chart'
19
+ }, {
20
+ id: 'option-1',
21
+ icon: function icon(props) {
22
+ return /*#__PURE__*/React.createElement(ChartBubble, _extends({
23
+ size: 16
24
+ }, props));
25
+ },
26
+ text: 'Bubble Chart'
27
+ }, {
28
+ id: 'option-2',
29
+ icon: function icon(props) {
30
+ return /*#__PURE__*/React.createElement(ChartVennDiagram, _extends({
31
+ size: 16
32
+ }, props));
33
+ },
34
+ text: 'Venn Diagram'
35
+ }];
36
+ export var getInlineEditColumns = function getInlineEditColumns() {
37
+ return [{
38
+ Header: 'Row Index',
39
+ accessor: function accessor(row, i) {
40
+ return i;
41
+ },
42
+ id: 'rowIndex' // id is required when accessor is a function.
43
+
44
+ }, {
45
+ Header: 'First Name',
46
+ accessor: 'firstName',
47
+ inlineEdit: {
48
+ type: 'text',
49
+ // required for including validation, this is used to set the invalid prop internally
50
+ validator: function validator(n) {
51
+ return n.length > 40;
52
+ },
53
+ // These props are passed to the Carbon component used for inline editing
54
+ inputProps: {
55
+ invalidText: 'Invalid text, character count must be less than 40'
56
+ }
57
+ }
58
+ }, {
59
+ Header: 'Last Name',
60
+ accessor: 'lastName',
61
+ inlineEdit: {
62
+ type: 'text',
63
+ // required for including validation, this is used to set the invalid prop internally
64
+ validator: function validator(n) {
65
+ return n.length > 40;
66
+ },
67
+ // These props are passed to the Carbon component used for inline editing
68
+ inputProps: {
69
+ invalidText: 'Invalid text, character count must be less than 40'
70
+ }
71
+ }
72
+ }, {
73
+ Header: 'Age',
74
+ accessor: 'age',
75
+ width: 120,
76
+ inlineEdit: {
77
+ // required for including validation, this is used to set the invalid prop internally
78
+ validator: function validator(n) {
79
+ return n && n < 18;
80
+ },
81
+ type: 'number',
82
+ // These props are passed to the Carbon component used for inline editing
83
+ inputProps: {
84
+ invalidText: 'Invalid number, must be 18 or greater'
85
+ }
86
+ }
87
+ }, {
88
+ Header: 'Visits',
89
+ accessor: 'visits',
90
+ width: 120,
91
+ inlineEdit: {
92
+ type: 'number',
93
+ inputProps: {} // These props are passed to the Carbon component used for inline editing
94
+
95
+ }
96
+ }, {
97
+ Header: 'Active since',
98
+ accessor: 'activeSince',
99
+ inlineEdit: {
100
+ type: 'date',
101
+ inputProps: {
102
+ // optionally pass props here to be passed through to Carbon's DatePicker component
103
+ onChange: function onChange(newDateObj, cell) {
104
+ console.log(newDateObj, cell);
105
+ },
106
+ // optionally pass props here to be passed through to Carbon's DatePickerInput component
107
+ datePickerInputProps: {
108
+ labelText: 'Change active since date'
109
+ }
110
+ }
111
+ }
112
+ }, {
113
+ Header: 'Chart type',
114
+ accessor: 'chartType',
115
+ inlineEdit: {
116
+ type: 'selection',
117
+ inputProps: {
118
+ // These props are passed to the Carbon component used for inline editing
119
+ items: inlineEditSelectItems,
120
+ onChange: function onChange(item) {
121
+ return console.log(item);
122
+ }
123
+ }
124
+ }
125
+ }, {
126
+ Header: 'Someone 2',
127
+ accessor: 'someone2'
128
+ }, {
129
+ Header: 'Someone 3',
130
+ accessor: 'someone3'
131
+ }, {
132
+ Header: 'Someone 4',
133
+ accessor: 'someone4'
134
+ }, {
135
+ Header: 'Someone 5',
136
+ accessor: 'someone5'
137
+ }, {
138
+ Header: 'Someone 6',
139
+ accessor: 'someone6'
140
+ }, {
141
+ Header: 'Someone 7',
142
+ accessor: 'someone7'
143
+ }, {
144
+ Header: 'Someone 8',
145
+ accessor: 'someone8'
146
+ }, {
147
+ Header: 'Someone 9',
148
+ accessor: 'someone9'
149
+ }, {
150
+ Header: 'Someone 10',
151
+ accessor: 'someone10'
152
+ }];
153
+ };