@carbon/react 1.99.0-rc.0 → 1.100.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 +942 -942
- package/es/components/BadgeIndicator/index.d.ts +1 -1
- package/es/components/BadgeIndicator/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/es/components/Breadcrumb/BreadcrumbItem.js +6 -7
- package/es/components/Button/Button.Skeleton.d.ts +28 -2
- package/es/components/Button/Button.js +3 -2
- package/es/components/ChatButton/ChatButton.d.ts +3 -2
- package/es/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
- package/es/components/ComboBox/ComboBox.d.ts +4 -4
- package/es/components/ComboBox/ComboBox.js +21 -3
- package/es/components/ComposedModal/ComposedModal.d.ts +2 -2
- package/es/components/ContainedList/ContainedList.d.ts +35 -6
- package/es/components/ContainedList/ContainedList.js +3 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
- package/es/components/ContainedList/index.d.ts +1 -1
- package/es/components/ContainedList/index.js +4 -1
- package/es/components/DangerButton/DangerButton.d.ts +1 -1
- package/es/components/DataTable/DataTable.d.ts +22 -5
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/TableExpandRow.d.ts +1 -1
- package/es/components/DataTable/TableExpandRow.js +2 -2
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +18 -16
- package/es/components/DataTable/TableToolbar.d.ts +25 -1
- package/es/components/DataTable/TableToolbarMenu.d.ts +25 -5
- package/es/components/DataTable/TableToolbarMenu.js +0 -3
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
- package/es/components/DatePicker/DatePicker.d.ts +2 -2
- package/es/components/DatePicker/DatePicker.js +38 -53
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
- package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.js +3 -2
- package/es/components/Dialog/Dialog.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +14 -12
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +28 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
- package/es/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
- package/es/components/FluidForm/FluidForm.d.ts +15 -2
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
- package/es/components/FluidSearch/FluidSearch.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.js +3 -3
- package/es/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
- package/es/components/FluidTextArea/FluidTextArea.d.ts +95 -1
- package/es/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
- package/es/components/Grid/GridContext.d.ts +19 -1
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +2 -2
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxField.d.ts +35 -2
- package/es/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
- package/es/components/ListBox/ListBoxMenuItem.d.ts +1 -1
- package/es/components/ListBox/ListBoxSelection.d.ts +34 -3
- package/es/components/Menu/MenuItem.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +22 -13
- package/es/components/MultiSelect/MultiSelect.js +22 -13
- package/es/components/Notification/Notification.d.ts +8 -7
- package/es/components/Notification/Notification.js +0 -1
- package/es/components/NumberInput/NumberInput.d.ts +9 -0
- package/es/components/NumberInput/NumberInput.js +206 -38
- package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +0 -1
- package/es/components/OverflowMenu/index.d.ts +1 -1
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/Popover/index.js +21 -12
- package/es/components/Search/Search.d.ts +2 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +2 -2
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
- package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/es/components/Tag/Tag.d.ts +1 -1
- package/es/components/Tag/Tag.js +2 -0
- package/es/components/Text/Text.d.ts +1 -1
- package/es/components/Text/Text.js +4 -3
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/Text/TextDirection.js +1 -3
- package/es/components/Text/TextDirectionContext.d.ts +3 -3
- package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/es/components/TextInput/ControlledPasswordInput.js +2 -2
- package/es/components/TextInput/PasswordInput.d.ts +1 -1
- package/es/components/TextInput/PasswordInput.js +2 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +2 -2
- package/es/components/Toggle/Toggle.Skeleton.d.ts +9 -3
- package/es/components/Toggletip/index.d.ts +1 -1
- package/es/components/Toggletip/index.js +9 -7
- package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -1
- package/es/components/Tooltip/Tooltip.js +2 -0
- package/es/components/TreeView/TreeNode.d.ts +4 -4
- package/es/components/UIShell/Header.d.ts +20 -3
- package/es/components/UIShell/HeaderGlobalAction.d.ts +2 -2
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/Link.d.ts +1 -1
- package/es/components/UIShell/Link.js +14 -14
- package/es/components/UIShell/SideNav.d.ts +3 -3
- package/es/components/UIShell/SideNav.js +26 -25
- package/es/components/UIShell/SideNavDivider.d.ts +11 -3
- package/es/components/UIShell/SideNavHeader.d.ts +24 -1
- package/es/components/UIShell/SideNavIcon.d.ts +20 -2
- package/es/components/UIShell/SideNavItem.d.ts +20 -2
- package/es/components/UIShell/SideNavItems.d.ts +22 -2
- package/es/components/UIShell/SideNavLink.d.ts +1 -1
- package/es/components/UIShell/SideNavLink.js +14 -14
- package/es/components/UIShell/SideNavMenu.d.ts +1 -1
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.d.ts +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +2 -2
- package/es/components/UIShell/SwitcherDivider.d.ts +10 -2
- package/es/internal/FloatingMenu.d.ts +1 -1
- package/es/internal/FloatingMenu.js +0 -2
- package/es/internal/PolymorphicProps.d.ts +3 -3
- package/es/internal/useNoInteractiveChildren.d.ts +1 -1
- package/es/internal/useNoInteractiveChildren.js +8 -10
- package/es/internal/useOutsideClick.d.ts +1 -1
- package/es/internal/useOutsideClick.js +0 -4
- package/lib/components/BadgeIndicator/index.d.ts +1 -1
- package/lib/components/BadgeIndicator/index.js +7 -5
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/lib/components/Breadcrumb/BreadcrumbItem.js +5 -6
- package/lib/components/Button/Button.Skeleton.d.ts +28 -2
- package/lib/components/Button/Button.js +3 -2
- package/lib/components/ChatButton/ChatButton.d.ts +3 -2
- package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
- package/lib/components/ComboBox/ComboBox.d.ts +4 -4
- package/lib/components/ComboBox/ComboBox.js +21 -3
- package/lib/components/ComposedModal/ComposedModal.d.ts +2 -2
- package/lib/components/ContainedList/ContainedList.d.ts +35 -6
- package/lib/components/ContainedList/ContainedList.js +3 -1
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
- package/lib/components/ContainedList/index.d.ts +1 -1
- package/lib/components/ContainedList/index.js +4 -1
- package/lib/components/DangerButton/DangerButton.d.ts +1 -1
- package/lib/components/DataTable/DataTable.d.ts +22 -5
- package/lib/components/DataTable/DataTable.js +1 -1
- package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +17 -15
- package/lib/components/DataTable/TableToolbar.d.ts +25 -1
- package/lib/components/DataTable/TableToolbarMenu.d.ts +25 -5
- package/lib/components/DataTable/TableToolbarMenu.js +0 -3
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
- package/lib/components/DatePicker/DatePicker.d.ts +2 -2
- package/lib/components/DatePicker/DatePicker.js +37 -52
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -1
- package/lib/components/Dialog/Dialog.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +13 -11
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +28 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
- package/lib/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
- package/lib/components/FluidForm/FluidForm.d.ts +15 -2
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
- package/lib/components/FluidSearch/FluidSearch.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.js +2 -2
- package/lib/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
- package/lib/components/FluidTextArea/FluidTextArea.d.ts +95 -1
- package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
- package/lib/components/Grid/GridContext.d.ts +19 -1
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxField.d.ts +35 -2
- package/lib/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +1 -1
- package/lib/components/ListBox/ListBoxSelection.d.ts +34 -3
- package/lib/components/Menu/MenuItem.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +22 -13
- package/lib/components/MultiSelect/MultiSelect.js +22 -13
- package/lib/components/Notification/Notification.d.ts +8 -7
- package/lib/components/Notification/Notification.js +0 -1
- package/lib/components/NumberInput/NumberInput.d.ts +9 -0
- package/lib/components/NumberInput/NumberInput.js +206 -37
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +0 -1
- package/lib/components/OverflowMenu/index.d.ts +1 -1
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/Popover/index.js +19 -10
- package/lib/components/Search/Search.d.ts +2 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
- package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Tag/Tag.js +2 -0
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.js +3 -2
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/Text/TextDirection.js +1 -3
- package/lib/components/Text/TextDirectionContext.d.ts +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/lib/components/TextInput/PasswordInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/Toggle/Toggle.Skeleton.d.ts +9 -3
- package/lib/components/Toggletip/index.d.ts +1 -1
- package/lib/components/Toggletip/index.js +7 -5
- package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -1
- package/lib/components/Tooltip/Tooltip.js +2 -0
- package/lib/components/TreeView/TreeNode.d.ts +4 -4
- package/lib/components/UIShell/Header.d.ts +20 -3
- package/lib/components/UIShell/HeaderGlobalAction.d.ts +2 -2
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/Link.d.ts +1 -1
- package/lib/components/UIShell/Link.js +13 -13
- package/lib/components/UIShell/SideNav.d.ts +3 -3
- package/lib/components/UIShell/SideNav.js +25 -24
- package/lib/components/UIShell/SideNavDivider.d.ts +11 -3
- package/lib/components/UIShell/SideNavHeader.d.ts +24 -1
- package/lib/components/UIShell/SideNavIcon.d.ts +20 -2
- package/lib/components/UIShell/SideNavItem.d.ts +20 -2
- package/lib/components/UIShell/SideNavItems.d.ts +22 -2
- package/lib/components/UIShell/SideNavLink.d.ts +1 -1
- package/lib/components/UIShell/SideNavLink.js +14 -14
- package/lib/components/UIShell/SideNavMenu.d.ts +1 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherDivider.d.ts +10 -2
- package/lib/internal/FloatingMenu.d.ts +1 -1
- package/lib/internal/FloatingMenu.js +0 -2
- package/lib/internal/PolymorphicProps.d.ts +3 -3
- package/lib/internal/useNoInteractiveChildren.d.ts +1 -1
- package/lib/internal/useNoInteractiveChildren.js +8 -10
- package/lib/internal/useOutsideClick.d.ts +1 -1
- package/lib/internal/useOutsideClick.js +0 -4
- package/package.json +8 -8
- package/scss/_carbon-utilities.scss +9 -0
- package/telemetry.yml +0 -1
- package/es/internal/createClassWrapper.d.ts +0 -12
- package/lib/internal/createClassWrapper.d.ts +0 -12
|
@@ -13,8 +13,11 @@ var deprecateFieldOnObject = require('../../internal/deprecateFieldOnObject.js')
|
|
|
13
13
|
var ContainedList = require('./ContainedList.js');
|
|
14
14
|
var ContainedListItem = require('./ContainedListItem/ContainedListItem.js');
|
|
15
15
|
|
|
16
|
-
ContainedList.default.ContainedListItem = ContainedListItem.default;
|
|
17
16
|
if (process.env.NODE_ENV !== 'production') {
|
|
17
|
+
// @ts-expect-error - This component did not have a `displayName` before it
|
|
18
|
+
// was properly typed. After adding proper typing, a type error appears here.
|
|
19
|
+
// The warning logged to the console includes `undefined` because no
|
|
20
|
+
// `displayName` is set.
|
|
18
21
|
deprecateFieldOnObject.deprecateFieldOnObject(ContainedList.default, 'ContainedListItem', ContainedListItem.default);
|
|
19
22
|
}
|
|
20
23
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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.
|
|
@@ -140,7 +140,7 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
|
140
140
|
[key: string]: unknown;
|
|
141
141
|
}) => {
|
|
142
142
|
onCancel: () => void;
|
|
143
|
-
onSelectAll?: () => void
|
|
143
|
+
onSelectAll?: () => void;
|
|
144
144
|
shouldShowBatchActions: boolean;
|
|
145
145
|
totalCount: number;
|
|
146
146
|
totalSelected: number;
|
|
@@ -367,7 +367,15 @@ export declare const DataTable: {
|
|
|
367
367
|
slug: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
368
368
|
};
|
|
369
369
|
};
|
|
370
|
-
TableToolbar:
|
|
370
|
+
TableToolbar: {
|
|
371
|
+
({ ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, children, size, ...rest }: import("./TableToolbar").TableToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
372
|
+
propTypes: {
|
|
373
|
+
"aria-label": PropTypes.Requireable<string>;
|
|
374
|
+
ariaLabel: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
375
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
376
|
+
size: PropTypes.Requireable<string>;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
371
379
|
TableToolbarAction: React.ForwardRefExoticComponent<import("./TableToolbarAction").TableToolbarActionProps & React.RefAttributes<HTMLDivElement>>;
|
|
372
380
|
TableToolbarContent: (props: React.HTMLAttributes<"div">) => React.ReactElement<any>;
|
|
373
381
|
TableToolbarSearch: {
|
|
@@ -394,12 +402,21 @@ export declare const DataTable: {
|
|
|
394
402
|
translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
395
403
|
};
|
|
396
404
|
};
|
|
397
|
-
TableToolbarMenu:
|
|
405
|
+
TableToolbarMenu: {
|
|
406
|
+
({ className, renderIcon, iconDescription, children, menuOptionsClass, ...rest }: import("./TableToolbarMenu").TableToolbarMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
407
|
+
propTypes: {
|
|
408
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
409
|
+
className: PropTypes.Requireable<string>;
|
|
410
|
+
iconDescription: PropTypes.Requireable<string>;
|
|
411
|
+
menuOptionsClass: PropTypes.Requireable<string>;
|
|
412
|
+
renderIcon: PropTypes.Requireable<object>;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
398
415
|
propTypes: {
|
|
399
416
|
/**
|
|
400
417
|
* Pass in the children that will be rendered within the Table
|
|
401
418
|
*/
|
|
402
|
-
children: PropTypes.Requireable<
|
|
419
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
403
420
|
/**
|
|
404
421
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
405
422
|
*/
|
|
@@ -584,7 +584,7 @@ DataTable.propTypes = {
|
|
|
584
584
|
/**
|
|
585
585
|
* Pass in the children that will be rendered within the Table
|
|
586
586
|
*/
|
|
587
|
-
children: PropTypes.
|
|
587
|
+
children: PropTypes.func,
|
|
588
588
|
/**
|
|
589
589
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
590
590
|
*/
|
|
@@ -49,21 +49,23 @@ const sortDirections = {
|
|
|
49
49
|
[sortStates.sortStates.ASC]: 'ascending',
|
|
50
50
|
[sortStates.sortStates.DESC]: 'descending'
|
|
51
51
|
};
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
52
|
+
const frFn = React.forwardRef;
|
|
53
|
+
const TableHeader = frFn((props, ref) => {
|
|
54
|
+
const {
|
|
55
|
+
className: headerClassName,
|
|
56
|
+
children,
|
|
57
|
+
colSpan,
|
|
58
|
+
decorator,
|
|
59
|
+
isSortable = false,
|
|
60
|
+
isSortHeader,
|
|
61
|
+
onClick,
|
|
62
|
+
scope = defaultScope,
|
|
63
|
+
sortDirection,
|
|
64
|
+
translateWithId: t = defaultTranslateWithId,
|
|
65
|
+
slug,
|
|
66
|
+
id,
|
|
67
|
+
...rest
|
|
68
|
+
} = props;
|
|
67
69
|
const prefix = usePrefix.usePrefix();
|
|
68
70
|
const uniqueId = useId.useId('table-sort');
|
|
69
71
|
|
|
@@ -4,6 +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 PropTypes from 'prop-types';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
export interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
10
|
/**
|
|
@@ -25,5 +26,28 @@ export interface TableToolbarProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
25
26
|
*/
|
|
26
27
|
size?: 'sm' | 'lg';
|
|
27
28
|
}
|
|
28
|
-
declare const TableToolbar:
|
|
29
|
+
declare const TableToolbar: {
|
|
30
|
+
({ ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, children, size, ...rest }: TableToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
propTypes: {
|
|
32
|
+
/**
|
|
33
|
+
* 'aria-label' of the TableToolbar component.
|
|
34
|
+
* Specify a label to be read by screen readers on the container node
|
|
35
|
+
*/
|
|
36
|
+
"aria-label": PropTypes.Requireable<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Deprecated, please use `aria-label` instead.
|
|
39
|
+
* Specify a label to be read by screen readers on the container node.
|
|
40
|
+
* 'aria-label' of the TableToolbar component.
|
|
41
|
+
*/
|
|
42
|
+
ariaLabel: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
43
|
+
/**
|
|
44
|
+
* Pass in the children that will be rendered inside the TableToolbar
|
|
45
|
+
*/
|
|
46
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
47
|
+
/**
|
|
48
|
+
* `lg` Change the row height of table
|
|
49
|
+
*/
|
|
50
|
+
size: PropTypes.Requireable<string>;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
29
53
|
export default TableToolbar;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
8
|
import { OverflowMenuProps } from '../OverflowMenu';
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export type TableToolbarMenuProps = OverflowMenuProps;
|
|
10
|
+
declare const TableToolbarMenu: {
|
|
11
|
+
({ className, renderIcon, iconDescription, children, menuOptionsClass, ...rest }: TableToolbarMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
propTypes: {
|
|
13
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
14
|
+
/**
|
|
15
|
+
* Provide an optional class name for the toolbar menu
|
|
16
|
+
*/
|
|
17
|
+
className: PropTypes.Requireable<string>;
|
|
18
|
+
/**
|
|
19
|
+
* The description of the menu icon.
|
|
20
|
+
*/
|
|
21
|
+
iconDescription: PropTypes.Requireable<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Provide an optional class name for the toolbar menu
|
|
24
|
+
*/
|
|
25
|
+
menuOptionsClass: PropTypes.Requireable<string>;
|
|
26
|
+
/**
|
|
27
|
+
* A component used to render an icon.
|
|
28
|
+
*/
|
|
29
|
+
renderIcon: PropTypes.Requireable<object>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
12
32
|
export default TableToolbarMenu;
|
|
@@ -18,9 +18,6 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
18
18
|
var index = require('../OverflowMenu/index.js');
|
|
19
19
|
|
|
20
20
|
const defaultIconDescription = 'Settings';
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
23
|
-
|
|
24
21
|
const TableToolbarMenu = ({
|
|
25
22
|
className,
|
|
26
23
|
renderIcon = iconsReact.Settings,
|
|
@@ -4,7 +4,9 @@
|
|
|
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
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import React, { type TableHTMLAttributes } from 'react';
|
|
9
|
+
import { DataTableSize } from '../DataTable/DataTable';
|
|
8
10
|
export interface DataTableSkeletonHeader {
|
|
9
11
|
/**
|
|
10
12
|
* Specify header label
|
|
@@ -41,6 +43,10 @@ export interface DataTableSkeletonProps extends TableHTMLAttributes<HTMLTableEle
|
|
|
41
43
|
* Specify if the table toolbar should be rendered as part of the skeleton.
|
|
42
44
|
*/
|
|
43
45
|
showToolbar?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Changes the row height of table.
|
|
48
|
+
*/
|
|
49
|
+
size?: DataTableSize;
|
|
44
50
|
/**
|
|
45
51
|
* Optionally specify whether you want the DataTable to be zebra striped
|
|
46
52
|
*/
|
|
@@ -50,5 +56,48 @@ export interface DataTableSkeletonProps extends TableHTMLAttributes<HTMLTableEle
|
|
|
50
56
|
*/
|
|
51
57
|
className?: string;
|
|
52
58
|
}
|
|
53
|
-
declare const DataTableSkeleton:
|
|
59
|
+
declare const DataTableSkeleton: {
|
|
60
|
+
({ headers, rowCount, columnCount, zebra, compact, className, showHeader, showToolbar, size, ...rest }: DataTableSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
propTypes: {
|
|
62
|
+
/**
|
|
63
|
+
* Specify an optional className to add.
|
|
64
|
+
*/
|
|
65
|
+
className: PropTypes.Requireable<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Specify the number of columns that you want to render in the skeleton state
|
|
68
|
+
*/
|
|
69
|
+
columnCount: PropTypes.Requireable<number>;
|
|
70
|
+
/**
|
|
71
|
+
* Optionally specify whether you want the Skeleton to be rendered as a
|
|
72
|
+
* compact DataTable
|
|
73
|
+
*/
|
|
74
|
+
compact: PropTypes.Requireable<boolean>;
|
|
75
|
+
/**
|
|
76
|
+
* Optionally specify the displayed headers
|
|
77
|
+
*/
|
|
78
|
+
headers: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
79
|
+
header: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
80
|
+
}>>[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Specify the number of rows that you want to render in the skeleton state
|
|
83
|
+
*/
|
|
84
|
+
rowCount: PropTypes.Requireable<number>;
|
|
85
|
+
/**
|
|
86
|
+
* Specify if the table header should be rendered as part of the skeleton.
|
|
87
|
+
*/
|
|
88
|
+
showHeader: PropTypes.Requireable<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Specify if the table toolbar should be rendered as part of the skeleton.
|
|
91
|
+
*/
|
|
92
|
+
showToolbar: PropTypes.Requireable<boolean>;
|
|
93
|
+
/**
|
|
94
|
+
* Changes the row height of table.
|
|
95
|
+
*/
|
|
96
|
+
size: PropTypes.Requireable<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Optionally specify whether you want the DataTable to be zebra striped
|
|
99
|
+
*/
|
|
100
|
+
zebra: PropTypes.Requireable<boolean>;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
54
103
|
export default DataTableSkeleton;
|
|
@@ -25,12 +25,14 @@ const DataTableSkeleton = ({
|
|
|
25
25
|
className,
|
|
26
26
|
showHeader = true,
|
|
27
27
|
showToolbar = true,
|
|
28
|
+
size = 'lg',
|
|
28
29
|
...rest
|
|
29
30
|
}) => {
|
|
30
31
|
const prefix = usePrefix.usePrefix();
|
|
31
32
|
const dataTableSkeletonClasses = cx(className, {
|
|
32
33
|
[`${prefix}--skeleton`]: true,
|
|
33
34
|
[`${prefix}--data-table`]: true,
|
|
35
|
+
[`${prefix}--data-table--${size}`]: size,
|
|
34
36
|
[`${prefix}--data-table--zebra`]: zebra,
|
|
35
37
|
[`${prefix}--data-table--compact`]: compact
|
|
36
38
|
});
|
|
@@ -101,6 +103,10 @@ DataTableSkeleton.propTypes = {
|
|
|
101
103
|
* Specify if the table toolbar should be rendered as part of the skeleton.
|
|
102
104
|
*/
|
|
103
105
|
showToolbar: PropTypes.bool,
|
|
106
|
+
/**
|
|
107
|
+
* Changes the row height of table.
|
|
108
|
+
*/
|
|
109
|
+
size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
|
|
104
110
|
/**
|
|
105
111
|
* Optionally specify whether you want the DataTable to be zebra striped
|
|
106
112
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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.
|
|
6
6
|
*/
|
|
7
|
-
import React, { ReactNode } from 'react';
|
|
7
|
+
import React, { type ReactNode } from 'react';
|
|
8
8
|
import flatpickr from 'flatpickr';
|
|
9
9
|
import { DateLimit, DateOption } from 'flatpickr/dist/types/options';
|
|
10
10
|
import { type SupportedLocale } from './DatePickerLocales';
|
|
@@ -143,36 +143,38 @@ function updateClassNames(calendar, prefix) {
|
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
146
|
+
// eslint-disable-next-line react/display-name
|
|
147
|
+
const DatePicker = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
148
|
+
const {
|
|
149
|
+
allowInput,
|
|
150
|
+
appendTo,
|
|
151
|
+
children,
|
|
152
|
+
className,
|
|
153
|
+
closeOnSelect = true,
|
|
154
|
+
dateFormat = 'm/d/Y',
|
|
155
|
+
datePickerType,
|
|
156
|
+
disable,
|
|
157
|
+
enable,
|
|
158
|
+
inline,
|
|
159
|
+
invalid,
|
|
160
|
+
invalidText,
|
|
161
|
+
warn,
|
|
162
|
+
warnText,
|
|
163
|
+
light = false,
|
|
164
|
+
locale = 'en',
|
|
165
|
+
maxDate,
|
|
166
|
+
minDate,
|
|
167
|
+
onChange,
|
|
168
|
+
onClose,
|
|
169
|
+
onOpen,
|
|
170
|
+
readOnly = false,
|
|
171
|
+
short = false,
|
|
172
|
+
value,
|
|
173
|
+
parseDate: parseDateProp,
|
|
174
|
+
nextMonthAriaLabel = 'Next month',
|
|
175
|
+
prevMonthAriaLabel = 'Previous month',
|
|
176
|
+
...rest
|
|
177
|
+
} = props;
|
|
176
178
|
const prefix = usePrefix.usePrefix();
|
|
177
179
|
const {
|
|
178
180
|
isFluid
|
|
@@ -201,7 +203,6 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
201
203
|
},
|
|
202
204
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
203
205
|
[onClose]);
|
|
204
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
205
206
|
const onCalendarClose = (selectedDates, dateStr, instance, e) => {
|
|
206
207
|
if (e && e.type === 'clickOutside') {
|
|
207
208
|
return;
|
|
@@ -228,6 +229,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
228
229
|
const savedOnChange = useSavedCallback.useSavedCallback(onChange);
|
|
229
230
|
const savedOnOpen = useSavedCallback.useSavedCallback(onOpen);
|
|
230
231
|
const effectiveWarn = warn && !invalid;
|
|
232
|
+
const wrapperRef = React.useRef(null);
|
|
231
233
|
const datePickerClasses = cx(`${prefix}--date-picker`, {
|
|
232
234
|
[`${prefix}--date-picker--short`]: short,
|
|
233
235
|
[`${prefix}--date-picker--light`]: light,
|
|
@@ -393,7 +395,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
393
395
|
}), fixEventsPlugin.default({
|
|
394
396
|
inputFrom: startInputField.current,
|
|
395
397
|
inputTo: endInputField.current,
|
|
396
|
-
lastStartValue
|
|
398
|
+
lastStartValue,
|
|
399
|
+
container: wrapperRef.current
|
|
397
400
|
})],
|
|
398
401
|
clickOpens: !readOnly,
|
|
399
402
|
noCalendar: readOnly,
|
|
@@ -600,25 +603,6 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
600
603
|
}
|
|
601
604
|
}
|
|
602
605
|
}, [value, startInputField]);
|
|
603
|
-
React.useEffect(() => {
|
|
604
|
-
const handleMouseDown = event => {
|
|
605
|
-
if (calendarRef.current && calendarRef.current.isOpen && !calendarRef.current.calendarContainer.contains(event.target) && !startInputField.current.contains(event.target) && !endInputField.current?.contains(event.target)) {
|
|
606
|
-
// Close the calendar immediately on mousedown
|
|
607
|
-
closeCalendar();
|
|
608
|
-
}
|
|
609
|
-
};
|
|
610
|
-
const closeCalendar = () => {
|
|
611
|
-
calendarRef.current?.close();
|
|
612
|
-
// Remove focus from endDate calendar input
|
|
613
|
-
onCalendarClose(calendarRef.current?.selectedDates, '', calendarRef.current, {
|
|
614
|
-
type: 'clickOutside'
|
|
615
|
-
});
|
|
616
|
-
};
|
|
617
|
-
document.addEventListener('mousedown', handleMouseDown, true);
|
|
618
|
-
return () => {
|
|
619
|
-
document.removeEventListener('mousedown', handleMouseDown, true);
|
|
620
|
-
};
|
|
621
|
-
}, [calendarRef, startInputField, endInputField, onCalendarClose]);
|
|
622
606
|
React.useEffect(() => {
|
|
623
607
|
if (calendarRef.current?.set) {
|
|
624
608
|
if (value !== undefined) {
|
|
@@ -662,7 +646,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
|
|
|
662
646
|
className: wrapperClasses,
|
|
663
647
|
ref: ref
|
|
664
648
|
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
665
|
-
className: datePickerClasses
|
|
649
|
+
className: datePickerClasses,
|
|
650
|
+
ref: wrapperRef
|
|
666
651
|
}, childrenWithProps), fluidError);
|
|
667
652
|
});
|
|
668
653
|
DatePicker.propTypes = {
|
|
@@ -20,17 +20,41 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
|
|
|
20
20
|
const {
|
|
21
21
|
inputFrom,
|
|
22
22
|
inputTo,
|
|
23
|
-
lastStartValue
|
|
23
|
+
lastStartValue,
|
|
24
|
+
container
|
|
24
25
|
} = config;
|
|
26
|
+
// Avoid closing when mousedown starts inside but click lands outside after
|
|
27
|
+
// scroll or blur (e.g., scrollable modal masks).
|
|
28
|
+
let mouseDownInside = false;
|
|
29
|
+
const getEventPath = event => typeof event.composedPath === 'function' ? event.composedPath() : [];
|
|
30
|
+
const isEventInside = event => {
|
|
31
|
+
const path = getEventPath(event);
|
|
32
|
+
return Boolean(container && (path.includes(container) || container.contains(event.target)) || fp.calendarContainer && (path.includes(fp.calendarContainer) || fp.calendarContainer.contains(event.target)) || inputFrom && (path.includes(inputFrom) || inputFrom.contains(event.target)) || inputTo && (path.includes(inputTo) || inputTo.contains(event.target)));
|
|
33
|
+
};
|
|
34
|
+
|
|
25
35
|
/**
|
|
26
36
|
* Handles `click` outside to close calendar
|
|
27
37
|
*/
|
|
28
38
|
const handleClickOutside = event => {
|
|
29
|
-
if (
|
|
39
|
+
if (mouseDownInside) {
|
|
40
|
+
mouseDownInside = false;
|
|
30
41
|
return;
|
|
31
42
|
}
|
|
43
|
+
if (!fp.isOpen || isEventInside(event)) {
|
|
44
|
+
mouseDownInside = false;
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
mouseDownInside = false;
|
|
32
48
|
fp.close();
|
|
33
49
|
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Tracks the initial mouse target to avoid closing on click after scroll.
|
|
53
|
+
*/
|
|
54
|
+
const handleMouseDown = event => {
|
|
55
|
+
mouseDownInside = isEventInside(event);
|
|
56
|
+
};
|
|
57
|
+
|
|
34
58
|
/**
|
|
35
59
|
* Handles `keydown` event.
|
|
36
60
|
*/
|
|
@@ -124,6 +148,7 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
|
|
|
124
148
|
inputTo.removeEventListener('blur', handleBlur, true);
|
|
125
149
|
}
|
|
126
150
|
inputFrom.removeEventListener('keydown', handleKeydown, true);
|
|
151
|
+
document.removeEventListener('mousedown', handleMouseDown, true);
|
|
127
152
|
document.removeEventListener('click', handleClickOutside, true);
|
|
128
153
|
};
|
|
129
154
|
|
|
@@ -141,6 +166,7 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
|
|
|
141
166
|
inputTo.addEventListener('keydown', handleKeydown, true);
|
|
142
167
|
inputTo.addEventListener('blur', handleBlur, true);
|
|
143
168
|
}
|
|
169
|
+
document.addEventListener('mousedown', handleMouseDown, true);
|
|
144
170
|
document.addEventListener('click', handleClickOutside, true);
|
|
145
171
|
};
|
|
146
172
|
|
|
@@ -28,7 +28,8 @@ var useNormalizedInputProps = require('../../internal/useNormalizedInputProps.js
|
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
29
29
|
|
|
30
30
|
let didWarnAboutDatePickerInputValue = false;
|
|
31
|
-
const
|
|
31
|
+
const frFn = React.forwardRef;
|
|
32
|
+
const DatePickerInput = frFn((props, ref) => {
|
|
32
33
|
const {
|
|
33
34
|
datePickerType,
|
|
34
35
|
decorator,
|
|
@@ -4,7 +4,8 @@
|
|
|
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
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { type HTMLAttributes } from 'react';
|
|
8
9
|
import { type ListBoxSize } from '../ListBox';
|
|
9
10
|
export interface DropdownSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
11
|
/**
|
|
@@ -20,6 +21,22 @@ export interface DropdownSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
20
21
|
*/
|
|
21
22
|
size?: ListBoxSize;
|
|
22
23
|
}
|
|
23
|
-
declare const DropdownSkeleton:
|
|
24
|
+
declare const DropdownSkeleton: {
|
|
25
|
+
({ className, size, hideLabel, ...rest }: DropdownSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
propTypes: {
|
|
27
|
+
/**
|
|
28
|
+
* Specify an optional className to add.
|
|
29
|
+
*/
|
|
30
|
+
className: PropTypes.Requireable<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Specify whether the label should be hidden, or not
|
|
33
|
+
*/
|
|
34
|
+
hideLabel: PropTypes.Requireable<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Specify the size of the ListBox.
|
|
37
|
+
*/
|
|
38
|
+
size: PropTypes.Requireable<"sm" | "md" | "lg">;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
24
41
|
export default DropdownSkeleton;
|
|
25
42
|
export { DropdownSkeleton };
|
|
@@ -20,15 +20,17 @@ var keys = require('../../internal/keyboard/keys.js');
|
|
|
20
20
|
var match = require('../../internal/keyboard/match.js');
|
|
21
21
|
var mergeRefs = require('../../tools/mergeRefs.js');
|
|
22
22
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
const frFn = React.forwardRef;
|
|
24
|
+
const ExpandableSearch = frFn((props, forwardedRef) => {
|
|
25
|
+
const {
|
|
26
|
+
onBlur,
|
|
27
|
+
onChange,
|
|
28
|
+
onExpand,
|
|
29
|
+
onKeyDown,
|
|
30
|
+
defaultValue,
|
|
31
|
+
isExpanded,
|
|
32
|
+
...rest
|
|
33
|
+
} = props;
|
|
32
34
|
const [expanded, setExpanded] = React.useState(isExpanded || false);
|
|
33
35
|
const [hasContent, setHasContent] = React.useState(defaultValue ? true : false);
|
|
34
36
|
const searchRef = React.useRef(null);
|
|
@@ -61,8 +63,8 @@ const ExpandableSearch = /*#__PURE__*/React.forwardRef(function ExpandableSearch
|
|
|
61
63
|
}
|
|
62
64
|
const classes = cx(`${prefix}--search--expandable`, {
|
|
63
65
|
[`${prefix}--search--expanded`]: expanded
|
|
64
|
-
},
|
|
65
|
-
return /*#__PURE__*/React.createElement(Search.default, _rollupPluginBabelHelpers.extends({},
|
|
66
|
+
}, rest.className);
|
|
67
|
+
return /*#__PURE__*/React.createElement(Search.default, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
66
68
|
defaultValue: defaultValue,
|
|
67
69
|
isExpanded: expanded,
|
|
68
70
|
ref: mergeRefs.mergeRefs(searchRef, forwardedRef),
|