@carbon/ibm-products 2.0.0-rc.28 → 2.0.0-rc.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/config.css +3 -0
- package/css/config.css.map +1 -0
- package/css/index-full-carbon.css +55 -134
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +5 -3
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +54 -63
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +4 -2
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +55 -134
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +5 -3
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +55 -134
- package/css/index.css.map +1 -1
- package/css/index.min.css +5 -3
- package/css/index.min.css.map +1 -1
- package/es/components/AboutModal/AboutModal.js +41 -62
- package/es/components/AddSelect/AddSelectBody.js +4 -2
- package/es/components/AddSelect/AddSelectColumn.js +11 -5
- package/es/components/AddSelect/AddSelectFilter.js +5 -4
- package/es/components/AddSelect/AddSelectRow.js +3 -3
- package/es/components/AddSelect/AddSelectSort.js +2 -1
- package/es/components/Datagrid/index.js +1 -0
- package/es/components/Datagrid/useEditableCell.js +13 -0
- package/es/components/Datagrid/useInlineEdit.js +16 -11
- package/es/components/ExampleComponent/ExampleDeprecatedComponent.js +24 -0
- package/es/components/Tearsheet/Tearsheet.js +5 -0
- package/es/components/index.js +0 -1
- package/es/global/js/package-settings.js +2 -2
- package/es/settings.js +40 -20
- package/lib/components/AboutModal/AboutModal.js +40 -62
- package/lib/components/AddSelect/AddSelectBody.js +4 -2
- package/lib/components/AddSelect/AddSelectColumn.js +11 -5
- package/lib/components/AddSelect/AddSelectFilter.js +4 -3
- package/lib/components/AddSelect/AddSelectRow.js +2 -2
- package/lib/components/AddSelect/AddSelectSort.js +2 -1
- package/lib/components/Datagrid/index.js +8 -0
- package/lib/components/Datagrid/useEditableCell.js +23 -0
- package/lib/components/Datagrid/useInlineEdit.js +22 -11
- package/lib/components/ExampleComponent/ExampleDeprecatedComponent.js +38 -0
- package/lib/components/Tearsheet/Tearsheet.js +5 -0
- package/lib/components/index.js +0 -8
- package/lib/global/js/package-settings.js +2 -2
- package/lib/settings.js +43 -21
- package/package.json +2 -2
- package/scss/components/AboutModal/_about-modal.scss +34 -53
- package/scss/components/AboutModal/_storybook-styles.scss +10 -4
- package/scss/components/AddSelect/_add-select.scss +7 -3
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +1 -1
- package/scss/components/_index-with-carbon.scss +0 -1
- package/scss/components/_index.scss +0 -1
- package/scss/config.scss +1 -0
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -34
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -47
- package/es/components/ModifiedTabs/ModifiedTabs.js +0 -141
- package/es/components/ModifiedTabs/index.js +0 -1
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -50
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -63
- package/lib/components/ModifiedTabs/ModifiedTabs.js +0 -164
- package/lib/components/ModifiedTabs/index.js +0 -13
- package/scss/components/ModifiedTabs/_carbon-imports.scss +0 -10
- package/scss/components/ModifiedTabs/_index-with-carbon.scss +0 -9
- package/scss/components/ModifiedTabs/_index.scss +0 -8
- package/scss/components/ModifiedTabs/_modified-tabs.scss +0 -89
- package/scss/components/ModifiedTabs/_storybook-styles.scss +0 -6
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["columnInputPlaceholder", "filterByLabel", "header", "items", "multiSelection", "parentId", "path", "setMultiSelection", "setPath"];
|
5
|
+
var _excluded = ["columnInputPlaceholder", "filterByLabel", "header", "items", "multiSelection", "parentId", "path", "setMultiSelection", "setPath", "sortByLabel"];
|
6
6
|
//
|
7
7
|
// Copyright IBM Corp. 2022, 2022
|
8
8
|
//
|
@@ -33,6 +33,7 @@ export var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
33
33
|
path = _ref.path,
|
34
34
|
setMultiSelection = _ref.setMultiSelection,
|
35
35
|
setPath = _ref.setPath,
|
36
|
+
sortByLabel = _ref.sortByLabel,
|
36
37
|
props = _objectWithoutProperties(_ref, _excluded);
|
37
38
|
|
38
39
|
var carbonPrefix = usePrefix();
|
@@ -183,7 +184,8 @@ export var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
183
184
|
setSortDirection: setSortDirection,
|
184
185
|
sortAttribute: sortAttribute,
|
185
186
|
sortDirection: sortDirection,
|
186
|
-
sortBy: sortBy
|
187
|
+
sortBy: sortBy,
|
188
|
+
sortByLabel: sortByLabel
|
187
189
|
}), filterByOpts.length > 0 && /*#__PURE__*/React.createElement(OverflowMenu, {
|
188
190
|
renderIcon: function renderIcon(props) {
|
189
191
|
return /*#__PURE__*/React.createElement(Filter, _extends({
|
@@ -192,7 +194,8 @@ export var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
192
194
|
},
|
193
195
|
className: "".concat(colClass, "-overflow"),
|
194
196
|
flipped: true,
|
195
|
-
ariaLabel: filterByLabel
|
197
|
+
ariaLabel: filterByLabel,
|
198
|
+
iconDescription: filterByLabel
|
196
199
|
}, filterByOpts.map(function (opt) {
|
197
200
|
return /*#__PURE__*/React.createElement("div", {
|
198
201
|
key: opt,
|
@@ -236,7 +239,9 @@ export var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
236
239
|
setMultiSelection: setMultiSelection,
|
237
240
|
parentId: selectedItem.id,
|
238
241
|
setPath: setPath,
|
239
|
-
path: path
|
242
|
+
path: path,
|
243
|
+
sortByLabel: sortByLabel,
|
244
|
+
filterByLabel: filterByLabel
|
240
245
|
}, props)));
|
241
246
|
};
|
242
247
|
AddSelectColumn.propTypes = {
|
@@ -248,6 +253,7 @@ AddSelectColumn.propTypes = {
|
|
248
253
|
parentId: PropTypes.string,
|
249
254
|
path: PropTypes.array,
|
250
255
|
setMultiSelection: PropTypes.func,
|
251
|
-
setPath: PropTypes.func
|
256
|
+
setPath: PropTypes.func,
|
257
|
+
sortByLabel: PropTypes.string
|
252
258
|
};
|
253
259
|
AddSelectColumn.displayName = componentName;
|
@@ -13,7 +13,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
13
13
|
// LICENSE file in the root directory of this source tree.
|
14
14
|
//
|
15
15
|
import React, { useState } from 'react';
|
16
|
-
import { Button, ButtonSet, Dropdown, Search, Tag } from '@carbon/react';
|
16
|
+
import { Button, ButtonSet, Dropdown, Search, Tag, Layer } from '@carbon/react';
|
17
17
|
import cx from 'classnames';
|
18
18
|
import PropTypes from 'prop-types';
|
19
19
|
import { Filter } from '@carbon/react/icons';
|
@@ -116,16 +116,17 @@ export var AddSelectFilter = function AddSelectFilter(_ref) {
|
|
116
116
|
className: filterBtnClassnames,
|
117
117
|
size: "md",
|
118
118
|
tooltipPosition: "left"
|
119
|
-
}), open && /*#__PURE__*/React.createElement(
|
120
|
-
className: blockClass
|
119
|
+
}), open && /*#__PURE__*/React.createElement(Layer, {
|
120
|
+
className: blockClass,
|
121
|
+
level: 1
|
121
122
|
}, /*#__PURE__*/React.createElement("div", {
|
122
123
|
className: "".concat(blockClass, "-content")
|
123
124
|
}, /*#__PURE__*/React.createElement("p", null, filtersLabel), /*#__PURE__*/React.createElement("div", {
|
124
125
|
className: "".concat(blockClass, "-opts")
|
125
126
|
}, filterOpts.map(function (filterOpts) {
|
126
127
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
127
|
-
id: filterOpts.id,
|
128
128
|
key: filterOpts.id,
|
129
|
+
id: filterOpts.id,
|
129
130
|
titleText: filterOpts.label,
|
130
131
|
items: filterOpts.opts,
|
131
132
|
onChange: function onChange(value) {
|
@@ -8,7 +8,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
8
8
|
// LICENSE file in the root directory of this source tree.
|
9
9
|
//
|
10
10
|
import React, { useRef, useEffect, useCallback } from 'react';
|
11
|
-
import { Button, Dropdown } from '@carbon/react';
|
11
|
+
import { Button, Dropdown, Layer } from '@carbon/react';
|
12
12
|
import { ChevronRight, View } from '@carbon/react/icons';
|
13
13
|
import PropTypes from 'prop-types';
|
14
14
|
import cx from 'classnames';
|
@@ -149,7 +149,7 @@ export var AddSelectRow = function AddSelectRow(_ref) {
|
|
149
149
|
item: item,
|
150
150
|
selected: selected,
|
151
151
|
onClick: handleMultiSelection
|
152
|
-
}), hasModifiers && /*#__PURE__*/React.createElement(Dropdown, {
|
152
|
+
}), hasModifiers && /*#__PURE__*/React.createElement(Layer, null, /*#__PURE__*/React.createElement(Dropdown, {
|
153
153
|
id: "add-select-modifier-".concat(item.id),
|
154
154
|
type: "inline",
|
155
155
|
items: modifiers.options,
|
@@ -161,7 +161,7 @@ export var AddSelectRow = function AddSelectRow(_ref) {
|
|
161
161
|
var selectedItem = _ref3.selectedItem;
|
162
162
|
return modifierHandler(item.id, selectedItem);
|
163
163
|
}
|
164
|
-
})) : /*#__PURE__*/React.createElement(AddSelectFormControl, {
|
164
|
+
}))) : /*#__PURE__*/React.createElement(AddSelectFormControl, {
|
165
165
|
type: "radio",
|
166
166
|
item: item,
|
167
167
|
selected: selected,
|
@@ -54,7 +54,8 @@ export var AddSelectSort = function AddSelectSort(_ref) {
|
|
54
54
|
},
|
55
55
|
className: "".concat(blockClass, "_overflow"),
|
56
56
|
flipped: true,
|
57
|
-
ariaLabel: sortByLabel
|
57
|
+
ariaLabel: sortByLabel,
|
58
|
+
iconDescription: sortByLabel
|
58
59
|
}, sortByOpts.map(function (opt) {
|
59
60
|
return /*#__PURE__*/React.createElement(OverflowMenuItem, {
|
60
61
|
className: "".concat(blockClass, "_overflow-item"),
|
@@ -22,5 +22,6 @@ export { default as useSelectAllWithToggle } from './useSelectAllToggle';
|
|
22
22
|
export { default as useColumnCenterAlign } from './useColumnCenterAlign';
|
23
23
|
export { default as useColumnOrder } from './useColumnOrder';
|
24
24
|
export { default as useInlineEdit } from './useInlineEdit';
|
25
|
+
export { default as useEditableCell } from './useEditableCell';
|
25
26
|
export { default as useFiltering } from './useFiltering';
|
26
27
|
export { getAutoSizedColumnWidth } from './utils/getAutoSizedColumnWidth';
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 2023
|
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 useInlineEdit from './useInlineEdit';
|
8
|
+
|
9
|
+
var useEditableCell = function useEditableCell(hooks) {
|
10
|
+
useInlineEdit(hooks, 'usingEditableCell');
|
11
|
+
};
|
12
|
+
|
13
|
+
export default useEditableCell;
|
@@ -1,19 +1,24 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
|
3
|
-
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
* restricted by GSA ADP Schedule Contract with IBM Corp.
|
3
|
+
/**
|
4
|
+
* Copyright IBM Corp. 2022, 2023
|
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.
|
9
8
|
*/
|
10
|
-
import React from 'react';
|
9
|
+
import React, { useEffect } from 'react';
|
11
10
|
import { pkg } from '../../settings';
|
12
11
|
import cx from 'classnames';
|
13
12
|
import { InlineEditCell } from './Datagrid/addons/InlineEdit/InlineEditCell';
|
14
13
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
15
14
|
|
16
|
-
var useInlineEdit = function useInlineEdit(hooks) {
|
15
|
+
var useInlineEdit = function useInlineEdit(hooks, usingEditableCell) {
|
16
|
+
useEffect(function () {
|
17
|
+
if (!usingEditableCell) {
|
18
|
+
pkg.checkReportFeatureEnabled('Datagrid.useInlineEdit');
|
19
|
+
}
|
20
|
+
}, [usingEditableCell]);
|
21
|
+
|
17
22
|
var addInlineEdit = function addInlineEdit(props, _ref) {
|
18
23
|
var _cell$column, _cell$column$inlineEd, _instance$columns$fil;
|
19
24
|
|
@@ -44,9 +49,9 @@ var useInlineEdit = function useInlineEdit(hooks) {
|
|
44
49
|
}
|
45
50
|
|
46
51
|
return [props, {
|
47
|
-
className: cx("".concat(blockClass, "__cell"), _defineProperty({}, "".concat(blockClass, "__cell-inline-edit"), true)),
|
52
|
+
className: cx("".concat(blockClass, "__cell"), _defineProperty({}, "".concat(blockClass, "__cell-inline-edit"), !!usingEditableCell || pkg.isFeatureEnabled('Datagrid.useInlineEdit') ? true : '')),
|
48
53
|
role: 'gridcell',
|
49
|
-
children: /*#__PURE__*/React.createElement(React.Fragment, null, inlineEditType === 'text' && renderInlineEditComponent(inlineEditType), inlineEditType === 'number' && renderInlineEditComponent(inlineEditType), inlineEditType === 'selection' && renderInlineEditComponent(inlineEditType), inlineEditType === 'date' && renderInlineEditComponent(inlineEditType), !inlineEditType && /*#__PURE__*/React.createElement(InlineEditCell, {
|
54
|
+
children: (!!usingEditableCell || pkg.isFeatureEnabled('Datagrid.useInlineEdit')) && /*#__PURE__*/React.createElement(React.Fragment, null, inlineEditType === 'text' && renderInlineEditComponent(inlineEditType), inlineEditType === 'number' && renderInlineEditComponent(inlineEditType), inlineEditType === 'selection' && renderInlineEditComponent(inlineEditType), inlineEditType === 'date' && renderInlineEditComponent(inlineEditType), !inlineEditType && /*#__PURE__*/React.createElement(InlineEditCell, {
|
50
55
|
config: columnInlineEditConfig,
|
51
56
|
tabIndex: -1,
|
52
57
|
value: cell.value,
|
@@ -63,7 +68,7 @@ var useInlineEdit = function useInlineEdit(hooks) {
|
|
63
68
|
hooks.getCellProps.push(addInlineEdit);
|
64
69
|
hooks.useInstance.push(function (instance) {
|
65
70
|
Object.assign(instance, {
|
66
|
-
withInlineEdit: true
|
71
|
+
withInlineEdit: !!usingEditableCell || pkg.isFeatureEnabled('Datagrid.useInlineEdit') ? true : false
|
67
72
|
});
|
68
73
|
});
|
69
74
|
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2023, 2023
|
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 { pkg } from '../../settings';
|
9
|
+
import { ExampleComponent } from './ExampleComponent';
|
10
|
+
var componentName = 'ExampleDeprecatedComponent'; // This is NOT a full component example. It is only intended to show the deprecation of a component.
|
11
|
+
|
12
|
+
export var ExampleDeprecatedComponent = function ExampleDeprecatedComponent() {
|
13
|
+
return /*#__PURE__*/React.createElement(ExampleComponent, {
|
14
|
+
primaryButtonLabel: "primary",
|
15
|
+
secondaryButtonLabel: "secondary"
|
16
|
+
});
|
17
|
+
}; // example of a deprecation warning
|
18
|
+
|
19
|
+
ExampleDeprecatedComponent.deprecated = {
|
20
|
+
level: 'warn',
|
21
|
+
details: "This an example component deprecation message used by 'checkComponentEnabled'."
|
22
|
+
}; // The component enable should log the deprecation
|
23
|
+
|
24
|
+
ExampleDeprecatedComponent = pkg.checkComponentEnabled(ExampleDeprecatedComponent, componentName);
|
@@ -187,6 +187,11 @@ Tearsheet.propTypes = _objectSpread({
|
|
187
187
|
*/
|
188
188
|
portalTarget: PropTypes.node,
|
189
189
|
|
190
|
+
/**
|
191
|
+
* Specify a CSS selector that matches the DOM element that should be focused when the Modal opens
|
192
|
+
*/
|
193
|
+
selectorPrimaryFocus: PropTypes.string,
|
194
|
+
|
190
195
|
/**
|
191
196
|
* The main title of the tearsheet, displayed in the header area.
|
192
197
|
*/
|
package/es/components/index.js
CHANGED
@@ -18,7 +18,6 @@ export { ExportModal } from './ExportModal';
|
|
18
18
|
export { ExpressiveCard } from './ExpressiveCard';
|
19
19
|
export { HTTPError403, HTTPError404, HTTPErrorOther } from './HTTPErrors';
|
20
20
|
export { ImportModal } from './ImportModal';
|
21
|
-
export { ModifiedTabs } from './ModifiedTabs';
|
22
21
|
export { MultiAddSelect } from './MultiAddSelect';
|
23
22
|
export { NotificationsPanel } from './NotificationsPanel';
|
24
23
|
export { PageHeader } from './PageHeader';
|
@@ -59,7 +59,6 @@ var defaults = {
|
|
59
59
|
WebTerminalContentWrapper: true,
|
60
60
|
WebTerminalProvider: true,
|
61
61
|
// other public components not yet reviewed and released:
|
62
|
-
ModifiedTabs: false,
|
63
62
|
Toolbar: false,
|
64
63
|
ToolbarButton: false,
|
65
64
|
ToolbarGroup: false,
|
@@ -78,7 +77,8 @@ var defaults = {
|
|
78
77
|
feature: {
|
79
78
|
'a-new-feature': false,
|
80
79
|
'default-portal-target-body': true,
|
81
|
-
'Datagrid.useInfiniteScroll': false
|
80
|
+
'Datagrid.useInfiniteScroll': false,
|
81
|
+
'Datagrid.useInlineEdit': false
|
82
82
|
}
|
83
83
|
};
|
84
84
|
|
package/es/settings.js
CHANGED
@@ -2,32 +2,51 @@ import { Canary } from './components/_Canary';
|
|
2
2
|
import pkgSettings from './global/js/package-settings';
|
3
3
|
import React from 'react';
|
4
4
|
import { themes } from '@carbon/themes';
|
5
|
+
import pconsole from './global/js/utils/pconsole';
|
5
6
|
export var carbon = {
|
6
7
|
get themes() {
|
7
8
|
return themes;
|
8
9
|
},
|
9
10
|
|
10
11
|
prefix: 'cds'
|
12
|
+
};
|
13
|
+
|
14
|
+
var componentDeprecatedWarning = function componentDeprecatedWarning(name, details) {
|
15
|
+
return "Carbon for IBM Products (WARNING): Component \"".concat(name, "\" is deprecated. ").concat(details);
|
16
|
+
};
|
17
|
+
|
18
|
+
pkgSettings.logDeprecated = function (component, name) {
|
19
|
+
if (component !== null && component !== void 0 && component.deprecated) {
|
20
|
+
var _pconsole$level;
|
21
|
+
|
22
|
+
var _component$deprecated = component.deprecated,
|
23
|
+
level = _component$deprecated.level,
|
24
|
+
details = _component$deprecated.details;
|
25
|
+
var logUsing = (_pconsole$level = pconsole === null || pconsole === void 0 ? void 0 : pconsole[level]) !== null && _pconsole$level !== void 0 ? _pconsole$level : pconsole.error;
|
26
|
+
logUsing(componentDeprecatedWarning(name || component.displayName, details));
|
27
|
+
}
|
11
28
|
}; // Check that a component is enabled. This function returns a stub which checks
|
12
29
|
// the component status on first use and then renders as the component or as
|
13
30
|
// a Canary placeholder initialized with the name of the replaced component.
|
14
31
|
// Note that the returned stub carries any other properties which had already
|
15
32
|
// been assigned (eg propTypes, displayName, etc).
|
16
33
|
|
34
|
+
|
17
35
|
pkgSettings.checkComponentEnabled = function (component, name) {
|
18
36
|
if (component.render) {
|
19
37
|
// The component is a forward-ref, so make a stub forward-ref.
|
20
38
|
var forward = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
)
|
39
|
+
pkgSettings.logDeprecated(component, name); // may log don't care about result
|
40
|
+
// Replace the stub's render fn so this test only happens once.
|
41
|
+
|
42
|
+
return (forward.render = pkgSettings.isComponentEnabled(name) || !pkgSettings.isComponentPublic(name) ? // If the component is enabled, or if it's not a public component,
|
43
|
+
// replace the stub's render fn with the component's render fn.
|
44
|
+
component.render : // Note that Canary is a direct render fn (not a forward-ref) and
|
45
|
+
// will ignore the passed props and ref (if any)
|
46
|
+
Canary.bind(undefined, {
|
47
|
+
componentName: name
|
48
|
+
}))( // Call it now (after this it will be directly called).
|
49
|
+
props, ref);
|
31
50
|
}); // Transfer object properties already assigned (eg propTypes, displayName)
|
32
51
|
// then merge in the stub forward-ref which checks the component status
|
33
52
|
// when first used.
|
@@ -36,16 +55,17 @@ pkgSettings.checkComponentEnabled = function (component, name) {
|
|
36
55
|
} else {
|
37
56
|
// The component is a direct render fn, so make a stub render fn.
|
38
57
|
var _render = function render(props) {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
)
|
58
|
+
pkgSettings.logDeprecated(component, name); // may log don't care about result
|
59
|
+
// Replace the stub render fn so this test only happens once.
|
60
|
+
|
61
|
+
return (_render = pkgSettings.isComponentEnabled(name) || !pkgSettings.isComponentPublic(name) ? // If the component is enabled, or if it's not a public component,
|
62
|
+
// replace the stub render fn with the component render fn.
|
63
|
+
component : // Replace the stub render fn with the Canary render fn, which will
|
64
|
+
// ignore the passed props.
|
65
|
+
Canary.bind(undefined, {
|
66
|
+
componentName: name
|
67
|
+
}))( // Call it now (after this it will be directly called).
|
68
|
+
props);
|
49
69
|
}; // Transfer object properties already assigned (eg propTypes, displayName)
|
50
70
|
// to a function which calls the stub render fn which checks the component
|
51
71
|
// status when first used.
|
@@ -33,9 +33,7 @@ var _devtools = require("../../global/js/utils/devtools");
|
|
33
33
|
|
34
34
|
var _react2 = require("@carbon/react");
|
35
35
|
|
36
|
-
var
|
37
|
-
|
38
|
-
var _excluded = ["additionalInfo", "className", "closeIconDescription", "content", "copyrightText", "legalText", "links", "logo", "modalAriaLabel", "onClose", "open", "tabListAriaLabel", "title"];
|
36
|
+
var _excluded = ["additionalInfo", "className", "closeIconDescription", "copyrightText", "content", "links", "logo", "modalAriaLabel", "onClose", "open", "title", "version"];
|
39
37
|
|
40
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
41
39
|
|
@@ -61,16 +59,15 @@ var AboutModal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
61
59
|
var additionalInfo = _ref.additionalInfo,
|
62
60
|
className = _ref.className,
|
63
61
|
closeIconDescription = _ref.closeIconDescription,
|
64
|
-
content = _ref.content,
|
65
62
|
copyrightText = _ref.copyrightText,
|
66
|
-
|
63
|
+
content = _ref.content,
|
67
64
|
links = _ref.links,
|
68
65
|
logo = _ref.logo,
|
69
66
|
modalAriaLabel = _ref.modalAriaLabel,
|
70
67
|
onClose = _ref.onClose,
|
71
68
|
open = _ref.open,
|
72
|
-
tabListAriaLabel = _ref.tabListAriaLabel,
|
73
69
|
title = _ref.title,
|
70
|
+
version = _ref.version,
|
74
71
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
75
72
|
|
76
73
|
var _useState = (0, _react.useState)(true),
|
@@ -99,8 +96,8 @@ var AboutModal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
99
96
|
});
|
100
97
|
return /*#__PURE__*/_react.default.createElement(_react2.ComposedModal, (0, _extends2.default)({}, rest, {
|
101
98
|
className: (0, _classnames.default)(blockClass, // Apply the block class to the main HTML element
|
102
|
-
className
|
103
|
-
|
99
|
+
className // Apply any supplied class names to the main HTML element.
|
100
|
+
),
|
104
101
|
"aria-label": modalAriaLabel
|
105
102
|
}, _objectSpread({
|
106
103
|
onClose: onClose,
|
@@ -123,59 +120,42 @@ var AboutModal = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
123
120
|
className: "".concat(blockClass, "__body-content"),
|
124
121
|
ref: contentRef,
|
125
122
|
id: contentId
|
126
|
-
},
|
123
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
124
|
+
className: "".concat(blockClass, "__version")
|
125
|
+
}, version), links && links.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
127
126
|
className: "".concat(blockClass, "__links-container")
|
128
|
-
}, links
|
127
|
+
}, links.map(function (link, i) {
|
129
128
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
|
130
129
|
key: i
|
131
130
|
}, link);
|
132
|
-
})),
|
133
|
-
className: "".concat(blockClass, "
|
134
|
-
},
|
131
|
+
})), content && /*#__PURE__*/_react.default.createElement("p", {
|
132
|
+
className: "".concat(blockClass, "__content")
|
133
|
+
}, content), copyrightText && /*#__PURE__*/_react.default.createElement("p", {
|
135
134
|
className: "".concat(blockClass, "__copyright-text")
|
136
|
-
}, copyrightText))), /*#__PURE__*/_react.default.createElement(_react2.
|
135
|
+
}, copyrightText))), additionalInfo && additionalInfo.length > 0 && /*#__PURE__*/_react.default.createElement(_react2.Theme, {
|
136
|
+
theme: "g100"
|
137
|
+
}, /*#__PURE__*/_react.default.createElement(_react2.ModalFooter, {
|
137
138
|
className: "".concat(blockClass, "__footer")
|
138
|
-
},
|
139
|
-
className: "".concat(blockClass, "
|
139
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
140
|
+
className: "".concat(blockClass, "__footer-label")
|
140
141
|
}, additionalInfo[0].label), /*#__PURE__*/_react.default.createElement("p", {
|
141
|
-
className: "".concat(blockClass, "
|
142
|
-
}, additionalInfo[0].content))
|
143
|
-
className: "".concat(blockClass, "__tab-container")
|
144
|
-
}, /*#__PURE__*/_react.default.createElement(_react2.Tabs, null, /*#__PURE__*/_react.default.createElement(_react2.TabList, {
|
145
|
-
"aria-label": tabListAriaLabel
|
146
|
-
}, additionalInfo.map(function (tab, index) {
|
147
|
-
return /*#__PURE__*/_react.default.createElement(_react2.Tab, {
|
148
|
-
key: index
|
149
|
-
}, tab.label);
|
150
|
-
})), /*#__PURE__*/_react.default.createElement(_react2.TabPanels, null, additionalInfo.map(function (tab, index) {
|
151
|
-
return /*#__PURE__*/_react.default.createElement(_react2.TabPanel, {
|
152
|
-
key: index
|
153
|
-
}, tab.content);
|
154
|
-
})))))));
|
142
|
+
className: "".concat(blockClass, "__footer-content")
|
143
|
+
}, additionalInfo[0].content))));
|
155
144
|
}); // Return a placeholder if not released and not enabled by feature flag
|
156
145
|
|
157
146
|
|
158
147
|
exports.AboutModal = AboutModal;
|
159
148
|
exports.AboutModal = AboutModal = _settings.pkg.checkComponentEnabled(AboutModal, componentName);
|
160
|
-
AboutModal.displayName = componentName;
|
161
|
-
|
162
|
-
var tabListAriaLabelRequiredProps = function tabListAriaLabelRequiredProps(type) {
|
163
|
-
return (0, _propsHelper.isRequiredIf)(type, function (_ref2) {
|
164
|
-
var additionalInfo = _ref2.additionalInfo;
|
165
|
-
return additionalInfo === null || additionalInfo === void 0 ? void 0 : additionalInfo.length;
|
166
|
-
});
|
167
|
-
}; // The types and DocGen commentary for the component props,
|
149
|
+
AboutModal.displayName = componentName; // The types and DocGen commentary for the component props,
|
168
150
|
// in alphabetical order (for consistency).
|
169
151
|
// See https://www.npmjs.com/package/prop-types#usage.
|
170
152
|
|
171
|
-
|
172
153
|
AboutModal.propTypes = {
|
173
154
|
/**
|
174
|
-
*
|
175
|
-
*
|
176
|
-
*
|
177
|
-
*
|
178
|
-
* other in the footer.
|
155
|
+
* If you are legally required to display logos of technologies used
|
156
|
+
* to build your product you can provide this in the additionalInfo.
|
157
|
+
* Additional information will be displayed in the footer. The label
|
158
|
+
* and content are displayed one above the other in the footer (optional)
|
179
159
|
*/
|
180
160
|
additionalInfo: _propTypes.default.arrayOf(_propTypes.default.shape({
|
181
161
|
label: _propTypes.default.string,
|
@@ -193,26 +173,21 @@ AboutModal.propTypes = {
|
|
193
173
|
closeIconDescription: _propTypes.default.string.isRequired,
|
194
174
|
|
195
175
|
/**
|
196
|
-
*
|
197
|
-
*
|
198
|
-
* user name, user role, browser version, browser OS etc.
|
199
|
-
*/
|
200
|
-
content: _propTypes.default.node.isRequired,
|
201
|
-
|
202
|
-
/**
|
203
|
-
* Trademark and copyright information. Suggested format for copyright -
|
204
|
-
* "Copyright © 2018 Company".
|
176
|
+
* Subhead text providing any relevant product disclaimers including
|
177
|
+
* legal information (optional)
|
205
178
|
*/
|
206
|
-
|
179
|
+
content: _propTypes.default.node,
|
207
180
|
|
208
181
|
/**
|
209
|
-
*
|
182
|
+
* Trademark and copyright information. Displays first year of
|
183
|
+
* product release to current year.
|
210
184
|
*/
|
211
|
-
|
185
|
+
copyrightText: _propTypes.default.string.isRequired,
|
212
186
|
|
213
187
|
/**
|
214
|
-
* An array of Carbon `Link`
|
215
|
-
*
|
188
|
+
* An array of Carbon `Link` component if there are additional information
|
189
|
+
* to call out within the card. The about modal should be used to display
|
190
|
+
* the product information and not where users go to find help (optional)
|
216
191
|
*/
|
217
192
|
links: _propTypes.default.arrayOf(_propTypes.default.element),
|
218
193
|
|
@@ -238,12 +213,15 @@ AboutModal.propTypes = {
|
|
238
213
|
open: _propTypes.default.bool,
|
239
214
|
|
240
215
|
/**
|
241
|
-
*
|
216
|
+
* Header text that provides the product name. The IBM Services logo
|
217
|
+
* consists of two discrete, but required, elements: the iconic
|
218
|
+
* IBM 8-bar logo represented alongside the IBM Services logotype.
|
219
|
+
* Please follow these guidelines to ensure proper execution.
|
242
220
|
*/
|
243
|
-
|
221
|
+
title: _propTypes.default.node.isRequired,
|
244
222
|
|
245
223
|
/**
|
246
|
-
*
|
224
|
+
* Text that provides information on the version number of your product.
|
247
225
|
*/
|
248
|
-
|
226
|
+
version: _propTypes.default.string.isRequired
|
249
227
|
};
|
@@ -51,7 +51,7 @@ var _usePath2 = _interopRequireDefault(require("./hooks/usePath"));
|
|
51
51
|
|
52
52
|
var _settings = require("../../settings");
|
53
53
|
|
54
|
-
var _excluded = ["className", "clearFiltersText", "closeIconDescription", "columnInputPlaceholder", "defaultModifiers", "description", "filterByLabel", "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"];
|
54
|
+
var _excluded = ["className", "clearFiltersText", "closeIconDescription", "columnInputPlaceholder", "defaultModifiers", "description", "filterByLabel", "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", "sortByLabel", "title", "useNormalizedItems"];
|
55
55
|
|
56
56
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
57
57
|
|
@@ -102,6 +102,7 @@ var AddSelectBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
102
102
|
open = _ref.open,
|
103
103
|
portalTarget = _ref.portalTarget,
|
104
104
|
searchResultsTitle = _ref.searchResultsTitle,
|
105
|
+
sortByLabel = _ref.sortByLabel,
|
105
106
|
title = _ref.title,
|
106
107
|
useNormalizedItems = _ref.useNormalizedItems,
|
107
108
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
@@ -326,7 +327,8 @@ var AddSelectBody = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
326
327
|
items: itemsToDisplay,
|
327
328
|
columnInputPlaceholder: columnInputPlaceholder,
|
328
329
|
header: (_path$ = path[0]) === null || _path$ === void 0 ? void 0 : _path$.title,
|
329
|
-
filterByLabel: filterByLabel
|
330
|
+
filterByLabel: filterByLabel,
|
331
|
+
sortByLabel: sortByLabel
|
330
332
|
}))) : /*#__PURE__*/_react.default.createElement("div", null, hasResults ? /*#__PURE__*/_react.default.createElement(_AddSelectList.AddSelectList, (0, _extends2.default)({}, commonListProps, {
|
331
333
|
filteredItems: itemsToDisplay,
|
332
334
|
modifiers: items.modifiers,
|
@@ -39,7 +39,7 @@ var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
|
39
39
|
|
40
40
|
var _useParentSelect2 = _interopRequireDefault(require("./hooks/useParentSelect"));
|
41
41
|
|
42
|
-
var _excluded = ["columnInputPlaceholder", "filterByLabel", "header", "items", "multiSelection", "parentId", "path", "setMultiSelection", "setPath"];
|
42
|
+
var _excluded = ["columnInputPlaceholder", "filterByLabel", "header", "items", "multiSelection", "parentId", "path", "setMultiSelection", "setPath", "sortByLabel"];
|
43
43
|
|
44
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
45
45
|
|
@@ -59,6 +59,7 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
59
59
|
path = _ref.path,
|
60
60
|
setMultiSelection = _ref.setMultiSelection,
|
61
61
|
setPath = _ref.setPath,
|
62
|
+
sortByLabel = _ref.sortByLabel,
|
62
63
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
63
64
|
var carbonPrefix = (0, _react2.usePrefix)();
|
64
65
|
|
@@ -207,7 +208,8 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
207
208
|
setSortDirection: setSortDirection,
|
208
209
|
sortAttribute: sortAttribute,
|
209
210
|
sortDirection: sortDirection,
|
210
|
-
sortBy: sortBy
|
211
|
+
sortBy: sortBy,
|
212
|
+
sortByLabel: sortByLabel
|
211
213
|
}), filterByOpts.length > 0 && /*#__PURE__*/_react.default.createElement(_react2.OverflowMenu, {
|
212
214
|
renderIcon: function renderIcon(props) {
|
213
215
|
return /*#__PURE__*/_react.default.createElement(_icons.Filter, (0, _extends2.default)({
|
@@ -216,7 +218,8 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
216
218
|
},
|
217
219
|
className: "".concat(colClass, "-overflow"),
|
218
220
|
flipped: true,
|
219
|
-
ariaLabel: filterByLabel
|
221
|
+
ariaLabel: filterByLabel,
|
222
|
+
iconDescription: filterByLabel
|
220
223
|
}, filterByOpts.map(function (opt) {
|
221
224
|
return /*#__PURE__*/_react.default.createElement("div", {
|
222
225
|
key: opt,
|
@@ -260,7 +263,9 @@ var AddSelectColumn = function AddSelectColumn(_ref) {
|
|
260
263
|
setMultiSelection: setMultiSelection,
|
261
264
|
parentId: selectedItem.id,
|
262
265
|
setPath: setPath,
|
263
|
-
path: path
|
266
|
+
path: path,
|
267
|
+
sortByLabel: sortByLabel,
|
268
|
+
filterByLabel: filterByLabel
|
264
269
|
}, props)));
|
265
270
|
};
|
266
271
|
|
@@ -274,6 +279,7 @@ AddSelectColumn.propTypes = {
|
|
274
279
|
parentId: _propTypes.default.string,
|
275
280
|
path: _propTypes.default.array,
|
276
281
|
setMultiSelection: _propTypes.default.func,
|
277
|
-
setPath: _propTypes.default.func
|
282
|
+
setPath: _propTypes.default.func,
|
283
|
+
sortByLabel: _propTypes.default.string
|
278
284
|
};
|
279
285
|
AddSelectColumn.displayName = componentName;
|