@carbon/ibm-products 2.0.0-rc.27 → 2.0.0-rc.28
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +71 -221
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +3 -5
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +142 -189
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -3
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +71 -221
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +3 -5
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +71 -221
- package/css/index.css.map +1 -1
- package/css/index.min.css +3 -5
- package/css/index.min.css.map +1 -1
- package/es/components/AboutModal/AboutModal.js +3 -4
- package/es/components/ActionBar/ActionBar.js +13 -29
- 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/useFiltering.js +4 -2
- 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/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/TearsheetShell.js +4 -6
- package/es/components/index.js +1 -1
- 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 +2 -4
- package/lib/components/AboutModal/AboutModal.js +3 -4
- package/lib/components/ActionBar/ActionBar.js +13 -29
- 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/useFiltering.js +4 -2
- 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/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/TearsheetShell.js +4 -6
- package/lib/components/index.js +7 -7
- 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 +2 -4
- package/package.json +3 -4
- package/scss/components/BreadcrumbWithOverflow/_breadcrumb-with-overflow.scss +10 -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 -2
- package/scss/components/_index.scss +1 -2
- 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/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/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/{InlineEditV2 → EditInPlace}/_carbon-imports.scss +0 -0
@@ -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]),
|
@@ -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,12 +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
180
|
Object.defineProperty(exports, "ModifiedTabs", {
|
181
181
|
enumerable: true,
|
182
182
|
get: function get() {
|
@@ -516,7 +516,7 @@ var _EditSidePanel = require("./EditSidePanel");
|
|
516
516
|
|
517
517
|
var _OptionsTile = require("./OptionsTile");
|
518
518
|
|
519
|
-
var
|
519
|
+
var _EditInPlace = require("./EditInPlace");
|
520
520
|
|
521
521
|
var _DataSpreadsheet = require("./DataSpreadsheet");
|
522
522
|
|
@@ -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,
|
@@ -75,8 +74,7 @@ var defaults = {
|
|
75
74
|
EditTearsheet: false,
|
76
75
|
EditTearsheetNarrow: false,
|
77
76
|
EditFullPage: false,
|
78
|
-
EditUpdateCards: false
|
79
|
-
InlineEditV2: false
|
77
|
+
EditUpdateCards: false
|
80
78
|
/* new component flags here - comment used by generate CLI */
|
81
79
|
|
82
80
|
},
|
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.28",
|
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": "d459d01283f68efa6a4bfbdc79a97bf508f83f6b"
|
98
97
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
//
|
2
|
-
// Copyright IBM Corp. 2020,
|
2
|
+
// Copyright IBM Corp. 2020, 2023
|
3
3
|
//
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
@@ -47,6 +47,15 @@ $_block-class: #{c4p-settings.$pkg-prefix}--breadcrumb-with-overflow;
|
|
47
47
|
display: none;
|
48
48
|
}
|
49
49
|
|
50
|
+
.#{$_block-class}__back__button.#{c4p-settings.$carbon-prefix}--btn {
|
51
|
+
min-height: revert;
|
52
|
+
padding: 0;
|
53
|
+
}
|
54
|
+
|
55
|
+
.#{$_block-class}__back__button.#{c4p-settings.$carbon-prefix}--btn--ghost:hover {
|
56
|
+
background-color: inherit;
|
57
|
+
}
|
58
|
+
|
50
59
|
@include breakpoint-down(md) {
|
51
60
|
.#{c4p-settings.$carbon-prefix}--breadcrumb-item {
|
52
61
|
display: none;
|
@@ -1,14 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
*/
|
1
|
+
//
|
2
|
+
// Copyright IBM Corp. 2021, 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
|
+
//
|
8
7
|
|
9
8
|
@use '@carbon/styles/scss/spacing' as *;
|
10
9
|
@use '@carbon/styles/scss/theme' as *;
|
11
10
|
@use './variables';
|
11
|
+
@use '../../../global/styles/project-settings' as c4p-settings;
|
12
12
|
|
13
13
|
.#{variables.$block-class}__grid-container {
|
14
14
|
th.#{variables.$block-class}__select-all-toggle-on,
|
@@ -31,3 +31,7 @@ th.#{variables.$block-class}__select-all-toggle-on {
|
|
31
31
|
th.#{variables.$block-class}__select-all-toggle-on.button {
|
32
32
|
margin-left: $spacing-01;
|
33
33
|
}
|
34
|
+
|
35
|
+
.#{variables.$block-class}__select-all-toggle-overflow.#{c4p-settings.$carbon-prefix}--overflow-menu-options--sm.#{c4p-settings.$carbon-prefix}--overflow-menu-options[data-floating-menu-direction='bottom']::after {
|
36
|
+
width: $spacing-13;
|
37
|
+
}
|
package/scss/components/{InlineEditV2/_inline-edit-v2.scss → EditInPlace/_edit-in-place.scss}
RENAMED
@@ -12,17 +12,32 @@
|
|
12
12
|
@use '@carbon/styles/scss/type';
|
13
13
|
@use '@carbon/styles/scss/motion' as *;
|
14
14
|
|
15
|
-
$block-class: #{$pkg-prefix}--
|
15
|
+
$block-class: #{$pkg-prefix}--edit-in-place;
|
16
16
|
$carbon-input: #{$carbon-prefix}--text-input;
|
17
17
|
|
18
18
|
.#{$block-class} {
|
19
|
+
--#{$block-class}--size: #{$spacing-07};
|
20
|
+
|
19
21
|
display: flex;
|
20
22
|
align-items: center;
|
21
23
|
background: transparent;
|
22
24
|
cursor: pointer;
|
23
25
|
}
|
24
26
|
|
25
|
-
.#{$block-class}
|
27
|
+
.#{$block-class}--sm {
|
28
|
+
--#{$block-class}--size: #{$spacing-07};
|
29
|
+
}
|
30
|
+
|
31
|
+
.#{$block-class}--md {
|
32
|
+
--#{$block-class}--size: #{$spacing-08};
|
33
|
+
}
|
34
|
+
|
35
|
+
.#{$block-class}--lg {
|
36
|
+
/* April 2023 max text input size */
|
37
|
+
--#{$block-class}--size: #{$spacing-09};
|
38
|
+
}
|
39
|
+
|
40
|
+
.#{$block-class}--readonly {
|
26
41
|
cursor: not-allowed;
|
27
42
|
}
|
28
43
|
|
@@ -30,7 +45,8 @@ $carbon-input: #{$carbon-prefix}--text-input;
|
|
30
45
|
background: $field-01;
|
31
46
|
}
|
32
47
|
|
33
|
-
.#{$block-class}:hover .#{$block-class}__btn-edit
|
48
|
+
.#{$block-class}:hover .#{$block-class}__btn-edit,
|
49
|
+
.#{$block-class}__btn-edit.#{$block-class}__btn-edit--always-visible {
|
34
50
|
visibility: visible;
|
35
51
|
}
|
36
52
|
|
@@ -38,6 +54,10 @@ $carbon-input: #{$carbon-prefix}--text-input;
|
|
38
54
|
visibility: hidden;
|
39
55
|
}
|
40
56
|
|
57
|
+
.#{$block-class}--invalid {
|
58
|
+
outline: 2px solid $support-error;
|
59
|
+
}
|
60
|
+
|
41
61
|
.#{$block-class}--focused {
|
42
62
|
background: $field-01;
|
43
63
|
outline: 2px solid $focus;
|
@@ -47,12 +67,32 @@ $carbon-input: #{$carbon-prefix}--text-input;
|
|
47
67
|
flex: 1;
|
48
68
|
}
|
49
69
|
|
70
|
+
.#{$block-class}--inherit-type .#{$block-class}__text-input {
|
71
|
+
/* match font of container */
|
72
|
+
font-size: inherit;
|
73
|
+
font-weight: inherit;
|
74
|
+
letter-spacing: inherit;
|
75
|
+
line-height: inherit;
|
76
|
+
}
|
77
|
+
|
78
|
+
.#{$block-class}__ellipsis {
|
79
|
+
position: relative;
|
80
|
+
margin-left: calc(-1 * $spacing-05);
|
81
|
+
opacity: 0;
|
82
|
+
}
|
83
|
+
|
84
|
+
.#{$block-class}--overflows:not(.#{$block-class}--focused)
|
85
|
+
.#{$block-class}__ellipsis {
|
86
|
+
opacity: 1;
|
87
|
+
}
|
88
|
+
|
50
89
|
.#{$block-class}__text-input-label {
|
51
90
|
display: none;
|
52
91
|
}
|
53
92
|
|
54
93
|
.#{$block-class}__warning-icon {
|
55
|
-
|
94
|
+
width: $spacing-05;
|
95
|
+
margin: auto $spacing-03;
|
56
96
|
color: $support-error;
|
57
97
|
}
|
58
98
|
|
@@ -71,11 +111,11 @@ $carbon-input: #{$carbon-prefix}--text-input;
|
|
71
111
|
outline: none;
|
72
112
|
}
|
73
113
|
|
74
|
-
.#{$block-class}-readonly .#{$block-class}__text-input.#{$carbon-input},
|
75
|
-
.#{$block-class}-readonly
|
76
|
-
|
77
|
-
|
78
|
-
}
|
114
|
+
// .#{$block-class}-readonly .#{$block-class}__text-input.#{$carbon-input},
|
115
|
+
// .#{$block-class}-readonly
|
116
|
+
// .#{$carbon-prefix}--btn.#{$carbon-prefix}--btn--icon-only.#{$carbon-prefix}--tooltip__trigger {
|
117
|
+
// cursor: not-allowed;
|
118
|
+
// }
|
79
119
|
|
80
120
|
.#{$block-class}__text-input.#{$carbon-input}:focus,
|
81
121
|
.#{$block-class}__text-input.#{$carbon-input}:active {
|
@@ -83,18 +123,20 @@ $carbon-input: #{$carbon-prefix}--text-input;
|
|
83
123
|
}
|
84
124
|
|
85
125
|
.#{$block-class}__toolbar {
|
86
|
-
--toolbar-width:
|
87
|
-
--toolbar-width-focussed:
|
126
|
+
--toolbar-width: var(--#{$block-class}--size);
|
127
|
+
--toolbar-width-focussed: calc(2 * var(--#{$block-class}--size));
|
88
128
|
|
89
129
|
// animation div
|
90
130
|
display: inline-flex;
|
91
|
-
overflow: hidden;
|
92
131
|
width: var(--toolbar-width);
|
93
132
|
}
|
94
133
|
|
95
134
|
.#{$block-class}--invalid .#{$block-class}__toolbar {
|
96
|
-
|
97
|
-
--toolbar-width
|
135
|
+
// width of invalid icon is always $spacing-07 ($spacing-05 + 2 * $spacing-03 margin)
|
136
|
+
--toolbar-width: calc(var(--#{$block-class}--size) + #{$spacing-07});
|
137
|
+
--toolbar-width-focussed: calc(
|
138
|
+
2 * var(--#{$block-class}--size) + #{$spacing-07}
|
139
|
+
);
|
98
140
|
}
|
99
141
|
|
100
142
|
@keyframes slide-in {
|
@@ -4,24 +4,12 @@
|
|
4
4
|
// This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
6
6
|
//
|
7
|
-
|
8
|
-
@use '@carbon/type/scss/scale';
|
9
7
|
@use '../../global/styles/display-box';
|
10
|
-
@use '../../global/styles/project-settings' as c4p-settings;
|
11
8
|
|
12
|
-
|
9
|
+
$block-class: 'edit-in-place-example';
|
10
|
+
|
11
|
+
.#{$block-class}__viewport {
|
13
12
|
// width: 300px; // larger than standard size needed by text input at standard font size (html input attribute size)
|
14
13
|
// stylelint-disable-next-line carbon/layout-token-use
|
15
14
|
margin: 100px;
|
16
15
|
}
|
17
|
-
|
18
|
-
$block-class: #{c4p-settings.$pkg-prefix}--inline-edit;
|
19
|
-
|
20
|
-
.component-full-width {
|
21
|
-
.#{$block-class} {
|
22
|
-
width: 100%;
|
23
|
-
}
|
24
|
-
.#{$block-class} .#{$block-class}__input {
|
25
|
-
@include scale.font-size(2);
|
26
|
-
}
|
27
|
-
}
|
@@ -357,7 +357,7 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
357
357
|
}
|
358
358
|
|
359
359
|
.#{$block-class}__title-row {
|
360
|
-
margin-top:
|
360
|
+
margin-top: $spacing-01; /* spacing needed in case of editable title, otherwise top of focus indicator hidden */
|
361
361
|
margin-bottom: 0;
|
362
362
|
transform: translateY(
|
363
363
|
$spacing-01
|
@@ -436,12 +436,6 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
436
436
|
white-space: nowrap;
|
437
437
|
}
|
438
438
|
|
439
|
-
.#{$block-class}__title .#{$pkg-prefix}--inline-edit__value {
|
440
|
-
// The heading text sits 2px pixels lower in the inline edit which is aligned center
|
441
|
-
// stylelint-disable-next-line carbon/layout-token-use
|
442
|
-
transform: translateY(-2px);
|
443
|
-
}
|
444
|
-
|
445
439
|
.#{$block-class}__title--editable {
|
446
440
|
display: flex;
|
447
441
|
overflow: visible;
|
@@ -17,11 +17,11 @@
|
|
17
17
|
@use './CreateSidePanel/index-with-carbon' as *;
|
18
18
|
@use './CreateTearsheetNarrow/index-with-carbon' as *;
|
19
19
|
@use './CreateTearsheet/index-with-carbon' as *;
|
20
|
+
@use './EditInPlace/index-with-carbon' as *;
|
20
21
|
@use './EmptyStates/index-with-carbon' as *;
|
21
22
|
@use './ExportModal/index-with-carbon' as *;
|
22
23
|
@use './ExpressiveCard/index-with-carbon' as *;
|
23
24
|
@use './HTTPErrors/index-with-carbon' as *;
|
24
|
-
@use './InlineEditV1/index-with-carbon' as *;
|
25
25
|
@use './ImportModal/index-with-carbon' as *;
|
26
26
|
@use './MultiAddSelect/index-with-carbon' as *;
|
27
27
|
@use './NotificationsPanel/index-with-carbon' as *;
|
@@ -17,11 +17,11 @@
|
|
17
17
|
@use './CreateSidePanel';
|
18
18
|
@use './CreateTearsheetNarrow';
|
19
19
|
@use './CreateTearsheet';
|
20
|
+
@use './EditInPlace';
|
20
21
|
@use './EmptyStates';
|
21
22
|
@use './ExportModal';
|
22
23
|
@use './ExpressiveCard';
|
23
24
|
@use './HTTPErrors';
|
24
|
-
@use './InlineEditV1';
|
25
25
|
@use './ImportModal';
|
26
26
|
@use './MultiAddSelect';
|
27
27
|
@use './NotificationsPanel';
|
@@ -42,8 +42,7 @@
|
|
42
42
|
@use './UserProfileImage/index-with-carbon' as *;
|
43
43
|
@use './EditSidePanel/index-with-carbon' as *;
|
44
44
|
@use './OptionsTile/index-with-carbon' as *;
|
45
|
-
@use './
|
46
|
-
@use './InlineEditV2/index-with-carbon' as *;
|
45
|
+
@use './EditInPlace/index-with-carbon' as *;
|
47
46
|
@use './DataSpreadsheet/index-with-carbon' as *;
|
48
47
|
@use './Datagrid/index-with-carbon' as *;
|
49
48
|
@use './EditUpdateCards/index-with-carbon' as *;
|