@carbon/ibm-products 1.12.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. package/css/components/Datagrid/styles/addons/CustomizeColumnsModal.css +47 -0
  2. package/css/components/Datagrid/styles/addons/CustomizeColumnsModal.css.map +1 -0
  3. package/css/components/Datagrid/styles/addons/RowSizeDropdown.css +20 -0
  4. package/css/components/Datagrid/styles/addons/RowSizeDropdown.css.map +1 -0
  5. package/css/components/Datagrid/styles/datagrid.css +264 -0
  6. package/css/components/Datagrid/styles/datagrid.css.map +1 -0
  7. package/css/components/Datagrid/styles/index.css +509 -0
  8. package/css/components/Datagrid/styles/index.css.map +1 -0
  9. package/css/components/Datagrid/styles/useActionsColumn.css +23 -0
  10. package/css/components/Datagrid/styles/useActionsColumn.css.map +1 -0
  11. package/css/components/Datagrid/styles/useColumnRightAlign.css +28 -0
  12. package/css/components/Datagrid/styles/useColumnRightAlign.css.map +1 -0
  13. package/css/components/Datagrid/styles/useNestedRows.css +15 -0
  14. package/css/components/Datagrid/styles/useNestedRows.css.map +1 -0
  15. package/css/components/Datagrid/styles/useNestedTable.css +25 -0
  16. package/css/components/Datagrid/styles/useNestedTable.css.map +1 -0
  17. package/css/components/Datagrid/styles/useSelectAllToggle.css +28 -0
  18. package/css/components/Datagrid/styles/useSelectAllToggle.css.map +1 -0
  19. package/css/components/Datagrid/styles/useSortableColumns.css +50 -0
  20. package/css/components/Datagrid/styles/useSortableColumns.css.map +1 -0
  21. package/css/components/Datagrid/styles/useStickyColumn.css +35 -0
  22. package/css/components/Datagrid/styles/useStickyColumn.css.map +1 -0
  23. package/css/index-full-carbon.css +653 -21
  24. package/css/index-full-carbon.css.map +1 -1
  25. package/css/index-full-carbon.min.css +6 -6
  26. package/css/index-full-carbon.min.css.map +1 -1
  27. package/css/index-without-carbon-released-only.css +21 -10
  28. package/css/index-without-carbon-released-only.css.map +1 -1
  29. package/css/index-without-carbon-released-only.min.css +2 -2
  30. package/css/index-without-carbon-released-only.min.css.map +1 -1
  31. package/css/index-without-carbon.css +653 -21
  32. package/css/index-without-carbon.css.map +1 -1
  33. package/css/index-without-carbon.min.css +5 -5
  34. package/css/index-without-carbon.min.css.map +1 -1
  35. package/css/index.css +653 -21
  36. package/css/index.css.map +1 -1
  37. package/css/index.min.css +6 -6
  38. package/css/index.min.css.map +1 -1
  39. package/es/components/ActionBar/ActionBar.js +3 -1
  40. package/es/components/ActionBar/ActionBarOverflowItems.js +5 -3
  41. package/es/components/AddSelect/AddSelect.js +98 -40
  42. package/es/components/AddSelect/AddSelectFilter.js +129 -0
  43. package/es/components/AddSelect/AddSelectList.js +27 -1
  44. package/es/components/AddSelect/AddSelectSidebar.js +15 -5
  45. package/es/components/AddSelect/add-select-utils.js +30 -0
  46. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +2 -0
  47. package/es/components/DataSpreadsheet/DataSpreadsheet.js +269 -142
  48. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +122 -39
  49. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +46 -17
  50. package/es/components/DataSpreadsheet/hooks/index.js +11 -0
  51. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +139 -0
  52. package/es/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -4
  53. package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +68 -0
  54. package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +6 -6
  55. package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +20 -8
  56. package/es/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +18 -0
  57. package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +121 -0
  58. package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +108 -0
  59. package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +87 -0
  60. package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +42 -8
  61. package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +225 -13
  62. package/es/components/DataSpreadsheet/utils/selectAllCells.js +53 -0
  63. package/es/components/Datagrid/Datagrid/Datagrid.js +70 -0
  64. package/es/components/Datagrid/Datagrid/DatagridBody.js +36 -0
  65. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +19 -0
  66. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +26 -0
  67. package/es/components/Datagrid/Datagrid/DatagridHead.js +31 -0
  68. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +57 -0
  69. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +37 -0
  70. package/es/components/Datagrid/Datagrid/DatagridRow.js +50 -0
  71. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +50 -0
  72. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +122 -0
  73. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +36 -0
  74. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +22 -0
  75. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +87 -0
  76. package/es/components/Datagrid/Datagrid/DraggableElement.js +188 -0
  77. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +78 -0
  78. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +51 -0
  79. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +140 -0
  80. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +157 -0
  81. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +62 -0
  82. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +13 -0
  83. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +9 -0
  84. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +62 -0
  85. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +139 -0
  86. package/es/components/Datagrid/Datagrid/addons/RowSize/index.js +8 -0
  87. package/es/components/Datagrid/Datagrid/index.js +8 -0
  88. package/es/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +6 -0
  89. package/es/components/Datagrid/Datagrid.stories/LeftPanelStory.js +6 -0
  90. package/es/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +6 -0
  91. package/es/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +6 -0
  92. package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +92 -0
  93. package/es/components/Datagrid/Datagrid.stories/common.js +199 -0
  94. package/es/components/Datagrid/Datagrid.stories/index.js +5 -0
  95. package/es/components/Datagrid/common-column-ids.js +8 -0
  96. package/es/components/Datagrid/index.js +22 -0
  97. package/es/components/Datagrid/useActionsColumn.js +86 -0
  98. package/es/components/Datagrid/useColumnRightAlign.js +52 -0
  99. package/es/components/Datagrid/useCustomizeColumns.js +45 -0
  100. package/es/components/Datagrid/useDatagrid.js +44 -0
  101. package/es/components/Datagrid/useDefaultStringRenderer.js +48 -0
  102. package/es/components/Datagrid/useDisableSelectRows.js +84 -0
  103. package/es/components/Datagrid/useExpandedRow.js +52 -0
  104. package/es/components/Datagrid/useFlexResize.js +51 -0
  105. package/es/components/Datagrid/useFloatingScroll.js +88 -0
  106. package/es/components/Datagrid/useInfiniteScroll.js +54 -0
  107. package/es/components/Datagrid/useNestedRows.js +53 -0
  108. package/es/components/Datagrid/useOnRowClick.js +37 -0
  109. package/es/components/Datagrid/useParentDimensions.js +65 -0
  110. package/es/components/Datagrid/useResizeTable.js +40 -0
  111. package/es/components/Datagrid/useRowExpander.js +34 -0
  112. package/es/components/Datagrid/useRowIsMouseOver.js +61 -0
  113. package/es/components/Datagrid/useRowRenderer.js +30 -0
  114. package/es/components/Datagrid/useRowSize.js +56 -0
  115. package/es/components/Datagrid/useSelectAllToggle.js +74 -0
  116. package/es/components/Datagrid/useSelectRows.js +107 -0
  117. package/es/components/Datagrid/useSkeletonRows.js +32 -0
  118. package/es/components/Datagrid/useSortableColumns.js +110 -0
  119. package/es/components/Datagrid/useStickyColumn.js +183 -0
  120. package/es/components/HTTPErrors/assets/HTTPErrorSvg403.js +2 -3
  121. package/es/components/HTTPErrors/assets/HTTPErrorSvg404.js +2 -3
  122. package/es/components/HTTPErrors/assets/HTTPErrorSvgOther.js +2 -3
  123. package/es/components/MultiAddSelect/MultiAddSelect.js +150 -3
  124. package/es/components/PageHeader/PageHeader.js +3 -1
  125. package/es/components/SingleAddSelect/SingleAddSelect.js +90 -4
  126. package/es/components/TagSet/TagSet.js +22 -6
  127. package/es/components/Tearsheet/TearsheetShell.js +34 -10
  128. package/es/components/UserProfileImage/UserProfileImage.js +37 -9
  129. package/es/components/index.js +2 -1
  130. package/es/global/js/package-settings.js +4 -2
  131. package/lib/components/ActionBar/ActionBar.js +3 -1
  132. package/lib/components/ActionBar/ActionBarOverflowItems.js +5 -3
  133. package/lib/components/AddSelect/AddSelect.js +97 -38
  134. package/lib/components/AddSelect/AddSelectFilter.js +147 -0
  135. package/lib/components/AddSelect/AddSelectList.js +28 -1
  136. package/lib/components/AddSelect/AddSelectSidebar.js +15 -11
  137. package/lib/components/AddSelect/add-select-utils.js +35 -2
  138. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +2 -0
  139. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +279 -145
  140. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +121 -45
  141. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +47 -17
  142. package/lib/components/DataSpreadsheet/hooks/index.js +45 -0
  143. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +151 -0
  144. package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -4
  145. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +79 -0
  146. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +6 -5
  147. package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +21 -8
  148. package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +27 -0
  149. package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +127 -0
  150. package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +118 -0
  151. package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +94 -0
  152. package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +44 -8
  153. package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +235 -20
  154. package/lib/components/DataSpreadsheet/utils/selectAllCells.js +60 -0
  155. package/lib/components/Datagrid/Datagrid/Datagrid.js +86 -0
  156. package/lib/components/Datagrid/Datagrid/DatagridBody.js +50 -0
  157. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +31 -0
  158. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +38 -0
  159. package/lib/components/Datagrid/Datagrid/DatagridHead.js +43 -0
  160. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +73 -0
  161. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +44 -0
  162. package/lib/components/Datagrid/Datagrid/DatagridRow.js +56 -0
  163. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +55 -0
  164. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +139 -0
  165. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +44 -0
  166. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +35 -0
  167. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +101 -0
  168. package/lib/components/Datagrid/Datagrid/DraggableElement.js +210 -0
  169. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +92 -0
  170. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +65 -0
  171. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +166 -0
  172. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +173 -0
  173. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +73 -0
  174. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +25 -0
  175. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +23 -0
  176. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +80 -0
  177. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +160 -0
  178. package/lib/components/Datagrid/Datagrid/addons/RowSize/index.js +15 -0
  179. package/lib/components/Datagrid/Datagrid/index.js +15 -0
  180. package/lib/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +13 -0
  181. package/lib/components/Datagrid/Datagrid.stories/LeftPanelStory.js +13 -0
  182. package/lib/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +13 -0
  183. package/lib/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +13 -0
  184. package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +112 -0
  185. package/lib/components/Datagrid/Datagrid.stories/common.js +215 -0
  186. package/lib/components/Datagrid/Datagrid.stories/index.js +47 -0
  187. package/lib/components/Datagrid/common-column-ids.js +16 -0
  188. package/lib/components/Datagrid/index.js +127 -0
  189. package/lib/components/Datagrid/useActionsColumn.js +94 -0
  190. package/lib/components/Datagrid/useColumnRightAlign.js +59 -0
  191. package/lib/components/Datagrid/useCustomizeColumns.js +55 -0
  192. package/lib/components/Datagrid/useDatagrid.js +58 -0
  193. package/lib/components/Datagrid/useDefaultStringRenderer.js +54 -0
  194. package/lib/components/Datagrid/useDisableSelectRows.js +92 -0
  195. package/lib/components/Datagrid/useExpandedRow.js +58 -0
  196. package/lib/components/Datagrid/useFlexResize.js +61 -0
  197. package/lib/components/Datagrid/useFloatingScroll.js +101 -0
  198. package/lib/components/Datagrid/useInfiniteScroll.js +67 -0
  199. package/lib/components/Datagrid/useNestedRows.js +65 -0
  200. package/lib/components/Datagrid/useOnRowClick.js +45 -0
  201. package/lib/components/Datagrid/useParentDimensions.js +75 -0
  202. package/lib/components/Datagrid/useResizeTable.js +48 -0
  203. package/lib/components/Datagrid/useRowExpander.js +45 -0
  204. package/lib/components/Datagrid/useRowIsMouseOver.js +66 -0
  205. package/lib/components/Datagrid/useRowRenderer.js +40 -0
  206. package/lib/components/Datagrid/useRowSize.js +67 -0
  207. package/lib/components/Datagrid/useSelectAllToggle.js +88 -0
  208. package/lib/components/Datagrid/useSelectRows.js +119 -0
  209. package/lib/components/Datagrid/useSkeletonRows.js +42 -0
  210. package/lib/components/Datagrid/useSortableColumns.js +117 -0
  211. package/lib/components/Datagrid/useStickyColumn.js +190 -0
  212. package/lib/components/HTTPErrors/assets/HTTPErrorSvg403.js +2 -3
  213. package/lib/components/HTTPErrors/assets/HTTPErrorSvg404.js +2 -3
  214. package/lib/components/HTTPErrors/assets/HTTPErrorSvgOther.js +2 -3
  215. package/lib/components/MultiAddSelect/MultiAddSelect.js +150 -2
  216. package/lib/components/PageHeader/PageHeader.js +3 -1
  217. package/lib/components/SingleAddSelect/SingleAddSelect.js +91 -3
  218. package/lib/components/TagSet/TagSet.js +22 -6
  219. package/lib/components/Tearsheet/TearsheetShell.js +36 -10
  220. package/lib/components/UserProfileImage/UserProfileImage.js +37 -9
  221. package/lib/components/index.js +9 -1
  222. package/lib/global/js/package-settings.js +4 -2
  223. package/package.json +20 -16
  224. package/scss/components/AboutModal/_about-modal.scss +4 -0
  225. package/scss/components/AddSelect/_add-select.scss +51 -2
  226. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +72 -9
  227. package/scss/components/Datagrid/_datagrid.scss +66 -0
  228. package/scss/components/Datagrid/_index.scss +8 -0
  229. package/scss/components/Datagrid/_storybook-styles.scss +26 -0
  230. package/scss/components/Datagrid/styles/_variables.scss +9 -0
  231. package/scss/components/Datagrid/styles/addons/CustomizeColumnsModal.scss +48 -0
  232. package/scss/components/Datagrid/styles/addons/RowSizeDropdown.scss +23 -0
  233. package/scss/components/Datagrid/styles/datagrid.scss +318 -0
  234. package/scss/components/Datagrid/styles/index.scss +17 -0
  235. package/scss/components/Datagrid/styles/useActionsColumn.scss +24 -0
  236. package/scss/components/Datagrid/styles/useColumnRightAlign.scss +29 -0
  237. package/scss/components/Datagrid/styles/useNestedRows.scss +17 -0
  238. package/scss/components/Datagrid/styles/useNestedTable.scss +28 -0
  239. package/scss/components/Datagrid/styles/useSelectAllToggle.scss +28 -0
  240. package/scss/components/Datagrid/styles/useSortableColumns.scss +55 -0
  241. package/scss/components/Datagrid/styles/useStickyColumn.scss +38 -0
  242. package/scss/components/ExportModal/_export-modal.scss +0 -4
  243. package/scss/components/HTTPErrors/_http-errors.scss +16 -16
  244. package/scss/components/PageHeader/_page-header.scss +4 -0
  245. package/scss/components/Tearsheet/_tearsheet.scss +4 -0
  246. package/scss/components/_index.scss +1 -0
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { forwardRef } from 'react'; // import PropTypes from 'prop-types';
3
-
2
+ import React, { forwardRef } from 'react';
3
+ import PropTypes from 'prop-types';
4
4
  import { AddSelect } from '../AddSelect';
5
5
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
6
6
  import { pkg } from '../../settings';
@@ -12,5 +12,152 @@ export var MultiAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
12
12
  }, getDevtoolsProps(componentName)));
13
13
  });
14
14
  MultiAddSelect = pkg.checkComponentEnabled(MultiAddSelect, componentName);
15
- MultiAddSelect.propTypes = {};
15
+ MultiAddSelect.propTypes = {
16
+ /**
17
+ * optional class name
18
+ */
19
+ className: PropTypes.string,
20
+
21
+ /**
22
+ * placeholder for column input filter
23
+ */
24
+ columnInputPlaceholder: PropTypes.string,
25
+
26
+ /**
27
+ * text description that appears under the title
28
+ */
29
+ description: PropTypes.string,
30
+
31
+ /**
32
+ * options to display in the global filter box. values are generated
33
+ * from the id which should correlate with a specific property in an
34
+ * item entry
35
+ */
36
+ globalFilters: PropTypes.arrayOf(PropTypes.shape({
37
+ id: PropTypes.string,
38
+ label: PropTypes.string
39
+ })),
40
+ globalFiltersIconDescription: PropTypes.string,
41
+
42
+ /**
43
+ * placeholder text for the global filter dropdown
44
+ */
45
+ globalFiltersPlaceholderText: PropTypes.string,
46
+
47
+ /**
48
+ * text for the global filter primary button
49
+ */
50
+ globalFiltersPrimaryButtonText: PropTypes.string,
51
+
52
+ /**
53
+ * text for the global filter secondary button
54
+ */
55
+ globalFiltersSecondaryButtonText: PropTypes.string,
56
+
57
+ /**
58
+ * label for global search input
59
+ */
60
+ globalSearchLabel: PropTypes.string,
61
+
62
+ /**
63
+ * placeholder for global search input
64
+ */
65
+ globalSearchPlaceholder: PropTypes.string,
66
+
67
+ /**
68
+ * title that displays in the sidebar / influencer
69
+ */
70
+ influencerTitle: PropTypes.string,
71
+
72
+ /**
73
+ * object that contains the item data. for more information reference the
74
+ * "Structuring items" section in the docs tab
75
+ */
76
+ items: PropTypes.shape({
77
+ modifiers: PropTypes.shape({
78
+ label: PropTypes.string,
79
+ options: PropTypes.array
80
+ }),
81
+ sortBy: PropTypes.array,
82
+ filterBy: PropTypes.array,
83
+ entries: PropTypes.arrayOf(PropTypes.shape({
84
+ avatar: PropTypes.shape({
85
+ alt: PropTypes.string,
86
+ icon: PropTypes.object,
87
+ src: PropTypes.string
88
+ }),
89
+ children: PropTypes.object,
90
+ icon: PropTypes.object,
91
+ id: PropTypes.string.isRequired,
92
+ subtitle: PropTypes.string,
93
+ title: PropTypes.string.isRequired,
94
+ value: PropTypes.string.isRequired
95
+ }))
96
+ }),
97
+
98
+ /**
99
+ * label that display above the list of items
100
+ */
101
+ itemsLabel: PropTypes.string,
102
+
103
+ /**
104
+ * text to display when no results are found from the global search
105
+ */
106
+ noResultsDescription: PropTypes.string,
107
+
108
+ /**
109
+ * title to display when no results are found from the global search
110
+ */
111
+ noResultsTitle: PropTypes.string,
112
+
113
+ /**
114
+ * text body that displays in the sidebar when nothing is selected
115
+ */
116
+ noSelectionDescription: PropTypes.string,
117
+
118
+ /**
119
+ * title that displays in the sidebar when nothing is selected
120
+ */
121
+ noSelectionTitle: PropTypes.string,
122
+
123
+ /**
124
+ * function to call when the close button clicked
125
+ */
126
+ onClose: PropTypes.func,
127
+
128
+ /**
129
+ * text for close button
130
+ */
131
+ onCloseButtonText: PropTypes.string,
132
+
133
+ /**
134
+ * function to call when the submit button is clicked. returns a selection
135
+ */
136
+ onSubmit: PropTypes.func,
137
+
138
+ /**
139
+ * text for the submit button
140
+ */
141
+ onSubmitButtonText: PropTypes.string,
142
+
143
+ /**
144
+ * specifies if the component is open or not
145
+ */
146
+ open: PropTypes.bool,
147
+
148
+ /**
149
+ * description for the remove item icon
150
+ */
151
+ removeIconDescription: PropTypes.string,
152
+
153
+ /**
154
+ * text that displays when displaying filtered items
155
+ */
156
+ searchResultsLabel: PropTypes.string,
157
+
158
+ /**
159
+ * header text
160
+ */
161
+ title: PropTypes.string
162
+ };
16
163
  MultiAddSelect.displayName = componentName;
@@ -499,7 +499,8 @@ var TYPES = {
499
499
  gray: 'Gray',
500
500
  'cool-gray': 'Cool-Gray',
501
501
  'warm-gray': 'Warm-Gray',
502
- 'high-contrast': 'High-Contrast'
502
+ 'high-contrast': 'High-Contrast',
503
+ outline: 'Outline'
503
504
  };
504
505
  var tagTypes = Object.keys(TYPES);
505
506
  export var deprecatedProps = {
@@ -513,6 +514,7 @@ export var deprecatedProps = {
513
514
  */
514
515
  hasBackgroundAlways: deprecateProp(PropTypes.bool, 'Property replaced by `withoutBackground`')
515
516
  };
517
+ PageHeader.tagTypes = tagTypes;
516
518
  PageHeader.propTypes = _objectSpread({
517
519
  /**
518
520
  * Specifies the action bar items which are the final items in the row top of the PageHeader.
@@ -1,15 +1,101 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { forwardRef } from 'react'; // import PropTypes from 'prop-types';
3
-
2
+ import React, { forwardRef } from 'react';
3
+ import PropTypes from 'prop-types';
4
4
  import { AddSelect } from '../AddSelect';
5
5
  import { getDevtoolsProps } from '../../global/js/utils/devtools';
6
6
  import { pkg } from '../../settings';
7
+ import { prepareProps } from '../../global/js/utils/props-helper';
7
8
  var componentName = 'SingleAddSelect';
8
9
  export var SingleAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
9
- return /*#__PURE__*/React.createElement(AddSelect, _extends({}, props, {
10
+ // remove multi add select specific props
11
+ var validProps = prepareProps(props, ['columnInputPlaceholder', 'globalFilters', 'globalFiltersIconDescription', 'globalFiltersPlaceholderText', 'globalFiltersPrimaryButtonText', 'globalFiltersSecondaryButtonText', 'influencerTitle', 'multi', 'noSelectionDescription', 'noSelectionTitle', 'removeIconDescription']);
12
+ return /*#__PURE__*/React.createElement(AddSelect, _extends({}, validProps, {
10
13
  ref: ref
11
14
  }, getDevtoolsProps(componentName)));
12
15
  });
13
16
  SingleAddSelect = pkg.checkComponentEnabled(SingleAddSelect, componentName);
14
- SingleAddSelect.propTypes = {};
17
+ SingleAddSelect.propTypes = {
18
+ /**
19
+ * optional class name
20
+ */
21
+ className: PropTypes.string,
22
+
23
+ /**
24
+ * text description that appears under the title
25
+ */
26
+ description: PropTypes.string,
27
+
28
+ /**
29
+ * label for global search input
30
+ */
31
+ globalSearchLabel: PropTypes.string,
32
+
33
+ /**
34
+ * placeholder for global search input
35
+ */
36
+ globalSearchPlaceholder: PropTypes.string,
37
+
38
+ /**
39
+ * object that contains the item data. for more information reference the
40
+ * "Structuring items" section in the docs tab
41
+ */
42
+ items: PropTypes.shape({
43
+ entries: PropTypes.arrayOf(PropTypes.shape({
44
+ children: PropTypes.object,
45
+ id: PropTypes.string.isRequired,
46
+ title: PropTypes.string.isRequired,
47
+ value: PropTypes.string.isRequired
48
+ }))
49
+ }),
50
+
51
+ /**
52
+ * label that display above the list of items
53
+ */
54
+ itemsLabel: PropTypes.string,
55
+
56
+ /**
57
+ * text to display when no results are found from the global search
58
+ */
59
+ noResultsDescription: PropTypes.string,
60
+
61
+ /**
62
+ * title to display when no results are found from the global search
63
+ */
64
+ noResultsTitle: PropTypes.string,
65
+
66
+ /**
67
+ * function to call when the close button clicked
68
+ */
69
+ onClose: PropTypes.func,
70
+
71
+ /**
72
+ * text for close button
73
+ */
74
+ onCloseButtonText: PropTypes.string,
75
+
76
+ /**
77
+ * function to call when the submit button is clicked. returns a selection
78
+ */
79
+ onSubmit: PropTypes.func,
80
+
81
+ /**
82
+ * text for the submit button
83
+ */
84
+ onSubmitButtonText: PropTypes.string,
85
+
86
+ /**
87
+ * specifies if the component is open or not
88
+ */
89
+ open: PropTypes.bool,
90
+
91
+ /**
92
+ * text that displays when displaying filtered items
93
+ */
94
+ searchResultsLabel: PropTypes.string,
95
+
96
+ /**
97
+ * header text
98
+ */
99
+ title: PropTypes.string
100
+ };
15
101
  SingleAddSelect.displayName = componentName;
@@ -33,15 +33,14 @@ var allTagsModalSearchThreshold = 10; // Default values for props
33
33
 
34
34
  var defaults = {
35
35
  align: 'start',
36
- allTagsModalTarget: document.body,
36
+ // allTagsModalTarget: document.body,
37
37
  overflowAlign: 'center',
38
38
  overflowDirection: 'bottom'
39
39
  };
40
40
  export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
41
41
  var _ref$align = _ref.align,
42
42
  align = _ref$align === void 0 ? defaults.align : _ref$align,
43
- _ref$allTagsModalTarg = _ref.allTagsModalTarget,
44
- allTagsModalTarget = _ref$allTagsModalTarg === void 0 ? defaults.allTagsModalTarget : _ref$allTagsModalTarg,
43
+ allTagsModalTargetIn = _ref.allTagsModalTarget,
45
44
  className = _ref.className,
46
45
  maxVisible = _ref.maxVisible,
47
46
  _ref$overflowAlign = _ref.overflowAlign,
@@ -88,10 +87,24 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
88
87
 
89
88
  var overflowTag = useRef(null);
90
89
 
90
+ var _useState11 = useState(null),
91
+ _useState12 = _slicedToArray(_useState11, 2),
92
+ allTagsModalTarget = _useState12[0],
93
+ setAllTagsModalTarget = _useState12[1];
94
+
91
95
  var handleShowAllClick = function handleShowAllClick() {
92
96
  setShowAllModalOpen(true);
93
97
  };
94
98
 
99
+ useEffect(function () {
100
+ if (allTagsModalTargetIn) {
101
+ setAllTagsModalTarget(allTagsModalTargetIn);
102
+ } else {
103
+ if (pkg.isFeatureEnabled('default-portal-target-body')) {
104
+ setAllTagsModalTarget(document.body);
105
+ }
106
+ }
107
+ }, [allTagsModalTargetIn]);
95
108
  useEffect(function () {
96
109
  var newSizingTags = []; // create sizing tags
97
110
 
@@ -228,14 +241,16 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
228
241
  }, hiddenSizingTags), /*#__PURE__*/React.createElement("div", {
229
242
  className: "".concat(blockClass, "__tag-container"),
230
243
  ref: displayedArea
231
- }, displayedTags)), allTagsModalTarget && tags && displayCount < tags.length ? /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(TagSetModal, {
244
+ }, displayedTags)), (allTagsModalTarget ? createPortal : function (children) {
245
+ return children;
246
+ })( /*#__PURE__*/React.createElement(TagSetModal, {
232
247
  allTags: tags,
233
248
  open: showAllModalOpen,
234
249
  title: allTagsModalTitle,
235
250
  onClose: handleModalClose,
236
251
  searchLabel: allTagsModalSearchLabel,
237
252
  searchPlaceholder: allTagsModalSearchPlaceholderText
238
- }), allTagsModalTarget) : null);
253
+ }), allTagsModalTarget));
239
254
  }); // Return a placeholder if not released and not enabled by feature flag
240
255
 
241
256
  TagSet = pkg.checkComponentEnabled(TagSet, componentName);
@@ -260,7 +275,8 @@ var TYPES = {
260
275
  gray: 'Gray',
261
276
  'cool-gray': 'Cool-Gray',
262
277
  'warm-gray': 'Warm-Gray',
263
- 'high-contrast': 'High-Contrast'
278
+ 'high-contrast': 'High-Contrast',
279
+ outline: 'Outline'
264
280
  };
265
281
  var tagTypes = Object.keys(TYPES);
266
282
  TagSet.types = tagTypes;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["actions", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "selectorPrimaryFocus", "size", "title", "verticalPosition"];
5
+ var _excluded = ["actions", "children", "className", "closeIconDescription", "description", "hasCloseIcon", "headerActions", "influencer", "influencerPosition", "influencerWidth", "label", "navigation", "onClose", "open", "selectorPrimaryFocus", "size", "portalTarget", "title", "verticalPosition"];
6
6
 
7
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
8
 
@@ -16,6 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
16
16
  */
17
17
  // Import portions of React that are needed.
18
18
  import React, { useEffect, useState, useRef } from 'react';
19
+ import { createPortal } from 'react-dom';
19
20
  import { useResizeDetector } from 'react-resize-detector'; // Other standard imports.
20
21
 
21
22
  import PropTypes from 'prop-types';
@@ -68,10 +69,26 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
68
69
  open = _ref.open,
69
70
  selectorPrimaryFocus = _ref.selectorPrimaryFocus,
70
71
  size = _ref.size,
72
+ portalTargetIn = _ref.portalTarget,
71
73
  title = _ref.title,
72
74
  verticalPosition = _ref.verticalPosition,
73
75
  rest = _objectWithoutProperties(_ref, _excluded);
74
76
 
77
+ // node the modal tearsheet is hosted in
78
+ var _useState = useState(null),
79
+ _useState2 = _slicedToArray(_useState, 2),
80
+ portalTarget = _useState2[0],
81
+ setPortalTarget = _useState2[1];
82
+
83
+ useEffect(function () {
84
+ if (portalTargetIn) {
85
+ setPortalTarget(portalTargetIn);
86
+ } else {
87
+ if (pkg.isFeatureEnabled('default-portal-target-body')) {
88
+ setPortalTarget(document.body);
89
+ }
90
+ }
91
+ }, [portalTargetIn]);
75
92
  var localRef = useRef();
76
93
  var modalRef = ref || localRef;
77
94
 
@@ -82,15 +99,15 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
82
99
  resizer = _useResizeDetector.ref; // Keep track of the stack depth and our position in it (1-based, 0=closed)
83
100
 
84
101
 
85
- var _useState = useState(0),
86
- _useState2 = _slicedToArray(_useState, 2),
87
- depth = _useState2[0],
88
- setDepth = _useState2[1];
89
-
90
102
  var _useState3 = useState(0),
91
103
  _useState4 = _slicedToArray(_useState3, 2),
92
- position = _useState4[0],
93
- setPosition = _useState4[1]; // Keep a record of the previous value of depth.
104
+ depth = _useState4[0],
105
+ setDepth = _useState4[1];
106
+
107
+ var _useState5 = useState(0),
108
+ _useState6 = _slicedToArray(_useState5, 2),
109
+ position = _useState6[0],
110
+ setPosition = _useState6[1]; // Keep a record of the previous value of depth.
94
111
 
95
112
 
96
113
  var prevDepth = useRef();
@@ -176,7 +193,9 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
176
193
  var includeHeader = label || title || description || headerActions || navigation || effectiveHasCloseIcon; // Include an ActionSet if and only if one or more actions is given.
177
194
 
178
195
  var includeActions = actions && (actions === null || actions === void 0 ? void 0 : actions.length) > 0;
179
- return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
196
+ return (portalTarget ? createPortal : function (children) {
197
+ return children;
198
+ })( /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
180
199
  "aria-label": title,
181
200
  className: cx(bc, className, (_cx = {}, _defineProperty(_cx, "".concat(bc, "--stacked-").concat(position, "-of-").concat(depth), // Don't apply this on the initial open of a single tearsheet.
182
201
  depth > 1 || depth === 1 && prevDepth.current > 1), _defineProperty(_cx, "".concat(bc, "--wide"), size === 'wide'), _defineProperty(_cx, "".concat(bc, "--narrow"), size !== 'wide'), _cx)),
@@ -237,7 +256,7 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
237
256
  })))), /*#__PURE__*/React.createElement("div", {
238
257
  className: "".concat(bc, "__resize-detector"),
239
258
  ref: resizer
240
- }));
259
+ })), portalTarget);
241
260
  } else {
242
261
  pconsole.warn('Tearsheet not rendered: maximum stacking depth exceeded.');
243
262
  return null;
@@ -377,6 +396,11 @@ TearsheetShell.propTypes = _objectSpread({
377
396
  */
378
397
  open: PropTypes.bool,
379
398
 
399
+ /**
400
+ * portal target for the all tags modal
401
+ */
402
+ portalTarget: PropTypes.node,
403
+
380
404
  /**
381
405
  * Specifies the width of the tearsheet, 'narrow' or 'wide'.
382
406
  */
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["backgroundColor", "className", "kind", "initials", "image", "imageDescription", "size", "theme", "tooltipText"];
3
+ var _excluded = ["backgroundColor", "className", "kind", "icon", "initials", "image", "imageDescription", "size", "theme", "tooltipText"];
4
4
 
5
5
  /**
6
6
  * Copyright IBM Corp. 2021, 2021
@@ -31,6 +31,7 @@ export var UserProfileImage = /*#__PURE__*/React.forwardRef(function (_ref, ref)
31
31
  var backgroundColor = _ref.backgroundColor,
32
32
  className = _ref.className,
33
33
  kind = _ref.kind,
34
+ icon = _ref.icon,
34
35
  initials = _ref.initials,
35
36
  image = _ref.image,
36
37
  imageDescription = _ref.imageDescription,
@@ -62,18 +63,40 @@ export var UserProfileImage = /*#__PURE__*/React.forwardRef(function (_ref, ref)
62
63
  return initials.match(/(^\S\S?|\b\S)?/g).join('').match(/(^\S|\S$)?/g).join('').toUpperCase();
63
64
  };
64
65
 
65
- var FillItem = image ? function () {
66
- return /*#__PURE__*/React.createElement("img", {
67
- alt: imageDescription,
68
- src: image,
69
- className: "".concat(blockClass, "__photo ").concat(blockClass, "__photo--").concat(size)
70
- });
71
- } : initials ? formatInitials : kind && size && icons[kind][size];
66
+ var getFillItem = function getFillItem() {
67
+ if (image) {
68
+ return function () {
69
+ return /*#__PURE__*/React.createElement("img", {
70
+ alt: imageDescription,
71
+ src: image,
72
+ className: "".concat(blockClass, "__photo ").concat(blockClass, "__photo--").concat(size)
73
+ });
74
+ };
75
+ }
76
+
77
+ if (initials) {
78
+ return formatInitials;
79
+ }
80
+
81
+ if (kind && size) {
82
+ return icons[kind][size];
83
+ }
84
+
85
+ return icon;
86
+ }; // if user doesn't provide a color just generate a random one
87
+
88
+
89
+ var getRandomColor = function getRandomColor() {
90
+ var colors = ['light-cyan', 'dark-cyan', 'light-gray', 'dark-gray', 'light-green', 'dark-green', 'light-magenta', 'dark-magenta', 'light-purple', 'dark-purple', 'light-teal', 'dark-teal'];
91
+ return colors[Math.floor(Math.random() * colors.length)];
92
+ };
93
+
94
+ var FillItem = getFillItem();
72
95
 
73
96
  var renderUserProfileImage = function renderUserProfileImage() {
74
97
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
75
98
  ref: ref,
76
- className: cx([blockClass, className, "".concat(blockClass, "--").concat(size), "".concat(blockClass, "--").concat(theme), "".concat(blockClass, "--").concat(backgroundColor)])
99
+ className: cx([blockClass, className, "".concat(blockClass, "--").concat(size), "".concat(blockClass, "--").concat(theme), "".concat(blockClass, "--").concat(backgroundColor || getRandomColor())])
77
100
  }, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(FillItem, null));
78
101
  };
79
102
 
@@ -97,6 +120,11 @@ UserProfileImage.propTypes = {
97
120
  */
98
121
  className: PropTypes.string,
99
122
 
123
+ /**
124
+ * Provide a custom icon to use if you need to use an icon other than the included ones
125
+ */
126
+ icon: PropTypes.object,
127
+
100
128
  /**
101
129
  * When passing the image prop, supply a full path to the image to be displayed.
102
130
  */
@@ -36,4 +36,5 @@ export { WebTerminal } from './WebTerminal';
36
36
  export { EditSidePanel } from './EditSidePanel';
37
37
  export { OptionsTile } from './OptionsTile';
38
38
  export { InlineEdit } from './InlineEdit';
39
- export { DataSpreadsheet } from './DataSpreadsheet';
39
+ export { DataSpreadsheet } from './DataSpreadsheet';
40
+ export { Datagrid } from './Datagrid';
@@ -63,13 +63,15 @@ var defaults = {
63
63
  EditSidePanel: false,
64
64
  CancelableTextEdit: false,
65
65
  InlineEdit: false,
66
- DataSpreadsheet: false
66
+ DataSpreadsheet: false,
67
+ Datagrid: false
67
68
  /* new component flags here - comment used by generate CLI */
68
69
 
69
70
  },
70
71
  // feature level flags
71
72
  feature: {
72
- 'a-new-feature': false
73
+ 'a-new-feature': false,
74
+ 'default-portal-target-body': true
73
75
  }
74
76
  };
75
77
 
@@ -93,6 +93,8 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
93
93
  className: "".concat(blockClass, "__hidden-sizing-items"),
94
94
  "aria-hidden": true,
95
95
  ref: sizingRef
96
+ }, /*#__PURE__*/_react.default.createElement("span", {
97
+ "aria-hidden": false
96
98
  }, /*#__PURE__*/_react.default.createElement(_ActionBarOverflowItems.ActionBarOverflowItems, {
97
99
  className: "".concat(blockClass, "__hidden-sizing-item"),
98
100
  overflowAriaLabel: "hidden sizing overflow items",
@@ -108,7 +110,7 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
108
110
  key: "hidden-item-".concat(key),
109
111
  className: "".concat(blockClass, "__hidden-sizing-item")
110
112
  }));
111
- })));
113
+ }))));
112
114
  }, [actions]); // creates displayed items based on actions, displayCount and alignment
113
115
 
114
116
  (0, _react.useEffect)(function () {
@@ -49,8 +49,10 @@ var ActionBarOverflowItems = function ActionBarOverflowItems(_ref) {
49
49
  className: (0, _classnames.default)(blockClass, className),
50
50
  direction: "bottom",
51
51
  flipped: true,
52
+ iconDescription: overflowAriaLabel // also needs setting to avoid a11y "Accessible name does not match or contain the visible label text"
53
+ ,
52
54
  menuOptionsClass: (0, _classnames.default)("".concat(blockClass, "__options"), menuOptionsClass)
53
- }, _react.default.Children.map(overflowItems, function (item) {
55
+ }, _react.default.Children.map(overflowItems, function (item, index) {
54
56
  // This uses a copy of a menu item option
55
57
  // NOTE: Cannot use a real Tooltip icon below as it uses a <button /> the
56
58
  // div equivalent below is based on Carbon 10.25.0
@@ -58,10 +60,10 @@ var ActionBarOverflowItems = function ActionBarOverflowItems(_ref) {
58
60
  className: "".concat(blockClass, "__item"),
59
61
  itemText: /*#__PURE__*/_react.default.createElement("div", {
60
62
  className: "".concat(blockClass, "__item-content"),
61
- "aria-describedby": "".concat(internalId, "--item-label")
63
+ "aria-describedby": "".concat(internalId.current, "-").concat(index, "--item-label")
62
64
  }, /*#__PURE__*/_react.default.createElement("span", {
63
65
  className: "".concat(blockClass, "__item-label"),
64
- id: "".concat(internalId, "--item-label")
66
+ id: "".concat(internalId.current, "-").concat(index, "--item-label")
65
67
  }, item.props.iconDescription), /*#__PURE__*/_react.default.createElement(item.props.renderIcon, null))
66
68
  });
67
69
  }));