@carbon/react 1.29.0 → 1.30.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +154 -177
- 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 +1 -11
- package/es/components/FileUploader/Filename.js +0 -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 +0 -43
- 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 +1 -2
- 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 +154 -177
- 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 +1 -30
- package/lib/components/FileUploader/Filename.js +0 -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 +0 -43
- 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 +1 -2
- 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
|
@@ -27,7 +27,6 @@ import { Escape, ArrowDown } from '../../internal/keyboard/keys.js';
|
|
|
27
27
|
// Weekdays shorthand for english locale
|
|
28
28
|
l10n.en.weekdays.shorthand.forEach((_day, index) => {
|
|
29
29
|
const currentDay = l10n.en.weekdays.shorthand;
|
|
30
|
-
|
|
31
30
|
if (currentDay[index] === 'Thu' || currentDay[index] === 'Th') {
|
|
32
31
|
currentDay[index] = 'Th';
|
|
33
32
|
} else {
|
|
@@ -35,14 +34,15 @@ l10n.en.weekdays.shorthand.forEach((_day, index) => {
|
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
const forEach = Array.prototype.forEach;
|
|
37
|
+
|
|
38
38
|
/**
|
|
39
39
|
* @param {number} monthNumber The month number.
|
|
40
40
|
* @param {boolean} shorthand `true` to use shorthand month.
|
|
41
41
|
* @param {Locale} locale The Flatpickr locale data.
|
|
42
42
|
* @returns {string} The month string.
|
|
43
43
|
*/
|
|
44
|
-
|
|
45
44
|
const monthToStr = (monthNumber, shorthand, locale) => locale.months[shorthand ? 'shorthand' : 'longhand'][monthNumber];
|
|
45
|
+
|
|
46
46
|
/**
|
|
47
47
|
* @param {object} config Plugin configuration.
|
|
48
48
|
* @param {boolean} [config.shorthand] `true` to use shorthand month.
|
|
@@ -52,31 +52,25 @@ const monthToStr = (monthNumber, shorthand, locale) => locale.months[shorthand ?
|
|
|
52
52
|
* @param {string} config.classFlatpickrCurrentMonth The CSS class for the text-based month selection UI.
|
|
53
53
|
* @returns {Plugin} A Flatpickr plugin to use text instead of `<select>` for month picker.
|
|
54
54
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
55
|
const carbonFlatpickrMonthSelectPlugin = config => fp => {
|
|
58
56
|
const setupElements = () => {
|
|
59
57
|
if (!fp.monthElements) {
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
62
|
-
|
|
63
60
|
fp.monthElements.forEach(elem => {
|
|
64
61
|
if (!elem.parentNode) {
|
|
65
62
|
return;
|
|
66
63
|
}
|
|
67
|
-
|
|
68
64
|
elem.parentNode.removeChild(elem);
|
|
69
65
|
});
|
|
70
66
|
fp.monthElements.splice(0, fp.monthElements.length, ...fp.monthElements.map(() => {
|
|
71
67
|
// eslint-disable-next-line no-underscore-dangle
|
|
72
68
|
const monthElement = fp._createElement('span', config.classFlatpickrCurrentMonth);
|
|
73
|
-
|
|
74
69
|
monthElement.textContent = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
|
|
75
70
|
fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
|
|
76
71
|
return monthElement;
|
|
77
72
|
}));
|
|
78
73
|
};
|
|
79
|
-
|
|
80
74
|
const updateCurrentMonth = () => {
|
|
81
75
|
if (fp.monthElements) {
|
|
82
76
|
const monthStr = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
|
|
@@ -88,11 +82,9 @@ const carbonFlatpickrMonthSelectPlugin = config => fp => {
|
|
|
88
82
|
});
|
|
89
83
|
}
|
|
90
84
|
};
|
|
91
|
-
|
|
92
85
|
const register = () => {
|
|
93
86
|
fp.loadedPlugins.push('carbonFlatpickrMonthSelectPlugin');
|
|
94
87
|
};
|
|
95
|
-
|
|
96
88
|
return {
|
|
97
89
|
onMonthChange: updateCurrentMonth,
|
|
98
90
|
onValueUpdate: updateCurrentMonth,
|
|
@@ -100,28 +92,24 @@ const carbonFlatpickrMonthSelectPlugin = config => fp => {
|
|
|
100
92
|
onReady: [setupElements, updateCurrentMonth, register]
|
|
101
93
|
};
|
|
102
94
|
};
|
|
95
|
+
|
|
103
96
|
/**
|
|
104
97
|
* Determine if every child in a list of children has no label specified
|
|
105
98
|
* @param {Array<ReactElement>} children
|
|
106
99
|
* @returns {boolean}
|
|
107
100
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
101
|
function isLabelTextEmpty(children) {
|
|
111
102
|
return children.every(child => !child.props.labelText);
|
|
112
103
|
}
|
|
113
|
-
|
|
114
104
|
const rightArrowHTML = `<svg width="16px" height="16px" viewBox="0 0 16 16">
|
|
115
105
|
<polygon points="11,8 6,13 5.3,12.3 9.6,8 5.3,3.7 6,3 "/>
|
|
116
106
|
</svg>`;
|
|
117
107
|
const leftArrowHTML = `<svg width="16px" height="16px" viewBox="0 0 16 16">
|
|
118
108
|
<polygon points="5,8 10,3 10.7,3.7 6.4,8 10.7,12.3 10,13 "/>
|
|
119
109
|
</svg>`;
|
|
120
|
-
|
|
121
110
|
function updateClassNames(calendar, prefix) {
|
|
122
111
|
const calendarContainer = calendar.calendarContainer;
|
|
123
112
|
const daysContainer = calendar.days;
|
|
124
|
-
|
|
125
113
|
if (calendarContainer && daysContainer) {
|
|
126
114
|
// calendarContainer and daysContainer are undefined if flatpickr detects a mobile device
|
|
127
115
|
calendarContainer.classList.add(`${prefix}--date-picker__calendar`);
|
|
@@ -135,7 +123,6 @@ function updateClassNames(calendar, prefix) {
|
|
|
135
123
|
});
|
|
136
124
|
forEach.call(daysContainer.querySelectorAll('.flatpickr-day'), item => {
|
|
137
125
|
item.classList.add(`${prefix}--date-picker__day`);
|
|
138
|
-
|
|
139
126
|
if (item.classList.contains('today') && calendar.selectedDates.length > 0) {
|
|
140
127
|
item.classList.add('no-border');
|
|
141
128
|
} else if (item.classList.contains('today') && calendar.selectedDates.length === 0) {
|
|
@@ -144,7 +131,6 @@ function updateClassNames(calendar, prefix) {
|
|
|
144
131
|
});
|
|
145
132
|
}
|
|
146
133
|
}
|
|
147
|
-
|
|
148
134
|
const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_ref, ref) {
|
|
149
135
|
let {
|
|
150
136
|
allowInput,
|
|
@@ -184,29 +170,25 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
184
170
|
setHasInput(true);
|
|
185
171
|
}
|
|
186
172
|
}, []);
|
|
187
|
-
const lastStartValue = useRef('');
|
|
173
|
+
const lastStartValue = useRef('');
|
|
188
174
|
|
|
175
|
+
// fix datepicker deleting the selectedDate when the calendar closes
|
|
189
176
|
const onCalendarClose = (selectedDates, dateStr) => {
|
|
190
177
|
setTimeout(() => {
|
|
191
178
|
if (lastStartValue.current && selectedDates[0] && !startInputField.current.value) {
|
|
192
|
-
var _endInputField$curren;
|
|
193
|
-
|
|
194
179
|
startInputField.current.value = lastStartValue.current;
|
|
195
|
-
calendarRef.current.setDate([startInputField.current.value, endInputField
|
|
180
|
+
calendarRef.current.setDate([startInputField.current.value, endInputField?.current?.value], true, calendarRef.current.config.dateFormat);
|
|
196
181
|
}
|
|
197
|
-
|
|
198
182
|
if (onClose) {
|
|
199
183
|
onClose(calendarRef.current.selectedDates, dateStr, calendarRef.current);
|
|
200
184
|
}
|
|
201
185
|
});
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
|
|
186
|
+
};
|
|
205
187
|
const endInputField = useRef(null);
|
|
206
188
|
const calendarRef = useRef(null);
|
|
207
|
-
const savedOnChange = useSavedCallback(
|
|
189
|
+
const savedOnChange = useSavedCallback(onChange);
|
|
208
190
|
const savedOnClose = useSavedCallback(datePickerType === 'range' ? onCalendarClose : onClose);
|
|
209
|
-
const savedOnOpen = useSavedCallback(
|
|
191
|
+
const savedOnOpen = useSavedCallback(onOpen);
|
|
210
192
|
const datePickerClasses = cx(`${prefix}--date-picker`, {
|
|
211
193
|
[`${prefix}--date-picker--short`]: short,
|
|
212
194
|
[`${prefix}--date-picker--light`]: light,
|
|
@@ -226,7 +208,6 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
226
208
|
readOnly
|
|
227
209
|
});
|
|
228
210
|
}
|
|
229
|
-
|
|
230
211
|
if (index === 1 && child.type === React__default.createElement(DatePickerInput, child.props).type) {
|
|
231
212
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
232
213
|
datePickerType,
|
|
@@ -234,14 +215,12 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
234
215
|
readOnly
|
|
235
216
|
});
|
|
236
217
|
}
|
|
237
|
-
|
|
238
218
|
if (index === 0) {
|
|
239
219
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
240
220
|
ref: startInputField,
|
|
241
221
|
readOnly
|
|
242
222
|
});
|
|
243
223
|
}
|
|
244
|
-
|
|
245
224
|
if (index === 1) {
|
|
246
225
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
247
226
|
ref: endInputField,
|
|
@@ -253,28 +232,23 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
253
232
|
if (datePickerType !== 'single' && datePickerType !== 'range') {
|
|
254
233
|
return;
|
|
255
234
|
}
|
|
256
|
-
|
|
257
235
|
if (!startInputField.current) {
|
|
258
236
|
return;
|
|
259
237
|
}
|
|
260
|
-
|
|
261
238
|
const onHook = (_electedDates, _dateStr, instance, prefix) => {
|
|
262
239
|
updateClassNames(instance, prefix);
|
|
263
|
-
|
|
264
|
-
if (startInputField !== null && startInputField !== void 0 && startInputField.current) {
|
|
240
|
+
if (startInputField?.current) {
|
|
265
241
|
startInputField.current.readOnly = readOnly;
|
|
266
242
|
}
|
|
267
|
-
|
|
268
|
-
if (endInputField !== null && endInputField !== void 0 && endInputField.current) {
|
|
243
|
+
if (endInputField?.current) {
|
|
269
244
|
endInputField.current.readOnly = readOnly;
|
|
270
245
|
}
|
|
271
|
-
};
|
|
272
|
-
// is provided, we return the default empty disabled array, allowing all dates.
|
|
273
|
-
|
|
246
|
+
};
|
|
274
247
|
|
|
248
|
+
// Logic to determine if `enable` or `disable` will be passed down. If neither
|
|
249
|
+
// is provided, we return the default empty disabled array, allowing all dates.
|
|
275
250
|
const enableOrDisable = enable ? 'enable' : 'disable';
|
|
276
251
|
let enableOrDisableArr;
|
|
277
|
-
|
|
278
252
|
if (!enable && !disable) {
|
|
279
253
|
enableOrDisableArr = [];
|
|
280
254
|
} else if (enable) {
|
|
@@ -282,18 +256,16 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
282
256
|
} else {
|
|
283
257
|
enableOrDisableArr = disable;
|
|
284
258
|
}
|
|
285
|
-
|
|
286
259
|
let localeData;
|
|
287
|
-
|
|
288
260
|
if (typeof locale === 'object') {
|
|
289
261
|
const location = locale.locale ? locale.locale : 'en';
|
|
290
|
-
localeData = {
|
|
262
|
+
localeData = {
|
|
263
|
+
...l10n[location],
|
|
291
264
|
...locale
|
|
292
265
|
};
|
|
293
266
|
} else {
|
|
294
267
|
localeData = l10n[locale];
|
|
295
268
|
}
|
|
296
|
-
|
|
297
269
|
const {
|
|
298
270
|
current: start
|
|
299
271
|
} = startInputField;
|
|
@@ -347,12 +319,10 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
347
319
|
};
|
|
348
320
|
const calendar = flatpickr(start, flatpickerconfig);
|
|
349
321
|
calendarRef.current = calendar;
|
|
350
|
-
|
|
351
322
|
function handleArrowDown(event) {
|
|
352
323
|
if (match(event, Escape)) {
|
|
353
324
|
calendar.calendarContainer.classList.remove('open');
|
|
354
325
|
}
|
|
355
|
-
|
|
356
326
|
if (match(event, ArrowDown)) {
|
|
357
327
|
const {
|
|
358
328
|
calendarContainer,
|
|
@@ -364,156 +334,127 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
364
334
|
(selectedDateElem || todayDateElem || calendarContainer.querySelector('.flatpickr-day[tabindex]') || calendarContainer).focus();
|
|
365
335
|
}
|
|
366
336
|
}
|
|
367
|
-
|
|
368
337
|
function handleOnChange(event) {
|
|
369
338
|
if (datePickerType == 'single') {
|
|
370
339
|
calendar.calendarContainer.classList.remove('open');
|
|
371
340
|
}
|
|
372
|
-
|
|
373
341
|
const {
|
|
374
342
|
target
|
|
375
343
|
} = event;
|
|
376
|
-
|
|
377
344
|
if (target === start) {
|
|
378
345
|
lastStartValue.current = start.value;
|
|
379
346
|
}
|
|
380
|
-
|
|
381
347
|
if (start.value !== '') {
|
|
382
348
|
return;
|
|
383
349
|
}
|
|
384
|
-
|
|
385
350
|
if (!calendar.selectedDates) {
|
|
386
351
|
return;
|
|
387
352
|
}
|
|
388
|
-
|
|
389
353
|
if (calendar.selectedDates.length === 0) {
|
|
390
354
|
return;
|
|
391
355
|
}
|
|
392
|
-
|
|
393
356
|
calendar.clear();
|
|
394
357
|
calendar.input.focus();
|
|
395
358
|
}
|
|
396
|
-
|
|
397
359
|
if (start) {
|
|
398
360
|
start.addEventListener('keydown', handleArrowDown);
|
|
399
361
|
start.addEventListener('change', handleOnChange);
|
|
400
|
-
|
|
401
362
|
if (calendar && calendar.calendarContainer) {
|
|
402
363
|
// Flatpickr's calendar dialog is not rendered in a landmark causing an
|
|
403
364
|
// error with IBM Equal Access Accessibility Checker so we add an aria
|
|
404
365
|
// role to the container div.
|
|
405
|
-
calendar.calendarContainer.setAttribute('role', 'application');
|
|
406
|
-
|
|
366
|
+
calendar.calendarContainer.setAttribute('role', 'application');
|
|
367
|
+
// IBM EAAC requires an aria-label on a role='region'
|
|
407
368
|
calendar.calendarContainer.setAttribute('aria-label', 'calendar-container');
|
|
408
369
|
}
|
|
409
370
|
}
|
|
410
|
-
|
|
411
371
|
if (end) {
|
|
412
372
|
end.addEventListener('keydown', handleArrowDown);
|
|
413
373
|
end.addEventListener('change', handleOnChange);
|
|
414
|
-
}
|
|
415
|
-
|
|
374
|
+
}
|
|
416
375
|
|
|
376
|
+
//component did unmount equivalent
|
|
417
377
|
return () => {
|
|
418
378
|
// Note: if the `startInputField` ref is undefined then calendar will be
|
|
419
379
|
// of type: Array and `destroy` will not be defined
|
|
420
380
|
if (calendar && calendar.destroy) {
|
|
421
381
|
calendar.destroy();
|
|
422
|
-
}
|
|
423
|
-
|
|
382
|
+
}
|
|
424
383
|
|
|
384
|
+
// prevent a duplicate date selection when a default value is set
|
|
425
385
|
if (value) {
|
|
426
|
-
if (startInputField
|
|
386
|
+
if (startInputField?.current) {
|
|
427
387
|
startInputField.current.value = '';
|
|
428
388
|
}
|
|
429
|
-
|
|
430
|
-
if (endInputField !== null && endInputField !== void 0 && endInputField.current) {
|
|
389
|
+
if (endInputField?.current) {
|
|
431
390
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
432
391
|
endInputField.current.value = '';
|
|
433
392
|
}
|
|
434
393
|
}
|
|
435
|
-
|
|
436
394
|
if (start) {
|
|
437
395
|
start.removeEventListener('keydown', handleArrowDown);
|
|
438
396
|
start.removeEventListener('change', handleOnChange);
|
|
439
397
|
}
|
|
440
|
-
|
|
441
398
|
if (end) {
|
|
442
399
|
end.removeEventListener('keydown', handleArrowDown);
|
|
443
400
|
end.removeEventListener('change', handleOnChange);
|
|
444
401
|
}
|
|
445
402
|
};
|
|
446
403
|
}, [savedOnChange, savedOnClose, savedOnOpen, readOnly, hasInput]); //eslint-disable-line react-hooks/exhaustive-deps
|
|
404
|
+
|
|
447
405
|
// this hook allows consumers to access the flatpickr calendar
|
|
448
406
|
// instance for cases where functions like open() or close()
|
|
449
407
|
// need to be imperatively called on the calendar
|
|
450
|
-
|
|
451
408
|
useImperativeHandle(ref, () => ({
|
|
452
409
|
get calendar() {
|
|
453
410
|
return calendarRef.current;
|
|
454
411
|
}
|
|
455
|
-
|
|
456
412
|
}));
|
|
457
413
|
useEffect(() => {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current = calendarRef.current) !== null && _calendarRef$current !== void 0 && _calendarRef$current.set) {
|
|
414
|
+
if (calendarRef?.current?.set) {
|
|
461
415
|
calendarRef.current.set({
|
|
462
416
|
dateFormat
|
|
463
417
|
});
|
|
464
418
|
}
|
|
465
419
|
}, [dateFormat]);
|
|
466
420
|
useEffect(() => {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current2 = calendarRef.current) !== null && _calendarRef$current2 !== void 0 && _calendarRef$current2.set) {
|
|
421
|
+
if (calendarRef?.current?.set) {
|
|
470
422
|
calendarRef.current.set('minDate', minDate);
|
|
471
423
|
}
|
|
472
424
|
}, [minDate]);
|
|
473
425
|
useEffect(() => {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current3 = calendarRef.current) !== null && _calendarRef$current3 !== void 0 && _calendarRef$current3.set) {
|
|
426
|
+
if (calendarRef?.current?.set) {
|
|
477
427
|
calendarRef.current.set('maxDate', maxDate);
|
|
478
428
|
}
|
|
479
429
|
}, [maxDate]);
|
|
480
430
|
useEffect(() => {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current4 = calendarRef.current) !== null && _calendarRef$current4 !== void 0 && _calendarRef$current4.set && disable) {
|
|
431
|
+
if (calendarRef?.current?.set && disable) {
|
|
484
432
|
calendarRef.current.set('disable', disable);
|
|
485
433
|
}
|
|
486
434
|
}, [disable]);
|
|
487
435
|
useEffect(() => {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current5 = calendarRef.current) !== null && _calendarRef$current5 !== void 0 && _calendarRef$current5.set && enable) {
|
|
436
|
+
if (calendarRef?.current?.set && enable) {
|
|
491
437
|
calendarRef.current.set('enable', enable);
|
|
492
438
|
}
|
|
493
439
|
}, [enable]);
|
|
494
440
|
useEffect(() => {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current6 = calendarRef.current) !== null && _calendarRef$current6 !== void 0 && _calendarRef$current6.set && inline) {
|
|
441
|
+
if (calendarRef?.current?.set && inline) {
|
|
498
442
|
calendarRef.current.set('inline', inline);
|
|
499
443
|
}
|
|
500
444
|
}, [inline]);
|
|
501
445
|
useEffect(() => {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current7 = calendarRef.current) !== null && _calendarRef$current7 !== void 0 && _calendarRef$current7.set) {
|
|
446
|
+
if (calendarRef?.current?.set) {
|
|
505
447
|
if (value !== undefined) {
|
|
506
448
|
calendarRef.current.setDate(value);
|
|
507
449
|
}
|
|
508
|
-
|
|
509
|
-
|
|
450
|
+
updateClassNames(calendarRef.current, prefix);
|
|
451
|
+
//for simple date picker w/o calendar; initial mount may not have value
|
|
510
452
|
} else if (!calendarRef.current && value) {
|
|
511
453
|
startInputField.current.value = value;
|
|
512
454
|
}
|
|
513
455
|
}, [value, prefix]); //eslint-disable-line react-hooks/exhaustive-deps
|
|
514
456
|
|
|
515
457
|
let fluidError;
|
|
516
|
-
|
|
517
458
|
if (isFluid) {
|
|
518
459
|
if (invalid) {
|
|
519
460
|
fluidError = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
@@ -524,7 +465,6 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
524
465
|
className: `${prefix}--form-requirement`
|
|
525
466
|
}, invalidText));
|
|
526
467
|
}
|
|
527
|
-
|
|
528
468
|
if (warn && !invalid) {
|
|
529
469
|
fluidError = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(WarningAltFilled, {
|
|
530
470
|
className: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--warn`
|
|
@@ -535,7 +475,6 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
535
475
|
}, warnText));
|
|
536
476
|
}
|
|
537
477
|
}
|
|
538
|
-
|
|
539
478
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
540
479
|
className: wrapperClasses,
|
|
541
480
|
ref: ref
|
|
@@ -549,32 +488,26 @@ DatePicker.propTypes = {
|
|
|
549
488
|
* into the input field
|
|
550
489
|
*/
|
|
551
490
|
allowInput: PropTypes.bool,
|
|
552
|
-
|
|
553
491
|
/**
|
|
554
492
|
* The DOM element the Flatpicker should be inserted into. `<body>` by default.
|
|
555
493
|
*/
|
|
556
494
|
appendTo: PropTypes.object,
|
|
557
|
-
|
|
558
495
|
/**
|
|
559
496
|
* The child nodes.
|
|
560
497
|
*/
|
|
561
498
|
children: PropTypes.node,
|
|
562
|
-
|
|
563
499
|
/**
|
|
564
500
|
* The CSS class names.
|
|
565
501
|
*/
|
|
566
502
|
className: PropTypes.string,
|
|
567
|
-
|
|
568
503
|
/**
|
|
569
504
|
* flatpickr prop passthrough. Controls whether the calendar dropdown closes upon selection.
|
|
570
505
|
*/
|
|
571
506
|
closeOnSelect: PropTypes.bool,
|
|
572
|
-
|
|
573
507
|
/**
|
|
574
508
|
* The date format.
|
|
575
509
|
*/
|
|
576
510
|
dateFormat: PropTypes.string,
|
|
577
|
-
|
|
578
511
|
/**
|
|
579
512
|
* The type of the date picker:
|
|
580
513
|
*
|
|
@@ -583,100 +516,153 @@ DatePicker.propTypes = {
|
|
|
583
516
|
* * `range` - With calendar dropdown and a date range.
|
|
584
517
|
*/
|
|
585
518
|
datePickerType: PropTypes.oneOf(['simple', 'single', 'range']),
|
|
586
|
-
|
|
587
519
|
/**
|
|
588
520
|
* The flatpickr `disable` option that allows a user to disable certain dates.
|
|
589
521
|
*/
|
|
590
522
|
disable: PropTypes.array,
|
|
591
|
-
|
|
592
523
|
/**
|
|
593
524
|
* The flatpickr `enable` option that allows a user to enable certain dates.
|
|
594
525
|
*/
|
|
595
526
|
enable: PropTypes.array,
|
|
596
|
-
|
|
597
527
|
/**
|
|
598
528
|
* The flatpickr `inline` option.
|
|
599
529
|
*/
|
|
600
530
|
inline: PropTypes.bool,
|
|
601
|
-
|
|
602
531
|
/**
|
|
603
532
|
* Specify whether or not the control is invalid (Fluid only)
|
|
604
533
|
*/
|
|
605
534
|
invalid: PropTypes.bool,
|
|
606
|
-
|
|
607
535
|
/**
|
|
608
536
|
* Provide the text that is displayed when the control is in error state (Fluid Only)
|
|
609
537
|
*/
|
|
610
538
|
invalidText: PropTypes.node,
|
|
611
|
-
|
|
612
539
|
/**
|
|
613
540
|
* `true` to use the light version.
|
|
614
541
|
*/
|
|
615
542
|
light: deprecate(PropTypes.bool, 'The `light` prop for `DatePicker` has ' + 'been deprecated in favor of the new `Layer` component. It will be removed in the next major release.'),
|
|
616
|
-
|
|
617
543
|
/**
|
|
618
544
|
* The language locale used to format the days of the week, months, and numbers. The full list of supported locales can be found here https://github.com/flatpickr/flatpickr/tree/master/src/l10n
|
|
619
545
|
*/
|
|
620
|
-
locale: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['ar',
|
|
621
|
-
|
|
622
|
-
'
|
|
623
|
-
|
|
624
|
-
'
|
|
625
|
-
|
|
626
|
-
'
|
|
627
|
-
|
|
628
|
-
'
|
|
629
|
-
|
|
630
|
-
'
|
|
631
|
-
|
|
632
|
-
'
|
|
633
|
-
|
|
634
|
-
'
|
|
635
|
-
|
|
636
|
-
'
|
|
637
|
-
|
|
638
|
-
'
|
|
639
|
-
|
|
640
|
-
'
|
|
641
|
-
|
|
642
|
-
'
|
|
643
|
-
|
|
644
|
-
'
|
|
645
|
-
|
|
646
|
-
'
|
|
647
|
-
|
|
648
|
-
'
|
|
649
|
-
|
|
650
|
-
'
|
|
651
|
-
|
|
652
|
-
'
|
|
653
|
-
|
|
654
|
-
'
|
|
655
|
-
|
|
656
|
-
'
|
|
657
|
-
|
|
658
|
-
'
|
|
659
|
-
|
|
660
|
-
'
|
|
661
|
-
|
|
662
|
-
'
|
|
663
|
-
|
|
664
|
-
'
|
|
665
|
-
|
|
666
|
-
'
|
|
667
|
-
|
|
668
|
-
'
|
|
669
|
-
|
|
670
|
-
'
|
|
671
|
-
|
|
672
|
-
'
|
|
673
|
-
|
|
674
|
-
'
|
|
675
|
-
|
|
676
|
-
'
|
|
677
|
-
|
|
678
|
-
'
|
|
679
|
-
|
|
546
|
+
locale: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf(['ar',
|
|
547
|
+
// Arabic
|
|
548
|
+
'at',
|
|
549
|
+
// Austria
|
|
550
|
+
'az',
|
|
551
|
+
// Azerbaijan
|
|
552
|
+
'be',
|
|
553
|
+
// Belarusian
|
|
554
|
+
'bg',
|
|
555
|
+
// Bulgarian
|
|
556
|
+
'bn',
|
|
557
|
+
// Bangla
|
|
558
|
+
'bs',
|
|
559
|
+
// Bosnia
|
|
560
|
+
'cat',
|
|
561
|
+
// Catalan
|
|
562
|
+
'cs',
|
|
563
|
+
// Czech
|
|
564
|
+
'cy',
|
|
565
|
+
// Welsh
|
|
566
|
+
'da',
|
|
567
|
+
// Danish
|
|
568
|
+
'de',
|
|
569
|
+
// German
|
|
570
|
+
'en',
|
|
571
|
+
// English
|
|
572
|
+
'eo',
|
|
573
|
+
// Esperanto
|
|
574
|
+
'es',
|
|
575
|
+
// Spanish
|
|
576
|
+
'et',
|
|
577
|
+
// Estonian
|
|
578
|
+
'fa',
|
|
579
|
+
// Persian
|
|
580
|
+
'fi',
|
|
581
|
+
// Finnish
|
|
582
|
+
'fo',
|
|
583
|
+
// Faroese
|
|
584
|
+
'fr',
|
|
585
|
+
// French
|
|
586
|
+
'ga',
|
|
587
|
+
// Gaelic
|
|
588
|
+
'gr',
|
|
589
|
+
// Greek
|
|
590
|
+
'he',
|
|
591
|
+
// Hebrew
|
|
592
|
+
'hi',
|
|
593
|
+
// Hindi
|
|
594
|
+
'hr',
|
|
595
|
+
// Croatian
|
|
596
|
+
'hu',
|
|
597
|
+
// Hungarian
|
|
598
|
+
'id',
|
|
599
|
+
// Indonesian
|
|
600
|
+
'is',
|
|
601
|
+
// Icelandic
|
|
602
|
+
'it',
|
|
603
|
+
// Italian
|
|
604
|
+
'ja',
|
|
605
|
+
// Japanese
|
|
606
|
+
'ka',
|
|
607
|
+
// Georgian
|
|
608
|
+
'km',
|
|
609
|
+
// Khmer
|
|
610
|
+
'ko',
|
|
611
|
+
// Korean
|
|
612
|
+
'kz',
|
|
613
|
+
// Kazakh
|
|
614
|
+
'lt',
|
|
615
|
+
// Lithuanian
|
|
616
|
+
'lv',
|
|
617
|
+
// Latvian
|
|
618
|
+
'mk',
|
|
619
|
+
// Macedonian
|
|
620
|
+
'mn',
|
|
621
|
+
// Mongolian
|
|
622
|
+
'ms',
|
|
623
|
+
// Malaysian
|
|
624
|
+
'my',
|
|
625
|
+
// Burmese
|
|
626
|
+
'nl',
|
|
627
|
+
// Dutch
|
|
628
|
+
'no',
|
|
629
|
+
// Norwegian
|
|
630
|
+
'pa',
|
|
631
|
+
// Punjabi
|
|
632
|
+
'pl',
|
|
633
|
+
// Polish
|
|
634
|
+
'pt',
|
|
635
|
+
// Portuguese
|
|
636
|
+
'ro',
|
|
637
|
+
// Romanian
|
|
638
|
+
'ru',
|
|
639
|
+
// Russian
|
|
640
|
+
'si',
|
|
641
|
+
// Sinhala
|
|
642
|
+
'sk',
|
|
643
|
+
// Slovak
|
|
644
|
+
'sl',
|
|
645
|
+
// Slovenian
|
|
646
|
+
'sq',
|
|
647
|
+
// Albanian
|
|
648
|
+
'sr',
|
|
649
|
+
// Serbian
|
|
650
|
+
'sv',
|
|
651
|
+
// Swedish
|
|
652
|
+
'th',
|
|
653
|
+
// Thai
|
|
654
|
+
'tr',
|
|
655
|
+
// Turkish
|
|
656
|
+
'uk',
|
|
657
|
+
// Ukrainian
|
|
658
|
+
'uz',
|
|
659
|
+
// Uzbek
|
|
660
|
+
'uz_latn',
|
|
661
|
+
// Uzbek Latin
|
|
662
|
+
'vn',
|
|
663
|
+
// Vietnamese
|
|
664
|
+
'zh_tw',
|
|
665
|
+
// Mandarin Traditional
|
|
680
666
|
'zh' // Mandarin
|
|
681
667
|
])]),
|
|
682
668
|
|
|
@@ -684,50 +670,41 @@ DatePicker.propTypes = {
|
|
|
684
670
|
* The maximum date that a user can pick to.
|
|
685
671
|
*/
|
|
686
672
|
maxDate: PropTypes.string,
|
|
687
|
-
|
|
688
673
|
/**
|
|
689
674
|
* The minimum date that a user can start picking from.
|
|
690
675
|
*/
|
|
691
676
|
minDate: PropTypes.string,
|
|
692
|
-
|
|
693
677
|
/**
|
|
694
678
|
* The `change` event handler.
|
|
695
679
|
*/
|
|
696
680
|
onChange: PropTypes.func,
|
|
697
|
-
|
|
698
681
|
/**
|
|
699
682
|
* The `close` event handler.
|
|
700
683
|
*/
|
|
701
684
|
onClose: PropTypes.func,
|
|
702
|
-
|
|
703
685
|
/**
|
|
704
686
|
* The `open` event handler.
|
|
705
687
|
*/
|
|
706
688
|
onOpen: PropTypes.func,
|
|
707
|
-
|
|
708
689
|
/**
|
|
709
690
|
* whether the DatePicker is to be readOnly
|
|
710
691
|
* if boolean applies to all inputs
|
|
711
692
|
* if array applies to each input in order
|
|
712
693
|
*/
|
|
713
694
|
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.array]),
|
|
714
|
-
|
|
715
695
|
/**
|
|
716
696
|
* `true` to use the short version.
|
|
717
697
|
*/
|
|
718
698
|
short: PropTypes.bool,
|
|
719
|
-
|
|
720
699
|
/**
|
|
721
700
|
* The value of the date value provided to flatpickr, could
|
|
722
701
|
* be a date, a date number, a date string, an array of dates.
|
|
723
702
|
*/
|
|
724
703
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object])), PropTypes.object, PropTypes.number]),
|
|
725
|
-
|
|
726
704
|
/**
|
|
727
705
|
* Specify whether the control is currently in warning state (Fluid only)
|
|
728
706
|
*/
|
|
729
707
|
warn: PropTypes.bool,
|
|
730
|
-
|
|
731
708
|
/**
|
|
732
709
|
* Provide the text that is displayed when the control is in warning state (Fluid only)
|
|
733
710
|
*/
|