@carbon/react 1.29.1 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -7
- package/es/components/Accordion/Accordion.js +1 -8
- package/es/components/Accordion/AccordionItem.js +5 -19
- package/es/components/AspectRatio/AspectRatio.js +0 -5
- package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/es/components/Breadcrumb/Breadcrumb.js +0 -3
- package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/es/components/Button/Button.Skeleton.js +2 -7
- package/es/components/Button/Button.js +2 -36
- package/es/components/ButtonSet/ButtonSet.js +0 -2
- package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/es/components/Checkbox/Checkbox.js +4 -20
- package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/es/components/ClassPrefix/index.d.ts +26 -0
- package/es/components/ClassPrefix/index.js +0 -2
- package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/es/components/CodeSnippet/CodeSnippet.js +6 -45
- package/es/components/ComboBox/ComboBox.js +12 -79
- package/es/components/ComboBox/tools/filter.js +0 -1
- package/es/components/ComboButton/index.js +0 -14
- package/es/components/ComposedModal/ComposedModal.js +2 -32
- package/es/components/ComposedModal/ModalFooter.js +0 -21
- package/es/components/ComposedModal/ModalHeader.js +0 -12
- package/es/components/ContainedList/ContainedList.js +5 -32
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/es/components/ContextMenu/useContextMenu.js +1 -6
- package/es/components/Copy/Copy.js +8 -31
- package/es/components/CopyButton/CopyButton.js +0 -4
- package/es/components/DangerButton/DangerButton.js +0 -1
- package/es/components/DataTable/DataTable.js +171 -91
- package/es/components/DataTable/Table.js +0 -6
- package/es/components/DataTable/TableBatchAction.js +0 -4
- package/es/components/DataTable/TableBatchActions.js +0 -8
- package/es/components/DataTable/TableBody.js +0 -1
- package/es/components/DataTable/TableContainer.js +0 -5
- package/es/components/DataTable/TableExpandHeader.js +0 -7
- package/es/components/DataTable/TableExpandRow.js +0 -6
- package/es/components/DataTable/TableExpandedRow.js +0 -6
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -19
- package/es/components/DataTable/TableRow.js +4 -5
- package/es/components/DataTable/TableSelectAll.js +0 -8
- package/es/components/DataTable/TableSelectRow.js +2 -10
- package/es/components/DataTable/TableToolbar.js +0 -3
- package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +3 -6
- package/es/components/DataTable/TableToolbarSearch.js +2 -30
- package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/es/components/DataTable/state/sorting.js +5 -8
- package/es/components/DataTable/tools/denormalize.js +2 -2
- package/es/components/DataTable/tools/filter.js +0 -2
- package/es/components/DataTable/tools/instanceId.js +0 -1
- package/es/components/DataTable/tools/normalize.js +10 -10
- package/es/components/DataTable/tools/sorting.js +5 -13
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/es/components/DatePicker/DatePicker.js +153 -175
- package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/es/components/DatePickerInput/DatePickerInput.js +2 -28
- package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/es/components/Dropdown/Dropdown.js +43 -52
- package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/es/components/FeatureFlags/index.js +8 -20
- package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/es/components/FileUploader/FileUploader.js +3 -38
- package/es/components/FileUploader/FileUploaderButton.js +3 -24
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/es/components/FileUploader/FileUploaderItem.js +5 -12
- package/es/components/FileUploader/Filename.js +6 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/es/components/FluidComboBox/FluidComboBox.js +0 -18
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/es/components/FluidDropdown/FluidDropdown.js +0 -18
- package/es/components/FluidForm/FluidForm.js +0 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/es/components/FluidSelect/FluidSelect.js +0 -10
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/es/components/FluidTextArea/FluidTextArea.js +0 -20
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/es/components/FluidTextInput/FluidTextInput.js +0 -14
- package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/es/components/Form/Form.d.ts +23 -0
- package/es/components/Form/Form.js +3 -6
- package/es/components/Form/index.d.ts +7 -0
- package/es/components/FormGroup/FormGroup.js +0 -7
- package/es/components/FormItem/FormItem.js +0 -2
- package/es/components/FormLabel/FormLabel.js +1 -7
- package/es/components/Grid/CSSGrid.js +2 -15
- package/es/components/Grid/Column.js +18 -59
- package/es/components/Grid/ColumnHang.js +2 -5
- package/es/components/Grid/FlexGrid.js +2 -8
- package/es/components/Grid/Grid.js +0 -8
- package/es/components/Grid/GridContext.js +1 -3
- package/es/components/Grid/Row.js +2 -7
- package/es/components/Heading/index.js +0 -4
- package/es/components/Icon/Icon.Skeleton.js +2 -2
- package/es/components/IconButton/index.js +0 -10
- package/es/components/IdPrefix/index.js +0 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/es/components/InlineLoading/InlineLoading.js +0 -12
- package/es/components/Layer/index.js +3 -6
- package/es/components/Layout/LayoutDirection.js +0 -3
- package/es/components/Layout/useLayoutDirection.js +0 -1
- package/es/components/Link/Link.js +3 -10
- package/es/components/ListBox/ListBox.js +2 -13
- package/es/components/ListBox/ListBoxField.js +0 -5
- package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/es/components/ListBox/ListBoxMenuItem.js +2 -6
- package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/es/components/ListBox/ListBoxSelection.js +1 -13
- package/es/components/ListBox/next/ListBoxSelection.js +1 -14
- package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/es/components/ListItem/ListItem.d.ts +23 -0
- package/es/components/ListItem/ListItem.js +4 -8
- package/es/components/ListItem/index.d.ts +7 -0
- package/es/components/Loading/Loading.js +0 -6
- package/es/components/Menu/Menu.js +22 -40
- package/es/components/Menu/MenuContext.js +4 -5
- package/es/components/Menu/MenuItem.js +5 -39
- package/es/components/MenuButton/index.js +0 -9
- package/es/components/Modal/Modal.js +1 -46
- package/es/components/ModalWrapper/ModalWrapper.js +2 -15
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
- package/es/components/MultiSelect/MultiSelect.js +22 -70
- package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/es/components/MultiSelect/index.js +0 -1
- package/es/components/MultiSelect/tools/itemToString.js +0 -2
- package/es/components/MultiSelect/tools/sorting.js +3 -4
- package/es/components/Notification/Notification.js +0 -78
- package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/es/components/NumberInput/NumberInput.js +3 -60
- package/es/components/OrderedList/OrderedList.d.ts +39 -0
- package/es/components/OrderedList/OrderedList.js +7 -19
- package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
- package/es/components/OverflowMenu/OverflowMenu.js +65 -86
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/es/components/OverflowMenuV2/index.js +0 -5
- package/es/components/Pagination/Pagination.Skeleton.js +0 -2
- package/es/components/Pagination/Pagination.js +11 -47
- package/es/components/Pagination/experimental/PageSelector.js +0 -10
- package/es/components/Pagination/experimental/Pagination.js +2 -48
- package/es/components/PaginationNav/PaginationNav.js +15 -59
- package/es/components/Popover/index.d.ts +14 -8
- package/es/components/Popover/index.js +44 -48
- package/es/components/PrimaryButton/PrimaryButton.js +0 -1
- package/es/components/ProgressBar/ProgressBar.js +0 -15
- package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/es/components/RadioButton/RadioButton.js +0 -13
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/es/components/RadioTile/RadioTile.js +0 -12
- package/es/components/Search/Search.Skeleton.js +0 -2
- package/es/components/Search/Search.js +1 -28
- package/es/components/SecondaryButton/SecondaryButton.js +0 -1
- package/es/components/Select/Select.Skeleton.js +0 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +6 -33
- package/es/components/SelectItem/SelectItem.js +0 -5
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
- package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/es/components/SkeletonText/SkeletonText.js +0 -12
- package/es/components/Slider/Slider.Skeleton.js +0 -2
- package/es/components/Slider/Slider.d.ts +0 -1
- package/es/components/Slider/Slider.js +112 -135
- package/es/components/Stack/Stack.js +1 -8
- package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/es/components/StructuredList/StructuredList.js +1 -25
- package/es/components/Switch/IconSwitch.js +0 -18
- package/es/components/Switch/Switch.js +0 -11
- package/es/components/TabContent/TabContent.js +2 -6
- package/es/components/Tabs/Tabs.Skeleton.js +0 -4
- package/es/components/Tabs/Tabs.js +135 -104
- package/es/components/Tabs/usePressable.js +18 -31
- package/es/components/Tag/Tag.Skeleton.js +0 -2
- package/es/components/Tag/Tag.js +0 -15
- package/es/components/Text/Text.js +5 -18
- package/es/components/Text/TextDirection.js +0 -3
- package/es/components/Text/TextDirectionContext.js +0 -1
- package/es/components/Text/createTextComponent.js +0 -3
- package/es/components/TextArea/TextArea.Skeleton.js +0 -2
- package/es/components/TextArea/TextArea.js +11 -33
- package/es/components/TextInput/ControlledPasswordInput.js +0 -20
- package/es/components/TextInput/PasswordInput.js +0 -25
- package/es/components/TextInput/TextInput.Skeleton.js +0 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +5 -33
- package/es/components/TextInput/util.js +3 -5
- package/es/components/Theme/index.js +1 -6
- package/es/components/Tile/Tile.js +32 -59
- package/es/components/TileGroup/TileGroup.js +1 -22
- package/es/components/TimePicker/TimePicker.js +6 -32
- package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/es/components/Toggle/Toggle.Skeleton.js +0 -8
- package/es/components/Toggle/Toggle.js +0 -16
- package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/es/components/Toggletip/index.d.ts +148 -0
- package/es/components/Toggletip/index.js +20 -44
- package/es/components/Tooltip/DefinitionTooltip.js +0 -11
- package/es/components/Tooltip/Tooltip.d.ts +1 -1
- package/es/components/Tooltip/Tooltip.js +4 -21
- package/es/components/TreeView/TreeNode.js +21 -66
- package/es/components/TreeView/TreeView.js +11 -67
- package/es/components/UIShell/Content.js +2 -4
- package/es/components/UIShell/Header.js +0 -2
- package/es/components/UIShell/HeaderContainer.d.ts +33 -0
- package/es/components/UIShell/HeaderContainer.js +13 -11
- package/es/components/UIShell/HeaderGlobalAction.js +0 -6
- package/es/components/UIShell/HeaderGlobalBar.js +0 -1
- package/es/components/UIShell/HeaderMenu.js +32 -31
- package/es/components/UIShell/HeaderMenuButton.js +2 -4
- package/es/components/UIShell/HeaderMenuItem.js +0 -8
- package/es/components/UIShell/HeaderName.js +0 -5
- package/es/components/UIShell/HeaderNavigation.js +0 -2
- package/es/components/UIShell/HeaderPanel.js +0 -2
- package/es/components/UIShell/HeaderSideNavItems.js +0 -2
- package/es/components/UIShell/Link.js +2 -3
- package/es/components/UIShell/SideNav.d.ts +3 -1
- package/es/components/UIShell/SideNav.js +44 -36
- package/es/components/UIShell/SideNavDetails.js +0 -3
- package/es/components/UIShell/SideNavDivider.js +0 -1
- package/es/components/UIShell/SideNavFooter.js +1 -4
- package/es/components/UIShell/SideNavHeader.js +0 -4
- package/es/components/UIShell/SideNavIcon.js +0 -3
- package/es/components/UIShell/SideNavItem.js +0 -3
- package/es/components/UIShell/SideNavItems.js +2 -6
- package/es/components/UIShell/SideNavLink.js +3 -7
- package/es/components/UIShell/SideNavLinkText.js +0 -2
- package/es/components/UIShell/SideNavMenu.js +0 -16
- package/es/components/UIShell/SideNavMenuItem.js +0 -2
- package/es/components/UIShell/SideNavSwitcher.js +2 -5
- package/es/components/UIShell/SkipToContent.d.ts +32 -0
- package/es/components/UIShell/SkipToContent.js +8 -15
- package/es/components/UIShell/Switcher.js +0 -2
- package/es/components/UIShell/SwitcherDivider.js +0 -1
- package/es/components/UIShell/SwitcherItem.js +0 -3
- package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/es/components/UnorderedList/UnorderedList.js +6 -16
- package/es/components/UnorderedList/index.d.ts +7 -0
- package/es/index.js +7 -8
- package/es/internal/ClickListener.js +3 -13
- package/es/internal/FloatingMenu.js +57 -63
- package/es/internal/OptimizedResize.js +6 -12
- package/es/internal/Selection.js +2 -25
- package/es/internal/createClassWrapper.js +0 -2
- package/es/internal/deprecateFieldOnObject.js +0 -4
- package/es/internal/focus/index.js +0 -1
- package/es/internal/keyboard/keys.js +2 -1
- package/es/internal/keyboard/match.js +1 -6
- package/es/internal/keyboard/navigation.js +8 -7
- package/es/internal/useAnnouncer.js +0 -1
- package/es/internal/useAttachedMenu.js +1 -9
- package/es/internal/useControllableState.js +6 -13
- package/es/internal/useDelayedState.js +2 -4
- package/es/internal/useEffectOnce.js +0 -1
- package/es/internal/useEvent.js +61 -3
- package/es/internal/useId.js +2 -5
- package/es/internal/useIsomorphicEffect.js +1 -0
- package/es/internal/useMergedRefs.js +2 -2
- package/es/internal/useNoInteractiveChildren.js +2 -13
- package/es/internal/useNormalizedInputProps.js +0 -3
- package/es/internal/useSavedCallback.js +0 -1
- package/es/internal/warning.js +0 -3
- package/es/internal/wrapFocus.js +1 -8
- package/es/prop-types/deprecate.js +2 -5
- package/es/prop-types/isRequiredOneOf.js +2 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/es/tools/array.js +0 -3
- package/es/tools/events.js +0 -3
- package/es/tools/mergeRefs.js +0 -2
- package/es/tools/wrapComponent.js +2 -5
- package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
- package/lib/components/Accordion/Accordion.js +1 -27
- package/lib/components/Accordion/AccordionItem.js +5 -19
- package/lib/components/AspectRatio/AspectRatio.js +0 -5
- package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
- package/lib/components/Button/Button.Skeleton.js +2 -26
- package/lib/components/Button/Button.js +2 -36
- package/lib/components/ButtonSet/ButtonSet.js +0 -2
- package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
- package/lib/components/Checkbox/Checkbox.js +4 -20
- package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
- package/lib/components/ClassPrefix/index.d.ts +26 -0
- package/lib/components/ClassPrefix/index.js +0 -2
- package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
- package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
- package/lib/components/ComboBox/ComboBox.js +19 -86
- package/lib/components/ComboBox/tools/filter.js +0 -1
- package/lib/components/ComboButton/index.js +0 -14
- package/lib/components/ComposedModal/ComposedModal.js +2 -32
- package/lib/components/ComposedModal/ModalFooter.js +0 -21
- package/lib/components/ComposedModal/ModalHeader.js +0 -12
- package/lib/components/ContainedList/ContainedList.js +5 -32
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
- package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
- package/lib/components/ContextMenu/useContextMenu.js +1 -6
- package/lib/components/Copy/Copy.js +8 -50
- package/lib/components/CopyButton/CopyButton.js +0 -4
- package/lib/components/DangerButton/DangerButton.js +0 -1
- package/lib/components/DataTable/DataTable.js +171 -91
- package/lib/components/DataTable/Table.js +0 -6
- package/lib/components/DataTable/TableBatchAction.js +0 -4
- package/lib/components/DataTable/TableBatchActions.js +0 -8
- package/lib/components/DataTable/TableBody.js +0 -1
- package/lib/components/DataTable/TableContainer.js +0 -5
- package/lib/components/DataTable/TableExpandHeader.js +0 -7
- package/lib/components/DataTable/TableExpandRow.js +0 -6
- package/lib/components/DataTable/TableExpandedRow.js +0 -6
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -19
- package/lib/components/DataTable/TableRow.js +4 -5
- package/lib/components/DataTable/TableSelectAll.js +0 -8
- package/lib/components/DataTable/TableSelectRow.js +2 -10
- package/lib/components/DataTable/TableToolbar.js +0 -3
- package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +3 -6
- package/lib/components/DataTable/TableToolbarSearch.js +2 -30
- package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
- package/lib/components/DataTable/state/sorting.js +5 -8
- package/lib/components/DataTable/tools/denormalize.js +2 -2
- package/lib/components/DataTable/tools/filter.js +0 -2
- package/lib/components/DataTable/tools/instanceId.js +0 -1
- package/lib/components/DataTable/tools/normalize.js +10 -10
- package/lib/components/DataTable/tools/sorting.js +5 -13
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
- package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
- package/lib/components/DatePicker/DatePicker.js +153 -175
- package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
- package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
- package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
- package/lib/components/Dropdown/Dropdown.js +50 -59
- package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
- package/lib/components/FeatureFlags/index.js +8 -20
- package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
- package/lib/components/FileUploader/FileUploader.js +3 -57
- package/lib/components/FileUploader/FileUploaderButton.js +3 -43
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
- package/lib/components/FileUploader/FileUploaderItem.js +5 -31
- package/lib/components/FileUploader/Filename.js +6 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
- package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
- package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
- package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
- package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
- package/lib/components/FluidForm/FluidForm.js +0 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
- package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
- package/lib/components/FluidSelect/FluidSelect.js +0 -10
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
- package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
- package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
- package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
- package/lib/components/Form/Form.d.ts +23 -0
- package/lib/components/Form/Form.js +3 -6
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/FormGroup/FormGroup.js +0 -7
- package/lib/components/FormItem/FormItem.js +0 -2
- package/lib/components/FormLabel/FormLabel.js +1 -26
- package/lib/components/Grid/CSSGrid.js +2 -15
- package/lib/components/Grid/Column.js +18 -59
- package/lib/components/Grid/ColumnHang.js +2 -5
- package/lib/components/Grid/FlexGrid.js +2 -8
- package/lib/components/Grid/Grid.js +0 -8
- package/lib/components/Grid/GridContext.js +1 -3
- package/lib/components/Grid/Row.js +2 -7
- package/lib/components/Heading/index.js +0 -4
- package/lib/components/Icon/Icon.Skeleton.js +2 -2
- package/lib/components/IconButton/index.js +0 -10
- package/lib/components/IdPrefix/index.js +0 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
- package/lib/components/InlineLoading/InlineLoading.js +0 -12
- package/lib/components/Layer/index.js +3 -6
- package/lib/components/Layout/LayoutDirection.js +0 -3
- package/lib/components/Layout/useLayoutDirection.js +0 -1
- package/lib/components/Link/Link.js +3 -10
- package/lib/components/ListBox/ListBox.js +2 -13
- package/lib/components/ListBox/ListBoxField.js +0 -5
- package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
- package/lib/components/ListBox/ListBoxSelection.js +1 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
- package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
- package/lib/components/ListItem/ListItem.d.ts +23 -0
- package/lib/components/ListItem/ListItem.js +4 -8
- package/lib/components/ListItem/index.d.ts +7 -0
- package/lib/components/Loading/Loading.js +0 -6
- package/lib/components/Menu/Menu.js +22 -40
- package/lib/components/Menu/MenuContext.js +4 -5
- package/lib/components/Menu/MenuItem.js +5 -39
- package/lib/components/MenuButton/index.js +0 -9
- package/lib/components/Modal/Modal.js +1 -46
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
- package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
- package/lib/components/MultiSelect/MultiSelect.js +30 -78
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
- package/lib/components/MultiSelect/index.js +0 -1
- package/lib/components/MultiSelect/tools/itemToString.js +0 -2
- package/lib/components/MultiSelect/tools/sorting.js +3 -4
- package/lib/components/Notification/Notification.js +0 -78
- package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
- package/lib/components/NumberInput/NumberInput.js +3 -60
- package/lib/components/OrderedList/OrderedList.d.ts +39 -0
- package/lib/components/OrderedList/OrderedList.js +7 -19
- package/lib/components/OrderedList/index.d.ts +7 -0
- package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
- package/lib/components/OverflowMenuV2/index.js +0 -5
- package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
- package/lib/components/Pagination/Pagination.js +11 -47
- package/lib/components/Pagination/experimental/PageSelector.js +0 -10
- package/lib/components/Pagination/experimental/Pagination.js +2 -67
- package/lib/components/PaginationNav/PaginationNav.js +15 -78
- package/lib/components/Popover/index.d.ts +14 -8
- package/lib/components/Popover/index.js +44 -48
- package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
- package/lib/components/ProgressBar/ProgressBar.js +0 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
- package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
- package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
- package/lib/components/RadioButton/RadioButton.js +0 -13
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
- package/lib/components/RadioTile/RadioTile.js +0 -12
- package/lib/components/Search/Search.Skeleton.js +0 -2
- package/lib/components/Search/Search.js +1 -28
- package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
- package/lib/components/Select/Select.Skeleton.js +0 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +6 -33
- package/lib/components/SelectItem/SelectItem.js +0 -5
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
- package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
- package/lib/components/SkeletonText/SkeletonText.js +0 -12
- package/lib/components/Slider/Slider.Skeleton.js +0 -2
- package/lib/components/Slider/Slider.d.ts +0 -1
- package/lib/components/Slider/Slider.js +112 -154
- package/lib/components/Stack/Stack.js +1 -8
- package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
- package/lib/components/StructuredList/StructuredList.js +1 -25
- package/lib/components/Switch/IconSwitch.js +0 -18
- package/lib/components/Switch/Switch.js +0 -11
- package/lib/components/TabContent/TabContent.js +2 -6
- package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
- package/lib/components/Tabs/Tabs.js +133 -102
- package/lib/components/Tabs/usePressable.js +18 -31
- package/lib/components/Tag/Tag.Skeleton.js +0 -2
- package/lib/components/Tag/Tag.js +0 -15
- package/lib/components/Text/Text.js +5 -18
- package/lib/components/Text/TextDirection.js +0 -3
- package/lib/components/Text/TextDirectionContext.js +0 -1
- package/lib/components/Text/createTextComponent.js +0 -3
- package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
- package/lib/components/TextArea/TextArea.js +10 -32
- package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
- package/lib/components/TextInput/PasswordInput.js +0 -25
- package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +5 -52
- package/lib/components/TextInput/util.js +3 -5
- package/lib/components/Theme/index.js +1 -6
- package/lib/components/Tile/Tile.js +31 -58
- package/lib/components/TileGroup/TileGroup.js +1 -22
- package/lib/components/TimePicker/TimePicker.js +6 -32
- package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
- package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
- package/lib/components/Toggle/Toggle.js +0 -16
- package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
- package/lib/components/Toggletip/index.d.ts +148 -0
- package/lib/components/Toggletip/index.js +20 -44
- package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
- package/lib/components/Tooltip/Tooltip.d.ts +1 -1
- package/lib/components/Tooltip/Tooltip.js +4 -21
- package/lib/components/TreeView/TreeNode.js +21 -66
- package/lib/components/TreeView/TreeView.js +11 -67
- package/lib/components/UIShell/Content.js +2 -4
- package/lib/components/UIShell/Header.js +0 -2
- package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
- package/lib/components/UIShell/HeaderContainer.js +13 -11
- package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
- package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
- package/lib/components/UIShell/HeaderMenu.js +32 -31
- package/lib/components/UIShell/HeaderMenuButton.js +2 -4
- package/lib/components/UIShell/HeaderMenuItem.js +0 -8
- package/lib/components/UIShell/HeaderName.js +0 -5
- package/lib/components/UIShell/HeaderNavigation.js +0 -2
- package/lib/components/UIShell/HeaderPanel.js +0 -2
- package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
- package/lib/components/UIShell/Link.js +2 -3
- package/lib/components/UIShell/SideNav.d.ts +3 -1
- package/lib/components/UIShell/SideNav.js +43 -35
- package/lib/components/UIShell/SideNavDetails.js +0 -3
- package/lib/components/UIShell/SideNavDivider.js +0 -1
- package/lib/components/UIShell/SideNavFooter.js +1 -4
- package/lib/components/UIShell/SideNavHeader.js +0 -4
- package/lib/components/UIShell/SideNavIcon.js +0 -3
- package/lib/components/UIShell/SideNavItem.js +0 -3
- package/lib/components/UIShell/SideNavItems.js +2 -6
- package/lib/components/UIShell/SideNavLink.js +3 -7
- package/lib/components/UIShell/SideNavLinkText.js +0 -2
- package/lib/components/UIShell/SideNavMenu.js +0 -16
- package/lib/components/UIShell/SideNavMenuItem.js +0 -2
- package/lib/components/UIShell/SideNavSwitcher.js +2 -5
- package/lib/components/UIShell/SkipToContent.d.ts +32 -0
- package/lib/components/UIShell/SkipToContent.js +8 -15
- package/lib/components/UIShell/Switcher.js +0 -2
- package/lib/components/UIShell/SwitcherDivider.js +0 -1
- package/lib/components/UIShell/SwitcherItem.js +0 -3
- package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
- package/lib/components/UnorderedList/UnorderedList.js +6 -16
- package/lib/components/UnorderedList/index.d.ts +7 -0
- package/lib/index.js +42 -43
- package/lib/internal/ClickListener.js +3 -13
- package/lib/internal/FloatingMenu.js +57 -63
- package/lib/internal/OptimizedResize.js +6 -12
- package/lib/internal/Selection.js +2 -25
- package/lib/internal/createClassWrapper.js +0 -2
- package/lib/internal/deprecateFieldOnObject.js +0 -4
- package/lib/internal/focus/index.js +0 -1
- package/lib/internal/keyboard/keys.js +2 -1
- package/lib/internal/keyboard/match.js +1 -6
- package/lib/internal/keyboard/navigation.js +8 -7
- package/lib/internal/useAnnouncer.js +0 -1
- package/lib/internal/useAttachedMenu.js +1 -9
- package/lib/internal/useControllableState.js +6 -13
- package/lib/internal/useDelayedState.js +2 -4
- package/lib/internal/useEffectOnce.js +0 -1
- package/lib/internal/useEvent.js +61 -2
- package/lib/internal/useId.js +2 -5
- package/lib/internal/useIsomorphicEffect.js +1 -0
- package/lib/internal/useMergedRefs.js +2 -2
- package/lib/internal/useNoInteractiveChildren.js +2 -13
- package/lib/internal/useNormalizedInputProps.js +0 -3
- package/lib/internal/useSavedCallback.js +0 -1
- package/lib/internal/warning.js +0 -3
- package/lib/internal/wrapFocus.js +1 -8
- package/lib/prop-types/deprecate.js +2 -5
- package/lib/prop-types/isRequiredOneOf.js +2 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
- package/lib/tools/array.js +0 -3
- package/lib/tools/events.js +0 -3
- package/lib/tools/mergeRefs.js +0 -2
- package/lib/tools/wrapComponent.js +2 -5
- package/package.json +9 -9
- package/es/components/Tab/Tab.js +0 -185
- package/es/components/Tab/index.js +0 -14
- package/es/components/TimePickerSelect/index.js +0 -13
- package/lib/components/Form/index.js +0 -17
- package/lib/components/Tab/Tab.js +0 -214
- package/lib/components/Tab/index.js +0 -39
- package/lib/components/TimePickerSelect/index.js +0 -38
|
@@ -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,28 +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
198
|
};
|
|
215
|
-
|
|
216
199
|
const endInputField = React.useRef(null);
|
|
217
200
|
const calendarRef = React.useRef(null);
|
|
218
201
|
const savedOnChange = useSavedCallback.useSavedCallback(onChange);
|
|
219
202
|
const savedOnClose = useSavedCallback.useSavedCallback(datePickerType === 'range' ? onCalendarClose : onClose);
|
|
220
|
-
const savedOnOpen = useSavedCallback.useSavedCallback(
|
|
203
|
+
const savedOnOpen = useSavedCallback.useSavedCallback(onOpen);
|
|
221
204
|
const datePickerClasses = cx__default["default"](`${prefix}--date-picker`, {
|
|
222
205
|
[`${prefix}--date-picker--short`]: short,
|
|
223
206
|
[`${prefix}--date-picker--light`]: light,
|
|
@@ -237,7 +220,6 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
237
220
|
readOnly
|
|
238
221
|
});
|
|
239
222
|
}
|
|
240
|
-
|
|
241
223
|
if (index === 1 && child.type === React__default["default"].createElement(DatePickerInput["default"], child.props).type) {
|
|
242
224
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
243
225
|
datePickerType,
|
|
@@ -245,14 +227,12 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
245
227
|
readOnly
|
|
246
228
|
});
|
|
247
229
|
}
|
|
248
|
-
|
|
249
230
|
if (index === 0) {
|
|
250
231
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
251
232
|
ref: startInputField,
|
|
252
233
|
readOnly
|
|
253
234
|
});
|
|
254
235
|
}
|
|
255
|
-
|
|
256
236
|
if (index === 1) {
|
|
257
237
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
|
258
238
|
ref: endInputField,
|
|
@@ -264,28 +244,23 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
264
244
|
if (datePickerType !== 'single' && datePickerType !== 'range') {
|
|
265
245
|
return;
|
|
266
246
|
}
|
|
267
|
-
|
|
268
247
|
if (!startInputField.current) {
|
|
269
248
|
return;
|
|
270
249
|
}
|
|
271
|
-
|
|
272
|
-
const onHook = (_electedDates, _dateStr, instance, prefix) => {
|
|
250
|
+
const onHook = (_electedDates, _dateStr, instance) => {
|
|
273
251
|
updateClassNames(instance, prefix);
|
|
274
|
-
|
|
275
|
-
if (startInputField !== null && startInputField !== void 0 && startInputField.current) {
|
|
252
|
+
if (startInputField?.current) {
|
|
276
253
|
startInputField.current.readOnly = readOnly;
|
|
277
254
|
}
|
|
278
|
-
|
|
279
|
-
if (endInputField !== null && endInputField !== void 0 && endInputField.current) {
|
|
255
|
+
if (endInputField?.current) {
|
|
280
256
|
endInputField.current.readOnly = readOnly;
|
|
281
257
|
}
|
|
282
|
-
};
|
|
283
|
-
// is provided, we return the default empty disabled array, allowing all dates.
|
|
284
|
-
|
|
258
|
+
};
|
|
285
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.
|
|
286
262
|
const enableOrDisable = enable ? 'enable' : 'disable';
|
|
287
263
|
let enableOrDisableArr;
|
|
288
|
-
|
|
289
264
|
if (!enable && !disable) {
|
|
290
265
|
enableOrDisableArr = [];
|
|
291
266
|
} else if (enable) {
|
|
@@ -293,18 +268,16 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
293
268
|
} else {
|
|
294
269
|
enableOrDisableArr = disable;
|
|
295
270
|
}
|
|
296
|
-
|
|
297
271
|
let localeData;
|
|
298
|
-
|
|
299
272
|
if (typeof locale === 'object') {
|
|
300
273
|
const location = locale.locale ? locale.locale : 'en';
|
|
301
|
-
localeData = {
|
|
274
|
+
localeData = {
|
|
275
|
+
...l10n__default["default"][location],
|
|
302
276
|
...locale
|
|
303
277
|
};
|
|
304
278
|
} else {
|
|
305
279
|
localeData = l10n__default["default"][locale];
|
|
306
280
|
}
|
|
307
|
-
|
|
308
281
|
const {
|
|
309
282
|
current: start
|
|
310
283
|
} = startInputField;
|
|
@@ -358,12 +331,10 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
358
331
|
};
|
|
359
332
|
const calendar = flatpickr__default["default"](start, flatpickerconfig);
|
|
360
333
|
calendarRef.current = calendar;
|
|
361
|
-
|
|
362
334
|
function handleArrowDown(event) {
|
|
363
335
|
if (match.match(event, keys.Escape)) {
|
|
364
336
|
calendar.calendarContainer.classList.remove('open');
|
|
365
337
|
}
|
|
366
|
-
|
|
367
338
|
if (match.match(event, keys.ArrowDown)) {
|
|
368
339
|
const {
|
|
369
340
|
calendarContainer,
|
|
@@ -375,156 +346,127 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
375
346
|
(selectedDateElem || todayDateElem || calendarContainer.querySelector('.flatpickr-day[tabindex]') || calendarContainer).focus();
|
|
376
347
|
}
|
|
377
348
|
}
|
|
378
|
-
|
|
379
349
|
function handleOnChange(event) {
|
|
380
350
|
if (datePickerType == 'single') {
|
|
381
351
|
calendar.calendarContainer.classList.remove('open');
|
|
382
352
|
}
|
|
383
|
-
|
|
384
353
|
const {
|
|
385
354
|
target
|
|
386
355
|
} = event;
|
|
387
|
-
|
|
388
356
|
if (target === start) {
|
|
389
357
|
lastStartValue.current = start.value;
|
|
390
358
|
}
|
|
391
|
-
|
|
392
359
|
if (start.value !== '') {
|
|
393
360
|
return;
|
|
394
361
|
}
|
|
395
|
-
|
|
396
362
|
if (!calendar.selectedDates) {
|
|
397
363
|
return;
|
|
398
364
|
}
|
|
399
|
-
|
|
400
365
|
if (calendar.selectedDates.length === 0) {
|
|
401
366
|
return;
|
|
402
367
|
}
|
|
403
|
-
|
|
404
368
|
calendar.clear();
|
|
405
369
|
calendar.input.focus();
|
|
406
370
|
}
|
|
407
|
-
|
|
408
371
|
if (start) {
|
|
409
372
|
start.addEventListener('keydown', handleArrowDown);
|
|
410
373
|
start.addEventListener('change', handleOnChange);
|
|
411
|
-
|
|
412
374
|
if (calendar && calendar.calendarContainer) {
|
|
413
375
|
// Flatpickr's calendar dialog is not rendered in a landmark causing an
|
|
414
376
|
// error with IBM Equal Access Accessibility Checker so we add an aria
|
|
415
377
|
// role to the container div.
|
|
416
|
-
calendar.calendarContainer.setAttribute('role', 'application');
|
|
417
|
-
|
|
378
|
+
calendar.calendarContainer.setAttribute('role', 'application');
|
|
379
|
+
// IBM EAAC requires an aria-label on a role='region'
|
|
418
380
|
calendar.calendarContainer.setAttribute('aria-label', 'calendar-container');
|
|
419
381
|
}
|
|
420
382
|
}
|
|
421
|
-
|
|
422
383
|
if (end) {
|
|
423
384
|
end.addEventListener('keydown', handleArrowDown);
|
|
424
385
|
end.addEventListener('change', handleOnChange);
|
|
425
|
-
}
|
|
426
|
-
|
|
386
|
+
}
|
|
427
387
|
|
|
388
|
+
//component did unmount equivalent
|
|
428
389
|
return () => {
|
|
429
390
|
// Note: if the `startInputField` ref is undefined then calendar will be
|
|
430
391
|
// of type: Array and `destroy` will not be defined
|
|
431
392
|
if (calendar && calendar.destroy) {
|
|
432
393
|
calendar.destroy();
|
|
433
|
-
}
|
|
434
|
-
|
|
394
|
+
}
|
|
435
395
|
|
|
396
|
+
// prevent a duplicate date selection when a default value is set
|
|
436
397
|
if (value) {
|
|
437
|
-
if (startInputField
|
|
398
|
+
if (startInputField?.current) {
|
|
438
399
|
startInputField.current.value = '';
|
|
439
400
|
}
|
|
440
|
-
|
|
441
|
-
if (endInputField !== null && endInputField !== void 0 && endInputField.current) {
|
|
401
|
+
if (endInputField?.current) {
|
|
442
402
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
443
403
|
endInputField.current.value = '';
|
|
444
404
|
}
|
|
445
405
|
}
|
|
446
|
-
|
|
447
406
|
if (start) {
|
|
448
407
|
start.removeEventListener('keydown', handleArrowDown);
|
|
449
408
|
start.removeEventListener('change', handleOnChange);
|
|
450
409
|
}
|
|
451
|
-
|
|
452
410
|
if (end) {
|
|
453
411
|
end.removeEventListener('keydown', handleArrowDown);
|
|
454
412
|
end.removeEventListener('change', handleOnChange);
|
|
455
413
|
}
|
|
456
414
|
};
|
|
457
415
|
}, [savedOnChange, savedOnClose, savedOnOpen, readOnly, hasInput]); //eslint-disable-line react-hooks/exhaustive-deps
|
|
416
|
+
|
|
458
417
|
// this hook allows consumers to access the flatpickr calendar
|
|
459
418
|
// instance for cases where functions like open() or close()
|
|
460
419
|
// need to be imperatively called on the calendar
|
|
461
|
-
|
|
462
420
|
React.useImperativeHandle(ref, () => ({
|
|
463
421
|
get calendar() {
|
|
464
422
|
return calendarRef.current;
|
|
465
423
|
}
|
|
466
|
-
|
|
467
424
|
}));
|
|
468
425
|
React.useEffect(() => {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current = calendarRef.current) !== null && _calendarRef$current !== void 0 && _calendarRef$current.set) {
|
|
426
|
+
if (calendarRef?.current?.set) {
|
|
472
427
|
calendarRef.current.set({
|
|
473
428
|
dateFormat
|
|
474
429
|
});
|
|
475
430
|
}
|
|
476
431
|
}, [dateFormat]);
|
|
477
432
|
React.useEffect(() => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current2 = calendarRef.current) !== null && _calendarRef$current2 !== void 0 && _calendarRef$current2.set) {
|
|
433
|
+
if (calendarRef?.current?.set) {
|
|
481
434
|
calendarRef.current.set('minDate', minDate);
|
|
482
435
|
}
|
|
483
436
|
}, [minDate]);
|
|
484
437
|
React.useEffect(() => {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current3 = calendarRef.current) !== null && _calendarRef$current3 !== void 0 && _calendarRef$current3.set) {
|
|
438
|
+
if (calendarRef?.current?.set) {
|
|
488
439
|
calendarRef.current.set('maxDate', maxDate);
|
|
489
440
|
}
|
|
490
441
|
}, [maxDate]);
|
|
491
442
|
React.useEffect(() => {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
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) {
|
|
495
444
|
calendarRef.current.set('disable', disable);
|
|
496
445
|
}
|
|
497
446
|
}, [disable]);
|
|
498
447
|
React.useEffect(() => {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
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) {
|
|
502
449
|
calendarRef.current.set('enable', enable);
|
|
503
450
|
}
|
|
504
451
|
}, [enable]);
|
|
505
452
|
React.useEffect(() => {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
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) {
|
|
509
454
|
calendarRef.current.set('inline', inline);
|
|
510
455
|
}
|
|
511
456
|
}, [inline]);
|
|
512
457
|
React.useEffect(() => {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
if (calendarRef !== null && calendarRef !== void 0 && (_calendarRef$current7 = calendarRef.current) !== null && _calendarRef$current7 !== void 0 && _calendarRef$current7.set) {
|
|
458
|
+
if (calendarRef?.current?.set) {
|
|
516
459
|
if (value !== undefined) {
|
|
517
460
|
calendarRef.current.setDate(value);
|
|
518
461
|
}
|
|
519
|
-
|
|
520
|
-
|
|
462
|
+
updateClassNames(calendarRef.current, prefix);
|
|
463
|
+
//for simple date picker w/o calendar; initial mount may not have value
|
|
521
464
|
} else if (!calendarRef.current && value) {
|
|
522
465
|
startInputField.current.value = value;
|
|
523
466
|
}
|
|
524
467
|
}, [value, prefix]); //eslint-disable-line react-hooks/exhaustive-deps
|
|
525
468
|
|
|
526
469
|
let fluidError;
|
|
527
|
-
|
|
528
470
|
if (isFluid) {
|
|
529
471
|
if (invalid) {
|
|
530
472
|
fluidError = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(iconsReact.WarningFilled, {
|
|
@@ -535,7 +477,6 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
535
477
|
className: `${prefix}--form-requirement`
|
|
536
478
|
}, invalidText));
|
|
537
479
|
}
|
|
538
|
-
|
|
539
480
|
if (warn && !invalid) {
|
|
540
481
|
fluidError = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(iconsReact.WarningAltFilled, {
|
|
541
482
|
className: `${prefix}--date-picker__icon ${prefix}--date-picker__icon--warn`
|
|
@@ -546,7 +487,6 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
546
487
|
}, warnText));
|
|
547
488
|
}
|
|
548
489
|
}
|
|
549
|
-
|
|
550
490
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
551
491
|
className: wrapperClasses,
|
|
552
492
|
ref: ref
|
|
@@ -560,32 +500,26 @@ DatePicker.propTypes = {
|
|
|
560
500
|
* into the input field
|
|
561
501
|
*/
|
|
562
502
|
allowInput: PropTypes__default["default"].bool,
|
|
563
|
-
|
|
564
503
|
/**
|
|
565
504
|
* The DOM element the Flatpicker should be inserted into. `<body>` by default.
|
|
566
505
|
*/
|
|
567
506
|
appendTo: PropTypes__default["default"].object,
|
|
568
|
-
|
|
569
507
|
/**
|
|
570
508
|
* The child nodes.
|
|
571
509
|
*/
|
|
572
510
|
children: PropTypes__default["default"].node,
|
|
573
|
-
|
|
574
511
|
/**
|
|
575
512
|
* The CSS class names.
|
|
576
513
|
*/
|
|
577
514
|
className: PropTypes__default["default"].string,
|
|
578
|
-
|
|
579
515
|
/**
|
|
580
516
|
* flatpickr prop passthrough. Controls whether the calendar dropdown closes upon selection.
|
|
581
517
|
*/
|
|
582
518
|
closeOnSelect: PropTypes__default["default"].bool,
|
|
583
|
-
|
|
584
519
|
/**
|
|
585
520
|
* The date format.
|
|
586
521
|
*/
|
|
587
522
|
dateFormat: PropTypes__default["default"].string,
|
|
588
|
-
|
|
589
523
|
/**
|
|
590
524
|
* The type of the date picker:
|
|
591
525
|
*
|
|
@@ -594,100 +528,153 @@ DatePicker.propTypes = {
|
|
|
594
528
|
* * `range` - With calendar dropdown and a date range.
|
|
595
529
|
*/
|
|
596
530
|
datePickerType: PropTypes__default["default"].oneOf(['simple', 'single', 'range']),
|
|
597
|
-
|
|
598
531
|
/**
|
|
599
532
|
* The flatpickr `disable` option that allows a user to disable certain dates.
|
|
600
533
|
*/
|
|
601
534
|
disable: PropTypes__default["default"].array,
|
|
602
|
-
|
|
603
535
|
/**
|
|
604
536
|
* The flatpickr `enable` option that allows a user to enable certain dates.
|
|
605
537
|
*/
|
|
606
538
|
enable: PropTypes__default["default"].array,
|
|
607
|
-
|
|
608
539
|
/**
|
|
609
540
|
* The flatpickr `inline` option.
|
|
610
541
|
*/
|
|
611
542
|
inline: PropTypes__default["default"].bool,
|
|
612
|
-
|
|
613
543
|
/**
|
|
614
544
|
* Specify whether or not the control is invalid (Fluid only)
|
|
615
545
|
*/
|
|
616
546
|
invalid: PropTypes__default["default"].bool,
|
|
617
|
-
|
|
618
547
|
/**
|
|
619
548
|
* Provide the text that is displayed when the control is in error state (Fluid Only)
|
|
620
549
|
*/
|
|
621
550
|
invalidText: PropTypes__default["default"].node,
|
|
622
|
-
|
|
623
551
|
/**
|
|
624
552
|
* `true` to use the light version.
|
|
625
553
|
*/
|
|
626
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.'),
|
|
627
|
-
|
|
628
555
|
/**
|
|
629
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
|
|
630
557
|
*/
|
|
631
|
-
locale: PropTypes__default["default"].oneOfType([PropTypes__default["default"].object, PropTypes__default["default"].oneOf(['ar',
|
|
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
|
-
'
|
|
680
|
-
|
|
681
|
-
'
|
|
682
|
-
|
|
683
|
-
'
|
|
684
|
-
|
|
685
|
-
'
|
|
686
|
-
|
|
687
|
-
'
|
|
688
|
-
|
|
689
|
-
'
|
|
690
|
-
|
|
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
|
|
691
678
|
'zh' // Mandarin
|
|
692
679
|
])]),
|
|
693
680
|
|
|
@@ -695,50 +682,41 @@ DatePicker.propTypes = {
|
|
|
695
682
|
* The maximum date that a user can pick to.
|
|
696
683
|
*/
|
|
697
684
|
maxDate: PropTypes__default["default"].string,
|
|
698
|
-
|
|
699
685
|
/**
|
|
700
686
|
* The minimum date that a user can start picking from.
|
|
701
687
|
*/
|
|
702
688
|
minDate: PropTypes__default["default"].string,
|
|
703
|
-
|
|
704
689
|
/**
|
|
705
690
|
* The `change` event handler.
|
|
706
691
|
*/
|
|
707
692
|
onChange: PropTypes__default["default"].func,
|
|
708
|
-
|
|
709
693
|
/**
|
|
710
694
|
* The `close` event handler.
|
|
711
695
|
*/
|
|
712
696
|
onClose: PropTypes__default["default"].func,
|
|
713
|
-
|
|
714
697
|
/**
|
|
715
698
|
* The `open` event handler.
|
|
716
699
|
*/
|
|
717
700
|
onOpen: PropTypes__default["default"].func,
|
|
718
|
-
|
|
719
701
|
/**
|
|
720
702
|
* whether the DatePicker is to be readOnly
|
|
721
703
|
* if boolean applies to all inputs
|
|
722
704
|
* if array applies to each input in order
|
|
723
705
|
*/
|
|
724
706
|
readOnly: PropTypes__default["default"].oneOfType([PropTypes__default["default"].bool, PropTypes__default["default"].array]),
|
|
725
|
-
|
|
726
707
|
/**
|
|
727
708
|
* `true` to use the short version.
|
|
728
709
|
*/
|
|
729
710
|
short: PropTypes__default["default"].bool,
|
|
730
|
-
|
|
731
711
|
/**
|
|
732
712
|
* The value of the date value provided to flatpickr, could
|
|
733
713
|
* be a date, a date number, a date string, an array of dates.
|
|
734
714
|
*/
|
|
735
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]),
|
|
736
|
-
|
|
737
716
|
/**
|
|
738
717
|
* Specify whether the control is currently in warning state (Fluid only)
|
|
739
718
|
*/
|
|
740
719
|
warn: PropTypes__default["default"].bool,
|
|
741
|
-
|
|
742
720
|
/**
|
|
743
721
|
* Provide the text that is displayed when the control is in warning state (Fluid only)
|
|
744
722
|
*/
|