rsuite 5.47.0 → 5.48.1
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/CHANGELOG.md +20 -0
- package/DateInput/package.json +7 -0
- package/README.md +2 -2
- package/cjs/Affix/Affix.d.ts +6 -0
- package/cjs/Affix/Affix.js +7 -0
- package/cjs/Animation/Bounce.d.ts +4 -0
- package/cjs/Animation/Bounce.js +4 -0
- package/cjs/Animation/Collapse.d.ts +4 -0
- package/cjs/Animation/Collapse.js +5 -0
- package/cjs/Animation/Fade.d.ts +4 -0
- package/cjs/Animation/Fade.js +4 -0
- package/cjs/Animation/Slide.d.ts +4 -0
- package/cjs/Animation/Slide.js +4 -0
- package/cjs/Animation/Transition.d.ts +4 -0
- package/cjs/Animation/Transition.js +4 -0
- package/cjs/AutoComplete/AutoComplete.d.ts +3 -0
- package/cjs/AutoComplete/AutoComplete.js +3 -0
- package/cjs/Avatar/Avatar.d.ts +4 -0
- package/cjs/Avatar/Avatar.js +4 -0
- package/cjs/AvatarGroup/AvatarGroup.d.ts +4 -0
- package/cjs/AvatarGroup/AvatarGroup.js +5 -0
- package/cjs/Badge/Badge.d.ts +4 -0
- package/cjs/Badge/Badge.js +4 -0
- package/cjs/Breadcrumb/Breadcrumb.d.ts +4 -0
- package/cjs/Breadcrumb/Breadcrumb.js +4 -0
- package/cjs/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/cjs/Breadcrumb/BreadcrumbItem.js +4 -0
- package/cjs/Button/Button.d.ts +4 -0
- package/cjs/Button/Button.js +4 -0
- package/cjs/ButtonGroup/ButtonGroup.d.ts +4 -0
- package/cjs/ButtonGroup/ButtonGroup.js +4 -0
- package/cjs/ButtonToolbar/ButtonToolbar.d.ts +4 -0
- package/cjs/ButtonToolbar/ButtonToolbar.js +4 -0
- package/cjs/Calendar/Calendar.d.ts +4 -0
- package/cjs/Calendar/Calendar.js +4 -0
- package/cjs/Carousel/Carousel.d.ts +4 -0
- package/cjs/Carousel/Carousel.js +4 -0
- package/cjs/Cascader/Cascader.d.ts +4 -0
- package/cjs/Cascader/Cascader.js +5 -0
- package/cjs/CheckPicker/CheckPicker.d.ts +4 -0
- package/cjs/CheckPicker/CheckPicker.js +4 -0
- package/cjs/CheckTree/index.d.ts +4 -0
- package/cjs/CheckTree/index.js +4 -0
- package/cjs/CheckTreePicker/CheckTreePicker.d.ts +5 -0
- package/cjs/CheckTreePicker/CheckTreePicker.js +6 -0
- package/cjs/Checkbox/Checkbox.d.ts +4 -0
- package/cjs/Checkbox/Checkbox.js +4 -0
- package/cjs/CheckboxGroup/CheckboxGroup.d.ts +4 -0
- package/cjs/CheckboxGroup/CheckboxGroup.js +4 -0
- package/cjs/Col/Col.d.ts +4 -0
- package/cjs/Col/Col.js +4 -0
- package/cjs/Container/Container.d.ts +4 -0
- package/cjs/Container/Container.js +4 -0
- package/cjs/Content/Content.d.ts +3 -0
- package/cjs/Content/Content.js +3 -0
- package/cjs/CustomProvider/CustomProvider.d.ts +5 -0
- package/cjs/CustomProvider/CustomProvider.js +6 -0
- package/cjs/DOMHelper/index.d.ts +4 -0
- package/cjs/DOMHelper/index.js +4 -0
- package/cjs/DateInput/DateField.d.ts +180 -0
- package/cjs/DateInput/DateField.js +151 -0
- package/cjs/DateInput/DateInput.d.ts +18 -0
- package/cjs/DateInput/DateInput.js +222 -0
- package/cjs/DateInput/index.d.ts +3 -0
- package/cjs/DateInput/index.js +9 -0
- package/cjs/DateInput/useDateInputState.d.ts +165 -0
- package/cjs/DateInput/useDateInputState.js +105 -0
- package/cjs/DateInput/utils.d.ts +41 -0
- package/cjs/DateInput/utils.js +159 -0
- package/cjs/DatePicker/DatePicker.d.ts +5 -0
- package/cjs/DatePicker/DatePicker.js +11 -5
- package/cjs/DateRangePicker/DateRangePicker.d.ts +5 -0
- package/cjs/DateRangePicker/DateRangePicker.js +5 -0
- package/cjs/Divider/Divider.d.ts +4 -0
- package/cjs/Divider/Divider.js +4 -0
- package/cjs/Drawer/Drawer.d.ts +4 -0
- package/cjs/Drawer/Drawer.js +4 -0
- package/cjs/Dropdown/Dropdown.d.ts +6 -3
- package/cjs/Dropdown/Dropdown.js +6 -3
- package/cjs/Dropdown/DropdownItem.d.ts +3 -3
- package/cjs/Dropdown/DropdownItem.js +3 -3
- package/cjs/Dropdown/DropdownMenu.d.ts +3 -3
- package/cjs/Dropdown/DropdownMenu.js +3 -3
- package/cjs/Dropdown/DropdownSeparator.d.ts +1 -1
- package/cjs/Dropdown/DropdownSeparator.js +1 -1
- package/cjs/FlexboxGrid/FlexboxGrid.d.ts +4 -0
- package/cjs/FlexboxGrid/FlexboxGrid.js +4 -0
- package/cjs/FlexboxGrid/FlexboxGridItem.d.ts +4 -0
- package/cjs/FlexboxGrid/FlexboxGridItem.js +4 -0
- package/cjs/Footer/Footer.d.ts +4 -0
- package/cjs/Footer/Footer.js +4 -0
- package/cjs/Form/Form.d.ts +4 -0
- package/cjs/Form/Form.js +4 -0
- package/cjs/FormControl/FormControl.d.ts +4 -0
- package/cjs/FormControl/FormControl.js +6 -1
- package/cjs/FormControlLabel/FormControlLabel.d.ts +4 -0
- package/cjs/FormControlLabel/FormControlLabel.js +4 -0
- package/cjs/FormErrorMessage/FormErrorMessage.d.ts +4 -0
- package/cjs/FormErrorMessage/FormErrorMessage.js +4 -0
- package/cjs/FormGroup/FormGroup.d.ts +4 -0
- package/cjs/FormGroup/FormGroup.js +5 -0
- package/cjs/FormHelpText/FormHelpText.d.ts +4 -0
- package/cjs/FormHelpText/FormHelpText.js +4 -0
- package/cjs/Grid/Grid.d.ts +4 -0
- package/cjs/Grid/Grid.js +4 -0
- package/cjs/Header/Header.d.ts +4 -0
- package/cjs/Header/Header.js +4 -0
- package/cjs/IconButton/IconButton.d.ts +4 -0
- package/cjs/IconButton/IconButton.js +4 -0
- package/cjs/Input/Input.d.ts +4 -0
- package/cjs/Input/Input.js +4 -0
- package/cjs/InputGroup/InputGroup.d.ts +4 -0
- package/cjs/InputGroup/InputGroup.js +4 -0
- package/cjs/InputGroup/InputGroupAddon.d.ts +4 -0
- package/cjs/InputGroup/InputGroupAddon.js +4 -0
- package/cjs/InputGroup/InputGroupButton.d.ts +4 -0
- package/cjs/InputGroup/InputGroupButton.js +4 -0
- package/cjs/InputNumber/InputNumber.d.ts +4 -0
- package/cjs/InputNumber/InputNumber.js +5 -0
- package/cjs/InputPicker/InputPicker.d.ts +5 -0
- package/cjs/InputPicker/InputPicker.js +5 -0
- package/cjs/List/List.d.ts +4 -0
- package/cjs/List/List.js +4 -0
- package/cjs/List/ListItem.d.ts +4 -0
- package/cjs/List/ListItem.js +4 -0
- package/cjs/Loader/Loader.d.ts +4 -0
- package/cjs/Loader/Loader.js +4 -0
- package/cjs/MaskedInput/TextMask.d.ts +4 -0
- package/cjs/MaskedInput/TextMask.js +5 -0
- package/cjs/MaskedInput/createTextMaskInputElement.js +6 -16
- package/cjs/Message/Message.d.ts +4 -0
- package/cjs/Message/Message.js +4 -0
- package/cjs/Modal/Modal.d.ts +4 -0
- package/cjs/Modal/Modal.js +4 -0
- package/cjs/MultiCascader/MultiCascader.d.ts +4 -0
- package/cjs/MultiCascader/MultiCascader.js +8 -1
- package/cjs/Nav/Nav.d.ts +4 -0
- package/cjs/Nav/Nav.js +4 -0
- package/cjs/Nav/NavDropdown.d.ts +2 -1
- package/cjs/Nav/NavDropdown.js +2 -1
- package/cjs/Nav/NavItem.d.ts +6 -3
- package/cjs/Nav/NavItem.js +6 -3
- package/cjs/Nav/NavMenu.d.ts +6 -3
- package/cjs/Nav/NavMenu.js +6 -3
- package/cjs/Navbar/Navbar.d.ts +4 -0
- package/cjs/Navbar/Navbar.js +4 -0
- package/cjs/Notification/Notification.d.ts +5 -0
- package/cjs/Notification/Notification.js +5 -0
- package/cjs/Overlay/Overlay.d.ts +4 -0
- package/cjs/Overlay/Overlay.js +5 -0
- package/cjs/Overlay/OverlayTrigger.d.ts +4 -0
- package/cjs/Overlay/OverlayTrigger.js +16 -11
- package/cjs/Overlay/Position.d.ts +4 -0
- package/cjs/Overlay/Position.js +4 -0
- package/cjs/Pagination/Pagination.d.ts +5 -0
- package/cjs/Pagination/Pagination.js +5 -0
- package/cjs/Panel/Panel.d.ts +4 -0
- package/cjs/Panel/Panel.js +4 -0
- package/cjs/PanelGroup/PanelGroup.d.ts +4 -0
- package/cjs/PanelGroup/PanelGroup.js +5 -0
- package/cjs/Picker/PickerToggle.js +2 -1
- package/cjs/Placeholder/Placeholder.d.ts +4 -0
- package/cjs/Placeholder/Placeholder.js +4 -0
- package/cjs/Placeholder/PlaceholderGraph.d.ts +4 -0
- package/cjs/Placeholder/PlaceholderGraph.js +4 -0
- package/cjs/Placeholder/PlaceholderGrid.d.ts +4 -0
- package/cjs/Placeholder/PlaceholderGrid.js +4 -0
- package/cjs/Placeholder/PlaceholderParagraph.d.ts +4 -0
- package/cjs/Placeholder/PlaceholderParagraph.js +4 -0
- package/cjs/Plaintext/Plaintext.d.ts +2 -1
- package/cjs/Plaintext/Plaintext.js +5 -2
- package/cjs/Popover/Popover.d.ts +4 -0
- package/cjs/Popover/Popover.js +4 -0
- package/cjs/Progress/Progress.d.ts +4 -0
- package/cjs/Progress/Progress.js +4 -0
- package/cjs/Progress/ProgressCircle.d.ts +4 -0
- package/cjs/Progress/ProgressCircle.js +4 -0
- package/cjs/Progress/ProgressLine.d.ts +4 -0
- package/cjs/Progress/ProgressLine.js +4 -0
- package/cjs/Radio/Radio.d.ts +4 -0
- package/cjs/Radio/Radio.js +4 -0
- package/cjs/RadioGroup/RadioGroup.d.ts +4 -0
- package/cjs/RadioGroup/RadioGroup.js +5 -0
- package/cjs/RadioTileGroup/RadioTileGroup.d.ts +5 -0
- package/cjs/RadioTileGroup/RadioTileGroup.js +6 -0
- package/cjs/RangeSlider/RangeSlider.d.ts +4 -0
- package/cjs/RangeSlider/RangeSlider.js +5 -0
- package/cjs/Rate/Rate.d.ts +4 -0
- package/cjs/Rate/Rate.js +4 -0
- package/cjs/Ripple/Ripple.d.ts +4 -0
- package/cjs/Ripple/Ripple.js +5 -0
- package/cjs/Row/Row.d.ts +4 -0
- package/cjs/Row/Row.js +4 -0
- package/cjs/SafeAnchor/SafeAnchor.d.ts +4 -0
- package/cjs/SafeAnchor/SafeAnchor.js +5 -0
- package/cjs/Schema/Schema.d.ts +6 -0
- package/cjs/Schema/Schema.js +6 -0
- package/cjs/SelectPicker/SelectPicker.d.ts +4 -0
- package/cjs/SelectPicker/SelectPicker.js +4 -0
- package/cjs/Sidebar/Sidebar.d.ts +4 -0
- package/cjs/Sidebar/Sidebar.js +4 -0
- package/cjs/Sidenav/Sidenav.d.ts +4 -0
- package/cjs/Sidenav/Sidenav.js +5 -0
- package/cjs/Sidenav/SidenavBody.d.ts +5 -0
- package/cjs/Sidenav/SidenavBody.js +5 -0
- package/cjs/Sidenav/SidenavHeader.d.ts +5 -0
- package/cjs/Sidenav/SidenavHeader.js +5 -0
- package/cjs/Slider/Slider.d.ts +5 -0
- package/cjs/Slider/Slider.js +6 -0
- package/cjs/Stack/Stack.d.ts +6 -0
- package/cjs/Stack/Stack.js +6 -0
- package/cjs/Stack/StackItem.d.ts +5 -0
- package/cjs/Stack/StackItem.js +5 -0
- package/cjs/Steps/StepItem.d.ts +5 -0
- package/cjs/Steps/StepItem.js +5 -0
- package/cjs/Steps/Steps.d.ts +5 -0
- package/cjs/Steps/Steps.js +5 -0
- package/cjs/Table/Table.d.ts +19 -2
- package/cjs/Table/Table.js +20 -1
- package/cjs/Tag/Tag.d.ts +6 -0
- package/cjs/Tag/Tag.js +6 -0
- package/cjs/TagGroup/TagGroup.d.ts +5 -0
- package/cjs/TagGroup/TagGroup.js +5 -0
- package/cjs/TagInput/index.d.ts +5 -0
- package/cjs/TagInput/index.js +5 -0
- package/cjs/TagPicker/index.d.ts +2 -1
- package/cjs/TagPicker/index.js +2 -1
- package/cjs/Timeline/Timeline.d.ts +5 -0
- package/cjs/Timeline/Timeline.js +5 -0
- package/cjs/Timeline/TimelineItem.d.ts +5 -0
- package/cjs/Timeline/TimelineItem.js +5 -0
- package/cjs/Toggle/Toggle.d.ts +5 -0
- package/cjs/Toggle/Toggle.js +5 -0
- package/cjs/Tooltip/Tooltip.d.ts +5 -0
- package/cjs/Tooltip/Tooltip.js +5 -0
- package/cjs/Tree/Tree.d.ts +5 -0
- package/cjs/Tree/Tree.js +5 -0
- package/cjs/TreePicker/TreePicker.d.ts +5 -0
- package/cjs/TreePicker/TreePicker.js +6 -0
- package/cjs/Uploader/Uploader.d.ts +5 -0
- package/cjs/Uploader/Uploader.js +6 -0
- package/cjs/Whisper/Whisper.d.ts +6 -0
- package/cjs/Whisper/Whisper.js +6 -0
- package/cjs/Windowing/AutoSizer.d.ts +5 -0
- package/cjs/Windowing/AutoSizer.js +5 -0
- package/cjs/Windowing/List.d.ts +6 -1
- package/cjs/Windowing/List.js +5 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +6 -2
- package/cjs/toaster/toaster.d.ts +9 -7
- package/cjs/toaster/useToaster.d.ts +19 -1
- package/cjs/toaster/useToaster.js +19 -1
- package/cjs/useMediaQuery/index.d.ts +2 -0
- package/cjs/useMediaQuery/index.js +9 -0
- package/cjs/useMediaQuery/useMediaQuery.d.ts +23 -0
- package/cjs/useMediaQuery/useMediaQuery.js +123 -0
- package/cjs/utils/BrowserDetection.d.ts +1 -0
- package/cjs/utils/BrowserDetection.js +5 -1
- package/cjs/utils/dateUtils.d.ts +6 -0
- package/cjs/utils/dateUtils.js +13 -1
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +4 -1
- package/cjs/utils/safeSetSelection.d.ts +2 -0
- package/cjs/utils/safeSetSelection.js +21 -0
- package/cjs/utils/treeUtils.d.ts +2 -2
- package/dist/rsuite.js +337 -123
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Affix/Affix.d.ts +6 -0
- package/esm/Affix/Affix.js +7 -0
- package/esm/Animation/Bounce.d.ts +4 -0
- package/esm/Animation/Bounce.js +4 -0
- package/esm/Animation/Collapse.d.ts +4 -0
- package/esm/Animation/Collapse.js +5 -0
- package/esm/Animation/Fade.d.ts +4 -0
- package/esm/Animation/Fade.js +4 -0
- package/esm/Animation/Slide.d.ts +4 -0
- package/esm/Animation/Slide.js +4 -0
- package/esm/Animation/Transition.d.ts +4 -0
- package/esm/Animation/Transition.js +4 -0
- package/esm/AutoComplete/AutoComplete.d.ts +3 -0
- package/esm/AutoComplete/AutoComplete.js +3 -0
- package/esm/Avatar/Avatar.d.ts +4 -0
- package/esm/Avatar/Avatar.js +4 -0
- package/esm/AvatarGroup/AvatarGroup.d.ts +4 -0
- package/esm/AvatarGroup/AvatarGroup.js +5 -0
- package/esm/Badge/Badge.d.ts +4 -0
- package/esm/Badge/Badge.js +4 -0
- package/esm/Breadcrumb/Breadcrumb.d.ts +4 -0
- package/esm/Breadcrumb/Breadcrumb.js +4 -0
- package/esm/Breadcrumb/BreadcrumbItem.d.ts +4 -0
- package/esm/Breadcrumb/BreadcrumbItem.js +4 -0
- package/esm/Button/Button.d.ts +4 -0
- package/esm/Button/Button.js +4 -0
- package/esm/ButtonGroup/ButtonGroup.d.ts +4 -0
- package/esm/ButtonGroup/ButtonGroup.js +4 -0
- package/esm/ButtonToolbar/ButtonToolbar.d.ts +4 -0
- package/esm/ButtonToolbar/ButtonToolbar.js +4 -0
- package/esm/Calendar/Calendar.d.ts +4 -0
- package/esm/Calendar/Calendar.js +4 -0
- package/esm/Carousel/Carousel.d.ts +4 -0
- package/esm/Carousel/Carousel.js +4 -0
- package/esm/Cascader/Cascader.d.ts +4 -0
- package/esm/Cascader/Cascader.js +5 -0
- package/esm/CheckPicker/CheckPicker.d.ts +4 -0
- package/esm/CheckPicker/CheckPicker.js +4 -0
- package/esm/CheckTree/index.d.ts +4 -0
- package/esm/CheckTree/index.js +4 -0
- package/esm/CheckTreePicker/CheckTreePicker.d.ts +5 -0
- package/esm/CheckTreePicker/CheckTreePicker.js +6 -0
- package/esm/Checkbox/Checkbox.d.ts +4 -0
- package/esm/Checkbox/Checkbox.js +4 -0
- package/esm/CheckboxGroup/CheckboxGroup.d.ts +4 -0
- package/esm/CheckboxGroup/CheckboxGroup.js +4 -0
- package/esm/Col/Col.d.ts +4 -0
- package/esm/Col/Col.js +4 -0
- package/esm/Container/Container.d.ts +4 -0
- package/esm/Container/Container.js +4 -0
- package/esm/Content/Content.d.ts +3 -0
- package/esm/Content/Content.js +3 -0
- package/esm/CustomProvider/CustomProvider.d.ts +5 -0
- package/esm/CustomProvider/CustomProvider.js +6 -0
- package/esm/DOMHelper/index.d.ts +4 -0
- package/esm/DOMHelper/index.js +5 -0
- package/esm/DateInput/DateField.d.ts +180 -0
- package/esm/DateInput/DateField.js +144 -0
- package/esm/DateInput/DateInput.d.ts +18 -0
- package/esm/DateInput/DateInput.js +215 -0
- package/esm/DateInput/index.d.ts +3 -0
- package/esm/DateInput/index.js +3 -0
- package/esm/DateInput/useDateInputState.d.ts +165 -0
- package/esm/DateInput/useDateInputState.js +99 -0
- package/esm/DateInput/utils.d.ts +41 -0
- package/esm/DateInput/utils.js +151 -0
- package/esm/DatePicker/DatePicker.d.ts +5 -0
- package/esm/DatePicker/DatePicker.js +11 -5
- package/esm/DateRangePicker/DateRangePicker.d.ts +5 -0
- package/esm/DateRangePicker/DateRangePicker.js +5 -0
- package/esm/Divider/Divider.d.ts +4 -0
- package/esm/Divider/Divider.js +4 -0
- package/esm/Drawer/Drawer.d.ts +4 -0
- package/esm/Drawer/Drawer.js +4 -0
- package/esm/Dropdown/Dropdown.d.ts +6 -3
- package/esm/Dropdown/Dropdown.js +6 -3
- package/esm/Dropdown/DropdownItem.d.ts +3 -3
- package/esm/Dropdown/DropdownItem.js +3 -3
- package/esm/Dropdown/DropdownMenu.d.ts +3 -3
- package/esm/Dropdown/DropdownMenu.js +3 -3
- package/esm/Dropdown/DropdownSeparator.d.ts +1 -1
- package/esm/Dropdown/DropdownSeparator.js +1 -1
- package/esm/FlexboxGrid/FlexboxGrid.d.ts +4 -0
- package/esm/FlexboxGrid/FlexboxGrid.js +4 -0
- package/esm/FlexboxGrid/FlexboxGridItem.d.ts +4 -0
- package/esm/FlexboxGrid/FlexboxGridItem.js +4 -0
- package/esm/Footer/Footer.d.ts +4 -0
- package/esm/Footer/Footer.js +4 -0
- package/esm/Form/Form.d.ts +4 -0
- package/esm/Form/Form.js +4 -0
- package/esm/FormControl/FormControl.d.ts +4 -0
- package/esm/FormControl/FormControl.js +6 -1
- package/esm/FormControlLabel/FormControlLabel.d.ts +4 -0
- package/esm/FormControlLabel/FormControlLabel.js +4 -0
- package/esm/FormErrorMessage/FormErrorMessage.d.ts +4 -0
- package/esm/FormErrorMessage/FormErrorMessage.js +4 -0
- package/esm/FormGroup/FormGroup.d.ts +4 -0
- package/esm/FormGroup/FormGroup.js +5 -0
- package/esm/FormHelpText/FormHelpText.d.ts +4 -0
- package/esm/FormHelpText/FormHelpText.js +4 -0
- package/esm/Grid/Grid.d.ts +4 -0
- package/esm/Grid/Grid.js +4 -0
- package/esm/Header/Header.d.ts +4 -0
- package/esm/Header/Header.js +4 -0
- package/esm/IconButton/IconButton.d.ts +4 -0
- package/esm/IconButton/IconButton.js +4 -0
- package/esm/Input/Input.d.ts +4 -0
- package/esm/Input/Input.js +4 -0
- package/esm/InputGroup/InputGroup.d.ts +4 -0
- package/esm/InputGroup/InputGroup.js +4 -0
- package/esm/InputGroup/InputGroupAddon.d.ts +4 -0
- package/esm/InputGroup/InputGroupAddon.js +4 -0
- package/esm/InputGroup/InputGroupButton.d.ts +4 -0
- package/esm/InputGroup/InputGroupButton.js +5 -0
- package/esm/InputNumber/InputNumber.d.ts +4 -0
- package/esm/InputNumber/InputNumber.js +5 -0
- package/esm/InputPicker/InputPicker.d.ts +5 -0
- package/esm/InputPicker/InputPicker.js +5 -0
- package/esm/List/List.d.ts +4 -0
- package/esm/List/List.js +4 -0
- package/esm/List/ListItem.d.ts +4 -0
- package/esm/List/ListItem.js +4 -0
- package/esm/Loader/Loader.d.ts +4 -0
- package/esm/Loader/Loader.js +4 -0
- package/esm/MaskedInput/TextMask.d.ts +4 -0
- package/esm/MaskedInput/TextMask.js +5 -0
- package/esm/MaskedInput/createTextMaskInputElement.js +6 -16
- package/esm/Message/Message.d.ts +4 -0
- package/esm/Message/Message.js +4 -0
- package/esm/Modal/Modal.d.ts +4 -0
- package/esm/Modal/Modal.js +4 -0
- package/esm/MultiCascader/MultiCascader.d.ts +4 -0
- package/esm/MultiCascader/MultiCascader.js +9 -2
- package/esm/Nav/Nav.d.ts +4 -0
- package/esm/Nav/Nav.js +4 -0
- package/esm/Nav/NavDropdown.d.ts +2 -1
- package/esm/Nav/NavDropdown.js +2 -1
- package/esm/Nav/NavItem.d.ts +6 -3
- package/esm/Nav/NavItem.js +6 -3
- package/esm/Nav/NavMenu.d.ts +6 -3
- package/esm/Nav/NavMenu.js +6 -3
- package/esm/Navbar/Navbar.d.ts +4 -0
- package/esm/Navbar/Navbar.js +4 -0
- package/esm/Notification/Notification.d.ts +5 -0
- package/esm/Notification/Notification.js +5 -0
- package/esm/Overlay/Overlay.d.ts +4 -0
- package/esm/Overlay/Overlay.js +5 -0
- package/esm/Overlay/OverlayTrigger.d.ts +4 -0
- package/esm/Overlay/OverlayTrigger.js +16 -11
- package/esm/Overlay/Position.d.ts +4 -0
- package/esm/Overlay/Position.js +4 -0
- package/esm/Pagination/Pagination.d.ts +5 -0
- package/esm/Pagination/Pagination.js +5 -0
- package/esm/Panel/Panel.d.ts +4 -0
- package/esm/Panel/Panel.js +4 -0
- package/esm/PanelGroup/PanelGroup.d.ts +4 -0
- package/esm/PanelGroup/PanelGroup.js +5 -0
- package/esm/Picker/PickerToggle.js +2 -1
- package/esm/Placeholder/Placeholder.d.ts +4 -0
- package/esm/Placeholder/Placeholder.js +4 -0
- package/esm/Placeholder/PlaceholderGraph.d.ts +4 -0
- package/esm/Placeholder/PlaceholderGraph.js +4 -0
- package/esm/Placeholder/PlaceholderGrid.d.ts +4 -0
- package/esm/Placeholder/PlaceholderGrid.js +4 -0
- package/esm/Placeholder/PlaceholderParagraph.d.ts +4 -0
- package/esm/Placeholder/PlaceholderParagraph.js +4 -0
- package/esm/Plaintext/Plaintext.d.ts +2 -1
- package/esm/Plaintext/Plaintext.js +5 -2
- package/esm/Popover/Popover.d.ts +4 -0
- package/esm/Popover/Popover.js +4 -0
- package/esm/Progress/Progress.d.ts +4 -0
- package/esm/Progress/Progress.js +4 -0
- package/esm/Progress/ProgressCircle.d.ts +4 -0
- package/esm/Progress/ProgressCircle.js +4 -0
- package/esm/Progress/ProgressLine.d.ts +4 -0
- package/esm/Progress/ProgressLine.js +4 -0
- package/esm/Radio/Radio.d.ts +4 -0
- package/esm/Radio/Radio.js +4 -0
- package/esm/RadioGroup/RadioGroup.d.ts +4 -0
- package/esm/RadioGroup/RadioGroup.js +5 -0
- package/esm/RadioTileGroup/RadioTileGroup.d.ts +5 -0
- package/esm/RadioTileGroup/RadioTileGroup.js +6 -0
- package/esm/RangeSlider/RangeSlider.d.ts +4 -0
- package/esm/RangeSlider/RangeSlider.js +5 -0
- package/esm/Rate/Rate.d.ts +4 -0
- package/esm/Rate/Rate.js +4 -0
- package/esm/Ripple/Ripple.d.ts +4 -0
- package/esm/Ripple/Ripple.js +5 -0
- package/esm/Row/Row.d.ts +4 -0
- package/esm/Row/Row.js +4 -0
- package/esm/SafeAnchor/SafeAnchor.d.ts +4 -0
- package/esm/SafeAnchor/SafeAnchor.js +5 -0
- package/esm/Schema/Schema.d.ts +6 -0
- package/esm/Schema/Schema.js +7 -0
- package/esm/SelectPicker/SelectPicker.d.ts +4 -0
- package/esm/SelectPicker/SelectPicker.js +4 -0
- package/esm/Sidebar/Sidebar.d.ts +4 -0
- package/esm/Sidebar/Sidebar.js +4 -0
- package/esm/Sidenav/Sidenav.d.ts +4 -0
- package/esm/Sidenav/Sidenav.js +5 -0
- package/esm/Sidenav/SidenavBody.d.ts +5 -0
- package/esm/Sidenav/SidenavBody.js +5 -0
- package/esm/Sidenav/SidenavHeader.d.ts +5 -0
- package/esm/Sidenav/SidenavHeader.js +5 -0
- package/esm/Slider/Slider.d.ts +5 -0
- package/esm/Slider/Slider.js +6 -0
- package/esm/Stack/Stack.d.ts +6 -0
- package/esm/Stack/Stack.js +6 -0
- package/esm/Stack/StackItem.d.ts +5 -0
- package/esm/Stack/StackItem.js +5 -0
- package/esm/Steps/StepItem.d.ts +5 -0
- package/esm/Steps/StepItem.js +5 -0
- package/esm/Steps/Steps.d.ts +5 -0
- package/esm/Steps/Steps.js +5 -0
- package/esm/Table/Table.d.ts +19 -2
- package/esm/Table/Table.js +23 -4
- package/esm/Tag/Tag.d.ts +6 -0
- package/esm/Tag/Tag.js +6 -0
- package/esm/TagGroup/TagGroup.d.ts +5 -0
- package/esm/TagGroup/TagGroup.js +5 -0
- package/esm/TagInput/index.d.ts +5 -0
- package/esm/TagInput/index.js +5 -0
- package/esm/TagPicker/index.d.ts +2 -1
- package/esm/TagPicker/index.js +2 -1
- package/esm/Timeline/Timeline.d.ts +5 -0
- package/esm/Timeline/Timeline.js +5 -0
- package/esm/Timeline/TimelineItem.d.ts +5 -0
- package/esm/Timeline/TimelineItem.js +5 -0
- package/esm/Toggle/Toggle.d.ts +5 -0
- package/esm/Toggle/Toggle.js +5 -0
- package/esm/Tooltip/Tooltip.d.ts +5 -0
- package/esm/Tooltip/Tooltip.js +5 -0
- package/esm/Tree/Tree.d.ts +5 -0
- package/esm/Tree/Tree.js +5 -0
- package/esm/TreePicker/TreePicker.d.ts +5 -0
- package/esm/TreePicker/TreePicker.js +6 -0
- package/esm/Uploader/Uploader.d.ts +5 -0
- package/esm/Uploader/Uploader.js +6 -0
- package/esm/Whisper/Whisper.d.ts +6 -0
- package/esm/Whisper/Whisper.js +6 -0
- package/esm/Windowing/AutoSizer.d.ts +5 -0
- package/esm/Windowing/AutoSizer.js +5 -0
- package/esm/Windowing/List.d.ts +6 -1
- package/esm/Windowing/List.js +5 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -1
- package/esm/toaster/toaster.d.ts +9 -7
- package/esm/toaster/useToaster.d.ts +19 -1
- package/esm/toaster/useToaster.js +19 -1
- package/esm/useMediaQuery/index.d.ts +2 -0
- package/esm/useMediaQuery/index.js +3 -0
- package/esm/useMediaQuery/useMediaQuery.d.ts +23 -0
- package/esm/useMediaQuery/useMediaQuery.js +113 -0
- package/esm/utils/BrowserDetection.d.ts +1 -0
- package/esm/utils/BrowserDetection.js +3 -0
- package/esm/utils/dateUtils.d.ts +6 -0
- package/esm/utils/dateUtils.js +6 -0
- package/esm/utils/index.d.ts +1 -0
- package/esm/utils/index.js +1 -0
- package/esm/utils/safeSetSelection.d.ts +2 -0
- package/esm/utils/safeSetSelection.js +16 -0
- package/esm/utils/treeUtils.d.ts +2 -2
- package/package.json +1 -1
- package/useMediaQuery/package.json +7 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { Locale } from 'date-fns';
|
|
2
|
+
interface DateInputState {
|
|
3
|
+
formatStr: string;
|
|
4
|
+
localize: Locale['localize'];
|
|
5
|
+
date?: Date | null;
|
|
6
|
+
isControlledDate?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function useDateInputState({ formatStr, localize, date, isControlledDate }: DateInputState): {
|
|
9
|
+
dateField: {
|
|
10
|
+
year: any;
|
|
11
|
+
format: string;
|
|
12
|
+
patternArray: {
|
|
13
|
+
pattern: string;
|
|
14
|
+
key: string;
|
|
15
|
+
}[];
|
|
16
|
+
month: number | null;
|
|
17
|
+
day: number | null;
|
|
18
|
+
hour: number | null;
|
|
19
|
+
minute: number | null;
|
|
20
|
+
second: number | null;
|
|
21
|
+
meridian: "AM" | "PM" | null;
|
|
22
|
+
constructor: Function;
|
|
23
|
+
toString(): string;
|
|
24
|
+
toLocaleString(): string;
|
|
25
|
+
valueOf(): Object;
|
|
26
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
27
|
+
isPrototypeOf(v: Object): boolean;
|
|
28
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
29
|
+
should: Chai.Assertion;
|
|
30
|
+
} | {
|
|
31
|
+
month: any;
|
|
32
|
+
format: string;
|
|
33
|
+
patternArray: {
|
|
34
|
+
pattern: string;
|
|
35
|
+
key: string;
|
|
36
|
+
}[];
|
|
37
|
+
year: number | null;
|
|
38
|
+
day: number | null;
|
|
39
|
+
hour: number | null;
|
|
40
|
+
minute: number | null;
|
|
41
|
+
second: number | null;
|
|
42
|
+
meridian: "AM" | "PM" | null;
|
|
43
|
+
constructor: Function;
|
|
44
|
+
toString(): string;
|
|
45
|
+
toLocaleString(): string;
|
|
46
|
+
valueOf(): Object;
|
|
47
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
48
|
+
isPrototypeOf(v: Object): boolean;
|
|
49
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
50
|
+
should: Chai.Assertion;
|
|
51
|
+
} | {
|
|
52
|
+
day: any;
|
|
53
|
+
format: string;
|
|
54
|
+
patternArray: {
|
|
55
|
+
pattern: string;
|
|
56
|
+
key: string;
|
|
57
|
+
}[];
|
|
58
|
+
year: number | null;
|
|
59
|
+
month: number | null;
|
|
60
|
+
hour: number | null;
|
|
61
|
+
minute: number | null;
|
|
62
|
+
second: number | null;
|
|
63
|
+
meridian: "AM" | "PM" | null;
|
|
64
|
+
constructor: Function;
|
|
65
|
+
toString(): string;
|
|
66
|
+
toLocaleString(): string;
|
|
67
|
+
valueOf(): Object;
|
|
68
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
69
|
+
isPrototypeOf(v: Object): boolean;
|
|
70
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
71
|
+
should: Chai.Assertion;
|
|
72
|
+
} | {
|
|
73
|
+
hour: any;
|
|
74
|
+
format: string;
|
|
75
|
+
patternArray: {
|
|
76
|
+
pattern: string;
|
|
77
|
+
key: string;
|
|
78
|
+
}[];
|
|
79
|
+
year: number | null;
|
|
80
|
+
month: number | null;
|
|
81
|
+
day: number | null;
|
|
82
|
+
minute: number | null;
|
|
83
|
+
second: number | null;
|
|
84
|
+
meridian: "AM" | "PM" | null;
|
|
85
|
+
constructor: Function;
|
|
86
|
+
toString(): string;
|
|
87
|
+
toLocaleString(): string;
|
|
88
|
+
valueOf(): Object;
|
|
89
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
90
|
+
isPrototypeOf(v: Object): boolean;
|
|
91
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
92
|
+
should: Chai.Assertion;
|
|
93
|
+
} | {
|
|
94
|
+
minute: any;
|
|
95
|
+
format: string;
|
|
96
|
+
patternArray: {
|
|
97
|
+
pattern: string;
|
|
98
|
+
key: string;
|
|
99
|
+
}[];
|
|
100
|
+
year: number | null;
|
|
101
|
+
month: number | null;
|
|
102
|
+
day: number | null;
|
|
103
|
+
hour: number | null;
|
|
104
|
+
second: number | null;
|
|
105
|
+
meridian: "AM" | "PM" | null;
|
|
106
|
+
constructor: Function;
|
|
107
|
+
toString(): string;
|
|
108
|
+
toLocaleString(): string;
|
|
109
|
+
valueOf(): Object;
|
|
110
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
111
|
+
isPrototypeOf(v: Object): boolean;
|
|
112
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
113
|
+
should: Chai.Assertion;
|
|
114
|
+
} | {
|
|
115
|
+
second: any;
|
|
116
|
+
format: string;
|
|
117
|
+
patternArray: {
|
|
118
|
+
pattern: string;
|
|
119
|
+
key: string;
|
|
120
|
+
}[];
|
|
121
|
+
year: number | null;
|
|
122
|
+
month: number | null;
|
|
123
|
+
day: number | null;
|
|
124
|
+
hour: number | null;
|
|
125
|
+
minute: number | null;
|
|
126
|
+
meridian: "AM" | "PM" | null;
|
|
127
|
+
constructor: Function;
|
|
128
|
+
toString(): string;
|
|
129
|
+
toLocaleString(): string;
|
|
130
|
+
valueOf(): Object;
|
|
131
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
132
|
+
isPrototypeOf(v: Object): boolean;
|
|
133
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
134
|
+
should: Chai.Assertion;
|
|
135
|
+
} | {
|
|
136
|
+
meridian: any;
|
|
137
|
+
format: string;
|
|
138
|
+
patternArray: {
|
|
139
|
+
pattern: string;
|
|
140
|
+
key: string;
|
|
141
|
+
}[];
|
|
142
|
+
year: number | null;
|
|
143
|
+
month: number | null;
|
|
144
|
+
day: number | null;
|
|
145
|
+
hour: number | null;
|
|
146
|
+
minute: number | null;
|
|
147
|
+
second: number | null;
|
|
148
|
+
constructor: Function;
|
|
149
|
+
toString(): string;
|
|
150
|
+
toLocaleString(): string;
|
|
151
|
+
valueOf(): Object;
|
|
152
|
+
hasOwnProperty(v: PropertyKey): boolean;
|
|
153
|
+
isPrototypeOf(v: Object): boolean;
|
|
154
|
+
propertyIsEnumerable(v: PropertyKey): boolean;
|
|
155
|
+
should: Chai.Assertion;
|
|
156
|
+
};
|
|
157
|
+
setDateOffset: (pattern: string, offset: number, callback?: ((newDate: Date) => void) | undefined) => void;
|
|
158
|
+
setDateField: (pattern: string, value: number | null, callback?: ((newDate: Date) => void) | undefined) => void;
|
|
159
|
+
getDateField: (pattern: string) => {
|
|
160
|
+
name: any;
|
|
161
|
+
value: any;
|
|
162
|
+
};
|
|
163
|
+
toDateString: () => string;
|
|
164
|
+
};
|
|
165
|
+
export default useDateInputState;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import startCase from 'lodash/startCase';
|
|
4
|
+
import { addDays, addMonths, addYears, addHours, addMinutes, addSeconds, format, isLastDayOfMonth, lastDayOfMonth } from '../utils/dateUtils';
|
|
5
|
+
import { useDateField, patternMap } from './DateField';
|
|
6
|
+
function useDateInputState(_ref) {
|
|
7
|
+
var formatStr = _ref.formatStr,
|
|
8
|
+
localize = _ref.localize,
|
|
9
|
+
date = _ref.date,
|
|
10
|
+
isControlledDate = _ref.isControlledDate;
|
|
11
|
+
var _useDateField = useDateField(formatStr, localize, date),
|
|
12
|
+
dateField = _useDateField.dateField,
|
|
13
|
+
dispatch = _useDateField.dispatch,
|
|
14
|
+
toDateString = _useDateField.toDateString,
|
|
15
|
+
toDate = _useDateField.toDate;
|
|
16
|
+
var setDateOffset = useCallback(function (pattern, offset, callback) {
|
|
17
|
+
var currentDate = new Date();
|
|
18
|
+
var year = dateField.year || currentDate.getFullYear();
|
|
19
|
+
var month = dateField.month ? dateField.month - 1 : currentDate.getMonth();
|
|
20
|
+
var day = dateField.day || 0;
|
|
21
|
+
var hour = dateField.hour || 0;
|
|
22
|
+
var minute = dateField.minute || 0;
|
|
23
|
+
var second = dateField.second || 0;
|
|
24
|
+
var actionName;
|
|
25
|
+
var value;
|
|
26
|
+
switch (pattern) {
|
|
27
|
+
case 'y':
|
|
28
|
+
actionName = 'setYear';
|
|
29
|
+
value = addYears(new Date(year, 0), offset).getFullYear();
|
|
30
|
+
break;
|
|
31
|
+
case 'M':
|
|
32
|
+
actionName = 'setMonth';
|
|
33
|
+
value = addMonths(new Date(year, month), offset).getMonth() + 1;
|
|
34
|
+
break;
|
|
35
|
+
case 'd':
|
|
36
|
+
actionName = 'setDay';
|
|
37
|
+
var prevDate = new Date(year, month, day);
|
|
38
|
+
value = addDays(prevDate, offset).getDate();
|
|
39
|
+
if (offset > 0) {
|
|
40
|
+
value = isLastDayOfMonth(prevDate) ? 1 : value;
|
|
41
|
+
} else {
|
|
42
|
+
value = prevDate.getDate() === 1 ? lastDayOfMonth(prevDate).getDate() : value;
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case 'H':
|
|
46
|
+
case 'h':
|
|
47
|
+
actionName = 'setHour';
|
|
48
|
+
value = addHours(new Date(year, month, day, hour), offset).getHours();
|
|
49
|
+
break;
|
|
50
|
+
case 'm':
|
|
51
|
+
actionName = 'setMinute';
|
|
52
|
+
value = addMinutes(new Date(year, month, day, hour, minute), offset).getMinutes();
|
|
53
|
+
break;
|
|
54
|
+
case 's':
|
|
55
|
+
actionName = 'setSecond';
|
|
56
|
+
value = addSeconds(new Date(year, month, day, hour, minute, second), offset).getSeconds();
|
|
57
|
+
break;
|
|
58
|
+
case 'a':
|
|
59
|
+
actionName = 'setMeridian';
|
|
60
|
+
value = dateField.meridian === 'AM' ? 'PM' : 'AM';
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
if (actionName && value) {
|
|
64
|
+
dispatch({
|
|
65
|
+
type: actionName,
|
|
66
|
+
value: value
|
|
67
|
+
});
|
|
68
|
+
var field = patternMap[pattern];
|
|
69
|
+
callback === null || callback === void 0 ? void 0 : callback(toDate(field, value));
|
|
70
|
+
}
|
|
71
|
+
}, [dateField, toDate, dispatch]);
|
|
72
|
+
var setDateField = useCallback(function (pattern, value, callback) {
|
|
73
|
+
var field = patternMap[pattern];
|
|
74
|
+
var actionName = "set" + startCase(field);
|
|
75
|
+
dispatch({
|
|
76
|
+
type: actionName,
|
|
77
|
+
value: value
|
|
78
|
+
});
|
|
79
|
+
callback === null || callback === void 0 ? void 0 : callback(toDate(field, value));
|
|
80
|
+
}, [toDate, dispatch]);
|
|
81
|
+
var getDateField = useCallback(function (pattern) {
|
|
82
|
+
var fieldName = patternMap[pattern];
|
|
83
|
+
return {
|
|
84
|
+
name: fieldName,
|
|
85
|
+
value: dateField[fieldName]
|
|
86
|
+
};
|
|
87
|
+
}, [dateField]);
|
|
88
|
+
var toControlledDateString = useCallback(function () {
|
|
89
|
+
return format(date || new Date(), formatStr);
|
|
90
|
+
}, [date, formatStr]);
|
|
91
|
+
return {
|
|
92
|
+
dateField: dateField,
|
|
93
|
+
setDateOffset: setDateOffset,
|
|
94
|
+
setDateField: setDateField,
|
|
95
|
+
getDateField: getDateField,
|
|
96
|
+
toDateString: isControlledDate ? toControlledDateString : toDateString
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export default useDateInputState;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Locale } from 'date-fns';
|
|
2
|
+
interface SelectedStateOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The input element
|
|
5
|
+
*/
|
|
6
|
+
input: HTMLInputElement;
|
|
7
|
+
/**
|
|
8
|
+
* The direction of the arrow key, left or right
|
|
9
|
+
*/
|
|
10
|
+
direction?: 'left' | 'right';
|
|
11
|
+
/**
|
|
12
|
+
* Format of the string is based on Unicode Technical Standard: https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
13
|
+
*/
|
|
14
|
+
formatStr: string;
|
|
15
|
+
/**
|
|
16
|
+
* The locale object, date-fns locale object
|
|
17
|
+
*/
|
|
18
|
+
localize: Locale['localize'];
|
|
19
|
+
/**
|
|
20
|
+
* The selected month, used to calculate the offset of the character selection range
|
|
21
|
+
*/
|
|
22
|
+
selectedMonth: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* The offset of the value, which is used to calculate the month.
|
|
25
|
+
* This value will be changed when pressing the up and down arrow keys.
|
|
26
|
+
*/
|
|
27
|
+
valueOffset?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The date is rendered in string format according to format
|
|
30
|
+
*/
|
|
31
|
+
dateString: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function getPatternGroups(format: string, pattern: string): string;
|
|
34
|
+
export declare function getInputSelectedState(options: SelectedStateOptions): {
|
|
35
|
+
selectionStart: number;
|
|
36
|
+
selectionEnd: number;
|
|
37
|
+
selectedPattern: string;
|
|
38
|
+
};
|
|
39
|
+
export declare function validateDateTime(type: string, value: number): boolean;
|
|
40
|
+
export declare function modifyDate(date: Date, type: string, value: number): Date;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import { setYear, setMonth, setDate, setHours, setMinutes, setSeconds } from '../utils/dateUtils';
|
|
4
|
+
export function getPatternGroups(format, pattern) {
|
|
5
|
+
var _format$match;
|
|
6
|
+
return ((_format$match = format.match(new RegExp("(" + pattern + ")+"))) === null || _format$match === void 0 ? void 0 : _format$match[0]) || '';
|
|
7
|
+
}
|
|
8
|
+
export function getInputSelectedState(options) {
|
|
9
|
+
var input = options.input,
|
|
10
|
+
direction = options.direction,
|
|
11
|
+
formatStr = options.formatStr,
|
|
12
|
+
localize = options.localize,
|
|
13
|
+
selectedMonth = options.selectedMonth,
|
|
14
|
+
dateString = options.dateString,
|
|
15
|
+
_options$valueOffset = options.valueOffset,
|
|
16
|
+
valueOffset = _options$valueOffset === void 0 ? 0 : _options$valueOffset;
|
|
17
|
+
var getSelectIndexGap = function getSelectIndexGap(pattern) {
|
|
18
|
+
var gap = 0;
|
|
19
|
+
var monthIsAbbreviated = formatStr.includes('MMM');
|
|
20
|
+
var monthIsFull = formatStr.includes('MMMM');
|
|
21
|
+
|
|
22
|
+
// If the month is abbreviated or full, the gap needs to be adjusted.
|
|
23
|
+
if (monthIsAbbreviated || monthIsFull) {
|
|
24
|
+
var isSelected = pattern === 'M';
|
|
25
|
+
if (selectedMonth === null && valueOffset === 0) {
|
|
26
|
+
return gap;
|
|
27
|
+
}
|
|
28
|
+
var month = selectedMonth ? selectedMonth + (isSelected ? valueOffset : 0) : 1;
|
|
29
|
+
if (month > 12) {
|
|
30
|
+
month = 1;
|
|
31
|
+
} else if (month === 0) {
|
|
32
|
+
month = 12;
|
|
33
|
+
}
|
|
34
|
+
var monthStr = localize === null || localize === void 0 ? void 0 : localize.month(month - 1, {
|
|
35
|
+
width: monthIsFull ? 'wide' : 'abbreviated'
|
|
36
|
+
});
|
|
37
|
+
gap = monthStr.length - (monthIsFull ? 4 : 3);
|
|
38
|
+
}
|
|
39
|
+
return gap;
|
|
40
|
+
};
|
|
41
|
+
var getDatePattern = function getDatePattern(selectionIndex, positionOffset) {
|
|
42
|
+
if (positionOffset === void 0) {
|
|
43
|
+
positionOffset = -1;
|
|
44
|
+
}
|
|
45
|
+
var pattern = formatStr.charAt((input === null || input === void 0 ? void 0 : input.selectionStart) || 0);
|
|
46
|
+
if (selectionIndex < 0 || selectionIndex > dateString.length - 1) {
|
|
47
|
+
pattern = formatStr.trim().charAt(0);
|
|
48
|
+
return pattern;
|
|
49
|
+
}
|
|
50
|
+
var gap = getSelectIndexGap(pattern);
|
|
51
|
+
pattern = formatStr.charAt(selectionIndex - gap);
|
|
52
|
+
|
|
53
|
+
// If the pattern is not a letter, then get the pattern from the previous or next letter.
|
|
54
|
+
if (!pattern.match(/[y|d|M|H|h|m|s|a]/)) {
|
|
55
|
+
var nextIndex = selectionIndex + positionOffset;
|
|
56
|
+
pattern = getDatePattern(nextIndex, positionOffset);
|
|
57
|
+
}
|
|
58
|
+
return pattern;
|
|
59
|
+
};
|
|
60
|
+
var getPatternSelectedIndexes = function getPatternSelectedIndexes(pattern) {
|
|
61
|
+
var selectionStart = formatStr.indexOf(pattern);
|
|
62
|
+
var selectionEnd = formatStr.lastIndexOf(pattern) + 1;
|
|
63
|
+
var gap = getSelectIndexGap(pattern);
|
|
64
|
+
if (pattern === 'M') {
|
|
65
|
+
return {
|
|
66
|
+
selectionStart: selectionStart,
|
|
67
|
+
selectionEnd: selectionEnd + gap
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
selectionStart: selectionStart + gap,
|
|
72
|
+
selectionEnd: selectionEnd + gap
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
if (typeof input.selectionEnd === 'number' && typeof input.selectionStart === 'number') {
|
|
76
|
+
var index = input.selectionStart;
|
|
77
|
+
var positionOffset = -1;
|
|
78
|
+
if (direction === 'left') {
|
|
79
|
+
index = input.selectionStart - 1;
|
|
80
|
+
} else if (direction === 'right') {
|
|
81
|
+
index = input.selectionEnd + 1;
|
|
82
|
+
positionOffset = 1;
|
|
83
|
+
}
|
|
84
|
+
var datePattern = getDatePattern(index, positionOffset);
|
|
85
|
+
var indexes = getPatternSelectedIndexes(datePattern);
|
|
86
|
+
return _extends({
|
|
87
|
+
selectedPattern: datePattern
|
|
88
|
+
}, indexes);
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
selectedPattern: 'y',
|
|
92
|
+
selectionStart: 0,
|
|
93
|
+
selectionEnd: 0
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function validateDateTime(type, value) {
|
|
97
|
+
switch (type) {
|
|
98
|
+
case 'year':
|
|
99
|
+
if (value < 1 || value > 9999) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
case 'month':
|
|
104
|
+
if (value < 1 || value > 12) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case 'day':
|
|
109
|
+
if (value < 1 || value > 31) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
break;
|
|
113
|
+
case 'hour':
|
|
114
|
+
if (value < 0 || value > 23) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case 'minute':
|
|
119
|
+
if (value < 0 || value > 59) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
case 'second':
|
|
124
|
+
if (value < 0 || value > 59) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
return false;
|
|
130
|
+
// Invalid type
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
export function modifyDate(date, type, value) {
|
|
136
|
+
switch (type) {
|
|
137
|
+
case 'year':
|
|
138
|
+
return setYear(date, value);
|
|
139
|
+
case 'month':
|
|
140
|
+
return setMonth(date, value - 1);
|
|
141
|
+
case 'day':
|
|
142
|
+
return setDate(date, value);
|
|
143
|
+
case 'hour':
|
|
144
|
+
return setHours(date, value);
|
|
145
|
+
case 'minute':
|
|
146
|
+
return setMinutes(date, value);
|
|
147
|
+
case 'second':
|
|
148
|
+
return setSeconds(date, value);
|
|
149
|
+
}
|
|
150
|
+
return date;
|
|
151
|
+
}
|
|
@@ -101,5 +101,10 @@ export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, Form
|
|
|
101
101
|
/** Custom render value */
|
|
102
102
|
renderValue?: (value: Date, format: string) => string;
|
|
103
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* A date picker allows users to select a date from a calendar.
|
|
106
|
+
*
|
|
107
|
+
* @see https://rsuitejs.com/components/date-picker
|
|
108
|
+
*/
|
|
104
109
|
declare const DatePicker: RsRefForwardingComponent<'div', DatePickerProps>;
|
|
105
110
|
export default DatePicker;
|
|
@@ -22,6 +22,11 @@ import { PickerOverlay, pickerPropTypes, PickerToggle, PickerToggleTrigger, pick
|
|
|
22
22
|
import { OverlayCloseCause } from '../Overlay/OverlayTrigger';
|
|
23
23
|
import { deprecatePropTypeNew } from '../utils/deprecatePropType';
|
|
24
24
|
import { getAriaLabel } from '../Calendar/utils';
|
|
25
|
+
/**
|
|
26
|
+
* A date picker allows users to select a date from a calendar.
|
|
27
|
+
*
|
|
28
|
+
* @see https://rsuitejs.com/components/date-picker
|
|
29
|
+
*/
|
|
25
30
|
var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
26
31
|
var _props$as = props.as,
|
|
27
32
|
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
@@ -43,6 +48,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
43
48
|
limitStartYear = props.limitStartYear,
|
|
44
49
|
overrideLocale = props.locale,
|
|
45
50
|
menuClassName = props.menuClassName,
|
|
51
|
+
menuStyle = props.menuStyle,
|
|
46
52
|
_props$appearance = props.appearance,
|
|
47
53
|
appearance = _props$appearance === void 0 ? 'default' : _props$appearance,
|
|
48
54
|
_props$placement = props.placement,
|
|
@@ -80,7 +86,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
80
86
|
onToggleMonthDropdown = props.onToggleMonthDropdown,
|
|
81
87
|
onToggleTimeDropdown = props.onToggleTimeDropdown,
|
|
82
88
|
onShortcutClick = props.onShortcutClick,
|
|
83
|
-
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "editable", "defaultValue", "disabled", "format", "isoWeek", "limitEndYear", "limitStartYear", "locale", "menuClassName", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "toggleAs", "caretAs", "disabledDate", "disabledHours", "disabledMinutes", "disabledSeconds", "shouldDisableDate", "shouldDisableHour", "shouldDisableMinute", "shouldDisableSecond", "renderValue", "onChange", "onChangeCalendarDate", "onClean", "onClose", "onEntered", "onExited", "onNextMonth", "onOk", "onOpen", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown", "onShortcutClick"]);
|
|
89
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "editable", "defaultValue", "disabled", "format", "isoWeek", "limitEndYear", "limitStartYear", "locale", "menuClassName", "menuStyle", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "toggleAs", "caretAs", "disabledDate", "disabledHours", "disabledMinutes", "disabledSeconds", "shouldDisableDate", "shouldDisableHour", "shouldDisableMinute", "shouldDisableSecond", "renderValue", "onChange", "onChangeCalendarDate", "onClean", "onClose", "onEntered", "onExited", "onNextMonth", "onOk", "onOpen", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown", "onShortcutClick"]);
|
|
84
90
|
var _useCustom = useCustom('DatePicker', overrideLocale),
|
|
85
91
|
locale = _useCustom.locale,
|
|
86
92
|
formatDate = _useCustom.formatDate,
|
|
@@ -471,15 +477,15 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
471
477
|
var bottomRanges = (ranges === null || ranges === void 0 ? void 0 : ranges.filter(function (range) {
|
|
472
478
|
return (range === null || range === void 0 ? void 0 : range.placement) === 'bottom' || (range === null || range === void 0 ? void 0 : range.placement) === undefined;
|
|
473
479
|
})) || [];
|
|
474
|
-
var
|
|
480
|
+
var renderCalendarOverlay = function renderCalendarOverlay(positionProps, speakerRef) {
|
|
475
481
|
var left = positionProps.left,
|
|
476
482
|
top = positionProps.top,
|
|
477
483
|
className = positionProps.className;
|
|
478
484
|
var classes = merge(menuClassName, className, prefix('date-menu'));
|
|
479
|
-
var styles = {
|
|
485
|
+
var styles = _extends({}, menuStyle, {
|
|
480
486
|
left: left,
|
|
481
487
|
top: top
|
|
482
|
-
};
|
|
488
|
+
});
|
|
483
489
|
return /*#__PURE__*/React.createElement(PickerOverlay, {
|
|
484
490
|
role: "dialog",
|
|
485
491
|
className: classes,
|
|
@@ -545,7 +551,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
545
551
|
onClose: handleTriggerClose,
|
|
546
552
|
onEntered: createChainedFunction(handleEntered, onEntered),
|
|
547
553
|
onExited: createChainedFunction(handleExited, onExited),
|
|
548
|
-
speaker:
|
|
554
|
+
speaker: renderCalendarOverlay
|
|
549
555
|
}, /*#__PURE__*/React.createElement(Component, {
|
|
550
556
|
className: merge(className, classes),
|
|
551
557
|
style: style,
|
|
@@ -70,5 +70,10 @@ export interface DateRangePicker extends PickerComponent<DateRangePickerProps> {
|
|
|
70
70
|
/** Used to combine multiple conditions */
|
|
71
71
|
combine?: (...args: any) => DisabledDateFunction;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* A date range picker allows you to select a date range from a calendar.
|
|
75
|
+
*
|
|
76
|
+
* @see https://rsuitejs.com/components/date-range-picker
|
|
77
|
+
*/
|
|
73
78
|
declare const DateRangePicker: DateRangePicker;
|
|
74
79
|
export default DateRangePicker;
|
|
@@ -21,6 +21,11 @@ import * as disabledDateUtils from './disabledDateUtils';
|
|
|
21
21
|
import { getSafeCalendarDate, getMonthHoverRange, getWeekHoverRange, isSameRange } from './utils';
|
|
22
22
|
import { deprecatePropTypeNew } from '../utils/deprecatePropType';
|
|
23
23
|
import DateRangePickerContext from './DateRangePickerContext';
|
|
24
|
+
/**
|
|
25
|
+
* A date range picker allows you to select a date range from a calendar.
|
|
26
|
+
*
|
|
27
|
+
* @see https://rsuitejs.com/components/date-range-picker
|
|
28
|
+
*/
|
|
24
29
|
var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
25
30
|
var _ref, _ref2, _merge;
|
|
26
31
|
var _props$as = props.as,
|
package/esm/Divider/Divider.d.ts
CHANGED
|
@@ -5,5 +5,9 @@ export interface DividerProps extends WithAsProps {
|
|
|
5
5
|
*/
|
|
6
6
|
vertical?: boolean;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* The Divider component is used to separate content.
|
|
10
|
+
* @see https://rsuitejs.com/components/divider
|
|
11
|
+
*/
|
|
8
12
|
declare const Divider: RsRefForwardingComponent<'div', DividerProps>;
|
|
9
13
|
export default Divider;
|
package/esm/Divider/Divider.js
CHANGED
|
@@ -4,6 +4,10 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { useClassNames } from '../utils';
|
|
7
|
+
/**
|
|
8
|
+
* The Divider component is used to separate content.
|
|
9
|
+
* @see https://rsuitejs.com/components/divider
|
|
10
|
+
*/
|
|
7
11
|
var Divider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
8
12
|
var _props$as = props.as,
|
|
9
13
|
Component = _props$as === void 0 ? 'div' : _props$as,
|
package/esm/Drawer/Drawer.d.ts
CHANGED
|
@@ -22,5 +22,9 @@ interface DrawerComponent extends React.FC<DrawerProps> {
|
|
|
22
22
|
*/
|
|
23
23
|
Footer: typeof DrawerFooter;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* The Drawer component is used to display extra content from a main content.
|
|
27
|
+
* @see https://rsuitejs.com/components/drawer
|
|
28
|
+
*/
|
|
25
29
|
declare const Drawer: DrawerComponent;
|
|
26
30
|
export default Drawer;
|
package/esm/Drawer/Drawer.js
CHANGED
|
@@ -43,6 +43,10 @@ var DrawerTitle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
43
43
|
ref: ref
|
|
44
44
|
}));
|
|
45
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* The Drawer component is used to display extra content from a main content.
|
|
48
|
+
* @see https://rsuitejs.com/components/drawer
|
|
49
|
+
*/
|
|
46
50
|
var Drawer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
47
51
|
var className = props.className,
|
|
48
52
|
_props$placement = props.placement,
|
|
@@ -62,9 +62,12 @@ export interface DropdownComponent extends RsRefForwardingComponent<'div', Dropd
|
|
|
62
62
|
Separator: typeof DropdownSeparator;
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
|
-
* The
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* The `Dropdown` component is used to select an option from a set of options.
|
|
66
|
+
* @see https://rsuitejs.com/components/dropdown
|
|
67
|
+
*
|
|
68
|
+
* The `<Dropdown>` API
|
|
69
|
+
* - When used inside `<Sidenav>`, renders a `<TreeviewRootItem>`;
|
|
70
|
+
* - Otherwise renders a `<MenuRoot>`
|
|
68
71
|
*/
|
|
69
72
|
declare const Dropdown: DropdownComponent;
|
|
70
73
|
export default Dropdown;
|
package/esm/Dropdown/Dropdown.js
CHANGED
|
@@ -19,9 +19,12 @@ import warnOnce from '../utils/warnOnce';
|
|
|
19
19
|
import Nav from '../Nav';
|
|
20
20
|
import DropdownSeparator from './DropdownSeparator';
|
|
21
21
|
/**
|
|
22
|
-
* The
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* The `Dropdown` component is used to select an option from a set of options.
|
|
23
|
+
* @see https://rsuitejs.com/components/dropdown
|
|
24
|
+
*
|
|
25
|
+
* The `<Dropdown>` API
|
|
26
|
+
* - When used inside `<Sidenav>`, renders a `<TreeviewRootItem>`;
|
|
27
|
+
* - Otherwise renders a `<MenuRoot>`
|
|
25
28
|
*/
|
|
26
29
|
var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
27
30
|
var activeKey = props.activeKey,
|
|
@@ -39,9 +39,9 @@ export interface DropdownMenuItemProps<T = any> extends WithAsProps, Omit<React.
|
|
|
39
39
|
onSelect?: (eventKey: T, event: React.SyntheticEvent) => void;
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
* The
|
|
43
|
-
* When used inside
|
|
44
|
-
* Otherwise renders a
|
|
42
|
+
* The `<Dropdown.Item>` API
|
|
43
|
+
* - When used inside `<Sidenav>`, renders a `<TreeviewItem>`
|
|
44
|
+
* - Otherwise renders a `<MenuItem>`
|
|
45
45
|
*/
|
|
46
46
|
declare const DropdownItem: RsRefForwardingComponent<'li', DropdownMenuItemProps>;
|
|
47
47
|
export default DropdownItem;
|
|
@@ -17,9 +17,9 @@ import warnOnce from '../utils/warnOnce';
|
|
|
17
17
|
import Nav from '../Nav';
|
|
18
18
|
import DropdownSeparator from './DropdownSeparator';
|
|
19
19
|
/**
|
|
20
|
-
* The
|
|
21
|
-
* When used inside
|
|
22
|
-
* Otherwise renders a
|
|
20
|
+
* The `<Dropdown.Item>` API
|
|
21
|
+
* - When used inside `<Sidenav>`, renders a `<TreeviewItem>`
|
|
22
|
+
* - Otherwise renders a `<MenuItem>`
|
|
23
23
|
*/
|
|
24
24
|
var DropdownItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
25
25
|
var _props$classPrefix = props.classPrefix,
|
|
@@ -23,11 +23,11 @@ export interface DropdownMenuProps<T = string> extends StandardProps {
|
|
|
23
23
|
onToggle?: (eventKey: T | undefined, event: React.SyntheticEvent) => void;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* The
|
|
26
|
+
* The `<Dropdown.Menu>` API
|
|
27
27
|
*
|
|
28
28
|
* @description
|
|
29
|
-
* Note the difference between this component and
|
|
30
|
-
*
|
|
29
|
+
* Note the difference between this component and `<Menu>` component:
|
|
30
|
+
* `<Menu>` is used for ARIA menu control logic and is used internally only.
|
|
31
31
|
* This component is only used for supporting submenu syntax and is
|
|
32
32
|
* assigned to Dropdown.Menu
|
|
33
33
|
*
|