rsuite 6.0.0-canary-20250507 → 6.0.0-canary-2025062016
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/Accordion/styles/index.css +645 -325
- package/Animation/styles/index.css +153 -141
- package/AutoComplete/styles/index.css +2408 -2061
- package/Avatar/styles/index.css +227 -76
- package/AvatarGroup/styles/index.css +280 -107
- package/Badge/styles/index.css +335 -174
- package/Box/styles/index.css +132 -94
- package/Breadcrumb/styles/index.css +225 -71
- package/Button/styles/index.css +1199 -1016
- package/ButtonGroup/styles/index.css +221 -54
- package/ButtonToolbar/styles/index.css +274 -98
- package/CHANGELOG.md +66 -0
- package/Calendar/styles/index.css +1866 -1737
- package/Card/styles/index.css +242 -92
- package/CardGroup/styles/index.css +185 -6
- package/Carousel/styles/index.css +369 -213
- package/CascadeTree/styles/index.css +376 -237
- package/Cascader/styles/index.css +2494 -2146
- package/Center/styles/index.css +185 -6
- package/CheckPicker/styles/index.css +2555 -2193
- package/CheckTree/styles/index.css +2640 -2276
- package/CheckTreePicker/styles/index.css +2652 -2286
- package/Checkbox/styles/index.css +409 -251
- package/CheckboxGroup/styles/index.css +189 -25
- package/Container/styles/index.css +186 -20
- package/Content/styles/index.css +181 -15
- package/DateInput/styles/index.css +317 -164
- package/DatePicker/styles/index.css +3108 -2800
- package/DateRangeInput/styles/index.css +317 -164
- package/DateRangePicker/styles/index.css +3200 -2884
- package/Divider/styles/index.css +251 -96
- package/Drawer/styles/index.css +461 -312
- package/Dropdown/styles/index.css +1497 -1329
- package/FlexboxGrid/styles/index.css +498 -284
- package/Footer/styles/index.css +181 -23
- package/Form/styles/index.css +178 -12
- package/FormControl/styles/index.css +210 -44
- package/FormControlLabel/styles/index.css +190 -31
- package/FormErrorMessage/styles/index.css +332 -208
- package/FormGroup/styles/index.css +216 -48
- package/FormHelpText/styles/index.css +203 -44
- package/FormStack/styles/index.css +191 -26
- package/Grid/styles/index.css +2042 -1743
- package/Header/styles/index.css +181 -23
- package/Heading/styles/index.css +238 -73
- package/HeadingGroup/styles/index.css +181 -2
- package/Highlight/styles/index.css +190 -5
- package/IconButton/styles/index.css +1343 -1163
- package/Image/styles/index.css +216 -22
- package/InlineEdit/styles/index.css +378 -84
- package/Input/styles/index.css +317 -164
- package/InputGroup/styles/index.css +446 -1219
- package/InputNumber/styles/index.css +1565 -1366
- package/InputPicker/styles/index.css +2497 -2156
- package/Kbd/styles/index.css +258 -107
- package/Link/styles/index.css +203 -23
- package/List/styles/index.css +311 -158
- package/Loader/styles/index.css +354 -206
- package/Menu/styles/index.css +325 -186
- package/Message/styles/index.css +494 -408
- package/Modal/styles/index.css +394 -224
- package/MultiCascadeTree/styles/index.css +2694 -2331
- package/MultiCascader/styles/index.css +2710 -2346
- package/Nav/styles/index.css +1801 -1636
- package/Navbar/styles/index.css +1751 -1564
- package/Notification/styles/index.css +369 -221
- package/NumberInput/styles/index.css +1565 -1366
- package/Pagination/styles/index.css +2625 -2390
- package/Panel/styles/index.css +624 -305
- package/PanelGroup/styles/index.css +212 -55
- package/PasswordInput/styles/index.css +559 -164
- package/PasswordStrengthMeter/styles/index.css +224 -32
- package/PinInput/styles/index.css +381 -207
- package/Placeholder/styles/index.css +364 -200
- package/Popover/styles/index.css +468 -298
- package/Progress/styles/index.css +517 -236
- package/ProgressCircle/package.json +3 -3
- package/ProgressCircle/styles/index.css +248 -0
- package/README.md +1 -1
- package/Radio/styles/index.css +406 -242
- package/RadioGroup/styles/index.css +277 -124
- package/RadioTile/styles/index.css +286 -133
- package/RadioTileGroup/styles/index.css +0 -0
- package/RangeSlider/styles/index.css +599 -458
- package/Rate/styles/index.css +318 -179
- package/SegmentedControl/package.json +7 -0
- package/SegmentedControl/styles/index.css +157 -0
- package/SelectPicker/styles/index.css +2430 -2088
- package/Sidebar/styles/index.css +188 -28
- package/Sidenav/styles/index.css +764 -591
- package/Slider/styles/index.css +599 -458
- package/Stack/styles/index.css +268 -93
- package/Stat/styles/index.css +1620 -1454
- package/StatGroup/styles/index.css +185 -6
- package/Steps/styles/index.css +384 -234
- package/Table/styles/index.css +626 -497
- package/Tabs/styles/index.css +1815 -1649
- package/Tag/styles/index.css +1487 -139
- package/TagGroup/styles/index.css +185 -19
- package/TagInput/styles/index.css +2831 -2469
- package/TagPicker/styles/index.css +2827 -2466
- package/Text/styles/index.css +398 -224
- package/Textarea/styles/index.css +184 -5
- package/TimePicker/styles/index.css +3108 -2800
- package/TimeRangePicker/styles/index.css +3200 -2884
- package/Timeline/styles/index.css +305 -148
- package/Toggle/styles/index.css +606 -429
- package/Tooltip/styles/index.css +347 -214
- package/Tree/styles/index.css +2538 -2197
- package/TreePicker/styles/index.css +2548 -2206
- package/Uploader/styles/index.css +1680 -1612
- package/VisuallyHidden/styles/index.css +11 -11
- package/cjs/Affix/Affix.js +1 -2
- package/cjs/Animation/Bounce.js +4 -5
- package/cjs/Animation/Collapse.js +1 -2
- package/cjs/Animation/Fade.js +5 -6
- package/cjs/Animation/Slide.js +5 -6
- package/cjs/AutoComplete/AutoComplete.js +1 -2
- package/cjs/Avatar/Avatar.js +1 -2
- package/cjs/AvatarGroup/AvatarGroup.js +1 -2
- package/cjs/Badge/Badge.js +1 -2
- package/cjs/Breadcrumb/Breadcrumb.js +1 -2
- package/cjs/Button/Button.js +1 -2
- package/cjs/ButtonGroup/ButtonGroup.js +1 -2
- package/cjs/Calendar/CalendarContainer.js +1 -2
- package/cjs/Calendar/CalendarHeader.js +1 -2
- package/cjs/Calendar/Grid/GridRow.js +1 -2
- package/cjs/Calendar/MonthDropdown/MonthDropdown.js +17 -22
- package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -2
- package/cjs/Calendar/TimeDropdown/TimeDropdown.js +1 -2
- package/cjs/Calendar/TimeDropdown/utils/scrollToTime.js +1 -2
- package/cjs/Calendar/hooks/useCalendarDate.js +3 -6
- package/cjs/Carousel/Carousel.js +1 -2
- package/cjs/CascadeTree/CascadeTree.js +1 -2
- package/cjs/CascadeTree/TreeView.js +1 -2
- package/cjs/CascadeTree/hooks/usePaths.js +7 -8
- package/cjs/Cascader/Cascader.js +1 -2
- package/cjs/CheckPicker/CheckPicker.js +1 -2
- package/cjs/CheckTree/CheckTree.js +1 -2
- package/cjs/CheckTree/CheckTreeNode.js +1 -2
- package/cjs/CheckTree/CheckTreeView.js +17 -22
- package/cjs/CheckTree/hooks/useTreeNodeProps.js +1 -2
- package/cjs/CheckTree/hooks/useTreeValue.js +4 -5
- package/cjs/CheckTreePicker/CheckTreePicker.d.ts +4 -0
- package/cjs/CheckTreePicker/CheckTreePicker.js +29 -2
- package/cjs/Checkbox/Checkbox.js +1 -2
- package/cjs/CheckboxGroup/CheckboxGroup.js +1 -2
- package/cjs/Container/Container.js +1 -2
- package/cjs/CustomProvider/CustomProvider.js +14 -4
- package/cjs/DOMHelper/index.js +1 -2
- package/cjs/DateInput/DateInput.js +5 -2
- package/cjs/DateInput/hooks/useDateInputState.js +6 -7
- package/cjs/DateInput/hooks/useIsFocused.js +4 -5
- package/cjs/DateInput/hooks/useKeyboardInputEvent.js +7 -8
- package/cjs/DateInput/test/types/TestKeyPressProps.d.ts +6 -0
- package/cjs/DateInput/test/types/TestKeyPressProps.js +4 -0
- package/cjs/DatePicker/DatePicker.js +3 -10
- package/cjs/DatePicker/PredefinedRanges.js +1 -2
- package/cjs/DatePicker/Toolbar.js +6 -7
- package/cjs/DatePicker/utils.js +14 -24
- package/cjs/DateRangeInput/DateRangeInput.js +6 -6
- package/cjs/DateRangePicker/Calendar.d.ts +2 -1
- package/cjs/DateRangePicker/Calendar.js +8 -3
- package/cjs/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/cjs/DateRangePicker/DateRangePicker.js +9 -20
- package/cjs/DateRangePicker/DateRangePickerProvider.js +1 -2
- package/cjs/DateRangePicker/disabledDateUtils.js +5 -18
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +7 -8
- package/cjs/DateRangePicker/utils.js +5 -6
- package/cjs/Dropdown/Dropdown.js +9 -12
- package/cjs/Dropdown/DropdownItem.js +6 -8
- package/cjs/Dropdown/DropdownMenu.js +36 -43
- package/cjs/Dropdown/DropdownState.js +1 -4
- package/cjs/Form/Form.js +1 -2
- package/cjs/Form/FormContext.js +1 -2
- package/cjs/Form/hooks/useFormValidate.js +3 -8
- package/cjs/Form/hooks/useSchemaModel.js +6 -9
- package/cjs/FormControl/FormControl.d.ts +2 -2
- package/cjs/FormControl/FormControl.js +1 -1
- package/cjs/FormErrorMessage/FormErrorMessage.d.ts +2 -2
- package/cjs/FormGroup/FormGroup.d.ts +0 -18
- package/cjs/FormGroup/FormGroup.js +4 -33
- package/cjs/FormGroup/FormGroupContext.d.ts +4 -0
- package/cjs/FormGroup/FormGroupContext.js +8 -0
- package/cjs/FormGroup/index.d.ts +1 -1
- package/cjs/FormGroup/index.js +4 -4
- package/cjs/FormGroup/useFormGroup.d.ts +18 -0
- package/cjs/FormGroup/useFormGroup.js +35 -0
- package/cjs/Grid/Col.js +1 -2
- package/cjs/Grid/utils/styles.d.ts +1 -1
- package/cjs/Grid/utils/styles.js +1 -4
- package/cjs/InlineEdit/useEditState.js +1 -1
- package/cjs/InlineEdit/useFocusEvent.js +6 -7
- package/cjs/Input/Input.js +2 -3
- package/cjs/InputGroup/InputGroup.d.ts +0 -5
- package/cjs/InputGroup/InputGroup.js +4 -5
- package/cjs/InputGroup/InputGroupContext.d.ts +6 -0
- package/cjs/InputGroup/InputGroupContext.js +8 -0
- package/cjs/InputGroup/index.d.ts +1 -0
- package/cjs/InputGroup/index.js +3 -1
- package/cjs/InputPicker/InputAutosize.js +1 -2
- package/cjs/InputPicker/InputPicker.js +1 -2
- package/cjs/List/List.js +1 -2
- package/cjs/List/ListItem.js +1 -2
- package/cjs/List/helper/AutoScroller.js +7 -8
- package/cjs/List/helper/useSortHelper.js +1 -1
- package/cjs/List/helper/utils.js +4 -7
- package/cjs/MaskedInput/TextMask.js +1 -2
- package/cjs/MaskedInput/adjustCaretPosition.js +11 -12
- package/cjs/MaskedInput/conformToMask.js +1 -10
- package/cjs/MaskedInput/createTextMaskInputElement.js +9 -10
- package/cjs/MaskedInput/utilities.js +1 -7
- package/cjs/Menu/Menu.js +1 -2
- package/cjs/Menu/MenuItem.js +6 -8
- package/cjs/Message/Message.js +1 -2
- package/cjs/Modal/Modal.js +1 -2
- package/cjs/Modal/ModalBody.js +1 -2
- package/cjs/Modal/ModalHeader.js +1 -2
- package/cjs/Modal/ModalTitle.js +1 -2
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.js +1 -4
- package/cjs/MultiCascadeTree/utils.js +1 -4
- package/cjs/MultiCascader/MultiCascader.js +1 -2
- package/cjs/Nav/AdaptiveNavItem.js +3 -4
- package/cjs/Nav/Nav.js +3 -4
- package/cjs/Nav/NavDropdown.js +9 -12
- package/cjs/Nav/NavDropdownItem.js +6 -8
- package/cjs/Nav/NavDropdownMenu.js +36 -43
- package/cjs/Nav/NavItem.js +1 -2
- package/cjs/Nav/NavMegaMenu.js +1 -2
- package/cjs/Nav/NavMenu.js +3 -4
- package/cjs/Navbar/Navbar.js +1 -2
- package/cjs/Navbar/NavbarDrawer.js +1 -2
- package/cjs/Navbar/NavbarDropdown.js +8 -11
- package/cjs/Navbar/NavbarDropdownItem.js +1 -2
- package/cjs/Navbar/NavbarDropdownMenu.js +12 -16
- package/cjs/Navbar/NavbarItem.js +1 -2
- package/cjs/Navbar/NavbarMegaMenu.js +1 -2
- package/cjs/Navbar/NavbarToggle.js +1 -2
- package/cjs/Notification/Notification.js +1 -2
- package/cjs/NumberInput/utils/number.js +1 -4
- package/cjs/Pagination/LimitPicker.js +1 -2
- package/cjs/Pagination/PaginationButton.js +1 -2
- package/cjs/Panel/Panel.js +1 -2
- package/cjs/Panel/PanelHeader.js +1 -2
- package/cjs/PanelGroup/PanelGroup.js +1 -2
- package/cjs/PanelGroup/index.js +1 -2
- package/cjs/Placeholder/PlaceholderGrid.js +1 -2
- package/cjs/Placeholder/PlaceholderParagraph.js +1 -2
- package/cjs/Popover/Popover.js +1 -2
- package/cjs/Progress/Progress.d.ts +1 -1
- package/cjs/Progress/Progress.js +1 -1
- package/cjs/Progress/ProgressInfo.d.ts +17 -0
- package/cjs/Progress/ProgressInfo.js +29 -0
- package/cjs/Progress/ProgressLine.d.ts +20 -6
- package/cjs/Progress/ProgressLine.js +48 -37
- package/cjs/Progress/ProgressSections.d.ts +15 -0
- package/cjs/Progress/ProgressSections.js +43 -0
- package/cjs/Progress/ProgressStroke.d.ts +24 -0
- package/cjs/Progress/ProgressStroke.js +51 -0
- package/cjs/Progress/index.d.ts +3 -3
- package/cjs/Progress/index.js +1 -1
- package/cjs/Progress/types.d.ts +11 -0
- package/cjs/Progress/types.js +4 -0
- package/cjs/{Progress → ProgressCircle}/ProgressCircle.d.ts +20 -14
- package/cjs/ProgressCircle/ProgressCircle.js +113 -0
- package/cjs/ProgressCircle/ProgressCircleSections.d.ts +23 -0
- package/cjs/ProgressCircle/ProgressCircleSections.js +52 -0
- package/cjs/ProgressCircle/hooks/useProgressCirclePath.d.ts +28 -0
- package/cjs/ProgressCircle/hooks/useProgressCirclePath.js +66 -0
- package/cjs/ProgressCircle/index.d.ts +4 -0
- package/cjs/ProgressCircle/index.js +11 -0
- package/cjs/Radio/Radio.js +1 -2
- package/cjs/RadioGroup/RadioGroup.d.ts +4 -1
- package/cjs/RadioGroup/RadioGroup.js +1 -2
- package/cjs/RadioTile/RadioTile.js +1 -2
- package/cjs/RadioTileGroup/RadioTileGroup.js +1 -2
- package/cjs/RangeSlider/RangeSlider.js +1 -3
- package/cjs/Rate/Character.js +1 -2
- package/cjs/Rate/useRatingStates.js +6 -7
- package/cjs/SegmentedControl/Indicator.d.ts +10 -0
- package/cjs/SegmentedControl/Indicator.js +22 -0
- package/cjs/SegmentedControl/SegmentedControl.d.ts +27 -0
- package/cjs/SegmentedControl/SegmentedControl.js +87 -0
- package/cjs/SegmentedControl/SegmentedItem.d.ts +16 -0
- package/cjs/SegmentedControl/SegmentedItem.js +44 -0
- package/cjs/SegmentedControl/hooks/useIndicatorPosition.d.ts +17 -0
- package/cjs/SegmentedControl/hooks/useIndicatorPosition.js +55 -0
- package/cjs/SegmentedControl/index.d.ts +4 -0
- package/cjs/SegmentedControl/index.js +11 -0
- package/cjs/SelectPicker/SelectPicker.js +1 -2
- package/cjs/Sidebar/Sidebar.js +1 -2
- package/cjs/Sidenav/ExpandedSidenavDropdown.js +12 -17
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +3 -4
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +9 -12
- package/cjs/Sidenav/Sidenav.d.ts +0 -15
- package/cjs/Sidenav/Sidenav.js +4 -5
- package/cjs/Sidenav/SidenavContext.d.ts +16 -0
- package/cjs/Sidenav/SidenavContext.js +8 -0
- package/cjs/Sidenav/SidenavDropdown.js +15 -19
- package/cjs/Sidenav/SidenavDropdownItem.js +8 -10
- package/cjs/Sidenav/SidenavDropdownMenu.js +38 -45
- package/cjs/Sidenav/SidenavItem.js +8 -10
- package/cjs/Sidenav/SidenavToggle.js +3 -4
- package/cjs/Slider/ProgressBar.d.ts +0 -1
- package/cjs/Slider/ProgressBar.js +1 -3
- package/cjs/Slider/Slider.js +14 -6
- package/cjs/Stack/Stack.js +4 -2
- package/cjs/Stack/VStack.js +1 -3
- package/cjs/Tag/Tag.js +1 -2
- package/cjs/TagInput/TagInput.js +1 -2
- package/cjs/TagPicker/TagPicker.js +1 -2
- package/cjs/TimePicker/TimePicker.js +1 -2
- package/cjs/Toggle/Toggle.js +1 -2
- package/cjs/Tooltip/Tooltip.js +1 -2
- package/cjs/Tree/Tree.js +1 -2
- package/cjs/Tree/TreeNode.js +1 -2
- package/cjs/Tree/TreeView.js +17 -22
- package/cjs/Tree/hooks/useFlattenTree.js +2 -8
- package/cjs/Tree/hooks/useTreeNodeProps.js +1 -2
- package/cjs/Tree/hooks/useVirtualizedTreeData.js +1 -7
- package/cjs/Tree/utils/flattenTree.js +2 -8
- package/cjs/Tree/utils/getExpandItemValues.js +6 -7
- package/cjs/Tree/utils/indentTreeNode.js +1 -4
- package/cjs/TreePicker/TreePicker.js +1 -2
- package/cjs/Uploader/UploadFileItem.js +2 -6
- package/cjs/Uploader/UploadTrigger.js +1 -2
- package/cjs/Uploader/Uploader.js +2 -6
- package/cjs/global.d.ts +0 -6
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +18 -0
- package/cjs/internals/Disclosure/Disclosure.js +1 -2
- package/cjs/internals/InputBase/InputBase.js +2 -3
- package/cjs/internals/Menu/Menu.js +13 -18
- package/cjs/internals/Menu/MenuItem.js +1 -2
- package/cjs/internals/Menu/Menubar.js +6 -8
- package/cjs/internals/Menu/useRenderMenuItem.js +1 -2
- package/cjs/internals/Overlay/Modal.js +1 -2
- package/cjs/internals/Overlay/Overlay.js +1 -2
- package/cjs/internals/Overlay/OverlayProvider.js +1 -2
- package/cjs/internals/Overlay/OverlayTrigger.js +3 -11
- package/cjs/internals/Overlay/Position.js +4 -8
- package/cjs/internals/Overlay/types.d.ts +1 -1
- package/cjs/internals/Overlay/utils/position.d.ts +24 -0
- package/cjs/internals/Overlay/{positionUtils.js → utils/position.js} +136 -50
- package/cjs/internals/Picker/Listbox.js +18 -23
- package/cjs/internals/Picker/PickerIndicator.js +9 -10
- package/cjs/internals/Picker/PickerLabel.js +6 -7
- package/cjs/internals/Picker/PickerPopup.js +1 -2
- package/cjs/internals/Picker/PickerToggle.js +1 -2
- package/cjs/internals/Picker/PickerToggleTrigger.js +1 -2
- package/cjs/internals/Picker/utils.js +1 -4
- package/cjs/internals/Provider/CustomContext.d.ts +20 -1
- package/cjs/internals/Provider/types.d.ts +8 -3
- package/cjs/internals/Ripple/Ripple.js +1 -2
- package/cjs/internals/SafeAnchor/SafeAnchor.js +1 -2
- package/cjs/internals/Tree/TreeProvider.js +4 -5
- package/cjs/internals/Tree/utils/filterNodesOfTree.js +1 -4
- package/cjs/internals/Tree/utils/findNodeOfTree.js +1 -4
- package/cjs/internals/Windowing/AutoSizer.js +1 -2
- package/cjs/internals/Windowing/List.js +1 -2
- package/cjs/internals/Windowing/index.js +1 -2
- package/cjs/internals/hooks/useClickOutside.js +5 -6
- package/cjs/internals/hooks/useElementResize.d.ts +2 -1
- package/cjs/internals/hooks/useElementResize.js +50 -7
- package/cjs/internals/hooks/useEventCallback.js +1 -4
- package/cjs/internals/hooks/useEventListener.js +1 -4
- package/cjs/internals/hooks/usePortal.js +9 -15
- package/cjs/internals/hooks/useRootClose.js +6 -7
- package/cjs/internals/hooks/useStyles.js +5 -8
- package/cjs/internals/hooks/useTimeout.js +1 -7
- package/cjs/internals/hooks/useToggleCaret.d.ts +1 -1
- package/cjs/internals/intl/FormattedDate.js +4 -5
- package/cjs/internals/intl/FormattedNumber.js +5 -7
- package/cjs/internals/types/placement.d.ts +5 -0
- package/cjs/internals/utils/colours.js +1 -4
- package/cjs/internals/utils/composeFunctions.js +1 -4
- package/cjs/internals/utils/createChainedFunction.js +2 -8
- package/cjs/internals/utils/date/copyTime.js +4 -5
- package/cjs/internals/utils/getDataGroupBy.js +5 -8
- package/cjs/internals/utils/html/htmlPropsUtils.js +1 -4
- package/cjs/internals/utils/placement.js +1 -4
- package/cjs/internals/utils/react/createComponent.js +6 -7
- package/cjs/internals/utils/string/tplTransform.js +1 -4
- package/cjs/internals/utils/style-sheet/css.d.ts +1 -1
- package/cjs/internals/utils/style-sheet/css.js +4 -13
- package/cjs/internals/utils/style-sheet/styles.js +2 -8
- package/cjs/locales/ar_EG.d.ts +6 -0
- package/cjs/locales/ar_EG.js +6 -0
- package/cjs/locales/ca_ES.d.ts +6 -0
- package/cjs/locales/ca_ES.js +6 -0
- package/cjs/locales/cs_CZ.d.ts +6 -0
- package/cjs/locales/cs_CZ.js +6 -0
- package/cjs/locales/da_DK.d.ts +6 -0
- package/cjs/locales/da_DK.js +6 -0
- package/cjs/locales/de_DE.d.ts +6 -0
- package/cjs/locales/de_DE.js +6 -0
- package/cjs/locales/en_GB.d.ts +6 -0
- package/cjs/locales/en_GB.js +6 -0
- package/cjs/locales/en_US.d.ts +6 -0
- package/cjs/locales/en_US.js +6 -0
- package/cjs/locales/es_AR.d.ts +6 -0
- package/cjs/locales/es_AR.js +6 -0
- package/cjs/locales/es_ES.d.ts +6 -0
- package/cjs/locales/es_ES.js +7 -1
- package/cjs/locales/fa_IR.d.ts +6 -0
- package/cjs/locales/fa_IR.js +6 -0
- package/cjs/locales/fi_FI.d.ts +6 -0
- package/cjs/locales/fi_FI.js +6 -0
- package/cjs/locales/fr_FR.d.ts +6 -0
- package/cjs/locales/fr_FR.js +6 -0
- package/cjs/locales/gu_IN.d.ts +157 -0
- package/cjs/locales/gu_IN.js +97 -0
- package/cjs/locales/hu_HU.d.ts +6 -0
- package/cjs/locales/hu_HU.js +6 -0
- package/cjs/locales/index.d.ts +3 -0
- package/cjs/locales/index.js +8 -2
- package/cjs/locales/it_IT.d.ts +6 -0
- package/cjs/locales/it_IT.js +6 -0
- package/cjs/locales/ja_JP.d.ts +6 -0
- package/cjs/locales/ja_JP.js +6 -0
- package/cjs/locales/kk_KZ.d.ts +6 -0
- package/cjs/locales/kk_KZ.js +6 -0
- package/cjs/locales/ko_KR.d.ts +6 -0
- package/cjs/locales/ko_KR.js +6 -0
- package/cjs/locales/ne_NP.d.ts +6 -0
- package/cjs/locales/ne_NP.js +6 -0
- package/cjs/locales/nl_NL.d.ts +6 -0
- package/cjs/locales/nl_NL.js +8 -2
- package/cjs/locales/pl_PL.d.ts +6 -0
- package/cjs/locales/pl_PL.js +6 -0
- package/cjs/locales/pt_BR.d.ts +6 -0
- package/cjs/locales/pt_BR.js +6 -0
- package/cjs/locales/ru_RU.d.ts +6 -0
- package/cjs/locales/ru_RU.js +6 -0
- package/cjs/locales/sv_SE.d.ts +6 -0
- package/cjs/locales/sv_SE.js +6 -0
- package/cjs/locales/th_TH.d.ts +169 -0
- package/cjs/locales/th_TH.js +100 -0
- package/cjs/locales/tr_TR.d.ts +6 -0
- package/cjs/locales/tr_TR.js +6 -0
- package/cjs/locales/uk_UA.d.ts +157 -0
- package/cjs/locales/uk_UA.js +97 -0
- package/cjs/locales/zh_CN.d.ts +6 -0
- package/cjs/locales/zh_CN.js +6 -0
- package/cjs/locales/zh_TW.d.ts +6 -0
- package/cjs/locales/zh_TW.js +6 -0
- package/cjs/toaster/ToastContainer.js +3 -4
- package/cjs/toaster/toaster.js +2 -6
- package/cjs/useDialog/Dialog.d.ts +15 -0
- package/cjs/useDialog/Dialog.js +109 -0
- package/cjs/useDialog/DialogContainer.d.ts +11 -0
- package/cjs/useDialog/DialogContainer.js +57 -0
- package/cjs/useDialog/index.d.ts +3 -0
- package/cjs/useDialog/index.js +15 -0
- package/cjs/useDialog/types.d.ts +33 -0
- package/cjs/useDialog/types.js +4 -0
- package/cjs/useDialog/useDialog.d.ts +15 -0
- package/cjs/useDialog/useDialog.js +126 -0
- package/cjs/useFormControl/useFormControl.js +1 -4
- package/cjs/useMediaQuery/breakpoints.js +4 -10
- package/cjs/useMediaQuery/useMediaQuery.js +1 -4
- package/cjs/useToaster/useToaster.d.ts +1 -1
- package/cjs/useToaster/useToaster.js +9 -9
- package/dist/rsuite-no-reset.css +14549 -13982
- package/dist/rsuite-no-reset.min.css +1 -2
- package/dist/rsuite.css +14778 -14187
- package/dist/rsuite.js +508 -229
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -2
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Animation/Bounce.js +4 -5
- package/esm/Animation/Fade.js +5 -6
- package/esm/Animation/Slide.js +5 -6
- package/esm/Calendar/MonthDropdown/MonthDropdown.js +16 -20
- package/esm/Calendar/TimeDropdown/utils/scrollToTime.js +1 -2
- package/esm/Calendar/hooks/useCalendarDate.js +3 -6
- package/esm/CascadeTree/hooks/usePaths.js +7 -8
- package/esm/CheckTree/CheckTreeView.js +16 -20
- package/esm/CheckTree/hooks/useTreeValue.js +4 -5
- package/esm/CheckTreePicker/CheckTreePicker.d.ts +4 -0
- package/esm/CheckTreePicker/CheckTreePicker.js +28 -0
- package/esm/CustomProvider/CustomProvider.js +13 -2
- package/esm/DateInput/DateInput.js +4 -0
- package/esm/DateInput/hooks/useDateInputState.js +6 -7
- package/esm/DateInput/hooks/useIsFocused.js +4 -5
- package/esm/DateInput/hooks/useKeyboardInputEvent.js +7 -8
- package/esm/DateInput/test/types/TestKeyPressProps.d.ts +6 -0
- package/esm/DateInput/test/types/TestKeyPressProps.js +2 -0
- package/esm/DatePicker/DatePicker.js +2 -8
- package/esm/DatePicker/Toolbar.js +6 -7
- package/esm/DatePicker/utils.js +14 -24
- package/esm/DateRangeInput/DateRangeInput.js +5 -4
- package/esm/DateRangePicker/Calendar.d.ts +2 -1
- package/esm/DateRangePicker/Calendar.js +7 -1
- package/esm/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/esm/DateRangePicker/DateRangePicker.js +8 -18
- package/esm/DateRangePicker/disabledDateUtils.js +4 -16
- package/esm/DateRangePicker/hooks/useCalendarHandlers.js +7 -8
- package/esm/DateRangePicker/utils.js +5 -6
- package/esm/Dropdown/Dropdown.js +8 -10
- package/esm/Dropdown/DropdownItem.js +5 -6
- package/esm/Dropdown/DropdownMenu.js +35 -41
- package/esm/Dropdown/DropdownState.js +1 -4
- package/esm/Form/hooks/useFormValidate.js +3 -8
- package/esm/Form/hooks/useSchemaModel.js +6 -9
- package/esm/FormControl/FormControl.d.ts +2 -2
- package/esm/FormControl/FormControl.js +1 -1
- package/esm/FormErrorMessage/FormErrorMessage.d.ts +2 -2
- package/esm/FormGroup/FormGroup.d.ts +0 -18
- package/esm/FormGroup/FormGroup.js +1 -28
- package/esm/FormGroup/FormGroupContext.d.ts +4 -0
- package/esm/FormGroup/FormGroupContext.js +3 -0
- package/esm/FormGroup/index.d.ts +1 -1
- package/esm/FormGroup/index.js +1 -1
- package/esm/FormGroup/useFormGroup.d.ts +18 -0
- package/esm/FormGroup/useFormGroup.js +30 -0
- package/esm/Grid/utils/styles.d.ts +1 -1
- package/esm/Grid/utils/styles.js +1 -4
- package/esm/InlineEdit/useEditState.js +1 -1
- package/esm/InlineEdit/useFocusEvent.js +6 -7
- package/esm/Input/Input.js +1 -1
- package/esm/InputGroup/InputGroup.d.ts +0 -5
- package/esm/InputGroup/InputGroup.js +1 -1
- package/esm/InputGroup/InputGroupContext.d.ts +6 -0
- package/esm/InputGroup/InputGroupContext.js +3 -0
- package/esm/InputGroup/index.d.ts +1 -0
- package/esm/InputGroup/index.js +1 -0
- package/esm/List/helper/AutoScroller.js +7 -8
- package/esm/List/helper/useSortHelper.js +1 -1
- package/esm/List/helper/utils.js +4 -7
- package/esm/MaskedInput/adjustCaretPosition.js +11 -12
- package/esm/MaskedInput/conformToMask.js +1 -10
- package/esm/MaskedInput/createTextMaskInputElement.js +9 -10
- package/esm/MaskedInput/utilities.js +1 -7
- package/esm/Menu/MenuItem.js +5 -6
- package/esm/MultiCascadeTree/hooks/useCascadeValue.js +1 -4
- package/esm/MultiCascadeTree/utils.js +1 -4
- package/esm/Nav/AdaptiveNavItem.js +1 -1
- package/esm/Nav/Nav.js +1 -1
- package/esm/Nav/NavDropdown.js +8 -10
- package/esm/Nav/NavDropdownItem.js +5 -6
- package/esm/Nav/NavDropdownMenu.js +35 -41
- package/esm/Nav/NavMenu.js +1 -1
- package/esm/Navbar/NavbarDropdown.js +7 -9
- package/esm/Navbar/NavbarDropdownMenu.js +11 -14
- package/esm/NumberInput/utils/number.js +1 -4
- package/esm/Progress/Progress.d.ts +1 -1
- package/esm/Progress/Progress.js +1 -1
- package/esm/Progress/ProgressInfo.d.ts +17 -0
- package/esm/Progress/ProgressInfo.js +24 -0
- package/esm/Progress/ProgressLine.d.ts +20 -6
- package/esm/Progress/ProgressLine.js +49 -38
- package/esm/Progress/ProgressSections.d.ts +15 -0
- package/esm/Progress/ProgressSections.js +38 -0
- package/esm/Progress/ProgressStroke.d.ts +24 -0
- package/esm/Progress/ProgressStroke.js +46 -0
- package/esm/Progress/index.d.ts +3 -3
- package/esm/Progress/index.js +1 -1
- package/esm/Progress/types.d.ts +11 -0
- package/esm/Progress/types.js +2 -0
- package/esm/{Progress → ProgressCircle}/ProgressCircle.d.ts +20 -14
- package/esm/ProgressCircle/ProgressCircle.js +107 -0
- package/esm/ProgressCircle/ProgressCircleSections.d.ts +23 -0
- package/esm/ProgressCircle/ProgressCircleSections.js +47 -0
- package/esm/ProgressCircle/hooks/useProgressCirclePath.d.ts +28 -0
- package/esm/ProgressCircle/hooks/useProgressCirclePath.js +62 -0
- package/esm/ProgressCircle/index.d.ts +4 -0
- package/esm/ProgressCircle/index.js +8 -0
- package/esm/RadioGroup/RadioGroup.d.ts +4 -1
- package/esm/RangeSlider/RangeSlider.js +0 -1
- package/esm/Rate/useRatingStates.js +6 -7
- package/esm/SegmentedControl/Indicator.d.ts +10 -0
- package/esm/SegmentedControl/Indicator.js +17 -0
- package/esm/SegmentedControl/SegmentedControl.d.ts +27 -0
- package/esm/SegmentedControl/SegmentedControl.js +81 -0
- package/esm/SegmentedControl/SegmentedItem.d.ts +16 -0
- package/esm/SegmentedControl/SegmentedItem.js +39 -0
- package/esm/SegmentedControl/hooks/useIndicatorPosition.d.ts +17 -0
- package/esm/SegmentedControl/hooks/useIndicatorPosition.js +50 -0
- package/esm/SegmentedControl/index.d.ts +4 -0
- package/esm/SegmentedControl/index.js +8 -0
- package/esm/Sidenav/ExpandedSidenavDropdown.js +10 -14
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +7 -9
- package/esm/Sidenav/Sidenav.d.ts +0 -15
- package/esm/Sidenav/Sidenav.js +1 -1
- package/esm/Sidenav/SidenavContext.d.ts +16 -0
- package/esm/Sidenav/SidenavContext.js +3 -0
- package/esm/Sidenav/SidenavDropdown.js +13 -16
- package/esm/Sidenav/SidenavDropdownItem.js +6 -7
- package/esm/Sidenav/SidenavDropdownMenu.js +36 -42
- package/esm/Sidenav/SidenavItem.js +6 -7
- package/esm/Sidenav/SidenavToggle.js +1 -1
- package/esm/Slider/ProgressBar.d.ts +0 -1
- package/esm/Slider/ProgressBar.js +1 -3
- package/esm/Slider/Slider.js +13 -4
- package/esm/Stack/Stack.js +4 -2
- package/esm/Stack/VStack.js +1 -3
- package/esm/Tree/TreeView.js +16 -20
- package/esm/Tree/hooks/useFlattenTree.js +2 -8
- package/esm/Tree/hooks/useVirtualizedTreeData.js +1 -7
- package/esm/Tree/utils/flattenTree.js +2 -8
- package/esm/Tree/utils/getExpandItemValues.js +6 -7
- package/esm/Tree/utils/indentTreeNode.js +1 -4
- package/esm/Uploader/UploadFileItem.js +1 -4
- package/esm/Uploader/Uploader.js +1 -4
- package/esm/global.d.ts +0 -6
- package/esm/index.d.ts +3 -0
- package/esm/index.js +3 -0
- package/esm/internals/InputBase/InputBase.js +1 -1
- package/esm/internals/Menu/Menu.js +12 -16
- package/esm/internals/Menu/Menubar.js +5 -6
- package/esm/internals/Overlay/OverlayTrigger.js +2 -9
- package/esm/internals/Overlay/Position.js +3 -6
- package/esm/internals/Overlay/types.d.ts +1 -1
- package/esm/internals/Overlay/utils/position.d.ts +24 -0
- package/esm/internals/Overlay/{positionUtils.js → utils/position.js} +134 -48
- package/esm/internals/Picker/Listbox.js +17 -21
- package/esm/internals/Picker/PickerIndicator.js +9 -10
- package/esm/internals/Picker/PickerLabel.js +6 -7
- package/esm/internals/Picker/utils.js +1 -4
- package/esm/internals/Provider/CustomContext.d.ts +20 -1
- package/esm/internals/Provider/types.d.ts +8 -3
- package/esm/internals/Tree/TreeProvider.js +4 -5
- package/esm/internals/Tree/utils/filterNodesOfTree.js +1 -4
- package/esm/internals/Tree/utils/findNodeOfTree.js +1 -4
- package/esm/internals/hooks/useClickOutside.js +5 -6
- package/esm/internals/hooks/useElementResize.d.ts +2 -1
- package/esm/internals/hooks/useElementResize.js +50 -7
- package/esm/internals/hooks/useEventCallback.js +1 -4
- package/esm/internals/hooks/useEventListener.js +1 -4
- package/esm/internals/hooks/usePortal.js +8 -13
- package/esm/internals/hooks/useRootClose.js +6 -7
- package/esm/internals/hooks/useStyles.js +5 -8
- package/esm/internals/hooks/useTimeout.js +1 -7
- package/esm/internals/hooks/useToggleCaret.d.ts +1 -1
- package/esm/internals/intl/FormattedDate.js +4 -5
- package/esm/internals/intl/FormattedNumber.js +4 -5
- package/esm/internals/types/placement.d.ts +5 -0
- package/esm/internals/utils/colours.js +1 -4
- package/esm/internals/utils/composeFunctions.js +1 -4
- package/esm/internals/utils/createChainedFunction.js +2 -8
- package/esm/internals/utils/date/copyTime.js +4 -5
- package/esm/internals/utils/getDataGroupBy.js +5 -8
- package/esm/internals/utils/html/htmlPropsUtils.js +1 -4
- package/esm/internals/utils/placement.js +1 -4
- package/esm/internals/utils/react/createComponent.js +6 -7
- package/esm/internals/utils/string/tplTransform.js +1 -4
- package/esm/internals/utils/style-sheet/css.d.ts +1 -1
- package/esm/internals/utils/style-sheet/css.js +4 -13
- package/esm/internals/utils/style-sheet/styles.js +2 -8
- package/esm/locales/ar_EG.d.ts +6 -0
- package/esm/locales/ar_EG.js +6 -0
- package/esm/locales/ca_ES.d.ts +6 -0
- package/esm/locales/ca_ES.js +6 -0
- package/esm/locales/cs_CZ.d.ts +6 -0
- package/esm/locales/cs_CZ.js +6 -0
- package/esm/locales/da_DK.d.ts +6 -0
- package/esm/locales/da_DK.js +6 -0
- package/esm/locales/de_DE.d.ts +6 -0
- package/esm/locales/de_DE.js +6 -0
- package/esm/locales/en_GB.d.ts +6 -0
- package/esm/locales/en_GB.js +6 -0
- package/esm/locales/en_US.d.ts +6 -0
- package/esm/locales/en_US.js +6 -0
- package/esm/locales/es_AR.d.ts +6 -0
- package/esm/locales/es_AR.js +6 -0
- package/esm/locales/es_ES.d.ts +6 -0
- package/esm/locales/es_ES.js +7 -1
- package/esm/locales/fa_IR.d.ts +6 -0
- package/esm/locales/fa_IR.js +6 -0
- package/esm/locales/fi_FI.d.ts +6 -0
- package/esm/locales/fi_FI.js +6 -0
- package/esm/locales/fr_FR.d.ts +6 -0
- package/esm/locales/fr_FR.js +6 -0
- package/esm/locales/gu_IN.d.ts +157 -0
- package/esm/locales/gu_IN.js +93 -0
- package/esm/locales/hu_HU.d.ts +6 -0
- package/esm/locales/hu_HU.js +6 -0
- package/esm/locales/index.d.ts +3 -0
- package/esm/locales/index.js +4 -1
- package/esm/locales/it_IT.d.ts +6 -0
- package/esm/locales/it_IT.js +6 -0
- package/esm/locales/ja_JP.d.ts +6 -0
- package/esm/locales/ja_JP.js +6 -0
- package/esm/locales/kk_KZ.d.ts +6 -0
- package/esm/locales/kk_KZ.js +6 -0
- package/esm/locales/ko_KR.d.ts +6 -0
- package/esm/locales/ko_KR.js +6 -0
- package/esm/locales/ne_NP.d.ts +6 -0
- package/esm/locales/ne_NP.js +6 -0
- package/esm/locales/nl_NL.d.ts +6 -0
- package/esm/locales/nl_NL.js +8 -2
- package/esm/locales/pl_PL.d.ts +6 -0
- package/esm/locales/pl_PL.js +6 -0
- package/esm/locales/pt_BR.d.ts +6 -0
- package/esm/locales/pt_BR.js +6 -0
- package/esm/locales/ru_RU.d.ts +6 -0
- package/esm/locales/ru_RU.js +6 -0
- package/esm/locales/sv_SE.d.ts +6 -0
- package/esm/locales/sv_SE.js +6 -0
- package/esm/locales/th_TH.d.ts +169 -0
- package/esm/locales/th_TH.js +96 -0
- package/esm/locales/tr_TR.d.ts +6 -0
- package/esm/locales/tr_TR.js +6 -0
- package/esm/locales/uk_UA.d.ts +157 -0
- package/esm/locales/uk_UA.js +93 -0
- package/esm/locales/zh_CN.d.ts +6 -0
- package/esm/locales/zh_CN.js +6 -0
- package/esm/locales/zh_TW.d.ts +6 -0
- package/esm/locales/zh_TW.js +6 -0
- package/esm/toaster/ToastContainer.js +2 -2
- package/esm/toaster/toaster.js +1 -4
- package/esm/useDialog/Dialog.d.ts +15 -0
- package/esm/useDialog/Dialog.js +103 -0
- package/esm/useDialog/DialogContainer.d.ts +11 -0
- package/esm/useDialog/DialogContainer.js +52 -0
- package/esm/useDialog/index.d.ts +3 -0
- package/esm/useDialog/index.js +4 -0
- package/esm/useDialog/types.d.ts +33 -0
- package/esm/useDialog/types.js +2 -0
- package/esm/useDialog/useDialog.d.ts +15 -0
- package/esm/useDialog/useDialog.js +120 -0
- package/esm/useFormControl/useFormControl.js +1 -4
- package/esm/useMediaQuery/breakpoints.js +4 -10
- package/esm/useMediaQuery/useMediaQuery.js +1 -4
- package/esm/useToaster/useToaster.d.ts +1 -1
- package/esm/useToaster/useToaster.js +11 -10
- package/locales/gu_IN/package.json +7 -0
- package/locales/th_TH/package.json +7 -0
- package/locales/uk_UA/package.json +7 -0
- package/package.json +5 -6
- package/toaster/styles/index.css +107 -121
- package/useDialog/package.json +7 -0
- package/useToaster/styles/index.css +107 -121
- package/Accordion/styles/index.less +0 -2
- package/Animation/styles/animation.less +0 -95
- package/Animation/styles/bounce.less +0 -34
- package/Animation/styles/collapse.less +0 -23
- package/Animation/styles/fade.less +0 -10
- package/Animation/styles/index.less +0 -8
- package/Animation/styles/mixin.less +0 -15
- package/Animation/styles/slide.less +0 -24
- package/Animation/styles/variables.less +0 -4
- package/AutoComplete/styles/index.less +0 -37
- package/Avatar/styles/index.less +0 -48
- package/AvatarGroup/styles/index.less +0 -25
- package/Badge/styles/index.less +0 -101
- package/Badge/styles/variables.less +0 -19
- package/Box/styles/index.less +0 -1
- package/Breadcrumb/styles/index.less +0 -49
- package/Button/styles/index.less +0 -364
- package/Button/styles/mixin.less +0 -62
- package/Button/styles/variables.less +0 -30
- package/ButtonGroup/styles/index.less +0 -91
- package/ButtonToolbar/styles/index.less +0 -17
- package/Calendar/styles/index.less +0 -678
- package/Card/styles/index.less +0 -63
- package/CardGroup/styles/index.less +0 -8
- package/Carousel/styles/index.less +0 -192
- package/CascadeTree/styles/index.less +0 -88
- package/CascadeTree/styles/search.less +0 -35
- package/Cascader/styles/index.less +0 -5
- package/Center/styles/index.less +0 -9
- package/CheckPicker/styles/index.less +0 -21
- package/CheckTree/styles/index.less +0 -120
- package/CheckTreePicker/styles/index.less +0 -17
- package/Checkbox/styles/index.less +0 -153
- package/Checkbox/styles/mixin.less +0 -37
- package/CheckboxGroup/styles/index.less +0 -14
- package/Col/styles/index.less +0 -2
- package/Container/stories/styles.less +0 -23
- package/Container/styles/index.less +0 -16
- package/Content/styles/index.less +0 -6
- package/DateInput/styles/index.less +0 -1
- package/DatePicker/styles/index.less +0 -167
- package/DatePicker/styles/mixin.less +0 -8
- package/DateRangeInput/styles/index.less +0 -1
- package/DateRangePicker/styles/index.less +0 -145
- package/Divider/styles/index.less +0 -85
- package/Drawer/styles/index.less +0 -255
- package/Drawer/styles/mixin.less +0 -23
- package/Dropdown/styles/index.less +0 -341
- package/Dropdown/styles/mixin.less +0 -4
- package/FlexboxGrid/styles/index.less +0 -79
- package/Footer/styles/index.less +0 -5
- package/Form/styles/index.less +0 -1
- package/FormControl/styles/index.less +0 -79
- package/FormControlLabel/styles/index.less +0 -7
- package/FormErrorMessage/styles/animation.less +0 -43
- package/FormErrorMessage/styles/index.less +0 -179
- package/FormGroup/styles/index.less +0 -75
- package/FormHelpText/styles/index.less +0 -21
- package/FormStack/styles/index.less +0 -15
- package/Grid/styles/columns.less +0 -21
- package/Grid/styles/grid-framework.less +0 -92
- package/Grid/styles/index.less +0 -107
- package/Grid/styles/mixin.less +0 -12
- package/Grid/styles/row.less +0 -42
- package/Grid/styles/variables.less +0 -5
- package/Header/styles/index.less +0 -5
- package/Heading/styles/index.less +0 -42
- package/Heading/styles/variables.less +0 -19
- package/HeadingGroup/styles/index.less +0 -3
- package/Highlight/styles/index.less +0 -6
- package/IconButton/styles/index.less +0 -90
- package/Image/styles/index.less +0 -34
- package/InlineEdit/styles/index.less +0 -50
- package/Input/styles/index.less +0 -23
- package/Input/styles/mixin.less +0 -38
- package/Input/styles/variables.less +0 -22
- package/InputGroup/styles/index.less +0 -237
- package/InputNumber/styles/index.less +0 -1
- package/InputPicker/styles/index.less +0 -64
- package/InputPicker/styles/mixin.less +0 -7
- package/Kbd/styles/index.less +0 -20
- package/Kbd/styles/mixin.less +0 -24
- package/Kbd/styles/variables.less +0 -13
- package/Link/styles/index.less +0 -39
- package/List/styles/index.less +0 -113
- package/Loader/styles/index.less +0 -114
- package/Loader/styles/mixin.less +0 -33
- package/Loader/styles/variables.less +0 -16
- package/Menu/styles/index.less +0 -108
- package/Message/styles/index.less +0 -188
- package/Modal/styles/animation.less +0 -15
- package/Modal/styles/index.less +0 -189
- package/MultiCascadeTree/styles/index.less +0 -46
- package/MultiCascader/styles/index.less +0 -15
- package/Nav/styles/index.less +0 -366
- package/Navbar/styles/index.less +0 -236
- package/Notification/styles/index.less +0 -114
- package/NumberInput/styles/index.less +0 -74
- package/NumberInput/styles/mixin.less +0 -11
- package/Pagination/styles/index.less +0 -101
- package/Pagination/styles/mixin.less +0 -14
- package/Pagination/styles/pagination-group.less +0 -31
- package/Panel/styles/index.less +0 -121
- package/PanelGroup/styles/index.less +0 -34
- package/PasswordInput/styles/index.less +0 -1
- package/PasswordStrengthMeter/styles/index.less +0 -39
- package/PinInput/styles/index.less +0 -66
- package/Placeholder/styles/index.less +0 -148
- package/Placeholder/styles/mixin.less +0 -7
- package/Popover/styles/index.less +0 -202
- package/Popover/styles/mixins.less +0 -60
- package/Progress/styles/animation.less +0 -34
- package/Progress/styles/index.less +0 -187
- package/ProgressLine/package.json +0 -7
- package/Radio/styles/index.less +0 -144
- package/Radio/styles/mixin.less +0 -5
- package/RadioGroup/styles/index.less +0 -87
- package/RadioTile/styles/index.less +0 -79
- package/RadioTileGroup/styles/index.less +0 -1
- package/RangeSlider/styles/index.less +0 -4
- package/Rate/styles/index.less +0 -139
- package/Row/styles/index.less +0 -2
- package/SelectPicker/styles/index.less +0 -47
- package/Sidebar/styles/index.less +0 -15
- package/Sidenav/styles/index.less +0 -655
- package/Sidenav/styles/mixin.less +0 -23
- package/Slider/styles/index.less +0 -296
- package/Stack/styles/index.less +0 -83
- package/Stat/styles/index.less +0 -113
- package/StatGroup/styles/index.less +0 -8
- package/Steps/styles/index.less +0 -222
- package/Table/styles/index.less +0 -433
- package/Table/styles/mixin.less +0 -8
- package/Tabs/styles/index.less +0 -24
- package/Tag/styles/index.less +0 -55
- package/TagGroup/styles/index.less +0 -14
- package/TagInput/styles/index.less +0 -5
- package/TagPicker/styles/index.less +0 -136
- package/Text/styles/index.less +0 -122
- package/Text/styles/variables.less +0 -9
- package/Textarea/styles/index.less +0 -7
- package/TimePicker/styles/index.less +0 -1
- package/TimeRangePicker/styles/index.less +0 -1
- package/Timeline/stories/styles.less +0 -29
- package/Timeline/styles/index.less +0 -174
- package/Timeline/styles/mixin.less +0 -13
- package/Toggle/styles/index.less +0 -278
- package/Tooltip/styles/index.less +0 -161
- package/Tooltip/styles/mixins.less +0 -60
- package/Tree/styles/indent-line.less +0 -8
- package/Tree/styles/index.less +0 -186
- package/Tree/styles/toggle.less +0 -32
- package/TreePicker/styles/index.less +0 -16
- package/Uploader/styles/index.less +0 -468
- package/Uploader/styles/mixin.less +0 -11
- package/VisuallyHidden/styles/index.less +0 -11
- package/cjs/Progress/ProgressCircle.js +0 -132
- package/cjs/internals/Overlay/positionUtils.d.ts +0 -15
- package/dist/rsuite-no-reset-rtl.css +0 -15243
- package/dist/rsuite-no-reset-rtl.min.css +0 -2
- package/dist/rsuite-no-reset-rtl.min.css.map +0 -1
- package/dist/rsuite-no-reset.min.css.map +0 -1
- package/dist/rsuite-rtl.css +0 -15494
- package/dist/rsuite-rtl.min.css +0 -2
- package/dist/rsuite-rtl.min.css.map +0 -1
- package/dist/rsuite.min.css.map +0 -1
- package/esm/Progress/ProgressCircle.js +0 -125
- package/esm/internals/Overlay/positionUtils.d.ts +0 -15
- package/internals/Box/styles/index.less +0 -82
- package/internals/Burger/styles/index.less +0 -67
- package/internals/CloseButton/styles/index.less +0 -15
- package/internals/Picker/styles/index.less +0 -477
- package/internals/Picker/styles/mixin.less +0 -131
- package/internals/Ripple/styles/index.less +0 -36
- package/internals/Ripple/styles/mixins.less +0 -6
- package/internals/ScrollView/styles/index.less +0 -69
- package/internals/SearchBox/styles/index.less +0 -11
- package/styles/color-modes/dark.less +0 -441
- package/styles/color-modes/high-contrast.less +0 -452
- package/styles/color-modes/light.less +0 -464
- package/styles/colors/dark.less +0 -105
- package/styles/colors/high-contrast.less +0 -105
- package/styles/colors/light.less +0 -105
- package/styles/common.less +0 -13
- package/styles/index.less +0 -106
- package/styles/mixins/color-modes.less +0 -16
- package/styles/mixins/combobox.less +0 -6
- package/styles/mixins/hacks.less +0 -32
- package/styles/mixins/listbox.less +0 -68
- package/styles/mixins/menu.less +0 -12
- package/styles/mixins/utilities.less +0 -183
- package/styles/normalize.less +0 -247
- package/styles/plugins/palette.js +0 -1407
- package/styles/root.less +0 -83
- package/styles/scaffolding.less +0 -54
- package/styles/typography.less +0 -123
- package/styles/variables.less +0 -638
- package/toaster/styles/animation.less +0 -54
- package/toaster/styles/index.less +0 -100
- package/useToaster/styles/index.less +0 -1
|
@@ -23,10 +23,7 @@ function useFlattenTree(data, options) {
|
|
|
23
23
|
const forceUpdate = useForceUpdate();
|
|
24
24
|
const flattenedNodes = useRef({});
|
|
25
25
|
const seenValues = useRef(new Set());
|
|
26
|
-
const updateTreeNodeCheckState = useCallback(
|
|
27
|
-
if (value === void 0) {
|
|
28
|
-
value = [];
|
|
29
|
-
}
|
|
26
|
+
const updateTreeNodeCheckState = useCallback((value = []) => {
|
|
30
27
|
// Reset values to false
|
|
31
28
|
Object.keys(flattenedNodes.current).forEach(refKey => {
|
|
32
29
|
const node = flattenedNodes.current[refKey];
|
|
@@ -42,10 +39,7 @@ function useFlattenTree(data, options) {
|
|
|
42
39
|
});
|
|
43
40
|
});
|
|
44
41
|
}, [cascade, uncheckableItemValues, valueKey]);
|
|
45
|
-
const flattenTreeData = useCallback(
|
|
46
|
-
if (layer === void 0) {
|
|
47
|
-
layer = 1;
|
|
48
|
-
}
|
|
42
|
+
const flattenTreeData = useCallback((treeData, parent, layer = 1) => {
|
|
49
43
|
if (!Array.isArray(treeData) || treeData.length === 0) {
|
|
50
44
|
return [];
|
|
51
45
|
}
|
|
@@ -10,13 +10,7 @@ import { useItemDataKeys } from "../../internals/Tree/TreeProvider.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Determines whether a node should be shown based on the expanded state of its parent nodes.
|
|
12
12
|
*/
|
|
13
|
-
function shouldShowNodeByParentExpanded(expandItemValues, parentKeys) {
|
|
14
|
-
if (expandItemValues === void 0) {
|
|
15
|
-
expandItemValues = [];
|
|
16
|
-
}
|
|
17
|
-
if (parentKeys === void 0) {
|
|
18
|
-
parentKeys = [];
|
|
19
|
-
}
|
|
13
|
+
function shouldShowNodeByParentExpanded(expandItemValues = [], parentKeys = []) {
|
|
20
14
|
const intersectionKeys = intersection(expandItemValues, parentKeys);
|
|
21
15
|
if (intersectionKeys.length === parentKeys.length) {
|
|
22
16
|
return true;
|
|
@@ -13,10 +13,7 @@ export let WalkTreeStrategy = /*#__PURE__*/function (WalkTreeStrategy) {
|
|
|
13
13
|
/**
|
|
14
14
|
* Flattens a tree structure into an array.
|
|
15
15
|
*/
|
|
16
|
-
export function flattenTree(rootNodes, getChildren, walkStrategy) {
|
|
17
|
-
if (walkStrategy === void 0) {
|
|
18
|
-
walkStrategy = WalkTreeStrategy.BFS;
|
|
19
|
-
}
|
|
16
|
+
export function flattenTree(rootNodes, getChildren, walkStrategy = WalkTreeStrategy.BFS) {
|
|
20
17
|
const result = [];
|
|
21
18
|
if (walkStrategy === WalkTreeStrategy.BFS) {
|
|
22
19
|
walkTreeBfs(rootNodes, getChildren, node => result.push(node));
|
|
@@ -58,10 +55,7 @@ export function walkTreeDfs(rootNodes, getChildren, callback) {
|
|
|
58
55
|
* @deprecated This function is considered unsafe because it mutates the `tree` argument in-place.
|
|
59
56
|
* Use the `flattenTree` function instead.
|
|
60
57
|
*/
|
|
61
|
-
export function UNSAFE_flattenTree(tree, childrenKey, executor) {
|
|
62
|
-
if (childrenKey === void 0) {
|
|
63
|
-
childrenKey = 'children';
|
|
64
|
-
}
|
|
58
|
+
export function UNSAFE_flattenTree(tree, childrenKey = 'children', executor) {
|
|
65
59
|
const flattenData = [];
|
|
66
60
|
const traverse = (data, parent) => {
|
|
67
61
|
if (!Array.isArray(data)) {
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Returns an array of expanded item values.
|
|
4
4
|
*/
|
|
5
|
-
export function getExpandItemValues(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
5
|
+
export function getExpandItemValues({
|
|
6
|
+
node,
|
|
7
|
+
isExpand,
|
|
8
|
+
expandItemValues,
|
|
9
|
+
valueKey
|
|
10
|
+
}) {
|
|
12
11
|
const newExpandItemValues = new Set(expandItemValues);
|
|
13
12
|
if (isExpand) {
|
|
14
13
|
newExpandItemValues.add(node[valueKey]);
|
|
@@ -12,10 +12,7 @@ import { previewFile } from "./utils/previewFile.js";
|
|
|
12
12
|
* Format display file size
|
|
13
13
|
* @param size
|
|
14
14
|
*/
|
|
15
|
-
export const formatSize =
|
|
16
|
-
if (size === void 0) {
|
|
17
|
-
size = 0;
|
|
18
|
-
}
|
|
15
|
+
export const formatSize = (size = 0) => {
|
|
19
16
|
const K = 1024;
|
|
20
17
|
const M = 1024 * 1024;
|
|
21
18
|
const G = 1024 * 1024 * 1024;
|
package/esm/Uploader/Uploader.js
CHANGED
|
@@ -59,10 +59,7 @@ function fileListReducer(files, action) {
|
|
|
59
59
|
throw new Error();
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const useFileList =
|
|
63
|
-
if (defaultFileList === void 0) {
|
|
64
|
-
defaultFileList = [];
|
|
65
|
-
}
|
|
62
|
+
const useFileList = (defaultFileList = []) => {
|
|
66
63
|
const fileListRef = useRef(defaultFileList.map(createFile));
|
|
67
64
|
const fileListUpdateCallback = useRef(null);
|
|
68
65
|
const [fileList, dispatch] = useReducer(fileListReducer, fileListRef.current);
|
package/esm/global.d.ts
CHANGED
package/esm/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './Badge';
|
|
|
20
20
|
export * from './toaster';
|
|
21
21
|
export * from './useToaster';
|
|
22
22
|
export * from './Progress';
|
|
23
|
+
export * from './ProgressCircle';
|
|
23
24
|
export * from './Avatar';
|
|
24
25
|
export * from './AvatarGroup';
|
|
25
26
|
export * from './Image';
|
|
@@ -56,6 +57,7 @@ export * from './RadioGroup';
|
|
|
56
57
|
export * from './RadioTile';
|
|
57
58
|
export * from './RadioTileGroup';
|
|
58
59
|
export * from './SelectPicker';
|
|
60
|
+
export * from './SegmentedControl';
|
|
59
61
|
export * from './CheckPicker';
|
|
60
62
|
export * from './InputPicker';
|
|
61
63
|
export * from './TagPicker';
|
|
@@ -112,6 +114,7 @@ export * from './CustomProvider';
|
|
|
112
114
|
export * from './useMediaQuery';
|
|
113
115
|
export * from './useBreakpointValue';
|
|
114
116
|
export * from './useFormControl';
|
|
117
|
+
export * from './useDialog';
|
|
115
118
|
export * from './VisuallyHidden';
|
|
116
119
|
export * from './Tabs';
|
|
117
120
|
export * from './Accordion';
|
package/esm/index.js
CHANGED
|
@@ -32,6 +32,7 @@ export * from "./Badge/index.js";
|
|
|
32
32
|
export * from "./toaster/index.js";
|
|
33
33
|
export * from "./useToaster/index.js";
|
|
34
34
|
export * from "./Progress/index.js";
|
|
35
|
+
export * from "./ProgressCircle/index.js";
|
|
35
36
|
|
|
36
37
|
// Media
|
|
37
38
|
// --------------------------------------------------------
|
|
@@ -80,6 +81,7 @@ export * from "./RadioGroup/index.js";
|
|
|
80
81
|
export * from "./RadioTile/index.js";
|
|
81
82
|
export * from "./RadioTileGroup/index.js";
|
|
82
83
|
export * from "./SelectPicker/index.js";
|
|
84
|
+
export * from "./SegmentedControl/index.js";
|
|
83
85
|
export * from "./CheckPicker/index.js";
|
|
84
86
|
export * from "./InputPicker/index.js";
|
|
85
87
|
export * from "./TagPicker/index.js";
|
|
@@ -148,6 +150,7 @@ export * from "./CustomProvider/index.js";
|
|
|
148
150
|
export * from "./useMediaQuery/index.js";
|
|
149
151
|
export * from "./useBreakpointValue/index.js";
|
|
150
152
|
export * from "./useFormControl/index.js";
|
|
153
|
+
export * from "./useDialog/index.js";
|
|
151
154
|
|
|
152
155
|
// Disclosure
|
|
153
156
|
// --------------------------------------------------------
|
|
@@ -5,7 +5,7 @@ import Plaintext from "../Plaintext/index.js";
|
|
|
5
5
|
import Box from "../Box/index.js";
|
|
6
6
|
import { forwardRef, mergeRefs, createChainedFunction } from "../utils/index.js";
|
|
7
7
|
import { useFormGroup } from "../../FormGroup/index.js";
|
|
8
|
-
import { InputGroupContext } from "../../InputGroup/
|
|
8
|
+
import { InputGroupContext } from "../../InputGroup/index.js";
|
|
9
9
|
import { KEY_VALUES } from "../constants/index.js";
|
|
10
10
|
import { useStyles } from "../hooks/index.js";
|
|
11
11
|
/**
|
|
@@ -24,19 +24,18 @@ function getMenuItemTarget(event) {
|
|
|
24
24
|
* Headless ARIA `menu`
|
|
25
25
|
* @private
|
|
26
26
|
*/
|
|
27
|
-
function Menu(
|
|
27
|
+
function Menu({
|
|
28
|
+
disabled,
|
|
29
|
+
children,
|
|
30
|
+
openMenuOn = defaultOpenMenuOn,
|
|
31
|
+
defaultOpen = false,
|
|
32
|
+
open: openProp,
|
|
33
|
+
menuButtonText,
|
|
34
|
+
renderMenuButton,
|
|
35
|
+
renderMenuPopup,
|
|
36
|
+
onToggleMenu
|
|
37
|
+
}) {
|
|
28
38
|
var _items$activeItemInde;
|
|
29
|
-
let {
|
|
30
|
-
disabled,
|
|
31
|
-
children,
|
|
32
|
-
openMenuOn = defaultOpenMenuOn,
|
|
33
|
-
defaultOpen = false,
|
|
34
|
-
open: openProp,
|
|
35
|
-
menuButtonText,
|
|
36
|
-
renderMenuButton,
|
|
37
|
-
renderMenuPopup,
|
|
38
|
-
onToggleMenu
|
|
39
|
-
} = _ref;
|
|
40
39
|
const buttonElementRef = useRef(null);
|
|
41
40
|
const menuElementRef = useRef(null);
|
|
42
41
|
const parentMenu = useContext(MenuContext);
|
|
@@ -71,10 +70,7 @@ function Menu(_ref) {
|
|
|
71
70
|
onToggleMenu === null || onToggleMenu === void 0 || onToggleMenu(true, event);
|
|
72
71
|
grabFocus();
|
|
73
72
|
}, [dispatch, onToggleMenu, grabFocus]);
|
|
74
|
-
const closeMenu = useCallback(
|
|
75
|
-
if (returnFocusToButton === void 0) {
|
|
76
|
-
returnFocusToButton = true;
|
|
77
|
-
}
|
|
73
|
+
const closeMenu = useCallback((event, returnFocusToButton = true) => {
|
|
78
74
|
dispatch({
|
|
79
75
|
type: MenuActionTypes.CloseMenu
|
|
80
76
|
});
|
|
@@ -10,13 +10,12 @@ import { isFocusEntering, isFocusLeaving, isFocusableElement } from "../utils/in
|
|
|
10
10
|
/**
|
|
11
11
|
* @private
|
|
12
12
|
*/
|
|
13
|
-
export default function Menubar(
|
|
13
|
+
export default function Menubar({
|
|
14
|
+
vertical = false,
|
|
15
|
+
children,
|
|
16
|
+
onActivateItem
|
|
17
|
+
}) {
|
|
14
18
|
var _items$activeItemInde3;
|
|
15
|
-
let {
|
|
16
|
-
vertical = false,
|
|
17
|
-
children,
|
|
18
|
-
onActivateItem
|
|
19
|
-
} = _ref;
|
|
20
19
|
const menubar = useMenu({
|
|
21
20
|
role: 'menubar'
|
|
22
21
|
});
|
|
@@ -10,18 +10,11 @@ import { useOverlay } from "./OverlayProvider.js";
|
|
|
10
10
|
import { usePortal, useControlled } from "../hooks/index.js";
|
|
11
11
|
import { createChainedFunction, isOneOf } from "../utils/index.js";
|
|
12
12
|
import { isFragment } from "../utils/index.js";
|
|
13
|
-
function mergeEvents(events, props) {
|
|
14
|
-
if (events === void 0) {
|
|
15
|
-
events = {};
|
|
16
|
-
}
|
|
17
|
-
if (props === void 0) {
|
|
18
|
-
props = {};
|
|
19
|
-
}
|
|
13
|
+
function mergeEvents(events = {}, props = {}) {
|
|
20
14
|
const nextEvents = {};
|
|
21
15
|
Object.keys(events).forEach(eventName => {
|
|
22
16
|
if (events[eventName]) {
|
|
23
|
-
|
|
24
|
-
nextEvents[eventName] = createChainedFunction(events[eventName], (_props = props) === null || _props === void 0 ? void 0 : _props[eventName]);
|
|
17
|
+
nextEvents[eventName] = createChainedFunction(events[eventName], props === null || props === void 0 ? void 0 : props[eventName]);
|
|
25
18
|
}
|
|
26
19
|
});
|
|
27
20
|
return nextEvents;
|
|
@@ -5,7 +5,7 @@ import ownerDocument from 'dom-lib/ownerDocument';
|
|
|
5
5
|
import on from 'dom-lib/on';
|
|
6
6
|
import addStyle from 'dom-lib/addStyle';
|
|
7
7
|
import isElement from "../../DOMHelper/isElement.js";
|
|
8
|
-
import
|
|
8
|
+
import { calcPosition } from "./utils/position.js";
|
|
9
9
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
10
10
|
import { getDOMNode, kebabPlace } from "../utils/index.js";
|
|
11
11
|
import { useUpdateEffect } from "../hooks/index.js";
|
|
@@ -38,7 +38,7 @@ const usePosition = (props, ref) => {
|
|
|
38
38
|
arrowOffsetTop: undefined
|
|
39
39
|
};
|
|
40
40
|
const [position, setPosition] = useState(defaultPosition);
|
|
41
|
-
const utils = useMemo(() =>
|
|
41
|
+
const utils = useMemo(() => calcPosition({
|
|
42
42
|
placement,
|
|
43
43
|
preventOverflow,
|
|
44
44
|
padding: containerPadding
|
|
@@ -49,10 +49,7 @@ const usePosition = (props, ref) => {
|
|
|
49
49
|
* @param forceUpdateDOM Whether to update the DOM directly
|
|
50
50
|
* @returns void
|
|
51
51
|
*/
|
|
52
|
-
|
|
53
|
-
if (placementChanged === void 0) {
|
|
54
|
-
placementChanged = true;
|
|
55
|
-
}
|
|
52
|
+
(placementChanged = true, forceUpdateDOM) => {
|
|
56
53
|
if (!(triggerTarget !== null && triggerTarget !== void 0 && triggerTarget.current)) {
|
|
57
54
|
return;
|
|
58
55
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Offset, Placement } from '../../types';
|
|
2
|
+
import type { CursorPosition, PositionOptions, PositionType } from '../types';
|
|
3
|
+
export declare const AutoPlacement: {
|
|
4
|
+
readonly left: "Start";
|
|
5
|
+
readonly right: "End";
|
|
6
|
+
readonly top: "Start";
|
|
7
|
+
readonly bottom: "End";
|
|
8
|
+
};
|
|
9
|
+
export declare function calcPosition(options: PositionOptions): {
|
|
10
|
+
getPosition(target: HTMLElement, container: HTMLElement): import("dom-lib/getOffset").Offset | DOMRect | null;
|
|
11
|
+
getCursorOffsetPosition(target: HTMLElement, container: HTMLElement, cursorPosition: CursorPosition): Offset;
|
|
12
|
+
/**
|
|
13
|
+
* Calculate the optimal auto placement position
|
|
14
|
+
* @param targetOffset Target element offset
|
|
15
|
+
* @param container Container element
|
|
16
|
+
* @param overlay Overlay dimensions
|
|
17
|
+
* @returns Calculated optimal placement position
|
|
18
|
+
*/
|
|
19
|
+
calcAutoPlacement(targetOffset: Offset, container: HTMLElement, overlay: {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}): Placement;
|
|
23
|
+
calcOverlayPosition(overlayNode: HTMLElement, target: HTMLElement, container: HTMLElement, cursorPosition?: CursorPosition | null): PositionType;
|
|
24
|
+
};
|
|
@@ -15,11 +15,26 @@ export const AutoPlacement = {
|
|
|
15
15
|
bottom: 'End'
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
+
// Cache for memoization
|
|
19
|
+
const dimensionsCache = new Map();
|
|
20
|
+
|
|
21
|
+
// Cache expiry time (milliseconds)
|
|
22
|
+
const CACHE_EXPIRY = 100;
|
|
23
|
+
|
|
18
24
|
/**
|
|
19
|
-
* Get the external dimensions of the container
|
|
20
|
-
* @param containerNode
|
|
25
|
+
* Get the external dimensions of the container with memoization for performance
|
|
26
|
+
* @param containerNode Container element
|
|
27
|
+
* @returns Container dimensions information
|
|
21
28
|
*/
|
|
22
29
|
function getContainerDimensions(containerNode) {
|
|
30
|
+
// Check cache
|
|
31
|
+
const cached = dimensionsCache.get(containerNode);
|
|
32
|
+
const now = Date.now();
|
|
33
|
+
if (cached && now - cached.timestamp < CACHE_EXPIRY) {
|
|
34
|
+
return cached.dimensions;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Calculate new dimensions
|
|
23
38
|
let width;
|
|
24
39
|
let height;
|
|
25
40
|
let scrollX;
|
|
@@ -37,19 +52,28 @@ function getContainerDimensions(containerNode) {
|
|
|
37
52
|
scrollY = scrollTop(containerNode);
|
|
38
53
|
scrollX = scrollLeft(containerNode);
|
|
39
54
|
}
|
|
40
|
-
|
|
55
|
+
const dimensions = {
|
|
41
56
|
width,
|
|
42
57
|
height,
|
|
43
58
|
scrollX,
|
|
44
59
|
scrollY
|
|
45
60
|
};
|
|
61
|
+
|
|
62
|
+
// Update cache
|
|
63
|
+
dimensionsCache.set(containerNode, {
|
|
64
|
+
dimensions,
|
|
65
|
+
timestamp: now
|
|
66
|
+
});
|
|
67
|
+
return dimensions;
|
|
46
68
|
}
|
|
47
|
-
export
|
|
69
|
+
export function calcPosition(options) {
|
|
48
70
|
const {
|
|
49
71
|
placement,
|
|
50
72
|
preventOverflow,
|
|
51
73
|
padding
|
|
52
|
-
} =
|
|
74
|
+
} = options;
|
|
75
|
+
// Ensure placement is a valid type
|
|
76
|
+
const currentPlacement = placement;
|
|
53
77
|
function getTopDelta(top, overlayHeight, container) {
|
|
54
78
|
if (!preventOverflow) {
|
|
55
79
|
return 0;
|
|
@@ -95,12 +119,12 @@ export default props => {
|
|
|
95
119
|
height: containerHeight
|
|
96
120
|
} = getContainerDimensions(container);
|
|
97
121
|
|
|
98
|
-
//
|
|
122
|
+
// Check if the bottom of the overlay overflows, set top
|
|
99
123
|
if (overlayHeight + top > containerHeight + scrollY) {
|
|
100
124
|
return containerHeight - overlayHeight + scrollY;
|
|
101
125
|
}
|
|
102
126
|
|
|
103
|
-
// top
|
|
127
|
+
// The minimum value of top should not be less than the vertical scroll bar y value
|
|
104
128
|
return Math.max(scrollY, top);
|
|
105
129
|
}
|
|
106
130
|
function getPositionLeft(container, overlayWidth, left) {
|
|
@@ -115,7 +139,7 @@ export default props => {
|
|
|
115
139
|
return containerWidth - overlayWidth + scrollX;
|
|
116
140
|
}
|
|
117
141
|
|
|
118
|
-
// left
|
|
142
|
+
// The minimum value of left should not be less than the horizontal scroll bar x value
|
|
119
143
|
return Math.max(scrollX, left);
|
|
120
144
|
}
|
|
121
145
|
return {
|
|
@@ -161,57 +185,86 @@ export default props => {
|
|
|
161
185
|
offset.top = top - containerOffset.top;
|
|
162
186
|
return offset;
|
|
163
187
|
},
|
|
188
|
+
/**
|
|
189
|
+
* Calculate the optimal auto placement position
|
|
190
|
+
* @param targetOffset Target element offset
|
|
191
|
+
* @param container Container element
|
|
192
|
+
* @param overlay Overlay dimensions
|
|
193
|
+
* @returns Calculated optimal placement position
|
|
194
|
+
*/
|
|
164
195
|
calcAutoPlacement(targetOffset, container, overlay) {
|
|
196
|
+
// Get container dimensions and scroll position
|
|
165
197
|
const {
|
|
166
198
|
width,
|
|
167
199
|
height,
|
|
168
200
|
scrollX,
|
|
169
201
|
scrollY
|
|
170
202
|
} = getContainerDimensions(container);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
203
|
+
|
|
204
|
+
// Calculate available space in each direction
|
|
205
|
+
const availableSpace = {
|
|
206
|
+
left: targetOffset.left - scrollX - overlay.width,
|
|
207
|
+
top: targetOffset.top - scrollY - overlay.height,
|
|
208
|
+
right: width - targetOffset.left - targetOffset.width + scrollX - overlay.width,
|
|
209
|
+
bottom: height - targetOffset.top - targetOffset.height + scrollY - overlay.height
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// Group available space into horizontal and vertical directions
|
|
175
213
|
const horizontal = [{
|
|
176
214
|
key: 'left',
|
|
177
|
-
value: left
|
|
215
|
+
value: availableSpace.left
|
|
178
216
|
}, {
|
|
179
217
|
key: 'right',
|
|
180
|
-
value: right
|
|
218
|
+
value: availableSpace.right
|
|
181
219
|
}];
|
|
182
220
|
const vertical = [{
|
|
183
221
|
key: 'top',
|
|
184
|
-
value: top
|
|
222
|
+
value: availableSpace.top
|
|
185
223
|
}, {
|
|
186
224
|
key: 'bottom',
|
|
187
|
-
value: bottom
|
|
225
|
+
value: availableSpace.bottom
|
|
188
226
|
}];
|
|
227
|
+
|
|
228
|
+
// Constants for auto placement
|
|
189
229
|
const AV = 'autoVertical';
|
|
190
230
|
const AH = 'autoHorizontal';
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
direction = maxBy(horizontal, o => o.value);
|
|
198
|
-
return placement === AH ? direction.key : `${direction.key}${placement.replace(AH, '')}`;
|
|
231
|
+
|
|
232
|
+
// Handle specific auto vertical placement
|
|
233
|
+
if (currentPlacement.indexOf(AV) !== -1) {
|
|
234
|
+
const bestDirection = maxBy(vertical, o => o.value);
|
|
235
|
+
if (!bestDirection) return 'bottom'; // Default value
|
|
236
|
+
return currentPlacement === AV ? bestDirection.key : `${bestDirection.key}${currentPlacement.replace(AV, '')}`;
|
|
199
237
|
}
|
|
200
238
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (direction.key === 'left' || direction.key === 'right') {
|
|
207
|
-
align = minBy(vertical, o => o.value);
|
|
208
|
-
} else {
|
|
209
|
-
align = minBy(horizontal, o => o.value);
|
|
239
|
+
// Handle specific auto horizontal placement
|
|
240
|
+
if (currentPlacement.indexOf(AH) !== -1) {
|
|
241
|
+
const bestDirection = maxBy(horizontal, o => o.value);
|
|
242
|
+
if (!bestDirection) return 'right'; // Default value
|
|
243
|
+
return currentPlacement === AH ? bestDirection.key : `${bestDirection.key}${currentPlacement.replace(AH, '')}`;
|
|
210
244
|
}
|
|
211
|
-
|
|
245
|
+
|
|
246
|
+
// By default, vertical direction takes precedence
|
|
247
|
+
// Find the direction with the most space to use as main direction
|
|
248
|
+
const bestDirection = maxBy([...vertical, ...horizontal], o => o.value);
|
|
249
|
+
if (!bestDirection) return 'bottom'; // 默认值
|
|
250
|
+
|
|
251
|
+
// Determine alignment based on main direction
|
|
252
|
+
const isHorizontal = bestDirection.key === 'left' || bestDirection.key === 'right';
|
|
253
|
+
const bestAlign = isHorizontal ? minBy(vertical, o => o.value) // If main direction is horizontal, align vertically
|
|
254
|
+
: minBy(horizontal, o => o.value); // If main direction is vertical, align horizontally
|
|
255
|
+
|
|
256
|
+
if (!bestAlign) return bestDirection.key; // If no alignment, return main direction
|
|
257
|
+
|
|
258
|
+
// Return final placement position
|
|
259
|
+
return `${bestDirection.key}${AutoPlacement[bestAlign.key]}`;
|
|
212
260
|
},
|
|
213
261
|
// Calculate the position of the overlay
|
|
214
262
|
calcOverlayPosition(overlayNode, target, container, cursorPosition) {
|
|
263
|
+
// Cache commonly used values to avoid repeated calculations
|
|
264
|
+
const ARROW_OFFSET_FACTOR = 50; // Arrow offset calculation factor
|
|
265
|
+
const isRTL = document.dir === 'rtl';
|
|
266
|
+
|
|
267
|
+
// Get target element offset
|
|
215
268
|
const childOffset = cursorPosition ? this.getCursorOffsetPosition(target, container, cursorPosition) : this.getPosition(target, container);
|
|
216
269
|
const {
|
|
217
270
|
height: overlayHeight,
|
|
@@ -221,45 +274,70 @@ export default props => {
|
|
|
221
274
|
top,
|
|
222
275
|
left
|
|
223
276
|
} = childOffset;
|
|
224
|
-
|
|
225
|
-
|
|
277
|
+
|
|
278
|
+
// Determine placement position
|
|
279
|
+
let nextPlacement = currentPlacement;
|
|
280
|
+
if (currentPlacement && currentPlacement.indexOf('auto') >= 0) {
|
|
226
281
|
nextPlacement = this.calcAutoPlacement(childOffset, container, {
|
|
227
282
|
height: overlayHeight,
|
|
228
283
|
width: overlayWidth
|
|
229
284
|
});
|
|
230
285
|
}
|
|
286
|
+
|
|
287
|
+
// Initialize position and arrow offset values
|
|
231
288
|
let positionLeft;
|
|
232
289
|
let positionTop;
|
|
233
290
|
let arrowOffsetLeft;
|
|
234
291
|
let arrowOffsetTop;
|
|
292
|
+
|
|
293
|
+
// Handle basic left/right positions
|
|
235
294
|
if (nextPlacement === 'left' || nextPlacement === 'right') {
|
|
295
|
+
// Vertical centering
|
|
236
296
|
positionTop = childOffset.top + (childOffset.height - overlayHeight) / 2;
|
|
237
297
|
const topDelta = getTopDelta(positionTop, overlayHeight, container);
|
|
238
298
|
positionTop += topDelta;
|
|
239
|
-
arrowOffsetTop = `${
|
|
299
|
+
arrowOffsetTop = `${ARROW_OFFSET_FACTOR * (1 - 2 * topDelta / overlayHeight)}%`;
|
|
240
300
|
arrowOffsetLeft = undefined;
|
|
241
|
-
}
|
|
301
|
+
}
|
|
302
|
+
// Handle basic top/bottom positions
|
|
303
|
+
else if (nextPlacement === 'top' || nextPlacement === 'bottom') {
|
|
304
|
+
// Horizontal centering
|
|
242
305
|
positionLeft = left + (childOffset.width - overlayWidth) / 2;
|
|
243
306
|
const leftDelta = getLeftDelta(positionLeft, overlayWidth, container);
|
|
244
307
|
positionLeft += leftDelta;
|
|
245
|
-
arrowOffsetLeft = `${
|
|
308
|
+
arrowOffsetLeft = `${ARROW_OFFSET_FACTOR * (1 - 2 * leftDelta / overlayWidth)}%`;
|
|
246
309
|
arrowOffsetTop = undefined;
|
|
247
310
|
}
|
|
248
|
-
|
|
311
|
+
|
|
312
|
+
// Helper function: Check if placement matches specified prefix
|
|
313
|
+
const matchesPlacement = prefix => {
|
|
314
|
+
return nextPlacement === prefix || nextPlacement === `${prefix}Start` || nextPlacement === `${prefix}End`;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
// Handle top position series
|
|
318
|
+
if (matchesPlacement('top')) {
|
|
249
319
|
positionTop = getPositionTop(container, overlayHeight, childOffset.top - overlayHeight);
|
|
250
320
|
}
|
|
251
|
-
|
|
321
|
+
|
|
322
|
+
// Handle bottom position series
|
|
323
|
+
if (matchesPlacement('bottom')) {
|
|
252
324
|
positionTop = getPositionTop(container, overlayHeight, childOffset.top + childOffset.height);
|
|
253
325
|
}
|
|
254
|
-
|
|
326
|
+
|
|
327
|
+
// Handle left position series
|
|
328
|
+
if (matchesPlacement('left')) {
|
|
255
329
|
positionLeft = getPositionLeft(container, overlayWidth, childOffset.left - overlayWidth);
|
|
256
330
|
}
|
|
257
|
-
|
|
331
|
+
|
|
332
|
+
// Handle right position series
|
|
333
|
+
if (matchesPlacement('right')) {
|
|
258
334
|
positionLeft = getPositionLeft(container, overlayWidth, childOffset.left + childOffset.width);
|
|
259
335
|
}
|
|
260
|
-
|
|
336
|
+
|
|
337
|
+
// Handle horizontal position adjustment in RTL mode
|
|
338
|
+
if (isRTL && (matchesPlacement('left') || matchesPlacement('right'))) {
|
|
261
339
|
/**
|
|
262
|
-
* When laying out in
|
|
340
|
+
* When laying out in RTL, if the width of the container
|
|
263
341
|
* is less than the width of the container scrolling,
|
|
264
342
|
* you need to recalculate the left value.
|
|
265
343
|
*/
|
|
@@ -270,25 +348,33 @@ export default props => {
|
|
|
270
348
|
positionLeft = containerWidth + positionLeft - container.scrollWidth;
|
|
271
349
|
}
|
|
272
350
|
}
|
|
351
|
+
|
|
352
|
+
// Handle Start variant positions
|
|
273
353
|
if (nextPlacement === 'topStart' || nextPlacement === 'bottomStart') {
|
|
274
|
-
if (
|
|
354
|
+
if (isRTL) {
|
|
275
355
|
const nextLeft = left + (childOffset.width - overlayWidth);
|
|
276
356
|
positionLeft = nextLeft + getLeftDelta(nextLeft, overlayWidth, container);
|
|
277
357
|
} else {
|
|
278
358
|
positionLeft = left + getLeftDelta(left, overlayWidth, container);
|
|
279
359
|
}
|
|
280
360
|
}
|
|
361
|
+
|
|
362
|
+
// Handle End variant positions
|
|
281
363
|
if (nextPlacement === 'topEnd' || nextPlacement === 'bottomEnd') {
|
|
282
|
-
if (
|
|
364
|
+
if (isRTL) {
|
|
283
365
|
positionLeft = left + getLeftDelta(left, overlayWidth, container);
|
|
284
366
|
} else {
|
|
285
367
|
const nextLeft = left + (childOffset.width - overlayWidth);
|
|
286
368
|
positionLeft = nextLeft + getLeftDelta(nextLeft, overlayWidth, container);
|
|
287
369
|
}
|
|
288
370
|
}
|
|
371
|
+
|
|
372
|
+
// Handle leftStart and rightStart
|
|
289
373
|
if (nextPlacement === 'leftStart' || nextPlacement === 'rightStart') {
|
|
290
374
|
positionTop = top + getTopDelta(top, overlayHeight, container);
|
|
291
375
|
}
|
|
376
|
+
|
|
377
|
+
// Handle leftEnd and rightEnd
|
|
292
378
|
if (nextPlacement === 'leftEnd' || nextPlacement === 'rightEnd') {
|
|
293
379
|
const nextTop = top + (childOffset.height - overlayHeight);
|
|
294
380
|
positionTop = nextTop + getTopDelta(nextTop, overlayHeight, container);
|
|
@@ -302,4 +388,4 @@ export default props => {
|
|
|
302
388
|
};
|
|
303
389
|
}
|
|
304
390
|
};
|
|
305
|
-
}
|
|
391
|
+
}
|