@carbon/ibm-products 1.3.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +5102 -4711
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +9 -3
- package/css/index-full-carbon.min.css.map +1 -0
- package/css/index-without-carbon-released-only.css +189 -108
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +3 -3
- package/css/index-without-carbon-released-only.min.css.map +1 -0
- package/css/index-without-carbon.css +619 -236
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +9 -3
- package/css/index-without-carbon.min.css.map +1 -0
- package/css/index.css +950 -567
- package/css/index.css.map +1 -1
- package/css/index.min.css +9 -3
- package/css/index.min.css.map +1 -0
- package/es/components/APIKeyModal/APIKeyModal.js +25 -29
- package/es/components/ActionBar/ActionBar.js +4 -1
- package/es/components/ActionSet/ActionSet.js +22 -10
- package/es/components/ActionSet/actions.js +25 -17
- package/es/components/AddSelect/AddSelect.js +141 -53
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +56 -0
- package/es/components/AddSelect/AddSelectList.js +94 -0
- package/es/components/AddSelect/AddSelectSidebar.js +78 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +24 -17
- package/es/components/CancelableTextEdit/CancelableTextEdit.js +62 -24
- package/es/components/Card/Card.js +6 -4
- package/es/components/CreateFullPage/CreateFullPage.js +102 -258
- package/es/components/CreateFullPage/CreateFullPageStep.js +65 -13
- package/es/components/CreateFullPage/index.js +1 -2
- package/es/components/CreateInfluencer/CreateInfluencer.js +40 -220
- package/es/components/CreateTearsheet/CreateTearsheet.js +95 -146
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +70 -20
- package/es/components/CreateTearsheet/index.js +0 -1
- package/es/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +87 -28
- package/es/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +8 -6
- package/es/components/EmptyStates/EmptyState.js +1 -1
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
- package/es/components/ExportModal/ExportModal.js +41 -12
- package/es/components/ImportModal/ImportModal.js +2 -1
- package/es/components/InlineEdit/InlineEdit.js +397 -0
- package/es/components/InlineEdit/index.js +7 -0
- package/es/components/MultiAddSelect/MultiAddSelect.js +16 -0
- package/es/components/MultiAddSelect/index.js +1 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +16 -3
- package/es/components/OptionsTile/OptionsTile.js +36 -15
- package/es/components/PageHeader/PageHeader.js +59 -35
- package/es/components/PageHeader/PageHeaderTitle.js +82 -7
- package/es/components/PageHeader/PageHeaderUtils.js +21 -2
- package/es/components/RemoveModal/RemoveModal.js +4 -2
- package/es/components/SidePanel/SidePanel.js +33 -16
- package/es/components/SingleAddSelect/SingleAddSelect.js +15 -0
- package/es/components/SingleAddSelect/index.js +1 -0
- package/es/components/TagSet/TagSet.js +4 -1
- package/es/components/Tearsheet/Tearsheet.js +1 -1
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -1
- package/es/components/Tearsheet/TearsheetShell.js +1 -1
- package/es/components/Toolbar/Toolbar.js +69 -8
- package/es/components/WebTerminal/WebTerminal.js +1 -1
- package/es/components/index.js +4 -2
- package/es/global/js/hooks/index.js +1 -0
- package/es/global/js/hooks/useCreateComponentFocus.js +15 -19
- package/es/global/js/hooks/useCreateComponentStepChange.js +69 -79
- package/es/global/js/hooks/useResetCreateComponent.js +7 -4
- package/es/global/js/hooks/useRetrieveStepData.js +51 -0
- package/es/global/js/hooks/useValidCreateStepCount.js +4 -7
- package/es/global/js/package-settings.js +4 -2
- package/es/global/js/utils/lastIndexInArray.js +26 -0
- package/es/settings.js +0 -5
- package/lib/components/APIKeyModal/APIKeyModal.js +25 -29
- package/lib/components/ActionBar/ActionBar.js +4 -1
- package/lib/components/ActionSet/ActionSet.js +22 -10
- package/lib/components/ActionSet/actions.js +25 -17
- package/lib/components/AddSelect/AddSelect.js +141 -50
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +71 -0
- package/lib/components/AddSelect/AddSelectList.js +112 -0
- package/lib/components/AddSelect/AddSelectSidebar.js +89 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +23 -16
- package/lib/components/CancelableTextEdit/CancelableTextEdit.js +62 -23
- package/lib/components/Card/Card.js +6 -4
- package/lib/components/CreateFullPage/CreateFullPage.js +102 -258
- package/lib/components/CreateFullPage/CreateFullPageStep.js +68 -13
- package/lib/components/CreateFullPage/index.js +1 -9
- package/lib/components/CreateInfluencer/CreateInfluencer.js +38 -231
- package/lib/components/CreateTearsheet/CreateTearsheet.js +97 -148
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +72 -19
- package/lib/components/CreateTearsheet/index.js +0 -8
- package/lib/components/CreateTearsheet/preview-components/MultiStepTearsheet.js +86 -34
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithIntro.js +8 -6
- package/lib/components/EmptyStates/EmptyState.js +1 -1
- package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +1 -1
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +1 -1
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +1 -1
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +1 -1
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -1
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +1 -1
- package/lib/components/ExportModal/ExportModal.js +38 -11
- package/lib/components/ImportModal/ImportModal.js +2 -1
- package/lib/components/InlineEdit/InlineEdit.js +413 -0
- package/lib/components/InlineEdit/index.js +13 -0
- package/lib/components/MultiAddSelect/MultiAddSelect.js +37 -0
- package/lib/components/MultiAddSelect/index.js +13 -0
- package/lib/components/NotificationsPanel/NotificationsPanel.js +13 -1
- package/lib/components/OptionsTile/OptionsTile.js +36 -15
- package/lib/components/PageHeader/PageHeader.js +59 -35
- package/lib/components/PageHeader/PageHeaderTitle.js +91 -9
- package/lib/components/PageHeader/PageHeaderUtils.js +21 -2
- package/lib/components/RemoveModal/RemoveModal.js +4 -2
- package/lib/components/SidePanel/SidePanel.js +33 -16
- package/lib/components/SingleAddSelect/SingleAddSelect.js +36 -0
- package/lib/components/SingleAddSelect/index.js +13 -0
- package/lib/components/TagSet/TagSet.js +4 -1
- package/lib/components/Tearsheet/Tearsheet.js +1 -1
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -1
- package/lib/components/Tearsheet/TearsheetShell.js +1 -1
- package/lib/components/Toolbar/Toolbar.js +69 -6
- package/lib/components/WebTerminal/WebTerminal.js +1 -1
- package/lib/components/index.js +25 -9
- package/lib/global/js/hooks/index.js +8 -0
- package/lib/global/js/hooks/useCreateComponentFocus.js +15 -19
- package/lib/global/js/hooks/useCreateComponentStepChange.js +69 -79
- package/lib/global/js/hooks/useResetCreateComponent.js +7 -4
- package/lib/global/js/hooks/useRetrieveStepData.js +62 -0
- package/lib/global/js/hooks/useValidCreateStepCount.js +4 -7
- package/lib/global/js/package-settings.js +4 -2
- package/lib/global/js/utils/lastIndexInArray.js +35 -0
- package/lib/settings.js +0 -6
- package/package.json +24 -24
- package/scss/components/AddSelect/_add-select.scss +53 -8
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +19 -15
- package/scss/components/BreadcrumbWithOverflow/_index.scss +1 -1
- package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +142 -70
- package/scss/components/CancelableTextEdit/_storybook-styles.scss +0 -7
- package/scss/components/CreateFullPage/_create-full-page.scss +4 -11
- package/scss/components/CreateInfluencer/_create-influencer.scss +4 -4
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +6 -10
- package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +0 -6
- package/scss/components/EditSidePanel/_storybook-styles.scss +0 -8
- package/scss/components/InlineEdit/_index.scss +8 -0
- package/scss/components/InlineEdit/_inline-edit.scss +320 -0
- package/scss/components/InlineEdit/_storybook-styles.scss +21 -0
- package/scss/components/LoadingBar/_storybook-styles.scss +0 -5
- package/scss/components/MultiAddSelect/_index.scss +1 -0
- package/scss/components/MultiAddSelect/_multi-add-select.scss +1 -0
- package/scss/components/MultiAddSelect/_storybook-styles.scss +6 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -2
- package/scss/components/OptionsTile/_storybook-styles.scss +0 -7
- package/scss/components/PageHeader/_index.scss +1 -1
- package/scss/components/PageHeader/_page-header.scss +18 -5
- package/scss/components/ProductiveCard/_productive-card.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +15 -6
- package/scss/components/SingleAddSelect/_index.scss +1 -0
- package/scss/components/SingleAddSelect/_single-add-select.scss +1 -0
- package/scss/components/SingleAddSelect/_storybook-styles.scss +6 -0
- package/scss/components/StatusIcon/_index.scss +1 -1
- package/scss/components/StatusIcon/_status-icon.scss +6 -4
- package/scss/components/TagSet/_index.scss +1 -1
- package/scss/components/UserProfileImage/_index.scss +1 -1
- package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
- package/scss/components/WebTerminal/_web-terminal.scss +2 -2
- package/scss/components/_index.scss +3 -1
- package/scss/global/styles/_project-settings.scss +5 -1
- package/es/components/CreateFullPage/CreateFullPageSection.js +0 -53
- package/es/components/CreateFullPage/constants.js +0 -8
- package/es/components/CreateTearsheet/CreateTearsheetSection.js +0 -83
- package/es/components/CreateTearsheet/constants.js +0 -8
- package/es/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +0 -327
- package/es/generated/feature-flags/feature-flags.js +0 -15
- package/es/global/js/utils/hasValidType.js +0 -94
- package/lib/components/CreateFullPage/CreateFullPageSection.js +0 -74
- package/lib/components/CreateFullPage/constants.js +0 -16
- package/lib/components/CreateTearsheet/CreateTearsheetSection.js +0 -105
- package/lib/components/CreateTearsheet/constants.js +0 -17
- package/lib/components/CreateTearsheet/preview-components/MultiStepWithSectionsTearsheet.js +0 -354
- package/lib/generated/feature-flags/feature-flags.js +0 -22
- package/lib/global/js/utils/hasValidType.js +0 -110
- package/scss/generated/feature-flags/_feature-flags.scss +0 -19
@@ -112,7 +112,6 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
112
112
|
currentStep = _useState6[0],
|
113
113
|
setCurrentStep = _useState6[1];
|
114
114
|
|
115
|
-
var inputRef = (0, _react.useRef)();
|
116
115
|
var copyRef = (0, _react.useRef)();
|
117
116
|
var apiKeyInputId = (0, _react.useRef)((0, _uuidv.default)());
|
118
117
|
var nameInputId = (0, _react.useRef)((0, _uuidv.default)());
|
@@ -126,11 +125,6 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
126
125
|
ref: copyRef
|
127
126
|
};
|
128
127
|
var blockClass = "".concat(_settings.pkg.prefix, "--apikey-modal");
|
129
|
-
(0, _react.useEffect)(function () {
|
130
|
-
if (inputRef.current && open) {
|
131
|
-
inputRef.current.focus();
|
132
|
-
}
|
133
|
-
}, [open]);
|
134
128
|
(0, _react.useEffect)(function () {
|
135
129
|
if (copyRef.current && open && apiKeyLoaded) {
|
136
130
|
copyRef.current.focus();
|
@@ -204,70 +198,72 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
204
198
|
};
|
205
199
|
|
206
200
|
var submitHandler = /*#__PURE__*/function () {
|
207
|
-
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
201
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(e) {
|
208
202
|
return _regenerator.default.wrap(function _callee$(_context) {
|
209
203
|
while (1) {
|
210
204
|
switch (_context.prev = _context.next) {
|
211
205
|
case 0:
|
206
|
+
e.preventDefault();
|
207
|
+
|
212
208
|
if (!hasNextStep) {
|
213
|
-
_context.next =
|
209
|
+
_context.next = 5;
|
214
210
|
break;
|
215
211
|
}
|
216
212
|
|
217
213
|
setCurrentStep(currentStep + 1);
|
218
|
-
_context.next =
|
214
|
+
_context.next = 22;
|
219
215
|
break;
|
220
216
|
|
221
|
-
case
|
217
|
+
case 5:
|
222
218
|
if (!apiKeyLoaded) {
|
223
|
-
_context.next =
|
219
|
+
_context.next = 21;
|
224
220
|
break;
|
225
221
|
}
|
226
222
|
|
227
223
|
if (!onCopy) {
|
228
|
-
_context.next =
|
224
|
+
_context.next = 10;
|
229
225
|
break;
|
230
226
|
}
|
231
227
|
|
232
228
|
onCopy(apiKey);
|
233
|
-
_context.next =
|
229
|
+
_context.next = 19;
|
234
230
|
break;
|
235
231
|
|
236
|
-
case
|
237
|
-
_context.prev =
|
238
|
-
_context.next =
|
232
|
+
case 10:
|
233
|
+
_context.prev = 10;
|
234
|
+
_context.next = 13;
|
239
235
|
return navigator.clipboard.writeText(apiKey);
|
240
236
|
|
241
|
-
case
|
242
|
-
_context.next =
|
237
|
+
case 13:
|
238
|
+
_context.next = 19;
|
243
239
|
break;
|
244
240
|
|
245
|
-
case
|
246
|
-
_context.prev =
|
247
|
-
_context.t0 = _context["catch"](
|
241
|
+
case 15:
|
242
|
+
_context.prev = 15;
|
243
|
+
_context.t0 = _context["catch"](10);
|
248
244
|
console.error(_context.t0);
|
249
245
|
setCopyError(true);
|
250
246
|
|
251
|
-
case
|
252
|
-
_context.next =
|
247
|
+
case 19:
|
248
|
+
_context.next = 22;
|
253
249
|
break;
|
254
250
|
|
255
|
-
case
|
251
|
+
case 21:
|
256
252
|
if (editing) {
|
257
253
|
onRequestEdit(name);
|
258
254
|
} else {
|
259
255
|
onRequestGenerate(name);
|
260
256
|
}
|
261
257
|
|
262
|
-
case
|
258
|
+
case 22:
|
263
259
|
case "end":
|
264
260
|
return _context.stop();
|
265
261
|
}
|
266
262
|
}
|
267
|
-
}, _callee, null, [[
|
263
|
+
}, _callee, null, [[10, 15]]);
|
268
264
|
}));
|
269
265
|
|
270
|
-
return function submitHandler() {
|
266
|
+
return function submitHandler(_x) {
|
271
267
|
return _ref2.apply(this, arguments);
|
272
268
|
};
|
273
269
|
}();
|
@@ -318,8 +314,8 @@ var APIKeyModal = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
318
314
|
value: name,
|
319
315
|
id: nameInputId.current,
|
320
316
|
disabled: loading,
|
321
|
-
|
322
|
-
|
317
|
+
required: nameRequired,
|
318
|
+
"data-modal-primary-focus": true
|
323
319
|
})), loading && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.InlineLoading, {
|
324
320
|
description: loadingText,
|
325
321
|
className: "".concat(blockClass, "__loader")
|
@@ -38,7 +38,7 @@ var _ActionBarItem = require("./ActionBarItem");
|
|
38
38
|
var _ActionBarOverflowItems = require("./ActionBarOverflowItems");
|
39
39
|
|
40
40
|
var _excluded = ["actions", "className", "maxVisible", "menuOptionsClass", "onWidthChange", "overflowAriaLabel", "rightAlign"],
|
41
|
-
_excluded2 = ["key"],
|
41
|
+
_excluded2 = ["key", "id"],
|
42
42
|
_excluded3 = ["key"];
|
43
43
|
|
44
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -100,8 +100,11 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
100
100
|
key: "hidden-overflow-menu"
|
101
101
|
}), actions.map(function (_ref2) {
|
102
102
|
var key = _ref2.key,
|
103
|
+
id = _ref2.id,
|
103
104
|
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
104
105
|
return /*#__PURE__*/_react.default.createElement(_ActionBarItem.ActionBarItem, (0, _extends2.default)({}, rest, {
|
106
|
+
// ensure id is not duplicated
|
107
|
+
"data-original-id": id,
|
105
108
|
key: "hidden-item-".concat(key),
|
106
109
|
className: "".concat(blockClass, "__hidden-sizing-item")
|
107
110
|
}));
|
@@ -46,7 +46,7 @@ var ActionSetButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
46
46
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
47
47
|
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, (0, _extends2.default)({}, rest, {
|
48
48
|
isExpressive: true,
|
49
|
-
className: (0, _classnames.default)(className, ["".concat(blockClass, "__action-button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-button--ghost"), kind === 'ghost')]),
|
49
|
+
className: (0, _classnames.default)(className, ["".concat(blockClass, "__action-button"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-button--ghost"), kind === 'ghost' || kind === 'danger--ghost')]),
|
50
50
|
disabled: disabled || loading || false,
|
51
51
|
kind: kind,
|
52
52
|
onClick: onClick,
|
@@ -57,7 +57,7 @@ var ActionSetButton = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref
|
|
57
57
|
|
58
58
|
ActionSetButton.displayName = 'ActionSetButton';
|
59
59
|
ActionSetButton.propTypes = _objectSpread(_objectSpread({}, _carbonComponentsReact.Button.PropTypes), {}, {
|
60
|
-
kind: _propTypes.default.oneOf(['ghost', 'secondary', 'primary']),
|
60
|
+
kind: _propTypes.default.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
61
61
|
label: _propTypes.default.string,
|
62
62
|
loading: _propTypes.default.bool
|
63
63
|
});
|
@@ -90,13 +90,24 @@ var ActionSet = /*#__PURE__*/_react.default.forwardRef(function (_ref3, ref) {
|
|
90
90
|
rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
|
91
91
|
var buttons = actions && ((_actions$slice = actions.slice) === null || _actions$slice === void 0 ? void 0 : _actions$slice.call(actions, 0)) || []; // We stack the buttons in a xs/sm set, or if there are three or more in a md set.
|
92
92
|
|
93
|
-
var stacking = willStack(size, buttons.length); //
|
94
|
-
//
|
93
|
+
var stacking = willStack(size, buttons.length); // Order of button kinds: ghost first, then danger--ghost, then most other types,
|
94
|
+
// then danger, and finally primary
|
95
|
+
|
96
|
+
var buttonOrder = function buttonOrder(kind) {
|
97
|
+
var _ghost$dangerGhost$;
|
98
|
+
|
99
|
+
return (_ghost$dangerGhost$ = {
|
100
|
+
ghost: 1,
|
101
|
+
'danger--ghost': 2,
|
102
|
+
danger: 4,
|
103
|
+
primary: 5
|
104
|
+
}[kind]) !== null && _ghost$dangerGhost$ !== void 0 ? _ghost$dangerGhost$ : 3;
|
105
|
+
}; // order the actions with ghost/ghost-danger buttons first and primary/danger buttons last
|
106
|
+
// (or the opposite way if we're stacking)
|
107
|
+
|
95
108
|
|
96
109
|
buttons.sort(function (action1, action2) {
|
97
|
-
|
98
|
-
var kind2 = action2.kind || defaultKind;
|
99
|
-
return kind1 === 'ghost' || kind2 === 'primary' ? stacking ? 1 : -1 : kind1 === 'primary' || kind2 === 'ghost' ? stacking ? -1 : 1 : 0;
|
110
|
+
return (buttonOrder(action1.kind || defaultKind) - buttonOrder(action2.kind || defaultKind)) * (stacking ? -1 : 1);
|
100
111
|
});
|
101
112
|
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ButtonSet, (0, _extends2.default)({}, rest, {
|
102
113
|
className: (0, _classnames.default)(blockClass, className, (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "--row-single"), !stacking && buttons.length === 1), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "--row-double"), !stacking && buttons.length === 2), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "--row-triple"), !stacking && buttons.length === 3), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "--row-quadruple"), !stacking && buttons.length >= 4), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "--stacking"), stacking), _cx), "".concat(blockClass, "--").concat(size)),
|
@@ -147,13 +158,14 @@ ActionSet.validateActions = function (sizeFn) {
|
|
147
158
|
|
148
159
|
var primaryActions = countActions('primary');
|
149
160
|
var secondaryActions = countActions('secondary');
|
150
|
-
var
|
161
|
+
var dangerActions = countActions('danger');
|
162
|
+
var ghostActions = countActions('ghost') + countActions('danger--ghost');
|
151
163
|
stacking && actions > 3 && problems.push("you cannot have more than three actions in this size of ".concat(componentName));
|
152
164
|
actions > 4 && problems.push("you cannot have more than four actions in a ".concat(componentName));
|
153
165
|
primaryActions > 1 && problems.push("you cannot have more than one 'primary' action in a ".concat(componentName));
|
154
166
|
ghostActions > 1 && problems.push("you cannot have more than one 'ghost' action in a ".concat(componentName));
|
155
167
|
stacking && actions > 1 && ghostActions > 0 && problems.push("you cannot have a 'ghost' button in conjunction with other action types in this size of ".concat(componentName));
|
156
|
-
actions > primaryActions + secondaryActions + ghostActions && problems.push("you can only have 'primary', 'secondary' and 'ghost' buttons in a ".concat(componentName));
|
168
|
+
actions > primaryActions + secondaryActions + dangerActions + ghostActions && problems.push("you can only have 'primary', 'danger', 'secondary', 'ghost' and 'danger--ghost' buttons in a ".concat(componentName));
|
157
169
|
}
|
158
170
|
|
159
171
|
return problems.length > 0 ? new Error("Invalid ".concat(location, " `").concat(name, "` supplied to `").concat(componentName, "`: ").concat(problems.join(', and '), ".")) : null;
|
@@ -174,7 +186,7 @@ ActionSet.propTypes = {
|
|
174
186
|
* See https://react.carbondesignsystem.com/?path=/docs/components-button--default#component-api
|
175
187
|
*/
|
176
188
|
actions: (0, _propsHelper.allPropTypes)([ActionSet.validateActions(), _propTypes.default.arrayOf(_propTypes.default.shape(_objectSpread(_objectSpread({}, _carbonComponentsReact.Button.propTypes), {}, {
|
177
|
-
kind: _propTypes.default.oneOf(['ghost', 'secondary', 'primary']),
|
189
|
+
kind: _propTypes.default.oneOf(['ghost', 'danger--ghost', 'secondary', 'danger', 'primary']),
|
178
190
|
label: _propTypes.default.string,
|
179
191
|
loading: _propTypes.default.bool,
|
180
192
|
// we duplicate this Button prop to improve the DocGen here
|
@@ -11,22 +11,25 @@ exports.actionsOptions = exports.actionsMapping = exports.actionsLabels = void 0
|
|
11
11
|
* This source code is licensed under the Apache-2.0 license found in the
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
13
13
|
*/
|
14
|
-
var actionsOptions = [0, 1, 2, 3, 4, 5, 6, 7];
|
14
|
+
var actionsOptions = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
15
15
|
exports.actionsOptions = actionsOptions;
|
16
16
|
var actionsLabels = {
|
17
17
|
0: 'None',
|
18
18
|
1: 'One button',
|
19
|
-
2: '
|
20
|
-
3: '
|
21
|
-
4: 'Two buttons
|
22
|
-
5: '
|
23
|
-
6: 'Three buttons
|
24
|
-
7: '
|
19
|
+
2: 'A danger button',
|
20
|
+
3: 'A ghost button',
|
21
|
+
4: 'Two buttons',
|
22
|
+
5: 'Two buttons with one ghost',
|
23
|
+
6: 'Three buttons',
|
24
|
+
7: 'Three buttons with one ghost',
|
25
|
+
8: 'Three buttons with one danger',
|
26
|
+
9: 'Four buttons with one ghost',
|
27
|
+
10: 'Four buttons with two danger'
|
25
28
|
};
|
26
29
|
exports.actionsLabels = actionsLabels;
|
27
30
|
|
28
31
|
var actionsMapping = function actionsMapping(labels, action) {
|
29
|
-
var _labels$primary, _labels$secondary, _labels$secondary2, _labels$ghost;
|
32
|
+
var _labels$primary, _labels$danger, _labels$secondary, _labels$secondary2, _labels$dangerGhost, _labels$ghost;
|
30
33
|
|
31
34
|
var act = function act(label, kind, key) {
|
32
35
|
var actionCall = action && action("Click on '".concat(label, "'"));
|
@@ -42,18 +45,23 @@ var actionsMapping = function actionsMapping(labels, action) {
|
|
42
45
|
};
|
43
46
|
|
44
47
|
var primary = act((_labels$primary = labels === null || labels === void 0 ? void 0 : labels.primary) !== null && _labels$primary !== void 0 ? _labels$primary : 'Primary', 'primary', 1);
|
45
|
-
var
|
46
|
-
var
|
47
|
-
var
|
48
|
+
var danger = act((_labels$danger = labels === null || labels === void 0 ? void 0 : labels.danger) !== null && _labels$danger !== void 0 ? _labels$danger : 'Danger', 'danger', 2);
|
49
|
+
var secondary = act((_labels$secondary = labels === null || labels === void 0 ? void 0 : labels.secondary) !== null && _labels$secondary !== void 0 ? _labels$secondary : 'Secondary', 'secondary', 3);
|
50
|
+
var secondary2 = act((_labels$secondary2 = labels === null || labels === void 0 ? void 0 : labels.secondary2) !== null && _labels$secondary2 !== void 0 ? _labels$secondary2 : 'Secondary', 'secondary', 4);
|
51
|
+
var dangerGhost = act((_labels$dangerGhost = labels === null || labels === void 0 ? void 0 : labels.dangerGhost) !== null && _labels$dangerGhost !== void 0 ? _labels$dangerGhost : 'Danger-ghost', 'danger--ghost', 5);
|
52
|
+
var ghost = act((_labels$ghost = labels === null || labels === void 0 ? void 0 : labels.ghost) !== null && _labels$ghost !== void 0 ? _labels$ghost : 'Ghost', 'ghost', 6);
|
48
53
|
return {
|
49
54
|
0: [],
|
50
55
|
1: [primary],
|
51
|
-
2: [
|
52
|
-
3: [
|
53
|
-
4: [primary,
|
54
|
-
5: [primary,
|
55
|
-
6: [primary, secondary,
|
56
|
-
7: [primary, secondary,
|
56
|
+
2: [danger],
|
57
|
+
3: [ghost],
|
58
|
+
4: [primary, secondary],
|
59
|
+
5: [primary, ghost],
|
60
|
+
6: [primary, secondary, secondary2],
|
61
|
+
7: [primary, secondary, ghost],
|
62
|
+
8: [danger, secondary, ghost],
|
63
|
+
9: [primary, secondary, secondary2, ghost],
|
64
|
+
10: [danger, secondary, secondary2, dangerGhost]
|
57
65
|
};
|
58
66
|
};
|
59
67
|
|
@@ -11,6 +11,8 @@ exports.AddSelect = void 0;
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
15
|
+
|
14
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
15
17
|
|
16
18
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
@@ -29,7 +31,13 @@ var _NoDataEmptyState = require("../../components/EmptyStates/NoDataEmptyState")
|
|
29
31
|
|
30
32
|
var _settings = require("../../settings");
|
31
33
|
|
32
|
-
var
|
34
|
+
var _AddSelectSidebar = require("./AddSelectSidebar");
|
35
|
+
|
36
|
+
var _AddSelectBreadcrumbs = require("./AddSelectBreadcrumbs");
|
37
|
+
|
38
|
+
var _AddSelectList = require("./AddSelectList");
|
39
|
+
|
40
|
+
var _excluded = ["className", "description", "influencerTitle", "inputPlaceholder", "items", "itemsLabel", "multi", "noResultsDescription", "noResultsTitle", "noSelectionDescription", "noSelectionTitle", "onClose", "onCloseButtonText", "onSearchFilter", "onSubmit", "onSubmitButtonText", "open", "title"];
|
33
41
|
|
34
42
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
35
43
|
|
@@ -37,97 +45,180 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
37
45
|
|
38
46
|
var componentName = 'AddSelect';
|
39
47
|
var AddSelect = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
40
|
-
var
|
41
|
-
|
48
|
+
var _cx;
|
49
|
+
|
50
|
+
var className = _ref.className,
|
42
51
|
description = _ref.description,
|
43
52
|
influencerTitle = _ref.influencerTitle,
|
44
53
|
inputPlaceholder = _ref.inputPlaceholder,
|
45
54
|
items = _ref.items,
|
46
55
|
itemsLabel = _ref.itemsLabel,
|
47
|
-
|
56
|
+
multi = _ref.multi,
|
57
|
+
noResultsDescription = _ref.noResultsDescription,
|
58
|
+
noResultsTitle = _ref.noResultsTitle,
|
48
59
|
noSelectionDescription = _ref.noSelectionDescription,
|
49
60
|
noSelectionTitle = _ref.noSelectionTitle,
|
61
|
+
onClose = _ref.onClose,
|
62
|
+
onCloseButtonText = _ref.onCloseButtonText,
|
63
|
+
onSearchFilter = _ref.onSearchFilter,
|
64
|
+
onSubmit = _ref.onSubmit,
|
65
|
+
onSubmitButtonText = _ref.onSubmitButtonText,
|
50
66
|
open = _ref.open,
|
51
67
|
title = _ref.title,
|
52
68
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
53
|
-
var blockClass = "".concat(_settings.pkg.prefix, "--add-select");
|
69
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--add-select"); // hooks
|
54
70
|
|
55
|
-
var _useState = (0, _react.useState)(
|
56
|
-
_useState2 = (0, _slicedToArray2.default)(_useState,
|
57
|
-
|
71
|
+
var _useState = (0, _react.useState)([]),
|
72
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
73
|
+
path = _useState2[0],
|
74
|
+
setPath = _useState2[1];
|
58
75
|
|
59
|
-
var
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
76
|
+
var _useState3 = (0, _react.useState)(''),
|
77
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
78
|
+
singleSelection = _useState4[0],
|
79
|
+
setSingleSelection = _useState4[1];
|
80
|
+
|
81
|
+
var _useState5 = (0, _react.useState)([]),
|
82
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
83
|
+
multiSelection = _useState6[0],
|
84
|
+
setMultiSelection = _useState6[1];
|
85
|
+
|
86
|
+
var _useState7 = (0, _react.useState)(''),
|
87
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
88
|
+
searchTerm = _useState8[0],
|
89
|
+
setSearchTerm = _useState8[1]; // handlers
|
90
|
+
|
91
|
+
|
92
|
+
var handleSearch = function handleSearch(e) {
|
93
|
+
setSearchTerm(e.target.value);
|
94
|
+
}; // item filtering
|
95
|
+
|
96
|
+
|
97
|
+
var getFilteredItems = function getFilteredItems() {
|
98
|
+
var hasPath = path.length > 0;
|
99
|
+
/**
|
100
|
+
* how to traverse the levels of items-
|
101
|
+
* the path represents the ids of each level / item / breadcrumb
|
102
|
+
* using this path we can drill down into the items until we get to the last one the user selected
|
103
|
+
*/
|
104
|
+
|
105
|
+
var itemsToFilter = hasPath ? path.reduce(function (prev, cur) {
|
106
|
+
return prev.find(function (item) {
|
107
|
+
return item.id === cur.id;
|
108
|
+
}).children;
|
109
|
+
}, items) : items;
|
110
|
+
var results = itemsToFilter.filter(function (item) {
|
111
|
+
if (!searchTerm) {
|
112
|
+
return item;
|
113
|
+
} // if user provides their own filter function use that
|
114
|
+
|
115
|
+
|
116
|
+
if (onSearchFilter) {
|
117
|
+
return onSearchFilter(item, searchTerm);
|
118
|
+
} // otherwise use the default label filter
|
119
|
+
|
120
|
+
|
121
|
+
return item.label.toLowerCase().includes(searchTerm);
|
122
|
+
});
|
123
|
+
return results;
|
65
124
|
};
|
66
125
|
|
67
|
-
var
|
68
|
-
className: "".concat(blockClass, "__influencer")
|
69
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
70
|
-
className: "".concat(blockClass, "__influencer-header")
|
71
|
-
}, /*#__PURE__*/_react.default.createElement("p", {
|
72
|
-
className: "".concat(blockClass, "__influencer-title")
|
73
|
-
}, influencerTitle), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Tag, {
|
74
|
-
type: "gray",
|
75
|
-
size: "sm"
|
76
|
-
}, selected)), /*#__PURE__*/_react.default.createElement("div", {
|
77
|
-
className: "".concat(blockClass, "__influencer-body")
|
78
|
-
}, selected > 0 ? /*#__PURE__*/_react.default.createElement("p", null, "content") : /*#__PURE__*/_react.default.createElement(_NoDataEmptyState.NoDataEmptyState, {
|
79
|
-
subtitle: noSelectionDescription,
|
80
|
-
title: noSelectionTitle,
|
81
|
-
size: "sm"
|
82
|
-
})));
|
126
|
+
var filteredItems = getFilteredItems(); // main content
|
83
127
|
|
84
128
|
var body = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
85
129
|
className: "".concat(blockClass, "__header")
|
86
130
|
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.TextInput, {
|
87
131
|
id: "temp-id",
|
88
132
|
labelText: "temp label",
|
89
|
-
placeholder: inputPlaceholder
|
133
|
+
placeholder: inputPlaceholder,
|
134
|
+
value: searchTerm,
|
135
|
+
onChange: handleSearch
|
90
136
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
91
137
|
className: "".concat(blockClass, "__items-label-container")
|
92
|
-
}, /*#__PURE__*/_react.default.createElement(
|
138
|
+
}, path.length ? /*#__PURE__*/_react.default.createElement(_AddSelectBreadcrumbs.AddSelectBreadcrumbs, {
|
139
|
+
itemsLabel: itemsLabel,
|
140
|
+
path: path,
|
141
|
+
setPath: setPath
|
142
|
+
}) : /*#__PURE__*/_react.default.createElement("p", {
|
93
143
|
className: "".concat(blockClass, "__items-label")
|
94
144
|
}, itemsLabel), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Tag, {
|
95
145
|
type: "gray",
|
96
|
-
size: "sm"
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
146
|
+
size: "sm",
|
147
|
+
className: "".concat(blockClass, "__items-label-tag")
|
148
|
+
}, filteredItems.length))), filteredItems.length > 0 ? /*#__PURE__*/_react.default.createElement(_AddSelectList.AddSelectList, {
|
149
|
+
filteredItems: filteredItems,
|
150
|
+
multi: multi,
|
151
|
+
multiSelection: multiSelection,
|
152
|
+
path: path,
|
153
|
+
setMultiSelection: setMultiSelection,
|
154
|
+
setPath: setPath,
|
155
|
+
setSingleSelection: setSingleSelection,
|
156
|
+
singleSelection: singleSelection
|
157
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
158
|
+
className: "".concat(blockClass, "__body")
|
159
|
+
}, /*#__PURE__*/_react.default.createElement(_NoDataEmptyState.NoDataEmptyState, {
|
160
|
+
subtitle: noResultsDescription,
|
161
|
+
title: noResultsTitle
|
162
|
+
})));
|
105
163
|
|
164
|
+
var commonTearsheetProps = {
|
165
|
+
open: open,
|
166
|
+
title: title,
|
167
|
+
description: description,
|
168
|
+
closeIconDescription: 'temp description',
|
169
|
+
actions: [{
|
170
|
+
label: onCloseButtonText,
|
171
|
+
kind: 'secondary',
|
172
|
+
onClick: onClose
|
173
|
+
}, {
|
174
|
+
label: onSubmitButtonText,
|
175
|
+
kind: 'primary',
|
176
|
+
onClick: onSubmit,
|
177
|
+
disabled: multi ? multiSelection.length === 0 : !singleSelection
|
178
|
+
}]
|
179
|
+
};
|
180
|
+
var sidebarProps = {
|
181
|
+
influencerTitle: influencerTitle,
|
182
|
+
items: items,
|
183
|
+
multiSelection: multiSelection,
|
184
|
+
noSelectionDescription: noSelectionDescription,
|
185
|
+
noSelectionTitle: noSelectionTitle
|
186
|
+
};
|
187
|
+
var classNames = (0, _classnames.default)(className, blockClass, (_cx = {}, (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__single"), !multi), (0, _defineProperty2.default)(_cx, "".concat(blockClass, "__multi"), multi), _cx));
|
106
188
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
107
189
|
ref: ref,
|
108
|
-
className:
|
109
|
-
}, rest),
|
110
|
-
influencer:
|
190
|
+
className: classNames
|
191
|
+
}, rest), multi ? /*#__PURE__*/_react.default.createElement(_Tearsheet.Tearsheet, (0, _extends2.default)({}, commonTearsheetProps, {
|
192
|
+
influencer: multi && /*#__PURE__*/_react.default.createElement(_AddSelectSidebar.AddSelectSidebar, sidebarProps),
|
111
193
|
influencerPosition: "right"
|
112
194
|
}), body) : /*#__PURE__*/_react.default.createElement(_Tearsheet.TearsheetNarrow, commonTearsheetProps, body));
|
113
195
|
});
|
114
196
|
exports.AddSelect = AddSelect;
|
115
|
-
exports.AddSelect = AddSelect = _settings.pkg.checkComponentEnabled(AddSelect, componentName);
|
116
|
-
AddSelect.displayName = componentName;
|
117
197
|
AddSelect.propTypes = {
|
118
|
-
actions: _propTypes.default.array,
|
119
198
|
className: _propTypes.default.string,
|
120
199
|
description: _propTypes.default.string,
|
121
200
|
influencerTitle: _propTypes.default.string,
|
122
201
|
inputPlaceholder: _propTypes.default.string,
|
123
|
-
items: _propTypes.default.
|
202
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape({
|
203
|
+
id: _propTypes.default.string.isRequired,
|
204
|
+
label: _propTypes.default.string.isRequired,
|
205
|
+
value: _propTypes.default.string.isRequired
|
206
|
+
})),
|
124
207
|
itemsLabel: _propTypes.default.string,
|
125
|
-
|
208
|
+
multi: _propTypes.default.bool,
|
209
|
+
noResultsDescription: _propTypes.default.string,
|
210
|
+
noResultsTitle: _propTypes.default.string,
|
126
211
|
noSelectionDescription: _propTypes.default.string,
|
127
212
|
noSelectionTitle: _propTypes.default.string,
|
213
|
+
onClose: _propTypes.default.func,
|
214
|
+
onCloseButtonText: _propTypes.default.string,
|
215
|
+
onSearchFilter: _propTypes.default.func,
|
216
|
+
onSubmit: _propTypes.default.func,
|
217
|
+
onSubmitButtonText: _propTypes.default.string,
|
128
218
|
open: _propTypes.default.bool,
|
129
219
|
title: _propTypes.default.string
|
130
220
|
};
|
131
221
|
AddSelect.defaultProps = {
|
132
222
|
items: []
|
133
|
-
};
|
223
|
+
};
|
224
|
+
AddSelect.displayName = componentName;
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.AddSelectBreadcrumbs = void 0;
|
9
|
+
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
11
|
+
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
14
|
+
var _carbonComponentsReact = require("carbon-components-react");
|
15
|
+
|
16
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
17
|
+
|
18
|
+
//
|
19
|
+
// Copyright IBM Corp. 2022
|
20
|
+
//
|
21
|
+
// This source code is licensed under the Apache-2.0 license found in the
|
22
|
+
// LICENSE file in the root directory of this source tree.
|
23
|
+
//
|
24
|
+
var componentName = 'AddSelectBreadcrumbs';
|
25
|
+
|
26
|
+
var AddSelectBreadcrumbs = function AddSelectBreadcrumbs(_ref) {
|
27
|
+
var itemsLabel = _ref.itemsLabel,
|
28
|
+
path = _ref.path,
|
29
|
+
setPath = _ref.setPath;
|
30
|
+
|
31
|
+
var clickHandler = function clickHandler(id) {
|
32
|
+
var newPath = (0, _toConsumableArray2.default)(path);
|
33
|
+
var pathIdx = newPath.findIndex(function (entry) {
|
34
|
+
return entry.id === id;
|
35
|
+
});
|
36
|
+
var finalPath = newPath.splice(0, pathIdx + 1);
|
37
|
+
setPath(finalPath);
|
38
|
+
};
|
39
|
+
|
40
|
+
var resetPath = function resetPath() {
|
41
|
+
setPath([]);
|
42
|
+
};
|
43
|
+
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Breadcrumb, {
|
45
|
+
noTrailingSlash: true
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.BreadcrumbItem, {
|
47
|
+
onClick: resetPath
|
48
|
+
}, itemsLabel), path.map(function (entry, idx, arr) {
|
49
|
+
var isCurrentPage = idx === arr.length - 1;
|
50
|
+
|
51
|
+
var crumbHandler = function crumbHandler() {
|
52
|
+
if (!isCurrentPage) {
|
53
|
+
clickHandler(entry.id);
|
54
|
+
}
|
55
|
+
};
|
56
|
+
|
57
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.BreadcrumbItem, {
|
58
|
+
key: entry.id,
|
59
|
+
isCurrentPage: isCurrentPage,
|
60
|
+
onClick: crumbHandler
|
61
|
+
}, entry.label);
|
62
|
+
}));
|
63
|
+
};
|
64
|
+
|
65
|
+
exports.AddSelectBreadcrumbs = AddSelectBreadcrumbs;
|
66
|
+
AddSelectBreadcrumbs.propTypes = {
|
67
|
+
itemsLabel: _propTypes.default.string,
|
68
|
+
path: _propTypes.default.array,
|
69
|
+
setPath: _propTypes.default.func
|
70
|
+
};
|
71
|
+
AddSelectBreadcrumbs.displayName = componentName;
|