@carbon/ibm-products 2.0.0-rc.8 → 2.0.0-rc.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. package/css/index-full-carbon.css +67 -21
  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.css +67 -21
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +4 -2
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +67 -21
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +4 -2
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/ActionBar/ActionBarOverflowItems.js +1 -0
  14. package/es/components/AddSelect/AddSelect.js +6 -3
  15. package/es/components/AddSelect/AddSelectBody.js +50 -26
  16. package/es/components/AddSelect/AddSelectBreadcrumbs.js +1 -1
  17. package/es/components/AddSelect/AddSelectColumn.js +3 -3
  18. package/es/components/AddSelect/AddSelectFilter.js +5 -3
  19. package/es/components/AddSelect/AddSelectList.js +6 -5
  20. package/es/components/AddSelect/AddSelectMetaPanel.js +6 -0
  21. package/es/components/AddSelect/AddSelectSidebar.js +5 -2
  22. package/es/components/AddSelect/AddSelectSort.js +1 -1
  23. package/es/components/AddSelect/add-select-utils.js +7 -0
  24. package/es/components/AddSelect/hooks/useItemSort.js +6 -0
  25. package/es/components/AddSelect/hooks/useParentSelect.js +6 -0
  26. package/es/components/AddSelect/hooks/usePath.js +15 -1
  27. package/es/components/AddSelect/index.js +1 -1
  28. package/es/components/CreateFullPage/CreateFullPage.js +4 -1
  29. package/es/components/Datagrid/Datagrid/DatagridRow.js +41 -2
  30. package/es/components/Datagrid/useNestedRows.js +14 -2
  31. package/es/components/Datagrid/utils/DatagridActions.js +130 -46
  32. package/es/components/MultiAddSelect/MultiAddSelect.js +14 -7
  33. package/es/components/MultiAddSelect/index.js +6 -0
  34. package/es/components/SingleAddSelect/SingleAddSelect.js +6 -0
  35. package/es/components/SingleAddSelect/index.js +6 -0
  36. package/lib/components/ActionBar/ActionBarOverflowItems.js +1 -0
  37. package/lib/components/AddSelect/AddSelect.js +5 -2
  38. package/lib/components/AddSelect/AddSelectBody.js +45 -25
  39. package/lib/components/AddSelect/AddSelectBreadcrumbs.js +1 -1
  40. package/lib/components/AddSelect/AddSelectColumn.js +2 -2
  41. package/lib/components/AddSelect/AddSelectFilter.js +4 -2
  42. package/lib/components/AddSelect/AddSelectList.js +5 -4
  43. package/lib/components/AddSelect/AddSelectMetaPanel.js +6 -0
  44. package/lib/components/AddSelect/AddSelectSidebar.js +4 -1
  45. package/lib/components/AddSelect/AddSelectSort.js +1 -1
  46. package/lib/components/AddSelect/add-select-utils.js +7 -0
  47. package/lib/components/AddSelect/hooks/useItemSort.js +6 -0
  48. package/lib/components/AddSelect/hooks/useParentSelect.js +6 -0
  49. package/lib/components/AddSelect/hooks/usePath.js +9 -1
  50. package/lib/components/CreateFullPage/CreateFullPage.js +4 -1
  51. package/lib/components/Datagrid/Datagrid/DatagridRow.js +42 -2
  52. package/lib/components/Datagrid/useNestedRows.js +15 -2
  53. package/lib/components/Datagrid/utils/DatagridActions.js +134 -44
  54. package/lib/components/MultiAddSelect/MultiAddSelect.js +14 -7
  55. package/lib/components/SingleAddSelect/SingleAddSelect.js +6 -0
  56. package/package.json +2 -2
  57. package/scss/components/AddSelect/_add-select.scss +24 -25
  58. package/scss/components/AddSelect/_index.scss +1 -1
  59. package/scss/components/AddSelect/_storybook-styles.scss +1 -1
  60. package/scss/components/Datagrid/_storybook-styles.scss +5 -0
  61. package/scss/components/Datagrid/styles/_datagrid.scss +49 -4
  62. package/scss/components/MultiAddSelect/_multi-add-select.scss +7 -0
  63. package/scss/components/MultiAddSelect/_storybook-styles.scss +1 -1
  64. package/scss/components/SingleAddSelect/_carbon-imports.scss +1 -1
  65. package/scss/components/SingleAddSelect/_index-with-carbon.scss +1 -1
  66. package/scss/components/SingleAddSelect/_index.scss +7 -0
  67. package/scss/components/SingleAddSelect/_single-add-select.scss +7 -0
  68. package/scss/components/SingleAddSelect/_storybook-styles.scss +1 -1
@@ -2,14 +2,19 @@ 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 = ["className", "clearFiltersText", "closeIconDescription", "columnInputPlaceholder", "defaultModifiers", "description", "filterByLabel", "globalFilterOpts", "globalFiltersIconDescription", "globalFiltersPlaceholderText", "globalFiltersPrimaryButtonText", "globalFiltersSecondaryButtonText", "globalSearchLabel", "globalSearchPlaceholder", "globalSortBy", "influencerTitle", "items", "itemsLabel", "metaIconDescription", "metaPanelTitle", "multi", "navIconDescription", "noResultsDescription", "noResultsTitle", "noSelectionDescription", "noSelectionTitle", "normalizedItems", "onClose", "onCloseButtonText", "onSubmit", "onSubmitButtonText", "open", "portalTarget", "searchResultsLabel", "sortByLabel", "title", "useNormalizedItems"];
5
+ var _excluded = ["className", "clearFiltersText", "closeIconDescription", "columnInputPlaceholder", "defaultModifiers", "description", "filterByLabel", "globalFilterOpts", "globalFiltersLabel", "globalFiltersIconDescription", "globalFiltersPlaceholderText", "globalFiltersPrimaryButtonText", "globalFiltersSecondaryButtonText", "globalSearchLabel", "globalSearchPlaceholder", "globalSortBy", "illustrationTheme", "influencerTitle", "items", "itemsLabel", "metaIconDescription", "metaPanelTitle", "multi", "navIconDescription", "noResultsDescription", "noResultsTitle", "noSelectionDescription", "noSelectionTitle", "normalizedItems", "onClose", "onCloseButtonText", "onSubmit", "onSubmitButtonText", "open", "portalTarget", "searchResultsTitle", "title", "useNormalizedItems"];
6
+
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
+
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
10
+
6
11
  //
7
- // Copyright IBM Corp. 2022
12
+ // Copyright IBM Corp. 2022, 2022
8
13
  //
9
14
  // This source code is licensed under the Apache-2.0 license found in the
10
15
  // LICENSE file in the root directory of this source tree.
11
16
  //
12
- import React, { useState } from 'react';
17
+ import React, { forwardRef, useState } from 'react';
13
18
  import PropTypes from 'prop-types';
14
19
  import cx from 'classnames';
15
20
  import { Tag } from '@carbon/react';
@@ -28,7 +33,7 @@ import usePath from './hooks/usePath';
28
33
  import { pkg } from '../../settings';
29
34
  var blockClass = "".concat(pkg.prefix, "--add-select");
30
35
  var componentName = 'AddSelectBody';
31
- export var AddSelectBody = function AddSelectBody(_ref) {
36
+ export var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
32
37
  var _cx, _path$;
33
38
 
34
39
  var className = _ref.className,
@@ -39,6 +44,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
39
44
  description = _ref.description,
40
45
  filterByLabel = _ref.filterByLabel,
41
46
  globalFilterOpts = _ref.globalFilterOpts,
47
+ globalFiltersLabel = _ref.globalFiltersLabel,
42
48
  globalFiltersIconDescription = _ref.globalFiltersIconDescription,
43
49
  globalFiltersPlaceholderText = _ref.globalFiltersPlaceholderText,
44
50
  globalFiltersPrimaryButtonText = _ref.globalFiltersPrimaryButtonText,
@@ -46,6 +52,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
46
52
  globalSearchLabel = _ref.globalSearchLabel,
47
53
  globalSearchPlaceholder = _ref.globalSearchPlaceholder,
48
54
  globalSortBy = _ref.globalSortBy,
55
+ illustrationTheme = _ref.illustrationTheme,
49
56
  influencerTitle = _ref.influencerTitle,
50
57
  items = _ref.items,
51
58
  itemsLabel = _ref.itemsLabel,
@@ -64,8 +71,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
64
71
  onSubmitButtonText = _ref.onSubmitButtonText,
65
72
  open = _ref.open,
66
73
  portalTarget = _ref.portalTarget,
67
- searchResultsLabel = _ref.searchResultsLabel,
68
- sortByLabel = _ref.sortByLabel,
74
+ searchResultsTitle = _ref.searchResultsTitle,
69
75
  title = _ref.title,
70
76
  useNormalizedItems = _ref.useNormalizedItems,
71
77
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -114,7 +120,8 @@ export var AddSelectBody = function AddSelectBody(_ref) {
114
120
  var _usePath = usePath(itemsLabel),
115
121
  path = _usePath.path,
116
122
  setPath = _usePath.setPath,
117
- pathOnclick = _usePath.pathOnclick;
123
+ pathOnclick = _usePath.pathOnclick,
124
+ resetPath = _usePath.resetPath;
118
125
 
119
126
  var resetState = function resetState() {
120
127
  setSingleSelection('');
@@ -122,6 +129,11 @@ export var AddSelectBody = function AddSelectBody(_ref) {
122
129
  setSearchTerm('');
123
130
  setAppliedGlobalFilters({});
124
131
  setDisplayMetaPanel({});
132
+ setAppliedModifiers(defaultModifiers);
133
+ setSortAttribute('');
134
+ setSortDirection('');
135
+ setParentSelected(null);
136
+ resetPath();
125
137
  };
126
138
 
127
139
  var onCloseHandler = function onCloseHandler() {
@@ -129,7 +141,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
129
141
  onClose();
130
142
  };
131
143
 
132
- var classNames = cx(className, blockClass, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__single"), !multi), _defineProperty(_cx, "".concat(blockClass, "__multi"), multi), _cx));
144
+ var tearsheetClassnames = cx(className, blockClass, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__single"), !multi), _defineProperty(_cx, "".concat(blockClass, "__multi"), multi), _cx));
133
145
  var globalFilterKeys = Object.keys(appliedGlobalFilters);
134
146
  var globalFiltersApplied = globalFilterKeys.length > 0; // handlers
135
147
 
@@ -203,12 +215,12 @@ export var AddSelectBody = function AddSelectBody(_ref) {
203
215
  setDisplayMetaPanel: setDisplayMetaPanel,
204
216
  parentId: path[0].id
205
217
  };
206
- var commonTearsheetProps = {
207
- className: classNames,
218
+
219
+ var commonTearsheetProps = _objectSpread(_objectSpread({}, rest), {}, {
220
+ className: tearsheetClassnames,
208
221
  open: open,
209
222
  title: title,
210
223
  description: description,
211
- closeIconDescription: 'temp description',
212
224
  actions: [{
213
225
  label: onCloseButtonText,
214
226
  kind: 'secondary',
@@ -219,12 +231,15 @@ export var AddSelectBody = function AddSelectBody(_ref) {
219
231
  onClick: submitHandler,
220
232
  disabled: multi ? multiSelection.length === 0 : !singleSelection
221
233
  }],
222
- portalTarget: portalTarget
223
- };
234
+ portalTarget: portalTarget,
235
+ ref: ref
236
+ });
237
+
224
238
  var sidebarProps = {
225
239
  appliedModifiers: appliedModifiers,
226
240
  closeIconDescription: closeIconDescription,
227
241
  displayMetalPanel: displayMetalPanel,
242
+ illustrationTheme: illustrationTheme,
228
243
  influencerTitle: influencerTitle,
229
244
  items: useNormalizedItems ? normalizedItems : items.entries,
230
245
  metaPanelTitle: metaPanelTitle,
@@ -245,6 +260,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
245
260
  handleSearch: handleSearch,
246
261
  multi: multi,
247
262
  filterOpts: globalFilterOpts,
263
+ filtersLabel: globalFiltersLabel,
248
264
  handleFilter: handleFilter,
249
265
  primaryButtonText: globalFiltersPrimaryButtonText,
250
266
  secondaryButtonText: globalFiltersSecondaryButtonText,
@@ -256,14 +272,14 @@ export var AddSelectBody = function AddSelectBody(_ref) {
256
272
  }), /*#__PURE__*/React.createElement("div", {
257
273
  className: cx("".concat(blockClass, "__sub-header"), _defineProperty({}, "".concat(blockClass, "__sub-header-multi"), multi))
258
274
  }, /*#__PURE__*/React.createElement("div", {
259
- className: "".concat(blockClass, "__tag-container")
275
+ className: "".concat(blockClass, "__tags")
260
276
  }, showBreadsCrumbs ? /*#__PURE__*/React.createElement(AddSelectBreadcrumbs, {
261
277
  path: path,
262
278
  onClick: pathOnclick,
263
279
  multi: multi
264
280
  }) : /*#__PURE__*/React.createElement("p", {
265
- className: "".concat(blockClass, "__tag-container-label")
266
- }, searchTerm ? searchResultsLabel : itemsLabel), showTags && /*#__PURE__*/React.createElement(Tag, {
281
+ className: "".concat(blockClass, "__tags-label")
282
+ }, searchTerm ? searchResultsTitle : itemsLabel), showTags && /*#__PURE__*/React.createElement(Tag, {
267
283
  type: "gray",
268
284
  size: "sm"
269
285
  }, itemsToDisplay.length)), showSort && /*#__PURE__*/React.createElement(AddSelectSort, {
@@ -272,8 +288,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
272
288
  setSortDirection: setSortDirection,
273
289
  sortAttribute: sortAttribute,
274
290
  sortDirection: sortDirection,
275
- sortBy: globalSortBy,
276
- sortByLabel: sortByLabel
291
+ sortBy: globalSortBy
277
292
  }))), displayColumnView ? /*#__PURE__*/React.createElement("div", {
278
293
  className: "".concat(blockClass, "__columns")
279
294
  }, /*#__PURE__*/React.createElement(AddSelectColumn, _extends({}, commonListProps, {
@@ -293,13 +308,19 @@ export var AddSelectBody = function AddSelectBody(_ref) {
293
308
  className: "".concat(blockClass, "__body")
294
309
  }, /*#__PURE__*/React.createElement(NoDataEmptyState, {
295
310
  subtitle: noResultsDescription,
296
- title: noResultsTitle
311
+ title: noResultsTitle,
312
+ illustrationTheme: illustrationTheme
297
313
  }))));
298
- return /*#__PURE__*/React.createElement("div", rest, multi ? /*#__PURE__*/React.createElement(Tearsheet, _extends({}, commonTearsheetProps, {
299
- influencer: multi && /*#__PURE__*/React.createElement(AddSelectSidebar, sidebarProps),
300
- influencerPosition: "right"
301
- }), body) : /*#__PURE__*/React.createElement(TearsheetNarrow, commonTearsheetProps, body));
302
- };
314
+
315
+ if (multi) {
316
+ return /*#__PURE__*/React.createElement(Tearsheet, _extends({}, commonTearsheetProps, {
317
+ influencer: multi && /*#__PURE__*/React.createElement(AddSelectSidebar, sidebarProps),
318
+ influencerPosition: "right"
319
+ }), body);
320
+ }
321
+
322
+ return /*#__PURE__*/React.createElement(TearsheetNarrow, commonTearsheetProps, body);
323
+ });
303
324
  AddSelectBody.propTypes = {
304
325
  className: PropTypes.string,
305
326
  clearFiltersText: PropTypes.string,
@@ -310,12 +331,14 @@ AddSelectBody.propTypes = {
310
331
  filterByLabel: PropTypes.string,
311
332
  globalFilterOpts: PropTypes.array,
312
333
  globalFiltersIconDescription: PropTypes.string,
334
+ globalFiltersLabel: PropTypes.string,
313
335
  globalFiltersPlaceholderText: PropTypes.string,
314
336
  globalFiltersPrimaryButtonText: PropTypes.string,
315
337
  globalFiltersSecondaryButtonText: PropTypes.string,
316
338
  globalSearchLabel: PropTypes.string.isRequired,
317
339
  globalSearchPlaceholder: PropTypes.string,
318
340
  globalSortBy: PropTypes.array,
341
+ illustrationTheme: PropTypes.oneOf(['light', 'dark']),
319
342
  influencerTitle: PropTypes.string,
320
343
  items: PropTypes.shape({
321
344
  modifiers: PropTypes.shape({
@@ -329,7 +352,8 @@ AddSelectBody.propTypes = {
329
352
  avatar: PropTypes.shape({
330
353
  alt: PropTypes.string,
331
354
  icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
332
- src: PropTypes.string
355
+ src: PropTypes.string,
356
+ theme: PropTypes.oneOf(['light', 'dark'])
333
357
  }),
334
358
  children: PropTypes.object,
335
359
  icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
@@ -360,7 +384,7 @@ AddSelectBody.propTypes = {
360
384
  onSubmitButtonText: PropTypes.string,
361
385
  open: PropTypes.bool,
362
386
  portalTarget: PropTypes.node,
363
- searchResultsLabel: PropTypes.string,
387
+ searchResultsTitle: PropTypes.string,
364
388
  sortByLabel: PropTypes.string,
365
389
  title: PropTypes.string,
366
390
  useNormalizedItems: PropTypes.bool
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  //
3
- // Copyright IBM Corp. 2022
3
+ // Copyright IBM Corp. 2022, 2022
4
4
  //
5
5
  // This source code is licensed under the Apache-2.0 license found in the
6
6
  // LICENSE file in the root directory of this source tree.
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
5
  var _excluded = ["columnInputPlaceholder", "filterByLabel", "header", "items", "multiSelection", "parentId", "path", "setMultiSelection", "setPath"];
6
6
  //
7
- // Copyright IBM Corp. 2022
7
+ // Copyright IBM Corp. 2022, 2022
8
8
  //
9
9
  // This source code is licensed under the Apache-2.0 license found in the
10
10
  // LICENSE file in the root directory of this source tree.
@@ -211,14 +211,14 @@ export var AddSelectColumn = function AddSelectColumn(_ref) {
211
211
  }) ? true : false
212
212
  })));
213
213
  })))), /*#__PURE__*/React.createElement("div", {
214
- className: "".concat(blockClass, "__tag-container")
214
+ className: "".concat(blockClass, "__tags")
215
215
  }, /*#__PURE__*/React.createElement(Checkbox, {
216
216
  id: "".concat(uuidv4(), "-select-all"),
217
217
  className: "".concat(colClass, "__select-all"),
218
218
  checked: allSelected,
219
219
  onChange: selectAllHandler,
220
220
  labelText: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
221
- className: "".concat(blockClass, "__tag-container-label")
221
+ className: "".concat(blockClass, "__tag-label")
222
222
  }, header), /*#__PURE__*/React.createElement(Tag, {
223
223
  type: "gray",
224
224
  size: "sm"
@@ -7,7 +7,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
9
  //
10
- // Copyright IBM Corp. 2022
10
+ // Copyright IBM Corp. 2022, 2022
11
11
  //
12
12
  // This source code is licensed under the Apache-2.0 license found in the
13
13
  // LICENSE file in the root directory of this source tree.
@@ -24,6 +24,7 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
24
24
  var appliedFilters = _ref.appliedFilters,
25
25
  clearFiltersText = _ref.clearFiltersText,
26
26
  filterOpts = _ref.filterOpts,
27
+ filtersLabel = _ref.filtersLabel,
27
28
  handleFilter = _ref.handleFilter,
28
29
  handleSearch = _ref.handleSearch,
29
30
  hasFiltersApplied = _ref.hasFiltersApplied,
@@ -95,7 +96,7 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
95
96
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
96
97
  className: "".concat(blockClass, "-search")
97
98
  }, /*#__PURE__*/React.createElement(Search, {
98
- id: "temp-id",
99
+ id: "add-select-global-search-filter",
99
100
  labelText: inputLabel,
100
101
  placeholder: inputPlaceholder,
101
102
  value: searchTerm,
@@ -119,7 +120,7 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
119
120
  className: blockClass
120
121
  }, /*#__PURE__*/React.createElement("div", {
121
122
  className: "".concat(blockClass, "-content")
122
- }, /*#__PURE__*/React.createElement("p", null, "Filters"), /*#__PURE__*/React.createElement("div", {
123
+ }, /*#__PURE__*/React.createElement("p", null, filtersLabel), /*#__PURE__*/React.createElement("div", {
123
124
  className: "".concat(blockClass, "-opts")
124
125
  }, filterOpts.map(function (filterOpts) {
125
126
  return /*#__PURE__*/React.createElement(Dropdown, {
@@ -168,6 +169,7 @@ AddSelectFilter.propTypes = {
168
169
  appliedFilters: PropTypes.object,
169
170
  clearFiltersText: PropTypes.string,
170
171
  filterOpts: PropTypes.array,
172
+ filtersLabel: PropTypes.string,
171
173
  handleFilter: PropTypes.func,
172
174
  handleSearch: PropTypes.func,
173
175
  hasFiltersApplied: PropTypes.bool,
@@ -2,13 +2,13 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
4
  //
5
- // Copyright IBM Corp. 2022
5
+ // Copyright IBM Corp. 2022, 2022
6
6
  //
7
7
  // This source code is licensed under the Apache-2.0 license found in the
8
8
  // LICENSE file in the root directory of this source tree.
9
9
  //
10
10
  import React from 'react';
11
- import { Button, Checkbox, RadioButton, StructuredListRow, StructuredListWrapper, StructuredListBody, Dropdown } from '@carbon/react';
11
+ import { Button, Checkbox, Dropdown, RadioButton, StructuredListRow, StructuredListWrapper, StructuredListBody } from '@carbon/react';
12
12
  import { ChevronRight, View } from '@carbon/react/icons';
13
13
  import PropTypes from 'prop-types';
14
14
  import cx from 'classnames';
@@ -74,11 +74,12 @@ export var AddSelectList = function AddSelectList(_ref) {
74
74
  var src = _ref4.src,
75
75
  alt = _ref4.alt,
76
76
  icon = _ref4.icon,
77
- backgroundColor = _ref4.backgroundColor;
77
+ backgroundColor = _ref4.backgroundColor,
78
+ theme = _ref4.theme;
78
79
  return {
79
80
  className: "".concat(blockClass, "-cell-avatar"),
80
81
  size: 'lg',
81
- theme: 'light',
82
+ theme: theme,
82
83
  image: src,
83
84
  imageDescription: alt,
84
85
  icon: icon,
@@ -123,7 +124,7 @@ export var AddSelectList = function AddSelectList(_ref) {
123
124
 
124
125
  return /*#__PURE__*/React.createElement(StructuredListRow, {
125
126
  key: item.id,
126
- className: cx("".concat(blockClass, "-row"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "-row-selected"), isSelected(item.id)), _defineProperty(_cx2, "".concat(blockClass, "-row-meta-selected"), isInMetaPanel(item.id)), _cx2)),
127
+ className: cx("".concat(blockClass, "-row"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "-row--selected"), isSelected(item.id)), _defineProperty(_cx2, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), _cx2)),
127
128
  onClick: function onClick(evt) {
128
129
  return metaPanelHandler(item, evt);
129
130
  }
@@ -1,4 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ //
3
+ // Copyright IBM Corp. 2022, 2022
4
+ //
5
+ // This source code is licensed under the Apache-2.0 license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
2
8
  import React, { isValidElement } from 'react';
3
9
  import PropTypes from 'prop-types';
4
10
  import { Close } from '@carbon/react/icons';
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
2
  var _excluded = ["meta", "icon", "avatar"];
3
3
  //
4
- // Copyright IBM Corp. 2022
4
+ // Copyright IBM Corp. 2022, 2022
5
5
  //
6
6
  // This source code is licensed under the Apache-2.0 license found in the
7
7
  // LICENSE file in the root directory of this source tree.
@@ -20,6 +20,7 @@ export var AddSelectSidebar = function AddSelectSidebar(_ref) {
20
20
  var appliedModifiers = _ref.appliedModifiers,
21
21
  closeIconDescription = _ref.closeIconDescription,
22
22
  displayMetalPanel = _ref.displayMetalPanel,
23
+ illustrationTheme = _ref.illustrationTheme,
23
24
  influencerTitle = _ref.influencerTitle,
24
25
  items = _ref.items,
25
26
  metaPanelTitle = _ref.metaPanelTitle,
@@ -106,13 +107,15 @@ export var AddSelectSidebar = function AddSelectSidebar(_ref) {
106
107
  }, /*#__PURE__*/React.createElement(NoDataEmptyState, {
107
108
  subtitle: noSelectionDescription,
108
109
  title: noSelectionTitle,
109
- size: "sm"
110
+ size: "sm",
111
+ illustrationTheme: illustrationTheme
110
112
  })));
111
113
  };
112
114
  AddSelectSidebar.propTypes = {
113
115
  appliedModifiers: PropTypes.array,
114
116
  closeIconDescription: PropTypes.string,
115
117
  displayMetalPanel: PropTypes.object,
118
+ illustrationTheme: PropTypes.oneOf(['light', 'dark']),
116
119
  influencerTitle: PropTypes.string,
117
120
  items: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
118
121
  metaPanelTitle: PropTypes.string,
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  //
4
- // Copyright IBM Corp. 2022
4
+ // Copyright IBM Corp. 2022, 2022
5
5
  //
6
6
  // This source code is licensed under the Apache-2.0 license found in the
7
7
  // LICENSE file in the root directory of this source tree.
@@ -6,6 +6,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
 
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
+ //
10
+ // Copyright IBM Corp. 2022, 2022
11
+ //
12
+ // This source code is licensed under the Apache-2.0 license found in the
13
+ // LICENSE file in the root directory of this source tree.
14
+ //
15
+
9
16
  /**
10
17
  * to be able to more easily and efficiently the child entries the data needs to be
11
18
  * normalized. this function recursively goes through the data array to build a single
@@ -1,4 +1,10 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ //
3
+ // Copyright IBM Corp. 2022, 2022
4
+ //
5
+ // This source code is licensed under the Apache-2.0 license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
2
8
  import { useState } from 'react';
3
9
  export var useItemSort = function useItemSort() {
4
10
  var _useState = useState(''),
@@ -1,4 +1,10 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ //
3
+ // Copyright IBM Corp. 2022, 2022
4
+ //
5
+ // This source code is licensed under the Apache-2.0 license found in the
6
+ // LICENSE file in the root directory of this source tree.
7
+ //
2
8
  import { useState } from 'react';
3
9
 
4
10
  var useParentSelect = function useParentSelect() {
@@ -6,6 +6,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
6
6
 
7
7
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
8
 
9
+ //
10
+ // Copyright IBM Corp. 2022, 2022
11
+ //
12
+ // This source code is licensed under the Apache-2.0 license found in the
13
+ // LICENSE file in the root directory of this source tree.
14
+ //
9
15
  import { useState } from 'react';
10
16
 
11
17
  var usePath = function usePath() {
@@ -56,10 +62,18 @@ var usePath = function usePath() {
56
62
  setPath(_toConsumableArray(pathCopy));
57
63
  };
58
64
 
65
+ var resetPath = function resetPath() {
66
+ setPath([{
67
+ id: 'base_of_path',
68
+ title: itemsLabel
69
+ }]);
70
+ };
71
+
59
72
  return {
60
73
  path: path,
61
74
  setPath: handler,
62
- pathOnclick: pathClickHandler
75
+ pathOnclick: pathClickHandler,
76
+ resetPath: resetPath
63
77
  };
64
78
  };
65
79
 
@@ -1,5 +1,5 @@
1
1
  //
2
- // Copyright IBM Corp. 2021
2
+ // Copyright IBM Corp. 2022, 2022
3
3
  //
4
4
  // This source code is licensed under the Apache-2.0 license found in the
5
5
  // LICENSE file in the root directory of this source tree.
@@ -198,7 +198,10 @@ export var CreateFullPage = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
198
198
  className: "".concat(blockClass, "__modal"),
199
199
  size: "sm",
200
200
  open: modalIsOpen,
201
- "aria-label": modalTitle
201
+ "aria-label": modalTitle,
202
+ onClose: function onClose() {
203
+ setModalIsOpen(false);
204
+ }
202
205
  }, /*#__PURE__*/React.createElement(ModalHeader, {
203
206
  title: modalTitle
204
207
  }), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, modalDescription)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
@@ -13,6 +13,7 @@ var _excluded = ["children"];
13
13
  // @flow
14
14
  import React, { useContext } from 'react';
15
15
  import { DataTable, SkeletonText } from '@carbon/react';
16
+ import { px } from '@carbon/layout';
16
17
  import { selectionColumnId } from '../common-column-ids';
17
18
  import cx from 'classnames';
18
19
  import { pkg, carbon } from '../../../settings';
@@ -20,25 +21,63 @@ import { InlineEditContext } from './addons/InlineEdit/InlineEditContext/InlineE
20
21
  import { getCellIdAsObject } from './addons/InlineEdit/InlineEditContext/getCellIdAsObject';
21
22
  var blockClass = "".concat(pkg.prefix, "--datagrid");
22
23
  var TableRow = DataTable.TableRow,
23
- TableCell = DataTable.TableCell; // eslint-disable-next-line react/prop-types
24
+ TableCell = DataTable.TableCell;
25
+ var rowHeights = {
26
+ xs: 24,
27
+ sm: 32,
28
+ md: 40,
29
+ lg: 48,
30
+ xl: 64
31
+ }; // eslint-disable-next-line react/prop-types
24
32
 
25
33
  var DatagridRow = function DatagridRow(datagridState) {
26
34
  var _cx;
27
35
 
28
- var row = datagridState.row;
36
+ var row = datagridState.row,
37
+ rowSize = datagridState.rowSize,
38
+ withNestedRows = datagridState.withNestedRows;
29
39
 
30
40
  var _useContext = useContext(InlineEditContext),
31
41
  state = _useContext.state;
32
42
 
33
43
  var activeCellId = state.activeCellId;
34
44
  var activeCellObject = activeCellId && getCellIdAsObject(activeCellId);
45
+
46
+ var getVisibleNestedRowCount = function getVisibleNestedRowCount(_ref) {
47
+ var isExpanded = _ref.isExpanded,
48
+ subRows = _ref.subRows;
49
+ var size = 0;
50
+
51
+ if (isExpanded && subRows) {
52
+ size += subRows.length;
53
+ subRows.forEach(function (child) {
54
+ size += getVisibleNestedRowCount(child);
55
+ });
56
+ }
57
+
58
+ return size;
59
+ };
60
+
35
61
  return /*#__PURE__*/React.createElement(TableRow, _extends({
36
62
  className: cx("".concat(blockClass, "__carbon-row"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expandable"), row.canExpand), _defineProperty(_cx, "".concat(carbon.prefix, "--data-table--selected"), row.isSelected), _defineProperty(_cx, "".concat(blockClass, "__carbon-row-hover-active"), activeCellObject && row.index === activeCellObject.row), _cx))
37
63
  }, row.getRowProps(), {
38
64
  key: row.id,
39
65
  onMouseEnter: function onMouseEnter(event) {
66
+ var _hoverRow$style, _hoverRow$style2, _hoverRow$style3;
67
+
68
+ if (!withNestedRows) {
69
+ return;
70
+ }
71
+
72
+ var subRowCount = getVisibleNestedRowCount(row);
73
+ var totalNestedRowIndicatorHeight = px(subRowCount * rowHeights[rowSize]);
40
74
  var hoverRow = event.target.closest(".".concat(blockClass, "__carbon-row-expanded"));
41
75
  hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.classList.add("".concat(blockClass, "__carbon-row-expanded-hover-active"));
76
+ var rowExpanderButton = hoverRow === null || hoverRow === void 0 ? void 0 : hoverRow.querySelector(".".concat(blockClass, "__row-expander"));
77
+ var rowSizeValue = rowSize || 'lg';
78
+ hoverRow === null || hoverRow === void 0 ? void 0 : (_hoverRow$style = hoverRow.style) === null || _hoverRow$style === void 0 ? void 0 : _hoverRow$style.setProperty("--".concat(blockClass, "--indicator-height"), totalNestedRowIndicatorHeight);
79
+ hoverRow === null || hoverRow === void 0 ? void 0 : (_hoverRow$style2 = hoverRow.style) === null || _hoverRow$style2 === void 0 ? void 0 : _hoverRow$style2.setProperty("--".concat(blockClass, "--row-height"), px(rowHeights[rowSizeValue]));
80
+ hoverRow === null || hoverRow === void 0 ? void 0 : (_hoverRow$style3 = hoverRow.style) === null || _hoverRow$style3 === void 0 ? void 0 : _hoverRow$style3.setProperty("--".concat(blockClass, "--indicator-offset-amount"), px((rowExpanderButton === null || rowExpanderButton === void 0 ? void 0 : rowExpanderButton.offsetLeft) || 0));
42
81
  },
43
82
  onMouseLeave: function onMouseLeave(event) {
44
83
  var hoverRow = event.target.closest(".".concat(blockClass, "__carbon-row-expanded"));
@@ -1,3 +1,5 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
1
3
  /*
2
4
  * Licensed Materials - Property of IBM
3
5
  * 5724-Q36
@@ -6,6 +8,7 @@
6
8
  * restricted by GSA ADP Schedule Contract with IBM Corp.
7
9
  */
8
10
  import { pkg } from '../../settings';
11
+ import cx from 'classnames';
9
12
  import useNestedRowExpander from './useNestedRowExpander';
10
13
  var blockClass = "".concat(pkg.prefix, "--datagrid");
11
14
 
@@ -14,9 +17,11 @@ var useNestedRows = function useNestedRows(hooks) {
14
17
  var marginLeft = 24;
15
18
 
16
19
  var getRowProps = function getRowProps(props, _ref) {
20
+ var _cx;
21
+
17
22
  var row = _ref.row;
18
23
  return [props, {
19
- className: row.depth > 0 ? "".concat(blockClass, "__carbon-nested-row") : ''
24
+ className: cx((_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__carbon-nested-row"), row.depth > 0), _defineProperty(_cx, "".concat(blockClass, "__carbon-row-expanded"), row.isExpanded), _cx))
20
25
  }];
21
26
  };
22
27
 
@@ -25,7 +30,7 @@ var useNestedRows = function useNestedRows(hooks) {
25
30
  return [props, {
26
31
  style: {
27
32
  marginLeft: "".concat(row.depth > 0 ? marginLeft : 0, "px"),
28
- paddingLeft: "".concat(row.depth > 1 ? marginLeft * (row.depth - 1) + marginLeft : row.depth === 1 ? marginLeft : 0, "px"),
33
+ paddingLeft: "".concat(row.depth === 2 ? marginLeft * (row.depth - 1) + marginLeft - 8 : row.depth > 2 ? marginLeft * (row.depth - 1) + marginLeft : row.depth === 1 ? marginLeft - 16 : 0, "px"),
29
34
  maxWidth: "calc(100% - ".concat(marginLeft * row.depth, "px)")
30
35
  }
31
36
  }];
@@ -45,9 +50,16 @@ var useNestedRows = function useNestedRows(hooks) {
45
50
  }];
46
51
  };
47
52
 
53
+ var useInstance = function useInstance(instance) {
54
+ Object.assign(instance, {
55
+ withNestedRows: true
56
+ });
57
+ };
58
+
48
59
  hooks.getRowProps.push(getRowProps);
49
60
  hooks.getRowProps.push(getRowStyles);
50
61
  hooks.getCellProps.push(getCellProps);
62
+ hooks.useInstance.push(useInstance);
51
63
  };
52
64
 
53
65
  export default useNestedRows;