@carbon/ibm-products 1.13.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) 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 +268 -0
  6. package/css/components/Datagrid/styles/datagrid.css.map +1 -0
  7. package/css/components/Datagrid/styles/index.css +513 -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 +611 -10
  24. package/css/index-full-carbon.css.map +1 -1
  25. package/css/index-full-carbon.min.css +3 -3
  26. package/css/index-full-carbon.min.css.map +1 -1
  27. package/css/index-without-carbon-released-only.css +7 -4
  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 +611 -10
  32. package/css/index-without-carbon.css.map +1 -1
  33. package/css/index-without-carbon.min.css +3 -3
  34. package/css/index-without-carbon.min.css.map +1 -1
  35. package/css/index.css +611 -10
  36. package/css/index.css.map +1 -1
  37. package/css/index.min.css +3 -3
  38. package/css/index.min.css.map +1 -1
  39. package/es/components/AddSelect/AddSelect.js +106 -43
  40. package/es/components/AddSelect/AddSelectFilter.js +172 -0
  41. package/es/components/AddSelect/add-select-utils.js +30 -0
  42. package/es/components/DataSpreadsheet/DataSpreadsheet.js +255 -175
  43. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +78 -17
  44. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +65 -20
  45. package/es/components/DataSpreadsheet/hooks/index.js +11 -0
  46. package/es/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +139 -0
  47. package/es/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -4
  48. package/es/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +68 -0
  49. package/es/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +1 -3
  50. package/es/components/DataSpreadsheet/utils/createCellSelectionArea.js +20 -8
  51. package/es/components/DataSpreadsheet/utils/generateData.js +17 -9
  52. package/es/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +18 -0
  53. package/es/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +30 -0
  54. package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +121 -0
  55. package/es/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +108 -0
  56. package/es/components/DataSpreadsheet/utils/handleEditSubmit.js +87 -0
  57. package/es/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +42 -8
  58. package/es/components/DataSpreadsheet/utils/handleMultipleKeys.js +225 -13
  59. package/es/components/DataSpreadsheet/utils/selectAllCells.js +53 -0
  60. package/es/components/Datagrid/Datagrid/Datagrid.js +70 -0
  61. package/es/components/Datagrid/Datagrid/DatagridBody.js +36 -0
  62. package/es/components/Datagrid/Datagrid/DatagridEmptyBody.js +19 -0
  63. package/es/components/Datagrid/Datagrid/DatagridExpandedRow.js +26 -0
  64. package/es/components/Datagrid/Datagrid/DatagridHead.js +31 -0
  65. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +57 -0
  66. package/es/components/Datagrid/Datagrid/DatagridRefBody.js +37 -0
  67. package/es/components/Datagrid/Datagrid/DatagridRow.js +60 -0
  68. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +50 -0
  69. package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +122 -0
  70. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.js +36 -0
  71. package/es/components/Datagrid/Datagrid/DatagridToolbar.js +22 -0
  72. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +87 -0
  73. package/es/components/Datagrid/Datagrid/DraggableElement.js +188 -0
  74. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +78 -0
  75. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +51 -0
  76. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +140 -0
  77. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +157 -0
  78. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +62 -0
  79. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +13 -0
  80. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +9 -0
  81. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +62 -0
  82. package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +139 -0
  83. package/es/components/Datagrid/Datagrid/addons/RowSize/index.js +8 -0
  84. package/es/components/Datagrid/Datagrid/index.js +8 -0
  85. package/es/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +6 -0
  86. package/es/components/Datagrid/Datagrid.stories/LeftPanelStory.js +6 -0
  87. package/es/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +6 -0
  88. package/es/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +6 -0
  89. package/es/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +92 -0
  90. package/es/components/Datagrid/Datagrid.stories/common.js +199 -0
  91. package/es/components/Datagrid/Datagrid.stories/index.js +5 -0
  92. package/es/components/Datagrid/common-column-ids.js +8 -0
  93. package/es/components/Datagrid/index.js +22 -0
  94. package/es/components/Datagrid/useActionsColumn.js +86 -0
  95. package/es/components/Datagrid/useColumnRightAlign.js +52 -0
  96. package/es/components/Datagrid/useCustomizeColumns.js +45 -0
  97. package/es/components/Datagrid/useDatagrid.js +44 -0
  98. package/es/components/Datagrid/useDefaultStringRenderer.js +48 -0
  99. package/es/components/Datagrid/useDisableSelectRows.js +84 -0
  100. package/es/components/Datagrid/useExpandedRow.js +52 -0
  101. package/es/components/Datagrid/useFlexResize.js +51 -0
  102. package/es/components/Datagrid/useFloatingScroll.js +88 -0
  103. package/es/components/Datagrid/useInfiniteScroll.js +54 -0
  104. package/es/components/Datagrid/useNestedRows.js +53 -0
  105. package/es/components/Datagrid/useOnRowClick.js +37 -0
  106. package/es/components/Datagrid/useParentDimensions.js +65 -0
  107. package/es/components/Datagrid/useResizeTable.js +40 -0
  108. package/es/components/Datagrid/useRowExpander.js +34 -0
  109. package/es/components/Datagrid/useRowIsMouseOver.js +61 -0
  110. package/es/components/Datagrid/useRowRenderer.js +30 -0
  111. package/es/components/Datagrid/useRowSize.js +56 -0
  112. package/es/components/Datagrid/useSelectAllToggle.js +74 -0
  113. package/es/components/Datagrid/useSelectRows.js +107 -0
  114. package/es/components/Datagrid/useSkeletonRows.js +32 -0
  115. package/es/components/Datagrid/useSortableColumns.js +110 -0
  116. package/es/components/Datagrid/useStickyColumn.js +183 -0
  117. package/es/components/MultiAddSelect/MultiAddSelect.js +150 -3
  118. package/es/components/PageHeader/PageHeader.js +3 -1
  119. package/es/components/SingleAddSelect/SingleAddSelect.js +90 -4
  120. package/es/components/TagSet/TagSet.js +13 -6
  121. package/es/components/Tearsheet/TearsheetShell.js +34 -10
  122. package/es/components/index.js +2 -1
  123. package/es/global/js/package-settings.js +4 -2
  124. package/lib/components/AddSelect/AddSelect.js +105 -41
  125. package/lib/components/AddSelect/AddSelectFilter.js +190 -0
  126. package/lib/components/AddSelect/add-select-utils.js +35 -2
  127. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +261 -177
  128. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +79 -23
  129. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +67 -21
  130. package/lib/components/DataSpreadsheet/hooks/index.js +45 -0
  131. package/lib/components/DataSpreadsheet/hooks/useMultipleKeyTracking.js +151 -0
  132. package/lib/components/DataSpreadsheet/hooks/useResetSpreadsheetFocus.js +2 -4
  133. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetEdit.js +79 -0
  134. package/lib/components/DataSpreadsheet/hooks/useSpreadsheetOutsideClick.js +1 -3
  135. package/lib/components/DataSpreadsheet/utils/createCellSelectionArea.js +21 -8
  136. package/lib/components/DataSpreadsheet/utils/generateData.js +17 -9
  137. package/lib/components/DataSpreadsheet/utils/getSelectionAreaPoints.js +27 -0
  138. package/lib/components/DataSpreadsheet/utils/getSpreadsheetWidth.js +40 -0
  139. package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionEnter.js +127 -0
  140. package/lib/components/DataSpreadsheet/utils/handleActiveCellInSelectionTab.js +118 -0
  141. package/lib/components/DataSpreadsheet/utils/handleEditSubmit.js +94 -0
  142. package/lib/components/DataSpreadsheet/utils/handleHeaderCellSelection.js +44 -8
  143. package/lib/components/DataSpreadsheet/utils/handleMultipleKeys.js +235 -20
  144. package/lib/components/DataSpreadsheet/utils/selectAllCells.js +60 -0
  145. package/lib/components/Datagrid/Datagrid/Datagrid.js +86 -0
  146. package/lib/components/Datagrid/Datagrid/DatagridBody.js +50 -0
  147. package/lib/components/Datagrid/Datagrid/DatagridEmptyBody.js +31 -0
  148. package/lib/components/Datagrid/Datagrid/DatagridExpandedRow.js +38 -0
  149. package/lib/components/Datagrid/Datagrid/DatagridHead.js +43 -0
  150. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +73 -0
  151. package/lib/components/Datagrid/Datagrid/DatagridRefBody.js +44 -0
  152. package/lib/components/Datagrid/Datagrid/DatagridRow.js +68 -0
  153. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +55 -0
  154. package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +139 -0
  155. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.js +44 -0
  156. package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +35 -0
  157. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +101 -0
  158. package/lib/components/Datagrid/Datagrid/DraggableElement.js +210 -0
  159. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +92 -0
  160. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +65 -0
  161. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +166 -0
  162. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsModal.js +173 -0
  163. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +73 -0
  164. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/common.js +25 -0
  165. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +23 -0
  166. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeDropdown.js +80 -0
  167. package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +160 -0
  168. package/lib/components/Datagrid/Datagrid/addons/RowSize/index.js +15 -0
  169. package/lib/components/Datagrid/Datagrid/index.js +15 -0
  170. package/lib/components/Datagrid/Datagrid.stories/CustomizeColumnStory.js +13 -0
  171. package/lib/components/Datagrid/Datagrid.stories/LeftPanelStory.js +13 -0
  172. package/lib/components/Datagrid/Datagrid.stories/RowSizeDropdownStory.js +13 -0
  173. package/lib/components/Datagrid/Datagrid.stories/SelectAllWithToggleStory.js +13 -0
  174. package/lib/components/Datagrid/Datagrid.stories/StickyActionsColumnStory.js +112 -0
  175. package/lib/components/Datagrid/Datagrid.stories/common.js +215 -0
  176. package/lib/components/Datagrid/Datagrid.stories/index.js +47 -0
  177. package/lib/components/Datagrid/common-column-ids.js +16 -0
  178. package/lib/components/Datagrid/index.js +127 -0
  179. package/lib/components/Datagrid/useActionsColumn.js +94 -0
  180. package/lib/components/Datagrid/useColumnRightAlign.js +59 -0
  181. package/lib/components/Datagrid/useCustomizeColumns.js +55 -0
  182. package/lib/components/Datagrid/useDatagrid.js +58 -0
  183. package/lib/components/Datagrid/useDefaultStringRenderer.js +54 -0
  184. package/lib/components/Datagrid/useDisableSelectRows.js +92 -0
  185. package/lib/components/Datagrid/useExpandedRow.js +58 -0
  186. package/lib/components/Datagrid/useFlexResize.js +61 -0
  187. package/lib/components/Datagrid/useFloatingScroll.js +101 -0
  188. package/lib/components/Datagrid/useInfiniteScroll.js +67 -0
  189. package/lib/components/Datagrid/useNestedRows.js +65 -0
  190. package/lib/components/Datagrid/useOnRowClick.js +45 -0
  191. package/lib/components/Datagrid/useParentDimensions.js +75 -0
  192. package/lib/components/Datagrid/useResizeTable.js +48 -0
  193. package/lib/components/Datagrid/useRowExpander.js +45 -0
  194. package/lib/components/Datagrid/useRowIsMouseOver.js +66 -0
  195. package/lib/components/Datagrid/useRowRenderer.js +40 -0
  196. package/lib/components/Datagrid/useRowSize.js +67 -0
  197. package/lib/components/Datagrid/useSelectAllToggle.js +88 -0
  198. package/lib/components/Datagrid/useSelectRows.js +119 -0
  199. package/lib/components/Datagrid/useSkeletonRows.js +42 -0
  200. package/lib/components/Datagrid/useSortableColumns.js +117 -0
  201. package/lib/components/Datagrid/useStickyColumn.js +190 -0
  202. package/lib/components/MultiAddSelect/MultiAddSelect.js +150 -2
  203. package/lib/components/PageHeader/PageHeader.js +3 -1
  204. package/lib/components/SingleAddSelect/SingleAddSelect.js +91 -3
  205. package/lib/components/TagSet/TagSet.js +13 -6
  206. package/lib/components/Tearsheet/TearsheetShell.js +36 -10
  207. package/lib/components/index.js +9 -1
  208. package/lib/global/js/package-settings.js +4 -2
  209. package/package.json +16 -12
  210. package/scss/components/AboutModal/_about-modal.scss +4 -0
  211. package/scss/components/AddSelect/_add-select.scss +46 -2
  212. package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +41 -4
  213. package/scss/components/Datagrid/_datagrid.scss +66 -0
  214. package/scss/components/Datagrid/_index.scss +8 -0
  215. package/scss/components/Datagrid/_storybook-styles.scss +26 -0
  216. package/scss/components/Datagrid/styles/_variables.scss +9 -0
  217. package/scss/components/Datagrid/styles/addons/CustomizeColumnsModal.scss +48 -0
  218. package/scss/components/Datagrid/styles/addons/RowSizeDropdown.scss +23 -0
  219. package/scss/components/Datagrid/styles/datagrid.scss +326 -0
  220. package/scss/components/Datagrid/styles/index.scss +17 -0
  221. package/scss/components/Datagrid/styles/useActionsColumn.scss +24 -0
  222. package/scss/components/Datagrid/styles/useColumnRightAlign.scss +29 -0
  223. package/scss/components/Datagrid/styles/useNestedRows.scss +17 -0
  224. package/scss/components/Datagrid/styles/useNestedTable.scss +28 -0
  225. package/scss/components/Datagrid/styles/useSelectAllToggle.scss +28 -0
  226. package/scss/components/Datagrid/styles/useSortableColumns.scss +55 -0
  227. package/scss/components/Datagrid/styles/useStickyColumn.scss +38 -0
  228. package/scss/components/ExportModal/_export-modal.scss +0 -4
  229. package/scss/components/Tearsheet/_tearsheet.scss +4 -0
  230. 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;
@@ -97,9 +97,13 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
97
97
  };
98
98
 
99
99
  useEffect(function () {
100
- var _document;
101
-
102
- setAllTagsModalTarget(allTagsModalTargetIn !== null && allTagsModalTargetIn !== void 0 ? allTagsModalTargetIn : (_document = document) === null || _document === void 0 ? void 0 : _document.body);
100
+ if (allTagsModalTargetIn) {
101
+ setAllTagsModalTarget(allTagsModalTargetIn);
102
+ } else {
103
+ if (pkg.isFeatureEnabled('default-portal-target-body')) {
104
+ setAllTagsModalTarget(document.body);
105
+ }
106
+ }
103
107
  }, [allTagsModalTargetIn]);
104
108
  useEffect(function () {
105
109
  var newSizingTags = []; // create sizing tags
@@ -237,14 +241,16 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
237
241
  }, hiddenSizingTags), /*#__PURE__*/React.createElement("div", {
238
242
  className: "".concat(blockClass, "__tag-container"),
239
243
  ref: displayedArea
240
- }, 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, {
241
247
  allTags: tags,
242
248
  open: showAllModalOpen,
243
249
  title: allTagsModalTitle,
244
250
  onClose: handleModalClose,
245
251
  searchLabel: allTagsModalSearchLabel,
246
252
  searchPlaceholder: allTagsModalSearchPlaceholderText
247
- }), allTagsModalTarget) : null);
253
+ }), allTagsModalTarget));
248
254
  }); // Return a placeholder if not released and not enabled by feature flag
249
255
 
250
256
  TagSet = pkg.checkComponentEnabled(TagSet, componentName);
@@ -269,7 +275,8 @@ var TYPES = {
269
275
  gray: 'Gray',
270
276
  'cool-gray': 'Cool-Gray',
271
277
  'warm-gray': 'Warm-Gray',
272
- 'high-contrast': 'High-Contrast'
278
+ 'high-contrast': 'High-Contrast',
279
+ outline: 'Outline'
273
280
  };
274
281
  var tagTypes = Object.keys(TYPES);
275
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
  */
@@ -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