@carbon/react 1.56.0 → 1.57.0-rc.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +912 -953
- package/es/components/ContainedList/ContainedList.d.ts +41 -0
- package/es/components/ContainedList/ContainedList.js +18 -4
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +35 -0
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +5 -3
- package/es/components/DataTable/TableToolbarSearch.js +1 -1
- package/es/components/OverflowMenu/OverflowMenu.d.ts +300 -0
- package/es/components/OverflowMenu/OverflowMenu.js +22 -14
- package/es/components/OverflowMenu/next/index.d.ts +39 -0
- package/es/components/OverflowMenu/next/index.js +4 -3
- package/es/components/RadioTile/RadioTile.d.ts +4 -0
- package/es/components/RadioTile/RadioTile.js +7 -1
- package/es/components/Slider/Slider.js +3 -3
- package/es/components/StructuredList/StructuredList.js +6 -2
- package/es/components/TileGroup/TileGroup.d.ts +8 -0
- package/es/components/TileGroup/TileGroup.js +7 -1
- package/es/index.js +1 -1
- package/es/internal/Selection.js +4 -1
- package/lib/components/ContainedList/ContainedList.d.ts +41 -0
- package/lib/components/ContainedList/ContainedList.js +18 -4
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +35 -0
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +5 -3
- package/lib/components/DataTable/TableToolbarSearch.js +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +300 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +21 -13
- package/lib/components/OverflowMenu/next/index.d.ts +39 -0
- package/lib/components/OverflowMenu/next/index.js +4 -3
- package/lib/components/RadioTile/RadioTile.d.ts +4 -0
- package/lib/components/RadioTile/RadioTile.js +7 -1
- package/lib/components/Slider/Slider.js +3 -3
- package/lib/components/StructuredList/StructuredList.js +6 -2
- package/lib/components/TileGroup/TileGroup.d.ts +8 -0
- package/lib/components/TileGroup/TileGroup.js +7 -1
- package/lib/index.js +2 -2
- package/lib/internal/Selection.js +4 -1
- package/package.json +8 -8
- package/telemetry.yml +1 -1
|
@@ -104,10 +104,16 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
-
class OverflowMenu extends
|
|
107
|
+
class OverflowMenu extends React__default["default"].Component {
|
|
108
108
|
constructor() {
|
|
109
109
|
super(...arguments);
|
|
110
|
-
_rollupPluginBabelHelpers.defineProperty(this, "state", {
|
|
110
|
+
_rollupPluginBabelHelpers.defineProperty(this, "state", {
|
|
111
|
+
open: false,
|
|
112
|
+
// Set a default value for 'open'
|
|
113
|
+
hasMountedTrigger: false,
|
|
114
|
+
// Set a default value for 'hasMountedTrigger'
|
|
115
|
+
click: false // Set a default value for 'click'
|
|
116
|
+
});
|
|
111
117
|
_rollupPluginBabelHelpers.defineProperty(this, "instanceId", getInstanceId());
|
|
112
118
|
/**
|
|
113
119
|
* The handle of `onfocusin` or `focus` event handler.
|
|
@@ -141,8 +147,8 @@ class OverflowMenu extends React.Component {
|
|
|
141
147
|
}
|
|
142
148
|
});
|
|
143
149
|
_rollupPluginBabelHelpers.defineProperty(this, "closeMenuAndFocus", () => {
|
|
144
|
-
|
|
145
|
-
|
|
150
|
+
const wasClicked = this.state.click;
|
|
151
|
+
const wasOpen = this.state.open;
|
|
146
152
|
this.closeMenu(() => {
|
|
147
153
|
if (wasOpen && !wasClicked) {
|
|
148
154
|
this.focusMenuEl();
|
|
@@ -150,7 +156,7 @@ class OverflowMenu extends React.Component {
|
|
|
150
156
|
});
|
|
151
157
|
});
|
|
152
158
|
_rollupPluginBabelHelpers.defineProperty(this, "closeMenuOnEscape", () => {
|
|
153
|
-
|
|
159
|
+
const wasOpen = this.state.open;
|
|
154
160
|
this.closeMenu(() => {
|
|
155
161
|
if (wasOpen) {
|
|
156
162
|
this.focusMenuEl();
|
|
@@ -212,7 +218,7 @@ class OverflowMenu extends React.Component {
|
|
|
212
218
|
direction
|
|
213
219
|
} = _ref;
|
|
214
220
|
const enabledIndices = React__default["default"].Children.toArray(this.props.children).reduce((acc, curr, i) => {
|
|
215
|
-
if (!curr.props.disabled) {
|
|
221
|
+
if ( /*#__PURE__*/React__default["default"].isValidElement(curr) && !curr.props.disabled) {
|
|
216
222
|
acc.push(i);
|
|
217
223
|
}
|
|
218
224
|
return acc;
|
|
@@ -237,6 +243,7 @@ class OverflowMenu extends React.Component {
|
|
|
237
243
|
* @param {Element} menuBody The DOM element of the menu body.
|
|
238
244
|
* @private
|
|
239
245
|
*/
|
|
246
|
+
_rollupPluginBabelHelpers.defineProperty(this, "_menuBody", null);
|
|
240
247
|
_rollupPluginBabelHelpers.defineProperty(this, "_bindMenuBody", menuBody => {
|
|
241
248
|
if (!menuBody) {
|
|
242
249
|
this._menuBody = menuBody;
|
|
@@ -279,7 +286,7 @@ class OverflowMenu extends React.Component {
|
|
|
279
286
|
const {
|
|
280
287
|
current: triggerEl
|
|
281
288
|
} = this._triggerRef;
|
|
282
|
-
return triggerEl && triggerEl.closest('[data-floating-menu-container]') || document.body;
|
|
289
|
+
return triggerEl instanceof Element && triggerEl.closest('[data-floating-menu-container]') || document.body;
|
|
283
290
|
});
|
|
284
291
|
}
|
|
285
292
|
componentDidUpdate(_, prevState) {
|
|
@@ -360,18 +367,19 @@ class OverflowMenu extends React.Component {
|
|
|
360
367
|
[`${prefix}--overflow-menu-options--${size}`]: size
|
|
361
368
|
});
|
|
362
369
|
const overflowMenuIconClasses = cx__default["default"](`${prefix}--overflow-menu__icon`, iconClass);
|
|
363
|
-
const childrenWithProps = React__default["default"].Children.toArray(children).map((child, index) => /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
364
|
-
|
|
370
|
+
const childrenWithProps = React__default["default"].Children.toArray(children).map((child, index) => /*#__PURE__*/React__default["default"].isValidElement(child) ? /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
371
|
+
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
372
|
+
closeMenu: child.props.closeMenu || this.closeMenuAndFocus,
|
|
365
373
|
handleOverflowMenuItemFocus: this.handleOverflowMenuItemFocus,
|
|
366
374
|
ref: e => {
|
|
367
375
|
this[`overflowMenuItem${index}`] = e;
|
|
368
376
|
},
|
|
369
377
|
index
|
|
370
|
-
}));
|
|
378
|
+
}) : null);
|
|
371
379
|
const menuBodyId = `overflow-menu-${this.instanceId}__menu-body`;
|
|
372
380
|
const menuBody = /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
373
381
|
className: overflowMenuOptionsClasses,
|
|
374
|
-
tabIndex:
|
|
382
|
+
tabIndex: -1,
|
|
375
383
|
role: "menu",
|
|
376
384
|
"aria-label": ariaLabel || deprecatedAriaLabel,
|
|
377
385
|
onKeyDown: this.handleKeyPress,
|
|
@@ -398,12 +406,12 @@ class OverflowMenu extends React.Component {
|
|
|
398
406
|
onClickOutside: this.handleClickOutside
|
|
399
407
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
400
408
|
className: `${prefix}--overflow-menu__wrapper`,
|
|
401
|
-
"aria-owns": open ? menuBodyId :
|
|
409
|
+
"aria-owns": open ? menuBodyId : undefined
|
|
402
410
|
}, /*#__PURE__*/React__default["default"].createElement(index.IconButton, _rollupPluginBabelHelpers["extends"]({}, other, {
|
|
403
411
|
type: "button",
|
|
404
412
|
"aria-haspopup": true,
|
|
405
413
|
"aria-expanded": open,
|
|
406
|
-
"aria-controls": open ? menuBodyId :
|
|
414
|
+
"aria-controls": open ? menuBodyId : undefined,
|
|
407
415
|
className: overflowMenuClasses,
|
|
408
416
|
onClick: this.handleClick,
|
|
409
417
|
id: id,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2020, 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, { type ComponentType, type FunctionComponent } from 'react';
|
|
8
|
+
interface OverflowMenuProps {
|
|
9
|
+
/**
|
|
10
|
+
* A collection of MenuItems to be rendered within this OverflowMenu.
|
|
11
|
+
*/
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names for the trigger button.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* A label describing the options available. Is used in the trigger tooltip and as the menu's accessible label.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Experimental property. Specify how the menu should align with the button element
|
|
23
|
+
*/
|
|
24
|
+
menuAlignment?: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
25
|
+
/**
|
|
26
|
+
* Optionally provide a custom icon to be rendered on the trigger button.
|
|
27
|
+
*/
|
|
28
|
+
renderIcon?: ComponentType | FunctionComponent;
|
|
29
|
+
/**
|
|
30
|
+
* Specify the size of the menu, from a list of available sizes.
|
|
31
|
+
*/
|
|
32
|
+
size?: 'sm' | 'md' | 'lg';
|
|
33
|
+
/**
|
|
34
|
+
* Specify how the trigger tooltip should be aligned.
|
|
35
|
+
*/
|
|
36
|
+
tooltipAlignment?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right';
|
|
37
|
+
}
|
|
38
|
+
declare const OverflowMenu: React.ForwardRefExoticComponent<OverflowMenuProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
export { OverflowMenu };
|
|
@@ -62,10 +62,10 @@ const OverflowMenu = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
62
62
|
}, size !== defaultSize && `${prefix}--overflow-menu--${size}`);
|
|
63
63
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
64
64
|
className: containerClasses,
|
|
65
|
-
"aria-owns": open ? id :
|
|
65
|
+
"aria-owns": open ? id : undefined,
|
|
66
66
|
ref: forwardRef
|
|
67
67
|
}), /*#__PURE__*/React__default["default"].createElement(index.IconButton, {
|
|
68
|
-
"aria-controls": open ? id :
|
|
68
|
+
"aria-controls": open ? id : undefined,
|
|
69
69
|
"aria-haspopup": true,
|
|
70
70
|
"aria-expanded": open,
|
|
71
71
|
className: triggerClasses,
|
|
@@ -107,8 +107,9 @@ OverflowMenu.propTypes = {
|
|
|
107
107
|
*/
|
|
108
108
|
menuAlignment: PropTypes__default["default"].oneOf(['top-start', 'top-end', 'bottom-start', 'bottom-end']),
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
110
|
+
* Optionally provide a custom icon to be rendered on the trigger button.
|
|
111
111
|
*/
|
|
112
|
+
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
112
113
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
113
114
|
/**
|
|
114
115
|
* Specify the size of the menu, from a list of available sizes.
|
|
@@ -50,6 +50,10 @@ export interface RadioTileProps {
|
|
|
50
50
|
* Specify the value of the underlying `<input>`.
|
|
51
51
|
*/
|
|
52
52
|
value: string | number;
|
|
53
|
+
/**
|
|
54
|
+
* `true` to specify if the input is required.
|
|
55
|
+
*/
|
|
56
|
+
required?: boolean;
|
|
53
57
|
}
|
|
54
58
|
declare const RadioTile: React.ForwardRefExoticComponent<RadioTileProps & React.RefAttributes<HTMLInputElement>>;
|
|
55
59
|
export default RadioTile;
|
|
@@ -43,6 +43,7 @@ const RadioTile = /*#__PURE__*/React__default["default"].forwardRef(function Rad
|
|
|
43
43
|
id,
|
|
44
44
|
onChange = noopFn.noopFn,
|
|
45
45
|
tabIndex = 0,
|
|
46
|
+
required,
|
|
46
47
|
...rest
|
|
47
48
|
} = _ref;
|
|
48
49
|
const prefix = usePrefix.usePrefix();
|
|
@@ -84,7 +85,8 @@ const RadioTile = /*#__PURE__*/React__default["default"].forwardRef(function Rad
|
|
|
84
85
|
tabIndex: !disabled ? tabIndex : undefined,
|
|
85
86
|
type: "radio",
|
|
86
87
|
value: value,
|
|
87
|
-
ref: ref
|
|
88
|
+
ref: ref,
|
|
89
|
+
required: required
|
|
88
90
|
}), /*#__PURE__*/React__default["default"].createElement("label", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
89
91
|
htmlFor: inputId,
|
|
90
92
|
className: className
|
|
@@ -130,6 +132,10 @@ RadioTile.propTypes = {
|
|
|
130
132
|
* the underlying `<input>` changes.
|
|
131
133
|
*/
|
|
132
134
|
onChange: PropTypes__default["default"].func,
|
|
135
|
+
/**
|
|
136
|
+
* `true` to specify if the control is required.
|
|
137
|
+
*/
|
|
138
|
+
required: PropTypes__default["default"].bool,
|
|
133
139
|
/**
|
|
134
140
|
* Specify the tab index of the underlying `<input>`.
|
|
135
141
|
*/
|
|
@@ -522,7 +522,7 @@ class Slider extends React.PureComponent {
|
|
|
522
522
|
if (clientX) {
|
|
523
523
|
const leftOffset = this.state.isRtl ? (boundingRect?.right ?? 0) - clientX : clientX - (boundingRect?.left ?? 0);
|
|
524
524
|
return leftOffset / width;
|
|
525
|
-
} else if (value && range) {
|
|
525
|
+
} else if (value !== null && value !== undefined && range) {
|
|
526
526
|
// Prevent NaN calculation if the range is 0.
|
|
527
527
|
return range === 0 ? 0 : (value - this.props.min) / range;
|
|
528
528
|
}
|
|
@@ -1104,7 +1104,7 @@ class Slider extends React.PureComponent {
|
|
|
1104
1104
|
hasTooltip: hideTextInput,
|
|
1105
1105
|
className: lowerThumbWrapperClasses,
|
|
1106
1106
|
label: `${value}`,
|
|
1107
|
-
align:
|
|
1107
|
+
align: "top"
|
|
1108
1108
|
}, lowerThumbWrapperProps), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1109
1109
|
className: lowerThumbClasses,
|
|
1110
1110
|
role: "slider",
|
|
@@ -1123,7 +1123,7 @@ class Slider extends React.PureComponent {
|
|
|
1123
1123
|
hasTooltip: hideTextInput,
|
|
1124
1124
|
className: upperThumbWrapperClasses,
|
|
1125
1125
|
label: `${valueUpper}`,
|
|
1126
|
-
align: "top
|
|
1126
|
+
align: "top"
|
|
1127
1127
|
}, upperThumbWrapperProps), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1128
1128
|
className: upperThumbClasses,
|
|
1129
1129
|
role: "slider",
|
|
@@ -27,7 +27,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
27
27
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
28
28
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
29
29
|
|
|
30
|
-
var _StructuredListCell
|
|
30
|
+
var _StructuredListCell;
|
|
31
31
|
const GridSelectedRowStateContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
32
32
|
const GridSelectedRowDispatchContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
33
33
|
function StructuredListWrapper(props) {
|
|
@@ -202,7 +202,11 @@ function StructuredListRow(props) {
|
|
|
202
202
|
onKeyDown: onKeyDown
|
|
203
203
|
}), /*#__PURE__*/React__default["default"].createElement(GridRowContext.Provider, {
|
|
204
204
|
value: value
|
|
205
|
-
}, selection && /*#__PURE__*/React__default["default"].createElement(StructuredListCell, null, selectedRow === id ?
|
|
205
|
+
}, selection && /*#__PURE__*/React__default["default"].createElement(StructuredListCell, null, selectedRow === id ? /*#__PURE__*/React__default["default"].createElement(iconsReact.RadioButtonChecked, {
|
|
206
|
+
className: `${prefix}--structured-list__icon`
|
|
207
|
+
}) : /*#__PURE__*/React__default["default"].createElement(iconsReact.RadioButton, {
|
|
208
|
+
className: `${prefix}--structured-list__icon`
|
|
209
|
+
})), children));
|
|
206
210
|
}
|
|
207
211
|
StructuredListRow.propTypes = {
|
|
208
212
|
/**
|
|
@@ -40,6 +40,10 @@ export interface TileGroupProps extends Omit<ReactAttr<HTMLFieldSetElement>, Exc
|
|
|
40
40
|
* Specify the value that is currently selected in the group
|
|
41
41
|
*/
|
|
42
42
|
valueSelected?: string | number;
|
|
43
|
+
/**
|
|
44
|
+
* `true` to specify if input selection in group is required.
|
|
45
|
+
*/
|
|
46
|
+
required?: boolean;
|
|
43
47
|
}
|
|
44
48
|
declare const TileGroup: {
|
|
45
49
|
(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -73,6 +77,10 @@ declare const TileGroup: {
|
|
|
73
77
|
* the group changes
|
|
74
78
|
*/
|
|
75
79
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
80
|
+
/**
|
|
81
|
+
* `true` to specify if input selection in group is required.
|
|
82
|
+
*/
|
|
83
|
+
required: PropTypes.Requireable<boolean>;
|
|
76
84
|
/**
|
|
77
85
|
* Specify the value that is currently selected in the group
|
|
78
86
|
*/
|
|
@@ -30,7 +30,8 @@ const TileGroup = props => {
|
|
|
30
30
|
legend,
|
|
31
31
|
name,
|
|
32
32
|
onChange = noopFn.noopFn,
|
|
33
|
-
valueSelected
|
|
33
|
+
valueSelected,
|
|
34
|
+
required
|
|
34
35
|
} = props;
|
|
35
36
|
const prefix = usePrefix.usePrefix();
|
|
36
37
|
const [selected, setSelected] = React.useState(valueSelected ?? defaultSelected);
|
|
@@ -54,6 +55,7 @@ const TileGroup = props => {
|
|
|
54
55
|
...otherProps
|
|
55
56
|
} = child.props;
|
|
56
57
|
return /*#__PURE__*/React__default["default"].createElement(RadioTile["default"], _rollupPluginBabelHelpers["extends"]({}, otherProps, {
|
|
58
|
+
required: required,
|
|
57
59
|
name: name,
|
|
58
60
|
key: value,
|
|
59
61
|
value: value,
|
|
@@ -122,6 +124,10 @@ TileGroup.propTypes = {
|
|
|
122
124
|
* the group changes
|
|
123
125
|
*/
|
|
124
126
|
onChange: PropTypes__default["default"].func,
|
|
127
|
+
/**
|
|
128
|
+
* `true` to specify if input selection in group is required.
|
|
129
|
+
*/
|
|
130
|
+
required: PropTypes__default["default"].bool,
|
|
125
131
|
/**
|
|
126
132
|
* Specify the value that is currently selected in the group
|
|
127
133
|
*/
|
package/lib/index.js
CHANGED
|
@@ -183,7 +183,6 @@ var PageSelector = require('./components/Pagination/experimental/PageSelector.js
|
|
|
183
183
|
var Pagination = require('./components/Pagination/experimental/Pagination.js');
|
|
184
184
|
var CheckboxGroup = require('./components/CheckboxGroup/CheckboxGroup.js');
|
|
185
185
|
var ContainedListItem = require('./components/ContainedList/ContainedListItem/ContainedListItem.js');
|
|
186
|
-
var ContainedList = require('./components/ContainedList/ContainedList.js');
|
|
187
186
|
var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
|
|
188
187
|
var Slider_Skeleton = require('./components/Slider/Slider.Skeleton.js');
|
|
189
188
|
var TextInput_Skeleton = require('./components/TextInput/TextInput.Skeleton.js');
|
|
@@ -208,6 +207,7 @@ var ChatButton = require('./components/ChatButton/ChatButton.js');
|
|
|
208
207
|
var ChatButton_Skeleton = require('./components/ChatButton/ChatButton.Skeleton.js');
|
|
209
208
|
var Text = require('./components/Text/Text.js');
|
|
210
209
|
var TextDirection = require('./components/Text/TextDirection.js');
|
|
210
|
+
var ContainedList = require('./components/ContainedList/ContainedList.js');
|
|
211
211
|
var DataTable = require('./components/DataTable/DataTable.js');
|
|
212
212
|
var Table = require('./components/DataTable/Table.js');
|
|
213
213
|
var TableActionList = require('./components/DataTable/TableActionList.js');
|
|
@@ -454,7 +454,6 @@ exports.unstable_PageSelector = PageSelector["default"];
|
|
|
454
454
|
exports.unstable_Pagination = Pagination["default"];
|
|
455
455
|
exports.CheckboxGroup = CheckboxGroup["default"];
|
|
456
456
|
exports.ContainedListItem = ContainedListItem["default"];
|
|
457
|
-
exports.ContainedList = ContainedList["default"];
|
|
458
457
|
exports.useContextMenu = useContextMenu["default"];
|
|
459
458
|
exports.SliderSkeleton = Slider_Skeleton["default"];
|
|
460
459
|
exports.TextInputSkeleton = TextInput_Skeleton["default"];
|
|
@@ -479,6 +478,7 @@ exports.unstable__ChatButton = ChatButton["default"];
|
|
|
479
478
|
exports.unstable__ChatButtonSkeleton = ChatButton_Skeleton["default"];
|
|
480
479
|
exports.unstable_Text = Text.Text;
|
|
481
480
|
exports.unstable_TextDirection = TextDirection.TextDirection;
|
|
481
|
+
exports.ContainedList = ContainedList["default"];
|
|
482
482
|
exports.DataTable = DataTable["default"];
|
|
483
483
|
exports.Table = Table.Table;
|
|
484
484
|
exports.TableActionList = TableActionList["default"];
|
|
@@ -50,6 +50,9 @@ function useSelection(_ref2) {
|
|
|
50
50
|
const [uncontrolledItems, setUncontrolledItems] = React.useState(initialSelectedItems);
|
|
51
51
|
const isControlled = !!controlledItems;
|
|
52
52
|
const [selectedItems, setSelectedItems] = React.useState(isControlled ? controlledItems : uncontrolledItems);
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
setSelectedItems(isControlled ? controlledItems : uncontrolledItems);
|
|
55
|
+
}, [isControlled, controlledItems, uncontrolledItems]);
|
|
53
56
|
React.useEffect(() => {
|
|
54
57
|
callOnChangeHandler({
|
|
55
58
|
isControlled,
|
|
@@ -84,7 +87,7 @@ function useSelection(_ref2) {
|
|
|
84
87
|
isMounted: isMounted.current,
|
|
85
88
|
onChangeHandlerControlled: savedOnChange.current,
|
|
86
89
|
onChangeHandlerUncontrolled: setUncontrolledItems,
|
|
87
|
-
selectedItems:
|
|
90
|
+
selectedItems: []
|
|
88
91
|
});
|
|
89
92
|
}, [disabled, isControlled]);
|
|
90
93
|
React.useEffect(() => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.57.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@babel/runtime": "^7.18.3",
|
|
51
|
-
"@carbon/feature-flags": "^0.
|
|
52
|
-
"@carbon/icons-react": "^11.
|
|
53
|
-
"@carbon/layout": "^11.
|
|
54
|
-
"@carbon/styles": "^1.
|
|
51
|
+
"@carbon/feature-flags": "^0.20.0-rc.0",
|
|
52
|
+
"@carbon/icons-react": "^11.41.0-rc.0",
|
|
53
|
+
"@carbon/layout": "^11.22.0-rc.0",
|
|
54
|
+
"@carbon/styles": "^1.57.0-rc.0",
|
|
55
55
|
"@floating-ui/react": "^0.26.0",
|
|
56
|
-
"@ibm/telemetry-js": "^1.
|
|
56
|
+
"@ibm/telemetry-js": "^1.5.0",
|
|
57
57
|
"classnames": "2.5.1",
|
|
58
58
|
"copy-to-clipboard": "^3.3.1",
|
|
59
59
|
"downshift": "8.5.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@babel/preset-react": "^7.22.3",
|
|
82
82
|
"@babel/preset-typescript": "^7.21.5",
|
|
83
83
|
"@carbon/test-utils": "^10.30.0",
|
|
84
|
-
"@carbon/themes": "^11.
|
|
84
|
+
"@carbon/themes": "^11.35.0-rc.0",
|
|
85
85
|
"@rollup/plugin-babel": "^6.0.0",
|
|
86
86
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
87
87
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
@@ -141,5 +141,5 @@
|
|
|
141
141
|
"**/*.scss",
|
|
142
142
|
"**/*.css"
|
|
143
143
|
],
|
|
144
|
-
"gitHead": "
|
|
144
|
+
"gitHead": "401633ab2d5fdeaeb89f66bb9040cc1de008599d"
|
|
145
145
|
}
|
package/telemetry.yml
CHANGED