rsuite 6.0.0-canary-2025032014 → 6.0.0-canary-20250416
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/AutoComplete/styles/index.css +112 -62
- package/AutoComplete/styles/index.less +1 -1
- package/Box/styles/index.css +12 -0
- package/CHANGELOG.md +24 -0
- package/Calendar/styles/index.css +11 -9
- package/Calendar/styles/index.less +3 -1
- package/Cascader/styles/index.css +112 -62
- package/CheckPicker/styles/index.css +112 -62
- package/CheckPicker/styles/index.less +1 -1
- package/CheckTree/styles/index.css +113 -63
- package/CheckTree/styles/index.less +1 -1
- package/CheckTreePicker/styles/index.css +113 -63
- package/DateInput/styles/index.css +0 -7
- package/DatePicker/styles/index.css +122 -74
- package/DatePicker/styles/index.less +5 -11
- package/DateRangeInput/styles/index.css +0 -7
- package/DateRangePicker/styles/index.css +132 -78
- package/DateRangePicker/styles/index.less +10 -4
- package/Divider/styles/index.css +2 -2
- package/Divider/styles/index.less +2 -2
- package/Grid/styles/columns.less +1 -2
- package/Grid/styles/grid-framework.less +1 -0
- package/Grid/styles/index.css +9 -4
- package/Grid/styles/row.less +2 -2
- package/Input/styles/index.css +0 -7
- package/Input/styles/index.less +0 -6
- package/Input/styles/mixin.less +0 -4
- package/InputGroup/styles/index.css +1 -1
- package/InputGroup/styles/index.less +1 -1
- package/InputNumber/styles/index.css +1 -8
- package/InputPicker/styles/index.css +121 -70
- package/InputPicker/styles/index.less +4 -4
- package/Link/package.json +7 -0
- package/Link/styles/index.css +32 -0
- package/Link/styles/index.less +39 -0
- package/Message/styles/index.css +9 -0
- package/Message/styles/index.less +11 -0
- package/MultiCascadeTree/styles/index.css +112 -62
- package/MultiCascader/styles/index.css +112 -62
- package/Nav/styles/index.css +1 -0
- package/Nav/styles/index.less +1 -0
- package/Pagination/styles/index.css +114 -64
- package/PasswordInput/package.json +7 -0
- package/PasswordInput/styles/index.css +172 -0
- package/PasswordInput/styles/index.less +1 -0
- package/PasswordStrengthMeter/package.json +7 -0
- package/PasswordStrengthMeter/styles/index.css +33 -0
- package/PasswordStrengthMeter/styles/index.less +39 -0
- package/README.md +3 -3
- package/RadioGroup/styles/index.css +1 -0
- package/RadioGroup/styles/index.less +1 -0
- package/RangeSlider/styles/index.css +76 -43
- package/Rate/styles/index.css +48 -34
- package/Rate/styles/index.less +32 -21
- package/SelectPicker/styles/index.css +112 -62
- package/SelectPicker/styles/index.less +1 -1
- package/Slider/styles/index.css +76 -43
- package/Slider/styles/index.less +95 -48
- package/Tabs/styles/index.css +1 -0
- package/TagInput/styles/index.css +152 -91
- package/TagInput/styles/index.less +1 -1
- package/TagPicker/styles/index.css +151 -90
- package/TagPicker/styles/index.less +52 -41
- package/Textarea/package.json +7 -0
- package/Textarea/styles/index.css +6 -0
- package/Textarea/styles/index.less +7 -0
- package/TimePicker/styles/index.css +122 -74
- package/TimeRangePicker/styles/index.css +132 -78
- package/Toggle/styles/index.css +146 -87
- package/Toggle/styles/index.less +66 -38
- package/Tree/styles/index.css +113 -63
- package/Tree/styles/index.less +1 -1
- package/TreePicker/styles/index.css +113 -63
- package/cjs/AutoComplete/AutoComplete.d.ts +1 -1
- package/cjs/AutoComplete/AutoComplete.js +13 -11
- package/cjs/Avatar/Avatar.d.ts +3 -4
- package/cjs/Breadcrumb/Breadcrumb.js +2 -2
- package/cjs/Breadcrumb/BreadcrumbItem.js +1 -1
- package/cjs/Button/Button.js +9 -10
- package/cjs/Calendar/CalendarProvider.js +0 -0
- package/cjs/Calendar/hooks/useCalendar.js +0 -0
- package/cjs/Carousel/Carousel.js +2 -2
- package/cjs/Cascader/Cascader.js +42 -45
- package/cjs/Cascader/useActive.d.ts +6 -4
- package/cjs/Cascader/useActive.js +10 -8
- package/cjs/CheckPicker/CheckPicker.js +38 -41
- package/cjs/CheckTreePicker/CheckTreePicker.js +20 -22
- package/cjs/CustomProvider/CustomProvider.d.ts +1 -4
- package/cjs/CustomProvider/types.d.ts +10 -2
- package/cjs/DatePicker/DatePicker.d.ts +1 -1
- package/cjs/DatePicker/DatePicker.js +28 -25
- package/cjs/DatePicker/utils.d.ts +3 -3
- package/cjs/DatePicker/utils.js +3 -3
- package/cjs/DateRangePicker/DateRangePicker.js +39 -33
- package/cjs/DateRangePicker/utils.js +0 -0
- package/cjs/Divider/Divider.d.ts +3 -2
- package/cjs/Divider/Divider.js +2 -2
- package/cjs/Form/hooks/useFormValidate.js +0 -0
- package/cjs/Form/hooks/useSchemaModel.js +2 -54
- package/cjs/Form/utils/constructFlatSchema.d.ts +4 -0
- package/cjs/Form/utils/constructFlatSchema.js +41 -0
- package/cjs/FormControl/hooks/useField.js +0 -0
- package/cjs/FormControl/utils.js +0 -0
- package/cjs/Grid/Row.d.ts +2 -2
- package/cjs/Grid/Row.js +2 -20
- package/cjs/Grid/types.d.ts +1 -0
- package/cjs/Grid/utils/styles.d.ts +6 -0
- package/cjs/Grid/utils/styles.js +43 -0
- package/cjs/Image/Image.js +12 -11
- package/cjs/Image/hooks/useImage.d.ts +2 -0
- package/cjs/Image/hooks/useImage.js +19 -43
- package/cjs/InlineEdit/InlineEdit.js +3 -1
- package/cjs/InlineEdit/useEditState.d.ts +2 -0
- package/cjs/InlineEdit/useEditState.js +8 -0
- package/cjs/Input/Input.d.ts +3 -12
- package/cjs/Input/Input.js +12 -73
- package/cjs/InputPicker/InputPicker.js +27 -28
- package/cjs/Link/ExternalLinkIcon.d.ts +3 -0
- package/cjs/Link/ExternalLinkIcon.js +23 -0
- package/cjs/Link/Link.d.ts +14 -0
- package/cjs/Link/Link.js +52 -0
- package/cjs/Link/index.d.ts +4 -0
- package/cjs/Link/index.js +11 -0
- package/cjs/List/List.js +6 -2
- package/cjs/List/helper/useSortHelper.d.ts +7 -5
- package/cjs/List/helper/useSortHelper.js +109 -16
- package/cjs/List/helper/utils.js +14 -6
- package/cjs/MultiCascader/MultiCascader.js +40 -43
- package/cjs/Nav/NavItem.js +1 -1
- package/cjs/Nav/NavMegaMenu.d.ts +5 -0
- package/cjs/Nav/NavMegaMenu.js +5 -0
- package/cjs/Navbar/NavbarItem.js +1 -1
- package/cjs/Navbar/NavbarMegaMenu.js +1 -1
- package/cjs/PasswordInput/PasswordInput.d.ts +14 -0
- package/cjs/PasswordInput/PasswordInput.js +71 -0
- package/cjs/PasswordInput/index.d.ts +4 -0
- package/cjs/PasswordInput/index.js +11 -0
- package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
- package/cjs/PasswordStrengthMeter/PasswordStrengthMeter.js +50 -0
- package/cjs/PasswordStrengthMeter/index.d.ts +4 -0
- package/cjs/PasswordStrengthMeter/index.js +11 -0
- package/cjs/RangeSlider/RangeSlider.js +18 -3
- package/cjs/Rate/Character.d.ts +4 -3
- package/cjs/Rate/Character.js +19 -15
- package/cjs/Rate/Rate.d.ts +10 -2
- package/cjs/Rate/Rate.js +47 -42
- package/cjs/Rate/types.d.ts +8 -0
- package/cjs/Rate/types.js +4 -0
- package/cjs/Rate/useRatingStates.d.ts +20 -0
- package/cjs/Rate/useRatingStates.js +48 -0
- package/cjs/Rate/utils.d.ts +14 -3
- package/cjs/Rate/utils.js +50 -9
- package/cjs/SelectPicker/SelectPicker.js +45 -46
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
- package/cjs/Sidenav/SidenavItem.js +1 -1
- package/cjs/Slider/Graduated.d.ts +4 -0
- package/cjs/Slider/Graduated.js +43 -20
- package/cjs/Slider/Handle.d.ts +1 -1
- package/cjs/Slider/Handle.js +12 -12
- package/cjs/Slider/Slider.d.ts +16 -1
- package/cjs/Slider/Slider.js +7 -2
- package/cjs/Slider/useDrag.d.ts +1 -0
- package/cjs/Slider/useDrag.js +8 -3
- package/cjs/Steps/Steps.js +2 -2
- package/cjs/Tabs/Tabs.js +2 -2
- package/cjs/Textarea/Textarea.d.ts +32 -0
- package/cjs/Textarea/Textarea.js +51 -0
- package/cjs/Textarea/index.d.ts +4 -0
- package/cjs/Textarea/index.js +11 -0
- package/cjs/Timeline/Timeline.js +2 -2
- package/cjs/Toggle/Toggle.d.ts +10 -1
- package/cjs/Toggle/Toggle.js +12 -9
- package/cjs/TreePicker/TreePicker.js +18 -19
- package/cjs/index.d.ts +4 -1
- package/cjs/index.js +24 -6
- package/cjs/internals/Box/Box.d.ts +4 -0
- package/cjs/internals/Box/Box.js +1 -1
- package/cjs/internals/Box/utils.js +5 -1
- package/cjs/internals/InputBase/InputBase.d.ts +45 -0
- package/cjs/internals/InputBase/InputBase.js +96 -0
- package/cjs/internals/InputBase/index.d.ts +3 -0
- package/cjs/internals/InputBase/index.js +8 -0
- package/cjs/internals/Overlay/Modal.d.ts +1 -1
- package/cjs/internals/Overlay/OverlayTrigger.d.ts +4 -3
- package/cjs/internals/Overlay/OverlayTrigger.js +8 -3
- package/cjs/internals/Picker/Listbox.js +7 -9
- package/cjs/internals/Picker/PickerDrawer.d.ts +8 -0
- package/cjs/internals/Picker/PickerDrawer.js +31 -0
- package/cjs/internals/Picker/PickerPopup.js +5 -3
- package/cjs/internals/Picker/PickerToggle.d.ts +1 -0
- package/cjs/internals/Picker/PickerToggle.js +10 -3
- package/cjs/internals/Picker/PickerToggleTrigger.d.ts +51 -11
- package/cjs/internals/Picker/PickerToggleTrigger.js +59 -13
- package/cjs/internals/Picker/hooks/index.d.ts +0 -1
- package/cjs/internals/Picker/hooks/index.js +2 -4
- package/cjs/internals/Picker/hooks/useCombobox.d.ts +1 -0
- package/cjs/internals/Picker/hooks/useCombobox.js +3 -1
- package/cjs/internals/Picker/index.d.ts +1 -2
- package/cjs/internals/Picker/index.js +10 -12
- package/{esm → cjs/internals}/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/cjs/{SafeAnchor → internals/SafeAnchor}/SafeAnchor.js +3 -3
- package/cjs/internals/Tree/TreeView.js +3 -4
- package/cjs/internals/hooks/useRootClose.js +4 -4
- package/cjs/internals/index.d.ts +4 -0
- package/cjs/internals/index.js +13 -1
- package/cjs/internals/types/html.d.ts +2 -0
- package/cjs/internals/utils/{dom.d.ts → html/dom.d.ts} +1 -0
- package/cjs/internals/utils/{dom.js → html/dom.js} +8 -0
- package/cjs/internals/utils/{events.js → html/events.js} +0 -0
- package/cjs/internals/utils/{htmlPropsUtils.js → html/htmlPropsUtils.js} +0 -0
- package/cjs/internals/utils/html/index.d.ts +4 -0
- package/cjs/internals/utils/html/index.js +28 -0
- package/cjs/internals/utils/{safeSetSelection.js → html/safeSetSelection.js} +1 -1
- package/cjs/internals/utils/index.d.ts +3 -15
- package/cjs/internals/utils/index.js +20 -49
- package/cjs/internals/utils/{ReactChildren.d.ts → react/ReactChildren.d.ts} +2 -8
- package/cjs/internals/utils/{ReactChildren.js → react/ReactChildren.js} +5 -25
- package/cjs/internals/utils/react/ReactIs.d.ts +7 -0
- package/cjs/internals/utils/react/ReactIs.js +26 -0
- package/{esm/internals/utils → cjs/internals/utils/react}/createComponent.d.ts +2 -2
- package/cjs/internals/utils/{createComponent.js → react/createComponent.js} +3 -3
- package/cjs/internals/utils/{deprecateComponent.js → react/deprecateComponent.js} +1 -1
- package/cjs/internals/utils/{forwardRef.d.ts → react/forwardRef.d.ts} +1 -1
- package/cjs/internals/utils/react/index.d.ts +7 -0
- package/cjs/internals/utils/react/index.js +46 -0
- package/cjs/internals/utils/{mergeRefs.js → react/mergeRefs.js} +0 -0
- package/cjs/internals/utils/{getStringLength.d.ts → string/getStringLength.d.ts} +0 -1
- package/cjs/internals/utils/{getStringLength.js → string/getStringLength.js} +1 -3
- package/cjs/internals/utils/string/index.d.ts +4 -0
- package/cjs/internals/utils/string/index.js +28 -0
- package/cjs/internals/utils/{stringifyReactNode.js → string/stringifyReactNode.js} +0 -0
- package/cjs/internals/utils/{tplTransform.js → string/tplTransform.js} +0 -0
- package/cjs/locales/en_GB.js +2 -2
- package/cjs/locales/en_US.js +2 -2
- package/cjs/locales/index.js +0 -0
- package/cjs/locales/pl_PL.js +2 -3
- package/cjs/useBreakpointValue/useBreakpointValue.d.ts +6 -2
- package/cjs/useBreakpointValue/useBreakpointValue.js +9 -4
- package/cjs/useMediaQuery/breakpoints.d.ts +24 -0
- package/cjs/useMediaQuery/breakpoints.js +248 -0
- package/cjs/useMediaQuery/index.d.ts +1 -1
- package/cjs/useMediaQuery/types.d.ts +45 -0
- package/cjs/useMediaQuery/types.js +4 -0
- package/cjs/useMediaQuery/useMediaQuery.d.ts +4 -13
- package/cjs/useMediaQuery/useMediaQuery.js +30 -12
- package/cjs/useToaster/useToaster.d.ts +1 -1
- package/cjs/useToaster/useToaster.js +1 -1
- package/dist/rsuite-no-reset-rtl.css +565 -276
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +565 -276
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +565 -276
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +565 -276
- package/dist/rsuite.js +508 -211
- 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.map +1 -1
- package/esm/AutoComplete/AutoComplete.d.ts +1 -1
- package/esm/AutoComplete/AutoComplete.js +13 -11
- package/esm/Avatar/Avatar.d.ts +3 -4
- package/esm/Breadcrumb/Breadcrumb.js +3 -3
- package/esm/Breadcrumb/BreadcrumbItem.js +1 -1
- package/esm/Button/Button.js +10 -11
- package/esm/Calendar/CalendarProvider.js +0 -0
- package/esm/Calendar/hooks/useCalendar.js +0 -0
- package/esm/Carousel/Carousel.js +3 -3
- package/esm/Cascader/Cascader.js +43 -46
- package/esm/Cascader/useActive.d.ts +6 -4
- package/esm/Cascader/useActive.js +10 -8
- package/esm/CheckPicker/CheckPicker.js +39 -42
- package/esm/CheckTreePicker/CheckTreePicker.js +21 -23
- package/esm/CustomProvider/CustomProvider.d.ts +1 -4
- package/esm/CustomProvider/types.d.ts +10 -2
- package/esm/DatePicker/DatePicker.d.ts +1 -1
- package/esm/DatePicker/DatePicker.js +29 -26
- package/esm/DatePicker/utils.d.ts +3 -3
- package/esm/DatePicker/utils.js +4 -4
- package/esm/DateRangePicker/DateRangePicker.js +35 -29
- package/esm/DateRangePicker/utils.js +0 -0
- package/esm/Divider/Divider.d.ts +3 -2
- package/esm/Divider/Divider.js +2 -2
- package/esm/Form/hooks/useFormValidate.js +0 -0
- package/esm/Form/hooks/useSchemaModel.js +3 -55
- package/esm/Form/utils/constructFlatSchema.d.ts +4 -0
- package/esm/Form/utils/constructFlatSchema.js +37 -0
- package/esm/FormControl/hooks/useField.js +0 -0
- package/esm/FormControl/utils.js +0 -0
- package/esm/Grid/Row.d.ts +2 -2
- package/esm/Grid/Row.js +2 -20
- package/esm/Grid/types.d.ts +1 -0
- package/esm/Grid/utils/styles.d.ts +6 -0
- package/esm/Grid/utils/styles.js +37 -0
- package/esm/Image/Image.js +12 -11
- package/esm/Image/hooks/useImage.d.ts +2 -0
- package/esm/Image/hooks/useImage.js +20 -43
- package/esm/InlineEdit/InlineEdit.js +3 -1
- package/esm/InlineEdit/useEditState.d.ts +2 -0
- package/esm/InlineEdit/useEditState.js +8 -0
- package/esm/Input/Input.d.ts +3 -12
- package/esm/Input/Input.js +12 -74
- package/esm/InputPicker/InputPicker.js +28 -29
- package/esm/Link/ExternalLinkIcon.d.ts +3 -0
- package/esm/Link/ExternalLinkIcon.js +18 -0
- package/esm/Link/Link.d.ts +14 -0
- package/esm/Link/Link.js +47 -0
- package/esm/Link/index.d.ts +4 -0
- package/esm/Link/index.js +8 -0
- package/esm/List/List.js +6 -2
- package/esm/List/helper/useSortHelper.d.ts +7 -5
- package/esm/List/helper/useSortHelper.js +109 -16
- package/esm/List/helper/utils.js +14 -6
- package/esm/MultiCascader/MultiCascader.js +41 -44
- package/esm/Nav/NavItem.js +1 -1
- package/esm/Nav/NavMegaMenu.d.ts +5 -0
- package/esm/Nav/NavMegaMenu.js +5 -0
- package/esm/Navbar/NavbarItem.js +1 -1
- package/esm/Navbar/NavbarMegaMenu.js +1 -1
- package/esm/PasswordInput/PasswordInput.d.ts +14 -0
- package/esm/PasswordInput/PasswordInput.js +66 -0
- package/esm/PasswordInput/index.d.ts +4 -0
- package/esm/PasswordInput/index.js +8 -0
- package/esm/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
- package/esm/PasswordStrengthMeter/PasswordStrengthMeter.js +45 -0
- package/esm/PasswordStrengthMeter/index.d.ts +4 -0
- package/esm/PasswordStrengthMeter/index.js +8 -0
- package/esm/RangeSlider/RangeSlider.js +18 -3
- package/esm/Rate/Character.d.ts +4 -3
- package/esm/Rate/Character.js +20 -16
- package/esm/Rate/Rate.d.ts +10 -2
- package/esm/Rate/Rate.js +49 -42
- package/esm/Rate/types.d.ts +8 -0
- package/esm/Rate/types.js +2 -0
- package/esm/Rate/useRatingStates.d.ts +20 -0
- package/esm/Rate/useRatingStates.js +43 -0
- package/esm/Rate/utils.d.ts +14 -3
- package/esm/Rate/utils.js +46 -7
- package/esm/SelectPicker/SelectPicker.js +46 -47
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
- package/esm/Sidenav/SidenavItem.js +1 -1
- package/esm/Slider/Graduated.d.ts +4 -0
- package/esm/Slider/Graduated.js +43 -20
- package/esm/Slider/Handle.d.ts +1 -1
- package/esm/Slider/Handle.js +12 -12
- package/esm/Slider/Slider.d.ts +16 -1
- package/esm/Slider/Slider.js +7 -2
- package/esm/Slider/useDrag.d.ts +1 -0
- package/esm/Slider/useDrag.js +8 -3
- package/esm/Steps/Steps.js +3 -3
- package/esm/Tabs/Tabs.js +3 -3
- package/esm/Textarea/Textarea.d.ts +32 -0
- package/esm/Textarea/Textarea.js +46 -0
- package/esm/Textarea/index.d.ts +4 -0
- package/esm/Textarea/index.js +8 -0
- package/esm/Timeline/Timeline.js +3 -3
- package/esm/Toggle/Toggle.d.ts +10 -1
- package/esm/Toggle/Toggle.js +12 -9
- package/esm/TreePicker/TreePicker.js +19 -20
- package/esm/index.d.ts +4 -1
- package/esm/index.js +4 -1
- package/esm/internals/Box/Box.d.ts +4 -0
- package/esm/internals/Box/Box.js +1 -1
- package/esm/internals/Box/utils.js +5 -1
- package/esm/internals/InputBase/InputBase.d.ts +45 -0
- package/esm/internals/InputBase/InputBase.js +89 -0
- package/esm/internals/InputBase/index.d.ts +3 -0
- package/esm/internals/InputBase/index.js +3 -0
- package/esm/internals/Overlay/Modal.d.ts +1 -1
- package/esm/internals/Overlay/OverlayTrigger.d.ts +4 -3
- package/esm/internals/Overlay/OverlayTrigger.js +8 -2
- package/esm/internals/Picker/Listbox.js +8 -10
- package/esm/internals/Picker/PickerDrawer.d.ts +8 -0
- package/esm/internals/Picker/PickerDrawer.js +26 -0
- package/esm/internals/Picker/PickerPopup.js +5 -3
- package/esm/internals/Picker/PickerToggle.d.ts +1 -0
- package/esm/internals/Picker/PickerToggle.js +10 -3
- package/esm/internals/Picker/PickerToggleTrigger.d.ts +51 -11
- package/esm/internals/Picker/PickerToggleTrigger.js +59 -12
- package/esm/internals/Picker/hooks/index.d.ts +0 -1
- package/esm/internals/Picker/hooks/index.js +1 -2
- package/esm/internals/Picker/hooks/useCombobox.d.ts +1 -0
- package/esm/internals/Picker/hooks/useCombobox.js +3 -1
- package/esm/internals/Picker/index.d.ts +1 -2
- package/esm/internals/Picker/index.js +1 -2
- package/{cjs → esm/internals}/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/esm/{SafeAnchor → internals/SafeAnchor}/SafeAnchor.js +3 -3
- package/esm/internals/Tree/TreeView.js +4 -5
- package/esm/internals/hooks/useRootClose.js +1 -1
- package/esm/internals/index.d.ts +4 -0
- package/esm/internals/index.js +5 -0
- package/esm/internals/types/html.d.ts +2 -0
- package/esm/internals/utils/{dom.d.ts → html/dom.d.ts} +1 -0
- package/esm/internals/utils/{dom.js → html/dom.js} +7 -0
- package/esm/internals/utils/{events.js → html/events.js} +0 -0
- package/esm/internals/utils/{htmlPropsUtils.js → html/htmlPropsUtils.js} +0 -0
- package/esm/internals/utils/html/index.d.ts +4 -0
- package/esm/internals/utils/html/index.js +5 -0
- package/esm/internals/utils/{safeSetSelection.js → html/safeSetSelection.js} +1 -1
- package/esm/internals/utils/index.d.ts +3 -15
- package/esm/internals/utils/index.js +3 -14
- package/esm/internals/utils/{ReactChildren.d.ts → react/ReactChildren.d.ts} +2 -8
- package/esm/internals/utils/{ReactChildren.js → react/ReactChildren.js} +3 -21
- package/esm/internals/utils/react/ReactIs.d.ts +7 -0
- package/esm/internals/utils/react/ReactIs.js +22 -0
- package/{cjs/internals/utils → esm/internals/utils/react}/createComponent.d.ts +2 -2
- package/esm/internals/utils/{createComponent.js → react/createComponent.js} +3 -3
- package/esm/internals/utils/{deprecateComponent.js → react/deprecateComponent.js} +1 -1
- package/esm/internals/utils/{forwardRef.d.ts → react/forwardRef.d.ts} +1 -1
- package/esm/internals/utils/react/index.d.ts +7 -0
- package/esm/internals/utils/react/index.js +8 -0
- package/esm/internals/utils/{mergeRefs.js → react/mergeRefs.js} +0 -0
- package/esm/internals/utils/{getStringLength.d.ts → string/getStringLength.d.ts} +0 -1
- package/esm/internals/utils/{getStringLength.js → string/getStringLength.js} +1 -2
- package/esm/internals/utils/string/index.d.ts +4 -0
- package/esm/internals/utils/string/index.js +5 -0
- package/esm/internals/utils/{stringifyReactNode.js → string/stringifyReactNode.js} +0 -0
- package/esm/internals/utils/{tplTransform.js → string/tplTransform.js} +0 -0
- package/esm/locales/en_GB.js +2 -2
- package/esm/locales/en_US.js +2 -2
- package/esm/locales/index.js +0 -0
- package/esm/locales/pl_PL.js +1 -1
- package/esm/useBreakpointValue/useBreakpointValue.d.ts +6 -2
- package/esm/useBreakpointValue/useBreakpointValue.js +9 -4
- package/esm/useMediaQuery/breakpoints.d.ts +24 -0
- package/esm/useMediaQuery/breakpoints.js +244 -0
- package/esm/useMediaQuery/index.d.ts +1 -1
- package/esm/useMediaQuery/types.d.ts +45 -0
- package/esm/useMediaQuery/types.js +2 -0
- package/esm/useMediaQuery/useMediaQuery.d.ts +4 -13
- package/esm/useMediaQuery/useMediaQuery.js +29 -11
- package/esm/useToaster/useToaster.d.ts +1 -1
- package/esm/useToaster/useToaster.js +1 -1
- package/internals/Box/styles/index.less +4 -0
- package/internals/Picker/styles/index.less +105 -23
- package/internals/Picker/styles/mixin.less +6 -6
- package/package.json +3 -2
- package/styles/color-modes/dark.less +2 -2
- package/styles/color-modes/high-contrast.less +2 -2
- package/styles/color-modes/light.less +2 -2
- package/styles/index.less +3 -0
- package/styles/root.less +2 -0
- package/styles/variables.less +0 -24
- package/SafeAnchor/package.json +0 -7
- package/cjs/Form/hooks/useFormClassNames.d.ts +0 -5
- package/cjs/Form/hooks/useFormClassNames.js +0 -29
- package/cjs/internals/Picker/hooks/usePickerClassName.d.ts +0 -19
- package/cjs/internals/Picker/hooks/usePickerClassName.js +0 -45
- package/esm/Form/hooks/useFormClassNames.d.ts +0 -5
- package/esm/Form/hooks/useFormClassNames.js +0 -25
- package/esm/internals/Picker/hooks/usePickerClassName.d.ts +0 -19
- package/esm/internals/Picker/hooks/usePickerClassName.js +0 -40
- /package/cjs/{SafeAnchor → internals/SafeAnchor}/index.d.ts +0 -0
- /package/cjs/{SafeAnchor → internals/SafeAnchor}/index.js +0 -0
- /package/cjs/internals/utils/{events.d.ts → html/events.d.ts} +0 -0
- /package/cjs/internals/utils/{htmlPropsUtils.d.ts → html/htmlPropsUtils.d.ts} +0 -0
- /package/cjs/internals/utils/{safeSetSelection.d.ts → html/safeSetSelection.d.ts} +0 -0
- /package/cjs/internals/utils/{deprecateComponent.d.ts → react/deprecateComponent.d.ts} +0 -0
- /package/cjs/internals/utils/{forwardRef.js → react/forwardRef.js} +0 -0
- /package/cjs/internals/utils/{getDOMNode.d.ts → react/getDOMNode.d.ts} +0 -0
- /package/cjs/internals/utils/{getDOMNode.js → react/getDOMNode.js} +0 -0
- /package/cjs/internals/utils/{mergeRefs.d.ts → react/mergeRefs.d.ts} +0 -0
- /package/cjs/internals/utils/{getSafeRegExpString.d.ts → string/getSafeRegExpString.d.ts} +0 -0
- /package/cjs/internals/utils/{getSafeRegExpString.js → string/getSafeRegExpString.js} +0 -0
- /package/cjs/internals/utils/{stringifyReactNode.d.ts → string/stringifyReactNode.d.ts} +0 -0
- /package/cjs/internals/utils/{tplTransform.d.ts → string/tplTransform.d.ts} +0 -0
- /package/esm/{SafeAnchor → internals/SafeAnchor}/index.d.ts +0 -0
- /package/esm/{SafeAnchor → internals/SafeAnchor}/index.js +0 -0
- /package/esm/internals/utils/{events.d.ts → html/events.d.ts} +0 -0
- /package/esm/internals/utils/{htmlPropsUtils.d.ts → html/htmlPropsUtils.d.ts} +0 -0
- /package/esm/internals/utils/{safeSetSelection.d.ts → html/safeSetSelection.d.ts} +0 -0
- /package/esm/internals/utils/{deprecateComponent.d.ts → react/deprecateComponent.d.ts} +0 -0
- /package/esm/internals/utils/{forwardRef.js → react/forwardRef.js} +0 -0
- /package/esm/internals/utils/{getDOMNode.d.ts → react/getDOMNode.d.ts} +0 -0
- /package/esm/internals/utils/{getDOMNode.js → react/getDOMNode.js} +0 -0
- /package/esm/internals/utils/{mergeRefs.d.ts → react/mergeRefs.d.ts} +0 -0
- /package/esm/internals/utils/{getSafeRegExpString.d.ts → string/getSafeRegExpString.d.ts} +0 -0
- /package/esm/internals/utils/{getSafeRegExpString.js → string/getSafeRegExpString.js} +0 -0
- /package/esm/internals/utils/{stringifyReactNode.d.ts → string/stringifyReactNode.d.ts} +0 -0
- /package/esm/internals/utils/{tplTransform.d.ts → string/tplTransform.d.ts} +0 -0
|
@@ -3,7 +3,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import CheckTreeView from "../CheckTree/CheckTreeView.js";
|
|
6
|
-
import Box from "../internals/Box/index.js";
|
|
7
6
|
import useTreeValue from "../CheckTree/hooks/useTreeValue.js";
|
|
8
7
|
import useFlattenTree from "../Tree/hooks/useFlattenTree.js";
|
|
9
8
|
import useTreeWithChildren from "../Tree/hooks/useTreeWithChildren.js";
|
|
@@ -12,10 +11,9 @@ import useFocusState from "./hooks/useFocusState.js";
|
|
|
12
11
|
import isNil from 'lodash/isNil';
|
|
13
12
|
import pick from 'lodash/pick';
|
|
14
13
|
import isFunction from 'lodash/isFunction';
|
|
15
|
-
import omit from 'lodash/omit';
|
|
16
14
|
import { useStyles, useEventCallback } from "../internals/hooks/index.js";
|
|
17
15
|
import { forwardRef, createChainedFunction, mergeRefs } from "../internals/utils/index.js";
|
|
18
|
-
import { PickerToggle, onMenuKeyDown, PickerPopup, SelectedElement, PickerToggleTrigger,
|
|
16
|
+
import { PickerToggle, onMenuKeyDown, PickerPopup, SelectedElement, PickerToggleTrigger, useToggleKeyDownEvent, usePickerRef, triggerPropKeys } from "../internals/Picker/index.js";
|
|
19
17
|
import { getSelectedItems } from "../CheckTree/utils.js";
|
|
20
18
|
import { TreeProvider, useTreeImperativeHandle } from "../internals/Tree/TreeProvider.js";
|
|
21
19
|
import { useCustom } from "../CustomProvider/index.js";
|
|
@@ -32,9 +30,11 @@ const CheckTreePicker = forwardRef((props, ref) => {
|
|
|
32
30
|
as,
|
|
33
31
|
id,
|
|
34
32
|
appearance = 'default',
|
|
33
|
+
block,
|
|
35
34
|
cleanable = true,
|
|
36
35
|
countable = true,
|
|
37
36
|
cascade = true,
|
|
37
|
+
className,
|
|
38
38
|
classPrefix = 'picker',
|
|
39
39
|
childrenKey = 'children',
|
|
40
40
|
disabled,
|
|
@@ -51,11 +51,11 @@ const CheckTreePicker = forwardRef((props, ref) => {
|
|
|
51
51
|
placement = 'bottomStart',
|
|
52
52
|
treeHeight = 320,
|
|
53
53
|
toggleAs,
|
|
54
|
-
style,
|
|
55
54
|
searchBy,
|
|
56
55
|
searchKeyword,
|
|
57
56
|
showIndentLine,
|
|
58
57
|
searchable = true,
|
|
58
|
+
style,
|
|
59
59
|
valueKey = 'value',
|
|
60
60
|
value: controlledValue,
|
|
61
61
|
virtualized = false,
|
|
@@ -250,35 +250,33 @@ const CheckTreePicker = forwardRef((props, ref) => {
|
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
classPrefix,
|
|
256
|
-
appearance,
|
|
257
|
-
countable,
|
|
258
|
-
cleanable,
|
|
259
|
-
disabled,
|
|
260
|
-
hasValue: hasValidValue,
|
|
261
|
-
name: 'check-tree'
|
|
262
|
-
});
|
|
263
|
-
return /*#__PURE__*/React.createElement(PickerToggleTrigger, _extends({
|
|
253
|
+
return /*#__PURE__*/React.createElement(PickerToggleTrigger, {
|
|
254
|
+
as: as,
|
|
264
255
|
id: id,
|
|
256
|
+
name: "check-tree",
|
|
257
|
+
block: block,
|
|
258
|
+
disabled: disabled,
|
|
259
|
+
appearance: appearance,
|
|
265
260
|
popupType: "tree",
|
|
266
261
|
multiple: true,
|
|
267
|
-
|
|
262
|
+
triggerProps: {
|
|
263
|
+
...pick(props, triggerPropKeys),
|
|
264
|
+
...triggerProps
|
|
265
|
+
},
|
|
268
266
|
ref: trigger,
|
|
269
267
|
placement: placement,
|
|
270
|
-
speaker: renderTreeView
|
|
271
|
-
|
|
272
|
-
as: as,
|
|
273
|
-
className: classes,
|
|
268
|
+
speaker: renderTreeView,
|
|
269
|
+
rootRef: root,
|
|
274
270
|
style: style,
|
|
275
|
-
|
|
276
|
-
|
|
271
|
+
classPrefix: classPrefix,
|
|
272
|
+
className: className
|
|
273
|
+
}, /*#__PURE__*/React.createElement(PickerToggle, _extends({
|
|
277
274
|
ref: target,
|
|
278
275
|
appearance: appearance,
|
|
279
276
|
onKeyDown: onPickerKeydown,
|
|
280
277
|
onClean: createChainedFunction(handleClean, onClean),
|
|
281
278
|
cleanable: cleanable && !disabled,
|
|
279
|
+
countable: countable,
|
|
282
280
|
disabled: disabled,
|
|
283
281
|
as: toggleAs,
|
|
284
282
|
hasValue: hasValidValue,
|
|
@@ -286,7 +284,7 @@ const CheckTreePicker = forwardRef((props, ref) => {
|
|
|
286
284
|
placement: placement,
|
|
287
285
|
inputValue: value,
|
|
288
286
|
focusItemValue: focusItemValue
|
|
289
|
-
}), selectedElement || (locale === null || locale === void 0 ? void 0 : locale.placeholder)))
|
|
287
|
+
}, rest), selectedElement || (locale === null || locale === void 0 ? void 0 : locale.placeholder)));
|
|
290
288
|
});
|
|
291
289
|
CheckTreePicker.displayName = 'CheckTreePicker';
|
|
292
290
|
export default CheckTreePicker;
|
|
@@ -267,10 +267,7 @@ export declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
267
267
|
} | undefined;
|
|
268
268
|
Toggle?: {
|
|
269
269
|
on: string;
|
|
270
|
-
off: string;
|
|
271
|
-
* If true, the ripple effect is disabled.
|
|
272
|
-
* Affected components include: Button, Nav.Item, Pagination.
|
|
273
|
-
*/
|
|
270
|
+
off: string;
|
|
274
271
|
} | undefined;
|
|
275
272
|
}>>;
|
|
276
273
|
/**
|
|
@@ -56,6 +56,7 @@ import type { InputNumberProps } from '../InputNumber';
|
|
|
56
56
|
import type { InputPickerProps } from '../InputPicker';
|
|
57
57
|
import type { KbdProps } from '../Kbd';
|
|
58
58
|
import type { ImageProps } from '../Image';
|
|
59
|
+
import type { LinkProps } from '../Link';
|
|
59
60
|
import type { ListProps } from '../List';
|
|
60
61
|
import type { LoaderProps } from '../Loader';
|
|
61
62
|
import type { MaskedInputProps } from '../MaskedInput';
|
|
@@ -66,6 +67,8 @@ import type { MultiCascaderProps } from '../MultiCascader';
|
|
|
66
67
|
import type { NavProps } from '../Nav';
|
|
67
68
|
import type { NavbarProps } from '../Navbar';
|
|
68
69
|
import type { NotificationProps } from '../Notification';
|
|
70
|
+
import type { PasswordInputProps } from '../PasswordInput';
|
|
71
|
+
import type { PasswordStrengthMeterProps } from '../PasswordStrengthMeter';
|
|
69
72
|
import type { PaginationProps } from '../Pagination';
|
|
70
73
|
import type { PanelProps } from '../Panel';
|
|
71
74
|
import type { PanelGroupProps } from '../PanelGroup';
|
|
@@ -82,7 +85,6 @@ import type { RadioTileGroupProps } from '../RadioTileGroup';
|
|
|
82
85
|
import type { RangeSliderProps } from '../RangeSlider';
|
|
83
86
|
import type { RateProps } from '../Rate';
|
|
84
87
|
import type { RowProps } from '../Row';
|
|
85
|
-
import type { SafeAnchorProps } from '../SafeAnchor';
|
|
86
88
|
import type { SelectPickerProps } from '../SelectPicker';
|
|
87
89
|
import type { SidebarProps } from '../Sidebar';
|
|
88
90
|
import type { SidenavProps } from '../Sidenav';
|
|
@@ -105,9 +107,11 @@ import type { ToggleProps } from '../Toggle';
|
|
|
105
107
|
import type { TooltipProps } from '../Tooltip';
|
|
106
108
|
import type { TreeProps } from '../Tree';
|
|
107
109
|
import type { TreePickerProps } from '../TreePicker';
|
|
110
|
+
import type { TextareaProps } from '../Textarea';
|
|
108
111
|
import type { UploaderProps } from '../Uploader';
|
|
109
112
|
import type { VisuallyHiddenProps } from '../VisuallyHidden';
|
|
110
113
|
import type { WhisperProps } from '../Whisper';
|
|
114
|
+
import type { SafeAnchorProps } from '../internals/SafeAnchor';
|
|
111
115
|
interface ComponentProps<T> {
|
|
112
116
|
defaultProps: Partial<T>;
|
|
113
117
|
}
|
|
@@ -170,6 +174,7 @@ export interface ReactSuiteComponents {
|
|
|
170
174
|
InputPicker: ComponentProps<InputPickerProps>;
|
|
171
175
|
Image: ComponentProps<ImageProps>;
|
|
172
176
|
Kbd: ComponentProps<KbdProps>;
|
|
177
|
+
Link: ComponentProps<LinkProps>;
|
|
173
178
|
List: ComponentProps<ListProps>;
|
|
174
179
|
Loader: ComponentProps<LoaderProps>;
|
|
175
180
|
MaskedInput: ComponentProps<MaskedInputProps>;
|
|
@@ -180,6 +185,8 @@ export interface ReactSuiteComponents {
|
|
|
180
185
|
Nav: ComponentProps<NavProps>;
|
|
181
186
|
Navbar: ComponentProps<NavbarProps>;
|
|
182
187
|
Notification: ComponentProps<NotificationProps>;
|
|
188
|
+
PasswordInput: ComponentProps<PasswordInputProps>;
|
|
189
|
+
PasswordStrengthMeter: ComponentProps<PasswordStrengthMeterProps>;
|
|
183
190
|
Pagination: ComponentProps<PaginationProps>;
|
|
184
191
|
Panel: ComponentProps<PanelProps>;
|
|
185
192
|
PanelGroup: ComponentProps<PanelGroupProps>;
|
|
@@ -196,7 +203,6 @@ export interface ReactSuiteComponents {
|
|
|
196
203
|
RangeSlider: ComponentProps<RangeSliderProps>;
|
|
197
204
|
Rate: ComponentProps<RateProps>;
|
|
198
205
|
Row: ComponentProps<RowProps>;
|
|
199
|
-
SafeAnchor: ComponentProps<SafeAnchorProps>;
|
|
200
206
|
SelectPicker: ComponentProps<SelectPickerProps>;
|
|
201
207
|
Sidebar: ComponentProps<SidebarProps>;
|
|
202
208
|
Sidenav: ComponentProps<SidenavProps>;
|
|
@@ -219,8 +225,10 @@ export interface ReactSuiteComponents {
|
|
|
219
225
|
Tooltip: ComponentProps<TooltipProps>;
|
|
220
226
|
Tree: ComponentProps<TreeProps>;
|
|
221
227
|
TreePicker: ComponentProps<TreePickerProps>;
|
|
228
|
+
Textarea: ComponentProps<TextareaProps>;
|
|
222
229
|
Uploader: ComponentProps<UploaderProps>;
|
|
223
230
|
VisuallyHidden: ComponentProps<VisuallyHiddenProps>;
|
|
224
231
|
Whisper: ComponentProps<WhisperProps>;
|
|
232
|
+
SafeAnchor: ComponentProps<SafeAnchorProps>;
|
|
225
233
|
}
|
|
226
234
|
export {};
|
|
@@ -11,16 +11,16 @@ import Stack from "../Stack/index.js";
|
|
|
11
11
|
import PredefinedRanges from "./PredefinedRanges.js";
|
|
12
12
|
import DateInput from "../DateInput/index.js";
|
|
13
13
|
import InputGroup from "../InputGroup/index.js";
|
|
14
|
-
import Box from "../internals/Box/index.js";
|
|
15
14
|
import useMonthView from "./hooks/useMonthView.js";
|
|
16
15
|
import useFocus from "./hooks/useFocus.js";
|
|
17
16
|
import useCustomizedInput from "./hooks/useCustomizedInput.js";
|
|
17
|
+
import Box from "../internals/Box/index.js";
|
|
18
18
|
import { useCalendarDate } from "../Calendar/hooks/index.js";
|
|
19
19
|
import { isEveryDateInMonth } from "../Calendar/utils/index.js";
|
|
20
20
|
import { forwardRef, mergeRefs, partitionHTMLProps, createChainedFunction } from "../internals/utils/index.js";
|
|
21
21
|
import { useStyles, useControlled, useUniqueId, useEventCallback } from "../internals/hooks/index.js";
|
|
22
22
|
import { isValid, copyTime, disableTime, DateMode, useDateMode, calendarOnlyProps } from "../internals/utils/date/index.js";
|
|
23
|
-
import { PickerPopup, PickerLabel, PickerIndicator, PickerToggleTrigger,
|
|
23
|
+
import { PickerPopup, PickerLabel, PickerIndicator, PickerToggleTrigger, triggerPropKeys, usePickerRef, onMenuKeyDown } from "../internals/Picker/index.js";
|
|
24
24
|
import { OverlayCloseCause } from "../internals/Overlay/OverlayTrigger.js";
|
|
25
25
|
import { splitRanges, getRestProps } from "./utils.js";
|
|
26
26
|
import { startOfToday } from "../internals/utils/date/index.js";
|
|
@@ -36,6 +36,7 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
36
36
|
} = useCustom('DatePicker', props);
|
|
37
37
|
const {
|
|
38
38
|
as,
|
|
39
|
+
block,
|
|
39
40
|
className,
|
|
40
41
|
classPrefix = 'picker',
|
|
41
42
|
calendarDefaultDate,
|
|
@@ -363,8 +364,9 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
363
364
|
target: trigger,
|
|
364
365
|
onKeyDown: handlePickerPopupKeyDown
|
|
365
366
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
366
|
-
align: "flex-start"
|
|
367
|
-
|
|
367
|
+
align: "flex-start",
|
|
368
|
+
h: "100%"
|
|
369
|
+
}, sideRanges && sideRanges.length > 0 && /*#__PURE__*/React.createElement(PredefinedRanges, {
|
|
368
370
|
direction: "column",
|
|
369
371
|
spacing: 0,
|
|
370
372
|
className: prefix('date-predefined'),
|
|
@@ -373,7 +375,9 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
373
375
|
locale: locale,
|
|
374
376
|
disableShortcut: isDatetimeDisabled,
|
|
375
377
|
onShortcutClick: handleShortcutPageDate
|
|
376
|
-
}), /*#__PURE__*/React.createElement(
|
|
378
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
379
|
+
className: prefix('box')
|
|
380
|
+
}, /*#__PURE__*/React.createElement(CalendarContainer, _extends({}, calendarProps, {
|
|
377
381
|
targetId: id,
|
|
378
382
|
locale: locale,
|
|
379
383
|
showWeekNumbers: showWeekNumbers,
|
|
@@ -409,15 +413,6 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
409
413
|
}))));
|
|
410
414
|
};
|
|
411
415
|
const hasValue = isValid(value);
|
|
412
|
-
const [classes, usedClassNamePropKeys] = usePickerClassName({
|
|
413
|
-
...props,
|
|
414
|
-
className,
|
|
415
|
-
classPrefix,
|
|
416
|
-
name: 'date',
|
|
417
|
-
appearance,
|
|
418
|
-
hasValue,
|
|
419
|
-
cleanable
|
|
420
|
-
});
|
|
421
416
|
const caretAs = useMemo(() => {
|
|
422
417
|
if (caretAsProp === null) {
|
|
423
418
|
return null;
|
|
@@ -454,27 +449,35 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
454
449
|
Input,
|
|
455
450
|
events
|
|
456
451
|
} = useCustomizedInput(customizedProps);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
pickerProps: pick(props, pickTriggerPropKeys),
|
|
460
|
-
ref: trigger,
|
|
461
|
-
placement: placement,
|
|
452
|
+
const triggerProps = {
|
|
453
|
+
...pick(props, triggerPropKeys),
|
|
462
454
|
onClose: handleTriggerClose,
|
|
463
455
|
onEnter: createChainedFunction(events.onActive, onEnter),
|
|
464
|
-
onExit: createChainedFunction(events.onInactive, onExit)
|
|
465
|
-
|
|
466
|
-
|
|
456
|
+
onExit: createChainedFunction(events.onInactive, onExit)
|
|
457
|
+
};
|
|
458
|
+
return /*#__PURE__*/React.createElement(PickerToggleTrigger, {
|
|
467
459
|
as: as,
|
|
468
|
-
|
|
460
|
+
name: "date",
|
|
461
|
+
classPrefix: classPrefix,
|
|
462
|
+
className: merge(className, {
|
|
469
463
|
[prefix('error')]: invalidValue
|
|
470
464
|
}),
|
|
465
|
+
block: block,
|
|
466
|
+
disabled: disabled,
|
|
467
|
+
appearance: appearance,
|
|
471
468
|
style: style,
|
|
472
|
-
|
|
469
|
+
rootRef: root,
|
|
470
|
+
trigger: "active",
|
|
471
|
+
triggerProps: triggerProps,
|
|
472
|
+
ref: trigger,
|
|
473
|
+
placement: placement,
|
|
474
|
+
speaker: renderCalendarOverlay,
|
|
475
|
+
"data-cleanable": cleanable
|
|
473
476
|
}, plaintext ? /*#__PURE__*/React.createElement(DateInput, {
|
|
474
477
|
value: value,
|
|
475
478
|
format: formatStr,
|
|
476
479
|
plaintext: plaintext
|
|
477
|
-
}) : /*#__PURE__*/React.createElement(InputGroup, _extends({}, getRestProps(rest
|
|
480
|
+
}) : /*#__PURE__*/React.createElement(InputGroup, _extends({}, getRestProps(rest), {
|
|
478
481
|
inside: true,
|
|
479
482
|
size: size,
|
|
480
483
|
disabled: disabled,
|
|
@@ -503,7 +506,7 @@ const DatePicker = forwardRef((props, ref) => {
|
|
|
503
506
|
caretAs: caretAs,
|
|
504
507
|
onClose: handleClean,
|
|
505
508
|
showCleanButton: showCleanButton
|
|
506
|
-
})))
|
|
509
|
+
})));
|
|
507
510
|
});
|
|
508
511
|
DatePicker.displayName = 'DatePicker';
|
|
509
512
|
export default DatePicker;
|
|
@@ -10,8 +10,8 @@ export declare function getDefaultRanges<T extends Date | DateRange>(value: T):
|
|
|
10
10
|
* @param calendarDate
|
|
11
11
|
*/
|
|
12
12
|
export declare const getRanges: <T extends Date | DateRange>({ ranges, calendarDate }: Pick<ToolbarProps<T, T>, "calendarDate" | "ranges">) => InnerRange<T | null>[];
|
|
13
|
-
export declare function splitRanges(ranges?: DateOptionPreset<
|
|
14
|
-
sideRanges: DateOptionPreset<
|
|
15
|
-
bottomRanges: DateOptionPreset<
|
|
13
|
+
export declare function splitRanges<T extends Date | DateRange>(ranges?: DateOptionPreset<T | null>[]): {
|
|
14
|
+
sideRanges: DateOptionPreset<T | null>[] | undefined;
|
|
15
|
+
bottomRanges: DateOptionPreset<T | null>[] | undefined;
|
|
16
16
|
};
|
|
17
17
|
export declare const getRestProps: (props: any, omitProps?: string[]) => import("lodash").Omit<any, string>;
|
package/esm/DatePicker/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import omit from 'lodash/omit';
|
|
3
|
-
import {
|
|
3
|
+
import { overlayPropKeys } from "../internals/Picker/index.js";
|
|
4
4
|
import { subDays, startOfDay, endOfDay, calendarOnlyProps, startOfToday } from "../internals/utils/date/index.js";
|
|
5
5
|
export function getDefaultRanges(value) {
|
|
6
6
|
const today = startOfToday();
|
|
@@ -61,10 +61,10 @@ export const getRanges = _ref3 => {
|
|
|
61
61
|
};
|
|
62
62
|
export function splitRanges(ranges) {
|
|
63
63
|
// The shortcut option on the left side of the calendar panel
|
|
64
|
-
const sideRanges =
|
|
64
|
+
const sideRanges = ranges === null || ranges === void 0 ? void 0 : ranges.filter(range => (range === null || range === void 0 ? void 0 : range.placement) === 'left');
|
|
65
65
|
|
|
66
66
|
// The shortcut option on the bottom of the calendar panel
|
|
67
|
-
const bottomRanges =
|
|
67
|
+
const bottomRanges = ranges === null || ranges === void 0 ? void 0 : ranges.filter(range => (range === null || range === void 0 ? void 0 : range.placement) === 'bottom' || (range === null || range === void 0 ? void 0 : range.placement) === undefined);
|
|
68
68
|
return {
|
|
69
69
|
sideRanges,
|
|
70
70
|
bottomRanges
|
|
@@ -74,5 +74,5 @@ export const getRestProps = function (props, omitProps) {
|
|
|
74
74
|
if (omitProps === void 0) {
|
|
75
75
|
omitProps = [];
|
|
76
76
|
}
|
|
77
|
-
return omit(props, [...
|
|
77
|
+
return omit(props, [...overlayPropKeys, ...calendarOnlyProps, ...omitProps]);
|
|
78
78
|
};
|
|
@@ -14,15 +14,16 @@ import InputGroup from "../InputGroup/index.js";
|
|
|
14
14
|
import Header from "./Header.js";
|
|
15
15
|
import useDateDisabled from "./hooks/useDateDisabled.js";
|
|
16
16
|
import useCustomizedInput from "../DatePicker/hooks/useCustomizedInput.js";
|
|
17
|
-
import Calendar from "./Calendar.js";
|
|
18
17
|
import Box from "../internals/Box/index.js";
|
|
18
|
+
import Calendar from "./Calendar.js";
|
|
19
19
|
import * as StaticMethods from "./disabledDateUtils.js";
|
|
20
20
|
import { DateRangePickerProvider } from "./DateRangePickerProvider.js";
|
|
21
21
|
import { getSafeCalendarDate, getMonthHoverRange, getWeekHoverRange, isSameRange } from "./utils.js";
|
|
22
22
|
import { DATERANGE_DISABLED_TARGET as TARGET } from "../internals/constants/index.js";
|
|
23
23
|
import { useStyles, useControlled, useUniqueId, useEventCallback } from "../internals/hooks/index.js";
|
|
24
24
|
import { useCustom } from "../CustomProvider/index.js";
|
|
25
|
-
import {
|
|
25
|
+
import { splitRanges } from "../DatePicker/utils.js";
|
|
26
|
+
import { PickerPopup, PickerToggleTrigger, PickerIndicator, PickerLabel, triggerPropKeys, usePickerRef, onMenuKeyDown } from "../internals/Picker/index.js";
|
|
26
27
|
import { forwardRef, createChainedFunction, mergeRefs, partitionHTMLProps, getStringLength } from "../internals/utils/index.js";
|
|
27
28
|
import { addMonths, addDays, copyTime, calendarOnlyProps, endOfDay, isValid, isBefore, isSameDay, isAfter, isSameMonth, reverseDateRangeOmitTime, startOfDay, DateMode, useDateMode } from "../internals/utils/date/index.js";
|
|
28
29
|
/**
|
|
@@ -38,6 +39,7 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
38
39
|
} = useCustom('DateRangePicker', props);
|
|
39
40
|
const {
|
|
40
41
|
as,
|
|
42
|
+
block,
|
|
41
43
|
classPrefix = 'picker',
|
|
42
44
|
className,
|
|
43
45
|
appearance = 'default',
|
|
@@ -643,8 +645,10 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
643
645
|
index: 1
|
|
644
646
|
}, calendarProps)));
|
|
645
647
|
};
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
+
const {
|
|
649
|
+
sideRanges,
|
|
650
|
+
bottomRanges
|
|
651
|
+
} = splitRanges(ranges);
|
|
648
652
|
return /*#__PURE__*/React.createElement(PickerPopup, {
|
|
649
653
|
role: "dialog",
|
|
650
654
|
"aria-labelledby": label ? `${id}-label` : undefined,
|
|
@@ -657,8 +661,9 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
657
661
|
className: panelClasses,
|
|
658
662
|
style: panelStyles
|
|
659
663
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
660
|
-
align: "flex-start"
|
|
661
|
-
|
|
664
|
+
align: "flex-start",
|
|
665
|
+
h: "100%"
|
|
666
|
+
}, sideRanges && sideRanges.length > 0 && /*#__PURE__*/React.createElement(PredefinedRanges, {
|
|
662
667
|
direction: "column",
|
|
663
668
|
spacing: 0,
|
|
664
669
|
className: prefix('daterange-predefined'),
|
|
@@ -668,7 +673,9 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
668
673
|
disableShortcut: shouldDisableShortcut,
|
|
669
674
|
onShortcutClick: handleShortcutPageDate,
|
|
670
675
|
"data-testid": "daterange-predefined-side"
|
|
671
|
-
}), /*#__PURE__*/React.createElement(
|
|
676
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
677
|
+
className: prefix('box')
|
|
678
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
672
679
|
className: prefix('daterange-content')
|
|
673
680
|
}, showHeader && /*#__PURE__*/React.createElement(Header, {
|
|
674
681
|
value: isSelectedIdle ? selectedDates : hoverDateRange,
|
|
@@ -695,15 +702,6 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
695
702
|
})))));
|
|
696
703
|
};
|
|
697
704
|
const hasValue = !isNil(value) && value.length > 1;
|
|
698
|
-
const [classes, usedClassNamePropKeys] = usePickerClassName({
|
|
699
|
-
...props,
|
|
700
|
-
classPrefix,
|
|
701
|
-
className,
|
|
702
|
-
name: 'daterange',
|
|
703
|
-
appearance,
|
|
704
|
-
hasValue,
|
|
705
|
-
cleanable
|
|
706
|
-
});
|
|
707
705
|
const caretAs = useMemo(() => {
|
|
708
706
|
if (caretAsProp === null) {
|
|
709
707
|
return null;
|
|
@@ -756,26 +754,34 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
756
754
|
editable,
|
|
757
755
|
loading
|
|
758
756
|
});
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
ref: trigger,
|
|
762
|
-
pickerProps: pick(props, pickTriggerPropKeys),
|
|
763
|
-
placement: placement,
|
|
757
|
+
const triggerProps = {
|
|
758
|
+
...pick(props, triggerPropKeys),
|
|
764
759
|
onEnter: createChainedFunction(events.onActive, handleEnter, onEnter),
|
|
765
|
-
onExit: createChainedFunction(events.onInactive, handleExit, onExit)
|
|
766
|
-
|
|
767
|
-
|
|
760
|
+
onExit: createChainedFunction(events.onInactive, handleExit, onExit)
|
|
761
|
+
};
|
|
762
|
+
return /*#__PURE__*/React.createElement(PickerToggleTrigger, {
|
|
768
763
|
as: as,
|
|
769
|
-
|
|
770
|
-
|
|
764
|
+
name: "date-range",
|
|
765
|
+
classPrefix: classPrefix,
|
|
766
|
+
className: merge(className, {
|
|
771
767
|
[prefix('error')]: invalidValue
|
|
772
768
|
}),
|
|
773
|
-
|
|
769
|
+
block: block,
|
|
770
|
+
disabled: disabled,
|
|
771
|
+
appearance: appearance,
|
|
772
|
+
style: style,
|
|
773
|
+
rootRef: root,
|
|
774
|
+
ref: trigger,
|
|
775
|
+
placement: placement,
|
|
776
|
+
trigger: "active",
|
|
777
|
+
triggerProps: triggerProps,
|
|
778
|
+
speaker: renderCalendarOverlay,
|
|
779
|
+
"data-cleanable": cleanable
|
|
774
780
|
}, plaintext ? /*#__PURE__*/React.createElement(DateRangeInput, {
|
|
775
781
|
value: value,
|
|
776
782
|
format: formatStr,
|
|
777
783
|
plaintext: plaintext
|
|
778
|
-
}) : /*#__PURE__*/React.createElement(InputGroup, _extends({}, omit(rest, [...
|
|
784
|
+
}) : /*#__PURE__*/React.createElement(InputGroup, _extends({}, omit(rest, [...calendarOnlyProps, ...triggerPropKeys]), {
|
|
779
785
|
inside: true,
|
|
780
786
|
className: prefix`input-group`,
|
|
781
787
|
disabled: disabled,
|
|
@@ -805,7 +811,7 @@ const DateRangePicker = forwardRef((props, ref) => {
|
|
|
805
811
|
caretAs: caretAs,
|
|
806
812
|
onClose: handleClean,
|
|
807
813
|
showCleanButton: showCleanButton
|
|
808
|
-
})))
|
|
814
|
+
})));
|
|
809
815
|
}, StaticMethods);
|
|
810
816
|
DateRangePicker.displayName = 'DateRangePicker';
|
|
811
817
|
export default DateRangePicker;
|
|
File without changes
|
package/esm/Divider/Divider.d.ts
CHANGED
|
@@ -11,9 +11,10 @@ export interface DividerProps extends BoxProps {
|
|
|
11
11
|
*/
|
|
12
12
|
label?: React.ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
* The
|
|
14
|
+
* The placement of the label.
|
|
15
|
+
* @version 6.0.0
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
labelPlacement?: 'start' | 'center' | 'end';
|
|
17
18
|
/**
|
|
18
19
|
* Vertical dividing line. Cannot be used with label.
|
|
19
20
|
*/
|
package/esm/Divider/Divider.js
CHANGED
|
@@ -21,7 +21,7 @@ const Divider = forwardRef((props, ref) => {
|
|
|
21
21
|
children,
|
|
22
22
|
color,
|
|
23
23
|
label = children,
|
|
24
|
-
|
|
24
|
+
labelPlacement,
|
|
25
25
|
vertical,
|
|
26
26
|
spacing,
|
|
27
27
|
style,
|
|
@@ -46,7 +46,7 @@ const Divider = forwardRef((props, ref) => {
|
|
|
46
46
|
"data-appearance": appearance,
|
|
47
47
|
"data-orientation": vertical ? 'vertical' : 'horizontal',
|
|
48
48
|
"data-with-label": label ? 'true' : undefined,
|
|
49
|
-
"data-
|
|
49
|
+
"data-placement": labelPlacement
|
|
50
50
|
}, rest), label);
|
|
51
51
|
});
|
|
52
52
|
Divider.displayName = 'Divider';
|
|
File without changes
|
|
@@ -1,59 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { SchemaModel
|
|
2
|
+
import { SchemaModel } from 'schema-typed';
|
|
3
3
|
import { useRef, useCallback } from 'react';
|
|
4
|
-
|
|
5
|
-
* Convert a flat schema object to a nested schema object
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
*
|
|
9
|
-
* ```js
|
|
10
|
-
* const schema = {
|
|
11
|
-
* 'address.city': StringType().isRequired('City is required'),
|
|
12
|
-
* 'address.street': StringType().isRequired('Street is required')
|
|
13
|
-
* };
|
|
14
|
-
*
|
|
15
|
-
* const result = unflattenSchemaObject(schema);
|
|
16
|
-
*
|
|
17
|
-
* // result
|
|
18
|
-
* {
|
|
19
|
-
* address: ObjectType().shape({
|
|
20
|
-
* city: StringType().isRequired('City is required'),
|
|
21
|
-
* street: StringType().isRequired('Street is required')
|
|
22
|
-
* })
|
|
23
|
-
* }
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
function unflattenSchemaObject(schema) {
|
|
27
|
-
const result = {};
|
|
28
|
-
const $type = Symbol('schema-type');
|
|
29
|
-
Object.keys(schema).forEach(key => {
|
|
30
|
-
if (key.includes('.')) {
|
|
31
|
-
const keys = key.split('.');
|
|
32
|
-
const lastKey = keys.pop() || '';
|
|
33
|
-
let current = result;
|
|
34
|
-
keys.forEach(subKey => {
|
|
35
|
-
current[subKey] = current[subKey] || {
|
|
36
|
-
[$type]: 'object-type'
|
|
37
|
-
};
|
|
38
|
-
current = current[subKey];
|
|
39
|
-
});
|
|
40
|
-
current[lastKey] = schema[key];
|
|
41
|
-
} else {
|
|
42
|
-
result[key] = schema[key];
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
function convertToShape(obj) {
|
|
46
|
-
Object.keys(obj).forEach(key => {
|
|
47
|
-
var _obj$key;
|
|
48
|
-
if (((_obj$key = obj[key]) === null || _obj$key === void 0 ? void 0 : _obj$key[$type]) === 'object-type') {
|
|
49
|
-
delete obj[key][$type];
|
|
50
|
-
obj[key] = ObjectType().shape(convertToShape(obj[key]));
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
return obj;
|
|
54
|
-
}
|
|
55
|
-
return convertToShape(result);
|
|
56
|
-
}
|
|
4
|
+
import { constructFlatSchema } from "../utils/constructFlatSchema.js";
|
|
57
5
|
function useSchemaModel(formModel, nestedField) {
|
|
58
6
|
const subRulesRef = useRef([]);
|
|
59
7
|
const pushFieldRule = useCallback((name, fieldRule) => {
|
|
@@ -82,7 +30,7 @@ function useSchemaModel(formModel, nestedField) {
|
|
|
82
30
|
[name]: fieldRule.current
|
|
83
31
|
};
|
|
84
32
|
}).reduce((a, b) => Object.assign(a, b), {});
|
|
85
|
-
return SchemaModel.combine(formModel, SchemaModel(nestedField ?
|
|
33
|
+
return SchemaModel.combine(formModel, SchemaModel(nestedField ? constructFlatSchema(subRuleObject) : subRuleObject));
|
|
86
34
|
}, [formModel, nestedField]);
|
|
87
35
|
return {
|
|
88
36
|
getCombinedModel,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { ObjectType, ArrayType } from 'schema-typed';
|
|
3
|
+
import set from 'lodash/set';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* combine flat schema to nested schema
|
|
7
|
+
*/
|
|
8
|
+
export function constructFlatSchema(schema) {
|
|
9
|
+
const shape = {};
|
|
10
|
+
Object.keys(schema).forEach(key => {
|
|
11
|
+
set(shape, key, {
|
|
12
|
+
schema: schema[key],
|
|
13
|
+
primitiveType: true
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
function convertShapeToSchema(shape, result, internal) {
|
|
17
|
+
Object.keys(shape).forEach(key => {
|
|
18
|
+
const currentShape = shape[key];
|
|
19
|
+
if (Array.isArray(currentShape)) {
|
|
20
|
+
result[key] = ArrayType().of(...currentShape.map(v => {
|
|
21
|
+
if (v.primitiveType) {
|
|
22
|
+
return v.schema;
|
|
23
|
+
}
|
|
24
|
+
return convertShapeToSchema(v, {}, true);
|
|
25
|
+
}));
|
|
26
|
+
} else {
|
|
27
|
+
if (currentShape.primitiveType) {
|
|
28
|
+
result[key] = currentShape.schema;
|
|
29
|
+
} else {
|
|
30
|
+
result[key] = convertShapeToSchema(currentShape, {}, true);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return internal ? ObjectType().shape(result) : result;
|
|
35
|
+
}
|
|
36
|
+
return convertShapeToSchema(shape, {});
|
|
37
|
+
}
|
|
File without changes
|
package/esm/FormControl/utils.js
CHANGED
|
File without changes
|
package/esm/Grid/Row.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BoxProps } from '../internals/Box';
|
|
2
2
|
import type { ResponsiveValue } from '../internals/types';
|
|
3
|
-
import type { RowAlignment, RowJustify } from './types';
|
|
3
|
+
import type { RowAlignment, RowJustify, GutterType } from './types';
|
|
4
4
|
export interface RowProps extends BoxProps {
|
|
5
5
|
/** Spacing between columns. Support responsive values */
|
|
6
|
-
gutter?:
|
|
6
|
+
gutter?: GutterType | ResponsiveValue<GutterType>;
|
|
7
7
|
/** Vertical alignment of columns. Support responsive values */
|
|
8
8
|
align?: RowAlignment | ResponsiveValue<RowAlignment>;
|
|
9
9
|
/** Horizontal distribution of columns. Support responsive values */
|