@carbon/ibm-products 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +206 -44
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-without-carbon-released-only.css +31 -27
- 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.css +193 -39
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -3
- package/css/index.css +195 -41
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -3
- package/es/components/AddSelect/AddSelect.js +106 -65
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +56 -0
- package/es/components/AddSelect/AddSelectList.js +94 -0
- package/es/components/AddSelect/AddSelectSidebar.js +46 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -2
- package/es/components/CancelableTextEdit/CancelableTextEdit.js +2 -2
- package/es/components/Card/Card.js +6 -4
- package/es/components/InlineEdit/InlineEdit.js +223 -74
- package/es/components/NotificationsPanel/NotificationsPanel.js +16 -3
- package/es/components/PageHeader/PageHeader.js +7 -4
- package/es/components/PageHeader/PageHeaderTitle.js +10 -6
- package/es/components/SidePanel/SidePanel.js +32 -15
- package/es/components/WebTerminal/WebTerminal.js +1 -1
- package/es/settings.js +0 -5
- package/lib/components/AddSelect/AddSelect.js +110 -65
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +71 -0
- package/lib/components/AddSelect/AddSelectList.js +112 -0
- package/lib/components/AddSelect/AddSelectSidebar.js +63 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -2
- package/lib/components/CancelableTextEdit/CancelableTextEdit.js +1 -1
- package/lib/components/Card/Card.js +6 -4
- package/lib/components/InlineEdit/InlineEdit.js +219 -72
- package/lib/components/NotificationsPanel/NotificationsPanel.js +13 -1
- package/lib/components/PageHeader/PageHeader.js +7 -4
- package/lib/components/PageHeader/PageHeaderTitle.js +10 -6
- package/lib/components/SidePanel/SidePanel.js +32 -15
- package/lib/components/WebTerminal/WebTerminal.js +1 -1
- package/lib/settings.js +0 -6
- package/package.json +12 -12
- package/scss/components/AddSelect/_add-select.scss +24 -0
- package/scss/components/BreadcrumbWithOverflow/_index.scss +1 -1
- package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +1 -0
- package/scss/components/CreateInfluencer/_create-influencer.scss +4 -4
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -2
- package/scss/components/InlineEdit/_inline-edit.scss +210 -9
- package/scss/components/InlineEdit/_storybook-styles.scss +13 -0
- package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -2
- package/scss/components/PageHeader/_index.scss +1 -1
- package/scss/components/PageHeader/_page-header.scss +1 -1
- package/scss/components/ProductiveCard/_productive-card.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +15 -6
- package/scss/components/StatusIcon/_index.scss +1 -1
- package/scss/components/TagSet/_index.scss +1 -1
- package/scss/components/UserProfileImage/_index.scss +1 -1
- package/scss/components/WebTerminal/_web-terminal.scss +2 -2
- package/scss/global/styles/_project-settings.scss +5 -1
- package/es/generated/feature-flags/feature-flags.js +0 -15
- package/lib/generated/feature-flags/feature-flags.js +0 -22
- package/scss/generated/feature-flags/_feature-flags.scss +0 -19
@@ -1,9 +1,10 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
var _excluded = ["
|
5
|
+
var _excluded = ["className", "description", "influencerTitle", "inputPlaceholder", "items", "itemsLabel", "multi", "noResultsDescription", "noResultsTitle", "noSelectionDescription", "noSelectionTitle", "onClose", "onCloseButtonText", "onSearchFilter", "onSubmit", "onSubmitButtonText", "open", "title"];
|
5
6
|
//
|
6
|
-
// Copyright IBM Corp.
|
7
|
+
// Copyright IBM Corp. 2022
|
7
8
|
//
|
8
9
|
// This source code is licensed under the Apache-2.0 license found in the
|
9
10
|
// LICENSE file in the root directory of this source tree.
|
@@ -11,15 +12,18 @@ var _excluded = ["actions", "className", "description", "influencerTitle", "inpu
|
|
11
12
|
import React, { forwardRef, useState } from 'react';
|
12
13
|
import PropTypes from 'prop-types';
|
13
14
|
import cx from 'classnames';
|
14
|
-
import {
|
15
|
-
TextInput, Tag } from 'carbon-components-react';
|
15
|
+
import { TextInput, Tag } from 'carbon-components-react';
|
16
16
|
import { Tearsheet, TearsheetNarrow } from '../../components/Tearsheet';
|
17
17
|
import { NoDataEmptyState } from '../../components/EmptyStates/NoDataEmptyState';
|
18
18
|
import { pkg } from '../../settings';
|
19
|
+
import { AddSelectSidebar } from './AddSelectSidebar';
|
20
|
+
import { AddSelectBreadcrumbs } from './AddSelectBreadcrumbs';
|
21
|
+
import { AddSelectList } from './AddSelectList';
|
19
22
|
var componentName = 'AddSelect';
|
20
23
|
export var AddSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
21
|
-
var
|
22
|
-
|
24
|
+
var _cx;
|
25
|
+
|
26
|
+
var className = _ref.className,
|
23
27
|
description = _ref.description,
|
24
28
|
influencerTitle = _ref.influencerTitle,
|
25
29
|
inputPlaceholder = _ref.inputPlaceholder,
|
@@ -30,70 +34,73 @@ export var AddSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
30
34
|
noResultsTitle = _ref.noResultsTitle,
|
31
35
|
noSelectionDescription = _ref.noSelectionDescription,
|
32
36
|
noSelectionTitle = _ref.noSelectionTitle,
|
37
|
+
onClose = _ref.onClose,
|
38
|
+
onCloseButtonText = _ref.onCloseButtonText,
|
33
39
|
onSearchFilter = _ref.onSearchFilter,
|
40
|
+
onSubmit = _ref.onSubmit,
|
41
|
+
onSubmitButtonText = _ref.onSubmitButtonText,
|
34
42
|
open = _ref.open,
|
35
43
|
title = _ref.title,
|
36
44
|
rest = _objectWithoutProperties(_ref, _excluded);
|
37
45
|
|
38
|
-
var blockClass = "".concat(pkg.prefix, "--add-select");
|
39
|
-
var commonTearsheetProps = {
|
40
|
-
open: open,
|
41
|
-
title: title,
|
42
|
-
actions: actions,
|
43
|
-
description: description,
|
44
|
-
closeIconDescription: 'temp description'
|
45
|
-
}; // hooks
|
46
|
+
var blockClass = "".concat(pkg.prefix, "--add-select"); // hooks
|
46
47
|
|
47
|
-
var _useState = useState(
|
48
|
-
_useState2 = _slicedToArray(_useState,
|
49
|
-
|
48
|
+
var _useState = useState([]),
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
50
|
+
path = _useState2[0],
|
51
|
+
setPath = _useState2[1];
|
50
52
|
|
51
53
|
var _useState3 = useState(''),
|
52
54
|
_useState4 = _slicedToArray(_useState3, 2),
|
53
|
-
|
54
|
-
|
55
|
+
singleSelection = _useState4[0],
|
56
|
+
setSingleSelection = _useState4[1];
|
55
57
|
|
58
|
+
var _useState5 = useState([]),
|
59
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
60
|
+
multiSelection = _useState6[0],
|
61
|
+
setMultiSelection = _useState6[1];
|
56
62
|
|
57
|
-
var
|
58
|
-
|
59
|
-
|
63
|
+
var _useState7 = useState(''),
|
64
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
65
|
+
searchTerm = _useState8[0],
|
66
|
+
setSearchTerm = _useState8[1]; // handlers
|
60
67
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}; //
|
68
|
+
|
69
|
+
var handleSearch = function handleSearch(e) {
|
70
|
+
setSearchTerm(e.target.value);
|
71
|
+
}; // item filtering
|
65
72
|
|
66
73
|
|
67
74
|
var getFilteredItems = function getFilteredItems() {
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
75
|
+
var hasPath = path.length > 0;
|
76
|
+
/**
|
77
|
+
* how to traverse the levels of items-
|
78
|
+
* the path represents the ids of each level / item / breadcrumb
|
79
|
+
* using this path we can drill down into the items until we get to the last one the user selected
|
80
|
+
*/
|
81
|
+
|
82
|
+
var itemsToFilter = hasPath ? path.reduce(function (prev, cur) {
|
83
|
+
return prev.find(function (item) {
|
84
|
+
return item.id === cur.id;
|
85
|
+
}).children;
|
86
|
+
}, items) : items;
|
87
|
+
var results = itemsToFilter.filter(function (item) {
|
88
|
+
if (!searchTerm) {
|
89
|
+
return item;
|
90
|
+
} // if user provides their own filter function use that
|
91
|
+
|
92
|
+
|
93
|
+
if (onSearchFilter) {
|
94
|
+
return onSearchFilter(item, searchTerm);
|
95
|
+
} // otherwise use the default label filter
|
72
96
|
|
73
97
|
|
74
|
-
|
75
|
-
return i.label.includes(searchTerm);
|
98
|
+
return item.label.toLowerCase().includes(searchTerm);
|
76
99
|
});
|
100
|
+
return results;
|
77
101
|
};
|
78
102
|
|
79
|
-
var
|
80
|
-
|
81
|
-
var influencer = /*#__PURE__*/React.createElement("div", {
|
82
|
-
className: "".concat(blockClass, "__influencer")
|
83
|
-
}, /*#__PURE__*/React.createElement("div", {
|
84
|
-
className: "".concat(blockClass, "__influencer-header")
|
85
|
-
}, /*#__PURE__*/React.createElement("p", {
|
86
|
-
className: "".concat(blockClass, "__influencer-title")
|
87
|
-
}, influencerTitle), /*#__PURE__*/React.createElement(Tag, {
|
88
|
-
type: "gray",
|
89
|
-
size: "sm"
|
90
|
-
}, selected)), /*#__PURE__*/React.createElement("div", {
|
91
|
-
className: "".concat(blockClass, "__influencer-body")
|
92
|
-
}, selected > 0 ? /*#__PURE__*/React.createElement("p", null, "content") : /*#__PURE__*/React.createElement(NoDataEmptyState, {
|
93
|
-
subtitle: noSelectionDescription,
|
94
|
-
title: noSelectionTitle,
|
95
|
-
size: "sm"
|
96
|
-
}))); // main content
|
103
|
+
var filteredItems = getFilteredItems(); // main content
|
97
104
|
|
98
105
|
var body = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
99
106
|
className: "".concat(blockClass, "__header")
|
@@ -102,44 +109,74 @@ export var AddSelect = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
102
109
|
labelText: "temp label",
|
103
110
|
placeholder: inputPlaceholder,
|
104
111
|
value: searchTerm,
|
105
|
-
onChange:
|
112
|
+
onChange: handleSearch
|
106
113
|
}), /*#__PURE__*/React.createElement("div", {
|
107
114
|
className: "".concat(blockClass, "__items-label-container")
|
108
|
-
}, /*#__PURE__*/React.createElement(
|
115
|
+
}, path.length ? /*#__PURE__*/React.createElement(AddSelectBreadcrumbs, {
|
116
|
+
itemsLabel: itemsLabel,
|
117
|
+
path: path,
|
118
|
+
setPath: setPath
|
119
|
+
}) : /*#__PURE__*/React.createElement("p", {
|
109
120
|
className: "".concat(blockClass, "__items-label")
|
110
121
|
}, itemsLabel), /*#__PURE__*/React.createElement(Tag, {
|
111
122
|
type: "gray",
|
112
|
-
size: "sm"
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
123
|
+
size: "sm",
|
124
|
+
className: "".concat(blockClass, "__items-label-tag")
|
125
|
+
}, filteredItems.length))), filteredItems.length > 0 ? /*#__PURE__*/React.createElement(AddSelectList, {
|
126
|
+
filteredItems: filteredItems,
|
127
|
+
multi: multi,
|
128
|
+
multiSelection: multiSelection,
|
129
|
+
path: path,
|
130
|
+
setMultiSelection: setMultiSelection,
|
131
|
+
setPath: setPath,
|
132
|
+
setSingleSelection: setSingleSelection,
|
133
|
+
singleSelection: singleSelection
|
134
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
121
135
|
className: "".concat(blockClass, "__body")
|
122
136
|
}, /*#__PURE__*/React.createElement(NoDataEmptyState, {
|
123
137
|
subtitle: noResultsDescription,
|
124
138
|
title: noResultsTitle
|
125
139
|
})));
|
140
|
+
var commonTearsheetProps = {
|
141
|
+
open: open,
|
142
|
+
title: title,
|
143
|
+
description: description,
|
144
|
+
closeIconDescription: 'temp description',
|
145
|
+
actions: [{
|
146
|
+
label: onCloseButtonText,
|
147
|
+
kind: 'secondary',
|
148
|
+
onClick: onClose
|
149
|
+
}, {
|
150
|
+
label: onSubmitButtonText,
|
151
|
+
kind: 'primary',
|
152
|
+
onClick: onSubmit,
|
153
|
+
disabled: multi ? multiSelection.length === 0 : !singleSelection
|
154
|
+
}]
|
155
|
+
};
|
156
|
+
var sidebarProps = {
|
157
|
+
influencerTitle: influencerTitle,
|
158
|
+
multiSelection: multiSelection,
|
159
|
+
noSelectionDescription: noSelectionDescription,
|
160
|
+
noSelectionTitle: noSelectionTitle
|
161
|
+
};
|
162
|
+
var classNames = cx(className, blockClass, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__single"), !multi), _defineProperty(_cx, "".concat(blockClass, "__multi"), multi), _cx));
|
126
163
|
return /*#__PURE__*/React.createElement("div", _extends({
|
127
164
|
ref: ref,
|
128
|
-
className:
|
165
|
+
className: classNames
|
129
166
|
}, rest), multi ? /*#__PURE__*/React.createElement(Tearsheet, _extends({}, commonTearsheetProps, {
|
130
|
-
influencer: multi &&
|
167
|
+
influencer: multi && /*#__PURE__*/React.createElement(AddSelectSidebar, sidebarProps),
|
131
168
|
influencerPosition: "right"
|
132
169
|
}), body) : /*#__PURE__*/React.createElement(TearsheetNarrow, commonTearsheetProps, body));
|
133
170
|
});
|
134
171
|
AddSelect.propTypes = {
|
135
|
-
actions: PropTypes.array,
|
136
172
|
className: PropTypes.string,
|
137
173
|
description: PropTypes.string,
|
138
174
|
influencerTitle: PropTypes.string,
|
139
175
|
inputPlaceholder: PropTypes.string,
|
140
176
|
items: PropTypes.arrayOf(PropTypes.shape({
|
177
|
+
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
141
178
|
label: PropTypes.string,
|
142
|
-
|
179
|
+
value: PropTypes.string
|
143
180
|
})),
|
144
181
|
itemsLabel: PropTypes.string,
|
145
182
|
multi: PropTypes.bool,
|
@@ -147,7 +184,11 @@ AddSelect.propTypes = {
|
|
147
184
|
noResultsTitle: PropTypes.string,
|
148
185
|
noSelectionDescription: PropTypes.string,
|
149
186
|
noSelectionTitle: PropTypes.string,
|
187
|
+
onClose: PropTypes.func,
|
188
|
+
onCloseButtonText: PropTypes.string,
|
150
189
|
onSearchFilter: PropTypes.func,
|
190
|
+
onSubmit: PropTypes.func,
|
191
|
+
onSubmitButtonText: PropTypes.string,
|
151
192
|
open: PropTypes.bool,
|
152
193
|
title: PropTypes.string
|
153
194
|
};
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
2
|
+
//
|
3
|
+
// Copyright IBM Corp. 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
|
+
//
|
8
|
+
import React from 'react';
|
9
|
+
import { Breadcrumb, BreadcrumbItem } from 'carbon-components-react';
|
10
|
+
import PropTypes from 'prop-types';
|
11
|
+
var componentName = 'AddSelectBreadcrumbs';
|
12
|
+
export var AddSelectBreadcrumbs = function AddSelectBreadcrumbs(_ref) {
|
13
|
+
var itemsLabel = _ref.itemsLabel,
|
14
|
+
path = _ref.path,
|
15
|
+
setPath = _ref.setPath;
|
16
|
+
|
17
|
+
var clickHandler = function clickHandler(id) {
|
18
|
+
var newPath = _toConsumableArray(path);
|
19
|
+
|
20
|
+
var pathIdx = newPath.findIndex(function (entry) {
|
21
|
+
return entry.id === id;
|
22
|
+
});
|
23
|
+
var finalPath = newPath.splice(0, pathIdx + 1);
|
24
|
+
setPath(finalPath);
|
25
|
+
};
|
26
|
+
|
27
|
+
var resetPath = function resetPath() {
|
28
|
+
setPath([]);
|
29
|
+
};
|
30
|
+
|
31
|
+
return /*#__PURE__*/React.createElement(Breadcrumb, {
|
32
|
+
noTrailingSlash: true
|
33
|
+
}, /*#__PURE__*/React.createElement(BreadcrumbItem, {
|
34
|
+
onClick: resetPath
|
35
|
+
}, itemsLabel), path.map(function (entry, idx, arr) {
|
36
|
+
var isCurrentPage = idx === arr.length - 1;
|
37
|
+
|
38
|
+
var crumbHandler = function crumbHandler() {
|
39
|
+
if (!isCurrentPage) {
|
40
|
+
clickHandler(entry.id);
|
41
|
+
}
|
42
|
+
};
|
43
|
+
|
44
|
+
return /*#__PURE__*/React.createElement(BreadcrumbItem, {
|
45
|
+
key: entry.id,
|
46
|
+
isCurrentPage: isCurrentPage,
|
47
|
+
onClick: crumbHandler
|
48
|
+
}, entry.label);
|
49
|
+
}));
|
50
|
+
};
|
51
|
+
AddSelectBreadcrumbs.propTypes = {
|
52
|
+
itemsLabel: PropTypes.string,
|
53
|
+
path: PropTypes.array,
|
54
|
+
setPath: PropTypes.func
|
55
|
+
};
|
56
|
+
AddSelectBreadcrumbs.displayName = componentName;
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
2
|
+
//
|
3
|
+
// Copyright IBM Corp. 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
|
+
//
|
8
|
+
import React from 'react';
|
9
|
+
import { Checkbox, RadioButton, StructuredListRow, StructuredListWrapper, StructuredListBody, StructuredListCell } from 'carbon-components-react';
|
10
|
+
import { ChevronRight16 } from '@carbon/icons-react';
|
11
|
+
import PropTypes from 'prop-types';
|
12
|
+
import { pkg } from '../../settings';
|
13
|
+
var componentName = 'AddSelectList';
|
14
|
+
export var AddSelectList = function AddSelectList(_ref) {
|
15
|
+
var filteredItems = _ref.filteredItems,
|
16
|
+
multi = _ref.multi,
|
17
|
+
multiSelection = _ref.multiSelection,
|
18
|
+
path = _ref.path,
|
19
|
+
setMultiSelection = _ref.setMultiSelection,
|
20
|
+
setPath = _ref.setPath,
|
21
|
+
setSingleSelection = _ref.setSingleSelection,
|
22
|
+
singleSelection = _ref.singleSelection;
|
23
|
+
var blockClass = "".concat(pkg.prefix, "--add-select__selections");
|
24
|
+
|
25
|
+
var handleSingleSelection = function handleSingleSelection(value) {
|
26
|
+
setSingleSelection(value);
|
27
|
+
};
|
28
|
+
|
29
|
+
var handleMultiSelection = function handleMultiSelection(value, checked) {
|
30
|
+
if (checked) {
|
31
|
+
var newValues = [].concat(_toConsumableArray(multiSelection), [value]);
|
32
|
+
setMultiSelection(newValues);
|
33
|
+
} else {
|
34
|
+
var _newValues = multiSelection.filter(function (v) {
|
35
|
+
return v !== value;
|
36
|
+
});
|
37
|
+
|
38
|
+
setMultiSelection(_newValues);
|
39
|
+
}
|
40
|
+
};
|
41
|
+
|
42
|
+
var onNavigateItem = function onNavigateItem(_ref2) {
|
43
|
+
var id = _ref2.id,
|
44
|
+
label = _ref2.label;
|
45
|
+
setPath([].concat(_toConsumableArray(path), [{
|
46
|
+
id: id,
|
47
|
+
label: label
|
48
|
+
}]));
|
49
|
+
};
|
50
|
+
|
51
|
+
return /*#__PURE__*/React.createElement("div", {
|
52
|
+
className: "".concat(blockClass, "-wrapper")
|
53
|
+
}, /*#__PURE__*/React.createElement(StructuredListWrapper, {
|
54
|
+
selection: true,
|
55
|
+
className: "".concat(blockClass)
|
56
|
+
}, /*#__PURE__*/React.createElement(StructuredListBody, null, filteredItems.map(function (item) {
|
57
|
+
return /*#__PURE__*/React.createElement(StructuredListRow, {
|
58
|
+
key: item.id
|
59
|
+
}, /*#__PURE__*/React.createElement(StructuredListCell, null, /*#__PURE__*/React.createElement("div", {
|
60
|
+
className: "".concat(blockClass, "-cell-wrapper")
|
61
|
+
}, multi ? /*#__PURE__*/React.createElement(Checkbox, {
|
62
|
+
className: "".concat(blockClass, "-checkbox"),
|
63
|
+
onChange: function onChange(value) {
|
64
|
+
return handleMultiSelection(item.value, value);
|
65
|
+
},
|
66
|
+
labelText: item.label,
|
67
|
+
id: item.id,
|
68
|
+
checked: multiSelection.includes(item.value)
|
69
|
+
}) : /*#__PURE__*/React.createElement(RadioButton, {
|
70
|
+
className: "".concat(blockClass, "-radio"),
|
71
|
+
name: "add-select-selections",
|
72
|
+
id: item.id,
|
73
|
+
value: item.value,
|
74
|
+
labelText: item.label,
|
75
|
+
onChange: handleSingleSelection,
|
76
|
+
selected: item.value === singleSelection
|
77
|
+
}), item.children && /*#__PURE__*/React.createElement(ChevronRight16, {
|
78
|
+
onClick: function onClick() {
|
79
|
+
return onNavigateItem(item);
|
80
|
+
}
|
81
|
+
}))));
|
82
|
+
}))));
|
83
|
+
};
|
84
|
+
AddSelectList.propTypes = {
|
85
|
+
filteredItems: PropTypes.array,
|
86
|
+
multi: PropTypes.bool,
|
87
|
+
multiSelection: PropTypes.array,
|
88
|
+
path: PropTypes.array,
|
89
|
+
setMultiSelection: PropTypes.func,
|
90
|
+
setPath: PropTypes.func,
|
91
|
+
setSingleSelection: PropTypes.func,
|
92
|
+
singleSelection: PropTypes.string
|
93
|
+
};
|
94
|
+
AddSelectList.displayName = componentName;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 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.
|
6
|
+
//
|
7
|
+
import React from 'react';
|
8
|
+
import { Tag } from 'carbon-components-react';
|
9
|
+
import PropTypes from 'prop-types';
|
10
|
+
import { NoDataEmptyState } from '../../components/EmptyStates/NoDataEmptyState';
|
11
|
+
import { pkg } from '../../settings';
|
12
|
+
var componentName = 'AddSelectSidebar';
|
13
|
+
export var AddSelectSidebar = function AddSelectSidebar(_ref) {
|
14
|
+
var influencerTitle = _ref.influencerTitle,
|
15
|
+
multiSelection = _ref.multiSelection,
|
16
|
+
noSelectionDescription = _ref.noSelectionDescription,
|
17
|
+
noSelectionTitle = _ref.noSelectionTitle;
|
18
|
+
var blockClass = "".concat(pkg.prefix, "--add-select__influencer");
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
20
|
+
className: "".concat(blockClass)
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
22
|
+
className: "".concat(blockClass, "-header")
|
23
|
+
}, /*#__PURE__*/React.createElement("p", {
|
24
|
+
className: "".concat(blockClass, "-title")
|
25
|
+
}, influencerTitle), /*#__PURE__*/React.createElement(Tag, {
|
26
|
+
type: "gray",
|
27
|
+
size: "sm"
|
28
|
+
}, multiSelection.length)), /*#__PURE__*/React.createElement("div", {
|
29
|
+
className: "".concat(blockClass, "-body")
|
30
|
+
}, multiSelection.length > 0 ? multiSelection.map(function (item) {
|
31
|
+
return /*#__PURE__*/React.createElement("p", {
|
32
|
+
key: item
|
33
|
+
}, item);
|
34
|
+
}) : /*#__PURE__*/React.createElement(NoDataEmptyState, {
|
35
|
+
subtitle: noSelectionDescription,
|
36
|
+
title: noSelectionTitle,
|
37
|
+
size: "sm"
|
38
|
+
})));
|
39
|
+
};
|
40
|
+
AddSelectSidebar.propTypes = {
|
41
|
+
influencerTitle: PropTypes.string,
|
42
|
+
multiSelection: PropTypes.array,
|
43
|
+
noSelectionDescription: PropTypes.string,
|
44
|
+
noSelectionTitle: PropTypes.string
|
45
|
+
};
|
46
|
+
AddSelectSidebar.displayName = componentName;
|
@@ -343,9 +343,12 @@ BreadcrumbWithOverflow.propTypes = {
|
|
343
343
|
noTrailingSlash: PropTypes.bool,
|
344
344
|
|
345
345
|
/**
|
346
|
-
* overflowAriaLabel label for open close button overflow used for
|
346
|
+
* overflowAriaLabel label for open close button overflow used for breadcrumb items that do not fit.
|
347
347
|
*/
|
348
|
-
overflowAriaLabel: PropTypes.string.isRequired
|
348
|
+
overflowAriaLabel: PropTypes.string.isRequired.if(function (_ref6) {
|
349
|
+
var breadcrumbs = _ref6.breadcrumbs;
|
350
|
+
return breadcrumbs.length > 1;
|
351
|
+
})
|
349
352
|
};
|
350
353
|
BreadcrumbWithOverflow.defaultProps = {
|
351
354
|
noTrailingSlash: false
|
@@ -23,7 +23,7 @@ import { Button, TextInput } from 'carbon-components-react';
|
|
23
23
|
import { prepareProps } from '../../global/js/utils/props-helper';
|
24
24
|
import { pkg, carbon } from '../../settings';
|
25
25
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
26
|
-
import { Checkmark16,
|
26
|
+
import { Checkmark16, Close16 } from '@carbon/icons-react'; // Carbon and package components we use.
|
27
27
|
|
28
28
|
/* TODO: @import(s) of carbon components and other package components. */
|
29
29
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
@@ -131,7 +131,7 @@ export var CancelableTextEdit = /*#__PURE__*/React.forwardRef(function (_ref, re
|
|
131
131
|
hasIconOnly: true,
|
132
132
|
iconDescription: revertDescription,
|
133
133
|
onClick: handleRevert,
|
134
|
-
renderIcon:
|
134
|
+
renderIcon: Close16
|
135
135
|
}), /*#__PURE__*/React.createElement(Button, {
|
136
136
|
className: "".concat(blockClass, "__save"),
|
137
137
|
kind: "ghost",
|
@@ -2,7 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
4
|
var _excluded = ["actionIcons", "actionsPlacement", "children", "className", "clickZone", "description", "label", "media", "mediaPosition", "onClick", "onKeyDown", "onPrimaryButtonClick", "overflowActions", "onSecondaryButtonClick", "pictogram", "primaryButtonHref", "primaryButtonIcon", "primaryButtonKind", "primaryButtonText", "productive", "secondaryButtonHref", "secondaryButtonIcon", "secondaryButtonKind", "secondaryButtonText", "title", "titleSize"],
|
5
|
-
_excluded2 = ["id"]
|
5
|
+
_excluded2 = ["id"],
|
6
|
+
_excluded3 = ["id", "icon", "onClick", "iconDescription", "onKeyDown", "href"];
|
6
7
|
|
7
8
|
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
|
|
@@ -88,10 +89,11 @@ export var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
88
89
|
onClick = _ref3.onClick,
|
89
90
|
iconDescription = _ref3.iconDescription,
|
90
91
|
onKeyDown = _ref3.onKeyDown,
|
91
|
-
href = _ref3.href
|
92
|
+
href = _ref3.href,
|
93
|
+
rest = _objectWithoutProperties(_ref3, _excluded3);
|
92
94
|
|
93
95
|
if (productive) {
|
94
|
-
return /*#__PURE__*/React.createElement(Button, {
|
96
|
+
return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
|
95
97
|
key: id,
|
96
98
|
renderIcon: Icon,
|
97
99
|
hasIconOnly: true,
|
@@ -100,7 +102,7 @@ export var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
100
102
|
iconDescription: iconDescription,
|
101
103
|
kind: "ghost",
|
102
104
|
href: href
|
103
|
-
});
|
105
|
+
}));
|
104
106
|
}
|
105
107
|
|
106
108
|
if (href) {
|