@carbon/ibm-products 2.0.0-rc.2 → 2.0.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (229) hide show
  1. package/css/index-full-carbon.css +891 -178
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +4 -2
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +779 -19
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +4 -2
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +659 -77
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +4 -2
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +683 -91
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +4 -2
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/APIKeyModal/APIKeyModal.js +1 -1
  18. package/es/components/AddSelect/AddSelect.js +0 -3
  19. package/es/components/AddSelect/AddSelectBody.js +20 -3
  20. package/es/components/AddSelect/AddSelectBreadcrumbs.js +11 -3
  21. package/es/components/AddSelect/AddSelectColumn.js +5 -5
  22. package/es/components/AddSelect/AddSelectFilter.js +5 -4
  23. package/es/components/AddSelect/AddSelectList.js +61 -27
  24. package/es/components/AddSelect/AddSelectMetaPanel.js +1 -1
  25. package/es/components/AddSelect/AddSelectSort.js +1 -1
  26. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +4 -6
  27. package/es/components/Card/Card.js +16 -6
  28. package/es/components/Card/CardFooter.js +3 -1
  29. package/es/components/Card/CardHeader.js +20 -1
  30. package/es/components/ComboButton/ComboButton.js +1 -1
  31. package/es/components/DataSpreadsheet/DataSpreadsheet.js +63 -11
  32. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  33. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  34. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  35. package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +31 -0
  36. package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  37. package/es/components/Datagrid/Datagrid/Datagrid.js +10 -38
  38. package/es/components/Datagrid/Datagrid/DatagridContent.js +149 -0
  39. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  40. package/es/components/Datagrid/Datagrid/DatagridRow.js +10 -2
  41. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +10 -3
  42. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +13 -4
  43. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
  44. package/es/components/Datagrid/Datagrid/DraggableElement.js +6 -2
  45. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +5 -45
  46. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +1 -1
  47. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +35 -10
  48. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +61 -24
  49. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  50. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +60 -0
  51. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +1 -0
  52. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +534 -0
  53. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +1 -0
  54. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +112 -0
  55. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +27 -0
  56. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +1 -0
  57. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +39 -0
  58. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +19 -0
  59. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +263 -0
  60. package/es/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +87 -0
  61. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -14
  62. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -36
  63. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  64. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  65. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  66. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  67. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  68. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  69. package/es/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  70. package/es/components/Datagrid/index.js +3 -1
  71. package/es/components/Datagrid/useActionsColumn.js +28 -12
  72. package/es/components/Datagrid/useColumnOrder.js +8 -0
  73. package/es/components/Datagrid/useCustomizeColumns.js +5 -0
  74. package/es/components/Datagrid/useDisableSelectRows.js +6 -2
  75. package/es/components/Datagrid/useExpandedRow.js +0 -1
  76. package/es/components/Datagrid/useInlineEdit.js +71 -0
  77. package/es/components/Datagrid/useNestedRowExpander.js +42 -0
  78. package/es/components/Datagrid/useNestedRows.js +2 -2
  79. package/es/components/Datagrid/useRowExpander.js +1 -1
  80. package/es/components/Datagrid/useRowSize.js +17 -6
  81. package/es/components/Datagrid/useSelectAllToggle.js +17 -4
  82. package/es/components/Datagrid/useSelectRows.js +12 -2
  83. package/es/components/Datagrid/useSortableColumns.js +1 -1
  84. package/es/components/Datagrid/useStickyColumn.js +11 -0
  85. package/es/components/Datagrid/utils/DatagridActions.js +152 -0
  86. package/es/components/Datagrid/utils/DatagridPagination.js +33 -0
  87. package/es/components/Datagrid/utils/Wrapper.js +21 -0
  88. package/es/components/Datagrid/utils/getArgTypes.js +85 -0
  89. package/es/components/Datagrid/utils/getInlineEditColumns.js +153 -0
  90. package/es/components/Datagrid/utils/makeData.js +46 -1
  91. package/es/components/ExportModal/ExportModal.js +1 -1
  92. package/es/components/ImportModal/ImportModal.js +3 -3
  93. package/es/components/InlineEdit/InlineEdit.js +11 -9
  94. package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +1 -1
  95. package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +1 -1
  96. package/es/components/NotificationsPanel/NotificationsPanel.js +1 -1
  97. package/es/components/OptionsTile/OptionsTile.js +1 -1
  98. package/es/components/PageHeader/PageHeader.js +1 -1
  99. package/es/components/ProductiveCard/ProductiveCard.js +5 -0
  100. package/es/components/Saving/Saving.js +1 -1
  101. package/es/components/SidePanel/SidePanel.js +1 -1
  102. package/es/components/StatusIcon/StatusIcon.js +1 -1
  103. package/es/components/UserProfileImage/UserProfileImage.js +1 -1
  104. package/es/components/WebTerminal/WebTerminal.js +1 -1
  105. package/es/components/WebTerminal/preview-components/Navigation.js +1 -1
  106. package/es/components/index.js +1 -1
  107. package/es/global/js/hooks/useClickOutside.js +1 -1
  108. package/es/global/js/package-settings.js +3 -3
  109. package/es/global/js/utils/rangeWithCallback.js +13 -0
  110. package/es/global/js/utils/story-helper.js +5 -1
  111. package/es/global/js/utils/uuidv4.spec.js +4 -0
  112. package/lib/components/APIKeyModal/APIKeyModal.js +4 -4
  113. package/lib/components/AddSelect/AddSelect.js +0 -4
  114. package/lib/components/AddSelect/AddSelectBody.js +20 -3
  115. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +14 -3
  116. package/lib/components/AddSelect/AddSelectColumn.js +5 -5
  117. package/lib/components/AddSelect/AddSelectFilter.js +5 -4
  118. package/lib/components/AddSelect/AddSelectList.js +62 -28
  119. package/lib/components/AddSelect/AddSelectMetaPanel.js +2 -2
  120. package/lib/components/AddSelect/AddSelectSort.js +4 -4
  121. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +6 -6
  122. package/lib/components/Card/Card.js +16 -6
  123. package/lib/components/Card/CardFooter.js +3 -1
  124. package/lib/components/Card/CardHeader.js +21 -1
  125. package/lib/components/ComboButton/ComboButton.js +3 -3
  126. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +63 -10
  127. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +2 -1
  128. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +7 -0
  129. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +6 -5
  130. package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +42 -0
  131. package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +1 -1
  132. package/lib/components/Datagrid/Datagrid/Datagrid.js +12 -45
  133. package/lib/components/Datagrid/Datagrid/DatagridContent.js +183 -0
  134. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +9 -1
  135. package/lib/components/Datagrid/Datagrid/DatagridRow.js +19 -2
  136. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +12 -3
  137. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +16 -5
  138. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
  139. package/lib/components/Datagrid/Datagrid/DraggableElement.js +7 -3
  140. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +12 -47
  141. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +2 -2
  142. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +47 -25
  143. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +59 -23
  144. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +3 -2
  145. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/InlineEditButton.js +76 -0
  146. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditButton/index.js +13 -0
  147. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +558 -0
  148. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/index.js +13 -0
  149. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +129 -0
  150. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/getCellIdAsObject.js +36 -0
  151. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/index.js +19 -0
  152. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/returnUpdatedActiveCell.js +45 -0
  153. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridFocus.js +28 -0
  154. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleGridKeyPress.js +272 -0
  155. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/handleMultipleKeys.js +100 -0
  156. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +17 -13
  157. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +13 -35
  158. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/CustomizeColumnStory.js +0 -0
  159. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/LeftPanelStory.js +0 -0
  160. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/RowSizeDropdownStory.js +0 -0
  161. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/SelectAllWithToggleStory.js +0 -0
  162. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/StickyActionsColumnStory.js +0 -0
  163. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/common.js +0 -0
  164. package/lib/components/Datagrid/{Datagrid.stories-helpers → Datagrid.stories}/index.js +0 -0
  165. package/lib/components/Datagrid/index.js +17 -1
  166. package/lib/components/Datagrid/useActionsColumn.js +28 -13
  167. package/lib/components/Datagrid/useColumnOrder.js +17 -0
  168. package/lib/components/Datagrid/useCustomizeColumns.js +5 -0
  169. package/lib/components/Datagrid/useDisableSelectRows.js +6 -2
  170. package/lib/components/Datagrid/useExpandedRow.js +0 -1
  171. package/lib/components/Datagrid/useInlineEdit.js +85 -0
  172. package/lib/components/Datagrid/useNestedRowExpander.js +57 -0
  173. package/lib/components/Datagrid/useNestedRows.js +3 -3
  174. package/lib/components/Datagrid/useRowExpander.js +3 -3
  175. package/lib/components/Datagrid/useRowSize.js +18 -13
  176. package/lib/components/Datagrid/useSelectAllToggle.js +18 -4
  177. package/lib/components/Datagrid/useSelectRows.js +12 -2
  178. package/lib/components/Datagrid/useSortableColumns.js +5 -5
  179. package/lib/components/Datagrid/useStickyColumn.js +11 -0
  180. package/lib/components/Datagrid/utils/DatagridActions.js +170 -0
  181. package/lib/components/Datagrid/utils/DatagridPagination.js +46 -0
  182. package/lib/components/Datagrid/utils/Wrapper.js +33 -0
  183. package/lib/components/Datagrid/utils/getArgTypes.js +93 -0
  184. package/lib/components/Datagrid/utils/getInlineEditColumns.js +168 -0
  185. package/lib/components/Datagrid/utils/makeData.js +47 -1
  186. package/lib/components/ExportModal/ExportModal.js +3 -3
  187. package/lib/components/ImportModal/ImportModal.js +4 -4
  188. package/lib/components/InlineEdit/InlineEdit.js +16 -14
  189. package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +2 -2
  190. package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +3 -3
  191. package/lib/components/NotificationsPanel/NotificationsPanel.js +8 -8
  192. package/lib/components/OptionsTile/OptionsTile.js +6 -6
  193. package/lib/components/PageHeader/PageHeader.js +2 -2
  194. package/lib/components/ProductiveCard/ProductiveCard.js +5 -0
  195. package/lib/components/Saving/Saving.js +5 -5
  196. package/lib/components/SidePanel/SidePanel.js +3 -3
  197. package/lib/components/StatusIcon/StatusIcon.js +45 -45
  198. package/lib/components/UserProfileImage/UserProfileImage.js +7 -7
  199. package/lib/components/WebTerminal/WebTerminal.js +3 -3
  200. package/lib/components/WebTerminal/preview-components/Navigation.js +4 -4
  201. package/lib/components/index.js +12 -0
  202. package/lib/global/js/hooks/useClickOutside.js +1 -1
  203. package/lib/global/js/package-settings.js +3 -3
  204. package/lib/global/js/utils/rangeWithCallback.js +22 -0
  205. package/lib/global/js/utils/story-helper.js +5 -1
  206. package/lib/global/js/utils/uuidv4.spec.js +4 -0
  207. package/package.json +15 -15
  208. package/scss/components/AddSelect/_add-select.scss +127 -28
  209. package/scss/components/Card/_card.scss +1 -0
  210. package/scss/components/Cascade/_cascade.scss +1 -1
  211. package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -0
  212. package/scss/components/Datagrid/_datagrid.scss +7 -0
  213. package/scss/components/Datagrid/_storybook-styles.scss +8 -5
  214. package/scss/components/Datagrid/styles/_datagrid.scss +31 -15
  215. package/scss/components/Datagrid/styles/_draggableElement.scss +26 -9
  216. package/scss/components/Datagrid/styles/_index.scss +1 -0
  217. package/scss/components/Datagrid/styles/_useActionsColumn.scss +14 -0
  218. package/scss/components/Datagrid/styles/_useExpandedRow.scss +37 -9
  219. package/scss/components/Datagrid/styles/_useInlineEdit.scss +404 -0
  220. package/scss/components/Datagrid/styles/_useNestedRows.scss +16 -1
  221. package/scss/components/Datagrid/styles/_useStickyColumn.scss +31 -2
  222. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +45 -6
  223. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +9 -1
  224. package/scss/components/InlineEdit/_inline-edit.scss +4 -2
  225. package/scss/components/NotificationsPanel/_notifications-panel.scss +3 -6
  226. package/scss/components/RemoveModal/_remove-modal.scss +0 -4
  227. package/scss/components/SidePanel/_side-panel.scss +3 -6
  228. package/scss/components/Tearsheet/_tearsheet.scss +2 -2
  229. package/scss/components/_index-released-only.scss +1 -0
@@ -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,85 @@
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
+ };
@@ -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
+ };
@@ -12,6 +12,22 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
12
12
  */
13
13
  import React from 'react';
14
14
  import namor from 'namor';
15
+ import { StatusIcon } from '../../StatusIcon';
16
+ import { inlineEditSelectItems } from './getInlineEditColumns';
17
+
18
+ var getRandomInteger = function getRandomInteger(min, max, decimalPlaces) {
19
+ var roundedMin = Math.ceil(min);
20
+ var roundedMax = Math.floor(max);
21
+ var randomNumber = Math.random() * (max - min) + min;
22
+
23
+ if (!decimalPlaces) {
24
+ return Math.floor(Math.random() * (roundedMax - roundedMin + 1)) + roundedMin;
25
+ }
26
+
27
+ var power = Math.pow(10, decimalPlaces);
28
+ return Math.floor(randomNumber * power) / power;
29
+ };
30
+
15
31
  export var makeData = function makeData() {
16
32
  for (var _len = arguments.length, lens = new Array(_len), _key = 0; _key < _len; _key++) {
17
33
  lens[_key] = arguments[_key];
@@ -39,8 +55,32 @@ export var range = function range(len) {
39
55
  return arr;
40
56
  };
41
57
 
58
+ var renderStatusIcon = function renderStatusIcon(statusChance) {
59
+ var iconProps = {
60
+ size: 'sm',
61
+ theme: 'light',
62
+ kind: statusChance > 0.66 ? 'critical' : statusChance > 0.33 ? 'minor-warning' : 'normal',
63
+ iconDescription: statusChance > 0.66 ? 'Critical' : statusChance > 0.33 ? 'Minor warning' : 'Normal'
64
+ };
65
+ return /*#__PURE__*/React.createElement(StatusIcon, iconProps);
66
+ };
67
+
68
+ var renderDocLink = function renderDocLink(statusChance) {
69
+ var docLinkObj = {
70
+ href: statusChance > 0.66 ? 'http://carbondesignsystem.com/' : statusChance > 0.33 ? 'https://pages.github.ibm.com/cdai-design/pal/' : 'http://carbon-for-ibm-products.netlify.app/',
71
+ text: statusChance > 0.66 ? 'Carbon Design System' : statusChance > 0.33 ? 'Carbon for IBM Products PAL' : 'Carbon for IBM Products storybook'
72
+ };
73
+ return docLinkObj;
74
+ };
75
+
42
76
  var newPerson = function newPerson() {
43
77
  var statusChance = Math.random();
78
+ var initialChartTypeIndex = getRandomInteger(0, 2);
79
+ var activeSinceDate = new Date();
80
+ var yesterdayDate = new Date();
81
+ yesterdayDate.setDate(yesterdayDate.getDate() - 1);
82
+ var twoDaysAgoDate = new Date();
83
+ twoDaysAgoDate.setDate(twoDaysAgoDate.getDate() - 2);
44
84
  return {
45
85
  firstName: namor.generate({
46
86
  words: 1,
@@ -133,7 +173,12 @@ var newPerson = function newPerson() {
133
173
  words: 1,
134
174
  numbers: 0
135
175
  }),
136
- status: statusChance > 0.66 ? 'relationship' : statusChance > 0.33 ? 'complicated' : 'single'
176
+ status: statusChance > 0.66 ? 'relationship' : statusChance > 0.33 ? 'complicated' : 'single',
177
+ chartType: initialChartTypeIndex === 0 ? inlineEditSelectItems[0] : initialChartTypeIndex === 1 ? inlineEditSelectItems[1] : inlineEditSelectItems[2],
178
+ activeSince: statusChance > 0.66 ? activeSinceDate : statusChance > 0.33 ? yesterdayDate : twoDaysAgoDate,
179
+ bonus: "$\r".concat(getRandomInteger(100, 500, 2)),
180
+ status_icon: renderStatusIcon(statusChance),
181
+ doc_link: renderDocLink(statusChance)
137
182
  };
138
183
  };
139
184
 
@@ -17,7 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
17
17
  import React, { useState, useRef, forwardRef, useEffect } from 'react';
18
18
  import { Button, ComposedModal, ModalHeader, ModalFooter, ModalBody, TextInput, RadioButton, RadioButtonGroup, FormGroup, Loading, PasswordInput } from '@carbon/react';
19
19
  import cx from 'classnames';
20
- import { ErrorFilled, CheckmarkFilled } from '@carbon/icons-react';
20
+ import { ErrorFilled, CheckmarkFilled } from '@carbon/react/icons';
21
21
  import PropTypes from 'prop-types';
22
22
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
23
23
  import uuidv4 from '../../global/js/utils/uuidv4';
@@ -18,7 +18,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
18
18
  // LICENSE file in the root directory of this source tree.
19
19
  //
20
20
  import React, { useState, forwardRef } from 'react';
21
- import { Add } from '@carbon/icons-react';
21
+ import { Add } from '@carbon/react/icons';
22
22
  import { ComposedModal, ModalHeader, ModalFooter, ModalBody, FileUploaderDropContainer, FileUploaderItem, TextInput, Button, usePrefix } from '@carbon/react';
23
23
  import cx from 'classnames';
24
24
  import PropTypes from 'prop-types';
@@ -77,9 +77,9 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
77
77
  var acceptSet = new Set(accept);
78
78
  var name = file.name;
79
79
  var mimeType = file.type;
80
- var extension = name.split('.').pop();
80
+ var extension = ".".concat(name.split('.').pop());
81
81
 
82
- if (acceptSet.has(mimeType) || acceptSet.has(extension)) {
82
+ if (acceptSet.has(mimeType) || acceptSet.has(extension) || accept.length === 0) {
83
83
  return false;
84
84
  }
85
85
 
@@ -22,7 +22,7 @@ import { pkg } from '../../settings'; // Carbon and package components we use.
22
22
  /* TODO: @use(s) of carbon components and other package components. */
23
23
 
24
24
  import { Button, IconButton, usePrefix } from '@carbon/react';
25
- import { Close, Edit, EditOff, Checkmark, WarningFilled } from '@carbon/icons-react'; // The block part of our conventional BEM class names (blockClass__E--M).
25
+ import { Close, Edit, EditOff, Checkmark, WarningFilled } from '@carbon/react/icons'; // The block part of our conventional BEM class names (blockClass__E--M).
26
26
 
27
27
  var blockClass = "".concat(pkg.prefix, "--inline-edit");
28
28
  var componentName = 'InlineEdit'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
@@ -40,7 +40,7 @@ var buttons = ['cancel', 'edit', 'save'];
40
40
  */
41
41
 
42
42
  export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
43
- var _cx, _refInput$current, _refInput$current$inn, _cx3;
43
+ var _cx, _refInput$current, _refInput$current$tex, _cx3;
44
44
 
45
45
  var buttonTooltipAlignment = _ref.buttonTooltipAlignment,
46
46
  buttonTooltipPosition = _ref.buttonTooltipPosition,
@@ -66,7 +66,9 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
66
66
  rest = _objectWithoutProperties(_ref, _excluded);
67
67
 
68
68
  var carbonPrefix = usePrefix();
69
- var refInput = useRef(null);
69
+ var refInput = useRef({
70
+ textContent: value
71
+ });
70
72
  var localRef = useRef(null);
71
73
  var ref = refIn || localRef;
72
74
 
@@ -149,15 +151,15 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
149
151
  document.getSelection().removeAllRanges();
150
152
 
151
153
  if (onSave) {
152
- onSave(refInput.current.innerText);
154
+ onSave(refInput.current.textContent);
153
155
  }
154
156
  };
155
157
 
156
158
  var handleInput = function handleInput() {
157
- setInternalValue(refInput.current.innerText);
159
+ setInternalValue(refInput.current.textContent);
158
160
 
159
161
  if (onChange) {
160
- onChange(refInput.current.innerText);
162
+ onChange(refInput.current.textContent);
161
163
  }
162
164
  }; // pasting into contentEditable not supported by userEvent
163
165
 
@@ -192,7 +194,7 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
192
194
  };
193
195
 
194
196
  var handleCancel = function handleCancel() {
195
- refInput.current.innerText = value;
197
+ refInput.current.textContent = value;
196
198
  handleInput(value);
197
199
  doSetEditing(false);
198
200
  document.getSelection().removeAllRanges();
@@ -260,7 +262,7 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
260
262
  }, /*#__PURE__*/React.createElement("div", _extends({}, rest, getDevtoolsProps(componentName), {
261
263
  id: id,
262
264
  size: size,
263
- className: cx("".concat(blockClass, "__input"), _defineProperty({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$inn = _refInput$current.innerText) === null || _refInput$current$inn === void 0 ? void 0 : _refInput$current$inn.length) === 0)),
265
+ className: cx("".concat(blockClass, "__input"), _defineProperty({}, "".concat(blockClass, "__input--empty"), ((_refInput$current = refInput.current) === null || _refInput$current === void 0 ? void 0 : (_refInput$current$tex = _refInput$current.textContent) === null || _refInput$current$tex === void 0 ? void 0 : _refInput$current$tex.length) === 0)),
264
266
  contentEditable: true,
265
267
  "aria-label": labelText,
266
268
  role: "textbox",
@@ -271,7 +273,7 @@ export var InlineEdit = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
271
273
  onPaste: handlePaste,
272
274
  suppressContentEditableWarning: true,
273
275
  ref: refInput,
274
- "data-placeholder": placeholder !== null && placeholder !== void 0 ? placeholder : labelText
276
+ "data-placeholder": placeholder
275
277
  }), value), /*#__PURE__*/React.createElement("div", {
276
278
  className: cx("".concat(blockClass, "__after-input-elements")) // tabindex -1 fixes blur target test when clicking on after-input-elements background
277
279
  ,
@@ -6,7 +6,7 @@
6
6
  //
7
7
  import React from 'react';
8
8
  import PropTypes from 'prop-types';
9
- import { Add } from '@carbon/icons-react';
9
+ import { Add } from '@carbon/react/icons';
10
10
  import { pkg } from '../../settings';
11
11
  var blockClass = "".concat(pkg.prefix, "--modified-tabs");
12
12
  export var ModifiedTabLabelNew = function ModifiedTabLabelNew(_ref) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Close, CloseFilled } from '@carbon/icons-react';
3
+ import { Close, CloseFilled } from '@carbon/react/icons';
4
4
  import { pkg } from '../../settings';
5
5
  var blockClass = "".concat(pkg.prefix, "--modified-tabs");
6
6
  export var ModifiedTabLabelWithClose = function ModifiedTabLabelWithClose(_ref) {
@@ -22,7 +22,7 @@ import { timeAgo } from './utils';
22
22
  import { NotificationsEmptyState } from '../EmptyStates/NotificationsEmptyState'; // Carbon and package components we use.
23
23
 
24
24
  import { Button, Link, Toggle, IconButton } from '@carbon/react';
25
- import { ErrorFilled, WarningAltFilled, CheckmarkFilled, InformationSquareFilled, ChevronDown, Close, Settings } from '@carbon/icons-react';
25
+ import { ErrorFilled, WarningAltFilled, CheckmarkFilled, InformationSquareFilled, ChevronDown, Close, Settings } from '@carbon/react/icons';
26
26
  import { usePreviousValue } from '../../global/js/hooks'; // The block part of our conventional BEM class names (blockClass__E--M).
27
27
 
28
28
  var componentName = 'NotificationsPanel';
@@ -20,7 +20,7 @@ import uuidv4 from '../../global/js/utils/uuidv4';
20
20
  import { pkg } from '../../settings'; // Carbon and package components we use.
21
21
 
22
22
  import { Toggle } from '@carbon/react';
23
- import { ChevronDown, Locked, WarningAltFilled, WarningFilled } from '@carbon/icons-react';
23
+ import { ChevronDown, Locked, WarningAltFilled, WarningFilled } from '@carbon/react/icons';
24
24
  import * as carbonMotion from '@carbon/motion'; // The block part of our conventional BEM class names (blockClass__E--M).
25
25
 
26
26
  var blockClass = "".concat(pkg.prefix, "--options-tile");
@@ -29,7 +29,7 @@ import { ActionBar } from '../ActionBar/';
29
29
  import { BreadcrumbWithOverflow } from '../BreadcrumbWithOverflow';
30
30
  import { TagSet, string_required_if_more_than_10_tags } from '../TagSet/TagSet';
31
31
  import { ButtonSetWithOverflow } from '../ButtonSetWithOverflow';
32
- import { ChevronUp } from '@carbon/icons-react';
32
+ import { ChevronUp } from '@carbon/react/icons';
33
33
  var componentName = 'PageHeader';
34
34
  import { blockClass, utilCheckUpdateVerticalSpace, utilGetBreadcrumbItemForTitle, utilSetCollapsed } from './PageHeaderUtils';
35
35
  import { PageHeaderTitle } from './PageHeaderTitle'; // Default values for props
@@ -117,6 +117,11 @@ ProductiveCard.propTypes = {
117
117
  */
118
118
  primaryButtonIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
119
119
 
120
+ /**
121
+ * Determines if the primary button is on the top or bottom of the card
122
+ */
123
+ primaryButtonPlacement: PropTypes.oneOf(['top', 'bottom']),
124
+
120
125
  /**
121
126
  * The text that's displayed in the primary button
122
127
  */
@@ -12,7 +12,7 @@ var _excluded = ["secondaryButtonText", "className", "defaultIconDescription", "
12
12
  import React, { forwardRef } from 'react';
13
13
  import cx from 'classnames';
14
14
  import { Button, InlineLoading } from '@carbon/react';
15
- import { Save, CheckmarkOutline, ErrorOutline, ErrorFilled } from '@carbon/icons-react';
15
+ import { Save, CheckmarkOutline, ErrorOutline, ErrorFilled } from '@carbon/react/icons';
16
16
  import PropTypes from 'prop-types';
17
17
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
18
18
  import { pkg } from '../../settings';
@@ -30,7 +30,7 @@ import { SIDE_PANEL_SIZES } from './constants';
30
30
  import { usePreviousValue } from '../../global/js/hooks'; // Carbon and package components we use.
31
31
 
32
32
  import { Button } from '@carbon/react';
33
- import { Close, ArrowLeft } from '@carbon/icons-react';
33
+ import { Close, ArrowLeft } from '@carbon/react/icons';
34
34
  import { ActionSet } from '../ActionSet';
35
35
  var blockClass = "".concat(pkg.prefix, "--side-panel");
36
36
  var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
@@ -12,7 +12,7 @@ var _excluded = ["kind", "theme", "size", "className", "iconDescription"];
12
12
  import React, { forwardRef } from 'react';
13
13
  import PropTypes from 'prop-types';
14
14
  import cx from 'classnames';
15
- import { Misuse, ErrorFilled, WarningAltInvertedFilled, WarningAltFilled, UndefinedFilled, UnknownFilled, CheckmarkFilled, InformationSquareFilled, Renew, Time } from '@carbon/icons-react';
15
+ import { Misuse, ErrorFilled, WarningAltInvertedFilled, WarningAltFilled, UndefinedFilled, UnknownFilled, CheckmarkFilled, InformationSquareFilled, Renew, Time } from '@carbon/react/icons';
16
16
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
17
  import { pkg } from '../../settings';
18
18
  var blockClass = "".concat(pkg.prefix, "--status-icon");
@@ -17,7 +17,7 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools';
17
17
  import '../../global/js/utils/props-helper';
18
18
  import { pkg } from '../../settings'; // Carbon and package components we use.
19
19
 
20
- import { User, Group } from '@carbon/icons-react';
20
+ import { User, Group } from '@carbon/react/icons';
21
21
  import { IconButton } from '@carbon/react'; // The block part of our conventional BEM class names (blockClass__E--M).
22
22
 
23
23
  var blockClass = "".concat(pkg.prefix, "--user-profile-image");
@@ -21,7 +21,7 @@ import PropTypes from 'prop-types';
21
21
  import cx from 'classnames';
22
22
  import { pkg } from '../../settings'; // Carbon and package components we use.
23
23
 
24
- import { Close, Help } from '@carbon/icons-react';
24
+ import { Close, Help } from '@carbon/react/icons';
25
25
  import { Button, OverflowMenu, OverflowMenuItem } from '@carbon/react';
26
26
  import { moderate02 } from '@carbon/motion';
27
27
  import { useWebTerminal } from './hooks';
@@ -6,7 +6,7 @@
6
6
  //
7
7
  import React from 'react';
8
8
  import { Header, HeaderName, HeaderGlobalAction, HeaderGlobalBar } from '@carbon/react';
9
- import { Terminal, Search, User } from '@carbon/icons-react';
9
+ import { Terminal, Search, User } from '@carbon/react/icons';
10
10
  import { useWebTerminal } from '../hooks';
11
11
 
12
12
  var Navigation = function Navigation() {
@@ -37,7 +37,7 @@ export { EditSidePanel } from './EditSidePanel';
37
37
  export { OptionsTile } from './OptionsTile';
38
38
  export { InlineEdit } from './InlineEdit';
39
39
  export { DataSpreadsheet } from './DataSpreadsheet';
40
- export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows, useExpandedRow, useOnRowClick, useSortableColumns, useRowIsMouseOver, useColumnRightAlign, useDisableSelectRows, useStickyColumn, useActionsColumn, useCustomizeColumns, useSelectAllWithToggle } from './Datagrid';
40
+ export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows, useExpandedRow, useOnRowClick, useSortableColumns, useRowIsMouseOver, useColumnRightAlign, useDisableSelectRows, useStickyColumn, useActionsColumn, useCustomizeColumns, useSelectAllWithToggle, useColumnOrder, useInlineEdit } from './Datagrid';
41
41
  export { EditTearsheet } from './EditTearsheet';
42
42
  export { EditTearsheetNarrow } from './EditTearsheetNarrow';
43
43
  export { EditFullPage } from './EditFullPage';
@@ -8,7 +8,7 @@ import { useEffect } from 'react';
8
8
  export var useClickOutside = function useClickOutside(ref, callback) {
9
9
  var handleClick = function handleClick(event) {
10
10
  if (ref.current && !ref.current.contains(event.target)) {
11
- callback();
11
+ callback(event.target);
12
12
  }
13
13
  };
14
14
 
@@ -53,6 +53,9 @@ var defaults = {
53
53
  TearsheetNarrow: true,
54
54
  UnauthorizedEmptyState: true,
55
55
  UserProfileImage: true,
56
+ WebTerminal: true,
57
+ WebTerminalContentWrapper: true,
58
+ WebTerminalProvider: true,
56
59
  // other public components not yet reviewed and released:
57
60
  MultiAddSelect: false,
58
61
  SingleAddSelect: false,
@@ -60,9 +63,6 @@ var defaults = {
60
63
  Toolbar: false,
61
64
  ToolbarButton: false,
62
65
  ToolbarGroup: false,
63
- WebTerminal: false,
64
- WebTerminalContentWrapper: false,
65
- WebTerminalProvider: false,
66
66
  EditSidePanel: false,
67
67
  CancelableTextEdit: false,
68
68
  DataSpreadsheet: false,
@@ -0,0 +1,13 @@
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
+ // Iterates through a numeric range and calls callback
8
+ // function for each iteration
9
+ export var rangeWithCallback = function rangeWithCallback(start, end, fn) {
10
+ for (var i = start; i <= end; i++) {
11
+ fn(i);
12
+ }
13
+ };