@carbon/ibm-products 2.0.0-rc.27 → 2.0.0-rc.29
Sign up to get free protection for your applications and to get access to all the features.
- package/css/config.css +3 -0
- package/css/config.css.map +1 -0
- package/css/index-full-carbon.css +126 -355
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +6 -6
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +196 -252
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +4 -4
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +126 -355
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +6 -6
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +126 -355
- package/css/index.css.map +1 -1
- package/css/index.min.css +6 -6
- package/css/index.min.css.map +1 -1
- package/es/components/AboutModal/AboutModal.js +44 -66
- package/es/components/ActionBar/ActionBar.js +13 -29
- 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/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +15 -21
- package/es/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
- package/es/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +7 -8
- package/es/components/Datagrid/Datagrid/DatagridToolbar.js +6 -5
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/utils.js +19 -1
- package/es/components/Datagrid/index.js +1 -0
- package/es/components/Datagrid/useEditableCell.js +13 -0
- package/es/components/Datagrid/useFiltering.js +4 -2
- package/es/components/Datagrid/useInlineEdit.js +16 -11
- package/es/components/Datagrid/useOnRowClick.js +11 -1
- package/es/components/Datagrid/useSelectRows.js +2 -0
- package/es/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +92 -30
- package/es/components/{InlineEdit → EditInPlace}/index.js +1 -1
- package/es/components/ExampleComponent/ExampleDeprecatedComponent.js +24 -0
- package/es/components/PageHeader/PageHeader.js +36 -35
- package/es/components/PageHeader/PageHeaderTitle.js +18 -18
- package/es/components/SidePanel/SidePanel.js +25 -26
- package/es/components/TagSet/TagSet.js +5 -7
- package/es/components/Tearsheet/Tearsheet.js +5 -0
- package/es/components/Tearsheet/TearsheetShell.js +4 -6
- package/es/components/index.js +1 -2
- package/es/global/js/hooks/useResizeObserver.js +79 -0
- package/es/global/js/hooks/useWindowResize.js +6 -0
- package/es/global/js/hooks/useWindowScroll.js +7 -0
- package/es/global/js/package-settings.js +4 -6
- package/es/settings.js +40 -20
- package/lib/components/AboutModal/AboutModal.js +43 -66
- package/lib/components/ActionBar/ActionBar.js +13 -29
- 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/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +13 -19
- package/lib/components/ButtonSetWithOverflow/ButtonSetWithOverflow.js +7 -11
- package/lib/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js +2 -1
- package/lib/components/Datagrid/Datagrid/DatagridToolbar.js +5 -4
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterFlyout.js +17 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +19 -4
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +8 -5
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useInitialStateFromFilters.js +2 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/utils.js +18 -1
- package/lib/components/Datagrid/index.js +8 -0
- package/lib/components/Datagrid/useEditableCell.js +23 -0
- package/lib/components/Datagrid/useFiltering.js +4 -2
- package/lib/components/Datagrid/useInlineEdit.js +22 -11
- package/lib/components/Datagrid/useOnRowClick.js +11 -1
- package/lib/components/Datagrid/useSelectRows.js +2 -0
- package/lib/components/{InlineEditV2/InlineEditV2.js → EditInPlace/EditInPlace.js} +100 -34
- package/lib/components/{InlineEdit → EditInPlace}/index.js +3 -3
- package/lib/components/ExampleComponent/ExampleDeprecatedComponent.js +38 -0
- package/lib/components/PageHeader/PageHeader.js +36 -35
- package/lib/components/PageHeader/PageHeaderTitle.js +19 -19
- package/lib/components/SidePanel/SidePanel.js +25 -26
- package/lib/components/TagSet/TagSet.js +5 -7
- package/lib/components/Tearsheet/Tearsheet.js +5 -0
- package/lib/components/Tearsheet/TearsheetShell.js +4 -6
- package/lib/components/index.js +7 -15
- package/lib/global/js/hooks/useResizeObserver.js +91 -0
- package/lib/global/js/hooks/useWindowScroll.js +6 -0
- package/lib/global/js/package-settings.js +4 -6
- package/lib/settings.js +43 -21
- package/package.json +3 -4
- 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/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +10 -1
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +1 -1
- package/scss/components/Datagrid/styles/_useSelectAllToggle.scss +11 -7
- package/scss/components/{InlineEditV2/_inline-edit-v2.scss → EditInPlace/_edit-in-place.scss} +56 -14
- package/scss/components/{InlineEditV1 → EditInPlace}/_index-with-carbon.scss +1 -1
- package/scss/components/{InlineEditV2 → EditInPlace}/_index.scss +1 -1
- package/scss/components/{InlineEditV1 → EditInPlace}/_storybook-styles.scss +3 -15
- package/scss/components/PageHeader/_page-header.scss +1 -7
- package/scss/components/_index-released-only-with-carbon.scss +1 -1
- package/scss/components/_index-released-only.scss +1 -1
- package/scss/components/_index-with-carbon.scss +1 -3
- package/scss/components/_index.scss +1 -3
- package/scss/config.scss +1 -0
- package/es/components/InlineEdit/InlineEdit.js +0 -47
- package/es/components/InlineEditV1/InlineEditV1.js +0 -442
- package/es/components/InlineEditV1/index.js +0 -7
- package/es/components/InlineEditV2/index.js +0 -7
- 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/InlineEdit/InlineEdit.js +0 -63
- package/lib/components/InlineEditV1/InlineEditV1.js +0 -459
- package/lib/components/InlineEditV1/index.js +0 -13
- package/lib/components/InlineEditV2/index.js +0 -13
- 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/InlineEditV1/_carbon-imports.scss +0 -6
- package/scss/components/InlineEditV1/_index.scss +0 -8
- package/scss/components/InlineEditV1/_inline-edit-v1.scss +0 -269
- package/scss/components/InlineEditV2/_index-with-carbon.scss +0 -9
- package/scss/components/InlineEditV2/_storybook-styles.scss +0 -9
- 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
- /package/scss/components/{InlineEditV2 → EditInPlace}/_carbon-imports.scss +0 -0
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports.
|
8
|
+
exports.editInPlaceRequired = exports.PageHeaderTitle = void 0;
|
9
9
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
11
|
|
@@ -23,7 +23,7 @@ var _react2 = require("@carbon/react");
|
|
23
23
|
|
24
24
|
var _ = require("../");
|
25
25
|
|
26
|
-
var _excluded = ["text", "content", "loading", "icon", "asText", "onChange", "onSave", "editDescription", "editableLabel", "
|
26
|
+
var _excluded = ["text", "content", "loading", "icon", "asText", "onChange", "onSave", "editDescription", "editableLabel", "cancelDescription", "saveDescription"];
|
27
27
|
|
28
28
|
/**
|
29
29
|
*
|
@@ -46,7 +46,7 @@ var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
46
46
|
onSave = title.onSave,
|
47
47
|
editDescription = title.editDescription,
|
48
48
|
editableLabel = title.editableLabel,
|
49
|
-
|
49
|
+
cancelDescription = title.cancelDescription,
|
50
50
|
saveDescription = title.saveDescription,
|
51
51
|
rest = (0, _objectWithoutProperties2.default)(title, _excluded);
|
52
52
|
var titleText;
|
@@ -63,17 +63,17 @@ var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
63
63
|
className: "".concat(blockClass, "__title-icon")
|
64
64
|
}) : null, loading ? /*#__PURE__*/_react.default.createElement(_react2.SkeletonText, {
|
65
65
|
className: "".concat(blockClass, "__title-skeleton")
|
66
|
-
}) : isEditable ? /*#__PURE__*/_react.default.createElement(_.
|
67
|
-
|
68
|
-
hideLabel: true,
|
66
|
+
}) : isEditable ? /*#__PURE__*/_react.default.createElement(_.EditInPlace, (0, _extends2.default)({
|
67
|
+
tooltipAlignment: "bottom",
|
69
68
|
value: text,
|
70
|
-
|
69
|
+
cancelLabel: cancelDescription,
|
70
|
+
editLabel: editDescription,
|
71
|
+
saveLabel: saveDescription,
|
72
|
+
labelText: editableLabel,
|
71
73
|
onChange: onChange,
|
72
74
|
onSave: onSave,
|
73
|
-
|
74
|
-
|
75
|
-
saveDescription: saveDescription,
|
76
|
-
buttonTooltipPosition: "bottom"
|
75
|
+
size: "md",
|
76
|
+
inheritTypography: true
|
77
77
|
}, rest)) : /*#__PURE__*/_react.default.createElement("span", {
|
78
78
|
title: !loading ? asText : null
|
79
79
|
}, text));
|
@@ -90,12 +90,12 @@ var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
90
90
|
|
91
91
|
exports.PageHeaderTitle = PageHeaderTitle;
|
92
92
|
|
93
|
-
var
|
93
|
+
var editInPlaceRequired = function editInPlaceRequired(_ref2) {
|
94
94
|
var onSave = _ref2.onSave;
|
95
95
|
return !!onSave;
|
96
96
|
};
|
97
97
|
|
98
|
-
exports.
|
98
|
+
exports.editInPlaceRequired = editInPlaceRequired;
|
99
99
|
PageHeaderTitle.propTypes = {
|
100
100
|
// passed from page header
|
101
101
|
blockClass: _propTypes.default.string.isRequired,
|
@@ -118,7 +118,7 @@ PageHeaderTitle.propTypes = {
|
|
118
118
|
* - onSave: function to process a confirmed change
|
119
119
|
* - editDescription: description for edit button
|
120
120
|
* - editableLabel: label for edit required if onSave supplied
|
121
|
-
* -
|
121
|
+
* - cancelDescription: description for edit cancel button
|
122
122
|
* - saveDescription: description for edit save button
|
123
123
|
* - Object containing user defined contents. These must fit within the area defined for the title in both main part of the header and the breadcrumb.
|
124
124
|
* - content: title or name of current location shown in main part of page header
|
@@ -131,13 +131,13 @@ PageHeaderTitle.propTypes = {
|
|
131
131
|
icon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
132
132
|
loading: _propTypes.default.bool,
|
133
133
|
// inline edit version properties
|
134
|
-
editDescription: _propTypes.default.string.isRequired.if(
|
135
|
-
editableLabel: _propTypes.default.string.isRequired.if(
|
136
|
-
id: _propTypes.default.string.isRequired.if(
|
134
|
+
editDescription: _propTypes.default.string.isRequired.if(editInPlaceRequired),
|
135
|
+
editableLabel: _propTypes.default.string.isRequired.if(editInPlaceRequired),
|
136
|
+
id: _propTypes.default.string.isRequired.if(editInPlaceRequired),
|
137
137
|
onChange: _propTypes.default.func,
|
138
138
|
onSave: _propTypes.default.func,
|
139
|
-
|
140
|
-
saveDescription: _propTypes.default.string.isRequired.if(
|
139
|
+
cancelDescription: _propTypes.default.string.isRequired.if(editInPlaceRequired),
|
140
|
+
saveDescription: _propTypes.default.string.isRequired.if(editInPlaceRequired) // Update docgen if changed
|
141
141
|
|
142
142
|
}), _propTypes.default.string, _propTypes.default.shape({
|
143
143
|
content: _propTypes.default.node.isRequired,
|
@@ -25,7 +25,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
25
|
|
26
26
|
var _classnames = _interopRequireDefault(require("classnames"));
|
27
27
|
|
28
|
-
var
|
28
|
+
var _useResizeObserver = require("../../global/js/hooks/useResizeObserver");
|
29
29
|
|
30
30
|
var _motion = require("@carbon/motion");
|
31
31
|
|
@@ -77,7 +77,7 @@ var defaults = {
|
|
77
77
|
*/
|
78
78
|
|
79
79
|
var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
80
|
-
var _window,
|
80
|
+
var _window, _ref5, _cx4;
|
81
81
|
|
82
82
|
var actionToolbarButtons = _ref.actionToolbarButtons,
|
83
83
|
actions = _ref.actions,
|
@@ -198,9 +198,10 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
198
198
|
}, [labelText, title]);
|
199
199
|
/* istanbul ignore next */
|
200
200
|
|
201
|
-
var handleResize = function handleResize(
|
201
|
+
var handleResize = function handleResize(_ref2) {
|
202
202
|
var _sidePanelOuter$style3;
|
203
203
|
|
204
|
+
var height = _ref2.height;
|
204
205
|
setPanelHeight(height);
|
205
206
|
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
206
207
|
var actionsContainer = getActionsContainerElement();
|
@@ -397,9 +398,9 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
397
398
|
|
398
399
|
/* istanbul ignore next */
|
399
400
|
|
400
|
-
var handleBlur = function handleBlur(
|
401
|
-
var oldActiveNode =
|
402
|
-
currentActiveNode =
|
401
|
+
var handleBlur = function handleBlur(_ref3) {
|
402
|
+
var oldActiveNode = _ref3.target,
|
403
|
+
currentActiveNode = _ref3.relatedTarget;
|
403
404
|
|
404
405
|
// focus trap should only be set if the side panel is a `slideOver` type
|
405
406
|
if (open && sidePanelInnerRef && !slideIn) {
|
@@ -414,7 +415,7 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
414
415
|
};
|
415
416
|
|
416
417
|
var primaryActionContainerClassNames = (0, _classnames.default)(["".concat(blockClass, "__actions-container"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__actions-container-condensed"), condensedActions)]);
|
417
|
-
var mainPanelClassNames = (0, _classnames.default)([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (
|
418
|
+
var mainPanelClassNames = (0, _classnames.default)([blockClass, className, "".concat(blockClass, "__container"), "".concat(blockClass, "__container--").concat(size), (_ref5 = {}, (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-right-placement"), placement === 'right'), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-left-placement"), placement === 'left'), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-with-action-toolbar"), actionToolbarButtons && actionToolbarButtons.length), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-without-overlay"), !includeOverlay && !slideIn), (0, _defineProperty2.default)(_ref5, "".concat(blockClass, "__container-is-animating"), !animationComplete || !open), _ref5)]);
|
418
419
|
|
419
420
|
var renderHeader = function renderHeader() {
|
420
421
|
var _cx, _cx2;
|
@@ -453,17 +454,17 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
453
454
|
className: (0, _classnames.default)("".concat(blockClass, "__subtitle-text"), (_cx2 = {}, (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-no-animation"), !animateTitle), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-no-animation-no-action-toolbar"), !animateTitle && (!actionToolbarButtons || !actionToolbarButtons.length)), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-text-is-animating"), !animationComplete && animateTitle), (0, _defineProperty2.default)(_cx2, "".concat(blockClass, "__subtitle-without-title"), !title), _cx2))
|
454
455
|
}, subtitle), actionToolbarButtons && actionToolbarButtons.length && /*#__PURE__*/_react.default.createElement("div", {
|
455
456
|
className: (0, _classnames.default)("".concat(blockClass, "__action-toolbar"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__action-toolbar-no-animation"), !animateTitle))
|
456
|
-
}, actionToolbarButtons.map(function (
|
457
|
-
var label =
|
458
|
-
kind =
|
459
|
-
icon =
|
460
|
-
tooltipPosition =
|
461
|
-
tooltipAlignment =
|
462
|
-
leading =
|
463
|
-
disabled =
|
464
|
-
className =
|
465
|
-
onClick =
|
466
|
-
rest = (0, _objectWithoutProperties2.default)(
|
457
|
+
}, actionToolbarButtons.map(function (_ref6) {
|
458
|
+
var label = _ref6.label,
|
459
|
+
kind = _ref6.kind,
|
460
|
+
icon = _ref6.icon,
|
461
|
+
tooltipPosition = _ref6.tooltipPosition,
|
462
|
+
tooltipAlignment = _ref6.tooltipAlignment,
|
463
|
+
leading = _ref6.leading,
|
464
|
+
disabled = _ref6.disabled,
|
465
|
+
className = _ref6.className,
|
466
|
+
onClick = _ref6.onClick,
|
467
|
+
rest = (0, _objectWithoutProperties2.default)(_ref6, _excluded2);
|
467
468
|
return /*#__PURE__*/_react.default.createElement(_react2.Button, (0, _extends2.default)({}, rest, {
|
468
469
|
key: label,
|
469
470
|
kind: kind || 'ghost',
|
@@ -493,10 +494,8 @@ var SidePanel = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
493
494
|
};
|
494
495
|
|
495
496
|
var contentRef = ref || sidePanelRef;
|
496
|
-
(0,
|
497
|
-
|
498
|
-
onResize: handleResize,
|
499
|
-
targetRef: contentRef
|
497
|
+
(0, _useResizeObserver.useResizeObserver)(contentRef, {
|
498
|
+
callback: handleResize
|
500
499
|
});
|
501
500
|
return /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, open && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), rest, {
|
502
501
|
id: "".concat(blockClass, "-outer"),
|
@@ -667,8 +666,8 @@ SidePanel.propTypes = {
|
|
667
666
|
* This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
|
668
667
|
* This prop is required when using the `slideIn` variant of the side panel.
|
669
668
|
*/
|
670
|
-
selectorPageContent: _propTypes.default.string.isRequired.if(function (
|
671
|
-
var slideIn =
|
669
|
+
selectorPageContent: _propTypes.default.string.isRequired.if(function (_ref8) {
|
670
|
+
var slideIn = _ref8.slideIn;
|
672
671
|
return slideIn;
|
673
672
|
}),
|
674
673
|
|
@@ -696,8 +695,8 @@ SidePanel.propTypes = {
|
|
696
695
|
/**
|
697
696
|
* Sets the title text
|
698
697
|
*/
|
699
|
-
title: _propTypes.default.string.isRequired.if(function (
|
700
|
-
var labelText =
|
698
|
+
title: _propTypes.default.string.isRequired.if(function (_ref9) {
|
699
|
+
var labelText = _ref9.labelText;
|
701
700
|
return labelText;
|
702
701
|
})
|
703
702
|
};
|
@@ -31,7 +31,7 @@ var _TagSetModal = require("./TagSetModal");
|
|
31
31
|
|
32
32
|
var _react2 = require("@carbon/react");
|
33
33
|
|
34
|
-
var
|
34
|
+
var _useResizeObserver = require("../../global/js/hooks/useResizeObserver");
|
35
35
|
|
36
36
|
var _devtools = require("../../global/js/utils/devtools");
|
37
37
|
|
@@ -245,13 +245,11 @@ var TagSet = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
245
245
|
setShowAllModalOpen(false);
|
246
246
|
};
|
247
247
|
|
248
|
-
(0,
|
249
|
-
|
250
|
-
targetRef: sizingContainerRef
|
248
|
+
(0, _useResizeObserver.useResizeObserver)(sizingContainerRef, {
|
249
|
+
callback: handleSizerTagsResize
|
251
250
|
});
|
252
|
-
(0,
|
253
|
-
|
254
|
-
targetRef: tagSetRef
|
251
|
+
(0, _useResizeObserver.useResizeObserver)(tagSetRef, {
|
252
|
+
callback: handleResize
|
255
253
|
});
|
256
254
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
257
255
|
className: (0, _classnames.default)([blockClass, className]),
|
@@ -199,6 +199,11 @@ Tearsheet.propTypes = _objectSpread({
|
|
199
199
|
*/
|
200
200
|
portalTarget: _propTypes.default.node,
|
201
201
|
|
202
|
+
/**
|
203
|
+
* Specify a CSS selector that matches the DOM element that should be focused when the Modal opens
|
204
|
+
*/
|
205
|
+
selectorPrimaryFocus: _propTypes.default.string,
|
206
|
+
|
202
207
|
/**
|
203
208
|
* The main title of the tearsheet, displayed in the header area.
|
204
209
|
*/
|
@@ -21,7 +21,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
22
22
|
var _reactDom = require("react-dom");
|
23
23
|
|
24
|
-
var
|
24
|
+
var _useResizeObserver2 = require("../../global/js/hooks/useResizeObserver");
|
25
25
|
|
26
26
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
27
27
|
|
@@ -118,13 +118,11 @@ var TearsheetShell = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref)
|
|
118
118
|
}
|
119
119
|
}, [portalTargetIn]);
|
120
120
|
var localRef = (0, _react.useRef)();
|
121
|
+
var resizer = (0, _react.useRef)(null);
|
121
122
|
var modalRef = ref || localRef;
|
122
123
|
|
123
|
-
var
|
124
|
-
|
125
|
-
}),
|
126
|
-
width = _useResizeDetector.width,
|
127
|
-
resizer = _useResizeDetector.ref;
|
124
|
+
var _useResizeObserver = (0, _useResizeObserver2.useResizeObserver)(resizer),
|
125
|
+
width = _useResizeObserver.width;
|
128
126
|
|
129
127
|
var wide = size === 'wide'; // Keep track of the stack depth and our position in it (1-based, 0=closed)
|
130
128
|
|
package/lib/components/index.js
CHANGED
@@ -99,6 +99,12 @@ Object.defineProperty(exports, "EditFullPage", {
|
|
99
99
|
return _EditFullPage.EditFullPage;
|
100
100
|
}
|
101
101
|
});
|
102
|
+
Object.defineProperty(exports, "EditInPlace", {
|
103
|
+
enumerable: true,
|
104
|
+
get: function get() {
|
105
|
+
return _EditInPlace.EditInPlace;
|
106
|
+
}
|
107
|
+
});
|
102
108
|
Object.defineProperty(exports, "EditSidePanel", {
|
103
109
|
enumerable: true,
|
104
110
|
get: function get() {
|
@@ -171,18 +177,6 @@ Object.defineProperty(exports, "ImportModal", {
|
|
171
177
|
return _ImportModal.ImportModal;
|
172
178
|
}
|
173
179
|
});
|
174
|
-
Object.defineProperty(exports, "InlineEdit", {
|
175
|
-
enumerable: true,
|
176
|
-
get: function get() {
|
177
|
-
return _InlineEdit.InlineEdit;
|
178
|
-
}
|
179
|
-
});
|
180
|
-
Object.defineProperty(exports, "ModifiedTabs", {
|
181
|
-
enumerable: true,
|
182
|
-
get: function get() {
|
183
|
-
return _ModifiedTabs.ModifiedTabs;
|
184
|
-
}
|
185
|
-
});
|
186
180
|
Object.defineProperty(exports, "MultiAddSelect", {
|
187
181
|
enumerable: true,
|
188
182
|
get: function get() {
|
@@ -482,8 +476,6 @@ var _HTTPErrors = require("./HTTPErrors");
|
|
482
476
|
|
483
477
|
var _ImportModal = require("./ImportModal");
|
484
478
|
|
485
|
-
var _ModifiedTabs = require("./ModifiedTabs");
|
486
|
-
|
487
479
|
var _MultiAddSelect = require("./MultiAddSelect");
|
488
480
|
|
489
481
|
var _NotificationsPanel = require("./NotificationsPanel");
|
@@ -516,7 +508,7 @@ var _EditSidePanel = require("./EditSidePanel");
|
|
516
508
|
|
517
509
|
var _OptionsTile = require("./OptionsTile");
|
518
510
|
|
519
|
-
var
|
511
|
+
var _EditInPlace = require("./EditInPlace");
|
520
512
|
|
521
513
|
var _DataSpreadsheet = require("./DataSpreadsheet");
|
522
514
|
|
@@ -0,0 +1,91 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.useResizeObserver = void 0;
|
9
|
+
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
11
|
+
|
12
|
+
var _react = require("react");
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Copyright IBM Corp. 2023, 2023
|
16
|
+
*
|
17
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
18
|
+
* LICENSE file in the root directory of this source tree.
|
19
|
+
*/
|
20
|
+
var useResizeObserver = function useResizeObserver(ref) {
|
21
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
22
|
+
callback: null,
|
23
|
+
throttleInterval: 0
|
24
|
+
};
|
25
|
+
var callback = options.callback,
|
26
|
+
throttleInterval = options.throttleInterval;
|
27
|
+
|
28
|
+
var _useState = (0, _react.useState)(0),
|
29
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
30
|
+
width = _useState2[0],
|
31
|
+
setWidth = _useState2[1];
|
32
|
+
|
33
|
+
var _useState3 = (0, _react.useState)(0),
|
34
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
35
|
+
height = _useState4[0],
|
36
|
+
setHeight = _useState4[1];
|
37
|
+
|
38
|
+
var throttleTimeout = (0, _react.useRef)(null);
|
39
|
+
var entriesToHandle = (0, _react.useRef)(null);
|
40
|
+
(0, _react.useLayoutEffect)(function () {
|
41
|
+
if (!(ref !== null && ref !== void 0 && ref.current)) {
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
|
45
|
+
var doCallbacks = function doCallbacks() {
|
46
|
+
if (!(ref !== null && ref !== void 0 && ref.current) || !Array.isArray(entriesToHandle === null || entriesToHandle === void 0 ? void 0 : entriesToHandle.current)) {
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
|
50
|
+
var entry = entriesToHandle.current[0];
|
51
|
+
setWidth(entry.contentRect.width);
|
52
|
+
setHeight(entry.contentRect.height);
|
53
|
+
throttleTimeout.current = null;
|
54
|
+
callback && callback(entry.contentRect);
|
55
|
+
};
|
56
|
+
|
57
|
+
var observer = new ResizeObserver(function (entries) {
|
58
|
+
// always update entriesToHandle
|
59
|
+
entriesToHandle.current = entries;
|
60
|
+
|
61
|
+
if (throttleInterval) {
|
62
|
+
// if a throttleInterval check for running timeout
|
63
|
+
if (throttleTimeout.current === null) {
|
64
|
+
// no live timeout set entries to handle and move on
|
65
|
+
// set up throttle
|
66
|
+
throttleTimeout.current = setTimeout(function () {
|
67
|
+
// do callbacks
|
68
|
+
doCallbacks(); // reset throttle
|
69
|
+
|
70
|
+
throttleTimeout.current = null;
|
71
|
+
}, throttleInterval);
|
72
|
+
}
|
73
|
+
} else {
|
74
|
+
// no throttle do callbacks every time
|
75
|
+
doCallbacks();
|
76
|
+
}
|
77
|
+
}); // observe all refs passed
|
78
|
+
|
79
|
+
observer.observe(ref.current);
|
80
|
+
return function () {
|
81
|
+
observer.disconnect();
|
82
|
+
observer = null;
|
83
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
84
|
+
}, [ref, options]);
|
85
|
+
return {
|
86
|
+
width: width,
|
87
|
+
height: height
|
88
|
+
};
|
89
|
+
};
|
90
|
+
|
91
|
+
exports.useResizeObserver = useResizeObserver;
|
@@ -14,6 +14,12 @@ var _react = require("react");
|
|
14
14
|
|
15
15
|
var _scrollableAncestor = require("../utils/scrollableAncestor");
|
16
16
|
|
17
|
+
/**
|
18
|
+
* Copyright IBM Corp. 2022, 2023
|
19
|
+
*
|
20
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
21
|
+
* LICENSE file in the root directory of this source tree.
|
22
|
+
*/
|
17
23
|
var windowExists = (typeof window === "undefined" ? "undefined" : (0, _typeof2.default)(window)) !== "undefined";
|
18
24
|
|
19
25
|
var useTargetScroll = function useTargetScroll(target, effect, deps, throttleInterval) {
|
@@ -31,6 +31,7 @@ var defaults = {
|
|
31
31
|
CreateTearsheet: true,
|
32
32
|
CreateTearsheetStep: true,
|
33
33
|
CreateTearsheetDivider: true,
|
34
|
+
EditInPlace: true,
|
34
35
|
EmptyState: true,
|
35
36
|
ErrorEmptyState: true,
|
36
37
|
ExportModal: true,
|
@@ -39,8 +40,6 @@ var defaults = {
|
|
39
40
|
HTTPError404: true,
|
40
41
|
HTTPErrorOther: true,
|
41
42
|
ImportModal: true,
|
42
|
-
InlineEdit: true,
|
43
|
-
InlineEditV1: true,
|
44
43
|
MultiAddSelect: true,
|
45
44
|
NotificationsPanel: true,
|
46
45
|
NoDataEmptyState: true,
|
@@ -64,7 +63,6 @@ var defaults = {
|
|
64
63
|
WebTerminalContentWrapper: true,
|
65
64
|
WebTerminalProvider: true,
|
66
65
|
// other public components not yet reviewed and released:
|
67
|
-
ModifiedTabs: false,
|
68
66
|
Toolbar: false,
|
69
67
|
ToolbarButton: false,
|
70
68
|
ToolbarGroup: false,
|
@@ -75,8 +73,7 @@ var defaults = {
|
|
75
73
|
EditTearsheet: false,
|
76
74
|
EditTearsheetNarrow: false,
|
77
75
|
EditFullPage: false,
|
78
|
-
EditUpdateCards: false
|
79
|
-
InlineEditV2: false
|
76
|
+
EditUpdateCards: false
|
80
77
|
/* new component flags here - comment used by generate CLI */
|
81
78
|
|
82
79
|
},
|
@@ -84,7 +81,8 @@ var defaults = {
|
|
84
81
|
feature: {
|
85
82
|
'a-new-feature': false,
|
86
83
|
'default-portal-target-body': true,
|
87
|
-
'Datagrid.useInfiniteScroll': false
|
84
|
+
'Datagrid.useInfiniteScroll': false,
|
85
|
+
'Datagrid.useInlineEdit': false
|
88
86
|
}
|
89
87
|
};
|
90
88
|
|
package/lib/settings.js
CHANGED
@@ -15,34 +15,54 @@ var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
16
16
|
var _themes = require("@carbon/themes");
|
17
17
|
|
18
|
+
var _pconsole = _interopRequireDefault(require("./global/js/utils/pconsole"));
|
19
|
+
|
18
20
|
var carbon = {
|
19
21
|
get themes() {
|
20
22
|
return _themes.themes;
|
21
23
|
},
|
22
24
|
|
23
25
|
prefix: 'cds'
|
26
|
+
};
|
27
|
+
exports.carbon = carbon;
|
28
|
+
|
29
|
+
var componentDeprecatedWarning = function componentDeprecatedWarning(name, details) {
|
30
|
+
return "Carbon for IBM Products (WARNING): Component \"".concat(name, "\" is deprecated. ").concat(details);
|
31
|
+
};
|
32
|
+
|
33
|
+
_packageSettings.default.logDeprecated = function (component, name) {
|
34
|
+
if (component !== null && component !== void 0 && component.deprecated) {
|
35
|
+
var _pconsole$level;
|
36
|
+
|
37
|
+
var _component$deprecated = component.deprecated,
|
38
|
+
level = _component$deprecated.level,
|
39
|
+
details = _component$deprecated.details;
|
40
|
+
var logUsing = (_pconsole$level = _pconsole.default === null || _pconsole.default === void 0 ? void 0 : _pconsole.default[level]) !== null && _pconsole$level !== void 0 ? _pconsole$level : _pconsole.default.error;
|
41
|
+
logUsing(componentDeprecatedWarning(name || component.displayName, details));
|
42
|
+
}
|
24
43
|
}; // Check that a component is enabled. This function returns a stub which checks
|
25
44
|
// the component status on first use and then renders as the component or as
|
26
45
|
// a Canary placeholder initialized with the name of the replaced component.
|
27
46
|
// Note that the returned stub carries any other properties which had already
|
28
47
|
// been assigned (eg propTypes, displayName, etc).
|
29
48
|
|
30
|
-
exports.carbon = carbon;
|
31
49
|
|
32
50
|
_packageSettings.default.checkComponentEnabled = function (component, name) {
|
33
51
|
if (component.render) {
|
34
52
|
// The component is a forward-ref, so make a stub forward-ref.
|
35
53
|
var forward = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
54
|
+
_packageSettings.default.logDeprecated(component, name); // may log don't care about result
|
55
|
+
// Replace the stub's render fn so this test only happens once.
|
56
|
+
|
57
|
+
|
58
|
+
return (forward.render = _packageSettings.default.isComponentEnabled(name) || !_packageSettings.default.isComponentPublic(name) ? // If the component is enabled, or if it's not a public component,
|
59
|
+
// replace the stub's render fn with the component's render fn.
|
60
|
+
component.render : // Note that Canary is a direct render fn (not a forward-ref) and
|
61
|
+
// will ignore the passed props and ref (if any)
|
62
|
+
_Canary.Canary.bind(undefined, {
|
63
|
+
componentName: name
|
64
|
+
}))( // Call it now (after this it will be directly called).
|
65
|
+
props, ref);
|
46
66
|
}); // Transfer object properties already assigned (eg propTypes, displayName)
|
47
67
|
// then merge in the stub forward-ref which checks the component status
|
48
68
|
// when first used.
|
@@ -52,16 +72,18 @@ _packageSettings.default.checkComponentEnabled = function (component, name) {
|
|
52
72
|
} else {
|
53
73
|
// The component is a direct render fn, so make a stub render fn.
|
54
74
|
var _render = function render(props) {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
75
|
+
_packageSettings.default.logDeprecated(component, name); // may log don't care about result
|
76
|
+
// Replace the stub render fn so this test only happens once.
|
77
|
+
|
78
|
+
|
79
|
+
return (_render = _packageSettings.default.isComponentEnabled(name) || !_packageSettings.default.isComponentPublic(name) ? // If the component is enabled, or if it's not a public component,
|
80
|
+
// replace the stub render fn with the component render fn.
|
81
|
+
component : // Replace the stub render fn with the Canary render fn, which will
|
82
|
+
// ignore the passed props.
|
83
|
+
_Canary.Canary.bind(undefined, {
|
84
|
+
componentName: name
|
85
|
+
}))( // Call it now (after this it will be directly called).
|
86
|
+
props);
|
65
87
|
}; // Transfer object properties already assigned (eg propTypes, displayName)
|
66
88
|
// to a function which calls the stub render fn which checks the component
|
67
89
|
// status when first used.
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.0.0-rc.
|
4
|
+
"version": "2.0.0-rc.29",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"repository": {
|
12
12
|
"type": "git",
|
13
13
|
"url": "https://github.com/carbon-design-system/ibm-cloud-cognitive.git",
|
14
|
-
"directory": "packages/
|
14
|
+
"directory": "packages/ibm-products"
|
15
15
|
},
|
16
16
|
"bugs": "https://github.com/carbon-design-system/ibm-cloud-cognitive/issues",
|
17
17
|
"sideEffects": [
|
@@ -80,7 +80,6 @@
|
|
80
80
|
"immutability-helper": "^3.1.1",
|
81
81
|
"react-dnd": "^15.1.2",
|
82
82
|
"react-dnd-html5-backend": "^15.1.3",
|
83
|
-
"react-resize-detector": "^7.1.2",
|
84
83
|
"react-table": "^7.8.0",
|
85
84
|
"react-window": "^1.8.7"
|
86
85
|
},
|
@@ -94,5 +93,5 @@
|
|
94
93
|
"react": "^16.8.6 || ^17.0.1",
|
95
94
|
"react-dom": "^16.8.6 || ^17.0.1"
|
96
95
|
},
|
97
|
-
"gitHead": "
|
96
|
+
"gitHead": "16ba4d09a98be1ea3c64f6ee4323d08529e12a34"
|
98
97
|
}
|