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