@carbon/react 1.78.1 → 1.78.2
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 +764 -764
- package/es/components/Accordion/AccordionItem.js +2 -2
- package/es/components/Button/Button.d.ts +3 -2
- package/es/components/Button/Button.js +2 -1
- package/es/components/Button/ButtonBase.js +1 -1
- package/es/components/ChatButton/ChatButton.d.ts +3 -2
- package/es/components/ChatButton/ChatButton.js +2 -1
- package/es/components/ComboBox/ComboBox.js +24 -34
- package/es/components/ComposedModal/ComposedModal.js +51 -65
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/es/components/DataTable/TableBatchAction.d.ts +3 -3
- package/es/components/DataTable/TableBatchAction.js +1 -1
- package/es/components/DataTable/TableContainer.d.ts +1 -1
- package/es/components/DataTable/TableContainer.js +3 -3
- package/es/components/DataTable/TableExpandHeader.d.ts +5 -6
- package/es/components/DataTable/TableToolbarMenu.d.ts +2 -2
- package/es/components/DataTable/TableToolbarMenu.js +1 -1
- package/es/components/DatePicker/DatePicker.js +2 -2
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/es/components/Dialog/index.d.ts +4 -42
- package/es/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/es/components/FeatureFlags/index.d.ts +1 -3
- package/es/components/FeatureFlags/index.js +0 -3
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +4 -6
- package/es/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/Grid/CSSGrid.js +14 -18
- package/es/components/Grid/FlexGrid.js +6 -7
- package/es/components/Grid/GridTypes.d.ts +3 -5
- package/es/components/IconButton/index.js +3 -3
- package/es/components/Layer/index.d.ts +6 -4
- package/es/components/Layer/index.js +6 -5
- package/es/components/Link/Link.d.ts +3 -2
- package/es/components/Link/Link.js +2 -1
- package/es/components/ListBox/ListBoxMenuItem.d.ts +3 -3
- package/es/components/ListBox/ListBoxMenuItem.js +15 -37
- package/es/components/Menu/Menu.js +2 -2
- package/es/components/Menu/MenuItem.d.ts +2 -2
- package/es/components/Menu/MenuItem.js +3 -3
- package/es/components/Modal/Modal.js +49 -121
- package/es/components/Modal/next/index.d.ts +171 -0
- package/es/components/ModalWrapper/ModalWrapper.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/Notification/Notification.d.ts +13 -5
- package/es/components/Notification/Notification.js +4 -3
- package/es/components/OverflowMenu/OverflowMenu.d.ts +8 -4
- package/es/components/OverflowMenu/OverflowMenu.js +3 -3
- package/es/components/OverflowMenu/next/index.d.ts +2 -2
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.d.ts +3 -2
- package/es/components/Search/Search.js +6 -4
- package/es/components/Slider/Slider.d.ts +15 -16
- package/es/components/Slider/Slider.js +22 -22
- package/es/components/Tabs/Tabs.d.ts +6 -3
- package/es/components/Tabs/Tabs.js +9 -8
- package/es/components/Tag/DismissibleTag.d.ts +5 -3
- package/es/components/Tag/DismissibleTag.js +2 -1
- package/es/components/Tag/OperationalTag.d.ts +3 -2
- package/es/components/Tag/OperationalTag.js +2 -1
- package/es/components/Tag/SelectableTag.d.ts +5 -3
- package/es/components/Tag/SelectableTag.js +2 -1
- package/es/components/Tag/Tag.d.ts +3 -2
- package/es/components/Tag/Tag.js +2 -1
- package/es/components/Tile/Tile.d.ts +5 -3
- package/es/components/Tile/Tile.js +6 -8
- package/es/components/Toggletip/index.js +2 -2
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +2 -2
- package/es/components/TreeView/TreeNode.d.ts +5 -3
- package/es/components/TreeView/TreeNode.js +4 -3
- package/es/components/TreeView/TreeView.js +2 -2
- package/es/components/UIShell/HeaderContainer.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +2 -2
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNav.js +2 -2
- package/es/components/UIShell/SideNavHeader.d.ts +3 -2
- package/es/components/UIShell/SideNavHeader.js +2 -1
- package/es/components/UIShell/SideNavLink.d.ts +2 -2
- package/es/components/UIShell/SideNavLink.js +1 -1
- package/es/components/UIShell/SideNavMenu.d.ts +2 -2
- package/es/components/UIShell/SideNavMenu.js +3 -3
- package/es/components/UIShell/SwitcherItem.js +2 -2
- package/es/internal/FloatingMenu.js +4 -4
- package/es/internal/OptimizedResize.js +24 -21
- package/es/internal/focus/index.js +15 -0
- package/es/internal/keyboard/keys.js +2 -2
- package/es/internal/keyboard/match.js +41 -17
- package/es/internal/keyboard/navigation.js +27 -15
- package/es/internal/useMergedRefs.js +0 -3
- package/lib/components/Accordion/AccordionItem.js +2 -2
- package/lib/components/Button/Button.d.ts +3 -2
- package/lib/components/Button/Button.js +2 -1
- package/lib/components/Button/ButtonBase.js +1 -1
- package/lib/components/ChatButton/ChatButton.d.ts +3 -2
- package/lib/components/ChatButton/ChatButton.js +2 -1
- package/lib/components/ComboBox/ComboBox.js +24 -34
- package/lib/components/ComposedModal/ComposedModal.js +50 -64
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +3 -3
- package/lib/components/DataTable/TableBatchAction.d.ts +3 -3
- package/lib/components/DataTable/TableBatchAction.js +1 -1
- package/lib/components/DataTable/TableContainer.d.ts +1 -1
- package/lib/components/DataTable/TableContainer.js +3 -3
- package/lib/components/DataTable/TableExpandHeader.d.ts +5 -6
- package/lib/components/DataTable/TableToolbarMenu.d.ts +2 -2
- package/lib/components/DataTable/TableToolbarMenu.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +2 -2
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
- package/lib/components/Dialog/index.d.ts +4 -42
- package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
- package/lib/components/FeatureFlags/index.d.ts +1 -3
- package/lib/components/FeatureFlags/index.js +0 -3
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.js +2 -2
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +4 -6
- package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/Grid/CSSGrid.js +14 -18
- package/lib/components/Grid/FlexGrid.js +6 -7
- package/lib/components/Grid/GridTypes.d.ts +3 -5
- package/lib/components/IconButton/index.js +3 -3
- package/lib/components/Layer/index.d.ts +6 -4
- package/lib/components/Layer/index.js +6 -5
- package/lib/components/Link/Link.d.ts +3 -2
- package/lib/components/Link/Link.js +2 -1
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +3 -3
- package/lib/components/ListBox/ListBoxMenuItem.js +14 -36
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuItem.d.ts +2 -2
- package/lib/components/Menu/MenuItem.js +3 -3
- package/lib/components/Modal/Modal.js +51 -123
- package/lib/components/Modal/next/index.d.ts +171 -0
- package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -3
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/Notification/Notification.d.ts +13 -5
- package/lib/components/Notification/Notification.js +4 -3
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +8 -4
- package/lib/components/OverflowMenu/OverflowMenu.js +3 -3
- package/lib/components/OverflowMenu/next/index.d.ts +2 -2
- package/lib/components/OverflowMenu/next/index.js +1 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.d.ts +3 -2
- package/lib/components/Search/Search.js +6 -4
- package/lib/components/Slider/Slider.d.ts +15 -16
- package/lib/components/Slider/Slider.js +22 -22
- package/lib/components/Tabs/Tabs.d.ts +6 -3
- package/lib/components/Tabs/Tabs.js +9 -8
- package/lib/components/Tag/DismissibleTag.d.ts +5 -3
- package/lib/components/Tag/DismissibleTag.js +2 -1
- package/lib/components/Tag/OperationalTag.d.ts +3 -2
- package/lib/components/Tag/OperationalTag.js +2 -1
- package/lib/components/Tag/SelectableTag.d.ts +5 -3
- package/lib/components/Tag/SelectableTag.js +2 -1
- package/lib/components/Tag/Tag.d.ts +3 -2
- package/lib/components/Tag/Tag.js +2 -1
- package/lib/components/Tile/Tile.d.ts +5 -3
- package/lib/components/Tile/Tile.js +6 -8
- package/lib/components/Toggletip/index.js +2 -2
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +2 -2
- package/lib/components/TreeView/TreeNode.d.ts +5 -3
- package/lib/components/TreeView/TreeNode.js +4 -3
- package/lib/components/TreeView/TreeView.js +2 -2
- package/lib/components/UIShell/HeaderContainer.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +2 -2
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNav.js +2 -2
- package/lib/components/UIShell/SideNavHeader.d.ts +3 -2
- package/lib/components/UIShell/SideNavHeader.js +2 -1
- package/lib/components/UIShell/SideNavLink.d.ts +2 -2
- package/lib/components/UIShell/SideNavLink.js +1 -1
- package/lib/components/UIShell/SideNavMenu.d.ts +2 -2
- package/lib/components/UIShell/SideNavMenu.js +3 -3
- package/lib/components/UIShell/SwitcherItem.js +2 -2
- package/lib/internal/FloatingMenu.js +5 -5
- package/lib/internal/OptimizedResize.js +24 -21
- package/lib/internal/focus/index.js +19 -0
- package/lib/internal/keyboard/keys.js +2 -2
- package/lib/internal/keyboard/match.js +41 -17
- package/lib/internal/keyboard/navigation.js +27 -15
- package/lib/internal/useMergedRefs.js +0 -3
- package/package.json +6 -6
- package/telemetry.yml +0 -1
- package/es/components/Dialog/index.js +0 -177
- package/es/internal/OptimizedResize.d.ts +0 -18
- package/es/internal/keyboard/index.d.ts +0 -9
- package/es/internal/keyboard/keys.d.ts +0 -23
- package/es/internal/keyboard/match.d.ts +0 -26
- package/es/internal/keyboard/navigation.d.ts +0 -37
- package/lib/components/Dialog/index.js +0 -190
- package/lib/internal/OptimizedResize.d.ts +0 -18
- package/lib/internal/keyboard/index.d.ts +0 -9
- package/lib/internal/keyboard/keys.d.ts +0 -23
- package/lib/internal/keyboard/match.d.ts +0 -26
- package/lib/internal/keyboard/navigation.d.ts +0 -37
- package/scss/components/dialog/_dialog.scss +0 -9
- package/scss/components/dialog/_index.scss +0 -9
|
@@ -13,12 +13,12 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
-
var match = require('../../internal/keyboard/match.js');
|
|
18
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
17
|
var warning = require('../../internal/warning.js');
|
|
20
18
|
require('../Text/index.js');
|
|
19
|
+
var match = require('../../internal/keyboard/match.js');
|
|
21
20
|
var Text = require('../Text/Text.js');
|
|
21
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -13,12 +13,12 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
-
var match = require('../../internal/keyboard/match.js');
|
|
18
16
|
var iconsReact = require('@carbon/icons-react');
|
|
19
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
18
|
require('../Text/index.js');
|
|
19
|
+
var match = require('../../internal/keyboard/match.js');
|
|
21
20
|
var Text = require('../Text/Text.js');
|
|
21
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -14,15 +14,15 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
14
14
|
var cx = require('classnames');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var React = require('react');
|
|
17
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
-
var match = require('../../internal/keyboard/match.js');
|
|
19
17
|
var useId = require('../../internal/useId.js');
|
|
20
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
19
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
22
20
|
var noopFn = require('../../internal/noopFn.js');
|
|
23
21
|
require('../Text/index.js');
|
|
24
22
|
var index = require('../FeatureFlags/index.js');
|
|
23
|
+
var match = require('../../internal/keyboard/match.js');
|
|
25
24
|
var Text = require('../Text/Text.js');
|
|
25
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
26
26
|
|
|
27
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
28
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -62,7 +62,8 @@ export interface SearchProps extends InputPropsBase {
|
|
|
62
62
|
*/
|
|
63
63
|
placeholder?: string;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Rendered icon for the Search.
|
|
66
|
+
* Can be a React component class
|
|
66
67
|
*/
|
|
67
68
|
renderIcon?: ComponentType | FunctionComponent;
|
|
68
69
|
/**
|
|
@@ -14,8 +14,7 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
14
14
|
var cx = require('classnames');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var React = require('react');
|
|
17
|
-
var
|
|
18
|
-
var match = require('../../internal/keyboard/match.js');
|
|
17
|
+
var index = require('../../internal/focus/index.js');
|
|
19
18
|
var useId = require('../../internal/useId.js');
|
|
20
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
20
|
var events = require('../../tools/events.js');
|
|
@@ -23,6 +22,8 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
23
22
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
24
23
|
require('../FluidForm/FluidForm.js');
|
|
25
24
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
25
|
+
var match = require('../../internal/keyboard/match.js');
|
|
26
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
26
27
|
|
|
27
28
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
28
29
|
|
|
@@ -99,7 +100,7 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
|
|
|
99
100
|
onChange(clearedEvt);
|
|
100
101
|
onClear();
|
|
101
102
|
setHasContent(false);
|
|
102
|
-
|
|
103
|
+
index.focus(inputRef);
|
|
103
104
|
}
|
|
104
105
|
function handleChange(event) {
|
|
105
106
|
setHasContent(event.target.value !== '');
|
|
@@ -230,7 +231,8 @@ Search.propTypes = {
|
|
|
230
231
|
*/
|
|
231
232
|
placeholder: PropTypes__default["default"].string,
|
|
232
233
|
/**
|
|
233
|
-
*
|
|
234
|
+
* Rendered icon for the Search.
|
|
235
|
+
* Can be a React component class
|
|
234
236
|
*/
|
|
235
237
|
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
236
238
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -355,13 +355,11 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
355
355
|
*/
|
|
356
356
|
clamp(val: any, min: any, max: any): number;
|
|
357
357
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
361
|
-
* @param value - The value to adjust to the nearest step. Defaults to `0`.
|
|
362
|
-
* @returns The value rounded to the precision determined by the step.
|
|
358
|
+
* Takes a value and ensures it fits to the steps of the range
|
|
359
|
+
* @param value
|
|
360
|
+
* @returns value of the nearest step
|
|
363
361
|
*/
|
|
364
|
-
nearestStepValue(value
|
|
362
|
+
nearestStepValue(value: any): number;
|
|
365
363
|
/**
|
|
366
364
|
* Sets up "drag" event handlers and calls `this.onDrag` in case dragging
|
|
367
365
|
* started on somewhere other than the thumb without a corresponding "move"
|
|
@@ -444,16 +442,17 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
444
442
|
};
|
|
445
443
|
calcDistanceToHandle: (handle: HandlePosition, clientX: any) => number;
|
|
446
444
|
/**
|
|
447
|
-
*
|
|
448
|
-
* and a step.
|
|
445
|
+
* Given the current value, delta and step, calculate the new value.
|
|
449
446
|
*
|
|
450
|
-
* @param currentValue
|
|
451
|
-
*
|
|
452
|
-
* @param
|
|
453
|
-
*
|
|
454
|
-
*
|
|
455
|
-
|
|
456
|
-
|
|
447
|
+
* @param {number} currentValue
|
|
448
|
+
* Current value user is moving from.
|
|
449
|
+
* @param {number} delta
|
|
450
|
+
* Movement from the current value. Can be positive or negative.
|
|
451
|
+
* @param {number} step
|
|
452
|
+
* A value determining how much the value should increase/decrease by moving
|
|
453
|
+
* the thumb by mouse.
|
|
454
|
+
*/
|
|
455
|
+
calcValueForDelta: (currentValue: any, delta: any, step?: number) => any;
|
|
457
456
|
/**
|
|
458
457
|
* Sets state relevant to the given handle position.
|
|
459
458
|
*
|
|
@@ -14,7 +14,6 @@ var React = require('react');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
-
var match = require('../../internal/keyboard/match.js');
|
|
18
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
18
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
20
19
|
var index = require('../FeatureFlags/index.js');
|
|
@@ -24,6 +23,7 @@ require('../Tooltip/DefinitionTooltip.js');
|
|
|
24
23
|
var Tooltip = require('../Tooltip/Tooltip.js');
|
|
25
24
|
var SliderHandles = require('./SliderHandles.js');
|
|
26
25
|
var throttle = require('../../node_modules/es-toolkit/dist/compat/function/throttle.mjs.js');
|
|
26
|
+
var match = require('../../internal/keyboard/match.js');
|
|
27
27
|
var Text = require('../Text/Text.js');
|
|
28
28
|
|
|
29
29
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -326,7 +326,7 @@ class Slider extends React.PureComponent {
|
|
|
326
326
|
value,
|
|
327
327
|
left
|
|
328
328
|
} = this.calcValue({
|
|
329
|
-
value: this.calcValueForDelta(currentValue
|
|
329
|
+
value: this.calcValueForDelta(currentValue, delta, this.props.step)
|
|
330
330
|
});
|
|
331
331
|
this.setValueLeftForHandle(this.state.activeHandle, {
|
|
332
332
|
value: this.nearestStepValue(value),
|
|
@@ -603,21 +603,19 @@ class Slider extends React.PureComponent {
|
|
|
603
603
|
return Math.abs(handleX - clientX);
|
|
604
604
|
});
|
|
605
605
|
/**
|
|
606
|
-
*
|
|
607
|
-
* and a step.
|
|
606
|
+
* Given the current value, delta and step, calculate the new value.
|
|
608
607
|
*
|
|
609
|
-
* @param currentValue
|
|
610
|
-
*
|
|
611
|
-
* @param
|
|
612
|
-
*
|
|
613
|
-
*
|
|
608
|
+
* @param {number} currentValue
|
|
609
|
+
* Current value user is moving from.
|
|
610
|
+
* @param {number} delta
|
|
611
|
+
* Movement from the current value. Can be positive or negative.
|
|
612
|
+
* @param {number} step
|
|
613
|
+
* A value determining how much the value should increase/decrease by moving
|
|
614
|
+
* the thumb by mouse.
|
|
614
615
|
*/
|
|
615
616
|
_rollupPluginBabelHelpers.defineProperty(this, "calcValueForDelta", function (currentValue, delta) {
|
|
616
617
|
let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
617
|
-
|
|
618
|
-
const newValue = base + delta;
|
|
619
|
-
const decimals = (step.toString().split('.')[1] || '').length;
|
|
620
|
-
return Number(newValue.toFixed(decimals));
|
|
618
|
+
return (delta > 0 ? Math.floor(currentValue / step) * step : currentValue) + delta;
|
|
621
619
|
});
|
|
622
620
|
/**
|
|
623
621
|
* Sets state relevant to the given handle position.
|
|
@@ -881,16 +879,18 @@ class Slider extends React.PureComponent {
|
|
|
881
879
|
}
|
|
882
880
|
|
|
883
881
|
/**
|
|
884
|
-
*
|
|
885
|
-
*
|
|
886
|
-
*
|
|
887
|
-
* @param value - The value to adjust to the nearest step. Defaults to `0`.
|
|
888
|
-
* @returns The value rounded to the precision determined by the step.
|
|
882
|
+
* Takes a value and ensures it fits to the steps of the range
|
|
883
|
+
* @param value
|
|
884
|
+
* @returns value of the nearest step
|
|
889
885
|
*/
|
|
890
|
-
nearestStepValue() {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
886
|
+
nearestStepValue(value) {
|
|
887
|
+
const tempInput = document.createElement('input');
|
|
888
|
+
tempInput.type = 'range';
|
|
889
|
+
tempInput.min = `${this.props.min}`;
|
|
890
|
+
tempInput.max = `${this.props.max}`;
|
|
891
|
+
tempInput.step = `${this.props.step}`;
|
|
892
|
+
tempInput.value = `${value}`;
|
|
893
|
+
return parseFloat(tempInput.value);
|
|
894
894
|
}
|
|
895
895
|
getClientXFromEvent(event) {
|
|
896
896
|
let clientX;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -340,9 +340,12 @@ export interface TabProps extends HTMLAttributes<HTMLElement> {
|
|
|
340
340
|
*/
|
|
341
341
|
renderButton?(): ReactNode;
|
|
342
342
|
/**
|
|
343
|
-
*
|
|
343
|
+
* Optional prop to render an icon next to the label.
|
|
344
|
+
* Can be a React component class
|
|
344
345
|
*/
|
|
345
|
-
renderIcon?:
|
|
346
|
+
renderIcon?: ComponentType<{
|
|
347
|
+
size: number;
|
|
348
|
+
}>;
|
|
346
349
|
/**
|
|
347
350
|
* An optional label to render under the primary tab label.
|
|
348
351
|
* Only useful for contained tabs.
|
|
@@ -31,8 +31,6 @@ var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
|
31
31
|
var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
32
32
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
33
33
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
34
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
35
|
-
var match = require('../../internal/keyboard/match.js');
|
|
36
34
|
var usePressable = require('./usePressable.js');
|
|
37
35
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
38
36
|
var useEvent = require('../../internal/useEvent.js');
|
|
@@ -40,7 +38,9 @@ var useMatchMedia = require('../../internal/useMatchMedia.js');
|
|
|
40
38
|
require('../Text/index.js');
|
|
41
39
|
var index = require('../BadgeIndicator/index.js');
|
|
42
40
|
var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
|
|
41
|
+
var match = require('../../internal/keyboard/match.js');
|
|
43
42
|
var Text = require('../Text/Text.js');
|
|
43
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
44
44
|
|
|
45
45
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
46
46
|
|
|
@@ -1017,21 +1017,22 @@ Tab.propTypes = {
|
|
|
1017
1017
|
* Provide a handler that is invoked on the key down event for the control
|
|
1018
1018
|
*/
|
|
1019
1019
|
onKeyDown: PropTypes__default["default"].func,
|
|
1020
|
-
|
|
1020
|
+
/*
|
|
1021
1021
|
* An optional parameter to allow overriding the anchor rendering.
|
|
1022
1022
|
* Useful for using Tab along with react-router or other client
|
|
1023
1023
|
* side router libraries.
|
|
1024
|
-
|
|
1024
|
+
**/
|
|
1025
1025
|
renderButton: PropTypes__default["default"].func,
|
|
1026
1026
|
/**
|
|
1027
|
-
*
|
|
1027
|
+
* Optional prop to render an icon next to the label.
|
|
1028
|
+
* Can be a React component class
|
|
1028
1029
|
*/
|
|
1029
1030
|
// @ts-expect-error: Invalid prop type derivation
|
|
1030
1031
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
1031
|
-
|
|
1032
|
+
/*
|
|
1032
1033
|
* An optional label to render under the primary tab label.
|
|
1033
|
-
|
|
1034
|
-
|
|
1034
|
+
/* This prop is only useful for contained tabs
|
|
1035
|
+
**/
|
|
1035
1036
|
secondaryLabel: PropTypes__default["default"].string
|
|
1036
1037
|
};
|
|
1037
1038
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -30,7 +30,8 @@ export interface DismissibleTagBaseProps {
|
|
|
30
30
|
*/
|
|
31
31
|
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* Optional prop to render a custom icon.
|
|
34
|
+
* Can be a React component class
|
|
34
35
|
*/
|
|
35
36
|
renderIcon?: React.ElementType;
|
|
36
37
|
/**
|
|
@@ -85,7 +86,8 @@ declare const DismissibleTag: {
|
|
|
85
86
|
*/
|
|
86
87
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
87
88
|
/**
|
|
88
|
-
*
|
|
89
|
+
* Optional prop to render a custom icon.
|
|
90
|
+
* Can be a React component class
|
|
89
91
|
*/
|
|
90
92
|
renderIcon: PropTypes.Requireable<object>;
|
|
91
93
|
/**
|
|
@@ -129,7 +129,8 @@ DismissibleTag.propTypes = {
|
|
|
129
129
|
*/
|
|
130
130
|
onClose: PropTypes__default["default"].func,
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
132
|
+
* Optional prop to render a custom icon.
|
|
133
|
+
* Can be a React component class
|
|
133
134
|
*/
|
|
134
135
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
135
136
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -33,7 +33,8 @@ export interface OperationalTagBaseProps {
|
|
|
33
33
|
*/
|
|
34
34
|
id?: string;
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Optional prop to render a custom icon.
|
|
37
|
+
* Can be a React component class
|
|
37
38
|
*/
|
|
38
39
|
renderIcon?: React.ElementType;
|
|
39
40
|
onClick?: MouseEventHandler;
|
|
@@ -111,7 +111,8 @@ OperationalTag.propTypes = {
|
|
|
111
111
|
*/
|
|
112
112
|
id: PropTypes__default["default"].string,
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Optional prop to render a custom icon.
|
|
115
|
+
* Can be a React component class
|
|
115
116
|
*/
|
|
116
117
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
117
118
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -22,7 +22,8 @@ export interface SelectableTagBaseProps {
|
|
|
22
22
|
*/
|
|
23
23
|
id?: string;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Optional prop to render a custom icon.
|
|
26
|
+
* Can be a React component class
|
|
26
27
|
*/
|
|
27
28
|
renderIcon?: React.ElementType;
|
|
28
29
|
/**
|
|
@@ -64,7 +65,8 @@ declare const SelectableTag: {
|
|
|
64
65
|
*/
|
|
65
66
|
id: PropTypes.Requireable<string>;
|
|
66
67
|
/**
|
|
67
|
-
*
|
|
68
|
+
* Optional prop to render a custom icon.
|
|
69
|
+
* Can be a React component class
|
|
68
70
|
*/
|
|
69
71
|
renderIcon: PropTypes.Requireable<object>;
|
|
70
72
|
/**
|
|
@@ -108,7 +108,8 @@ SelectableTag.propTypes = {
|
|
|
108
108
|
*/
|
|
109
109
|
id: PropTypes__default["default"].string,
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
111
|
+
* Optional prop to render a custom icon.
|
|
112
|
+
* Can be a React component class
|
|
112
113
|
*/
|
|
113
114
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
114
115
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -58,7 +58,8 @@ export interface TagBaseProps {
|
|
|
58
58
|
*/
|
|
59
59
|
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Optional prop to render a custom icon.
|
|
62
|
+
* Can be a React component class
|
|
62
63
|
*/
|
|
63
64
|
renderIcon?: React.ElementType;
|
|
64
65
|
/**
|
|
@@ -186,7 +186,8 @@ Tag.propTypes = {
|
|
|
186
186
|
*/
|
|
187
187
|
onClose: deprecate["default"](PropTypes__default["default"].func, 'The `onClose` prop has been deprecated and will be removed in the next major version. Use DismissibleTag instead.'),
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
189
|
+
* Optional prop to render a custom icon.
|
|
190
|
+
* Can be a React component class
|
|
190
191
|
*/
|
|
191
192
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
192
193
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ChangeEvent } from 'react';
|
|
7
|
+
import React, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ChangeEvent, type ComponentType } from 'react';
|
|
8
8
|
export interface TileProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
className?: string;
|
|
@@ -53,9 +53,11 @@ export interface ClickableTileProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
|
53
53
|
*/
|
|
54
54
|
href?: string;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Optional prop to allow overriding the icon rendering.
|
|
57
57
|
*/
|
|
58
|
-
renderIcon?:
|
|
58
|
+
renderIcon?: ComponentType<{
|
|
59
|
+
className?: string;
|
|
60
|
+
}>;
|
|
59
61
|
/**
|
|
60
62
|
* Specify the function to run when the ClickableTile is clicked
|
|
61
63
|
*/
|
|
@@ -15,8 +15,6 @@ var PropTypes = require('prop-types');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var iconsReact = require('@carbon/icons-react');
|
|
17
17
|
var Link = require('../Link/Link.js');
|
|
18
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
19
|
-
var match = require('../../internal/keyboard/match.js');
|
|
20
18
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
21
19
|
var events = require('../../tools/events.js');
|
|
22
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
@@ -26,7 +24,9 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
26
24
|
var index = require('../FeatureFlags/index.js');
|
|
27
25
|
var useId = require('../../internal/useId.js');
|
|
28
26
|
require('../Text/index.js');
|
|
27
|
+
var match = require('../../internal/keyboard/match.js');
|
|
29
28
|
var Text = require('../Text/Text.js');
|
|
29
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
30
30
|
|
|
31
31
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
32
32
|
|
|
@@ -211,7 +211,8 @@ ClickableTile.propTypes = {
|
|
|
211
211
|
*/
|
|
212
212
|
rel: PropTypes__default["default"].string,
|
|
213
213
|
/**
|
|
214
|
-
*
|
|
214
|
+
* Optional prop to allow overriding the icon rendering.
|
|
215
|
+
* Can be a React component class
|
|
215
216
|
*/
|
|
216
217
|
// @ts-expect-error: Invalid derived prop type, seemingly no real solution.
|
|
217
218
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object])
|
|
@@ -254,12 +255,9 @@ const SelectableTile = /*#__PURE__*/React__default["default"].forwardRef(functio
|
|
|
254
255
|
if (normalizedDecorator && decoratorRef.current && decoratorRef.current.contains(evt.target)) {
|
|
255
256
|
return;
|
|
256
257
|
}
|
|
257
|
-
setIsSelected(
|
|
258
|
-
const newSelected = !prevSelected;
|
|
259
|
-
onChange(evt, newSelected, id);
|
|
260
|
-
return newSelected;
|
|
261
|
-
});
|
|
258
|
+
setIsSelected(!isSelected);
|
|
262
259
|
clickHandler(evt);
|
|
260
|
+
onChange(evt, isSelected, id);
|
|
263
261
|
}
|
|
264
262
|
function handleKeyDown(evt) {
|
|
265
263
|
evt?.persist?.();
|
|
@@ -14,11 +14,11 @@ var cx = require('classnames');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
16
|
var index = require('../Popover/index.js');
|
|
17
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
-
var match = require('../../internal/keyboard/match.js');
|
|
19
17
|
var useEvent = require('../../internal/useEvent.js');
|
|
20
18
|
var useId = require('../../internal/useId.js');
|
|
21
19
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
|
+
var match = require('../../internal/keyboard/match.js');
|
|
21
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -14,11 +14,11 @@ var cx = require('classnames');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
16
|
var index = require('../Popover/index.js');
|
|
17
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
-
var match = require('../../internal/keyboard/match.js');
|
|
19
17
|
var useId = require('../../internal/useId.js');
|
|
20
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
19
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
20
|
+
var match = require('../../internal/keyboard/match.js');
|
|
21
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
24
|
|
|
@@ -14,13 +14,13 @@ var cx = require('classnames');
|
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
16
|
var index = require('../Popover/index.js');
|
|
17
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
-
var match = require('../../internal/keyboard/match.js');
|
|
19
17
|
var useDelayedState = require('../../internal/useDelayedState.js');
|
|
20
18
|
var useId = require('../../internal/useId.js');
|
|
21
19
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
22
20
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
23
21
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
22
|
+
var match = require('../../internal/keyboard/match.js');
|
|
23
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
24
24
|
|
|
25
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
26
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -62,7 +62,8 @@ export type TreeNodeProps = {
|
|
|
62
62
|
*/
|
|
63
63
|
onTreeSelect?: (event: React.MouseEvent, node?: TreeNodeProps) => void;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* Optional prop to allow each node to have an associated icon.
|
|
66
|
+
* Can be a React component class
|
|
66
67
|
*/
|
|
67
68
|
renderIcon?: ComponentType | FunctionComponent;
|
|
68
69
|
/**
|
|
@@ -136,7 +137,8 @@ declare const TreeNode: React.ForwardRefExoticComponent<{
|
|
|
136
137
|
*/
|
|
137
138
|
onTreeSelect?: (event: React.MouseEvent, node?: TreeNodeProps) => void;
|
|
138
139
|
/**
|
|
139
|
-
*
|
|
140
|
+
* Optional prop to allow each node to have an associated icon.
|
|
141
|
+
* Can be a React component class
|
|
140
142
|
*/
|
|
141
143
|
renderIcon?: ComponentType | FunctionComponent;
|
|
142
144
|
/**
|
|
@@ -14,12 +14,12 @@ var iconsReact = require('@carbon/icons-react');
|
|
|
14
14
|
var cx = require('classnames');
|
|
15
15
|
var PropTypes = require('prop-types');
|
|
16
16
|
var React = require('react');
|
|
17
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
18
|
-
var match = require('../../internal/keyboard/match.js');
|
|
19
17
|
var useControllableState = require('../../internal/useControllableState.js');
|
|
20
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
21
19
|
var uniqueId = require('../../tools/uniqueId.js');
|
|
22
20
|
var index = require('../FeatureFlags/index.js');
|
|
21
|
+
var match = require('../../internal/keyboard/match.js');
|
|
22
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
23
23
|
|
|
24
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
25
|
|
|
@@ -410,7 +410,8 @@ TreeNode.propTypes = {
|
|
|
410
410
|
*/
|
|
411
411
|
onTreeSelect: PropTypes__default["default"].func,
|
|
412
412
|
/**
|
|
413
|
-
*
|
|
413
|
+
* Optional prop to allow each node to have an associated icon.
|
|
414
|
+
* Can be a React component class
|
|
414
415
|
*/
|
|
415
416
|
// @ts-ignore
|
|
416
417
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
@@ -13,13 +13,13 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var cx = require('classnames');
|
|
14
14
|
var PropTypes = require('prop-types');
|
|
15
15
|
var React = require('react');
|
|
16
|
-
var keys = require('../../internal/keyboard/keys.js');
|
|
17
|
-
var match = require('../../internal/keyboard/match.js');
|
|
18
16
|
var useControllableState = require('../../internal/useControllableState.js');
|
|
19
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
20
18
|
var uniqueId = require('../../tools/uniqueId.js');
|
|
21
19
|
var index = require('../FeatureFlags/index.js');
|
|
22
20
|
var TreeNode = require('./TreeNode.js');
|
|
21
|
+
var match = require('../../internal/keyboard/match.js');
|
|
22
|
+
var keys = require('../../internal/keyboard/keys.js');
|
|
23
23
|
|
|
24
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
25
|
|