rsuite 5.17.0-beta.1 → 5.17.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/Animation/styles/animation.less +0 -0
- package/Animation/styles/index.less +0 -0
- package/Animation/styles/mixin.less +0 -0
- package/AutoComplete/styles/index.less +0 -0
- package/Avatar/styles/mixin.less +0 -0
- package/Badge/styles/index.less +0 -0
- package/Breadcrumb/styles/index.less +0 -0
- package/Button/styles/index.less +1 -1
- package/Button/styles/mixin.less +0 -0
- package/CHANGELOG.md +32 -0
- package/Calendar/styles/index.less +0 -0
- package/Cascader/styles/index.less +0 -0
- package/CheckPicker/styles/index.less +0 -0
- package/Checkbox/styles/index.less +0 -0
- package/Checkbox/styles/mixin.less +0 -0
- package/CheckboxGroup/styles/index.less +0 -0
- package/CloseButton/styles/index.less +0 -0
- package/Container/styles/index.less +0 -0
- package/Content/styles/index.less +0 -0
- package/DatePicker/styles/index.less +0 -10
- package/DateRangePicker/styles/index.less +12 -5
- package/Divider/styles/index.less +0 -0
- package/Drawer/styles/mixin.less +0 -0
- package/FlexboxGrid/styles/index.less +0 -0
- package/Footer/styles/index.less +0 -0
- package/Form/styles/index.less +0 -0
- package/FormControl/styles/index.less +0 -0
- package/FormControlLabel/styles/index.less +0 -0
- package/FormErrorMessage/styles/animation.less +0 -0
- package/FormErrorMessage/styles/index.less +0 -0
- package/FormGroup/styles/index.less +0 -0
- package/FormHelpText/styles/index.less +0 -0
- package/Grid/styles/grid-framework.less +0 -0
- package/Grid/styles/mixin.less +0 -0
- package/Header/styles/index.less +0 -0
- package/Input/styles/index.less +0 -0
- package/InputGroup/styles/index.less +5 -1
- package/InputNumber/styles/index.less +0 -0
- package/InputNumber/styles/mixin.less +0 -0
- package/InputPicker/styles/index.less +0 -0
- package/LICENSE +0 -0
- package/List/styles/index.less +0 -0
- package/Loader/styles/index.less +0 -0
- package/Loader/styles/mixin.less +0 -0
- package/Message/styles/index.less +0 -0
- package/Message/styles/mixin.less +0 -0
- package/Modal/styles/animation.less +0 -0
- package/Notification/styles/index.less +0 -0
- package/Notification/styles/mixin.less +0 -0
- package/Pagination/styles/index.less +0 -0
- package/Pagination/styles/mixin.less +0 -0
- package/Pagination/styles/pagination-group.less +0 -0
- package/Panel/styles/index.less +0 -0
- package/Placeholder/styles/index.less +0 -0
- package/Popover/styles/index.less +0 -0
- package/Popover/styles/mixins.less +0 -0
- package/Progress/styles/animation.less +0 -0
- package/Progress/styles/index.less +0 -0
- package/Radio/styles/mixin.less +0 -0
- package/RadioGroup/styles/index.less +0 -0
- package/Rate/styles/index.less +0 -0
- package/Ripple/styles/index.less +0 -0
- package/Ripple/styles/mixins.less +0 -0
- package/Row/styles/index.less +0 -0
- package/SelectPicker/styles/index.less +0 -0
- package/Sidebar/styles/index.less +0 -0
- package/Sidenav/styles/mixin.less +0 -0
- package/Steps/styles/index.less +0 -0
- package/Table/styles/mixin.less +0 -0
- package/Tag/styles/index.less +0 -0
- package/TagInput/styles/index.less +0 -0
- package/TagPicker/styles/index.less +0 -0
- package/Timeline/styles/index.less +0 -0
- package/Timeline/styles/mixin.less +0 -0
- package/Tooltip/styles/mixins.less +0 -0
- package/TreePicker/styles/mixin.less +0 -0
- package/Uploader/styles/mixin.less +0 -0
- package/cjs/@types/global.d.ts +0 -0
- package/cjs/Affix/index.js +0 -0
- package/cjs/Animation/Bounce.js +0 -0
- package/cjs/Animation/Fade.js +0 -0
- package/cjs/Animation/Slide.js +0 -0
- package/cjs/Animation/index.js +0 -0
- package/cjs/Animation/utils.js +0 -0
- package/cjs/AutoComplete/index.js +0 -0
- package/cjs/Avatar/index.js +0 -0
- package/cjs/Badge/index.js +0 -0
- package/cjs/Breadcrumb/index.js +0 -0
- package/cjs/Button/index.js +0 -0
- package/cjs/ButtonToolbar/ButtonToolbar.js +0 -0
- package/cjs/ButtonToolbar/index.js +0 -0
- package/cjs/Calendar/Header.js +2 -4
- package/cjs/Calendar/index.js +0 -0
- package/cjs/Calendar/useCalendarDate.d.ts +1 -0
- package/cjs/Calendar/useCalendarDate.js +7 -1
- package/cjs/Carousel/index.js +0 -0
- package/cjs/Cascader/index.js +0 -0
- package/cjs/CheckPicker/index.js +0 -0
- package/cjs/CheckTreePicker/index.js +0 -0
- package/cjs/Checkbox/index.js +0 -0
- package/cjs/CloseButton/CloseButton.js +0 -0
- package/cjs/CloseButton/index.js +0 -0
- package/cjs/Col/index.js +0 -0
- package/cjs/Container/index.js +0 -0
- package/cjs/Content/Content.js +0 -0
- package/cjs/Content/index.js +0 -0
- package/cjs/CustomProvider/FormattedDate.js +0 -0
- package/cjs/CustomProvider/index.js +0 -0
- package/cjs/DatePicker/DatePicker.d.ts +2 -0
- package/cjs/DatePicker/DatePicker.js +8 -5
- package/cjs/DatePicker/PredefinedRanges.d.ts +13 -0
- package/cjs/DatePicker/PredefinedRanges.js +79 -0
- package/cjs/DatePicker/Toolbar.d.ts +2 -9
- package/cjs/DatePicker/Toolbar.js +45 -62
- package/cjs/DatePicker/index.js +0 -0
- package/cjs/DateRangePicker/DateRangePicker.d.ts +2 -0
- package/cjs/DateRangePicker/DateRangePicker.js +61 -11
- package/cjs/DateRangePicker/disabledDateUtils.js +0 -0
- package/cjs/DateRangePicker/types.d.ts +2 -1
- package/cjs/Disclosure/Disclosure.d.ts +2 -2
- package/cjs/Disclosure/Disclosure.js +6 -6
- package/cjs/Disclosure/index.js +0 -0
- package/cjs/Divider/index.js +0 -0
- package/cjs/Drawer/index.js +0 -0
- package/cjs/Dropdown/DropdownState.js +0 -0
- package/cjs/Dropdown/index.js +0 -0
- package/cjs/FlexboxGrid/index.js +0 -0
- package/cjs/Footer/Footer.js +0 -0
- package/cjs/Footer/index.js +0 -0
- package/cjs/FormControl/FormControl.js +3 -5
- package/cjs/FormControl/index.js +0 -0
- package/cjs/FormControlLabel/FormControlLabel.js +0 -0
- package/cjs/FormControlLabel/index.js +0 -0
- package/cjs/FormErrorMessage/FormErrorMessage.js +0 -0
- package/cjs/FormErrorMessage/index.js +0 -0
- package/cjs/FormGroup/index.js +0 -0
- package/cjs/FormHelpText/index.js +0 -0
- package/cjs/Grid/Grid.js +0 -0
- package/cjs/Grid/index.js +0 -0
- package/cjs/Header/Header.js +0 -0
- package/cjs/Header/index.js +0 -0
- package/cjs/IconButton/index.js +0 -0
- package/cjs/Input/index.js +0 -0
- package/cjs/InputGroup/InputGroupButton.js +0 -0
- package/cjs/InputGroup/index.js +0 -0
- package/cjs/InputNumber/index.js +0 -0
- package/cjs/InputPicker/index.js +0 -0
- package/cjs/List/index.js +0 -0
- package/cjs/Loader/index.js +0 -0
- package/cjs/Menu/MenuContext.js +0 -0
- package/cjs/Menu/index.js +0 -0
- package/cjs/Message/index.js +0 -0
- package/cjs/Modal/ModalFooter.js +0 -0
- package/cjs/Modal/index.js +0 -0
- package/cjs/MultiCascader/index.js +0 -0
- package/cjs/Nav/index.js +0 -0
- package/cjs/Navbar/NavbarBody.js +0 -0
- package/cjs/Navbar/NavbarBrand.js +0 -0
- package/cjs/Navbar/NavbarDropdownMenu.js +10 -16
- package/cjs/Navbar/NavbarHeader.js +0 -0
- package/cjs/Notification/index.js +0 -0
- package/cjs/Overlay/index.js +0 -0
- package/cjs/Pagination/index.js +0 -0
- package/cjs/Panel/index.js +0 -0
- package/cjs/PanelGroup/index.js +0 -0
- package/cjs/Picker/types.js +0 -0
- package/cjs/Placeholder/Placeholder.js +0 -0
- package/cjs/Placeholder/index.js +0 -0
- package/cjs/Plaintext/index.js +0 -0
- package/cjs/Popover/index.js +0 -0
- package/cjs/Progress/Progress.js +0 -0
- package/cjs/Progress/index.js +0 -0
- package/cjs/Radio/index.js +0 -0
- package/cjs/RadioGroup/index.js +0 -0
- package/cjs/RangeSlider/index.js +0 -0
- package/cjs/Rate/index.js +0 -0
- package/cjs/Ripple/index.js +0 -0
- package/cjs/Row/Row.js +0 -0
- package/cjs/Row/index.js +0 -0
- package/cjs/SafeAnchor/index.js +0 -0
- package/cjs/Schema/Schema.js +0 -0
- package/cjs/Schema/index.js +0 -0
- package/cjs/Sidebar/index.js +0 -0
- package/cjs/Sidenav/SidenavBody.js +0 -0
- package/cjs/Sidenav/SidenavHeader.js +0 -0
- package/cjs/Sidenav/index.js +0 -0
- package/cjs/Slider/index.js +0 -0
- package/cjs/Steps/index.js +0 -0
- package/cjs/Table/index.js +0 -0
- package/cjs/Tag/Tag.js +0 -0
- package/cjs/Tag/index.js +0 -0
- package/cjs/TagGroup/TagGroup.js +0 -0
- package/cjs/TagGroup/index.js +0 -0
- package/cjs/Timeline/index.js +0 -0
- package/cjs/Toggle/index.js +0 -0
- package/cjs/Tooltip/index.js +0 -0
- package/cjs/Tree/index.js +0 -0
- package/cjs/TreePicker/index.js +0 -0
- package/cjs/Whisper/index.js +0 -0
- package/cjs/locales/ar_EG.js +0 -0
- package/cjs/locales/da_DK.js +0 -0
- package/cjs/locales/de_DE.js +0 -0
- package/cjs/locales/default.js +0 -0
- package/cjs/locales/en_GB.js +0 -0
- package/cjs/locales/en_US.js +0 -0
- package/cjs/locales/es_AR.js +0 -0
- package/cjs/locales/es_ES.js +0 -0
- package/cjs/locales/fi_FI.js +0 -0
- package/cjs/locales/it_IT.js +0 -0
- package/cjs/locales/ko_KR.js +0 -0
- package/cjs/locales/pt_BR.js +0 -0
- package/cjs/locales/ru_RU.js +0 -0
- package/cjs/locales/sv_SE.js +0 -0
- package/cjs/locales/zh_CN.js +0 -0
- package/cjs/locales/zh_TW.js +0 -0
- package/cjs/toaster/ToastContainer.d.ts +1 -2
- package/cjs/toaster/ToastContainer.js +26 -27
- package/cjs/toaster/toaster.d.ts +1 -1
- package/cjs/toaster/toaster.js +13 -43
- package/cjs/toaster/useToaster.d.ts +1 -1
- package/cjs/utils/clone.js +0 -0
- package/cjs/utils/dateUtils.d.ts +1 -0
- package/cjs/utils/dateUtils.js +5 -1
- package/cjs/utils/events.js +0 -0
- package/cjs/utils/getDOMNode.js +0 -0
- package/cjs/utils/getSafeRegExpString.js +0 -0
- package/cjs/utils/guid.js +0 -0
- package/cjs/utils/htmlPropsUtils.js +0 -0
- package/cjs/utils/index.d.ts +0 -1
- package/cjs/utils/index.js +1 -6
- package/cjs/utils/isOneOf.js +0 -0
- package/cjs/utils/prefix.js +0 -0
- package/cjs/utils/shallowEqual.js +0 -0
- package/cjs/utils/shallowEqualArray.js +0 -0
- package/cjs/utils/statusIcons.js +0 -0
- package/cjs/utils/stringToObject.js +0 -0
- package/cjs/utils/tplTransform.js +0 -0
- package/cjs/utils/useClassNames.js +0 -0
- package/cjs/utils/useEnsuredRef.js +0 -0
- package/cjs/utils/useEventCallback.js +0 -0
- package/cjs/utils/useToggleCaret.js +0 -0
- package/cjs/utils/useUniqueId.js +2 -10
- package/cjs/utils/useUpdateEffect.js +0 -0
- package/cjs/utils/useUpdatedRef.js +0 -0
- package/cjs/utils/useWillUnmount.js +0 -0
- package/dist/rsuite-rtl.css +14 -19
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +14 -19
- package/dist/rsuite.js +223 -241
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.LICENSE.txt +0 -2
- package/dist/rsuite.min.js.map +1 -1
- package/esm/@types/global.d.ts +0 -0
- package/esm/Affix/index.js +0 -0
- package/esm/Animation/Bounce.js +0 -0
- package/esm/Animation/Fade.js +0 -0
- package/esm/Animation/Slide.js +0 -0
- package/esm/Animation/index.js +0 -0
- package/esm/Animation/utils.js +0 -0
- package/esm/AutoComplete/index.js +0 -0
- package/esm/Avatar/index.js +0 -0
- package/esm/Badge/index.js +0 -0
- package/esm/Breadcrumb/index.js +0 -0
- package/esm/Button/index.js +0 -0
- package/esm/ButtonToolbar/ButtonToolbar.js +0 -0
- package/esm/ButtonToolbar/index.js +0 -0
- package/esm/Calendar/Header.js +2 -4
- package/esm/Calendar/index.js +0 -0
- package/esm/Calendar/useCalendarDate.d.ts +1 -0
- package/esm/Calendar/useCalendarDate.js +7 -1
- package/esm/Carousel/index.js +0 -0
- package/esm/Cascader/index.js +0 -0
- package/esm/CheckPicker/index.js +0 -0
- package/esm/CheckTreePicker/index.js +0 -0
- package/esm/Checkbox/index.js +0 -0
- package/esm/CloseButton/CloseButton.js +0 -0
- package/esm/CloseButton/index.js +0 -0
- package/esm/Col/index.js +0 -0
- package/esm/Container/index.js +0 -0
- package/esm/Content/Content.js +0 -0
- package/esm/Content/index.js +0 -0
- package/esm/CustomProvider/FormattedDate.js +0 -0
- package/esm/CustomProvider/index.js +0 -0
- package/esm/DatePicker/DatePicker.d.ts +2 -0
- package/esm/DatePicker/DatePicker.js +8 -5
- package/esm/DatePicker/PredefinedRanges.d.ts +13 -0
- package/esm/DatePicker/PredefinedRanges.js +62 -0
- package/esm/DatePicker/Toolbar.d.ts +2 -9
- package/esm/DatePicker/Toolbar.js +45 -61
- package/esm/DatePicker/index.js +0 -0
- package/esm/DateRangePicker/DateRangePicker.d.ts +2 -0
- package/esm/DateRangePicker/DateRangePicker.js +59 -11
- package/esm/DateRangePicker/disabledDateUtils.js +0 -0
- package/esm/DateRangePicker/types.d.ts +2 -1
- package/esm/Disclosure/Disclosure.d.ts +2 -2
- package/esm/Disclosure/Disclosure.js +6 -6
- package/esm/Disclosure/index.js +0 -0
- package/esm/Divider/index.js +0 -0
- package/esm/Drawer/index.js +0 -0
- package/esm/Dropdown/DropdownState.js +0 -0
- package/esm/Dropdown/index.js +0 -0
- package/esm/FlexboxGrid/index.js +0 -0
- package/esm/Footer/Footer.js +0 -0
- package/esm/Footer/index.js +0 -0
- package/esm/FormControl/FormControl.js +3 -5
- package/esm/FormControl/index.js +0 -0
- package/esm/FormControlLabel/FormControlLabel.js +0 -0
- package/esm/FormControlLabel/index.js +0 -0
- package/esm/FormErrorMessage/FormErrorMessage.js +0 -0
- package/esm/FormErrorMessage/index.js +0 -0
- package/esm/FormGroup/index.js +0 -0
- package/esm/FormHelpText/index.js +0 -0
- package/esm/Grid/Grid.js +0 -0
- package/esm/Grid/index.js +0 -0
- package/esm/Header/Header.js +0 -0
- package/esm/Header/index.js +0 -0
- package/esm/IconButton/index.js +0 -0
- package/esm/Input/index.js +0 -0
- package/esm/InputGroup/InputGroupButton.js +0 -0
- package/esm/InputGroup/index.js +0 -0
- package/esm/InputNumber/index.js +0 -0
- package/esm/InputPicker/index.js +0 -0
- package/esm/List/index.js +0 -0
- package/esm/Loader/index.js +0 -0
- package/esm/Menu/MenuContext.js +0 -0
- package/esm/Menu/index.js +0 -0
- package/esm/Message/index.js +0 -0
- package/esm/Modal/ModalFooter.js +0 -0
- package/esm/Modal/index.js +0 -0
- package/esm/MultiCascader/index.js +0 -0
- package/esm/Nav/index.js +0 -0
- package/esm/Navbar/NavbarBody.js +0 -0
- package/esm/Navbar/NavbarBrand.js +0 -0
- package/esm/Navbar/NavbarDropdownMenu.js +8 -14
- package/esm/Navbar/NavbarHeader.js +0 -0
- package/esm/Notification/index.js +0 -0
- package/esm/Overlay/index.js +0 -0
- package/esm/Pagination/index.js +0 -0
- package/esm/Panel/index.js +0 -0
- package/esm/PanelGroup/index.js +0 -0
- package/esm/Picker/types.js +0 -0
- package/esm/Placeholder/Placeholder.js +0 -0
- package/esm/Placeholder/index.js +0 -0
- package/esm/Plaintext/index.js +0 -0
- package/esm/Popover/index.js +0 -0
- package/esm/Progress/Progress.js +0 -0
- package/esm/Progress/index.js +0 -0
- package/esm/Radio/index.js +0 -0
- package/esm/RadioGroup/index.js +0 -0
- package/esm/RangeSlider/index.js +0 -0
- package/esm/Rate/index.js +0 -0
- package/esm/Ripple/index.js +0 -0
- package/esm/Row/Row.js +0 -0
- package/esm/Row/index.js +0 -0
- package/esm/SafeAnchor/index.js +0 -0
- package/esm/Schema/Schema.js +0 -0
- package/esm/Schema/index.js +0 -0
- package/esm/Sidebar/index.js +0 -0
- package/esm/Sidenav/SidenavBody.js +0 -0
- package/esm/Sidenav/SidenavHeader.js +0 -0
- package/esm/Sidenav/index.js +0 -0
- package/esm/Slider/index.js +0 -0
- package/esm/Steps/index.js +0 -0
- package/esm/Table/index.js +0 -0
- package/esm/Tag/Tag.js +0 -0
- package/esm/Tag/index.js +0 -0
- package/esm/TagGroup/TagGroup.js +0 -0
- package/esm/TagGroup/index.js +0 -0
- package/esm/Timeline/index.js +0 -0
- package/esm/Toggle/index.js +0 -0
- package/esm/Tooltip/index.js +0 -0
- package/esm/Tree/index.js +0 -0
- package/esm/TreePicker/index.js +0 -0
- package/esm/Whisper/index.js +0 -0
- package/esm/locales/ar_EG.js +0 -0
- package/esm/locales/da_DK.js +0 -0
- package/esm/locales/de_DE.js +0 -0
- package/esm/locales/default.js +0 -0
- package/esm/locales/en_GB.js +0 -0
- package/esm/locales/en_US.js +0 -0
- package/esm/locales/es_AR.js +0 -0
- package/esm/locales/es_ES.js +0 -0
- package/esm/locales/fi_FI.js +0 -0
- package/esm/locales/it_IT.js +0 -0
- package/esm/locales/ko_KR.js +0 -0
- package/esm/locales/pt_BR.js +0 -0
- package/esm/locales/ru_RU.js +0 -0
- package/esm/locales/sv_SE.js +0 -0
- package/esm/locales/zh_CN.js +0 -0
- package/esm/locales/zh_TW.js +0 -0
- package/esm/toaster/ToastContainer.d.ts +1 -2
- package/esm/toaster/ToastContainer.js +26 -28
- package/esm/toaster/toaster.d.ts +1 -1
- package/esm/toaster/toaster.js +13 -41
- package/esm/toaster/useToaster.d.ts +1 -1
- package/esm/utils/clone.js +0 -0
- package/esm/utils/dateUtils.d.ts +1 -0
- package/esm/utils/dateUtils.js +1 -0
- package/esm/utils/events.js +0 -0
- package/esm/utils/getDOMNode.js +0 -0
- package/esm/utils/getSafeRegExpString.js +0 -0
- package/esm/utils/guid.js +0 -0
- package/esm/utils/htmlPropsUtils.js +0 -0
- package/esm/utils/index.d.ts +0 -1
- package/esm/utils/index.js +0 -1
- package/esm/utils/isOneOf.js +0 -0
- package/esm/utils/prefix.js +0 -0
- package/esm/utils/shallowEqual.js +0 -0
- package/esm/utils/shallowEqualArray.js +0 -0
- package/esm/utils/statusIcons.js +0 -0
- package/esm/utils/stringToObject.js +0 -0
- package/esm/utils/tplTransform.js +0 -0
- package/esm/utils/useClassNames.js +0 -0
- package/esm/utils/useEnsuredRef.js +0 -0
- package/esm/utils/useEventCallback.js +0 -0
- package/esm/utils/useToggleCaret.js +0 -0
- package/esm/utils/useUniqueId.js +2 -7
- package/esm/utils/useUpdateEffect.js +0 -0
- package/esm/utils/useUpdatedRef.js +0 -0
- package/esm/utils/useWillUnmount.js +0 -0
- package/package.json +3 -3
- package/styles/color-modes.less +0 -0
- package/styles/colors/light.less +0 -0
- package/styles/common.less +0 -0
- package/styles/mixins/color-modes.less +0 -0
- package/styles/mixins/hacks.less +0 -0
- package/styles/mixins/listbox.less +0 -0
- package/styles/mixins/menu.less +0 -0
- package/styles/normalize.less +0 -0
- package/styles/scaffolding.less +0 -0
- package/styles/typography.less +0 -0
- package/toaster/styles/animation.less +0 -0
- package/toaster/styles/index.less +0 -0
- package/cjs/utils/render.d.ts +0 -3
- package/cjs/utils/render.js +0 -49
- package/esm/utils/render.d.ts +0 -3
- package/esm/utils/render.js +0 -37
package/esm/@types/global.d.ts
CHANGED
|
File without changes
|
package/esm/Affix/index.js
CHANGED
|
File without changes
|
package/esm/Animation/Bounce.js
CHANGED
|
File without changes
|
package/esm/Animation/Fade.js
CHANGED
|
File without changes
|
package/esm/Animation/Slide.js
CHANGED
|
File without changes
|
package/esm/Animation/index.js
CHANGED
|
File without changes
|
package/esm/Animation/utils.js
CHANGED
|
File without changes
|
|
File without changes
|
package/esm/Avatar/index.js
CHANGED
|
File without changes
|
package/esm/Badge/index.js
CHANGED
|
File without changes
|
package/esm/Breadcrumb/index.js
CHANGED
|
File without changes
|
package/esm/Button/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/esm/Calendar/Header.js
CHANGED
|
@@ -70,14 +70,12 @@ var Header = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
70
70
|
return timeFormat.join(':');
|
|
71
71
|
}, [format, showMeridian]);
|
|
72
72
|
var getDateFormat = useCallback(function () {
|
|
73
|
-
if (
|
|
74
|
-
return (locale === null || locale === void 0 ? void 0 : locale.formattedDayPattern) || 'yyyy-MM-dd';
|
|
75
|
-
} else if (showMonth) {
|
|
73
|
+
if (showMonth) {
|
|
76
74
|
return (locale === null || locale === void 0 ? void 0 : locale.formattedMonthPattern) || 'yyyy-MM';
|
|
77
75
|
}
|
|
78
76
|
|
|
79
77
|
return 'yyyy';
|
|
80
|
-
}, [locale,
|
|
78
|
+
}, [locale, showMonth]);
|
|
81
79
|
var renderTitle = useCallback(function () {
|
|
82
80
|
var _renderTitleProp;
|
|
83
81
|
|
package/esm/Calendar/index.js
CHANGED
|
File without changes
|
|
@@ -15,6 +15,11 @@ var useCalendarDate = function useCalendarDate(value, defaultDate) {
|
|
|
15
15
|
setValue(date);
|
|
16
16
|
}
|
|
17
17
|
}, [calendarDate]);
|
|
18
|
+
var resetCalendarDate = useCallback(function () {
|
|
19
|
+
var _ref2;
|
|
20
|
+
|
|
21
|
+
setValue((_ref2 = value !== null && value !== void 0 ? value : defaultDate) !== null && _ref2 !== void 0 ? _ref2 : new Date());
|
|
22
|
+
}, [defaultDate, value]);
|
|
18
23
|
useUpdateEffect(function () {
|
|
19
24
|
var _valueRef$current;
|
|
20
25
|
|
|
@@ -25,7 +30,8 @@ var useCalendarDate = function useCalendarDate(value, defaultDate) {
|
|
|
25
30
|
}, [value]);
|
|
26
31
|
return {
|
|
27
32
|
calendarDate: calendarDate,
|
|
28
|
-
setCalendarDate: setCalendarDate
|
|
33
|
+
setCalendarDate: setCalendarDate,
|
|
34
|
+
resetCalendarDate: resetCalendarDate
|
|
29
35
|
};
|
|
30
36
|
};
|
|
31
37
|
|
package/esm/Carousel/index.js
CHANGED
|
File without changes
|
package/esm/Cascader/index.js
CHANGED
|
File without changes
|
package/esm/CheckPicker/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/esm/Checkbox/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/esm/CloseButton/index.js
CHANGED
|
File without changes
|
package/esm/Col/index.js
CHANGED
|
File without changes
|
package/esm/Container/index.js
CHANGED
|
File without changes
|
package/esm/Content/Content.js
CHANGED
|
File without changes
|
package/esm/Content/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -9,6 +9,8 @@ export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, Form
|
|
|
9
9
|
ranges?: RangeType<Date>[];
|
|
10
10
|
/** Calendar panel default presentation date and time */
|
|
11
11
|
calendarDefaultDate?: Date;
|
|
12
|
+
/** Rendered as an input, the date can be entered via the keyboard */
|
|
13
|
+
editable?: boolean;
|
|
12
14
|
/** Format date */
|
|
13
15
|
format?: string;
|
|
14
16
|
/**
|
|
@@ -22,6 +22,8 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
22
22
|
calendarDefaultDate = props.calendarDefaultDate,
|
|
23
23
|
_props$cleanable = props.cleanable,
|
|
24
24
|
cleanable = _props$cleanable === void 0 ? true : _props$cleanable,
|
|
25
|
+
_props$editable = props.editable,
|
|
26
|
+
editable = _props$editable === void 0 ? true : _props$editable,
|
|
25
27
|
defaultValue = props.defaultValue,
|
|
26
28
|
disabled = props.disabled,
|
|
27
29
|
_props$format = props.format,
|
|
@@ -60,7 +62,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
60
62
|
onSelect = props.onSelect,
|
|
61
63
|
onToggleMonthDropdown = props.onToggleMonthDropdown,
|
|
62
64
|
onToggleTimeDropdown = props.onToggleTimeDropdown,
|
|
63
|
-
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "defaultValue", "disabled", "format", "isoWeek", "limitEndYear", "locale", "menuClassName", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "toggleAs", "caretAs", "disabledDate", "renderValue", "onChange", "onChangeCalendarDate", "onClean", "onClose", "onEntered", "onExited", "onNextMonth", "onOk", "onOpen", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown"]);
|
|
65
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "editable", "defaultValue", "disabled", "format", "isoWeek", "limitEndYear", "locale", "menuClassName", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "toggleAs", "caretAs", "disabledDate", "renderValue", "onChange", "onChangeCalendarDate", "onClean", "onClose", "onEntered", "onExited", "onNextMonth", "onOk", "onOpen", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown"]);
|
|
64
66
|
|
|
65
67
|
var _useCustom = useCustom('DatePicker', overrideLocale),
|
|
66
68
|
locale = _useCustom.locale,
|
|
@@ -77,7 +79,8 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
77
79
|
|
|
78
80
|
var _useCalendarDate = useCalendarDate(valueProp, calendarDefaultDate),
|
|
79
81
|
calendarDate = _useCalendarDate.calendarDate,
|
|
80
|
-
setCalendarDate = _useCalendarDate.setCalendarDate
|
|
82
|
+
setCalendarDate = _useCalendarDate.setCalendarDate,
|
|
83
|
+
resetCalendarDate = _useCalendarDate.resetCalendarDate;
|
|
81
84
|
|
|
82
85
|
var _useState = useState(),
|
|
83
86
|
inputState = _useState[0],
|
|
@@ -217,9 +220,9 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
217
220
|
*/
|
|
218
221
|
|
|
219
222
|
var handleClean = useCallback(function (event) {
|
|
220
|
-
setCalendarDate(new Date());
|
|
221
223
|
updateValue(event, null);
|
|
222
|
-
|
|
224
|
+
resetCalendarDate();
|
|
225
|
+
}, [resetCalendarDate, updateValue]);
|
|
223
226
|
/**
|
|
224
227
|
* Handle keyboard events.
|
|
225
228
|
*/
|
|
@@ -437,7 +440,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
437
440
|
as: toggleAs,
|
|
438
441
|
ref: targetRef,
|
|
439
442
|
appearance: appearance,
|
|
440
|
-
editable:
|
|
443
|
+
editable: editable,
|
|
441
444
|
inputValue: value ? formatDate(value, formatStr) : '',
|
|
442
445
|
inputPlaceholder: typeof placeholder === 'string' && placeholder ? placeholder : formatStr,
|
|
443
446
|
inputMask: DateUtils.getDateMask(formatStr),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StackProps } from '../Stack';
|
|
3
|
+
import { RangeType } from './types';
|
|
4
|
+
import { CalendarLocale } from '../locales';
|
|
5
|
+
export interface PredefinedRangesProps<T = any, Shortcut = T> extends StackProps {
|
|
6
|
+
ranges?: RangeType<Shortcut>[];
|
|
7
|
+
calendarDate: T;
|
|
8
|
+
locale: CalendarLocale;
|
|
9
|
+
disabledShortcut?: (value: T) => boolean;
|
|
10
|
+
onClickShortcut?: (value: Shortcut, closeOverlay: boolean, event: React.MouseEvent) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const PredefinedRanges: React.ForwardRefExoticComponent<PredefinedRangesProps<any, any> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export default PredefinedRanges;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import React, { useCallback, useState } from 'react';
|
|
4
|
+
import Button from '../Button';
|
|
5
|
+
import Stack from '../Stack';
|
|
6
|
+
import { useUpdateEffect } from '../utils';
|
|
7
|
+
import { getDefaultRanges, getRanges } from './utils';
|
|
8
|
+
var PredefinedRanges = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
9
|
+
var className = props.className,
|
|
10
|
+
disabledShortcut = props.disabledShortcut,
|
|
11
|
+
onClickShortcut = props.onClickShortcut,
|
|
12
|
+
calendarDate = props.calendarDate,
|
|
13
|
+
rangesProp = props.ranges,
|
|
14
|
+
locale = props.locale,
|
|
15
|
+
rest = _objectWithoutPropertiesLoose(props, ["className", "disabledShortcut", "onClickShortcut", "calendarDate", "ranges", "locale"]);
|
|
16
|
+
|
|
17
|
+
var _useState = useState(getRanges(props)),
|
|
18
|
+
ranges = _useState[0],
|
|
19
|
+
setRanges = _useState[1];
|
|
20
|
+
|
|
21
|
+
useUpdateEffect(function () {
|
|
22
|
+
setRanges(getRanges({
|
|
23
|
+
ranges: rangesProp,
|
|
24
|
+
calendarDate: calendarDate
|
|
25
|
+
}));
|
|
26
|
+
}, [calendarDate, rangesProp]);
|
|
27
|
+
var hasLocaleKey = useCallback(function (key) {
|
|
28
|
+
return getDefaultRanges(calendarDate).some(function (item) {
|
|
29
|
+
return item.label === key;
|
|
30
|
+
});
|
|
31
|
+
}, [calendarDate]);
|
|
32
|
+
return /*#__PURE__*/React.createElement(Stack, _extends({
|
|
33
|
+
className: className,
|
|
34
|
+
ref: ref,
|
|
35
|
+
alignItems: "flex-start",
|
|
36
|
+
spacing: 4
|
|
37
|
+
}, rest), ranges.map(function (_ref, index) {
|
|
38
|
+
var value = _ref.value,
|
|
39
|
+
closeOverlay = _ref.closeOverlay,
|
|
40
|
+
label = _ref.label,
|
|
41
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["value", "closeOverlay", "label"]);
|
|
42
|
+
|
|
43
|
+
var disabled = disabledShortcut === null || disabledShortcut === void 0 ? void 0 : disabledShortcut(value);
|
|
44
|
+
|
|
45
|
+
var handleClickShortcut = function handleClickShortcut(event) {
|
|
46
|
+
if (disabled) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
onClickShortcut === null || onClickShortcut === void 0 ? void 0 : onClickShortcut(value, closeOverlay !== false ? true : false, event);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
54
|
+
appearance: "link",
|
|
55
|
+
size: "sm",
|
|
56
|
+
key: index,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
onClick: handleClickShortcut
|
|
59
|
+
}, rest), hasLocaleKey(label) && typeof label === 'string' ? locale === null || locale === void 0 ? void 0 : locale[label] : label);
|
|
60
|
+
}));
|
|
61
|
+
});
|
|
62
|
+
export default PredefinedRanges;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { RangeType } from './types';
|
|
4
|
-
import { CalendarLocale } from '../locales';
|
|
2
|
+
import { PredefinedRangesProps } from './PredefinedRanges';
|
|
5
3
|
export type { RangeType } from './types';
|
|
6
|
-
export interface ToolbarProps<T = any, Shortcut = T> extends
|
|
4
|
+
export interface ToolbarProps<T = any, Shortcut = T> extends PredefinedRangesProps<T, Shortcut> {
|
|
7
5
|
hideOkBtn?: boolean;
|
|
8
|
-
locale?: CalendarLocale;
|
|
9
|
-
calendarDate: T;
|
|
10
|
-
ranges?: RangeType<Shortcut>[];
|
|
11
6
|
disabledOkBtn?: (value: T) => boolean;
|
|
12
|
-
disabledShortcut?: (value: T) => boolean;
|
|
13
7
|
onOk?: (event: React.MouseEvent) => void;
|
|
14
|
-
onClickShortcut?: (value: Shortcut, closeOverlay: boolean, event: React.MouseEvent) => void;
|
|
15
8
|
}
|
|
16
9
|
declare type ToolbarComponent = React.ForwardRefExoticComponent<ToolbarProps> & {
|
|
17
10
|
<T = any, Shortcut = T>(props: ToolbarProps<T, Shortcut>): React.ReactElement | null;
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Button from '../Button';
|
|
6
|
-
import { useClassNames
|
|
7
|
-
import
|
|
6
|
+
import { useClassNames } from '../utils';
|
|
7
|
+
import PredefinedRanges from './PredefinedRanges';
|
|
8
|
+
import Stack from '../Stack';
|
|
8
9
|
|
|
10
|
+
var SubmitButton = function SubmitButton(_ref) {
|
|
11
|
+
var hide = _ref.hide,
|
|
12
|
+
disabledOkBtn = _ref.disabledOkBtn,
|
|
13
|
+
calendarDate = _ref.calendarDate,
|
|
14
|
+
onOk = _ref.onOk,
|
|
15
|
+
children = _ref.children;
|
|
16
|
+
|
|
17
|
+
if (hide) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var disabled = disabledOkBtn === null || disabledOkBtn === void 0 ? void 0 : disabledOkBtn(calendarDate);
|
|
22
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
23
|
+
appearance: "primary",
|
|
24
|
+
size: "sm",
|
|
25
|
+
disabled: disabled,
|
|
26
|
+
onClick: disabled ? undefined : onOk
|
|
27
|
+
}, children);
|
|
28
|
+
};
|
|
9
29
|
/**
|
|
10
30
|
* Toolbar for DatePicker and DateRangePicker
|
|
11
31
|
*/
|
|
32
|
+
|
|
33
|
+
|
|
12
34
|
var Toolbar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
35
|
var className = props.className,
|
|
14
36
|
_props$classPrefix = props.classPrefix,
|
|
@@ -19,78 +41,40 @@ var Toolbar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
19
41
|
onOk = props.onOk,
|
|
20
42
|
onClickShortcut = props.onClickShortcut,
|
|
21
43
|
calendarDate = props.calendarDate,
|
|
22
|
-
|
|
44
|
+
ranges = props.ranges,
|
|
23
45
|
locale = props.locale,
|
|
24
46
|
rest = _objectWithoutPropertiesLoose(props, ["className", "classPrefix", "disabledOkBtn", "disabledShortcut", "hideOkBtn", "onOk", "onClickShortcut", "calendarDate", "ranges", "locale"]);
|
|
25
47
|
|
|
26
|
-
var _useState = useState(getRanges(props)),
|
|
27
|
-
ranges = _useState[0],
|
|
28
|
-
setRanges = _useState[1];
|
|
29
|
-
|
|
30
48
|
var _useClassNames = useClassNames(classPrefix),
|
|
31
49
|
merge = _useClassNames.merge,
|
|
32
50
|
prefix = _useClassNames.prefix,
|
|
33
51
|
withClassPrefix = _useClassNames.withClassPrefix;
|
|
34
52
|
|
|
35
|
-
|
|
36
|
-
setRanges(getRanges({
|
|
37
|
-
ranges: rangesProp,
|
|
38
|
-
calendarDate: calendarDate
|
|
39
|
-
}));
|
|
40
|
-
}, [calendarDate, rangesProp]);
|
|
41
|
-
var hasLocaleKey = useCallback(function (key) {
|
|
42
|
-
return getDefaultRanges(calendarDate).some(function (item) {
|
|
43
|
-
return item.label === key;
|
|
44
|
-
});
|
|
45
|
-
}, [calendarDate]);
|
|
46
|
-
var renderOkButton = useCallback(function () {
|
|
47
|
-
if (hideOkBtn) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var disabled = disabledOkBtn === null || disabledOkBtn === void 0 ? void 0 : disabledOkBtn(calendarDate);
|
|
52
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
53
|
-
className: prefix('right')
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
55
|
-
appearance: "primary",
|
|
56
|
-
size: "sm",
|
|
57
|
-
disabled: disabled,
|
|
58
|
-
onClick: disabled ? undefined : onOk
|
|
59
|
-
}, locale === null || locale === void 0 ? void 0 : locale.ok));
|
|
60
|
-
}, [disabledOkBtn, hideOkBtn, locale, onOk, calendarDate, prefix]);
|
|
61
|
-
|
|
62
|
-
if (hideOkBtn && ranges.length === 0) {
|
|
53
|
+
if (hideOkBtn && (ranges === null || ranges === void 0 ? void 0 : ranges.length) === 0) {
|
|
63
54
|
return null;
|
|
64
55
|
}
|
|
65
56
|
|
|
66
57
|
var classes = merge(className, withClassPrefix());
|
|
67
|
-
return /*#__PURE__*/React.createElement(
|
|
58
|
+
return /*#__PURE__*/React.createElement(Stack, _extends({
|
|
68
59
|
ref: ref,
|
|
69
|
-
className: classes
|
|
60
|
+
className: classes,
|
|
61
|
+
justifyContent: "space-between",
|
|
62
|
+
alignItems: "flex-start"
|
|
63
|
+
}, rest), /*#__PURE__*/React.createElement(PredefinedRanges, {
|
|
64
|
+
className: prefix('ranges'),
|
|
65
|
+
ranges: ranges,
|
|
66
|
+
calendarDate: calendarDate,
|
|
67
|
+
locale: locale,
|
|
68
|
+
disabledShortcut: disabledShortcut,
|
|
69
|
+
onClickShortcut: onClickShortcut
|
|
70
70
|
}), /*#__PURE__*/React.createElement("div", {
|
|
71
|
-
className: prefix('
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var handleClickShortcut = function handleClickShortcut(event) {
|
|
79
|
-
if (disabled) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
onClickShortcut === null || onClickShortcut === void 0 ? void 0 : onClickShortcut(value, closeOverlay !== false ? true : false, event);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
87
|
-
appearance: "link",
|
|
88
|
-
size: "sm",
|
|
89
|
-
key: index,
|
|
90
|
-
disabled: disabled,
|
|
91
|
-
onClick: handleClickShortcut
|
|
92
|
-
}, hasLocaleKey(label) && typeof label === 'string' ? locale === null || locale === void 0 ? void 0 : locale[label] : label);
|
|
93
|
-
})), renderOkButton());
|
|
71
|
+
className: prefix('right')
|
|
72
|
+
}, /*#__PURE__*/React.createElement(SubmitButton, {
|
|
73
|
+
disabledOkBtn: disabledOkBtn,
|
|
74
|
+
hide: hideOkBtn,
|
|
75
|
+
calendarDate: calendarDate,
|
|
76
|
+
onOk: onOk
|
|
77
|
+
}, locale === null || locale === void 0 ? void 0 : locale.ok)));
|
|
94
78
|
});
|
|
95
79
|
Toolbar.displayName = 'Toolbar';
|
|
96
80
|
Toolbar.propTypes = {
|
package/esm/DatePicker/index.js
CHANGED
|
File without changes
|
|
@@ -7,6 +7,8 @@ export interface DateRangePickerProps extends PickerBaseProps, FormControlBasePr
|
|
|
7
7
|
ranges?: RangeType[];
|
|
8
8
|
/** Format date */
|
|
9
9
|
format?: string;
|
|
10
|
+
/** Rendered as an input, the date can be entered via the keyboard */
|
|
11
|
+
editable?: boolean;
|
|
10
12
|
/** The date range that will be selected when you click on the date */
|
|
11
13
|
hoverRange?: 'week' | 'month' | ((date: Date) => DateRange);
|
|
12
14
|
/** Whether to click once on selected date range,Can be used with hoverRange */
|
|
@@ -9,6 +9,8 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
10
10
|
import { FormattedDate } from '../CustomProvider';
|
|
11
11
|
import Toolbar from '../DatePicker/Toolbar';
|
|
12
|
+
import PredefinedRanges from '../DatePicker/PredefinedRanges';
|
|
13
|
+
import Stack from '../Stack';
|
|
12
14
|
import { omitTriggerPropKeys, PickerOverlay, pickerPropTypes, PickerToggle, PickerToggleTrigger, pickTriggerPropKeys, usePickerClassName, usePublicMethods, useToggleKeyDownEvent } from '../Picker';
|
|
13
15
|
import { createChainedFunction, DATERANGE_DISABLED_TARGET, DateUtils, mergeRefs, useClassNames, useControlled, useCustom } from '../utils';
|
|
14
16
|
import { addMonths, compareAsc, isSameMonth } from '../utils/dateUtils';
|
|
@@ -25,6 +27,8 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
27
|
className = props.className,
|
|
26
28
|
_props$appearance = props.appearance,
|
|
27
29
|
appearance = _props$appearance === void 0 ? 'default' : _props$appearance,
|
|
30
|
+
_props$editable = props.editable,
|
|
31
|
+
editable = _props$editable === void 0 ? true : _props$editable,
|
|
28
32
|
_props$cleanable = props.cleanable,
|
|
29
33
|
cleanable = _props$cleanable === void 0 ? true : _props$cleanable,
|
|
30
34
|
_props$character = props.character,
|
|
@@ -68,7 +72,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
68
72
|
onOpen = props.onOpen,
|
|
69
73
|
onSelect = props.onSelect,
|
|
70
74
|
renderTitle = props.renderTitle,
|
|
71
|
-
rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "appearance", "cleanable", "character", "defaultCalendarValue", "defaultValue", "disabled", "disabledDate", "format", "hoverRange", "isoWeek", "limitEndYear", "locale", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "renderValue", "showOneCalendar", "showWeekNumbers", "showMeridian", "style", "toggleAs", "caretAs", "value", "onChange", "onClean", "onClose", "onEnter", "onEntered", "onExited", "onOk", "onOpen", "onSelect", "renderTitle"]);
|
|
75
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "appearance", "editable", "cleanable", "character", "defaultCalendarValue", "defaultValue", "disabled", "disabledDate", "format", "hoverRange", "isoWeek", "limitEndYear", "locale", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "renderValue", "showOneCalendar", "showWeekNumbers", "showMeridian", "style", "toggleAs", "caretAs", "value", "onChange", "onClean", "onClose", "onEnter", "onEntered", "onExited", "onOk", "onOpen", "onSelect", "renderTitle"]);
|
|
72
76
|
|
|
73
77
|
var _useClassNames = useClassNames(classPrefix),
|
|
74
78
|
merge = _useClassNames.merge,
|
|
@@ -135,11 +139,31 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
135
139
|
*/
|
|
136
140
|
|
|
137
141
|
var updateCalendarDateRange = useCallback(function (value, calendarKey) {
|
|
142
|
+
var nextValue = value;
|
|
143
|
+
var shouldTime = DateUtils.shouldTime,
|
|
144
|
+
getHours = DateUtils.getHours,
|
|
145
|
+
getMinutes = DateUtils.getMinutes,
|
|
146
|
+
getSeconds = DateUtils.getSeconds,
|
|
147
|
+
set = DateUtils.set;
|
|
148
|
+
|
|
149
|
+
if (shouldTime(formatStr) && calendarKey === undefined && (value === null || value === void 0 ? void 0 : value.length) === 1 && (defaultCalendarValue === null || defaultCalendarValue === void 0 ? void 0 : defaultCalendarValue.length) === 2) {
|
|
150
|
+
var calendarEndDate = (calendarDate === null || calendarDate === void 0 ? void 0 : calendarDate[1]) || defaultCalendarValue[1];
|
|
151
|
+
var _startDate = value[0]; // When updating the start date, the time of the end date should keep the time set by the user by default.
|
|
152
|
+
|
|
153
|
+
var _endDate = set(addMonths(_startDate, 1), {
|
|
154
|
+
hours: getHours(calendarEndDate),
|
|
155
|
+
minutes: getMinutes(calendarEndDate),
|
|
156
|
+
seconds: getSeconds(calendarEndDate)
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
nextValue = [_startDate, _endDate];
|
|
160
|
+
}
|
|
161
|
+
|
|
138
162
|
setCalendarDate(getCalendarDate({
|
|
139
|
-
value:
|
|
163
|
+
value: nextValue,
|
|
140
164
|
calendarKey: calendarKey
|
|
141
165
|
}));
|
|
142
|
-
}, []); // if valueProp changed then update selectValue/hoverValue
|
|
166
|
+
}, [calendarDate, defaultCalendarValue, formatStr]); // if valueProp changed then update selectValue/hoverValue
|
|
143
167
|
|
|
144
168
|
useEffect(function () {
|
|
145
169
|
setSelectedDates(valueProp !== null && valueProp !== void 0 ? valueProp : []);
|
|
@@ -371,10 +395,17 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
371
395
|
closeOverlay = false;
|
|
372
396
|
}
|
|
373
397
|
|
|
374
|
-
|
|
398
|
+
updateCalendarDateRange(value);
|
|
399
|
+
|
|
400
|
+
if (closeOverlay) {
|
|
401
|
+
handleValueUpdate(event, value, closeOverlay);
|
|
402
|
+
} else {
|
|
403
|
+
setSelectedDates(value !== null && value !== void 0 ? value : []);
|
|
404
|
+
} // End unfinished selections.
|
|
405
|
+
|
|
375
406
|
|
|
376
407
|
hasDoneSelect.current = true;
|
|
377
|
-
}, [handleValueUpdate]);
|
|
408
|
+
}, [handleValueUpdate, updateCalendarDateRange]);
|
|
378
409
|
var handleOK = useCallback(function (event) {
|
|
379
410
|
handleValueUpdate(event, selectedDates);
|
|
380
411
|
onOk === null || onOk === void 0 ? void 0 : onOk(selectedDates, event);
|
|
@@ -435,10 +466,11 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
435
466
|
var nextCalendarDate;
|
|
436
467
|
|
|
437
468
|
if (value && value.length) {
|
|
438
|
-
var
|
|
469
|
+
var _startDate2 = value[0],
|
|
439
470
|
endData = value[1];
|
|
440
|
-
nextCalendarDate = [
|
|
471
|
+
nextCalendarDate = [_startDate2, isSameMonth(_startDate2, endData) ? addMonths(endData, 1) : endData];
|
|
441
472
|
} else {
|
|
473
|
+
// Reset the date on the calendar to the default date
|
|
442
474
|
nextCalendarDate = getCalendarDate({
|
|
443
475
|
value: defaultCalendarValue !== null && defaultCalendarValue !== void 0 ? defaultCalendarValue : null
|
|
444
476
|
});
|
|
@@ -542,13 +574,27 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
542
574
|
renderTitle: renderTitle
|
|
543
575
|
};
|
|
544
576
|
return /*#__PURE__*/React.createElement(PickerOverlay, {
|
|
577
|
+
role: "dialog",
|
|
545
578
|
className: classes,
|
|
546
579
|
ref: mergeRefs(overlayRef, speakerRef),
|
|
547
580
|
target: triggerRef,
|
|
548
581
|
style: styles
|
|
549
582
|
}, /*#__PURE__*/React.createElement("div", {
|
|
550
583
|
className: panelClasses
|
|
551
|
-
}, /*#__PURE__*/React.createElement(
|
|
584
|
+
}, /*#__PURE__*/React.createElement(Stack, {
|
|
585
|
+
alignItems: "flex-start"
|
|
586
|
+
}, /*#__PURE__*/React.createElement(PredefinedRanges, {
|
|
587
|
+
direction: "column",
|
|
588
|
+
spacing: 0,
|
|
589
|
+
className: prefix('daterange-predefined'),
|
|
590
|
+
ranges: (ranges === null || ranges === void 0 ? void 0 : ranges.filter(function (range) {
|
|
591
|
+
return (range === null || range === void 0 ? void 0 : range.placement) === 'left';
|
|
592
|
+
})) || [],
|
|
593
|
+
calendarDate: calendarDate,
|
|
594
|
+
locale: locale,
|
|
595
|
+
disabledShortcut: disabledShortcutButton,
|
|
596
|
+
onClickShortcut: handleShortcutPageDate
|
|
597
|
+
}), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
552
598
|
className: prefix('daterange-content')
|
|
553
599
|
}, /*#__PURE__*/React.createElement("div", {
|
|
554
600
|
className: prefix('daterange-header')
|
|
@@ -566,8 +612,10 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
566
612
|
hideOkBtn: oneTap,
|
|
567
613
|
onOk: handleOK,
|
|
568
614
|
onClickShortcut: handleShortcutPageDate,
|
|
569
|
-
ranges: ranges
|
|
570
|
-
|
|
615
|
+
ranges: ranges === null || ranges === void 0 ? void 0 : ranges.filter(function (range) {
|
|
616
|
+
return (range === null || range === void 0 ? void 0 : range.placement) === 'bottom' || (range === null || range === void 0 ? void 0 : range.placement) === undefined;
|
|
617
|
+
})
|
|
618
|
+
})))));
|
|
571
619
|
};
|
|
572
620
|
|
|
573
621
|
var hasValue = !isNil(value) && value.length > 1;
|
|
@@ -598,7 +646,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
598
646
|
as: toggleAs,
|
|
599
647
|
ref: targetRef,
|
|
600
648
|
appearance: appearance,
|
|
601
|
-
editable:
|
|
649
|
+
editable: editable,
|
|
602
650
|
inputMask: DateUtils.getDateMask(rangeFormatStr),
|
|
603
651
|
inputValue: value ? getDisplayString(value, true) : '',
|
|
604
652
|
inputPlaceholder: typeof placeholder === 'string' && placeholder ? placeholder : rangeFormatStr,
|
|
File without changes
|
|
@@ -4,8 +4,9 @@ export declare type ValueType = [Date?, Date?];
|
|
|
4
4
|
export declare type DateRange = [Date, Date];
|
|
5
5
|
export interface RangeType {
|
|
6
6
|
label: React.ReactNode;
|
|
7
|
-
closeOverlay?: boolean;
|
|
8
7
|
value: DateRange | ((value?: ValueType) => DateRange);
|
|
8
|
+
closeOverlay?: boolean;
|
|
9
|
+
placement?: 'bottom' | 'left';
|
|
9
10
|
}
|
|
10
11
|
export declare type DisabledDateFunction = (
|
|
11
12
|
/** Date used to determine if disabling is required. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import DisclosureButton from './DisclosureButton';
|
|
3
3
|
import DisclosureContent from './DisclosureContent';
|
|
4
|
-
export declare type DisclosureTrigger = 'click' | '
|
|
5
|
-
export interface DisclosureRenderProps extends Pick<React.HTMLAttributes<HTMLElement>, '
|
|
4
|
+
export declare type DisclosureTrigger = 'click' | 'mouseover';
|
|
5
|
+
export interface DisclosureRenderProps extends Pick<React.HTMLAttributes<HTMLElement>, 'onMouseOver' | 'onMouseOut'> {
|
|
6
6
|
open: boolean;
|
|
7
7
|
}
|
|
8
8
|
export interface DisclosureProps {
|
|
@@ -59,7 +59,7 @@ var Disclosure = /*#__PURE__*/React.memo(function (props) {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
-
var
|
|
62
|
+
var onMouseOver = useCallback(function (event) {
|
|
63
63
|
if (!open) {
|
|
64
64
|
dispatch({
|
|
65
65
|
type: DisclosureActionTypes.Show
|
|
@@ -67,7 +67,7 @@ var Disclosure = /*#__PURE__*/React.memo(function (props) {
|
|
|
67
67
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(true, event);
|
|
68
68
|
}
|
|
69
69
|
}, [open, dispatch, onToggle]);
|
|
70
|
-
var
|
|
70
|
+
var onMouseOut = useCallback(function (event) {
|
|
71
71
|
if (open) {
|
|
72
72
|
dispatch({
|
|
73
73
|
type: DisclosureActionTypes.Hide
|
|
@@ -98,13 +98,13 @@ var Disclosure = /*#__PURE__*/React.memo(function (props) {
|
|
|
98
98
|
open: open
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
if (trigger.includes('
|
|
102
|
-
renderProps.
|
|
103
|
-
renderProps.
|
|
101
|
+
if (trigger.includes('mouseover')) {
|
|
102
|
+
renderProps.onMouseOver = onMouseOver;
|
|
103
|
+
renderProps.onMouseOut = onMouseOut;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
return renderProps;
|
|
107
|
-
}, [open, trigger,
|
|
107
|
+
}, [open, trigger, onMouseOver, onMouseOut]);
|
|
108
108
|
return /*#__PURE__*/React.createElement(DisclosureContext.Provider, {
|
|
109
109
|
value: contextValue
|
|
110
110
|
}, children(renderProps, containerElementRef));
|
package/esm/Disclosure/index.js
CHANGED
|
File without changes
|
package/esm/Divider/index.js
CHANGED
|
File without changes
|
package/esm/Drawer/index.js
CHANGED
|
File without changes
|
|
File without changes
|