@carbon/ibm-products 1.37.0 → 1.38.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +11036 -10803
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +2 -2
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +59 -0
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +148 -23
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +3655 -1828
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.js +5 -2
- package/es/components/AddSelect/AddSelectBody.js +41 -22
- package/es/components/AddSelect/AddSelectColumn.js +2 -2
- package/es/components/AddSelect/AddSelectFilter.js +4 -2
- package/es/components/AddSelect/AddSelectList.js +7 -5
- package/es/components/AddSelect/AddSelectMetaPanel.js +7 -0
- package/es/components/AddSelect/AddSelectSidebar.js +4 -1
- package/es/components/AddSelect/add-select-utils.js +7 -0
- package/es/components/AddSelect/hooks/useItemSort.js +7 -0
- package/es/components/AddSelect/hooks/useParentSelect.js +7 -0
- package/es/components/AddSelect/hooks/usePath.js +15 -1
- package/es/components/AddSelect/index.js +1 -1
- package/es/components/InlineEditV1/InlineEditV1.js +0 -3
- package/es/components/InlineEditV2/InlineEditV2.js +0 -1
- package/es/components/MultiAddSelect/MultiAddSelect.js +14 -6
- package/es/components/MultiAddSelect/index.js +7 -0
- package/es/components/SingleAddSelect/SingleAddSelect.js +13 -2
- package/es/components/SingleAddSelect/index.js +7 -0
- package/es/components/index.js +1 -2
- package/es/global/js/package-settings.js +1 -3
- package/lib/components/AddSelect/AddSelect.js +5 -2
- package/lib/components/AddSelect/AddSelectBody.js +40 -21
- package/lib/components/AddSelect/AddSelectColumn.js +2 -2
- package/lib/components/AddSelect/AddSelectFilter.js +4 -2
- package/lib/components/AddSelect/AddSelectList.js +6 -4
- package/lib/components/AddSelect/AddSelectMetaPanel.js +7 -0
- package/lib/components/AddSelect/AddSelectSidebar.js +4 -1
- package/lib/components/AddSelect/add-select-utils.js +7 -0
- package/lib/components/AddSelect/hooks/useItemSort.js +7 -0
- package/lib/components/AddSelect/hooks/useParentSelect.js +7 -0
- package/lib/components/AddSelect/hooks/usePath.js +8 -1
- package/lib/components/InlineEditV1/InlineEditV1.js +1 -4
- package/lib/components/InlineEditV2/InlineEditV2.js +0 -1
- package/lib/components/MultiAddSelect/MultiAddSelect.js +14 -6
- package/lib/components/SingleAddSelect/SingleAddSelect.js +13 -2
- package/lib/components/index.js +1 -8
- package/lib/global/js/package-settings.js +1 -3
- package/package.json +2 -2
- package/scss/components/AddSelect/_add-select.scss +37 -29
- package/scss/components/AddSelect/_index.scss +1 -1
- package/scss/components/AddSelect/_storybook-styles.scss +1 -1
- package/scss/components/MultiAddSelect/_index.scss +7 -0
- package/scss/components/MultiAddSelect/_multi-add-select.scss +7 -0
- package/scss/components/MultiAddSelect/_storybook-styles.scss +1 -1
- package/scss/components/SingleAddSelect/_index.scss +7 -0
- package/scss/components/SingleAddSelect/_single-add-select.scss +7 -0
- package/scss/components/SingleAddSelect/_storybook-styles.scss +1 -1
- package/scss/components/_index-released-only.scss +1 -0
@@ -2,7 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["className", "clearFiltersText", "closeIconDescription", "columnInputPlaceholder", "defaultModifiers", "description", "globalFilterOpts", "globalFiltersIconDescription", "globalFiltersPlaceholderText", "globalFiltersPrimaryButtonText", "globalFiltersSecondaryButtonText", "globalSearchLabel", "globalSearchPlaceholder", "globalSortBy", "influencerTitle", "items", "itemsLabel", "metaIconDescription", "metaPanelTitle", "multi", "navIconDescription", "noResultsDescription", "noResultsTitle", "noSelectionDescription", "noSelectionTitle", "normalizedItems", "onClose", "onCloseButtonText", "onSubmit", "onSubmitButtonText", "open", "portalTarget", "
|
5
|
+
var _excluded = ["className", "clearFiltersText", "closeIconDescription", "columnInputPlaceholder", "defaultModifiers", "description", "globalFilterOpts", "globalFiltersLabel", "globalFiltersIconDescription", "globalFiltersPlaceholderText", "globalFiltersPrimaryButtonText", "globalFiltersSecondaryButtonText", "globalSearchLabel", "globalSearchPlaceholder", "globalSortBy", "illustrationTheme", "influencerTitle", "items", "itemsLabel", "metaIconDescription", "metaPanelTitle", "multi", "navIconDescription", "noResultsDescription", "noResultsTitle", "noSelectionDescription", "noSelectionTitle", "normalizedItems", "onClose", "onCloseButtonText", "onSubmit", "onSubmitButtonText", "open", "portalTarget", "searchResultsTitle", "title", "useNormalizedItems"];
|
6
|
+
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; }
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
8
|
//
|
7
9
|
// Copyright IBM Corp. 2022
|
8
10
|
//
|
@@ -10,7 +12,7 @@ var _excluded = ["className", "clearFiltersText", "closeIconDescription", "colum
|
|
10
12
|
// LICENSE file in the root directory of this source tree.
|
11
13
|
//
|
12
14
|
|
13
|
-
import React, { useState } from 'react';
|
15
|
+
import React, { forwardRef, useState } from 'react';
|
14
16
|
import PropTypes from 'prop-types';
|
15
17
|
import cx from 'classnames';
|
16
18
|
import { Tag } from 'carbon-components-react';
|
@@ -29,7 +31,7 @@ import usePath from './hooks/usePath';
|
|
29
31
|
import { pkg } from '../../settings';
|
30
32
|
var blockClass = "".concat(pkg.prefix, "--add-select");
|
31
33
|
var componentName = 'AddSelectBody';
|
32
|
-
export var AddSelectBody = function
|
34
|
+
export var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
33
35
|
var _cx, _path$;
|
34
36
|
var className = _ref.className,
|
35
37
|
clearFiltersText = _ref.clearFiltersText,
|
@@ -38,6 +40,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
38
40
|
defaultModifiers = _ref.defaultModifiers,
|
39
41
|
description = _ref.description,
|
40
42
|
globalFilterOpts = _ref.globalFilterOpts,
|
43
|
+
globalFiltersLabel = _ref.globalFiltersLabel,
|
41
44
|
globalFiltersIconDescription = _ref.globalFiltersIconDescription,
|
42
45
|
globalFiltersPlaceholderText = _ref.globalFiltersPlaceholderText,
|
43
46
|
globalFiltersPrimaryButtonText = _ref.globalFiltersPrimaryButtonText,
|
@@ -45,6 +48,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
45
48
|
globalSearchLabel = _ref.globalSearchLabel,
|
46
49
|
globalSearchPlaceholder = _ref.globalSearchPlaceholder,
|
47
50
|
globalSortBy = _ref.globalSortBy,
|
51
|
+
illustrationTheme = _ref.illustrationTheme,
|
48
52
|
influencerTitle = _ref.influencerTitle,
|
49
53
|
items = _ref.items,
|
50
54
|
itemsLabel = _ref.itemsLabel,
|
@@ -63,7 +67,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
63
67
|
onSubmitButtonText = _ref.onSubmitButtonText,
|
64
68
|
open = _ref.open,
|
65
69
|
portalTarget = _ref.portalTarget,
|
66
|
-
|
70
|
+
searchResultsTitle = _ref.searchResultsTitle,
|
67
71
|
title = _ref.title,
|
68
72
|
useNormalizedItems = _ref.useNormalizedItems,
|
69
73
|
rest = _objectWithoutProperties(_ref, _excluded);
|
@@ -103,19 +107,25 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
103
107
|
var _usePath = usePath(itemsLabel),
|
104
108
|
path = _usePath.path,
|
105
109
|
setPath = _usePath.setPath,
|
106
|
-
pathOnclick = _usePath.pathOnclick
|
110
|
+
pathOnclick = _usePath.pathOnclick,
|
111
|
+
resetPath = _usePath.resetPath;
|
107
112
|
var resetState = function resetState() {
|
108
113
|
setSingleSelection('');
|
109
114
|
setMultiSelection([]);
|
110
115
|
setSearchTerm('');
|
111
116
|
setAppliedGlobalFilters({});
|
112
117
|
setDisplayMetaPanel({});
|
118
|
+
setAppliedModifiers(defaultModifiers);
|
119
|
+
setSortAttribute('');
|
120
|
+
setSortDirection('');
|
121
|
+
setParentSelected(null);
|
122
|
+
resetPath();
|
113
123
|
};
|
114
124
|
var onCloseHandler = function onCloseHandler() {
|
115
125
|
resetState();
|
116
126
|
onClose();
|
117
127
|
};
|
118
|
-
var
|
128
|
+
var tearsheetClassnames = cx(className, blockClass, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__single"), !multi), _defineProperty(_cx, "".concat(blockClass, "__multi"), multi), _cx));
|
119
129
|
var globalFilterKeys = Object.keys(appliedGlobalFilters);
|
120
130
|
var globalFiltersApplied = globalFilterKeys.length > 0;
|
121
131
|
|
@@ -180,12 +190,11 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
180
190
|
setDisplayMetaPanel: setDisplayMetaPanel,
|
181
191
|
parentId: path[0].id
|
182
192
|
};
|
183
|
-
var commonTearsheetProps = {
|
184
|
-
className:
|
193
|
+
var commonTearsheetProps = _objectSpread(_objectSpread({}, rest), {}, {
|
194
|
+
className: tearsheetClassnames,
|
185
195
|
open: open,
|
186
196
|
title: title,
|
187
197
|
description: description,
|
188
|
-
closeIconDescription: 'temp description',
|
189
198
|
actions: [{
|
190
199
|
label: onCloseButtonText,
|
191
200
|
kind: 'secondary',
|
@@ -196,12 +205,14 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
196
205
|
onClick: submitHandler,
|
197
206
|
disabled: multi ? multiSelection.length === 0 : !singleSelection
|
198
207
|
}],
|
199
|
-
portalTarget: portalTarget
|
200
|
-
|
208
|
+
portalTarget: portalTarget,
|
209
|
+
ref: ref
|
210
|
+
});
|
201
211
|
var sidebarProps = {
|
202
212
|
appliedModifiers: appliedModifiers,
|
203
213
|
closeIconDescription: closeIconDescription,
|
204
214
|
displayMetalPanel: displayMetalPanel,
|
215
|
+
illustrationTheme: illustrationTheme,
|
205
216
|
influencerTitle: influencerTitle,
|
206
217
|
items: useNormalizedItems ? normalizedItems : items.entries,
|
207
218
|
metaPanelTitle: metaPanelTitle,
|
@@ -223,6 +234,7 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
223
234
|
handleSearch: handleSearch,
|
224
235
|
multi: multi,
|
225
236
|
filterOpts: globalFilterOpts,
|
237
|
+
filtersLabel: globalFiltersLabel,
|
226
238
|
handleFilter: handleFilter,
|
227
239
|
primaryButtonText: globalFiltersPrimaryButtonText,
|
228
240
|
secondaryButtonText: globalFiltersSecondaryButtonText,
|
@@ -234,14 +246,14 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
234
246
|
}), /*#__PURE__*/React.createElement("div", {
|
235
247
|
className: cx("".concat(blockClass, "__sub-header"), _defineProperty({}, "".concat(blockClass, "__sub-header-multi"), multi))
|
236
248
|
}, /*#__PURE__*/React.createElement("div", {
|
237
|
-
className: "".concat(blockClass, "
|
249
|
+
className: "".concat(blockClass, "__tags")
|
238
250
|
}, showBreadsCrumbs ? /*#__PURE__*/React.createElement(AddSelectBreadcrumbs, {
|
239
251
|
path: path,
|
240
252
|
onClick: pathOnclick,
|
241
253
|
multi: multi
|
242
254
|
}) : /*#__PURE__*/React.createElement("p", {
|
243
|
-
className: "".concat(blockClass, "
|
244
|
-
}, searchTerm ?
|
255
|
+
className: "".concat(blockClass, "__tags-label")
|
256
|
+
}, searchTerm ? searchResultsTitle : itemsLabel), showTags && /*#__PURE__*/React.createElement(Tag, {
|
245
257
|
type: "gray",
|
246
258
|
size: "sm"
|
247
259
|
}, itemsToDisplay.length)), showSort && /*#__PURE__*/React.createElement(AddSelectSort, {
|
@@ -269,13 +281,17 @@ export var AddSelectBody = function AddSelectBody(_ref) {
|
|
269
281
|
className: "".concat(blockClass, "__body")
|
270
282
|
}, /*#__PURE__*/React.createElement(NoDataEmptyState, {
|
271
283
|
subtitle: noResultsDescription,
|
272
|
-
title: noResultsTitle
|
284
|
+
title: noResultsTitle,
|
285
|
+
illustrationTheme: illustrationTheme
|
273
286
|
}))));
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
};
|
287
|
+
if (multi) {
|
288
|
+
return /*#__PURE__*/React.createElement(Tearsheet, _extends({}, commonTearsheetProps, {
|
289
|
+
influencer: multi && /*#__PURE__*/React.createElement(AddSelectSidebar, sidebarProps),
|
290
|
+
influencerPosition: "right"
|
291
|
+
}), body);
|
292
|
+
}
|
293
|
+
return /*#__PURE__*/React.createElement(TearsheetNarrow, commonTearsheetProps, body);
|
294
|
+
});
|
279
295
|
AddSelectBody.propTypes = {
|
280
296
|
className: PropTypes.string,
|
281
297
|
clearFiltersText: PropTypes.string,
|
@@ -285,12 +301,14 @@ AddSelectBody.propTypes = {
|
|
285
301
|
description: PropTypes.string,
|
286
302
|
globalFilterOpts: PropTypes.array,
|
287
303
|
globalFiltersIconDescription: PropTypes.string,
|
304
|
+
globalFiltersLabel: PropTypes.string,
|
288
305
|
globalFiltersPlaceholderText: PropTypes.string,
|
289
306
|
globalFiltersPrimaryButtonText: PropTypes.string,
|
290
307
|
globalFiltersSecondaryButtonText: PropTypes.string,
|
291
308
|
globalSearchLabel: PropTypes.string.isRequired,
|
292
309
|
globalSearchPlaceholder: PropTypes.string,
|
293
310
|
globalSortBy: PropTypes.array,
|
311
|
+
illustrationTheme: PropTypes.oneOf(['light', 'dark']),
|
294
312
|
influencerTitle: PropTypes.string,
|
295
313
|
items: PropTypes.shape({
|
296
314
|
modifiers: PropTypes.shape({
|
@@ -304,7 +322,8 @@ AddSelectBody.propTypes = {
|
|
304
322
|
avatar: PropTypes.shape({
|
305
323
|
alt: PropTypes.string,
|
306
324
|
icon: PropTypes.object,
|
307
|
-
src: PropTypes.string
|
325
|
+
src: PropTypes.string,
|
326
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
308
327
|
}),
|
309
328
|
children: PropTypes.object,
|
310
329
|
icon: PropTypes.object,
|
@@ -335,7 +354,7 @@ AddSelectBody.propTypes = {
|
|
335
354
|
onSubmitButtonText: PropTypes.string,
|
336
355
|
open: PropTypes.bool,
|
337
356
|
portalTarget: PropTypes.node,
|
338
|
-
|
357
|
+
searchResultsTitle: PropTypes.string,
|
339
358
|
title: PropTypes.string,
|
340
359
|
useNormalizedItems: PropTypes.bool
|
341
360
|
};
|
@@ -184,14 +184,14 @@ export var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
184
184
|
}) ? true : false
|
185
185
|
})));
|
186
186
|
})))), /*#__PURE__*/React.createElement("div", {
|
187
|
-
className: "".concat(blockClass, "
|
187
|
+
className: "".concat(blockClass, "__tags")
|
188
188
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
189
189
|
id: "".concat(uuidv4(), "-select-all"),
|
190
190
|
className: "".concat(colClass, "__select-all"),
|
191
191
|
checked: allSelected,
|
192
192
|
onChange: selectAllHandler,
|
193
193
|
labelText: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
194
|
-
className: "".concat(blockClass, "
|
194
|
+
className: "".concat(blockClass, "__tags-label")
|
195
195
|
}, header), /*#__PURE__*/React.createElement(Tag, {
|
196
196
|
type: "gray",
|
197
197
|
size: "sm"
|
@@ -21,6 +21,7 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
21
21
|
var appliedFilters = _ref.appliedFilters,
|
22
22
|
clearFiltersText = _ref.clearFiltersText,
|
23
23
|
filterOpts = _ref.filterOpts,
|
24
|
+
filtersLabel = _ref.filtersLabel,
|
24
25
|
handleFilter = _ref.handleFilter,
|
25
26
|
handleSearch = _ref.handleSearch,
|
26
27
|
hasFiltersApplied = _ref.hasFiltersApplied,
|
@@ -81,7 +82,7 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
81
82
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
82
83
|
className: "".concat(blockClass, "-search")
|
83
84
|
}, /*#__PURE__*/React.createElement(Search, {
|
84
|
-
id: "
|
85
|
+
id: "add-select-global-search-filter",
|
85
86
|
labelText: inputLabel,
|
86
87
|
placeholder: inputPlaceholder,
|
87
88
|
value: searchTerm,
|
@@ -101,7 +102,7 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
101
102
|
className: blockClass
|
102
103
|
}, /*#__PURE__*/React.createElement("div", {
|
103
104
|
className: "".concat(blockClass, "-content")
|
104
|
-
}, /*#__PURE__*/React.createElement("p", null,
|
105
|
+
}, /*#__PURE__*/React.createElement("p", null, filtersLabel), /*#__PURE__*/React.createElement("div", {
|
105
106
|
className: "".concat(blockClass, "-opts")
|
106
107
|
}, filterOpts.map(function (filterOpts) {
|
107
108
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
@@ -150,6 +151,7 @@ AddSelectFilter.propTypes = {
|
|
150
151
|
appliedFilters: PropTypes.object,
|
151
152
|
clearFiltersText: PropTypes.string,
|
152
153
|
filterOpts: PropTypes.array,
|
154
|
+
filtersLabel: PropTypes.string,
|
153
155
|
handleFilter: PropTypes.func,
|
154
156
|
handleSearch: PropTypes.func,
|
155
157
|
hasFiltersApplied: PropTypes.bool,
|
@@ -8,7 +8,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
8
8
|
//
|
9
9
|
|
10
10
|
import React from 'react';
|
11
|
-
import { Button, Checkbox, RadioButton, StructuredListRow, StructuredListWrapper, StructuredListBody
|
11
|
+
import { Button, Checkbox, Dropdown, RadioButton, StructuredListRow, StructuredListWrapper, StructuredListBody } from 'carbon-components-react';
|
12
12
|
import { ChevronRight16, View16 } from '@carbon/icons-react';
|
13
13
|
import PropTypes from 'prop-types';
|
14
14
|
import cx from 'classnames';
|
@@ -63,11 +63,12 @@ export var AddSelectList = function AddSelectList(_ref) {
|
|
63
63
|
var src = _ref3.src,
|
64
64
|
alt = _ref3.alt,
|
65
65
|
icon = _ref3.icon,
|
66
|
-
backgroundColor = _ref3.backgroundColor
|
66
|
+
backgroundColor = _ref3.backgroundColor,
|
67
|
+
theme = _ref3.theme;
|
67
68
|
return {
|
68
69
|
className: "".concat(blockClass, "-cell-avatar"),
|
69
70
|
size: 'lg',
|
70
|
-
theme:
|
71
|
+
theme: theme,
|
71
72
|
image: src,
|
72
73
|
imageDescription: alt,
|
73
74
|
icon: icon,
|
@@ -105,10 +106,11 @@ export var AddSelectList = function AddSelectList(_ref) {
|
|
105
106
|
var _cx2;
|
106
107
|
return /*#__PURE__*/React.createElement(StructuredListRow, {
|
107
108
|
key: item.id,
|
108
|
-
className: cx("".concat(blockClass, "-row"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "-row
|
109
|
+
className: cx("".concat(blockClass, "-row"), (_cx2 = {}, _defineProperty(_cx2, "".concat(blockClass, "-row--selected"), isSelected(item.id)), _defineProperty(_cx2, "".concat(blockClass, "-row-meta--selected"), isInMetaPanel(item.id)), _cx2)),
|
109
110
|
onClick: function onClick(evt) {
|
110
111
|
return metaPanelHandler(item, evt);
|
111
|
-
}
|
112
|
+
},
|
113
|
+
label: true
|
112
114
|
}, /*#__PURE__*/React.createElement("div", {
|
113
115
|
className: "".concat(blockClass, "-cell")
|
114
116
|
}, /*#__PURE__*/React.createElement("div", {
|
@@ -1,3 +1,10 @@
|
|
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
|
+
|
1
8
|
import React, { isValidElement } from 'react';
|
2
9
|
import PropTypes from 'prop-types';
|
3
10
|
import { Close16 } from '@carbon/icons-react';
|
@@ -20,6 +20,7 @@ export var AddSelectSidebar = function AddSelectSidebar(_ref) {
|
|
20
20
|
var appliedModifiers = _ref.appliedModifiers,
|
21
21
|
closeIconDescription = _ref.closeIconDescription,
|
22
22
|
displayMetalPanel = _ref.displayMetalPanel,
|
23
|
+
illustrationTheme = _ref.illustrationTheme,
|
23
24
|
influencerTitle = _ref.influencerTitle,
|
24
25
|
items = _ref.items,
|
25
26
|
metaPanelTitle = _ref.metaPanelTitle,
|
@@ -99,13 +100,15 @@ export var AddSelectSidebar = function AddSelectSidebar(_ref) {
|
|
99
100
|
}, /*#__PURE__*/React.createElement(NoDataEmptyState, {
|
100
101
|
subtitle: noSelectionDescription,
|
101
102
|
title: noSelectionTitle,
|
102
|
-
size: "sm"
|
103
|
+
size: "sm",
|
104
|
+
illustrationTheme: illustrationTheme
|
103
105
|
})));
|
104
106
|
};
|
105
107
|
AddSelectSidebar.propTypes = {
|
106
108
|
appliedModifiers: PropTypes.array,
|
107
109
|
closeIconDescription: PropTypes.string,
|
108
110
|
displayMetalPanel: PropTypes.object,
|
111
|
+
illustrationTheme: PropTypes.oneOf(['light', 'dark']),
|
109
112
|
influencerTitle: PropTypes.string,
|
110
113
|
items: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
111
114
|
metaPanelTitle: PropTypes.string,
|
@@ -3,6 +3,13 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
3
3
|
var _excluded = ["children"];
|
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
|
+
//
|
7
|
+
// Copyright IBM Corp. 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.
|
11
|
+
//
|
12
|
+
|
6
13
|
/**
|
7
14
|
* to be able to more easily and efficiently the child entries the data needs to be
|
8
15
|
* normalized. this function recursively goes through the data array to build a single
|
@@ -1,4 +1,11 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
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
|
+
|
2
9
|
import { useState } from 'react';
|
3
10
|
export var useItemSort = function useItemSort() {
|
4
11
|
var _useState = useState(''),
|
@@ -1,4 +1,11 @@
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
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
|
+
|
2
9
|
import { useState } from 'react';
|
3
10
|
var useParentSelect = function useParentSelect() {
|
4
11
|
var _useState = useState(null),
|
@@ -3,6 +3,13 @@ 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
|
+
//
|
7
|
+
// Copyright IBM Corp. 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.
|
11
|
+
//
|
12
|
+
|
6
13
|
import { useState } from 'react';
|
7
14
|
var usePath = function usePath() {
|
8
15
|
var itemsLabel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
@@ -43,10 +50,17 @@ var usePath = function usePath() {
|
|
43
50
|
pathCopy.length = idx + 1;
|
44
51
|
setPath(_toConsumableArray(pathCopy));
|
45
52
|
};
|
53
|
+
var resetPath = function resetPath() {
|
54
|
+
setPath([{
|
55
|
+
id: 'base_of_path',
|
56
|
+
title: itemsLabel
|
57
|
+
}]);
|
58
|
+
};
|
46
59
|
return {
|
47
60
|
path: path,
|
48
61
|
setPath: handler,
|
49
|
-
pathOnclick: pathClickHandler
|
62
|
+
pathOnclick: pathClickHandler,
|
63
|
+
resetPath: resetPath
|
50
64
|
};
|
51
65
|
};
|
52
66
|
export default usePath;
|
@@ -300,9 +300,6 @@ export var InlineEditV1 = /*#__PURE__*/React.forwardRef(function (_ref, refIn) {
|
|
300
300
|
);
|
301
301
|
});
|
302
302
|
|
303
|
-
// Return a placeholder if not released and not enabled by feature flag
|
304
|
-
InlineEditV1 = pkg.checkComponentEnabled(InlineEditV1, componentName);
|
305
|
-
|
306
303
|
// The display name of the component, used by React. Note that displayName
|
307
304
|
// is used in preference to relying on function.name.
|
308
305
|
InlineEditV1.displayName = componentName;
|
@@ -185,7 +185,6 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
185
185
|
className: "".concat(blockClass, "__warning-text")
|
186
186
|
}, invalidLabel));
|
187
187
|
});
|
188
|
-
InlineEditV2 = pkg.checkComponentEnabled(InlineEditV2, componentName);
|
189
188
|
InlineEditV2.displayName = componentName;
|
190
189
|
InlineEditV2.propTypes = {
|
191
190
|
/**
|
@@ -1,4 +1,11 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
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
|
+
|
2
9
|
import React, { forwardRef } from 'react';
|
3
10
|
import PropTypes from 'prop-types';
|
4
11
|
import { AddSelect } from '../AddSelect';
|
@@ -55,6 +62,10 @@ MultiAddSelect.propTypes = {
|
|
55
62
|
* placeholder for global search input
|
56
63
|
*/
|
57
64
|
globalSearchPlaceholder: PropTypes.string,
|
65
|
+
/**
|
66
|
+
* the theme for the empty state illustration
|
67
|
+
*/
|
68
|
+
illustrationTheme: PropTypes.oneOf(['light', 'dark']),
|
58
69
|
/**
|
59
70
|
* title that displays in the sidebar / influencer
|
60
71
|
*/
|
@@ -74,7 +85,8 @@ MultiAddSelect.propTypes = {
|
|
74
85
|
avatar: PropTypes.shape({
|
75
86
|
alt: PropTypes.string,
|
76
87
|
icon: PropTypes.object,
|
77
|
-
src: PropTypes.string
|
88
|
+
src: PropTypes.string,
|
89
|
+
theme: PropTypes.oneOf(['light', 'dark'])
|
78
90
|
}),
|
79
91
|
children: PropTypes.object,
|
80
92
|
icon: PropTypes.object,
|
@@ -124,14 +136,10 @@ MultiAddSelect.propTypes = {
|
|
124
136
|
* specifies if the component is open or not
|
125
137
|
*/
|
126
138
|
open: PropTypes.bool,
|
127
|
-
/**
|
128
|
-
* description for the remove item icon
|
129
|
-
*/
|
130
|
-
removeIconDescription: PropTypes.string,
|
131
139
|
/**
|
132
140
|
* text that displays when displaying filtered items
|
133
141
|
*/
|
134
|
-
|
142
|
+
searchResultsTitle: PropTypes.string,
|
135
143
|
/**
|
136
144
|
* header text
|
137
145
|
*/
|
@@ -1,4 +1,11 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
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
|
+
|
2
9
|
import React, { forwardRef } from 'react';
|
3
10
|
import PropTypes from 'prop-types';
|
4
11
|
import { AddSelect } from '../AddSelect';
|
@@ -8,7 +15,7 @@ import { prepareProps } from '../../global/js/utils/props-helper';
|
|
8
15
|
var componentName = 'SingleAddSelect';
|
9
16
|
export var SingleAddSelect = /*#__PURE__*/forwardRef(function (props, ref) {
|
10
17
|
// remove multi add select specific props
|
11
|
-
var validProps = prepareProps(props, ['columnInputPlaceholder', 'globalFilters', 'globalFiltersIconDescription', 'globalFiltersPlaceholderText', 'globalFiltersPrimaryButtonText', 'globalFiltersSecondaryButtonText', 'influencerTitle', 'multi', 'noSelectionDescription', 'noSelectionTitle'
|
18
|
+
var validProps = prepareProps(props, ['columnInputPlaceholder', 'globalFilters', 'globalFiltersIconDescription', 'globalFiltersPlaceholderText', 'globalFiltersPrimaryButtonText', 'globalFiltersSecondaryButtonText', 'influencerTitle', 'multi', 'noSelectionDescription', 'noSelectionTitle']);
|
12
19
|
return /*#__PURE__*/React.createElement(AddSelect, _extends({}, validProps, {
|
13
20
|
ref: ref
|
14
21
|
}, getDevtoolsProps(componentName)));
|
@@ -31,6 +38,10 @@ SingleAddSelect.propTypes = {
|
|
31
38
|
* placeholder for global search input
|
32
39
|
*/
|
33
40
|
globalSearchPlaceholder: PropTypes.string,
|
41
|
+
/**
|
42
|
+
* the theme for the empty state illustration
|
43
|
+
*/
|
44
|
+
illustrationTheme: PropTypes.oneOf(['light', 'dark']),
|
34
45
|
/**
|
35
46
|
* object that contains the item data. for more information reference the
|
36
47
|
* "Structuring items" section in the docs tab
|
@@ -78,7 +89,7 @@ SingleAddSelect.propTypes = {
|
|
78
89
|
/**
|
79
90
|
* text that displays when displaying filtered items
|
80
91
|
*/
|
81
|
-
|
92
|
+
searchResultsTitle: PropTypes.string,
|
82
93
|
/**
|
83
94
|
* header text
|
84
95
|
*/
|
package/es/components/index.js
CHANGED
@@ -42,5 +42,4 @@ export { EditTearsheet } from './EditTearsheet';
|
|
42
42
|
export { EditTearsheetNarrow } from './EditTearsheetNarrow';
|
43
43
|
export { EditFullPage } from './EditFullPage';
|
44
44
|
export { EditUpdateCards } from './EditUpdateCards';
|
45
|
-
export { InlineEdit } from './InlineEdit';
|
46
|
-
export { InlineEditV2 } from './InlineEditV2';
|
45
|
+
export { InlineEdit } from './InlineEdit';
|
@@ -34,7 +34,6 @@ var defaults = {
|
|
34
34
|
HTTPErrorOther: true,
|
35
35
|
ImportModal: true,
|
36
36
|
InlineEdit: true,
|
37
|
-
InlineEditV1: true,
|
38
37
|
NotificationsPanel: true,
|
39
38
|
NoDataEmptyState: true,
|
40
39
|
NoTagsEmptyState: true,
|
@@ -69,8 +68,7 @@ var defaults = {
|
|
69
68
|
EditTearsheet: false,
|
70
69
|
EditTearsheetNarrow: false,
|
71
70
|
EditFullPage: false,
|
72
|
-
EditUpdateCards: false
|
73
|
-
InlineEditV2: false
|
71
|
+
EditUpdateCards: false
|
74
72
|
/* new component flags here - comment used by generate CLI */
|
75
73
|
},
|
76
74
|
|
@@ -53,12 +53,14 @@ AddSelect.propTypes = {
|
|
53
53
|
label: _propTypes.default.string
|
54
54
|
})),
|
55
55
|
globalFiltersIconDescription: _propTypes.default.string,
|
56
|
+
globalFiltersLabel: _propTypes.default.string,
|
56
57
|
globalFiltersPlaceholderText: _propTypes.default.string,
|
57
58
|
globalFiltersPrimaryButtonText: _propTypes.default.string,
|
58
59
|
globalFiltersSecondaryButtonText: _propTypes.default.string,
|
59
60
|
globalSearchLabel: _propTypes.default.string.isRequired,
|
60
61
|
globalSearchPlaceholder: _propTypes.default.string,
|
61
62
|
globalSortBy: _propTypes.default.array,
|
63
|
+
illustrationTheme: _propTypes.default.oneOf(['light', 'dark']),
|
62
64
|
influencerTitle: _propTypes.default.string,
|
63
65
|
items: _propTypes.default.shape({
|
64
66
|
modifiers: _propTypes.default.shape({
|
@@ -72,7 +74,8 @@ AddSelect.propTypes = {
|
|
72
74
|
avatar: _propTypes.default.shape({
|
73
75
|
alt: _propTypes.default.string,
|
74
76
|
icon: _propTypes.default.object,
|
75
|
-
src: _propTypes.default.string
|
77
|
+
src: _propTypes.default.string,
|
78
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
76
79
|
}),
|
77
80
|
children: _propTypes.default.object,
|
78
81
|
icon: _propTypes.default.object,
|
@@ -105,7 +108,7 @@ AddSelect.propTypes = {
|
|
105
108
|
* portal target for the all tags modal
|
106
109
|
*/
|
107
110
|
portalTarget: _propTypes.default.node,
|
108
|
-
|
111
|
+
searchResultsTitle: _propTypes.default.string,
|
109
112
|
title: _propTypes.default.string.isRequired
|
110
113
|
};
|
111
114
|
AddSelect.defaultProps = {
|