@carbon/react 1.80.1 → 1.81.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 +785 -785
- package/es/components/Accordion/AccordionItem.d.ts +2 -2
- package/es/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/es/components/Button/Button.js +3 -0
- package/es/components/Button/ButtonBase.d.ts +2 -2
- package/es/components/ChatButton/ChatButton.js +5 -3
- package/es/components/CodeSnippet/CodeSnippet.js +2 -0
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +52 -30
- package/es/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/es/components/ComposedModal/ComposedModal.js +1 -2
- package/es/components/ComposedModal/ModalFooter.js +0 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/es/components/DataTable/DataTable.d.ts +5 -5
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableCell.js +28 -4
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/es/components/DataTable/tools/cells.d.ts +13 -0
- package/es/components/DataTable/tools/cells.js +3 -6
- package/es/components/DataTable/tools/filter.d.ts +26 -0
- package/es/components/DataTable/tools/filter.js +8 -17
- package/es/components/DatePicker/DatePicker.js +1 -1
- package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +6 -6
- package/es/components/FeatureFlags/index.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.d.ts +6 -1
- package/es/components/FileUploader/FileUploader.js +3 -1
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +1 -1
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +5 -6
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -4
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +40 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +123 -0
- package/es/components/FluidTextInput/FluidTextInput.js +2 -2
- package/es/components/Grid/Column.js +1 -1
- package/es/components/Grid/GridTypes.d.ts +6 -1
- package/es/components/Layer/LayerLevel.d.ts +3 -3
- package/es/components/Layer/LayerLevel.js +4 -3
- package/es/components/Layer/index.d.ts +4 -2
- package/es/components/Layer/index.js +3 -2
- package/es/components/Link/Link.js +3 -1
- package/es/components/Menu/Menu.d.ts +1 -1
- package/es/components/Menu/Menu.js +4 -14
- package/es/components/Menu/MenuContext.d.ts +1 -1
- package/es/components/Menu/MenuItem.js +15 -4
- package/es/components/Modal/Modal.js +5 -2
- package/es/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/es/components/MultiSelect/FilterableMultiSelect.js +4 -3
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/es/components/MultiSelect/MultiSelect.js +22 -4
- package/es/components/MultiSelect/index.d.ts +2 -4
- package/es/components/NumberInput/NumberInput.js +2 -1
- package/es/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +69 -17
- package/es/components/OverflowMenu/index.d.ts +2 -4
- package/es/components/OverflowMenu/index.js +10 -6
- package/es/components/OverflowMenu/next/index.js +0 -1
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/es/components/PageHeader/PageHeader.d.ts +9 -2
- package/es/components/PageHeader/PageHeader.js +16 -4
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/es/components/PaginationNav/PaginationNav.js +2 -1
- package/es/components/Popover/index.d.ts +3 -2
- package/es/components/Popover/index.js +10 -5
- package/es/components/Portal/index.d.ts +1 -1
- package/es/components/Search/Search.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +3 -1
- package/es/components/Slider/Slider.d.ts +3 -13
- package/es/components/Slider/Slider.js +2 -14
- package/es/components/Tabs/Tabs.d.ts +2 -2
- package/es/components/Tabs/Tabs.js +8 -6
- package/es/components/Tabs/usePressable.js +1 -1
- package/es/components/Tag/Tag.js +9 -2
- package/es/components/Text/Text.js +3 -2
- package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/es/components/TextInput/ControlledPasswordInput.js +0 -6
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +0 -4
- package/es/components/TextInput/index.d.ts +6 -0
- package/es/components/TextInput/index.js +0 -8
- package/es/components/Tile/Tile.js +0 -1
- package/es/components/Toggle/Toggle.d.ts +1 -1
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +37 -41
- package/es/components/Toggletip/index.js +11 -8
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/TreeView/TreeView.d.ts +1 -1
- package/es/components/UIShell/Content.d.ts +14 -1
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +2 -99
- package/es/components/UIShell/HeaderMenu.js +10 -3
- package/es/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/es/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/es/components/UIShell/HeaderMenuItem.js +3 -3
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/es/components/UIShell/Link.d.ts +8 -8
- package/es/components/UIShell/Link.js +8 -5
- package/es/components/UIShell/SideNav.d.ts +3 -3
- package/es/components/UIShell/SideNav.js +1 -1
- package/es/components/UIShell/SideNavHeader.js +0 -1
- package/es/components/UIShell/SideNavLink.d.ts +3 -4
- package/es/components/UIShell/SideNavLink.js +8 -3
- package/es/components/UIShell/SideNavMenu.js +0 -1
- package/es/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +0 -1
- package/es/components/UIShell/SwitcherItem.d.ts +2 -2
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +7 -7
- package/es/internal/FloatingMenu.js +2 -1
- package/es/internal/clamp.d.ts +10 -0
- package/es/internal/clamp.js +13 -0
- package/es/internal/useEvent.d.ts +9 -0
- package/es/internal/useEvent.js +8 -49
- package/es/internal/useId.js +1 -1
- package/es/internal/useMatchMedia.d.ts +7 -2
- package/es/internal/useMatchMedia.js +9 -10
- package/es/internal/useNoInteractiveChildren.js +4 -2
- package/es/internal/useOutsideClick.d.ts +1 -1
- package/es/prop-types/AriaPropTypes.js +1 -1
- package/es/prop-types/isRequiredOneOf.d.ts +16 -0
- package/es/prop-types/isRequiredOneOf.js +11 -9
- package/es/tools/setupGetInstanceId.d.ts +12 -0
- package/es/tools/setupGetInstanceId.js +7 -8
- package/es/tools/toggleClass.d.ts +14 -0
- package/es/tools/toggleClass.js +9 -10
- package/es/tools/wrapComponent.d.ts +1 -1
- package/es/types/common.d.ts +1 -6
- package/lib/components/Accordion/AccordionItem.d.ts +2 -2
- package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/Button/ButtonBase.d.ts +2 -2
- package/lib/components/ChatButton/ChatButton.js +5 -3
- package/lib/components/CodeSnippet/CodeSnippet.js +2 -0
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +52 -30
- package/lib/components/ComposedModal/ComposedModal.d.ts +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +2 -3
- package/lib/components/ComposedModal/ModalFooter.js +0 -1
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/ContextMenu/useContextMenu.d.ts +1 -1
- package/lib/components/DataTable/DataTable.d.ts +5 -5
- package/lib/components/DataTable/DataTable.js +1 -1
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableCell.js +28 -3
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +1 -1
- package/lib/components/DataTable/tools/cells.d.ts +13 -0
- package/lib/components/DataTable/tools/cells.js +3 -6
- package/lib/components/DataTable/tools/filter.d.ts +26 -0
- package/lib/components/DataTable/tools/filter.js +8 -17
- package/lib/components/DatePicker/DatePicker.js +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +6 -6
- package/lib/components/FeatureFlags/index.d.ts +1 -1
- package/lib/components/FileUploader/FileUploader.d.ts +6 -1
- package/lib/components/FileUploader/FileUploader.js +3 -1
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.d.ts +1 -1
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -5
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +7 -5
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +50 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +133 -0
- package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
- package/lib/components/Grid/Column.js +1 -1
- package/lib/components/Grid/GridTypes.d.ts +6 -1
- package/lib/components/Layer/LayerLevel.d.ts +3 -3
- package/lib/components/Layer/LayerLevel.js +4 -2
- package/lib/components/Layer/index.d.ts +4 -2
- package/lib/components/Layer/index.js +2 -1
- package/lib/components/Link/Link.js +3 -1
- package/lib/components/Menu/Menu.d.ts +1 -1
- package/lib/components/Menu/Menu.js +4 -14
- package/lib/components/Menu/MenuContext.d.ts +1 -1
- package/lib/components/Menu/MenuItem.js +15 -4
- package/lib/components/Modal/Modal.js +6 -3
- package/lib/components/ModalWrapper/ModalWrapper.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -6
- package/lib/components/MultiSelect/MultiSelect.js +21 -3
- package/lib/components/MultiSelect/index.d.ts +2 -4
- package/lib/components/NumberInput/NumberInput.js +2 -1
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +69 -17
- package/lib/components/OverflowMenu/index.d.ts +2 -4
- package/lib/components/OverflowMenu/index.js +9 -5
- package/lib/components/OverflowMenu/next/index.js +0 -1
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
- package/lib/components/PageHeader/PageHeader.d.ts +9 -2
- package/lib/components/PageHeader/PageHeader.js +17 -3
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +2 -0
- package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
- package/lib/components/PaginationNav/PaginationNav.js +2 -1
- package/lib/components/Popover/index.d.ts +3 -2
- package/lib/components/Popover/index.js +10 -5
- package/lib/components/Portal/index.d.ts +1 -1
- package/lib/components/Search/Search.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +3 -1
- package/lib/components/Slider/Slider.d.ts +3 -13
- package/lib/components/Slider/Slider.js +2 -14
- package/lib/components/Tabs/Tabs.d.ts +2 -2
- package/lib/components/Tabs/Tabs.js +7 -5
- package/lib/components/Tabs/usePressable.js +1 -1
- package/lib/components/Tag/Tag.js +9 -2
- package/lib/components/Text/Text.js +2 -1
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -6
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +0 -4
- package/lib/components/TextInput/index.d.ts +6 -0
- package/lib/components/TextInput/index.js +1 -7
- package/lib/components/Tile/Tile.js +0 -1
- package/lib/components/Toggle/Toggle.d.ts +1 -1
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +34 -39
- package/lib/components/Toggletip/index.js +11 -8
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/TreeView/TreeView.d.ts +1 -1
- package/lib/components/UIShell/Content.d.ts +14 -1
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +2 -99
- package/lib/components/UIShell/HeaderMenu.js +10 -3
- package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -98
- package/lib/components/UIShell/HeaderMenuItem.d.ts +3 -4
- package/lib/components/UIShell/HeaderMenuItem.js +3 -3
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +0 -97
- package/lib/components/UIShell/Link.d.ts +8 -8
- package/lib/components/UIShell/Link.js +7 -5
- package/lib/components/UIShell/SideNav.d.ts +3 -3
- package/lib/components/UIShell/SideNav.js +1 -1
- package/lib/components/UIShell/SideNavHeader.js +0 -1
- package/lib/components/UIShell/SideNavLink.d.ts +3 -4
- package/lib/components/UIShell/SideNavLink.js +8 -3
- package/lib/components/UIShell/SideNavMenu.js +0 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +1 -49
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +0 -1
- package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +13 -11
- package/lib/internal/FloatingMenu.js +2 -1
- package/lib/internal/clamp.d.ts +10 -0
- package/lib/internal/clamp.js +17 -0
- package/lib/internal/useEvent.d.ts +9 -0
- package/lib/internal/useEvent.js +8 -49
- package/lib/internal/useId.js +1 -1
- package/lib/internal/useMatchMedia.d.ts +7 -2
- package/lib/internal/useMatchMedia.js +9 -10
- package/lib/internal/useNoInteractiveChildren.js +4 -2
- package/lib/internal/useOutsideClick.d.ts +1 -1
- package/lib/prop-types/AriaPropTypes.js +1 -1
- package/lib/prop-types/isRequiredOneOf.d.ts +16 -0
- package/lib/prop-types/isRequiredOneOf.js +11 -9
- package/lib/tools/setupGetInstanceId.d.ts +12 -0
- package/lib/tools/setupGetInstanceId.js +7 -8
- package/lib/tools/toggleClass.d.ts +14 -0
- package/lib/tools/toggleClass.js +9 -10
- package/lib/tools/wrapComponent.d.ts +1 -1
- package/lib/types/common.d.ts +1 -6
- package/package.json +15 -15
- package/telemetry.yml +11 -12
- package/es/components/MultiSelect/index.js +0 -13
- package/es/internal/ClickListener.d.ts +0 -13
- package/es/internal/ClickListener.js +0 -47
- package/lib/components/MultiSelect/index.js +0 -19
- package/lib/internal/ClickListener.d.ts +0 -13
- package/lib/internal/ClickListener.js +0 -51
|
@@ -48,7 +48,9 @@ const {
|
|
|
48
48
|
ItemMouseMove,
|
|
49
49
|
InputKeyDownArrowUp,
|
|
50
50
|
InputKeyDownArrowDown,
|
|
51
|
-
MenuMouseLeave
|
|
51
|
+
MenuMouseLeave,
|
|
52
|
+
ItemClick,
|
|
53
|
+
FunctionSelectItem
|
|
52
54
|
} = Downshift.useCombobox.stateChangeTypes;
|
|
53
55
|
const defaultItemToString = item => {
|
|
54
56
|
if (typeof item === 'string') {
|
|
@@ -219,6 +221,8 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
219
221
|
prevInputLengthRef.current = inputValue.length;
|
|
220
222
|
}
|
|
221
223
|
}, [typeahead, inputValue, items, itemToString, autocompleteCustomFilter]);
|
|
224
|
+
const isManualClearingRef = React.useRef(false);
|
|
225
|
+
const [isClearing, setIsClearing] = React.useState(false);
|
|
222
226
|
const prefix = usePrefix.usePrefix();
|
|
223
227
|
const {
|
|
224
228
|
isFluid
|
|
@@ -228,6 +232,14 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
228
232
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
229
233
|
const prevInputValue = React.useRef(inputValue);
|
|
230
234
|
const prevSelectedItemProp = React.useRef(selectedItemProp);
|
|
235
|
+
React.useEffect(() => {
|
|
236
|
+
isManualClearingRef.current = isClearing;
|
|
237
|
+
|
|
238
|
+
// Reset flag after render cycle
|
|
239
|
+
if (isClearing) {
|
|
240
|
+
setIsClearing(false);
|
|
241
|
+
}
|
|
242
|
+
}, [isClearing]);
|
|
231
243
|
|
|
232
244
|
// fully controlled combobox: handle changes to selectedItemProp
|
|
233
245
|
React.useEffect(() => {
|
|
@@ -313,31 +325,38 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
313
325
|
}
|
|
314
326
|
case InputKeyDownEnter:
|
|
315
327
|
if (!allowCustomValue) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
328
|
+
if (state.highlightedIndex !== -1) {
|
|
329
|
+
const filteredList = filterItems(items, itemToString, inputValue);
|
|
330
|
+
const highlightedItem = filteredList[state.highlightedIndex];
|
|
331
|
+
if (highlightedItem && !highlightedItem.disabled) {
|
|
332
|
+
return {
|
|
333
|
+
...changes,
|
|
334
|
+
selectedItem: highlightedItem,
|
|
335
|
+
inputValue: itemToString(highlightedItem)
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
} else {
|
|
339
|
+
const autoIndex = indexToHighlight(inputValue);
|
|
340
|
+
if (autoIndex !== -1) {
|
|
341
|
+
const matchingItem = items[autoIndex];
|
|
342
|
+
if (matchingItem && !matchingItem.disabled) {
|
|
343
|
+
return {
|
|
344
|
+
...changes,
|
|
345
|
+
selectedItem: matchingItem,
|
|
346
|
+
inputValue: itemToString(matchingItem)
|
|
347
|
+
};
|
|
348
|
+
}
|
|
323
349
|
}
|
|
324
350
|
|
|
325
|
-
//
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
// selection, clear the selection.
|
|
335
|
-
if (state.selectedItem !== null) {
|
|
336
|
-
return {
|
|
337
|
-
...changes,
|
|
338
|
-
selectedItem: null,
|
|
339
|
-
inputValue
|
|
340
|
-
};
|
|
351
|
+
// If no matching item is found and there is an existing
|
|
352
|
+
// selection, clear the selection.
|
|
353
|
+
if (state.selectedItem !== null) {
|
|
354
|
+
return {
|
|
355
|
+
...changes,
|
|
356
|
+
selectedItem: null,
|
|
357
|
+
inputValue
|
|
358
|
+
};
|
|
359
|
+
}
|
|
341
360
|
}
|
|
342
361
|
}
|
|
343
362
|
|
|
@@ -502,13 +521,10 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
502
521
|
type,
|
|
503
522
|
selectedItem: newSelectedItem
|
|
504
523
|
});
|
|
505
|
-
if (
|
|
506
|
-
|
|
507
|
-
selectedItem: newSelectedItem
|
|
508
|
-
});
|
|
524
|
+
if (isManualClearingRef.current) {
|
|
525
|
+
return;
|
|
509
526
|
}
|
|
510
|
-
if ((type ===
|
|
511
|
-
) {
|
|
527
|
+
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== 'undefined' && !isEqual__default["default"](selectedItemProp, newSelectedItem)) {
|
|
512
528
|
onChange({
|
|
513
529
|
selectedItem: newSelectedItem
|
|
514
530
|
});
|
|
@@ -701,7 +717,13 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
701
717
|
className: `${prefix}--list-box__invalid-icon ${prefix}--list-box__invalid-icon--warning`
|
|
702
718
|
}), inputValue && /*#__PURE__*/React__default["default"].createElement(ListBoxSelection["default"], {
|
|
703
719
|
clearSelection: () => {
|
|
720
|
+
setIsClearing(true); // This updates the state which syncs to the ref
|
|
721
|
+
setInputValue('');
|
|
722
|
+
onChange({
|
|
723
|
+
selectedItem: null
|
|
724
|
+
});
|
|
704
725
|
selectItem(null);
|
|
726
|
+
handleSelectionClear();
|
|
705
727
|
},
|
|
706
728
|
translateWithId: translateWithId,
|
|
707
729
|
disabled: disabled || readOnly,
|
|
@@ -56,7 +56,7 @@ export interface ComposedModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
56
56
|
/**
|
|
57
57
|
* Provide a ref to return focus to once the modal is closed.
|
|
58
58
|
*/
|
|
59
|
-
launcherButtonRef?: RefObject<HTMLButtonElement>;
|
|
59
|
+
launcherButtonRef?: RefObject<HTMLButtonElement | null>;
|
|
60
60
|
/**
|
|
61
61
|
* Specify an optional handler for closing modal.
|
|
62
62
|
* Returning `false` here prevents closing modal.
|
|
@@ -142,14 +142,14 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
|
|
|
142
142
|
if (!enableDialogElement && open !== wasOpen) {
|
|
143
143
|
setIsOpen(!!open);
|
|
144
144
|
setWasOpen(!!open);
|
|
145
|
-
toggleClass
|
|
145
|
+
toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, !!open);
|
|
146
146
|
}
|
|
147
147
|
}, [open, wasOpen, prefix]);
|
|
148
148
|
// Remove the document.body className on unmount
|
|
149
149
|
React.useEffect(() => {
|
|
150
150
|
if (!enableDialogElement) {
|
|
151
151
|
return () => {
|
|
152
|
-
toggleClass
|
|
152
|
+
toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, false);
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
@@ -364,7 +364,6 @@ ComposedModal.propTypes = {
|
|
|
364
364
|
/**
|
|
365
365
|
* Provide a ref to return focus to once the modal is closed.
|
|
366
366
|
*/
|
|
367
|
-
// @ts-expect-error: Invalid derived type
|
|
368
367
|
launcherButtonRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
369
368
|
current: PropTypes__default["default"].any
|
|
370
369
|
})]),
|
|
@@ -159,7 +159,6 @@ ModalFooter.propTypes = {
|
|
|
159
159
|
/**
|
|
160
160
|
* The `ref` callback for the primary button.
|
|
161
161
|
*/
|
|
162
|
-
// @ts-expect-error: Invalid derived type
|
|
163
162
|
inputref: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
|
|
164
163
|
current: PropTypes__default["default"].any
|
|
165
164
|
})]),
|
|
@@ -83,7 +83,6 @@ ContainedListItem.propTypes = {
|
|
|
83
83
|
/**
|
|
84
84
|
* A component used to render an icon.
|
|
85
85
|
*/
|
|
86
|
-
// @ts-expect-error: PropTypes are not expressive enough to cover this case
|
|
87
86
|
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object])
|
|
88
87
|
};
|
|
89
88
|
|
|
@@ -16,7 +16,7 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
16
16
|
/**
|
|
17
17
|
* Pass in Switch components to be rendered in the ContentSwitcher
|
|
18
18
|
*/
|
|
19
|
-
children?: ReactElement[];
|
|
19
|
+
children?: ReactElement<any>[];
|
|
20
20
|
/**
|
|
21
21
|
* Specify an optional className to be added to the container node
|
|
22
22
|
*/
|
|
@@ -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
|
-
type TriggerType = Element | Document | Window | React.RefObject<Element>;
|
|
7
|
+
type TriggerType = Element | Document | Window | React.RefObject<Element | null>;
|
|
8
8
|
export interface ContextMenuProps {
|
|
9
9
|
open: boolean;
|
|
10
10
|
x: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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.
|
|
@@ -69,8 +69,8 @@ export interface DataTableRow<ColTypes extends any[]> {
|
|
|
69
69
|
export interface DataTableHeader {
|
|
70
70
|
key: string;
|
|
71
71
|
header: React.ReactNode;
|
|
72
|
-
slug?: React.ReactElement
|
|
73
|
-
decorator?: React.ReactElement
|
|
72
|
+
slug?: React.ReactElement<any>;
|
|
73
|
+
decorator?: React.ReactElement<any>;
|
|
74
74
|
}
|
|
75
75
|
export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
76
76
|
headers: Array<DataTableHeader>;
|
|
@@ -184,7 +184,7 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
|
184
184
|
radio: boolean | undefined;
|
|
185
185
|
}
|
|
186
186
|
export interface DataTableProps<RowType, ColTypes extends any[]> extends TranslateWithId<TranslationKey> {
|
|
187
|
-
children?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement
|
|
187
|
+
children?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement<any>;
|
|
188
188
|
experimentalAutoAlign?: boolean;
|
|
189
189
|
filterRows?: (filterRowsArgs: {
|
|
190
190
|
cellsById: Record<string, DataTableCell<ColTypes>>;
|
|
@@ -198,7 +198,7 @@ export interface DataTableProps<RowType, ColTypes extends any[]> extends Transla
|
|
|
198
198
|
locale?: string;
|
|
199
199
|
overflowMenuOnHover?: boolean;
|
|
200
200
|
radio?: boolean;
|
|
201
|
-
render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement
|
|
201
|
+
render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement<any>;
|
|
202
202
|
rows: Array<Omit<DataTableRow<ColTypes>, 'cells'>>;
|
|
203
203
|
size?: DataTableSize;
|
|
204
204
|
sortRow?: (cellA: any, cellB: any, sortRowOptions: {
|
|
@@ -49,7 +49,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
49
49
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
50
50
|
var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
51
51
|
|
|
52
|
-
const getInstanceId = setupGetInstanceId
|
|
52
|
+
const getInstanceId = setupGetInstanceId.setupGetInstanceId();
|
|
53
53
|
const translationKeys = {
|
|
54
54
|
expandRow: 'carbon.table.row.expand',
|
|
55
55
|
collapseRow: 'carbon.table.row.collapse',
|
|
@@ -4,5 +4,5 @@
|
|
|
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
|
-
declare const TableActionList: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement
|
|
7
|
+
declare const TableActionList: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement<any>;
|
|
8
8
|
export default TableActionList;
|
|
@@ -13,20 +13,23 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
13
13
|
var React = require('react');
|
|
14
14
|
var cx = require('classnames');
|
|
15
15
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
16
|
+
var PropTypes = require('prop-types');
|
|
16
17
|
|
|
17
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
19
|
|
|
19
20
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
21
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
21
23
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
+
const frFn = React.forwardRef;
|
|
25
|
+
const TableCell = frFn((props, ref) => {
|
|
26
|
+
const {
|
|
24
27
|
children,
|
|
25
28
|
className,
|
|
26
29
|
hasAILabelHeader,
|
|
27
30
|
colSpan,
|
|
28
31
|
...rest
|
|
29
|
-
} =
|
|
32
|
+
} = props;
|
|
30
33
|
const prefix = usePrefix.usePrefix();
|
|
31
34
|
const tableCellClassNames = cx__default["default"](className, {
|
|
32
35
|
[`${prefix}--table-cell--column-slug`]: hasAILabelHeader
|
|
@@ -38,5 +41,27 @@ const TableCell = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref)
|
|
|
38
41
|
}, rest), children);
|
|
39
42
|
});
|
|
40
43
|
TableCell.displayName = 'TableCell';
|
|
44
|
+
TableCell.propTypes = {
|
|
45
|
+
/**
|
|
46
|
+
* Pass in children that will be embedded in the table header label
|
|
47
|
+
*/
|
|
48
|
+
children: PropTypes__default["default"].node,
|
|
49
|
+
/**
|
|
50
|
+
* Specify an optional className to be applied to the container node
|
|
51
|
+
*/
|
|
52
|
+
className: PropTypes__default["default"].string,
|
|
53
|
+
/**
|
|
54
|
+
* The width of the expanded row's internal cell
|
|
55
|
+
*/
|
|
56
|
+
colSpan: PropTypes__default["default"].number,
|
|
57
|
+
/**
|
|
58
|
+
* Specify if the table cell is in an AI column
|
|
59
|
+
*/
|
|
60
|
+
hasAILabelHeader: PropTypes__default["default"].bool,
|
|
61
|
+
/**
|
|
62
|
+
* The id of the matching th node in the table head. Addresses a11y concerns outlined here: https://www.ibm.com/able/guidelines/ci162/info_and_relationships.html and https://www.w3.org/TR/WCAG20-TECHS/H43
|
|
63
|
+
*/
|
|
64
|
+
headers: PropTypes__default["default"].string
|
|
65
|
+
};
|
|
41
66
|
|
|
42
67
|
exports["default"] = TableCell;
|
|
@@ -99,7 +99,7 @@ declare const TableExpandHeader: {
|
|
|
99
99
|
* Specify whether this row is expanded or not. This helps coordinate data
|
|
100
100
|
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
|
|
101
101
|
*/
|
|
102
|
-
isExpanded:
|
|
102
|
+
isExpanded: React.Validator;
|
|
103
103
|
/**
|
|
104
104
|
* Hook for when a listener initiates a request to expand the given row
|
|
105
105
|
*/
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ThHTMLAttributes } from 'react';
|
|
8
8
|
export type TableHeadProps = ThHTMLAttributes<HTMLTableSectionElement>;
|
|
9
|
-
declare const TableHead: (props: import("../../types/common").ReactAttr<"thead">) => React.ReactElement
|
|
9
|
+
declare const TableHead: (props: import("../../types/common").ReactAttr<"thead">) => React.ReactElement<any>;
|
|
10
10
|
export default TableHead;
|
|
@@ -4,5 +4,5 @@
|
|
|
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
|
-
declare const TableToolbarContent: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement
|
|
7
|
+
declare const TableToolbarContent: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement<any>;
|
|
8
8
|
export default TableToolbarContent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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
|
+
/**
|
|
8
|
+
* Generates a unique cell ID by combining the row ID and header.
|
|
9
|
+
*
|
|
10
|
+
* Generic helper used to consolidate all call sites for getting a cell ID into
|
|
11
|
+
* one method.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getCellId: (rowId: string, header: string) => string;
|
|
@@ -10,13 +10,10 @@
|
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* one method. The strategy currently is that a "cellId" is just the combination
|
|
15
|
-
* of the row id and the header key used to access this field in a row.
|
|
13
|
+
* Generates a unique cell ID by combining the row ID and header.
|
|
16
14
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @returns {string}
|
|
15
|
+
* Generic helper used to consolidate all call sites for getting a cell ID into
|
|
16
|
+
* one method.
|
|
20
17
|
*/
|
|
21
18
|
const getCellId = (rowId, header) => `${rowId}:${header}`;
|
|
22
19
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
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
|
+
/**
|
|
8
|
+
* Filters row IDs based on whether any of the cell values in the row include
|
|
9
|
+
* the input value as a substring. Boolean cell values are ignored.
|
|
10
|
+
*/
|
|
11
|
+
export declare const defaultFilterRows: ({ rowIds, headers, cellsById, inputValue, getCellId, }: {
|
|
12
|
+
/** Table row IDs. */
|
|
13
|
+
rowIds: string[];
|
|
14
|
+
/** Table headers. */
|
|
15
|
+
headers: {
|
|
16
|
+
key: string;
|
|
17
|
+
}[];
|
|
18
|
+
/** Mapping of cell IDs to their corresponding cells. */
|
|
19
|
+
cellsById: Record<string, {
|
|
20
|
+
value: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
/** Input value to search for. */
|
|
23
|
+
inputValue: string;
|
|
24
|
+
/** Function that returns a cell ID given a row ID and a header. */
|
|
25
|
+
getCellId: (rowId: string, header: string) => string;
|
|
26
|
+
}) => string[];
|
|
@@ -10,18 +10,8 @@
|
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* individual cell values for a row. Then, we go through each cell value and see
|
|
16
|
-
* if any of them includes the given inputValue.
|
|
17
|
-
*
|
|
18
|
-
* @param {object} config
|
|
19
|
-
* @param {Array<string>} config.rowIds array of all the row ids in the table
|
|
20
|
-
* @param {Array<object>} config.headers
|
|
21
|
-
* @param {object} config.cellsById object containing a map of cell id to cell
|
|
22
|
-
* @param {string} config.inputValue the current input value in the Table Search
|
|
23
|
-
* @param {Function} config.getCellId
|
|
24
|
-
* @returns {Array<string>} rowIds
|
|
13
|
+
* Filters row IDs based on whether any of the cell values in the row include
|
|
14
|
+
* the input value as a substring. Boolean cell values are ignored.
|
|
25
15
|
*/
|
|
26
16
|
const defaultFilterRows = _ref => {
|
|
27
17
|
let {
|
|
@@ -31,15 +21,16 @@ const defaultFilterRows = _ref => {
|
|
|
31
21
|
inputValue,
|
|
32
22
|
getCellId
|
|
33
23
|
} = _ref;
|
|
24
|
+
const normalizedInput = inputValue.trim().toLowerCase();
|
|
25
|
+
if (!normalizedInput) return rowIds;
|
|
34
26
|
return rowIds.filter(rowId => headers.some(_ref2 => {
|
|
35
27
|
let {
|
|
36
28
|
key
|
|
37
29
|
} = _ref2;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return ('' + cellsById[id].value).toLowerCase().includes(inputValue.toLowerCase());
|
|
30
|
+
const cellId = getCellId(rowId, key);
|
|
31
|
+
const cell = cellsById[cellId];
|
|
32
|
+
if (typeof cell.value === 'boolean') return false;
|
|
33
|
+
return String(cell.value).toLowerCase().includes(normalizedInput);
|
|
43
34
|
}));
|
|
44
35
|
};
|
|
45
36
|
|
|
@@ -473,7 +473,7 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
476
|
-
}, [savedOnChange, savedOnOpen, readOnly, closeOnSelect, hasInput]);
|
|
476
|
+
}, [savedOnChange, savedOnOpen, readOnly, closeOnSelect, hasInput, datePickerType]);
|
|
477
477
|
|
|
478
478
|
// this hook allows consumers to access the flatpickr calendar
|
|
479
479
|
// instance for cases where functions like open() or close()
|
|
@@ -4,11 +4,11 @@
|
|
|
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 { ReactElementLike
|
|
7
|
+
import { ReactElementLike } from 'prop-types';
|
|
8
8
|
import React, { ReactNode } from 'react';
|
|
9
9
|
import { ReactAttr } from '../../types/common';
|
|
10
10
|
type ExcludedAttributes = 'value' | 'onChange' | 'locale' | 'children';
|
|
11
|
-
export type ReactNodeLike = ReactElementLike |
|
|
11
|
+
export type ReactNodeLike = ReactElementLike | ReadonlyArray<ReactNode> | string | number | boolean | null | undefined;
|
|
12
12
|
export type func = (...args: any[]) => any;
|
|
13
13
|
export interface DatePickerInputProps extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> {
|
|
14
14
|
/**
|
|
@@ -149,7 +149,7 @@ export interface DropdownProps<ItemType> extends Omit<ReactAttr<HTMLDivElement>,
|
|
|
149
149
|
export type DropdownTranslationKey = ListBoxMenuIconTranslationKey;
|
|
150
150
|
type DropdownComponentProps<ItemType> = React.PropsWithoutRef<React.PropsWithChildren<DropdownProps<ItemType>> & React.RefAttributes<HTMLButtonElement>>;
|
|
151
151
|
export interface DropdownComponent {
|
|
152
|
-
<ItemType>(props: DropdownComponentProps<ItemType>): React.ReactElement | null;
|
|
152
|
+
<ItemType>(props: DropdownComponentProps<ItemType>): React.ReactElement<any> | null;
|
|
153
153
|
}
|
|
154
154
|
declare const _default: DropdownComponent;
|
|
155
155
|
export default _default;
|
|
@@ -256,9 +256,9 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
256
256
|
|
|
257
257
|
// needs to be Capitalized for react to render it correctly
|
|
258
258
|
const ItemToElement = itemToElement;
|
|
259
|
-
const toggleButtonProps =
|
|
259
|
+
const toggleButtonProps = getToggleButtonProps({
|
|
260
260
|
'aria-label': ariaLabel || deprecatedAriaLabel
|
|
261
|
-
})
|
|
261
|
+
});
|
|
262
262
|
const helper = helperText && !isFluid ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
263
263
|
id: helperId,
|
|
264
264
|
className: helperClasses
|
|
@@ -330,7 +330,10 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
330
330
|
}
|
|
331
331
|
return /*#__PURE__*/React__default["default"].isValidElement(element) ? element : null;
|
|
332
332
|
}, [slug, decorator]);
|
|
333
|
-
const
|
|
333
|
+
const allLabelProps = getLabelProps();
|
|
334
|
+
const labelProps = /*#__PURE__*/React.isValidElement(titleText) ? {
|
|
335
|
+
id: allLabelProps.id
|
|
336
|
+
} : allLabelProps;
|
|
334
337
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
335
338
|
className: wrapperClasses
|
|
336
339
|
}, other), titleText && /*#__PURE__*/React__default["default"].createElement("label", _rollupPluginBabelHelpers["extends"]({
|
|
@@ -377,9 +380,6 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
|
|
|
377
380
|
item,
|
|
378
381
|
index
|
|
379
382
|
});
|
|
380
|
-
if (item !== null && typeof item === 'object' && Object.prototype.hasOwnProperty.call(item, 'id')) {
|
|
381
|
-
itemProps.id = item['id'];
|
|
382
|
-
}
|
|
383
383
|
const title = isObject && 'text' in item && itemToElement ? item.text : itemToString(item);
|
|
384
384
|
return /*#__PURE__*/React__default["default"].createElement(index$1["default"].MenuItem, _rollupPluginBabelHelpers["extends"]({
|
|
385
385
|
key: itemProps.id,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import React, { ReactNode } from 'react';
|
|
8
|
+
import React, { ReactNode, type JSX } from 'react';
|
|
9
9
|
export interface FeatureFlagsProps {
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
flags?: Record<string, boolean>;
|
|
@@ -79,5 +79,10 @@ export interface FileUploaderHandle {
|
|
|
79
79
|
*/
|
|
80
80
|
clearFiles: () => void;
|
|
81
81
|
}
|
|
82
|
-
declare const FileUploader:
|
|
82
|
+
declare const FileUploader: {
|
|
83
|
+
<ItemType>(props: FileUploaderProps): React.ReactElement<any>;
|
|
84
|
+
propTypes?: any;
|
|
85
|
+
contextTypes?: any;
|
|
86
|
+
defaultProps?: any;
|
|
87
|
+
};
|
|
83
88
|
export default FileUploader;
|
|
@@ -127,7 +127,9 @@ const FileUploader = /*#__PURE__*/React__default["default"].forwardRef((_ref, re
|
|
|
127
127
|
}, state.fileNames.length === 0 ? null : state.fileNames.map((name, index) => /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({
|
|
128
128
|
key: index,
|
|
129
129
|
className: selectedFileClasses,
|
|
130
|
-
ref: node =>
|
|
130
|
+
ref: node => {
|
|
131
|
+
nodes[index] = node;
|
|
132
|
+
} // eslint-disable-line
|
|
131
133
|
}, other), /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
132
134
|
as: "p",
|
|
133
135
|
className: `${prefix}--file-filename`,
|
|
@@ -69,7 +69,7 @@ export interface FileUploaderButtonProps extends Omit<ReactAttr<HTMLButtonElemen
|
|
|
69
69
|
* @deprecated The `tabIndex` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default.
|
|
70
70
|
*/
|
|
71
71
|
tabIndex?: number | string;
|
|
72
|
-
innerRef?: React.RefObject<HTMLLabelElement>;
|
|
72
|
+
innerRef?: React.RefObject<HTMLLabelElement | null>;
|
|
73
73
|
}
|
|
74
74
|
declare function FileUploaderButton({ accept, buttonKind, className, disabled, disableLabelChanges, id, labelText: ownerLabelText, multiple, onChange, name, size, innerRef, ...other }: FileUploaderButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
75
75
|
declare namespace FileUploaderButton {
|
|
@@ -55,7 +55,7 @@ export interface FileUploaderDropContainerProps extends Omit<ReactAttr<HTMLButto
|
|
|
55
55
|
/**
|
|
56
56
|
* Ref to pass to the inner button element
|
|
57
57
|
*/
|
|
58
|
-
innerRef?: React.
|
|
58
|
+
innerRef?: React.Ref<HTMLButtonElement>;
|
|
59
59
|
/**
|
|
60
60
|
* @deprecated The `role` prop for `FileUploaderButton` has been deprecated since it now renders a button element by default, and has an implicit role of button.
|
|
61
61
|
*/
|
|
@@ -18,17 +18,16 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
18
18
|
|
|
19
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
...other
|
|
24
|
-
} = _ref;
|
|
21
|
+
const frFn = React.forwardRef;
|
|
22
|
+
const FluidDatePickerInput = frFn((props, ref) => {
|
|
25
23
|
return /*#__PURE__*/React__default["default"].createElement(FormContext.FormContext.Provider, {
|
|
26
24
|
value: {
|
|
27
25
|
isFluid: true
|
|
28
26
|
}
|
|
29
27
|
}, /*#__PURE__*/React__default["default"].createElement(DatePickerInput["default"], _rollupPluginBabelHelpers["extends"]({
|
|
30
28
|
ref: ref
|
|
31
|
-
},
|
|
29
|
+
}, props)));
|
|
32
30
|
});
|
|
31
|
+
FluidDatePickerInput.propTypes = DatePickerInput["default"].propTypes;
|
|
33
32
|
|
|
34
33
|
exports["default"] = FluidDatePickerInput;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
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
7
|
import React, { FunctionComponent } from 'react';
|
|
8
|
-
import { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
-
import { FilterableMultiSelectProps } from '../MultiSelect
|
|
8
|
+
import type { UseComboboxProps, UseMultipleSelectionProps } from 'downshift';
|
|
9
|
+
import { type FilterableMultiSelectProps } from '../MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2022
|
|
2
|
+
* Copyright IBM Corp. 2022, 2025
|
|
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
7
|
import React from 'react';
|
|
8
|
+
import { type MultiSelectProps } from '../MultiSelect';
|
|
8
9
|
import { UseSelectProps } from 'downshift';
|
|
9
|
-
import { MultiSelectProps } from '../MultiSelect/MultiSelect';
|
|
10
10
|
interface OnChangeData<ItemType> {
|
|
11
11
|
selectedItems: ItemType[] | null;
|
|
12
12
|
}
|