@carbon/ibm-products 1.41.0 → 1.41.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/css/index-full-carbon.css +21 -65
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +2 -2
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +1 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +21 -65
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +2 -2
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +21 -65
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +2 -2
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/APIKeyModal/APIKeyDownloader.js +21 -23
  18. package/es/components/APIKeyModal/APIKeyModal.js +43 -45
  19. package/es/components/AddSelect/AddSelectBody.js +1 -1
  20. package/es/components/AddSelect/hooks/usePath.js +7 -1
  21. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +1 -1
  22. package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +1 -1
  23. package/es/components/CreateFullPage/CreateFullPage.js +8 -2
  24. package/es/components/CreateTearsheet/CreateTearsheet.js +8 -2
  25. package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +4 -2
  26. package/es/components/Datagrid/Datagrid/DatagridContent.js +10 -3
  27. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +7 -9
  28. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +11 -13
  29. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +26 -24
  30. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/{CustomizeColumnsModal.js → CustomizeColumnsTearsheet.js} +32 -32
  31. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/TearsheetWrapper.js +51 -0
  32. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +6 -7
  33. package/es/components/Datagrid/useCustomizeColumns.js +13 -15
  34. package/es/components/ImportModal/ImportModal.js +42 -44
  35. package/es/components/index.js +1 -1
  36. package/es/global/js/hooks/useCreateComponentFocus.js +31 -10
  37. package/es/global/js/hooks/useCreateComponentStepChange.js +73 -79
  38. package/es/global/js/utils/test-helper.js +12 -14
  39. package/es/global/js/utils/unwrap-if-fragment.js +1 -1
  40. package/lib/components/APIKeyModal/APIKeyDownloader.js +21 -23
  41. package/lib/components/APIKeyModal/APIKeyModal.js +43 -45
  42. package/lib/components/AddSelect/AddSelectBody.js +1 -1
  43. package/lib/components/AddSelect/hooks/usePath.js +6 -0
  44. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +1 -1
  45. package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +1 -1
  46. package/lib/components/CreateFullPage/CreateFullPage.js +8 -2
  47. package/lib/components/CreateTearsheet/CreateTearsheet.js +8 -2
  48. package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +4 -2
  49. package/lib/components/Datagrid/Datagrid/DatagridContent.js +10 -3
  50. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Actions.js +7 -9
  51. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +6 -6
  52. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +26 -24
  53. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/{CustomizeColumnsModal.js → CustomizeColumnsTearsheet.js} +26 -25
  54. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/{ModalWrapper.js → TearsheetWrapper.js} +30 -33
  55. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/index.js +3 -3
  56. package/lib/components/Datagrid/useCustomizeColumns.js +7 -7
  57. package/lib/components/ImportModal/ImportModal.js +42 -44
  58. package/lib/components/index.js +6 -0
  59. package/lib/global/js/hooks/useCreateComponentFocus.js +32 -10
  60. package/lib/global/js/hooks/useCreateComponentStepChange.js +73 -79
  61. package/lib/global/js/utils/test-helper.js +12 -14
  62. package/lib/global/js/utils/unwrap-if-fragment.js +1 -1
  63. package/package.json +10 -10
  64. package/scss/components/Datagrid/styles/_datagrid.scss +5 -0
  65. package/scss/components/Datagrid/styles/_draggableElement.scss +9 -8
  66. package/scss/components/Datagrid/styles/_index.scss +8 -8
  67. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +60 -0
  68. package/scss/components/Tearsheet/_tearsheet.scss +2 -0
  69. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ModalWrapper.js +0 -56
  70. package/scss/components/Datagrid/styles/addons/_CustomizeColumnsModal.scss +0 -86
@@ -1,10 +1,9 @@
1
- /*
2
- * Licensed Materials - Property of IBM
3
- * 5724-Q36
4
- * (c) Copyright IBM Corp. 2021
5
- * US Government Users Restricted Rights - Use, duplication or disclosure
6
- * restricted by GSA ADP Schedule Contract with IBM Corp.
1
+ /**
2
+ * Copyright IBM Corp. 2022, 2022
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
7
6
  */
8
7
 
9
- export { default as CustomizeColumnsModalWrapper } from './ModalWrapper';
8
+ export { default as CustomizeColumnsTearsheetWrapper } from './TearsheetWrapper';
10
9
  export { default as ToggleButtonWrapper } from './ButtonWrapper';
@@ -3,39 +3,37 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  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; }
5
5
  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; }
6
- // @flow
7
- /*
8
- * Licensed Materials - Property of IBM
9
- * 5724-Q36
10
- * (c) Copyright IBM Corp. 2021
11
- * US Government Users Restricted Rights - Use, duplication or disclosure
12
- * restricted by GSA ADP Schedule Contract with IBM Corp.
6
+ /**
7
+ * Copyright IBM Corp. 2022, 2022
8
+ *
9
+ * This source code is licensed under the Apache-2.0 license found in the
10
+ * LICENSE file in the root directory of this source tree.
13
11
  */
14
12
 
15
13
  import * as React from 'react';
16
- import { CustomizeColumnsModalWrapper, ToggleButtonWrapper } from './Datagrid/addons/CustomizeColumns';
14
+ import { CustomizeColumnsTearsheetWrapper, ToggleButtonWrapper } from './Datagrid/addons/CustomizeColumns';
17
15
  var useCustomizeColumns = function useCustomizeColumns(hooks) {
18
16
  var _React$useState = React.useState(false),
19
17
  _React$useState2 = _slicedToArray(_React$useState, 2),
20
- isModalOpen = _React$useState2[0],
21
- setIsModalOpen = _React$useState2[1];
18
+ isTearsheetOpen = _React$useState2[0],
19
+ setIsTearsheetOpen = _React$useState2[1];
22
20
  hooks.useInstance.push(function (instance) {
23
21
  var customizeColumnsProps = instance.customizeColumnsProps;
24
22
  var _ref = customizeColumnsProps || {},
25
23
  labels = _ref.labels;
26
24
  Object.assign(instance, {
27
25
  customizeColumnsProps: _objectSpread(_objectSpread({}, customizeColumnsProps), {}, {
28
- isModalOpen: isModalOpen,
29
- setIsModalOpen: setIsModalOpen
26
+ isTearsheetOpen: isTearsheetOpen,
27
+ setIsTearsheetOpen: setIsTearsheetOpen
30
28
  }),
31
29
  CustomizeColumnsButton: function CustomizeColumnsButton(props) {
32
30
  return /*#__PURE__*/React.createElement(ToggleButtonWrapper, _extends({
33
31
  iconTooltipLabel: labels === null || labels === void 0 ? void 0 : labels.iconTooltipLabel,
34
- isModalOpen: isModalOpen,
35
- setIsModalOpen: setIsModalOpen
32
+ isTearsheetOpen: isTearsheetOpen,
33
+ setIsTearsheetOpen: setIsTearsheetOpen
36
34
  }, props));
37
35
  },
38
- CustomizeColumnsModal: CustomizeColumnsModalWrapper
36
+ CustomizeColumnsTearsheet: CustomizeColumnsTearsheetWrapper
39
37
  });
40
38
  });
41
39
  };
@@ -111,51 +111,49 @@ export var ImportModal = /*#__PURE__*/forwardRef(function (_ref, ref) {
111
111
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(evt) {
112
112
  var fileName, pendingFile, response, blob, fetchedFile, failedFile;
113
113
  return _regeneratorRuntime.wrap(function _callee$(_context) {
114
- while (1) {
115
- switch (_context.prev = _context.next) {
116
- case 0:
117
- evt.preventDefault();
118
- fileName = importUrl.substring(importUrl.lastIndexOf('/') + 1).split('?')[0];
119
- pendingFile = {
120
- name: fileName,
121
- status: 'uploading',
122
- uuid: uuidv4()
123
- };
124
- setFiles([pendingFile]);
125
- _context.prev = 4;
126
- _context.next = 7;
127
- return fetch(importUrl);
128
- case 7:
129
- response = _context.sent;
130
- if (!(!response.ok || response.status !== 200)) {
131
- _context.next = 10;
132
- break;
133
- }
134
- throw new Error(response.status);
135
- case 10:
136
- _context.next = 12;
137
- return response.blob();
138
- case 12:
139
- blob = _context.sent;
140
- fetchedFile = new File([blob], fileName, {
141
- type: blob.type
142
- });
143
- fetchedFile.invalidFileType = isInvalidFileType(fetchedFile);
144
- fetchedFile.uuid = pendingFile.uuid;
145
- updateFiles([fetchedFile]);
146
- _context.next = 23;
114
+ while (1) switch (_context.prev = _context.next) {
115
+ case 0:
116
+ evt.preventDefault();
117
+ fileName = importUrl.substring(importUrl.lastIndexOf('/') + 1).split('?')[0];
118
+ pendingFile = {
119
+ name: fileName,
120
+ status: 'uploading',
121
+ uuid: uuidv4()
122
+ };
123
+ setFiles([pendingFile]);
124
+ _context.prev = 4;
125
+ _context.next = 7;
126
+ return fetch(importUrl);
127
+ case 7:
128
+ response = _context.sent;
129
+ if (!(!response.ok || response.status !== 200)) {
130
+ _context.next = 10;
147
131
  break;
148
- case 19:
149
- _context.prev = 19;
150
- _context.t0 = _context["catch"](4);
151
- failedFile = _objectSpread(_objectSpread({}, pendingFile), {}, {
152
- fetchError: true
153
- });
154
- updateFiles([failedFile]);
155
- case 23:
156
- case "end":
157
- return _context.stop();
158
- }
132
+ }
133
+ throw new Error(response.status);
134
+ case 10:
135
+ _context.next = 12;
136
+ return response.blob();
137
+ case 12:
138
+ blob = _context.sent;
139
+ fetchedFile = new File([blob], fileName, {
140
+ type: blob.type
141
+ });
142
+ fetchedFile.invalidFileType = isInvalidFileType(fetchedFile);
143
+ fetchedFile.uuid = pendingFile.uuid;
144
+ updateFiles([fetchedFile]);
145
+ _context.next = 23;
146
+ break;
147
+ case 19:
148
+ _context.prev = 19;
149
+ _context.t0 = _context["catch"](4);
150
+ failedFile = _objectSpread(_objectSpread({}, pendingFile), {}, {
151
+ fetchError: true
152
+ });
153
+ updateFiles([failedFile]);
154
+ case 23:
155
+ case "end":
156
+ return _context.stop();
159
157
  }
160
158
  }, _callee, null, [[4, 19]]);
161
159
  }));
@@ -37,7 +37,7 @@ export { WebTerminal, WebTerminalContentWrapper, useWebTerminal, WebTerminalProv
37
37
  export { EditSidePanel } from './EditSidePanel';
38
38
  export { OptionsTile } from './OptionsTile';
39
39
  export { DataSpreadsheet } from './DataSpreadsheet';
40
- export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows, useExpandedRow, useOnRowClick, useSortableColumns, useRowIsMouseOver, useColumnRightAlign, useDisableSelectRows, useStickyColumn, useActionsColumn, useCustomizeColumns, useSelectAllWithToggle, useColumnOrder, useInlineEdit } from './Datagrid';
40
+ export { Datagrid, useDatagrid, useInfiniteScroll, useNestedRows, useSelectRows, useExpandedRow, useOnRowClick, useSortableColumns, useRowIsMouseOver, useColumnRightAlign, useDisableSelectRows, useStickyColumn, useActionsColumn, useCustomizeColumns, useSelectAllWithToggle, useColumnOrder, useInlineEdit, useFiltering } from './Datagrid';
41
41
  export { EditTearsheet } from './EditTearsheet';
42
42
  export { EditTearsheetNarrow } from './EditTearsheetNarrow';
43
43
  export { EditFullPage } from './EditFullPage';
@@ -1,3 +1,5 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
3
  /**
2
4
  * Copyright IBM Corp. 2021, 2021
3
5
  *
@@ -6,29 +8,48 @@
6
8
  */
7
9
 
8
10
  import { useEffect } from 'react';
9
- import { getFocusableElements } from '../utils/getFocusableElements';
11
+ import wait from '../utils/wait';
10
12
 
11
13
  // Focus the first focusable element and call the onMount prop for the current step if one is provided
12
14
  export var useCreateComponentFocus = function useCreateComponentFocus(_ref) {
13
15
  var previousState = _ref.previousState,
14
16
  currentStep = _ref.currentStep,
15
17
  blockClass = _ref.blockClass,
16
- onMount = _ref.onMount;
18
+ onMount = _ref.onMount,
19
+ firstFocusElement = _ref.firstFocusElement;
17
20
  useEffect(function () {
18
21
  if (typeof onMount === 'function') {
19
22
  onMount();
20
23
  }
21
24
  }, [onMount]);
22
25
  useEffect(function () {
26
+ // because of how handleStackChange.claimFocus in TearsheetShell works a timeout is required to focus on specific elements
27
+ var awaitFocus = /*#__PURE__*/function () {
28
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(elm) {
29
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
30
+ while (1) switch (_context.prev = _context.next) {
31
+ case 0:
32
+ _context.next = 2;
33
+ return wait(10);
34
+ case 2:
35
+ elm.focus();
36
+ case 3:
37
+ case "end":
38
+ return _context.stop();
39
+ }
40
+ }, _callee);
41
+ }));
42
+ return function awaitFocus(_x) {
43
+ return _ref2.apply(this, arguments);
44
+ };
45
+ }();
23
46
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.currentStep) !== currentStep && currentStep > 0) {
24
- var visibleStepInnerContent = document.querySelector(".".concat(blockClass, "__step.").concat(blockClass, "__step__step--visible-step"));
25
- var focusableStepElements = visibleStepInnerContent ? getFocusableElements(visibleStepInnerContent) : [];
26
- if (focusableStepElements && focusableStepElements.length) {
27
- focusableStepElements[0].focus();
28
- } else {
29
- var nextButton = document.querySelector(".".concat(blockClass, "__create-button"));
30
- nextButton === null || nextButton === void 0 ? void 0 : nextButton.focus();
47
+ if (firstFocusElement) {
48
+ var elm = document.querySelector(firstFocusElement);
49
+ if (elm) {
50
+ awaitFocus(elm);
51
+ }
31
52
  }
32
53
  }
33
- }, [currentStep, previousState, blockClass, onMount]);
54
+ }, [currentStep, previousState, blockClass, onMount, firstFocusElement]);
34
55
  };
@@ -43,25 +43,23 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
43
43
  var handleOnRequestSubmit = /*#__PURE__*/function () {
44
44
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
45
45
  return _regeneratorRuntime.wrap(function _callee$(_context) {
46
- while (1) {
47
- switch (_context.prev = _context.next) {
48
- case 0:
49
- _context.prev = 0;
50
- _context.next = 3;
51
- return onRequestSubmit();
52
- case 3:
53
- onUnmount();
54
- _context.next = 10;
55
- break;
56
- case 6:
57
- _context.prev = 6;
58
- _context.t0 = _context["catch"](0);
59
- setIsSubmitting(false);
60
- console.warn("".concat(componentName, " submit error: ").concat(_context.t0));
61
- case 10:
62
- case "end":
63
- return _context.stop();
64
- }
46
+ while (1) switch (_context.prev = _context.next) {
47
+ case 0:
48
+ _context.prev = 0;
49
+ _context.next = 3;
50
+ return onRequestSubmit();
51
+ case 3:
52
+ onUnmount();
53
+ _context.next = 10;
54
+ break;
55
+ case 6:
56
+ _context.prev = 6;
57
+ _context.t0 = _context["catch"](0);
58
+ setIsSubmitting(false);
59
+ console.warn("".concat(componentName, " submit error: ").concat(_context.t0));
60
+ case 10:
61
+ case "end":
62
+ return _context.stop();
65
63
  }
66
64
  }, _callee, null, [[0, 6]]);
67
65
  }));
@@ -72,35 +70,33 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
72
70
  var handleNext = /*#__PURE__*/function () {
73
71
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
74
72
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
75
- while (1) {
76
- switch (_context2.prev = _context2.next) {
77
- case 0:
78
- setIsSubmitting(true);
79
- if (!(typeof onNext === 'function')) {
80
- _context2.next = 14;
81
- break;
82
- }
83
- _context2.prev = 2;
84
- _context2.next = 5;
85
- return onNext();
86
- case 5:
87
- continueToNextStep();
88
- _context2.next = 12;
89
- break;
90
- case 8:
91
- _context2.prev = 8;
92
- _context2.t0 = _context2["catch"](2);
93
- setIsSubmitting(false);
94
- console.warn("".concat(componentName, " onNext error: ").concat(_context2.t0));
95
- case 12:
96
- _context2.next = 15;
73
+ while (1) switch (_context2.prev = _context2.next) {
74
+ case 0:
75
+ setIsSubmitting(true);
76
+ if (!(typeof onNext === 'function')) {
77
+ _context2.next = 14;
97
78
  break;
98
- case 14:
99
- continueToNextStep();
100
- case 15:
101
- case "end":
102
- return _context2.stop();
103
- }
79
+ }
80
+ _context2.prev = 2;
81
+ _context2.next = 5;
82
+ return onNext();
83
+ case 5:
84
+ continueToNextStep();
85
+ _context2.next = 12;
86
+ break;
87
+ case 8:
88
+ _context2.prev = 8;
89
+ _context2.t0 = _context2["catch"](2);
90
+ setIsSubmitting(false);
91
+ console.warn("".concat(componentName, " onNext error: ").concat(_context2.t0));
92
+ case 12:
93
+ _context2.next = 15;
94
+ break;
95
+ case 14:
96
+ continueToNextStep();
97
+ case 15:
98
+ case "end":
99
+ return _context2.stop();
104
100
  }
105
101
  }, _callee2, null, [[2, 8]]);
106
102
  }));
@@ -111,39 +107,37 @@ export var useCreateComponentStepChange = function useCreateComponentStepChange(
111
107
  var handleSubmit = /*#__PURE__*/function () {
112
108
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
113
109
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
114
- while (1) {
115
- switch (_context3.prev = _context3.next) {
116
- case 0:
117
- setIsSubmitting(true);
118
- // last step should have onNext as well
119
- if (!(typeof onNext === 'function')) {
120
- _context3.next = 15;
121
- break;
122
- }
123
- _context3.prev = 2;
124
- _context3.next = 5;
125
- return onNext();
126
- case 5:
127
- _context3.next = 7;
128
- return handleOnRequestSubmit();
129
- case 7:
130
- _context3.next = 13;
131
- break;
132
- case 9:
133
- _context3.prev = 9;
134
- _context3.t0 = _context3["catch"](2);
135
- setIsSubmitting(false);
136
- console.warn("".concat(componentName, " onNext error: ").concat(_context3.t0));
137
- case 13:
138
- _context3.next = 17;
110
+ while (1) switch (_context3.prev = _context3.next) {
111
+ case 0:
112
+ setIsSubmitting(true);
113
+ // last step should have onNext as well
114
+ if (!(typeof onNext === 'function')) {
115
+ _context3.next = 15;
139
116
  break;
140
- case 15:
141
- _context3.next = 17;
142
- return handleOnRequestSubmit();
143
- case 17:
144
- case "end":
145
- return _context3.stop();
146
- }
117
+ }
118
+ _context3.prev = 2;
119
+ _context3.next = 5;
120
+ return onNext();
121
+ case 5:
122
+ _context3.next = 7;
123
+ return handleOnRequestSubmit();
124
+ case 7:
125
+ _context3.next = 13;
126
+ break;
127
+ case 9:
128
+ _context3.prev = 9;
129
+ _context3.t0 = _context3["catch"](2);
130
+ setIsSubmitting(false);
131
+ console.warn("".concat(componentName, " onNext error: ").concat(_context3.t0));
132
+ case 13:
133
+ _context3.next = 17;
134
+ break;
135
+ case 15:
136
+ _context3.next = 17;
137
+ return handleOnRequestSubmit();
138
+ case 17:
139
+ case "end":
140
+ return _context3.stop();
147
141
  }
148
142
  }, _callee3, null, [[2, 9]]);
149
143
  }));
@@ -137,20 +137,18 @@ export var expectWarnAsync = /*#__PURE__*/function () {
137
137
  var _expect2;
138
138
  var warn;
139
139
  return _regeneratorRuntime.wrap(function _callee$(_context) {
140
- while (1) {
141
- switch (_context.prev = _context.next) {
142
- case 0:
143
- warn = jest.spyOn(console, 'warn').mockImplementation(jest.fn());
144
- _context.next = 3;
145
- return test();
146
- case 3:
147
- expect(warn).toBeCalledTimes(1);
148
- (_expect2 = expect(warn)).toHaveBeenCalledWith.apply(_expect2, _toConsumableArray(makeMatcherArray(message)));
149
- warn.mockRestore();
150
- case 6:
151
- case "end":
152
- return _context.stop();
153
- }
140
+ while (1) switch (_context.prev = _context.next) {
141
+ case 0:
142
+ warn = jest.spyOn(console, 'warn').mockImplementation(jest.fn());
143
+ _context.next = 3;
144
+ return test();
145
+ case 3:
146
+ expect(warn).toBeCalledTimes(1);
147
+ (_expect2 = expect(warn)).toHaveBeenCalledWith.apply(_expect2, _toConsumableArray(makeMatcherArray(message)));
148
+ warn.mockRestore();
149
+ case 6:
150
+ case "end":
151
+ return _context.stop();
154
152
  }
155
153
  }, _callee);
156
154
  }));
@@ -1,6 +1,6 @@
1
1
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
2
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
3
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
4
  import React from 'react';
5
5
 
6
6
  /**
@@ -38,29 +38,27 @@ var APIKeyDownloader = function APIKeyDownloader(_ref) {
38
38
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
39
39
  var data, blob, href, download, props;
40
40
  return _regenerator.default.wrap(function _callee$(_context) {
41
- while (1) {
42
- switch (_context.prev = _context.next) {
43
- case 0:
44
- data = fileType === 'txt' ? apiKey : JSON.stringify({
45
- apiKey: apiKey
46
- });
47
- blob = new Blob([data], {
48
- type: fileType === 'txt' ? 'text/plain' : 'application/json'
49
- });
50
- _context.next = 4;
51
- return URL.createObjectURL(blob);
52
- case 4:
53
- href = _context.sent;
54
- download = "".concat(fileName || 'apikey', ".").concat(fileType);
55
- props = {
56
- href: href,
57
- download: download
58
- };
59
- setLinkProps(props);
60
- case 8:
61
- case "end":
62
- return _context.stop();
63
- }
41
+ while (1) switch (_context.prev = _context.next) {
42
+ case 0:
43
+ data = fileType === 'txt' ? apiKey : JSON.stringify({
44
+ apiKey: apiKey
45
+ });
46
+ blob = new Blob([data], {
47
+ type: fileType === 'txt' ? 'text/plain' : 'application/json'
48
+ });
49
+ _context.next = 4;
50
+ return URL.createObjectURL(blob);
51
+ case 4:
52
+ href = _context.sent;
53
+ download = "".concat(fileName || 'apikey', ".").concat(fileType);
54
+ props = {
55
+ href: href,
56
+ download: download
57
+ };
58
+ setLinkProps(props);
59
+ case 8:
60
+ case "end":
61
+ return _context.stop();
64
62
  }
65
63
  }, _callee);
66
64
  }));
@@ -163,54 +163,52 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
163
163
  var submitHandler = /*#__PURE__*/function () {
164
164
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
165
165
  return _regenerator.default.wrap(function _callee$(_context) {
166
- while (1) {
167
- switch (_context.prev = _context.next) {
168
- case 0:
169
- e.preventDefault();
170
- if (!hasNextStep) {
171
- _context.next = 5;
172
- break;
173
- }
174
- setCurrentStep(currentStep + 1);
175
- _context.next = 22;
166
+ while (1) switch (_context.prev = _context.next) {
167
+ case 0:
168
+ e.preventDefault();
169
+ if (!hasNextStep) {
170
+ _context.next = 5;
176
171
  break;
177
- case 5:
178
- if (!apiKeyLoaded) {
179
- _context.next = 21;
180
- break;
181
- }
182
- if (!onCopy) {
183
- _context.next = 10;
184
- break;
185
- }
186
- onCopy(apiKey);
187
- _context.next = 19;
172
+ }
173
+ setCurrentStep(currentStep + 1);
174
+ _context.next = 22;
175
+ break;
176
+ case 5:
177
+ if (!apiKeyLoaded) {
178
+ _context.next = 21;
188
179
  break;
189
- case 10:
190
- _context.prev = 10;
191
- _context.next = 13;
192
- return navigator.clipboard.writeText(apiKey);
193
- case 13:
194
- _context.next = 19;
180
+ }
181
+ if (!onCopy) {
182
+ _context.next = 10;
195
183
  break;
196
- case 15:
197
- _context.prev = 15;
198
- _context.t0 = _context["catch"](10);
199
- console.error(_context.t0);
200
- setCopyError(true);
201
- case 19:
202
- _context.next = 22;
203
- break;
204
- case 21:
205
- if (editing) {
206
- onRequestEdit(name);
207
- } else {
208
- onRequestGenerate(name);
209
- }
210
- case 22:
211
- case "end":
212
- return _context.stop();
213
- }
184
+ }
185
+ onCopy(apiKey);
186
+ _context.next = 19;
187
+ break;
188
+ case 10:
189
+ _context.prev = 10;
190
+ _context.next = 13;
191
+ return navigator.clipboard.writeText(apiKey);
192
+ case 13:
193
+ _context.next = 19;
194
+ break;
195
+ case 15:
196
+ _context.prev = 15;
197
+ _context.t0 = _context["catch"](10);
198
+ console.error(_context.t0);
199
+ setCopyError(true);
200
+ case 19:
201
+ _context.next = 22;
202
+ break;
203
+ case 21:
204
+ if (editing) {
205
+ onRequestEdit(name);
206
+ } else {
207
+ onRequestGenerate(name);
208
+ }
209
+ case 22:
210
+ case "end":
211
+ return _context.stop();
214
212
  }
215
213
  }, _callee, null, [[10, 15]]);
216
214
  }));
@@ -155,7 +155,7 @@ var AddSelectBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
155
155
  onCloseHandler();
156
156
  };
157
157
  var setShowBreadsCrumbs = function setShowBreadsCrumbs() {
158
- if (searchTerm || globalFiltersApplied || !path || path.length === 0) {
158
+ if (useNormalizedItems === false || searchTerm || globalFiltersApplied) {
159
159
  return false;
160
160
  }
161
161
  return true;
@@ -20,6 +20,12 @@ var usePath = function usePath() {
20
20
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
21
21
  path = _useState2[0],
22
22
  setPath = _useState2[1];
23
+ (0, _react.useEffect)(function () {
24
+ setPath([{
25
+ id: 'base_of_path',
26
+ title: itemsLabel
27
+ }]);
28
+ }, [itemsLabel]);
23
29
  var handler = function handler(id, title, parentId) {
24
30
  if (path.find(function (entry) {
25
31
  return entry.id === id;