@carbon/react 1.29.1 → 1.30.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/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -7
- package/es/components/Accordion/Accordion.js +1 -8
- package/es/components/Accordion/AccordionItem.js +5 -19
- package/es/components/AspectRatio/AspectRatio.js +0 -5
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/es/components/Breadcrumb/Breadcrumb.js +0 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/es/components/Button/Button.Skeleton.js +2 -7
- package/es/components/Button/Button.js +2 -36
- package/es/components/ButtonSet/ButtonSet.js +0 -2
- package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/es/components/Checkbox/Checkbox.js +4 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/es/components/ClassPrefix/index.d.ts +26 -0
- package/es/components/ClassPrefix/index.js +0 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/es/components/CodeSnippet/CodeSnippet.js +6 -45
- package/es/components/ComboBox/ComboBox.js +12 -79
- package/es/components/ComboBox/tools/filter.js +0 -1
- package/es/components/ComboButton/index.js +0 -14
- package/es/components/ComposedModal/ComposedModal.js +2 -32
- package/es/components/ComposedModal/ModalFooter.js +0 -21
- package/es/components/ComposedModal/ModalHeader.js +0 -12
- package/es/components/ContainedList/ContainedList.js +5 -32
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/es/components/ContextMenu/useContextMenu.js +1 -6
- package/es/components/Copy/Copy.js +8 -31
- package/es/components/CopyButton/CopyButton.js +0 -4
- package/es/components/DangerButton/DangerButton.js +0 -1
- package/es/components/DataTable/DataTable.js +171 -91
- package/es/components/DataTable/Table.js +0 -6
- package/es/components/DataTable/TableBatchAction.js +0 -4
- package/es/components/DataTable/TableBatchActions.js +0 -8
- package/es/components/DataTable/TableBody.js +0 -1
- package/es/components/DataTable/TableContainer.js +0 -5
- package/es/components/DataTable/TableExpandHeader.js +0 -7
- package/es/components/DataTable/TableExpandRow.js +0 -6
- package/es/components/DataTable/TableExpandedRow.js +0 -6
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -19
- package/es/components/DataTable/TableRow.js +4 -5
- package/es/components/DataTable/TableSelectAll.js +0 -8
- package/es/components/DataTable/TableSelectRow.js +2 -10
- package/es/components/DataTable/TableToolbar.js +0 -3
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +3 -6
- package/es/components/DataTable/TableToolbarSearch.js +2 -30
- package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/es/components/DataTable/state/sorting.js +5 -8
- package/es/components/DataTable/tools/denormalize.js +2 -2
- package/es/components/DataTable/tools/filter.js +0 -2
- package/es/components/DataTable/tools/instanceId.js +0 -1
- package/es/components/DataTable/tools/normalize.js +10 -10
- package/es/components/DataTable/tools/sorting.js +5 -13
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/es/components/DatePicker/DatePicker.js +153 -175
- package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/es/components/DatePickerInput/DatePickerInput.js +2 -28
- package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/es/components/Dropdown/Dropdown.js +43 -52
- package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/es/components/FeatureFlags/index.js +8 -20
- package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/es/components/FileUploader/FileUploader.js +3 -38
- package/es/components/FileUploader/FileUploaderButton.js +3 -24
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/es/components/FileUploader/FileUploaderItem.js +5 -12
- package/es/components/FileUploader/Filename.js +6 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/es/components/FluidComboBox/FluidComboBox.js +0 -18
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/es/components/FluidDropdown/FluidDropdown.js +0 -18
- package/es/components/FluidForm/FluidForm.js +0 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/es/components/FluidSelect/FluidSelect.js +0 -10
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -20
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -14
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/es/components/Form/Form.d.ts +23 -0
- package/es/components/Form/Form.js +3 -6
- package/es/components/Form/index.d.ts +7 -0
- package/es/components/FormGroup/FormGroup.js +0 -7
- package/es/components/FormItem/FormItem.js +0 -2
- package/es/components/FormLabel/FormLabel.js +1 -7
- package/es/components/Grid/CSSGrid.js +2 -15
- package/es/components/Grid/Column.js +18 -59
- package/es/components/Grid/ColumnHang.js +2 -5
- package/es/components/Grid/FlexGrid.js +2 -8
- package/es/components/Grid/Grid.js +0 -8
- package/es/components/Grid/GridContext.js +1 -3
- package/es/components/Grid/Row.js +2 -7
- package/es/components/Heading/index.js +0 -4
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +0 -10
- package/es/components/IdPrefix/index.js +0 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/es/components/InlineLoading/InlineLoading.js +0 -12
- package/es/components/Layer/index.js +3 -6
- package/es/components/Layout/LayoutDirection.js +0 -3
- package/es/components/Layout/useLayoutDirection.js +0 -1
- package/es/components/Link/Link.js +3 -10
- package/es/components/ListBox/ListBox.js +2 -13
- package/es/components/ListBox/ListBoxField.js +0 -5
- package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/es/components/ListBox/ListBoxMenuItem.js +2 -6
- package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +1 -13
- package/es/components/ListBox/next/ListBoxSelection.js +1 -14
- package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/es/components/ListItem/ListItem.d.ts +23 -0
- package/es/components/ListItem/ListItem.js +4 -8
- package/es/components/ListItem/index.d.ts +7 -0
- package/es/components/Loading/Loading.js +0 -6
- package/es/components/Menu/Menu.js +22 -40
- package/es/components/Menu/MenuContext.js +4 -5
- package/es/components/Menu/MenuItem.js +5 -39
- package/es/components/MenuButton/index.js +0 -9
- package/es/components/Modal/Modal.js +1 -46
- package/es/components/ModalWrapper/ModalWrapper.js +2 -15
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
- package/es/components/MultiSelect/MultiSelect.js +22 -70
- package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/es/components/MultiSelect/index.js +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -2
- package/es/components/MultiSelect/tools/sorting.js +3 -4
- package/es/components/Notification/Notification.js +0 -78
- package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/es/components/NumberInput/NumberInput.js +3 -60
- package/es/components/OrderedList/OrderedList.d.ts +39 -0
- package/es/components/OrderedList/OrderedList.js +7 -19
- package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
- package/es/components/OverflowMenu/OverflowMenu.js +65 -86
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/es/components/OverflowMenuV2/index.js +0 -5
- package/es/components/Pagination/Pagination.Skeleton.js +0 -2
- package/es/components/Pagination/Pagination.js +11 -47
- package/es/components/Pagination/experimental/PageSelector.js +0 -10
- package/es/components/Pagination/experimental/Pagination.js +2 -48
- package/es/components/PaginationNav/PaginationNav.js +15 -59
- package/es/components/Popover/index.d.ts +14 -8
- package/es/components/Popover/index.js +44 -48
- package/es/components/PrimaryButton/PrimaryButton.js +0 -1
- package/es/components/ProgressBar/ProgressBar.js +0 -15
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/es/components/RadioButton/RadioButton.js +0 -13
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/es/components/RadioTile/RadioTile.js +0 -12
- package/es/components/Search/Search.Skeleton.js +0 -2
- package/es/components/Search/Search.js +1 -28
- package/es/components/SecondaryButton/SecondaryButton.js +0 -1
- package/es/components/Select/Select.Skeleton.js +0 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +6 -33
- package/es/components/SelectItem/SelectItem.js +0 -5
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
- package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +0 -12
- package/es/components/Slider/Slider.Skeleton.js +0 -2
- package/es/components/Slider/Slider.d.ts +0 -1
- package/es/components/Slider/Slider.js +112 -135
- package/es/components/Stack/Stack.js +1 -8
- package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/es/components/StructuredList/StructuredList.js +1 -25
- package/es/components/Switch/IconSwitch.js +0 -18
- package/es/components/Switch/Switch.js +0 -11
- package/es/components/TabContent/TabContent.js +2 -6
- package/es/components/Tabs/Tabs.Skeleton.js +0 -4
- package/es/components/Tabs/Tabs.js +135 -104
- package/es/components/Tabs/usePressable.js +18 -31
- package/es/components/Tag/Tag.Skeleton.js +0 -2
- package/es/components/Tag/Tag.js +0 -15
- package/es/components/Text/Text.js +5 -18
- package/es/components/Text/TextDirection.js +0 -3
- package/es/components/Text/TextDirectionContext.js +0 -1
- package/es/components/Text/createTextComponent.js +0 -3
- package/es/components/TextArea/TextArea.Skeleton.js +0 -2
- package/es/components/TextArea/TextArea.js +11 -33
- package/es/components/TextInput/ControlledPasswordInput.js +0 -20
- package/es/components/TextInput/PasswordInput.js +0 -25
- package/es/components/TextInput/TextInput.Skeleton.js +0 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +5 -33
- package/es/components/TextInput/util.js +3 -5
- package/es/components/Theme/index.js +1 -6
- package/es/components/Tile/Tile.js +32 -59
- package/es/components/TileGroup/TileGroup.js +1 -22
- package/es/components/TimePicker/TimePicker.js +6 -32
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/es/components/Toggle/Toggle.Skeleton.js +0 -8
- package/es/components/Toggle/Toggle.js +0 -16
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/es/components/Toggletip/index.d.ts +148 -0
- package/es/components/Toggletip/index.js +20 -44
- package/es/components/Tooltip/DefinitionTooltip.js +0 -11
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +4 -21
- package/es/components/TreeView/TreeNode.js +21 -66
- package/es/components/TreeView/TreeView.js +11 -67
- package/es/components/UIShell/Content.js +2 -4
- package/es/components/UIShell/Header.js +0 -2
- package/es/components/UIShell/HeaderContainer.d.ts +33 -0
- package/es/components/UIShell/HeaderContainer.js +13 -11
- package/es/components/UIShell/HeaderGlobalAction.js +0 -6
- package/es/components/UIShell/HeaderGlobalBar.js +0 -1
- package/es/components/UIShell/HeaderMenu.js +32 -31
- package/es/components/UIShell/HeaderMenuButton.js +2 -4
- package/es/components/UIShell/HeaderMenuItem.js +0 -8
- package/es/components/UIShell/HeaderName.js +0 -5
- package/es/components/UIShell/HeaderNavigation.js +0 -2
- package/es/components/UIShell/HeaderPanel.js +0 -2
- package/es/components/UIShell/HeaderSideNavItems.js +0 -2
- package/es/components/UIShell/Link.js +2 -3
- package/es/components/UIShell/SideNav.d.ts +3 -1
- package/es/components/UIShell/SideNav.js +44 -36
- package/es/components/UIShell/SideNavDetails.js +0 -3
- package/es/components/UIShell/SideNavDivider.js +0 -1
- package/es/components/UIShell/SideNavFooter.js +1 -4
- package/es/components/UIShell/SideNavHeader.js +0 -4
- package/es/components/UIShell/SideNavIcon.js +0 -3
- package/es/components/UIShell/SideNavItem.js +0 -3
- package/es/components/UIShell/SideNavItems.js +2 -6
- package/es/components/UIShell/SideNavLink.js +3 -7
- package/es/components/UIShell/SideNavLinkText.js +0 -2
- package/es/components/UIShell/SideNavMenu.js +0 -16
- package/es/components/UIShell/SideNavMenuItem.js +0 -2
- package/es/components/UIShell/SideNavSwitcher.js +2 -5
- package/es/components/UIShell/SkipToContent.d.ts +32 -0
- package/es/components/UIShell/SkipToContent.js +8 -15
- package/es/components/UIShell/Switcher.js +0 -2
- package/es/components/UIShell/SwitcherDivider.js +0 -1
- package/es/components/UIShell/SwitcherItem.js +0 -3
- package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/es/components/UnorderedList/UnorderedList.js +6 -16
- package/es/components/UnorderedList/index.d.ts +7 -0
- package/es/index.js +7 -8
- package/es/internal/ClickListener.js +3 -13
- package/es/internal/FloatingMenu.js +57 -63
- package/es/internal/OptimizedResize.js +6 -12
- package/es/internal/Selection.js +2 -25
- package/es/internal/createClassWrapper.js +0 -2
- package/es/internal/deprecateFieldOnObject.js +0 -4
- package/es/internal/focus/index.js +0 -1
- package/es/internal/keyboard/keys.js +2 -1
- package/es/internal/keyboard/match.js +1 -6
- package/es/internal/keyboard/navigation.js +8 -7
- package/es/internal/useAnnouncer.js +0 -1
- package/es/internal/useAttachedMenu.js +1 -9
- package/es/internal/useControllableState.js +6 -13
- package/es/internal/useDelayedState.js +2 -4
- package/es/internal/useEffectOnce.js +0 -1
- package/es/internal/useEvent.js +61 -3
- package/es/internal/useId.js +2 -5
- package/es/internal/useIsomorphicEffect.js +1 -0
- package/es/internal/useMergedRefs.js +2 -2
- package/es/internal/useNoInteractiveChildren.js +2 -13
- package/es/internal/useNormalizedInputProps.js +0 -3
- package/es/internal/useSavedCallback.js +0 -1
- package/es/internal/warning.js +0 -3
- package/es/internal/wrapFocus.js +1 -8
- package/es/prop-types/deprecate.js +2 -5
- package/es/prop-types/isRequiredOneOf.js +2 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/es/tools/array.js +0 -3
- package/es/tools/events.js +0 -3
- package/es/tools/mergeRefs.js +0 -2
- package/es/tools/wrapComponent.js +2 -5
- package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
- package/lib/components/Accordion/Accordion.js +1 -27
- package/lib/components/Accordion/AccordionItem.js +5 -19
- package/lib/components/AspectRatio/AspectRatio.js +0 -5
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/lib/components/Button/Button.Skeleton.js +2 -26
- package/lib/components/Button/Button.js +2 -36
- package/lib/components/ButtonSet/ButtonSet.js +0 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/lib/components/Checkbox/Checkbox.js +4 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/lib/components/ClassPrefix/index.d.ts +26 -0
- package/lib/components/ClassPrefix/index.js +0 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
- package/lib/components/ComboBox/ComboBox.js +19 -86
- package/lib/components/ComboBox/tools/filter.js +0 -1
- package/lib/components/ComboButton/index.js +0 -14
- package/lib/components/ComposedModal/ComposedModal.js +2 -32
- package/lib/components/ComposedModal/ModalFooter.js +0 -21
- package/lib/components/ComposedModal/ModalHeader.js +0 -12
- package/lib/components/ContainedList/ContainedList.js +5 -32
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/lib/components/ContextMenu/useContextMenu.js +1 -6
- package/lib/components/Copy/Copy.js +8 -50
- package/lib/components/CopyButton/CopyButton.js +0 -4
- package/lib/components/DangerButton/DangerButton.js +0 -1
- package/lib/components/DataTable/DataTable.js +171 -91
- package/lib/components/DataTable/Table.js +0 -6
- package/lib/components/DataTable/TableBatchAction.js +0 -4
- package/lib/components/DataTable/TableBatchActions.js +0 -8
- package/lib/components/DataTable/TableBody.js +0 -1
- package/lib/components/DataTable/TableContainer.js +0 -5
- package/lib/components/DataTable/TableExpandHeader.js +0 -7
- package/lib/components/DataTable/TableExpandRow.js +0 -6
- package/lib/components/DataTable/TableExpandedRow.js +0 -6
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -19
- package/lib/components/DataTable/TableRow.js +4 -5
- package/lib/components/DataTable/TableSelectAll.js +0 -8
- package/lib/components/DataTable/TableSelectRow.js +2 -10
- package/lib/components/DataTable/TableToolbar.js +0 -3
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +3 -6
- package/lib/components/DataTable/TableToolbarSearch.js +2 -30
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/lib/components/DataTable/state/sorting.js +5 -8
- package/lib/components/DataTable/tools/denormalize.js +2 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/instanceId.js +0 -1
- package/lib/components/DataTable/tools/normalize.js +10 -10
- package/lib/components/DataTable/tools/sorting.js +5 -13
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/lib/components/DatePicker/DatePicker.js +153 -175
- package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
- package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/lib/components/Dropdown/Dropdown.js +50 -59
- package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/lib/components/FeatureFlags/index.js +8 -20
- package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/lib/components/FileUploader/FileUploader.js +3 -57
- package/lib/components/FileUploader/FileUploaderButton.js +3 -43
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/lib/components/FileUploader/FileUploaderItem.js +5 -31
- package/lib/components/FileUploader/Filename.js +6 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
- package/lib/components/FluidForm/FluidForm.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/lib/components/FluidSelect/FluidSelect.js +0 -10
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/lib/components/Form/Form.d.ts +23 -0
- package/lib/components/Form/Form.js +3 -6
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/FormGroup/FormGroup.js +0 -7
- package/lib/components/FormItem/FormItem.js +0 -2
- package/lib/components/FormLabel/FormLabel.js +1 -26
- package/lib/components/Grid/CSSGrid.js +2 -15
- package/lib/components/Grid/Column.js +18 -59
- package/lib/components/Grid/ColumnHang.js +2 -5
- package/lib/components/Grid/FlexGrid.js +2 -8
- package/lib/components/Grid/Grid.js +0 -8
- package/lib/components/Grid/GridContext.js +1 -3
- package/lib/components/Grid/Row.js +2 -7
- package/lib/components/Heading/index.js +0 -4
- package/lib/components/Icon/Icon.Skeleton.js +2 -2
- package/lib/components/IconButton/index.js +0 -10
- package/lib/components/IdPrefix/index.js +0 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/lib/components/InlineLoading/InlineLoading.js +0 -12
- package/lib/components/Layer/index.js +3 -6
- package/lib/components/Layout/LayoutDirection.js +0 -3
- package/lib/components/Layout/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.js +3 -10
- package/lib/components/ListBox/ListBox.js +2 -13
- package/lib/components/ListBox/ListBoxField.js +0 -5
- package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +1 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
- package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/lib/components/ListItem/ListItem.d.ts +23 -0
- package/lib/components/ListItem/ListItem.js +4 -8
- package/lib/components/ListItem/index.d.ts +7 -0
- package/lib/components/Loading/Loading.js +0 -6
- package/lib/components/Menu/Menu.js +22 -40
- package/lib/components/Menu/MenuContext.js +4 -5
- package/lib/components/Menu/MenuItem.js +5 -39
- package/lib/components/MenuButton/index.js +0 -9
- package/lib/components/Modal/Modal.js +1 -46
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
- package/lib/components/MultiSelect/MultiSelect.js +30 -78
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/lib/components/MultiSelect/index.js +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -2
- package/lib/components/MultiSelect/tools/sorting.js +3 -4
- package/lib/components/Notification/Notification.js +0 -78
- package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/lib/components/NumberInput/NumberInput.js +3 -60
- package/lib/components/OrderedList/OrderedList.d.ts +39 -0
- package/lib/components/OrderedList/OrderedList.js +7 -19
- package/lib/components/OrderedList/index.d.ts +7 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/lib/components/OverflowMenuV2/index.js +0 -5
- package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
- package/lib/components/Pagination/Pagination.js +11 -47
- package/lib/components/Pagination/experimental/PageSelector.js +0 -10
- package/lib/components/Pagination/experimental/Pagination.js +2 -67
- package/lib/components/PaginationNav/PaginationNav.js +15 -78
- package/lib/components/Popover/index.d.ts +14 -8
- package/lib/components/Popover/index.js +44 -48
- package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js +0 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/lib/components/RadioButton/RadioButton.js +0 -13
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/lib/components/RadioTile/RadioTile.js +0 -12
- package/lib/components/Search/Search.Skeleton.js +0 -2
- package/lib/components/Search/Search.js +1 -28
- package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
- package/lib/components/Select/Select.Skeleton.js +0 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +6 -33
- package/lib/components/SelectItem/SelectItem.js +0 -5
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
- package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +0 -12
- package/lib/components/Slider/Slider.Skeleton.js +0 -2
- package/lib/components/Slider/Slider.d.ts +0 -1
- package/lib/components/Slider/Slider.js +112 -154
- package/lib/components/Stack/Stack.js +1 -8
- package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/lib/components/StructuredList/StructuredList.js +1 -25
- package/lib/components/Switch/IconSwitch.js +0 -18
- package/lib/components/Switch/Switch.js +0 -11
- package/lib/components/TabContent/TabContent.js +2 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
- package/lib/components/Tabs/Tabs.js +133 -102
- package/lib/components/Tabs/usePressable.js +18 -31
- package/lib/components/Tag/Tag.Skeleton.js +0 -2
- package/lib/components/Tag/Tag.js +0 -15
- package/lib/components/Text/Text.js +5 -18
- package/lib/components/Text/TextDirection.js +0 -3
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/Text/createTextComponent.js +0 -3
- package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
- package/lib/components/TextArea/TextArea.js +10 -32
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
- package/lib/components/TextInput/PasswordInput.js +0 -25
- package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +5 -52
- package/lib/components/TextInput/util.js +3 -5
- package/lib/components/Theme/index.js +1 -6
- package/lib/components/Tile/Tile.js +31 -58
- package/lib/components/TileGroup/TileGroup.js +1 -22
- package/lib/components/TimePicker/TimePicker.js +6 -32
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
- package/lib/components/Toggle/Toggle.js +0 -16
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/lib/components/Toggletip/index.d.ts +148 -0
- package/lib/components/Toggletip/index.js +20 -44
- package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -21
- package/lib/components/TreeView/TreeNode.js +21 -66
- package/lib/components/TreeView/TreeView.js +11 -67
- package/lib/components/UIShell/Content.js +2 -4
- package/lib/components/UIShell/Header.js +0 -2
- package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
- package/lib/components/UIShell/HeaderContainer.js +13 -11
- package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
- package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
- package/lib/components/UIShell/HeaderMenu.js +32 -31
- package/lib/components/UIShell/HeaderMenuButton.js +2 -4
- package/lib/components/UIShell/HeaderMenuItem.js +0 -8
- package/lib/components/UIShell/HeaderName.js +0 -5
- package/lib/components/UIShell/HeaderNavigation.js +0 -2
- package/lib/components/UIShell/HeaderPanel.js +0 -2
- package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
- package/lib/components/UIShell/Link.js +2 -3
- package/lib/components/UIShell/SideNav.d.ts +3 -1
- package/lib/components/UIShell/SideNav.js +43 -35
- package/lib/components/UIShell/SideNavDetails.js +0 -3
- package/lib/components/UIShell/SideNavDivider.js +0 -1
- package/lib/components/UIShell/SideNavFooter.js +1 -4
- package/lib/components/UIShell/SideNavHeader.js +0 -4
- package/lib/components/UIShell/SideNavIcon.js +0 -3
- package/lib/components/UIShell/SideNavItem.js +0 -3
- package/lib/components/UIShell/SideNavItems.js +2 -6
- package/lib/components/UIShell/SideNavLink.js +3 -7
- package/lib/components/UIShell/SideNavLinkText.js +0 -2
- package/lib/components/UIShell/SideNavMenu.js +0 -16
- package/lib/components/UIShell/SideNavMenuItem.js +0 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -5
- package/lib/components/UIShell/SkipToContent.d.ts +32 -0
- package/lib/components/UIShell/SkipToContent.js +8 -15
- package/lib/components/UIShell/Switcher.js +0 -2
- package/lib/components/UIShell/SwitcherDivider.js +0 -1
- package/lib/components/UIShell/SwitcherItem.js +0 -3
- package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/lib/components/UnorderedList/UnorderedList.js +6 -16
- package/lib/components/UnorderedList/index.d.ts +7 -0
- package/lib/index.js +42 -43
- package/lib/internal/ClickListener.js +3 -13
- package/lib/internal/FloatingMenu.js +57 -63
- package/lib/internal/OptimizedResize.js +6 -12
- package/lib/internal/Selection.js +2 -25
- package/lib/internal/createClassWrapper.js +0 -2
- package/lib/internal/deprecateFieldOnObject.js +0 -4
- package/lib/internal/focus/index.js +0 -1
- package/lib/internal/keyboard/keys.js +2 -1
- package/lib/internal/keyboard/match.js +1 -6
- package/lib/internal/keyboard/navigation.js +8 -7
- package/lib/internal/useAnnouncer.js +0 -1
- package/lib/internal/useAttachedMenu.js +1 -9
- package/lib/internal/useControllableState.js +6 -13
- package/lib/internal/useDelayedState.js +2 -4
- package/lib/internal/useEffectOnce.js +0 -1
- package/lib/internal/useEvent.js +61 -2
- package/lib/internal/useId.js +2 -5
- package/lib/internal/useIsomorphicEffect.js +1 -0
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/useNoInteractiveChildren.js +2 -13
- package/lib/internal/useNormalizedInputProps.js +0 -3
- package/lib/internal/useSavedCallback.js +0 -1
- package/lib/internal/warning.js +0 -3
- package/lib/internal/wrapFocus.js +1 -8
- package/lib/prop-types/deprecate.js +2 -5
- package/lib/prop-types/isRequiredOneOf.js +2 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/lib/tools/array.js +0 -3
- package/lib/tools/events.js +0 -3
- package/lib/tools/mergeRefs.js +0 -2
- package/lib/tools/wrapComponent.js +2 -5
- package/package.json +9 -9
- package/es/components/Tab/Tab.js +0 -185
- package/es/components/Tab/index.js +0 -14
- package/es/components/TimePickerSelect/index.js +0 -13
- package/lib/components/Form/index.js +0 -17
- package/lib/components/Tab/Tab.js +0 -214
- package/lib/components/Tab/index.js +0 -39
- package/lib/components/TimePickerSelect/index.js +0 -38
|
@@ -29,11 +29,9 @@ const translationKeys = {
|
|
|
29
29
|
'carbon.table.toolbar.search.label': 'Filter table',
|
|
30
30
|
'carbon.table.toolbar.search.placeholder': 'Filter table'
|
|
31
31
|
};
|
|
32
|
-
|
|
33
32
|
const translateWithId = id => {
|
|
34
33
|
return translationKeys[id];
|
|
35
34
|
};
|
|
36
|
-
|
|
37
35
|
const TableToolbarSearch = _ref => {
|
|
38
36
|
let {
|
|
39
37
|
className,
|
|
@@ -74,7 +72,8 @@ const TableToolbarSearch = _ref => {
|
|
|
74
72
|
if (defaultValue) {
|
|
75
73
|
onChangeProp('', defaultValue);
|
|
76
74
|
}
|
|
77
|
-
},
|
|
75
|
+
},
|
|
76
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
78
77
|
[]);
|
|
79
78
|
const searchClasses = cx__default["default"](className, {
|
|
80
79
|
[searchContainerClass]: searchContainerClass,
|
|
@@ -83,33 +82,25 @@ const TableToolbarSearch = _ref => {
|
|
|
83
82
|
[`${prefix}--toolbar-search-container-expandable`]: !persistent,
|
|
84
83
|
[`${prefix}--toolbar-search-container-persistent`]: persistent
|
|
85
84
|
});
|
|
86
|
-
|
|
87
85
|
const handleExpand = function (event) {
|
|
88
86
|
let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !expanded;
|
|
89
|
-
|
|
90
87
|
if (!disabled) {
|
|
91
88
|
if (!controlled && !persistent) {
|
|
92
89
|
setExpandedState(value);
|
|
93
90
|
}
|
|
94
|
-
|
|
95
91
|
if (onExpand) {
|
|
96
92
|
onExpand(event, value);
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
};
|
|
100
|
-
|
|
101
96
|
const onChange = e => {
|
|
102
97
|
setValue(e.target.value);
|
|
103
|
-
|
|
104
98
|
if (onChangeProp) {
|
|
105
99
|
onChangeProp(e);
|
|
106
100
|
}
|
|
107
101
|
};
|
|
108
|
-
|
|
109
102
|
const handleOnFocus = event => handleExpand(event, true);
|
|
110
|
-
|
|
111
103
|
const handleOnBlur = event => !value && handleExpand(event, false);
|
|
112
|
-
|
|
113
104
|
return /*#__PURE__*/React__default["default"].createElement(Search["default"], _rollupPluginBabelHelpers["extends"]({
|
|
114
105
|
disabled: disabled,
|
|
115
106
|
className: searchClasses,
|
|
@@ -124,99 +115,80 @@ const TableToolbarSearch = _ref => {
|
|
|
124
115
|
size: size
|
|
125
116
|
}, rest));
|
|
126
117
|
};
|
|
127
|
-
|
|
128
118
|
TableToolbarSearch.propTypes = {
|
|
129
119
|
children: PropTypes__default["default"].node,
|
|
130
|
-
|
|
131
120
|
/**
|
|
132
121
|
* Provide an optional class name for the search container
|
|
133
122
|
*/
|
|
134
123
|
className: PropTypes__default["default"].string,
|
|
135
|
-
|
|
136
124
|
/**
|
|
137
125
|
* Specifies if the search should initially render in an expanded state
|
|
138
126
|
*/
|
|
139
127
|
defaultExpanded: PropTypes__default["default"].bool,
|
|
140
|
-
|
|
141
128
|
/**
|
|
142
129
|
* Provide an optional default value for the Search component
|
|
143
130
|
*/
|
|
144
131
|
defaultValue: PropTypes__default["default"].string,
|
|
145
|
-
|
|
146
132
|
/**
|
|
147
133
|
* Specifies if the search should be disabled
|
|
148
134
|
*/
|
|
149
135
|
disabled: PropTypes__default["default"].bool,
|
|
150
|
-
|
|
151
136
|
/**
|
|
152
137
|
* Specifies if the search should expand
|
|
153
138
|
*/
|
|
154
139
|
expanded: PropTypes__default["default"].bool,
|
|
155
|
-
|
|
156
140
|
/**
|
|
157
141
|
* Provide an optional id for the search container
|
|
158
142
|
*/
|
|
159
143
|
id: PropTypes__default["default"].string,
|
|
160
|
-
|
|
161
144
|
/**
|
|
162
145
|
* Provide an optional label text for the Search component icon
|
|
163
146
|
*/
|
|
164
147
|
labelText: PropTypes__default["default"].string,
|
|
165
|
-
|
|
166
148
|
/**
|
|
167
149
|
* Provide an optional function to be called when the search input loses focus, this will be
|
|
168
150
|
* passed the event as the first parameter and a function to handle the expanding of the search
|
|
169
151
|
* input as the second
|
|
170
152
|
*/
|
|
171
153
|
onBlur: PropTypes__default["default"].func,
|
|
172
|
-
|
|
173
154
|
/**
|
|
174
155
|
* Provide an optional hook that is called each time the input is updated
|
|
175
156
|
*/
|
|
176
157
|
onChange: PropTypes__default["default"].func,
|
|
177
|
-
|
|
178
158
|
/**
|
|
179
159
|
* Optional callback called when the search value is cleared.
|
|
180
160
|
*/
|
|
181
161
|
onClear: PropTypes__default["default"].func,
|
|
182
|
-
|
|
183
162
|
/**
|
|
184
163
|
* Provide an optional hook that is called each time the input is expanded
|
|
185
164
|
*/
|
|
186
165
|
onExpand: PropTypes__default["default"].func,
|
|
187
|
-
|
|
188
166
|
/**
|
|
189
167
|
* Provide an optional function to be called when the search input gains focus, this will be
|
|
190
168
|
* passed the event as the first parameter and a function to handle the expanding of the search
|
|
191
169
|
* input as the second.
|
|
192
170
|
*/
|
|
193
171
|
onFocus: PropTypes__default["default"].func,
|
|
194
|
-
|
|
195
172
|
/**
|
|
196
173
|
* Whether the search should be allowed to expand
|
|
197
174
|
*/
|
|
198
175
|
persistent: PropTypes__default["default"].bool,
|
|
199
|
-
|
|
200
176
|
/**
|
|
201
177
|
* Provide an optional placeholder text for the Search component
|
|
202
178
|
*/
|
|
203
179
|
placeholder: PropTypes__default["default"].string,
|
|
204
|
-
|
|
205
180
|
/**
|
|
206
181
|
* Provide an optional className for the overall container of the Search
|
|
207
182
|
*/
|
|
208
183
|
searchContainerClass: PropTypes__default["default"].string,
|
|
209
|
-
|
|
210
184
|
/**
|
|
211
185
|
* Specify the size of the Search
|
|
212
186
|
*/
|
|
213
187
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
214
|
-
|
|
215
188
|
/**
|
|
216
189
|
* Optional prop to specify the tabIndex of the <Search> (in expanded state) or the container (in collapsed state)
|
|
217
190
|
*/
|
|
218
191
|
tabIndex: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]),
|
|
219
|
-
|
|
220
192
|
/**
|
|
221
193
|
* Provide custom text for the component for each translation id
|
|
222
194
|
*/
|
|
@@ -19,7 +19,6 @@ var normalize = require('../tools/normalize.js');
|
|
|
19
19
|
* Currently, it's being used as a way to normalize the incoming data that we
|
|
20
20
|
* are receiving for rows
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
22
|
const getDerivedStateFromProps = (props, prevState) => {
|
|
24
23
|
const {
|
|
25
24
|
rowIds,
|
|
@@ -40,20 +39,17 @@ const getDerivedStateFromProps = (props, prevState) => {
|
|
|
40
39
|
// batch actions menu
|
|
41
40
|
shouldShowBatchActions: prevState.shouldShowBatchActions || false
|
|
42
41
|
};
|
|
43
|
-
|
|
44
42
|
if (prevState.sortDirection && prevState.sortHeaderKey) {
|
|
45
43
|
const {
|
|
46
44
|
rowIds
|
|
47
45
|
} = sorting.getSortedState(props, state, prevState.sortHeaderKey, prevState.sortDirection);
|
|
48
46
|
state.rowIds = rowIds;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
48
|
state.isExpandedAll = state.rowIds.every(id => {
|
|
52
49
|
return state.rowsById[id].isExpanded === true;
|
|
53
50
|
});
|
|
54
51
|
return state;
|
|
55
52
|
};
|
|
56
|
-
|
|
57
53
|
var getDerivedStateFromProps$1 = getDerivedStateFromProps;
|
|
58
54
|
|
|
59
55
|
exports["default"] = getDerivedStateFromProps$1;
|
|
@@ -12,9 +12,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
12
12
|
var sortStates = require('./sortStates.js');
|
|
13
13
|
var sorting = require('../tools/sorting.js');
|
|
14
14
|
|
|
15
|
+
// Our initialSortState should be `NONE`, unless a consumer has specified a
|
|
15
16
|
// different initialSortState
|
|
16
|
-
|
|
17
17
|
const initialSortState = sortStates.sortStates.NONE;
|
|
18
|
+
|
|
18
19
|
/**
|
|
19
20
|
* Utility used to get the next sort state given the following pieces of
|
|
20
21
|
* information:
|
|
@@ -24,7 +25,6 @@ const initialSortState = sortStates.sortStates.NONE;
|
|
|
24
25
|
* @param {string} prevState the previous sort state of the table
|
|
25
26
|
* @returns {string}
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
28
|
const getNextSortDirection = (prevHeader, header, prevState) => {
|
|
29
29
|
// If the previous header is equivalent to the current header, we know that we
|
|
30
30
|
// have to derive the next sort state from the previous sort state
|
|
@@ -34,16 +34,13 @@ const getNextSortDirection = (prevHeader, header, prevState) => {
|
|
|
34
34
|
if (prevState === 'NONE') {
|
|
35
35
|
return sortStates.sortStates.ASC;
|
|
36
36
|
}
|
|
37
|
-
|
|
38
37
|
if (prevState === 'ASC') {
|
|
39
38
|
return sortStates.sortStates.DESC;
|
|
40
39
|
}
|
|
41
|
-
|
|
42
40
|
return sortStates.sortStates.NONE;
|
|
43
|
-
}
|
|
41
|
+
}
|
|
42
|
+
// Otherwise, we have selected a new header and need to start off by sorting
|
|
44
43
|
// in descending order by default
|
|
45
|
-
|
|
46
|
-
|
|
47
44
|
return sortStates.sortStates.ASC;
|
|
48
45
|
};
|
|
49
46
|
const getNextSortState = (props, state, _ref) => {
|
|
@@ -57,6 +54,7 @@ const getNextSortState = (props, state, _ref) => {
|
|
|
57
54
|
const nextSortDirection = getNextSortDirection(key, sortHeaderKey, sortDirection);
|
|
58
55
|
return getSortedState(props, state, key, nextSortDirection);
|
|
59
56
|
};
|
|
57
|
+
|
|
60
58
|
/**
|
|
61
59
|
* Derive the set of sorted state fields from props and state for the given
|
|
62
60
|
* header key and sortDirection
|
|
@@ -75,7 +73,6 @@ const getNextSortState = (props, state, _ref) => {
|
|
|
75
73
|
* @param {string} sortDirection The sortState that we want to order by
|
|
76
74
|
* @returns {object}
|
|
77
75
|
*/
|
|
78
|
-
|
|
79
76
|
const getSortedState = (props, state, key, sortDirection) => {
|
|
80
77
|
const {
|
|
81
78
|
rowIds,
|
|
@@ -24,11 +24,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
24
24
|
* @param {object} cellsById object containing lookups for cells by id
|
|
25
25
|
*/
|
|
26
26
|
const denormalize = (rowIds, rowsById, cellsById) => {
|
|
27
|
-
return rowIds.map(id => ({
|
|
27
|
+
return rowIds.map(id => ({
|
|
28
|
+
...rowsById[id],
|
|
28
29
|
cells: rowsById[id].cells.map(cellId => cellsById[cellId])
|
|
29
30
|
}));
|
|
30
31
|
};
|
|
31
|
-
|
|
32
32
|
var denormalize$1 = denormalize;
|
|
33
33
|
|
|
34
34
|
exports["default"] = denormalize$1;
|
|
@@ -36,11 +36,9 @@ const defaultFilterRows = _ref => {
|
|
|
36
36
|
key
|
|
37
37
|
} = _ref2;
|
|
38
38
|
const id = getCellId(rowId, key);
|
|
39
|
-
|
|
40
39
|
if (typeof cellsById[id].value === 'boolean') {
|
|
41
40
|
return false;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
42
|
return ('' + cellsById[id].value).toLowerCase().includes(inputValue.toLowerCase());
|
|
45
43
|
}));
|
|
46
44
|
};
|
|
@@ -18,7 +18,6 @@ var cells = require('./cells.js');
|
|
|
18
18
|
* @param {Array<object>} headers
|
|
19
19
|
* @returns {object}
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
21
|
const normalize = function (rows, headers) {
|
|
23
22
|
let prevState = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
24
23
|
const {
|
|
@@ -28,9 +27,9 @@ const normalize = function (rows, headers) {
|
|
|
28
27
|
const rowsById = {};
|
|
29
28
|
const cellsById = {};
|
|
30
29
|
rows.forEach((row, i) => {
|
|
31
|
-
rowIds[i] = row.id;
|
|
30
|
+
rowIds[i] = row.id;
|
|
31
|
+
// Initialize the row info and state values, namely for selection and
|
|
32
32
|
// expansion
|
|
33
|
-
|
|
34
33
|
const {
|
|
35
34
|
id,
|
|
36
35
|
isSelected = false,
|
|
@@ -43,20 +42,20 @@ const normalize = function (rows, headers) {
|
|
|
43
42
|
isExpanded,
|
|
44
43
|
disabled,
|
|
45
44
|
cells: new Array(headers.length)
|
|
46
|
-
};
|
|
47
|
-
// then we'll set the state values of the row to the previous state values.
|
|
45
|
+
};
|
|
48
46
|
|
|
47
|
+
// If we have a previous state, and the row existed in that previous state,
|
|
48
|
+
// then we'll set the state values of the row to the previous state values.
|
|
49
49
|
if (prevRowsByIds && prevRowsByIds[row.id] !== undefined) {
|
|
50
50
|
rowsById[row.id].isSelected = prevRowsByIds[row.id].isSelected;
|
|
51
51
|
rowsById[row.id].isExpanded = prevRowsByIds[row.id].isExpanded;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
53
|
headers.forEach((_ref, i) => {
|
|
55
54
|
let {
|
|
56
55
|
key
|
|
57
56
|
} = _ref;
|
|
58
|
-
const id = cells.getCellId(row.id, key);
|
|
59
|
-
|
|
57
|
+
const id = cells.getCellId(row.id, key);
|
|
58
|
+
// Initialize the cell info and state values, namely for editing
|
|
60
59
|
cellsById[id] = {
|
|
61
60
|
id,
|
|
62
61
|
value: row[key],
|
|
@@ -67,7 +66,9 @@ const normalize = function (rows, headers) {
|
|
|
67
66
|
info: {
|
|
68
67
|
header: key
|
|
69
68
|
}
|
|
70
|
-
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// TODO: When working on inline edits, we'll need to derive the state
|
|
71
72
|
// values similarly to rows above.
|
|
72
73
|
|
|
73
74
|
rowsById[row.id].cells[i] = id;
|
|
@@ -79,7 +80,6 @@ const normalize = function (rows, headers) {
|
|
|
79
80
|
cellsById
|
|
80
81
|
};
|
|
81
82
|
};
|
|
82
|
-
|
|
83
83
|
var normalize$1 = normalize;
|
|
84
84
|
|
|
85
85
|
exports["default"] = normalize$1;
|
|
@@ -23,30 +23,27 @@ var sortStates = require('../state/sortStates.js');
|
|
|
23
23
|
* @param {string} locale
|
|
24
24
|
* @returns {number}
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
26
|
const compare = function (a, b) {
|
|
28
27
|
let locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';
|
|
29
28
|
// prevent multiple null values in one column (sorting breaks)
|
|
30
29
|
a === null ? a = '' : null;
|
|
31
30
|
b === null ? b = '' : null;
|
|
32
|
-
|
|
33
31
|
if (typeof a === 'number' && typeof b === 'number') {
|
|
34
32
|
return a - b;
|
|
35
33
|
}
|
|
36
|
-
|
|
37
34
|
if (typeof a === 'string' && typeof b === 'string') {
|
|
38
35
|
return compareStrings(a, b, locale);
|
|
39
|
-
}
|
|
40
|
-
|
|
36
|
+
}
|
|
41
37
|
|
|
38
|
+
// if column has React elements, this should sort by the child string if there is one
|
|
42
39
|
if (typeof a === 'object' && typeof b === 'object') {
|
|
43
40
|
if (typeof a.props.children === 'string' && typeof b.props.children === 'string') {
|
|
44
41
|
return compareStrings(a.props.children, b.props.children, locale);
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
|
|
48
44
|
return compareStrings('' + a, '' + b, locale);
|
|
49
45
|
};
|
|
46
|
+
|
|
50
47
|
/**
|
|
51
48
|
* Use the built-in `localeCompare` function available on strings to compare two
|
|
52
49
|
* strings.
|
|
@@ -56,20 +53,18 @@ const compare = function (a, b) {
|
|
|
56
53
|
* @param {string} locale
|
|
57
54
|
* @returns {number}
|
|
58
55
|
*/
|
|
59
|
-
|
|
60
56
|
const compareStrings = function (a, b) {
|
|
61
57
|
let locale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en';
|
|
62
|
-
|
|
63
58
|
// Only set `numeric: true` if the string only contains numbers
|
|
64
59
|
// https://stackoverflow.com/a/175787
|
|
65
|
-
if (!isNaN(a) && !isNaN(parseFloat(a))) {
|
|
60
|
+
if (!isNaN(a) && !isNaN(parseFloat(a)) && !isNaN(b) && !isNaN(parseFloat(b))) {
|
|
66
61
|
return a.localeCompare(b, locale, {
|
|
67
62
|
numeric: true
|
|
68
63
|
});
|
|
69
64
|
}
|
|
70
|
-
|
|
71
65
|
return a.localeCompare(b, locale);
|
|
72
66
|
};
|
|
67
|
+
|
|
73
68
|
/**
|
|
74
69
|
* Default implementation of how we sort rows internally. The idea behind this
|
|
75
70
|
* implementation is to use the given list of row ids to look up the cells in
|
|
@@ -89,7 +84,6 @@ const compareStrings = function (a, b) {
|
|
|
89
84
|
* @param {Function} config.sortRow
|
|
90
85
|
* @returns {Array[string]} array of sorted rowIds
|
|
91
86
|
*/
|
|
92
|
-
|
|
93
87
|
const sortRows = _ref => {
|
|
94
88
|
let {
|
|
95
89
|
rowIds,
|
|
@@ -118,11 +112,9 @@ const defaultSortRow = (cellA, cellB, _ref2) => {
|
|
|
118
112
|
sortStates,
|
|
119
113
|
locale
|
|
120
114
|
} = _ref2;
|
|
121
|
-
|
|
122
115
|
if (sortDirection === sortStates.ASC) {
|
|
123
116
|
return compare(cellA, cellB, locale);
|
|
124
117
|
}
|
|
125
|
-
|
|
126
118
|
return compare(cellB, cellA, locale);
|
|
127
119
|
};
|
|
128
120
|
|
|
@@ -22,7 +22,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
22
22
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
23
23
|
|
|
24
24
|
var _span, _span2;
|
|
25
|
-
|
|
26
25
|
const DataTableSkeleton = _ref => {
|
|
27
26
|
let {
|
|
28
27
|
headers,
|
|
@@ -47,7 +46,6 @@ const DataTableSkeleton = _ref => {
|
|
|
47
46
|
const columnsArray = Array.from({
|
|
48
47
|
length: columnCount
|
|
49
48
|
}, (_, index) => index);
|
|
50
|
-
|
|
51
49
|
for (let i = 0; i < rowRepeat; i++) {
|
|
52
50
|
rows[i] = /*#__PURE__*/React__default["default"].createElement("tr", {
|
|
53
51
|
key: i
|
|
@@ -55,7 +53,6 @@ const DataTableSkeleton = _ref => {
|
|
|
55
53
|
key: j
|
|
56
54
|
}, _span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null)))));
|
|
57
55
|
}
|
|
58
|
-
|
|
59
56
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
60
57
|
className: `${prefix}--skeleton ${prefix}--data-table-container`
|
|
61
58
|
}, showHeader ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -73,56 +70,44 @@ const DataTableSkeleton = _ref => {
|
|
|
73
70
|
className: `${prefix}--skeleton ${prefix}--btn ${prefix}--btn--sm`
|
|
74
71
|
}))) : null, /*#__PURE__*/React__default["default"].createElement("table", _rollupPluginBabelHelpers["extends"]({
|
|
75
72
|
className: dataTableSkeletonClasses
|
|
76
|
-
}, rest), /*#__PURE__*/React__default["default"].createElement("thead", null, /*#__PURE__*/React__default["default"].createElement("tr", null, columnsArray.map(i => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}, headers ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
82
|
-
className: "bx--table-header-label"
|
|
83
|
-
}, (_headers$i = headers[i]) === null || _headers$i === void 0 ? void 0 : _headers$i.header) : _span2 || (_span2 = /*#__PURE__*/React__default["default"].createElement("span", null)));
|
|
84
|
-
}))), /*#__PURE__*/React__default["default"].createElement("tbody", null, rows)));
|
|
73
|
+
}, rest), /*#__PURE__*/React__default["default"].createElement("thead", null, /*#__PURE__*/React__default["default"].createElement("tr", null, columnsArray.map(i => /*#__PURE__*/React__default["default"].createElement("th", {
|
|
74
|
+
key: i
|
|
75
|
+
}, headers ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
76
|
+
className: "bx--table-header-label"
|
|
77
|
+
}, headers[i]?.header) : _span2 || (_span2 = /*#__PURE__*/React__default["default"].createElement("span", null)))))), /*#__PURE__*/React__default["default"].createElement("tbody", null, rows)));
|
|
85
78
|
};
|
|
86
|
-
|
|
87
79
|
DataTableSkeleton.propTypes = {
|
|
88
80
|
/**
|
|
89
81
|
* Specify an optional className to add.
|
|
90
82
|
*/
|
|
91
83
|
className: PropTypes__default["default"].string,
|
|
92
|
-
|
|
93
84
|
/**
|
|
94
85
|
* Specify the number of columns that you want to render in the skeleton state
|
|
95
86
|
*/
|
|
96
87
|
columnCount: PropTypes__default["default"].number,
|
|
97
|
-
|
|
98
88
|
/**
|
|
99
89
|
* Optionally specify whether you want the Skeleton to be rendered as a
|
|
100
90
|
* compact DataTable
|
|
101
91
|
*/
|
|
102
92
|
compact: PropTypes__default["default"].bool,
|
|
103
|
-
|
|
104
93
|
/**
|
|
105
94
|
* Optionally specify the displayed headers
|
|
106
95
|
*/
|
|
107
96
|
headers: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array, PropTypes__default["default"].shape({
|
|
108
97
|
key: PropTypes__default["default"].string
|
|
109
98
|
})]),
|
|
110
|
-
|
|
111
99
|
/**
|
|
112
100
|
* Specify the number of rows that you want to render in the skeleton state
|
|
113
101
|
*/
|
|
114
102
|
rowCount: PropTypes__default["default"].number,
|
|
115
|
-
|
|
116
103
|
/**
|
|
117
104
|
* Specify if the table header should be rendered as part of the skeleton.
|
|
118
105
|
*/
|
|
119
106
|
showHeader: PropTypes__default["default"].bool,
|
|
120
|
-
|
|
121
107
|
/**
|
|
122
108
|
* Specify if the table toolbar should be rendered as part of the skeleton.
|
|
123
109
|
*/
|
|
124
110
|
showToolbar: PropTypes__default["default"].bool,
|
|
125
|
-
|
|
126
111
|
/**
|
|
127
112
|
* Optionally specify whether you want the DataTable to be zebra striped
|
|
128
113
|
*/
|
|
@@ -33,7 +33,6 @@ const DatePickerSkeleton = _ref => {
|
|
|
33
33
|
className: `${prefix}--date-picker-container`
|
|
34
34
|
},
|
|
35
35
|
/*#__PURE__*/
|
|
36
|
-
|
|
37
36
|
/* eslint-disable jsx-a11y/label-has-for,jsx-a11y/label-has-associated-control */
|
|
38
37
|
React__default["default"].createElement("label", {
|
|
39
38
|
className: `${prefix}--label`,
|
|
@@ -41,7 +40,6 @@ const DatePickerSkeleton = _ref => {
|
|
|
41
40
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
42
41
|
className: `${prefix}--date-picker__input ${prefix}--skeleton`
|
|
43
42
|
}));
|
|
44
|
-
|
|
45
43
|
if (range) {
|
|
46
44
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
47
45
|
className: `${prefix}--form-item`
|
|
@@ -49,25 +47,21 @@ const DatePickerSkeleton = _ref => {
|
|
|
49
47
|
className: cx__default["default"](`${prefix}--date-picker`, `${prefix}--date-picker--range`, `${prefix}--skeleton`, className)
|
|
50
48
|
}, rest), dateInput, dateInput));
|
|
51
49
|
}
|
|
52
|
-
|
|
53
50
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
54
51
|
className: `${prefix}--form-item`
|
|
55
52
|
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
56
53
|
className: cx__default["default"](`${prefix}--date-picker`, `${prefix}--date-picker--short`, `${prefix}--date-picker--simple`, `${prefix}--skeleton`, className)
|
|
57
54
|
}, rest), dateInput));
|
|
58
55
|
};
|
|
59
|
-
|
|
60
56
|
DatePickerSkeleton.propTypes = {
|
|
61
57
|
/**
|
|
62
58
|
* Specify an optional className to add.
|
|
63
59
|
*/
|
|
64
60
|
className: PropTypes__default["default"].string,
|
|
65
|
-
|
|
66
61
|
/**
|
|
67
62
|
* Specify the id to add.
|
|
68
63
|
*/
|
|
69
64
|
id: PropTypes__default["default"].string,
|
|
70
|
-
|
|
71
65
|
/**
|
|
72
66
|
* Specify whether the skeleton should be of range date picker.
|
|
73
67
|
*/
|