@carbon/ibm-products 1.36.0 → 1.38.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/css/index-full-carbon.css +11215 -10977
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +118 -65
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +2 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +217 -90
- 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 +3851 -2022
- package/css/index.css.map +1 -1
- package/css/index.min.css +2 -2
- 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/DataSpreadsheet/DataSpreadsheet.js +2 -1
- package/es/components/DataSpreadsheet/utils/handleCellDeletion.js +8 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +88 -0
- package/es/components/FilterSummary/FilterSummary.js +54 -0
- package/es/components/FilterSummary/index.js +7 -0
- 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/PageHeader/PageHeaderTitle.js +2 -4
- 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/DataSpreadsheet/DataSpreadsheet.js +2 -1
- package/lib/components/DataSpreadsheet/utils/handleCellDeletion.js +8 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +101 -0
- package/lib/components/FilterSummary/FilterSummary.js +63 -0
- package/lib/components/FilterSummary/index.js +13 -0
- 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/PageHeader/PageHeaderTitle.js +2 -4
- 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 +15 -15
- 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/FilterSummary/_filter-summary.scss +17 -0
- package/scss/components/FilterSummary/_index.scss +10 -0
- package/scss/components/FilterSummary/_storybook-styles.scss +14 -0
- 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/PageHeader/_page-header.scss +0 -4
- 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
- package/scss/components/_index.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;
|
@@ -355,7 +355,8 @@ export var DataSpreadsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
355
355
|
currentMatcher: currentMatcher,
|
356
356
|
rows: rows,
|
357
357
|
setActiveCellContent: setActiveCellContent,
|
358
|
-
updateData: updateData
|
358
|
+
updateData: updateData,
|
359
|
+
activeCellCoordinates: activeCellCoordinates
|
359
360
|
};
|
360
361
|
// Allow arrow key navigation if there are less than two activeKeys OR
|
361
362
|
// if one of the activeCellCoordinates is in a header position
|
@@ -8,11 +8,18 @@
|
|
8
8
|
import { deepCloneObject } from '../../../global/js/utils/deepCloneObject';
|
9
9
|
import { rangeWithCallback } from '../../../global/js/utils/rangeWithCallback';
|
10
10
|
export var handleCellDeletion = function handleCellDeletion(_ref) {
|
11
|
-
var
|
11
|
+
var activeCellCoordinates = _ref.activeCellCoordinates,
|
12
|
+
selectionAreas = _ref.selectionAreas,
|
12
13
|
currentMatcher = _ref.currentMatcher,
|
13
14
|
rows = _ref.rows,
|
14
15
|
setActiveCellContent = _ref.setActiveCellContent,
|
15
16
|
updateData = _ref.updateData;
|
17
|
+
// This means that the delete key has been pressed when the active cell is in a header,
|
18
|
+
// not within the spreadsheet body. To delete an entire row/column, it must first be
|
19
|
+
// selected, and then can be deleted.
|
20
|
+
if ((activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header') {
|
21
|
+
return;
|
22
|
+
}
|
16
23
|
var selectionAreaClone = deepCloneObject(selectionAreas);
|
17
24
|
var indexOfCurrentSelectionArea = selectionAreaClone.findIndex(function (item) {
|
18
25
|
return item.matcher === currentMatcher;
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
/**
|
4
|
+
* Copyright IBM Corp. 2022, 2022
|
5
|
+
*
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
9
|
+
import React, { createContext } from 'react';
|
10
|
+
import PropTypes from 'prop-types';
|
11
|
+
import { DATE, DROPDOWN, NUMBER, RADIO, CHECKBOX } from './constants';
|
12
|
+
export var FilterContext = /*#__PURE__*/createContext();
|
13
|
+
var prepareFiltersForTags = function prepareFiltersForTags(filters) {
|
14
|
+
var tags = [];
|
15
|
+
filters.forEach(function (_ref) {
|
16
|
+
var id = _ref.id,
|
17
|
+
type = _ref.type,
|
18
|
+
value = _ref.value;
|
19
|
+
if (type === DROPDOWN || type === RADIO || type === NUMBER) {
|
20
|
+
tags.push(_defineProperty({}, id, value));
|
21
|
+
} else if (type === DATE) {
|
22
|
+
var _value = _slicedToArray(value, 2),
|
23
|
+
startDate = _value[0],
|
24
|
+
endDate = _value[1];
|
25
|
+
tags.push(_defineProperty({}, id, "".concat(startDate.toLocaleString(), " - ").concat(endDate.toLocaleString())));
|
26
|
+
} else if (type === CHECKBOX) {
|
27
|
+
value.forEach(function (checkbox) {
|
28
|
+
tags.push(_defineProperty({}, id, checkbox.value));
|
29
|
+
});
|
30
|
+
}
|
31
|
+
});
|
32
|
+
return tags;
|
33
|
+
};
|
34
|
+
export var FilterProvider = function FilterProvider(_ref2) {
|
35
|
+
var children = _ref2.children,
|
36
|
+
filters = _ref2.filters;
|
37
|
+
console.log(filters);
|
38
|
+
var filterTags = prepareFiltersForTags(filters);
|
39
|
+
console.log({
|
40
|
+
filterTags: filterTags
|
41
|
+
});
|
42
|
+
var value = {
|
43
|
+
filterTags: filterTags
|
44
|
+
};
|
45
|
+
return /*#__PURE__*/React.createElement(FilterContext.Provider, {
|
46
|
+
value: value
|
47
|
+
}, children);
|
48
|
+
};
|
49
|
+
FilterProvider.propTypes = {
|
50
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
51
|
+
filters: PropTypes.arrayOf(PropTypes.object).isRequired
|
52
|
+
};
|
53
|
+
[{
|
54
|
+
id: 'joined',
|
55
|
+
value: ['2022-10-02T04:00:00.000Z', '2022-10-26T04:00:00.000Z'],
|
56
|
+
type: 'date'
|
57
|
+
}, {
|
58
|
+
id: 'visits',
|
59
|
+
value: '1',
|
60
|
+
type: 'number'
|
61
|
+
}, {
|
62
|
+
id: 'passwordStrength',
|
63
|
+
value: [{
|
64
|
+
id: 'normal',
|
65
|
+
labelText: 'Normal',
|
66
|
+
value: 'normal',
|
67
|
+
selected: true
|
68
|
+
}, {
|
69
|
+
id: 'minor-warning',
|
70
|
+
labelText: 'Minor warning',
|
71
|
+
value: 'minor-warning',
|
72
|
+
selected: true
|
73
|
+
}, {
|
74
|
+
id: 'critical',
|
75
|
+
labelText: 'Critical',
|
76
|
+
value: 'critical',
|
77
|
+
selected: false
|
78
|
+
}],
|
79
|
+
type: 'checkbox'
|
80
|
+
}, {
|
81
|
+
id: 'role',
|
82
|
+
value: 'developer',
|
83
|
+
type: 'radio'
|
84
|
+
}, {
|
85
|
+
id: 'status',
|
86
|
+
value: 'complicated',
|
87
|
+
type: 'dropdown'
|
88
|
+
}];
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2022, 2022
|
3
|
+
*
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
import { Button } from 'carbon-components-react';
|
8
|
+
import React from 'react';
|
9
|
+
import PropTypes from 'prop-types';
|
10
|
+
import cx from 'classnames';
|
11
|
+
import { TagSet } from '../TagSet';
|
12
|
+
import { pkg } from '../../settings';
|
13
|
+
var blockClass = "".concat(pkg.prefix, "--filter-summary");
|
14
|
+
var FilterSummary = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
15
|
+
var _ref$className = _ref.className,
|
16
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
17
|
+
_ref$clearFiltersText = _ref.clearFiltersText,
|
18
|
+
clearFiltersText = _ref$clearFiltersText === void 0 ? 'Clear filters' : _ref$clearFiltersText,
|
19
|
+
_ref$clearFilters = _ref.clearFilters,
|
20
|
+
clearFilters = _ref$clearFilters === void 0 ? function () {} : _ref$clearFilters,
|
21
|
+
_ref$filters = _ref.filters,
|
22
|
+
filters = _ref$filters === void 0 ? [] : _ref$filters;
|
23
|
+
var tagFilters = filters.map(function (_ref2) {
|
24
|
+
var key = _ref2.key,
|
25
|
+
value = _ref2.value;
|
26
|
+
return {
|
27
|
+
type: 'gray',
|
28
|
+
label: "".concat(key, ": ").concat(value)
|
29
|
+
};
|
30
|
+
});
|
31
|
+
return /*#__PURE__*/React.createElement("div", {
|
32
|
+
ref: ref,
|
33
|
+
className: cx([blockClass, className])
|
34
|
+
}, /*#__PURE__*/React.createElement(TagSet, {
|
35
|
+
allTagsModalSearchLabel: "Search all tags",
|
36
|
+
allTagsModalSearchPlaceholderText: "Search all tags",
|
37
|
+
allTagsModalTitle: "All tags",
|
38
|
+
showAllTagsLabel: "View all tags",
|
39
|
+
tags: tagFilters
|
40
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
41
|
+
kind: "ghost",
|
42
|
+
size: "sm",
|
43
|
+
onClick: clearFilters
|
44
|
+
}, clearFiltersText));
|
45
|
+
});
|
46
|
+
var componentName = 'FilterSummary';
|
47
|
+
FilterSummary.displayName = componentName;
|
48
|
+
FilterSummary.propTypes = {
|
49
|
+
className: PropTypes.string,
|
50
|
+
clearFilters: PropTypes.func.isRequired,
|
51
|
+
clearFiltersText: PropTypes.string,
|
52
|
+
filters: PropTypes.arrayOf(PropTypes.object).isRequired
|
53
|
+
};
|
54
|
+
export default FilterSummary;
|
@@ -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
|
/**
|