@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
@@ -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
|
};
|
@@ -26,9 +26,19 @@ var useOnRowClick = function useOnRowClick(hooks) {
|
|
26
26
|
}
|
27
27
|
};
|
28
28
|
|
29
|
+
var onKeyDown = function onKeyDown(event) {
|
30
|
+
var key = event.key;
|
31
|
+
|
32
|
+
if (key === 'Enter') {
|
33
|
+
onClick();
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
29
37
|
return [props, {
|
30
|
-
onClick: onClick
|
38
|
+
onClick: onClick,
|
39
|
+
onKeyDown: onKeyDown
|
31
40
|
}, {
|
41
|
+
tabIndex: 0,
|
32
42
|
style: {
|
33
43
|
cursor: 'pointer'
|
34
44
|
}
|
@@ -81,6 +81,7 @@ var SelectRow = function SelectRow(datagridState) {
|
|
81
81
|
radio = datagridState.radio,
|
82
82
|
toggleAllRowsSelected = datagridState.toggleAllRowsSelected,
|
83
83
|
onRadioSelect = datagridState.onRadioSelect,
|
84
|
+
onRowSelect = datagridState.onRowSelect,
|
84
85
|
columns = datagridState.columns,
|
85
86
|
withStickyColumn = datagridState.withStickyColumn;
|
86
87
|
|
@@ -121,6 +122,7 @@ var SelectRow = function SelectRow(datagridState) {
|
|
121
122
|
}
|
122
123
|
|
123
124
|
onChange(e);
|
125
|
+
onRowSelect === null || onRowSelect === void 0 ? void 0 : onRowSelect(row, e);
|
124
126
|
},
|
125
127
|
id: "".concat(tableId, "-").concat(row.index),
|
126
128
|
name: "".concat(tableId, "-").concat(row.index, "-name"),
|
@@ -1,8 +1,13 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["cancelLabel", "editLabel", "id", "invalid", "invalidLabel", "labelText", "onCancel", "onChange", "onSave", "saveLabel", "value"];
|
6
|
+
var _excluded = ["cancelLabel", "editAlwaysVisible", "editLabel", "id", "inheritTypography", "invalid", "invalidLabel", "invalidText", "labelText", "onCancel", "onChange", "onSave", "saveLabel", "size", "tooltipAlignment", "value"];
|
7
|
+
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
9
|
+
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
11
|
|
7
12
|
/**
|
8
13
|
* Copyright IBM Corp. 2022, 2022
|
@@ -18,21 +23,31 @@ import { Edit, Checkmark, Close, // EditOff,
|
|
18
23
|
WarningFilled } from '@carbon/react/icons';
|
19
24
|
import { pkg, carbon } from '../../settings';
|
20
25
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
21
|
-
var componentName = '
|
22
|
-
var blockClass = "".concat(pkg.prefix, "--
|
23
|
-
|
26
|
+
var componentName = 'EditInPlace';
|
27
|
+
var blockClass = "".concat(pkg.prefix, "--edit-in-place");
|
28
|
+
var defaults = {
|
29
|
+
tooltipAlignment: 'top',
|
30
|
+
size: 'sm'
|
31
|
+
};
|
32
|
+
export var EditInPlace = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
24
33
|
var _cx;
|
25
34
|
|
26
35
|
var cancelLabel = _ref.cancelLabel,
|
36
|
+
editAlwaysVisible = _ref.editAlwaysVisible,
|
27
37
|
editLabel = _ref.editLabel,
|
28
38
|
id = _ref.id,
|
39
|
+
inheritTypography = _ref.inheritTypography,
|
29
40
|
invalid = _ref.invalid,
|
30
|
-
|
41
|
+
deprecated_invalidLabel = _ref.invalidLabel,
|
42
|
+
invalidText = _ref.invalidText,
|
31
43
|
labelText = _ref.labelText,
|
32
44
|
onCancel = _ref.onCancel,
|
33
45
|
onChange = _ref.onChange,
|
34
46
|
onSave = _ref.onSave,
|
35
47
|
saveLabel = _ref.saveLabel,
|
48
|
+
_ref$size = _ref.size,
|
49
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
50
|
+
tooltipAlignment = _ref.tooltipAlignment,
|
36
51
|
value = _ref.value,
|
37
52
|
rest = _objectWithoutProperties(_ref, _excluded);
|
38
53
|
|
@@ -54,20 +69,27 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
54
69
|
var inputRef = useRef(null);
|
55
70
|
var canSave = value !== initialValue && !invalid;
|
56
71
|
var escaping = useRef(false);
|
72
|
+
var tipAlignIsObject = _typeof(tooltipAlignment) === 'object';
|
73
|
+
var tipAlignments = ['edit', 'save', 'cancel'].reduce(function (acc, tips) {
|
74
|
+
var _ref2;
|
75
|
+
|
76
|
+
acc[tips] = (_ref2 = tipAlignIsObject ? tooltipAlignment[tips] : tooltipAlignment) !== null && _ref2 !== void 0 ? _ref2 : defaults.tooltipAlignment;
|
77
|
+
return acc;
|
78
|
+
}, {});
|
57
79
|
useEffect(function () {
|
58
80
|
if (!initialValue && !dirtyInput) {
|
59
81
|
setInitialValue(value);
|
60
82
|
}
|
61
83
|
}, [initialValue, dirtyInput, value]);
|
62
84
|
|
63
|
-
var isTargetingChild = function isTargetingChild(
|
64
|
-
var currentTarget =
|
65
|
-
relatedTarget =
|
85
|
+
var isTargetingChild = function isTargetingChild(_ref3) {
|
86
|
+
var currentTarget = _ref3.currentTarget,
|
87
|
+
relatedTarget = _ref3.relatedTarget;
|
66
88
|
return currentTarget.contains(relatedTarget);
|
67
89
|
};
|
68
90
|
|
69
|
-
var onChangeHandler = function onChangeHandler(
|
70
|
-
var target =
|
91
|
+
var onChangeHandler = function onChangeHandler(_ref4) {
|
92
|
+
var target = _ref4.target;
|
71
93
|
|
72
94
|
if (!dirtyInput) {
|
73
95
|
setDirtyInput(true);
|
@@ -149,7 +171,7 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
149
171
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
150
172
|
ref: ref
|
151
173
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement("div", {
|
152
|
-
className: cx(blockClass, (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "--focused"), focused), _defineProperty(_cx, "".concat(blockClass, "--invalid"), invalid), _cx)),
|
174
|
+
className: cx(blockClass, "".concat(blockClass, "--").concat(size), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "--focused"), focused), _defineProperty(_cx, "".concat(blockClass, "--invalid"), invalid), _defineProperty(_cx, "".concat(blockClass, "--inherit-type"), inheritTypography), _defineProperty(_cx, "".concat(blockClass, "--overflows"), inputRef.current && inputRef.current.scrollWidth > inputRef.current.offsetWidth), _cx)),
|
153
175
|
onFocus: onFocusHandler,
|
154
176
|
onBlur: onBlurHandler
|
155
177
|
}, /*#__PURE__*/React.createElement("label", {
|
@@ -157,7 +179,7 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
157
179
|
htmlFor: id
|
158
180
|
}, labelText), /*#__PURE__*/React.createElement("input", {
|
159
181
|
id: id,
|
160
|
-
className: cx("".concat(blockClass, "__text-input"), "".concat(carbon.prefix, "--text-input"), "".concat(carbon.prefix, "--text-input--
|
182
|
+
className: cx("".concat(blockClass, "__text-input"), "".concat(carbon.prefix, "--text-input"), "".concat(carbon.prefix, "--text-input--").concat(size)),
|
161
183
|
type: "text",
|
162
184
|
value: value,
|
163
185
|
onChange: onChangeHandler,
|
@@ -165,12 +187,16 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
165
187
|
,
|
166
188
|
onKeyDown: onKeyHandler
|
167
189
|
}), /*#__PURE__*/React.createElement("div", {
|
190
|
+
className: "".concat(blockClass, "__ellipsis"),
|
191
|
+
"aria-hidden": !focused
|
192
|
+
}, "\u2026"), /*#__PURE__*/React.createElement("div", {
|
168
193
|
className: "".concat(blockClass, "__toolbar")
|
169
|
-
},
|
194
|
+
}, invalid && /*#__PURE__*/React.createElement(WarningFilled, {
|
170
195
|
size: 16,
|
171
196
|
className: "".concat(blockClass, "__warning-icon")
|
172
|
-
}), /*#__PURE__*/React.createElement(IconButton, {
|
173
|
-
|
197
|
+
}), focused ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IconButton, {
|
198
|
+
align: tipAlignments.cancel,
|
199
|
+
size: size,
|
174
200
|
label: cancelLabel,
|
175
201
|
onClick: onCancelHandler,
|
176
202
|
kind: "ghost",
|
@@ -180,7 +206,8 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
180
206
|
}, /*#__PURE__*/React.createElement(Close, {
|
181
207
|
size: 16
|
182
208
|
})), /*#__PURE__*/React.createElement(IconButton, {
|
183
|
-
|
209
|
+
align: tipAlignments.save,
|
210
|
+
size: size,
|
184
211
|
label: saveLabel,
|
185
212
|
onClick: onSaveHandler,
|
186
213
|
kind: "ghost",
|
@@ -191,8 +218,9 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
191
218
|
}, /*#__PURE__*/React.createElement(Checkmark, {
|
192
219
|
size: 16
|
193
220
|
}))) : /*#__PURE__*/React.createElement(IconButton, {
|
194
|
-
|
195
|
-
|
221
|
+
align: tipAlignments.edit,
|
222
|
+
className: cx("".concat(blockClass, "__btn"), "".concat(blockClass, "__btn-edit"), _defineProperty({}, "".concat(blockClass, "__btn-edit--always-visible"), editAlwaysVisible)),
|
223
|
+
size: size,
|
196
224
|
label: editLabel,
|
197
225
|
onClick: onFocusHandler,
|
198
226
|
kind: "ghost",
|
@@ -200,18 +228,32 @@ export var InlineEditV2 = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
200
228
|
key: "edit"
|
201
229
|
}, /*#__PURE__*/React.createElement(Edit, {
|
202
230
|
size: 16
|
203
|
-
})))),
|
231
|
+
})))), invalid && /*#__PURE__*/React.createElement("p", {
|
204
232
|
className: "".concat(blockClass, "__warning-text")
|
205
|
-
},
|
233
|
+
}, invalidText !== null && invalidText !== void 0 ? invalidText : deprecated_invalidLabel));
|
206
234
|
});
|
207
|
-
|
208
|
-
|
209
|
-
|
235
|
+
EditInPlace = pkg.checkComponentEnabled(EditInPlace, componentName);
|
236
|
+
EditInPlace.displayName = componentName;
|
237
|
+
export var deprecatedProps = {
|
238
|
+
/**
|
239
|
+
* **Deprecated**
|
240
|
+
* invalidLabel was misnamed, using invalidText to match Carbon
|
241
|
+
*/
|
242
|
+
invalidText: PropTypes.string
|
243
|
+
};
|
244
|
+
var alignPropType = PropTypes.oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']);
|
245
|
+
EditInPlace.propTypes = _objectSpread({
|
210
246
|
/**
|
211
247
|
* label for cancel button
|
212
248
|
*/
|
213
249
|
cancelLabel: PropTypes.string.isRequired,
|
214
250
|
|
251
|
+
/**
|
252
|
+
* By default the edit icon is shown on hover only.
|
253
|
+
*/
|
254
|
+
editAlwaysVisible: PropTypes.bool,
|
255
|
+
|
256
|
+
/**
|
215
257
|
/**
|
216
258
|
* label for edit button
|
217
259
|
*/
|
@@ -222,6 +264,15 @@ InlineEditV2.propTypes = {
|
|
222
264
|
*/
|
223
265
|
id: PropTypes.string.isRequired,
|
224
266
|
|
267
|
+
/**
|
268
|
+
* inheritTypography - causes the text entry field to inherit typography settings
|
269
|
+
* assigned to the container. This is useful when editing titles for instance.
|
270
|
+
*
|
271
|
+
* NOTE: The size property limits the vertical size of the input element.
|
272
|
+
* Inherited font's should be selected to fit within the size selected.
|
273
|
+
*/
|
274
|
+
inheritTypography: PropTypes.bool,
|
275
|
+
|
225
276
|
/**
|
226
277
|
* determines if the input is invalid
|
227
278
|
*/
|
@@ -230,7 +281,7 @@ InlineEditV2.propTypes = {
|
|
230
281
|
/**
|
231
282
|
* text that is displayed if the input is invalid
|
232
283
|
*/
|
233
|
-
|
284
|
+
invalidText: PropTypes.string,
|
234
285
|
|
235
286
|
/**
|
236
287
|
* Provide the text that will be read by a screen reader when visiting this control
|
@@ -267,13 +318,24 @@ InlineEditV2.propTypes = {
|
|
267
318
|
*/
|
268
319
|
saveLabel: PropTypes.string.isRequired,
|
269
320
|
|
321
|
+
/**
|
322
|
+
* vertical size of control
|
323
|
+
*/
|
324
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
325
|
+
|
326
|
+
/**
|
327
|
+
* tooltipAlignment from the standard tooltip. Default center.
|
328
|
+
*
|
329
|
+
* Can be passed either as one of tooltip options or as an object specifying cancel, edit and save separately
|
330
|
+
*/
|
331
|
+
tooltipAlignment: PropTypes.oneOfType([alignPropType, PropTypes.shape({
|
332
|
+
cancel: alignPropType,
|
333
|
+
edit: alignPropType,
|
334
|
+
save: alignPropType
|
335
|
+
})]),
|
336
|
+
|
270
337
|
/**
|
271
338
|
* current value of the input
|
272
339
|
*/
|
273
340
|
value: PropTypes.string.isRequired
|
274
|
-
};
|
275
|
-
InlineEditV2.defaultProps = {
|
276
|
-
invalid: false,
|
277
|
-
invalidLabel: '' // readOnly: false,
|
278
|
-
|
279
|
-
};
|
341
|
+
}, deprecatedProps);
|
@@ -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);
|
@@ -18,7 +18,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
18
18
|
import PropTypes from 'prop-types';
|
19
19
|
import { spacing10, baseFontSize } from '@carbon/layout';
|
20
20
|
import cx from 'classnames';
|
21
|
-
import {
|
21
|
+
import { useResizeObserver } from '../../global/js/hooks/useResizeObserver';
|
22
22
|
import { FlexGrid, Column, Row, Button, Tag } from '@carbon/react';
|
23
23
|
import { breakpoints } from '@carbon/layout';
|
24
24
|
import { useWindowResize, useNearestScroll } from '../../global/js/hooks';
|
@@ -39,7 +39,7 @@ var defaults = {
|
|
39
39
|
narrowGrid: false
|
40
40
|
};
|
41
41
|
export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
42
|
-
var _withoutBackground, _enableBreadcrumbScro,
|
42
|
+
var _withoutBackground, _enableBreadcrumbScro, _ref7, _cx2, _ref8, _cx4, _cx7;
|
43
43
|
|
44
44
|
var actionBarItems = _ref.actionBarItems,
|
45
45
|
actionBarMenuOptionsClass = _ref.actionBarMenuOptionsClass,
|
@@ -195,7 +195,9 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
195
195
|
/* istanbul ignore next */
|
196
196
|
|
197
197
|
|
198
|
-
var handleResizeActionBarColumn = function handleResizeActionBarColumn(
|
198
|
+
var handleResizeActionBarColumn = function handleResizeActionBarColumn(_ref4) {
|
199
|
+
var width = _ref4.width;
|
200
|
+
|
199
201
|
/* don't know how to test resize */
|
200
202
|
|
201
203
|
/* istanbul ignore next */
|
@@ -280,8 +282,8 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
280
282
|
}, [headerRef, enableBreadcrumbScroll, metrics, metrics.breadcrumbRowHeight, metrics.breadcrumbRowSpaceBelow, metrics.breadcrumbTitleHeight, metrics.breadcrumbRowWidth, metrics.headerHeight, metrics.headerWidth, metrics.headerOffset, metrics.headerTopValue, metrics.navigationRowHeight, navigation, scrollYValue, tags]);
|
281
283
|
useNearestScroll(headerRef, // on scroll or various layout changes check updates if needed
|
282
284
|
// istanbul ignore next
|
283
|
-
function (
|
284
|
-
var current =
|
285
|
+
function (_ref5) {
|
286
|
+
var current = _ref5.current;
|
285
287
|
setPageHeaderStyles(function (prev) {
|
286
288
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, "--".concat(blockClass, "--breadcrumb-top"), "".concat(metrics.headerOffset, "px")));
|
287
289
|
});
|
@@ -297,8 +299,8 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
297
299
|
document.documentElement.style.setProperty("--".concat(blockClass, "--tagset-tooltip-offset"), "".concat(tagsetTooltipOffset, "px"));
|
298
300
|
setScrollYValue(current.scrollY);
|
299
301
|
}, [metrics.headerHeight, metrics.headerTopValue, metrics.headerOffset, enableBreadcrumbScroll]);
|
300
|
-
useWindowResize(function (
|
301
|
-
var current =
|
302
|
+
useWindowResize(function (_ref6) {
|
303
|
+
var current = _ref6.current;
|
302
304
|
// on window resize and other updates some values may have changed
|
303
305
|
checkUpdateVerticalSpace();
|
304
306
|
setWidthIsNarrow(current.innerWidth / 16 < parseInt(breakpoints.md.width)); // small (below medium) media query
|
@@ -348,15 +350,11 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
348
350
|
utilSetCollapsed(collapseHeader, metrics.headerOffset, metrics.headerTopValue);
|
349
351
|
}
|
350
352
|
}, [collapseHeader, metrics.headerOffset, metrics.headerTopValue]);
|
351
|
-
|
352
|
-
|
353
|
-
targetRef: sizingContainerRef,
|
354
|
-
handleWidth: true
|
353
|
+
useResizeObserver(sizingContainerRef, {
|
354
|
+
callback: handleResizeActionBarColumn
|
355
355
|
});
|
356
|
-
|
357
|
-
|
358
|
-
targetRef: headerRef,
|
359
|
-
handleHeight: true
|
356
|
+
useResizeObserver(headerRef, {
|
357
|
+
callback: handleResize
|
360
358
|
}); // Determine what form of title to display in the breadcrumb
|
361
359
|
|
362
360
|
var breadcrumbItemForTitle = utilGetBreadcrumbItemForTitle(blockClass, collapseTitle, title);
|
@@ -364,7 +362,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
364
362
|
className: "".concat(blockClass, "--offset-top-measuring-element"),
|
365
363
|
ref: offsetTopMeasuringRef
|
366
364
|
}), /*#__PURE__*/React.createElement("section", _extends({}, rest, {
|
367
|
-
className: cx([blockClass, "".concat(blockClass, "--no-margins-below-row"), className, (
|
365
|
+
className: cx([blockClass, "".concat(blockClass, "--no-margins-below-row"), className, (_ref7 = {}, _defineProperty(_ref7, "".concat(blockClass, "--has-navigation"), navigation || tags), _defineProperty(_ref7, "".concat(blockClass, "--has-navigation-tags-only"), !navigation && tags), _ref7)]),
|
368
366
|
style: pageHeaderStyles,
|
369
367
|
ref: headerRef
|
370
368
|
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(FlexGrid, {
|
@@ -386,7 +384,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
386
384
|
breadcrumbs: breadcrumbs && breadcrumbItemForTitle ? breadcrumbs.concat(breadcrumbItemForTitle) : breadcrumbItemForTitle ? [breadcrumbItemForTitle] : breadcrumbs // breadcrumbs may be null or undefined
|
387
385
|
|
388
386
|
}) : null), /*#__PURE__*/React.createElement(Column, {
|
389
|
-
className: cx(["".concat(blockClass, "__action-bar-column ").concat(blockClass, "__action-bar-column--background"), (
|
387
|
+
className: cx(["".concat(blockClass, "__action-bar-column ").concat(blockClass, "__action-bar-column--background"), (_ref8 = {}, _defineProperty(_ref8, "".concat(blockClass, "__action-bar-column--has-page-actions"), pageActions), _defineProperty(_ref8, "".concat(blockClass, "__action-bar-column--influenced-by-collapse-button"), spaceForCollapseButton), _ref8)])
|
390
388
|
}, /*#__PURE__*/React.createElement("div", {
|
391
389
|
className: "".concat(blockClass, "__action-bar-column-content"),
|
392
390
|
ref: sizingContainerRef
|
@@ -543,8 +541,8 @@ PageHeader.propTypes = _objectSpread({
|
|
543
541
|
*
|
544
542
|
* NOTE: This prop is required if actionBarItems are supplied
|
545
543
|
*/
|
546
|
-
actionBarOverflowAriaLabel: PropTypes.string.isRequired.if(function (
|
547
|
-
var actionBarItems =
|
544
|
+
actionBarOverflowAriaLabel: PropTypes.string.isRequired.if(function (_ref10) {
|
545
|
+
var actionBarItems = _ref10.actionBarItems;
|
548
546
|
return actionBarItems && actionBarItems.length > 0;
|
549
547
|
}),
|
550
548
|
|
@@ -579,8 +577,8 @@ PageHeader.propTypes = _objectSpread({
|
|
579
577
|
* If the user supplies breadcrumbs then this property is required.
|
580
578
|
* It is used in an overflow menu when there is insufficient space to display all breadcrumbs inline.
|
581
579
|
*/
|
582
|
-
breadcrumbOverflowAriaLabel: PropTypes.string.isRequired.if(function (
|
583
|
-
var breadcrumbs =
|
580
|
+
breadcrumbOverflowAriaLabel: PropTypes.string.isRequired.if(function (_ref11) {
|
581
|
+
var breadcrumbs = _ref11.breadcrumbs;
|
584
582
|
return breadcrumbs && breadcrumbs.length > 0;
|
585
583
|
}),
|
586
584
|
|
@@ -619,8 +617,8 @@ PageHeader.propTypes = _objectSpread({
|
|
619
617
|
/**
|
620
618
|
* A text version of the `label` for display, required if `label` is not a string.
|
621
619
|
*/
|
622
|
-
title: PropTypes.string.isRequired.if(function (
|
623
|
-
var label =
|
620
|
+
title: PropTypes.string.isRequired.if(function (_ref12) {
|
621
|
+
var label = _ref12.label;
|
624
622
|
return typeof label !== 'string';
|
625
623
|
})
|
626
624
|
})),
|
@@ -650,9 +648,9 @@ PageHeader.propTypes = _objectSpread({
|
|
650
648
|
* If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
|
651
649
|
* required for both the expend and collapse states of the button component used.
|
652
650
|
*/
|
653
|
-
collapseHeaderIconDescription: PropTypes.string.isRequired.if(function (
|
654
|
-
var withoutBackground =
|
655
|
-
hasCollapseHeaderToggle =
|
651
|
+
collapseHeaderIconDescription: PropTypes.string.isRequired.if(function (_ref13) {
|
652
|
+
var withoutBackground = _ref13.withoutBackground,
|
653
|
+
hasCollapseHeaderToggle = _ref13.hasCollapseHeaderToggle;
|
656
654
|
return !withoutBackground && hasCollapseHeaderToggle;
|
657
655
|
}),
|
658
656
|
|
@@ -672,9 +670,9 @@ PageHeader.propTypes = _objectSpread({
|
|
672
670
|
* If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
|
673
671
|
* required for both the expend and collapse states of the button component used.
|
674
672
|
*/
|
675
|
-
expandHeaderIconDescription: PropTypes.string.isRequired.if(function (
|
676
|
-
var withoutBackground =
|
677
|
-
hasCollapseHeaderToggle =
|
673
|
+
expandHeaderIconDescription: PropTypes.string.isRequired.if(function (_ref14) {
|
674
|
+
var withoutBackground = _ref14.withoutBackground,
|
675
|
+
hasCollapseHeaderToggle = _ref14.hasCollapseHeaderToggle;
|
678
676
|
return !withoutBackground && hasCollapseHeaderToggle;
|
679
677
|
}),
|
680
678
|
|
@@ -745,8 +743,8 @@ PageHeader.propTypes = _objectSpread({
|
|
745
743
|
*
|
746
744
|
* NOTE: This prop is required if pageActions are supplied
|
747
745
|
*/
|
748
|
-
pageActionsOverflowLabel: PropTypes.node.isRequired.if(function (
|
749
|
-
var pageActions =
|
746
|
+
pageActionsOverflowLabel: PropTypes.node.isRequired.if(function (_ref15) {
|
747
|
+
var pageActions = _ref15.pageActions;
|
750
748
|
return pageActions && pageActions.length > 0 && !pageActions.content;
|
751
749
|
}),
|
752
750
|
|
@@ -809,14 +807,17 @@ PageHeader.propTypes = _objectSpread({
|
|
809
807
|
loading: PropTypes.bool,
|
810
808
|
// inline edit version properties
|
811
809
|
editableLabel: PropTypes.string,
|
812
|
-
// .isRequired.if(
|
810
|
+
// .isRequired.if(editInPlaceRequired),
|
813
811
|
id: PropTypes.string,
|
814
|
-
// .isRequired.if(
|
812
|
+
// .isRequired.if(editInPlaceRequired),
|
813
|
+
onCancel: PropTypes.func,
|
815
814
|
onChange: PropTypes.func,
|
816
815
|
onSave: PropTypes.func,
|
817
816
|
cancelDescription: PropTypes.string,
|
818
|
-
//.isRequired.if(
|
819
|
-
|
817
|
+
//.isRequired.if(editInPlaceRequired),
|
818
|
+
editDescription: PropTypes.string,
|
819
|
+
// .isRequired.if(editInPlaceRequired),
|
820
|
+
saveDescription: PropTypes.string //.isRequired.if(editInPlaceRequired),
|
820
821
|
// Update docgen if changed
|
821
822
|
|
822
823
|
}), PropTypes.string, PropTypes.shape({
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
var _excluded = ["text", "content", "loading", "icon", "asText", "onChange", "onSave", "editDescription", "editableLabel", "
|
4
|
+
var _excluded = ["text", "content", "loading", "icon", "asText", "onChange", "onSave", "editDescription", "editableLabel", "cancelDescription", "saveDescription"];
|
5
5
|
import React from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import cx from 'classnames';
|
8
8
|
import { SkeletonText } from '@carbon/react';
|
9
|
-
import {
|
9
|
+
import { EditInPlace } from '../';
|
10
10
|
/**
|
11
11
|
*
|
12
12
|
* Utility component used by Page Header
|
@@ -29,7 +29,7 @@ export var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
29
29
|
onSave = title.onSave,
|
30
30
|
editDescription = title.editDescription,
|
31
31
|
editableLabel = title.editableLabel,
|
32
|
-
|
32
|
+
cancelDescription = title.cancelDescription,
|
33
33
|
saveDescription = title.saveDescription,
|
34
34
|
rest = _objectWithoutProperties(title, _excluded);
|
35
35
|
|
@@ -47,17 +47,17 @@ export var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
47
47
|
className: "".concat(blockClass, "__title-icon")
|
48
48
|
}) : null, loading ? /*#__PURE__*/React.createElement(SkeletonText, {
|
49
49
|
className: "".concat(blockClass, "__title-skeleton")
|
50
|
-
}) : isEditable ? /*#__PURE__*/React.createElement(
|
51
|
-
|
52
|
-
hideLabel: true,
|
50
|
+
}) : isEditable ? /*#__PURE__*/React.createElement(EditInPlace, _extends({
|
51
|
+
tooltipAlignment: "bottom",
|
53
52
|
value: text,
|
54
|
-
|
53
|
+
cancelLabel: cancelDescription,
|
54
|
+
editLabel: editDescription,
|
55
|
+
saveLabel: saveDescription,
|
56
|
+
labelText: editableLabel,
|
55
57
|
onChange: onChange,
|
56
58
|
onSave: onSave,
|
57
|
-
|
58
|
-
|
59
|
-
saveDescription: saveDescription,
|
60
|
-
buttonTooltipPosition: "bottom"
|
59
|
+
size: "md",
|
60
|
+
inheritTypography: true
|
61
61
|
}, rest)) : /*#__PURE__*/React.createElement("span", {
|
62
62
|
title: !loading ? asText : null
|
63
63
|
}, text));
|
@@ -71,7 +71,7 @@ export var PageHeaderTitle = function PageHeaderTitle(_ref) {
|
|
71
71
|
title: titleText
|
72
72
|
}, titleInnards);
|
73
73
|
};
|
74
|
-
export var
|
74
|
+
export var editInPlaceRequired = function editInPlaceRequired(_ref2) {
|
75
75
|
var onSave = _ref2.onSave;
|
76
76
|
return !!onSave;
|
77
77
|
};
|
@@ -97,7 +97,7 @@ PageHeaderTitle.propTypes = {
|
|
97
97
|
* - onSave: function to process a confirmed change
|
98
98
|
* - editDescription: description for edit button
|
99
99
|
* - editableLabel: label for edit required if onSave supplied
|
100
|
-
* -
|
100
|
+
* - cancelDescription: description for edit cancel button
|
101
101
|
* - saveDescription: description for edit save button
|
102
102
|
* - 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.
|
103
103
|
* - content: title or name of current location shown in main part of page header
|
@@ -110,13 +110,13 @@ PageHeaderTitle.propTypes = {
|
|
110
110
|
icon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
111
111
|
loading: PropTypes.bool,
|
112
112
|
// inline edit version properties
|
113
|
-
editDescription: PropTypes.string.isRequired.if(
|
114
|
-
editableLabel: PropTypes.string.isRequired.if(
|
115
|
-
id: PropTypes.string.isRequired.if(
|
113
|
+
editDescription: PropTypes.string.isRequired.if(editInPlaceRequired),
|
114
|
+
editableLabel: PropTypes.string.isRequired.if(editInPlaceRequired),
|
115
|
+
id: PropTypes.string.isRequired.if(editInPlaceRequired),
|
116
116
|
onChange: PropTypes.func,
|
117
117
|
onSave: PropTypes.func,
|
118
|
-
|
119
|
-
saveDescription: PropTypes.string.isRequired.if(
|
118
|
+
cancelDescription: PropTypes.string.isRequired.if(editInPlaceRequired),
|
119
|
+
saveDescription: PropTypes.string.isRequired.if(editInPlaceRequired) // Update docgen if changed
|
120
120
|
|
121
121
|
}), PropTypes.string, PropTypes.shape({
|
122
122
|
content: PropTypes.node.isRequired,
|