carbon-react 114.14.0 → 114.15.0
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/esm/components/link/link.component.js +7 -2
- package/esm/components/link/link.style.d.ts +1 -0
- package/esm/components/link/link.style.js +3 -4
- package/esm/components/select/filterable-select/filterable-select.component.js +12 -9
- package/esm/components/select/multi-select/multi-select.component.js +9 -3
- package/esm/hooks/__internal__/useStableCallback/index.d.ts +1 -0
- package/esm/hooks/__internal__/useStableCallback/index.js +1 -0
- package/esm/hooks/__internal__/useStableCallback/useStableCallback.d.ts +2 -0
- package/esm/hooks/__internal__/useStableCallback/useStableCallback.js +14 -0
- package/lib/components/link/link.component.js +7 -1
- package/lib/components/link/link.style.d.ts +1 -0
- package/lib/components/link/link.style.js +3 -4
- package/lib/components/select/filterable-select/filterable-select.component.js +13 -9
- package/lib/components/select/multi-select/multi-select.component.js +10 -3
- package/lib/hooks/__internal__/useStableCallback/index.d.ts +1 -0
- package/lib/hooks/__internal__/useStableCallback/index.js +15 -0
- package/lib/hooks/__internal__/useStableCallback/package.json +6 -0
- package/lib/hooks/__internal__/useStableCallback/useStableCallback.d.ts +2 -0
- package/lib/hooks/__internal__/useStableCallback/useStableCallback.js +25 -0
- package/package.json +2 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
import React, { useMemo } from "react";
|
|
3
|
+
import React, { useContext, useMemo } from "react";
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import Icon from "../icon";
|
|
6
|
+
import MenuContext from "../menu/menu.context";
|
|
6
7
|
import Event from "../../__internal__/utils/helpers/events";
|
|
7
8
|
import { StyledLink, StyledContent } from "./link.style";
|
|
8
9
|
import tagComponent from "../../__internal__/utils/helpers/tags/tags";
|
|
@@ -29,6 +30,9 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
29
30
|
...rest
|
|
30
31
|
}, ref) => {
|
|
31
32
|
const l = useLocale();
|
|
33
|
+
const {
|
|
34
|
+
inMenu
|
|
35
|
+
} = useContext(MenuContext);
|
|
32
36
|
|
|
33
37
|
const handleOnKeyDown = ev => {
|
|
34
38
|
if (onKeyDown) {
|
|
@@ -99,7 +103,8 @@ const Link = /*#__PURE__*/React.forwardRef(({
|
|
|
99
103
|
iconAlign: iconAlign,
|
|
100
104
|
hasContent: Boolean(children),
|
|
101
105
|
variant: variant,
|
|
102
|
-
isDarkBackground: isDarkBackground
|
|
106
|
+
isDarkBackground: isDarkBackground,
|
|
107
|
+
isMenuItem: inMenu
|
|
103
108
|
}, tagComponent("link", rest), isSkipLink && {
|
|
104
109
|
"data-element": "skip-link"
|
|
105
110
|
}), createLinkBasedOnType());
|
|
@@ -13,6 +13,7 @@ export interface StyledLinkProps {
|
|
|
13
13
|
}
|
|
14
14
|
interface PrivateStyledLinkProps {
|
|
15
15
|
hasContent: boolean;
|
|
16
|
+
isMenuItem?: boolean;
|
|
16
17
|
}
|
|
17
18
|
declare const StyledLink: import("styled-components").StyledComponent<"span", any, StyledLinkProps & PrivateStyledLinkProps, never>;
|
|
18
19
|
declare const StyledContent: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -45,7 +45,8 @@ const StyledLink = styled.span`
|
|
|
45
45
|
hasContent,
|
|
46
46
|
disabled,
|
|
47
47
|
variant,
|
|
48
|
-
isDarkBackground
|
|
48
|
+
isDarkBackground,
|
|
49
|
+
isMenuItem
|
|
49
50
|
}) => {
|
|
50
51
|
const colorMapKey = isDarkBackground ? "dark" : "light";
|
|
51
52
|
const {
|
|
@@ -54,8 +55,6 @@ const StyledLink = styled.span`
|
|
|
54
55
|
disabledColor
|
|
55
56
|
} = colorMap[colorMapKey](variant);
|
|
56
57
|
return css`
|
|
57
|
-
display: inline-block;
|
|
58
|
-
|
|
59
58
|
${isSkipLink && css`
|
|
60
59
|
a {
|
|
61
60
|
position: absolute;
|
|
@@ -126,7 +125,7 @@ const StyledLink = styled.span`
|
|
|
126
125
|
a,
|
|
127
126
|
button {
|
|
128
127
|
text-decoration: underline;
|
|
129
|
-
display: inline-block;
|
|
128
|
+
${isMenuItem && "display: inline-block;"}
|
|
130
129
|
|
|
131
130
|
${StyledIcon} {
|
|
132
131
|
display: inline-block;
|
|
@@ -12,6 +12,7 @@ import SelectList from "../select-list/select-list.component";
|
|
|
12
12
|
import isExpectedOption from "../utils/is-expected-option";
|
|
13
13
|
import isNavigationKey from "../utils/is-navigation-key";
|
|
14
14
|
import Logger from "../../../__internal__/utils/logger";
|
|
15
|
+
import useStableCallback from "../../../hooks/__internal__/useStableCallback";
|
|
15
16
|
let deprecateInputRefWarnTriggered = false;
|
|
16
17
|
const FilterableSelectList = withFilter(SelectList);
|
|
17
18
|
const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
@@ -21,9 +22,9 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
21
22
|
name,
|
|
22
23
|
label,
|
|
23
24
|
children,
|
|
24
|
-
onOpen,
|
|
25
|
+
onOpen: onOpenProp,
|
|
25
26
|
onChange,
|
|
26
|
-
onFilterChange,
|
|
27
|
+
onFilterChange: onFilterChangeProp,
|
|
27
28
|
onClick,
|
|
28
29
|
onKeyDown,
|
|
29
30
|
onFocus,
|
|
@@ -206,13 +207,14 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
206
207
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
207
208
|
|
|
208
209
|
}, [value, onChange, children]);
|
|
210
|
+
const onOpen = useStableCallback(onOpenProp);
|
|
209
211
|
useEffect(() => {
|
|
210
212
|
if (!isOpen) {
|
|
211
213
|
setFilterText("");
|
|
212
214
|
} else if (onOpen) {
|
|
213
215
|
onOpen();
|
|
214
216
|
}
|
|
215
|
-
}, [
|
|
217
|
+
}, [onOpen, isOpen]);
|
|
216
218
|
useEffect(() => {
|
|
217
219
|
const hasListActionButton = listActionButton !== undefined;
|
|
218
220
|
const onListActionMissingMessage = "onListAction prop required when using listActionButton prop";
|
|
@@ -225,11 +227,16 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
225
227
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
226
228
|
|
|
227
229
|
}, [value, children]);
|
|
230
|
+
const onFilterChange = useStableCallback(onFilterChangeProp);
|
|
231
|
+
const isFirstRender = useRef(true);
|
|
228
232
|
useEffect(() => {
|
|
229
|
-
if (onFilterChange) {
|
|
233
|
+
if (onFilterChange && !isFirstRender.current) {
|
|
230
234
|
onFilterChange(filterText);
|
|
231
235
|
}
|
|
232
|
-
}, [
|
|
236
|
+
}, [onFilterChange, filterText]);
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
isFirstRender.current = false;
|
|
239
|
+
}, []);
|
|
233
240
|
useEffect(() => {
|
|
234
241
|
const clickEvent = "click";
|
|
235
242
|
window.addEventListener(clickEvent, handleGlobalClick);
|
|
@@ -308,10 +315,6 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
308
315
|
return true;
|
|
309
316
|
}
|
|
310
317
|
|
|
311
|
-
if (onOpen) {
|
|
312
|
-
onOpen();
|
|
313
|
-
}
|
|
314
|
-
|
|
315
318
|
if (onFocus && !isInputFocused.current) {
|
|
316
319
|
triggerFocus();
|
|
317
320
|
isInputFocused.current = true;
|
|
@@ -14,6 +14,7 @@ import isExpectedOption from "../utils/is-expected-option";
|
|
|
14
14
|
import isExpectedValue from "../utils/is-expected-value";
|
|
15
15
|
import isNavigationKey from "../utils/is-navigation-key";
|
|
16
16
|
import Logger from "../../../__internal__/utils/logger";
|
|
17
|
+
import useStableCallback from "../../../hooks/__internal__/useStableCallback";
|
|
17
18
|
let deprecateInputRefWarnTriggered = false;
|
|
18
19
|
const FilterableSelectList = withFilter(SelectList);
|
|
19
20
|
const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
@@ -25,7 +26,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
25
26
|
readOnly,
|
|
26
27
|
children,
|
|
27
28
|
onOpen,
|
|
28
|
-
onFilterChange,
|
|
29
|
+
onFilterChange: onFilterChangeProp,
|
|
29
30
|
onChange,
|
|
30
31
|
onClick,
|
|
31
32
|
onFocus,
|
|
@@ -245,11 +246,16 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
245
246
|
window.removeEventListener(clickEvent, handleGlobalClick);
|
|
246
247
|
};
|
|
247
248
|
}, [handleGlobalClick]);
|
|
249
|
+
const onFilterChange = useStableCallback(onFilterChangeProp);
|
|
250
|
+
const isFirstRender = useRef(true);
|
|
248
251
|
useEffect(() => {
|
|
249
|
-
if (onFilterChange) {
|
|
252
|
+
if (onFilterChange && !isFirstRender.current) {
|
|
250
253
|
onFilterChange(filterText);
|
|
251
254
|
}
|
|
252
|
-
}, [
|
|
255
|
+
}, [onFilterChange, filterText]);
|
|
256
|
+
useEffect(() => {
|
|
257
|
+
isFirstRender.current = false;
|
|
258
|
+
}, []);
|
|
253
259
|
|
|
254
260
|
function handleTextboxClick(event) {
|
|
255
261
|
isMouseDownReported.current = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./useStableCallback";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./useStableCallback";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useRef, useCallback } from "react"; // This is a hook that returns a memoized callback that is guaranteed to be the same reference between renders.
|
|
2
|
+
// This is useful when a stable reference is required to prevent unnecessary re-renders.
|
|
3
|
+
|
|
4
|
+
export function useStableCallback(callback) {
|
|
5
|
+
const ref = useRef(callback);
|
|
6
|
+
ref.current = callback;
|
|
7
|
+
const stableCallback = useCallback((...args) => {
|
|
8
|
+
var _ref$current;
|
|
9
|
+
|
|
10
|
+
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.call(ref, ...args);
|
|
11
|
+
}, []);
|
|
12
|
+
return callback ? stableCallback : undefined;
|
|
13
|
+
}
|
|
14
|
+
export default useStableCallback;
|
|
@@ -11,6 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
13
13
|
|
|
14
|
+
var _menu = _interopRequireDefault(require("../menu/menu.context"));
|
|
15
|
+
|
|
14
16
|
var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/events"));
|
|
15
17
|
|
|
16
18
|
var _link = require("./link.style");
|
|
@@ -49,6 +51,9 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
49
51
|
...rest
|
|
50
52
|
}, ref) => {
|
|
51
53
|
const l = (0, _useLocale.default)();
|
|
54
|
+
const {
|
|
55
|
+
inMenu
|
|
56
|
+
} = (0, _react.useContext)(_menu.default);
|
|
52
57
|
|
|
53
58
|
const handleOnKeyDown = ev => {
|
|
54
59
|
if (onKeyDown) {
|
|
@@ -119,7 +124,8 @@ const Link = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
119
124
|
iconAlign: iconAlign,
|
|
120
125
|
hasContent: Boolean(children),
|
|
121
126
|
variant: variant,
|
|
122
|
-
isDarkBackground: isDarkBackground
|
|
127
|
+
isDarkBackground: isDarkBackground,
|
|
128
|
+
isMenuItem: inMenu
|
|
123
129
|
}, (0, _tags.default)("link", rest), isSkipLink && {
|
|
124
130
|
"data-element": "skip-link"
|
|
125
131
|
}), createLinkBasedOnType());
|
|
@@ -13,6 +13,7 @@ export interface StyledLinkProps {
|
|
|
13
13
|
}
|
|
14
14
|
interface PrivateStyledLinkProps {
|
|
15
15
|
hasContent: boolean;
|
|
16
|
+
isMenuItem?: boolean;
|
|
16
17
|
}
|
|
17
18
|
declare const StyledLink: import("styled-components").StyledComponent<"span", any, StyledLinkProps & PrivateStyledLinkProps, never>;
|
|
18
19
|
declare const StyledContent: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
@@ -61,7 +61,8 @@ const StyledLink = _styledComponents.default.span`
|
|
|
61
61
|
hasContent,
|
|
62
62
|
disabled,
|
|
63
63
|
variant,
|
|
64
|
-
isDarkBackground
|
|
64
|
+
isDarkBackground,
|
|
65
|
+
isMenuItem
|
|
65
66
|
}) => {
|
|
66
67
|
const colorMapKey = isDarkBackground ? "dark" : "light";
|
|
67
68
|
const {
|
|
@@ -70,8 +71,6 @@ const StyledLink = _styledComponents.default.span`
|
|
|
70
71
|
disabledColor
|
|
71
72
|
} = colorMap[colorMapKey](variant);
|
|
72
73
|
return (0, _styledComponents.css)`
|
|
73
|
-
display: inline-block;
|
|
74
|
-
|
|
75
74
|
${isSkipLink && (0, _styledComponents.css)`
|
|
76
75
|
a {
|
|
77
76
|
position: absolute;
|
|
@@ -142,7 +141,7 @@ const StyledLink = _styledComponents.default.span`
|
|
|
142
141
|
a,
|
|
143
142
|
button {
|
|
144
143
|
text-decoration: underline;
|
|
145
|
-
display: inline-block;
|
|
144
|
+
${isMenuItem && "display: inline-block;"}
|
|
146
145
|
|
|
147
146
|
${_icon.default} {
|
|
148
147
|
display: inline-block;
|
|
@@ -29,6 +29,8 @@ var _isNavigationKey = _interopRequireDefault(require("../utils/is-navigation-ke
|
|
|
29
29
|
|
|
30
30
|
var _logger = _interopRequireDefault(require("../../../__internal__/utils/logger"));
|
|
31
31
|
|
|
32
|
+
var _useStableCallback = _interopRequireDefault(require("../../../hooks/__internal__/useStableCallback"));
|
|
33
|
+
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
35
|
|
|
34
36
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -47,9 +49,9 @@ const FilterableSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
47
49
|
name,
|
|
48
50
|
label,
|
|
49
51
|
children,
|
|
50
|
-
onOpen,
|
|
52
|
+
onOpen: onOpenProp,
|
|
51
53
|
onChange,
|
|
52
|
-
onFilterChange,
|
|
54
|
+
onFilterChange: onFilterChangeProp,
|
|
53
55
|
onClick,
|
|
54
56
|
onKeyDown,
|
|
55
57
|
onFocus,
|
|
@@ -233,13 +235,14 @@ const FilterableSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
233
235
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
234
236
|
|
|
235
237
|
}, [value, onChange, children]);
|
|
238
|
+
const onOpen = (0, _useStableCallback.default)(onOpenProp);
|
|
236
239
|
(0, _react.useEffect)(() => {
|
|
237
240
|
if (!isOpen) {
|
|
238
241
|
setFilterText("");
|
|
239
242
|
} else if (onOpen) {
|
|
240
243
|
onOpen();
|
|
241
244
|
}
|
|
242
|
-
}, [
|
|
245
|
+
}, [onOpen, isOpen]);
|
|
243
246
|
(0, _react.useEffect)(() => {
|
|
244
247
|
const hasListActionButton = listActionButton !== undefined;
|
|
245
248
|
const onListActionMissingMessage = "onListAction prop required when using listActionButton prop";
|
|
@@ -252,11 +255,16 @@ const FilterableSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
252
255
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
253
256
|
|
|
254
257
|
}, [value, children]);
|
|
258
|
+
const onFilterChange = (0, _useStableCallback.default)(onFilterChangeProp);
|
|
259
|
+
const isFirstRender = (0, _react.useRef)(true);
|
|
255
260
|
(0, _react.useEffect)(() => {
|
|
256
|
-
if (onFilterChange) {
|
|
261
|
+
if (onFilterChange && !isFirstRender.current) {
|
|
257
262
|
onFilterChange(filterText);
|
|
258
263
|
}
|
|
259
|
-
}, [
|
|
264
|
+
}, [onFilterChange, filterText]);
|
|
265
|
+
(0, _react.useEffect)(() => {
|
|
266
|
+
isFirstRender.current = false;
|
|
267
|
+
}, []);
|
|
260
268
|
(0, _react.useEffect)(() => {
|
|
261
269
|
const clickEvent = "click";
|
|
262
270
|
window.addEventListener(clickEvent, handleGlobalClick);
|
|
@@ -335,10 +343,6 @@ const FilterableSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
335
343
|
return true;
|
|
336
344
|
}
|
|
337
345
|
|
|
338
|
-
if (onOpen) {
|
|
339
|
-
onOpen();
|
|
340
|
-
}
|
|
341
|
-
|
|
342
346
|
if (onFocus && !isInputFocused.current) {
|
|
343
347
|
triggerFocus();
|
|
344
348
|
isInputFocused.current = true;
|
|
@@ -33,6 +33,8 @@ var _isNavigationKey = _interopRequireDefault(require("../utils/is-navigation-ke
|
|
|
33
33
|
|
|
34
34
|
var _logger = _interopRequireDefault(require("../../../__internal__/utils/logger"));
|
|
35
35
|
|
|
36
|
+
var _useStableCallback = _interopRequireDefault(require("../../../hooks/__internal__/useStableCallback"));
|
|
37
|
+
|
|
36
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
39
|
|
|
38
40
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -53,7 +55,7 @@ const MultiSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
53
55
|
readOnly,
|
|
54
56
|
children,
|
|
55
57
|
onOpen,
|
|
56
|
-
onFilterChange,
|
|
58
|
+
onFilterChange: onFilterChangeProp,
|
|
57
59
|
onChange,
|
|
58
60
|
onClick,
|
|
59
61
|
onFocus,
|
|
@@ -275,11 +277,16 @@ const MultiSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
275
277
|
window.removeEventListener(clickEvent, handleGlobalClick);
|
|
276
278
|
};
|
|
277
279
|
}, [handleGlobalClick]);
|
|
280
|
+
const onFilterChange = (0, _useStableCallback.default)(onFilterChangeProp);
|
|
281
|
+
const isFirstRender = (0, _react.useRef)(true);
|
|
278
282
|
(0, _react.useEffect)(() => {
|
|
279
|
-
if (onFilterChange) {
|
|
283
|
+
if (onFilterChange && !isFirstRender.current) {
|
|
280
284
|
onFilterChange(filterText);
|
|
281
285
|
}
|
|
282
|
-
}, [
|
|
286
|
+
}, [onFilterChange, filterText]);
|
|
287
|
+
(0, _react.useEffect)(() => {
|
|
288
|
+
isFirstRender.current = false;
|
|
289
|
+
}, []);
|
|
283
290
|
|
|
284
291
|
function handleTextboxClick(event) {
|
|
285
292
|
isMouseDownReported.current = false;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./useStableCallback";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useStableCallback.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _useStableCallback = _interopRequireDefault(require("./useStableCallback"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useStableCallback = useStableCallback;
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
|
|
11
|
+
// This is a hook that returns a memoized callback that is guaranteed to be the same reference between renders.
|
|
12
|
+
// This is useful when a stable reference is required to prevent unnecessary re-renders.
|
|
13
|
+
function useStableCallback(callback) {
|
|
14
|
+
const ref = (0, _react.useRef)(callback);
|
|
15
|
+
ref.current = callback;
|
|
16
|
+
const stableCallback = (0, _react.useCallback)((...args) => {
|
|
17
|
+
var _ref$current;
|
|
18
|
+
|
|
19
|
+
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.call(ref, ...args);
|
|
20
|
+
}, []);
|
|
21
|
+
return callback ? stableCallback : undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _default = useStableCallback;
|
|
25
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "114.
|
|
3
|
+
"version": "114.15.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"@storybook/theming": "^6.4.18",
|
|
81
81
|
"@testing-library/jest-dom": "^5.16.2",
|
|
82
82
|
"@testing-library/react": "^12.1.3",
|
|
83
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
83
84
|
"@testing-library/user-event": "^14.4.3",
|
|
84
85
|
"@types/crypto-js": "^4.1.1",
|
|
85
86
|
"@types/draft-js": "^0.11.7",
|