@carbon/ibm-products 2.43.2-canary.251 → 2.43.2-canary.253
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/Datagrid/Datagrid/DraggableElement.js +1 -0
- package/es/components/Tearsheet/TearsheetShell.js +9 -2
- package/es/global/js/utils/Wrap.d.ts +4 -0
- package/es/global/js/utils/Wrap.js +9 -3
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +1 -0
- package/lib/components/Tearsheet/TearsheetShell.js +8 -1
- package/lib/global/js/utils/Wrap.d.ts +4 -0
- package/lib/global/js/utils/Wrap.js +9 -3
- package/package.json +2 -2
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectSpread2 as _objectSpread2, objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty, toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import React__default, { useRef, useState, useEffect } from 'react';
|
9
|
+
import React__default, { useRef, useCallback, useState, useEffect } from 'react';
|
10
10
|
import { useResizeObserver } from '../../global/js/hooks/useResizeObserver.js';
|
11
11
|
import PropTypes from '../../node_modules/prop-types/index.js';
|
12
12
|
import cx from 'classnames';
|
@@ -102,6 +102,12 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
102
102
|
keyDownListener = _useFocus.keyDownListener,
|
103
103
|
specifiedElement = _useFocus.specifiedElement;
|
104
104
|
var modalRefValue = modalRef.current;
|
105
|
+
|
106
|
+
// Function to strip html tags out of a string.
|
107
|
+
var stripTags = useCallback(function (input) {
|
108
|
+
return input.replace(/<\/?[^>]+(>|$)/g, '');
|
109
|
+
}, []);
|
110
|
+
var titleText = stripTags(String(description));
|
105
111
|
var wide = size === 'wide';
|
106
112
|
|
107
113
|
// Keep track of the stack depth and our position in it (1-based, 0=closed)
|
@@ -283,7 +289,8 @@ var TearsheetShell = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
283
289
|
element: "h3",
|
284
290
|
className: cx("".concat(bcModalHeader, "__heading"), "".concat(bc, "__heading"))
|
285
291
|
}, title), /*#__PURE__*/React__default.createElement(Wrap, {
|
286
|
-
className: "".concat(bc, "__header-description")
|
292
|
+
className: "".concat(bc, "__header-description"),
|
293
|
+
title: titleText
|
287
294
|
}, description)), /*#__PURE__*/React__default.createElement(Wrap, {
|
288
295
|
className: "".concat(bc, "__header-actions")
|
289
296
|
}, headerActions)), /*#__PURE__*/React__default.createElement(Wrap, {
|
@@ -30,6 +30,10 @@ interface WrapProps extends PropsWithChildren {
|
|
30
30
|
* Tab index for the wrapper div
|
31
31
|
*/
|
32
32
|
tabIndex?: number;
|
33
|
+
/**
|
34
|
+
* The title attribute the content.
|
35
|
+
*/
|
36
|
+
title?: string;
|
33
37
|
}
|
34
38
|
/**
|
35
39
|
* A simple conditional wrapper that encloses its children in a <div> (or other
|
@@ -9,7 +9,7 @@ import { objectWithoutProperties as _objectWithoutProperties, extends as _extend
|
|
9
9
|
import React__default from 'react';
|
10
10
|
import PropTypes from '../../../node_modules/prop-types/index.js';
|
11
11
|
|
12
|
-
var _excluded = ["alwaysRender", "children", "element", "neverRender", "className"];
|
12
|
+
var _excluded = ["alwaysRender", "children", "element", "neverRender", "className", "title"];
|
13
13
|
|
14
14
|
// Examine a flat array of children to decide whether it is effectively empty.
|
15
15
|
// If there are no children, or all the children are falsy, or all the non-falsy
|
@@ -41,11 +41,13 @@ var Wrap = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
41
41
|
Wrapper = _ref$element === void 0 ? 'div' : _ref$element,
|
42
42
|
neverRender = _ref.neverRender,
|
43
43
|
className = _ref.className,
|
44
|
+
title = _ref.title,
|
44
45
|
rest = _objectWithoutProperties(_ref, _excluded);
|
45
46
|
return (neverRender || isEmpty(children)) && !alwaysRender ? null : /*#__PURE__*/React__default.createElement(Wrapper, _extends({
|
46
47
|
className: className
|
47
48
|
}, rest, {
|
48
|
-
ref: ref
|
49
|
+
ref: ref,
|
50
|
+
title: title
|
49
51
|
}), children);
|
50
52
|
});
|
51
53
|
Wrap.displayName = 'Wrap';
|
@@ -75,7 +77,11 @@ Wrap.propTypes = {
|
|
75
77
|
* set to true then it will take precedence and the wrapper element and
|
76
78
|
* content will be rendered.
|
77
79
|
*/
|
78
|
-
neverRender: PropTypes.bool
|
80
|
+
neverRender: PropTypes.bool,
|
81
|
+
/**
|
82
|
+
* The title attribute the content.
|
83
|
+
*/
|
84
|
+
title: PropTypes.string
|
79
85
|
};
|
80
86
|
|
81
87
|
export { Wrap };
|
@@ -62,6 +62,7 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
62
62
|
ref: setNodeRef,
|
63
63
|
style: style
|
64
64
|
}, attributes, listeners, {
|
65
|
+
"aria-disabled": undefined,
|
65
66
|
"aria-selected": selected,
|
66
67
|
role: "option"
|
67
68
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
@@ -111,6 +111,12 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
111
111
|
keyDownListener = _useFocus.keyDownListener,
|
112
112
|
specifiedElement = _useFocus.specifiedElement;
|
113
113
|
var modalRefValue = modalRef.current;
|
114
|
+
|
115
|
+
// Function to strip html tags out of a string.
|
116
|
+
var stripTags = React.useCallback(function (input) {
|
117
|
+
return input.replace(/<\/?[^>]+(>|$)/g, '');
|
118
|
+
}, []);
|
119
|
+
var titleText = stripTags(String(description));
|
114
120
|
var wide = size === 'wide';
|
115
121
|
|
116
122
|
// Keep track of the stack depth and our position in it (1-based, 0=closed)
|
@@ -292,7 +298,8 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
292
298
|
element: "h3",
|
293
299
|
className: cx__default["default"]("".concat(bcModalHeader, "__heading"), "".concat(bc, "__heading"))
|
294
300
|
}, title), /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
|
295
|
-
className: "".concat(bc, "__header-description")
|
301
|
+
className: "".concat(bc, "__header-description"),
|
302
|
+
title: titleText
|
296
303
|
}, description)), /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
|
297
304
|
className: "".concat(bc, "__header-actions")
|
298
305
|
}, headerActions)), /*#__PURE__*/React__default["default"].createElement(Wrap.Wrap, {
|
@@ -30,6 +30,10 @@ interface WrapProps extends PropsWithChildren {
|
|
30
30
|
* Tab index for the wrapper div
|
31
31
|
*/
|
32
32
|
tabIndex?: number;
|
33
|
+
/**
|
34
|
+
* The title attribute the content.
|
35
|
+
*/
|
36
|
+
title?: string;
|
33
37
|
}
|
34
38
|
/**
|
35
39
|
* A simple conditional wrapper that encloses its children in a <div> (or other
|
@@ -17,7 +17,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
17
17
|
|
18
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
19
19
|
|
20
|
-
var _excluded = ["alwaysRender", "children", "element", "neverRender", "className"];
|
20
|
+
var _excluded = ["alwaysRender", "children", "element", "neverRender", "className", "title"];
|
21
21
|
|
22
22
|
// Examine a flat array of children to decide whether it is effectively empty.
|
23
23
|
// If there are no children, or all the children are falsy, or all the non-falsy
|
@@ -49,11 +49,13 @@ var Wrap = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref
|
|
49
49
|
Wrapper = _ref$element === void 0 ? 'div' : _ref$element,
|
50
50
|
neverRender = _ref.neverRender,
|
51
51
|
className = _ref.className,
|
52
|
+
title = _ref.title,
|
52
53
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
53
54
|
return (neverRender || isEmpty(children)) && !alwaysRender ? null : /*#__PURE__*/React__default["default"].createElement(Wrapper, _rollupPluginBabelHelpers["extends"]({
|
54
55
|
className: className
|
55
56
|
}, rest, {
|
56
|
-
ref: ref
|
57
|
+
ref: ref,
|
58
|
+
title: title
|
57
59
|
}), children);
|
58
60
|
});
|
59
61
|
Wrap.displayName = 'Wrap';
|
@@ -83,7 +85,11 @@ Wrap.propTypes = {
|
|
83
85
|
* set to true then it will take precedence and the wrapper element and
|
84
86
|
* content will be rendered.
|
85
87
|
*/
|
86
|
-
neverRender: index["default"].bool
|
88
|
+
neverRender: index["default"].bool,
|
89
|
+
/**
|
90
|
+
* The title attribute the content.
|
91
|
+
*/
|
92
|
+
title: index["default"].string
|
87
93
|
};
|
88
94
|
|
89
95
|
exports.Wrap = Wrap;
|
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.253+5b58d506a",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -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": "5b58d506a39b3d625e169004e1385ae9cfcc6985"
|
124
124
|
}
|