@carbon/ibm-products 2.43.2-canary.166 → 2.43.2-canary.171
Sign up to get free protection for your applications and to get access to all the features.
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +8 -1
- package/es/components/Toolbar/ToolbarButton.d.ts +12 -1
- package/es/components/Toolbar/ToolbarButton.js +16 -8
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +8 -1
- package/lib/components/Toolbar/ToolbarButton.d.ts +12 -1
- package/lib/components/Toolbar/ToolbarButton.js +15 -6
- package/package.json +3 -3
@@ -19,6 +19,7 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
|
19
19
|
import { getScrollbarWidth } from '../../global/js/utils/getScrollbarWidth.js';
|
20
20
|
import { handleEditSubmit } from './utils/handleEditSubmit.js';
|
21
21
|
import { handleHeaderCellSelection } from './utils/handleHeaderCellSelection.js';
|
22
|
+
import { getNodeTextContent } from '../../global/js/utils/getNodeTextContent.js';
|
22
23
|
import { handleKeyPress } from './utils/commonEventHandlers.js';
|
23
24
|
import { pkg } from '../../settings.js';
|
24
25
|
import { removeCellSelections } from './utils/removeCellSelections.js';
|
@@ -205,7 +206,13 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
|
|
205
206
|
var currentHeaders = [];
|
206
207
|
if (Object.keys(currentColumns).length > 0) {
|
207
208
|
Object.keys(currentColumns).forEach(function (itemIndex) {
|
208
|
-
if (currentColumns[itemIndex].Header) {
|
209
|
+
if (_typeof(currentColumns[itemIndex].Header) === 'object') {
|
210
|
+
if (currentColumns[itemIndex].column_name) {
|
211
|
+
currentHeaders.push(currentColumns[itemIndex].column_name);
|
212
|
+
} else {
|
213
|
+
currentHeaders.push(getNodeTextContent(currentColumns[itemIndex].Header));
|
214
|
+
}
|
215
|
+
} else if (currentColumns[itemIndex].Header) {
|
209
216
|
currentHeaders.push(currentColumns[itemIndex].Header);
|
210
217
|
}
|
211
218
|
});
|
@@ -13,8 +13,12 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
|
|
13
13
|
caret?: boolean;
|
14
14
|
/** Provide an optional class to be applied to the containing node */
|
15
15
|
className?: string;
|
16
|
+
/**
|
17
|
+
* @deprecated use `label` instead
|
18
|
+
* Specifies the label for the icon button */
|
19
|
+
iconDescription?: string;
|
16
20
|
/** Specifies the label for the icon button */
|
17
|
-
|
21
|
+
label: string;
|
18
22
|
/** Specifies the icon to be used by the ToolbarButton component */
|
19
23
|
renderIcon: React.ElementType;
|
20
24
|
}
|
@@ -22,3 +26,10 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
|
|
22
26
|
export declare let ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & {
|
23
27
|
children?: React.ReactNode;
|
24
28
|
} & React.RefAttributes<unknown>>;
|
29
|
+
export declare const deprecatedProps: {
|
30
|
+
/**
|
31
|
+
* **Deprecated**
|
32
|
+
* Specifies the label for the icon button
|
33
|
+
* */
|
34
|
+
iconDescription: import("prop-types").Requireable<string>;
|
35
|
+
};
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectSpread2 as _objectSpread2, objectWithoutProperties as _objectWithoutProperties, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useContext } from 'react';
|
10
10
|
import { ToolbarContext, blockClass as blockClass$1 } from './Toolbar.js';
|
11
11
|
import { p as propTypesExports } from '../../node_modules/prop-types/index.js';
|
@@ -13,7 +13,7 @@ import { IconButton } from '@carbon/react';
|
|
13
13
|
import cx from 'classnames';
|
14
14
|
import { pkg } from '../../settings.js';
|
15
15
|
|
16
|
-
var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription"];
|
16
|
+
var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription", "label"];
|
17
17
|
var blockClass = "".concat(blockClass$1, "__button");
|
18
18
|
/** Toolbar buttons are common functions performed as part of a products interface or an open window. */
|
19
19
|
var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
@@ -24,13 +24,14 @@ var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
24
|
className = _ref.className,
|
25
25
|
renderIcon = _ref.renderIcon,
|
26
26
|
_ref$iconDescription = _ref.iconDescription,
|
27
|
-
|
27
|
+
deprecated_iconDescription = _ref$iconDescription === void 0 ? '' : _ref$iconDescription,
|
28
|
+
label = _ref.label,
|
28
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
29
30
|
var Icon = renderIcon;
|
30
31
|
return /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
31
32
|
align: (_useContext = useContext(ToolbarContext)) !== null && _useContext !== void 0 && _useContext.vertical ? 'right' : 'top'
|
32
33
|
}, rest, {
|
33
|
-
label:
|
34
|
+
label: label !== null && label !== void 0 ? label : deprecated_iconDescription,
|
34
35
|
ref: ref,
|
35
36
|
className: cx(className, _defineProperty({}, "".concat(blockClass, "--caret"), caret)),
|
36
37
|
kind: "ghost",
|
@@ -41,7 +42,14 @@ var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
41
42
|
});
|
42
43
|
var componentName = 'ToolbarButton';
|
43
44
|
ToolbarButton.displayName = componentName;
|
44
|
-
|
45
|
+
var deprecatedProps = {
|
46
|
+
/**
|
47
|
+
* **Deprecated**
|
48
|
+
* Specifies the label for the icon button
|
49
|
+
* */
|
50
|
+
iconDescription: propTypesExports.string
|
51
|
+
};
|
52
|
+
ToolbarButton.propTypes = _objectSpread2({
|
45
53
|
/** Determines whether the caret is rendered */
|
46
54
|
caret: propTypesExports.bool,
|
47
55
|
/** Provide the content of the `ToolbarButton` */
|
@@ -49,10 +57,10 @@ ToolbarButton.propTypes = {
|
|
49
57
|
/** Provide an optional class to be applied to the containing node */
|
50
58
|
className: propTypesExports.string,
|
51
59
|
/** Specifies the label for the icon button */
|
52
|
-
|
60
|
+
label: propTypesExports.string.isRequired,
|
53
61
|
/** Specifies the icon to be used by the ToolbarButton component */
|
54
62
|
renderIcon: propTypesExports.func.isRequired
|
55
|
-
};
|
63
|
+
}, deprecatedProps);
|
56
64
|
ToolbarButton = pkg.checkComponentEnabled(ToolbarButton, componentName);
|
57
65
|
|
58
|
-
export { ToolbarButton, blockClass };
|
66
|
+
export { ToolbarButton, blockClass, deprecatedProps };
|
@@ -23,6 +23,7 @@ var devtools = require('../../global/js/utils/devtools.js');
|
|
23
23
|
var getScrollbarWidth = require('../../global/js/utils/getScrollbarWidth.js');
|
24
24
|
var handleEditSubmit = require('./utils/handleEditSubmit.js');
|
25
25
|
var handleHeaderCellSelection = require('./utils/handleHeaderCellSelection.js');
|
26
|
+
var getNodeTextContent = require('../../global/js/utils/getNodeTextContent.js');
|
26
27
|
var commonEventHandlers = require('./utils/commonEventHandlers.js');
|
27
28
|
var settings = require('../../settings.js');
|
28
29
|
var removeCellSelections = require('./utils/removeCellSelections.js');
|
@@ -214,7 +215,13 @@ exports.DataSpreadsheet = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
214
215
|
var currentHeaders = [];
|
215
216
|
if (Object.keys(currentColumns).length > 0) {
|
216
217
|
Object.keys(currentColumns).forEach(function (itemIndex) {
|
217
|
-
if (currentColumns[itemIndex].Header) {
|
218
|
+
if (_rollupPluginBabelHelpers["typeof"](currentColumns[itemIndex].Header) === 'object') {
|
219
|
+
if (currentColumns[itemIndex].column_name) {
|
220
|
+
currentHeaders.push(currentColumns[itemIndex].column_name);
|
221
|
+
} else {
|
222
|
+
currentHeaders.push(getNodeTextContent.getNodeTextContent(currentColumns[itemIndex].Header));
|
223
|
+
}
|
224
|
+
} else if (currentColumns[itemIndex].Header) {
|
218
225
|
currentHeaders.push(currentColumns[itemIndex].Header);
|
219
226
|
}
|
220
227
|
});
|
@@ -13,8 +13,12 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
|
|
13
13
|
caret?: boolean;
|
14
14
|
/** Provide an optional class to be applied to the containing node */
|
15
15
|
className?: string;
|
16
|
+
/**
|
17
|
+
* @deprecated use `label` instead
|
18
|
+
* Specifies the label for the icon button */
|
19
|
+
iconDescription?: string;
|
16
20
|
/** Specifies the label for the icon button */
|
17
|
-
|
21
|
+
label: string;
|
18
22
|
/** Specifies the icon to be used by the ToolbarButton component */
|
19
23
|
renderIcon: React.ElementType;
|
20
24
|
}
|
@@ -22,3 +26,10 @@ export interface ToolbarButtonProps extends React.ComponentProps<typeof IconButt
|
|
22
26
|
export declare let ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & {
|
23
27
|
children?: React.ReactNode;
|
24
28
|
} & React.RefAttributes<unknown>>;
|
29
|
+
export declare const deprecatedProps: {
|
30
|
+
/**
|
31
|
+
* **Deprecated**
|
32
|
+
* Specifies the label for the icon button
|
33
|
+
* */
|
34
|
+
iconDescription: import("prop-types").Requireable<string>;
|
35
|
+
};
|
@@ -22,7 +22,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
22
22
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
23
23
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
24
24
|
|
25
|
-
var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription"];
|
25
|
+
var _excluded = ["caret", "children", "className", "renderIcon", "iconDescription", "label"];
|
26
26
|
var blockClass = "".concat(Toolbar.blockClass, "__button");
|
27
27
|
/** Toolbar buttons are common functions performed as part of a products interface or an open window. */
|
28
28
|
exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
@@ -33,13 +33,14 @@ exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
33
33
|
className = _ref.className,
|
34
34
|
renderIcon = _ref.renderIcon,
|
35
35
|
_ref$iconDescription = _ref.iconDescription,
|
36
|
-
|
36
|
+
deprecated_iconDescription = _ref$iconDescription === void 0 ? '' : _ref$iconDescription,
|
37
|
+
label = _ref.label,
|
37
38
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
38
39
|
var Icon = renderIcon;
|
39
40
|
return /*#__PURE__*/React__default["default"].createElement(react.IconButton, _rollupPluginBabelHelpers["extends"]({
|
40
41
|
align: (_useContext = React.useContext(Toolbar.ToolbarContext)) !== null && _useContext !== void 0 && _useContext.vertical ? 'right' : 'top'
|
41
42
|
}, rest, {
|
42
|
-
label:
|
43
|
+
label: label !== null && label !== void 0 ? label : deprecated_iconDescription,
|
43
44
|
ref: ref,
|
44
45
|
className: cx__default["default"](className, _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--caret"), caret)),
|
45
46
|
kind: "ghost",
|
@@ -50,7 +51,14 @@ exports.ToolbarButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
50
51
|
});
|
51
52
|
var componentName = 'ToolbarButton';
|
52
53
|
exports.ToolbarButton.displayName = componentName;
|
53
|
-
|
54
|
+
var deprecatedProps = {
|
55
|
+
/**
|
56
|
+
* **Deprecated**
|
57
|
+
* Specifies the label for the icon button
|
58
|
+
* */
|
59
|
+
iconDescription: index.propTypesExports.string
|
60
|
+
};
|
61
|
+
exports.ToolbarButton.propTypes = _rollupPluginBabelHelpers.objectSpread2({
|
54
62
|
/** Determines whether the caret is rendered */
|
55
63
|
caret: index.propTypesExports.bool,
|
56
64
|
/** Provide the content of the `ToolbarButton` */
|
@@ -58,10 +66,11 @@ exports.ToolbarButton.propTypes = {
|
|
58
66
|
/** Provide an optional class to be applied to the containing node */
|
59
67
|
className: index.propTypesExports.string,
|
60
68
|
/** Specifies the label for the icon button */
|
61
|
-
|
69
|
+
label: index.propTypesExports.string.isRequired,
|
62
70
|
/** Specifies the icon to be used by the ToolbarButton component */
|
63
71
|
renderIcon: index.propTypesExports.func.isRequired
|
64
|
-
};
|
72
|
+
}, deprecatedProps);
|
65
73
|
exports.ToolbarButton = settings.pkg.checkComponentEnabled(exports.ToolbarButton, componentName);
|
66
74
|
|
67
75
|
exports.blockClass = blockClass;
|
76
|
+
exports.deprecatedProps = deprecatedProps;
|
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.43.2-canary.
|
4
|
+
"version": "2.43.2-canary.171+25e95bab0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -96,7 +96,7 @@
|
|
96
96
|
"dependencies": {
|
97
97
|
"@babel/runtime": "^7.23.9",
|
98
98
|
"@carbon/feature-flags": "^0.20.0",
|
99
|
-
"@carbon/ibm-products-styles": "^2.
|
99
|
+
"@carbon/ibm-products-styles": "^2.44.0-rc.0",
|
100
100
|
"@carbon/telemetry": "^0.1.0",
|
101
101
|
"@dnd-kit/core": "^6.0.8",
|
102
102
|
"@dnd-kit/modifiers": "^7.0.0",
|
@@ -120,5 +120,5 @@
|
|
120
120
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0",
|
121
121
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0"
|
122
122
|
},
|
123
|
-
"gitHead": "
|
123
|
+
"gitHead": "25e95bab041d69b28cc8e2a1c15ddd78ea4ab311"
|
124
124
|
}
|