rsuite 5.74.2 → 5.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/Card/package.json +7 -0
- package/Card/styles/index.css +105 -0
- package/Card/styles/index.less +62 -0
- package/CardBody/package.json +7 -0
- package/CardFooter/package.json +7 -0
- package/CardGroup/package.json +7 -0
- package/CardGroup/styles/index.css +7 -0
- package/CardGroup/styles/index.less +8 -0
- package/CardHeader/package.json +7 -0
- package/Image/package.json +7 -0
- package/Image/styles/index.css +33 -0
- package/Image/styles/index.less +34 -0
- package/List/styles/index.css +10 -12
- package/List/styles/index.less +12 -4
- package/Stat/package.json +7 -0
- package/Stat/styles/index.css +1749 -0
- package/Stat/styles/index.less +106 -0
- package/StatGroup/package.json +7 -0
- package/StatGroup/styles/index.css +7 -0
- package/StatGroup/styles/index.less +8 -0
- package/StatHelpText/package.json +7 -0
- package/StatLabel/package.json +7 -0
- package/StatTrend/package.json +7 -0
- package/StatValue/package.json +7 -0
- package/StatValueUnit/package.json +7 -0
- package/cjs/Affix/Affix.js +2 -2
- package/cjs/Animation/Transition.js +7 -7
- package/cjs/AutoComplete/AutoComplete.js +7 -7
- package/cjs/Avatar/useImage.js +1 -1
- package/cjs/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/Calendar/Calendar.js +3 -3
- package/cjs/Calendar/CalendarContainer.js +1 -1
- package/cjs/Calendar/Grid/GridRow.js +3 -3
- package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/cjs/Calendar/TimeDropdown/TimeDropdown.js +3 -3
- package/cjs/Calendar/hooks/useCalendarState.js +6 -6
- package/cjs/Card/Card.d.ts +33 -0
- package/cjs/Card/Card.js +63 -0
- package/cjs/Card/CardBody.d.ts +4 -0
- package/cjs/Card/CardBody.js +11 -0
- package/cjs/Card/CardFooter.d.ts +4 -0
- package/cjs/Card/CardFooter.js +11 -0
- package/cjs/Card/CardHeader.d.ts +4 -0
- package/cjs/Card/CardHeader.js +11 -0
- package/cjs/Card/index.d.ts +6 -0
- package/cjs/Card/index.js +8 -0
- package/cjs/CardGroup/CardGroup.d.ts +13 -0
- package/cjs/CardGroup/CardGroup.js +47 -0
- package/cjs/CardGroup/index.d.ts +3 -0
- package/cjs/CardGroup/index.js +8 -0
- package/cjs/Carousel/Carousel.js +5 -4
- package/cjs/CascadeTree/CascadeTree.js +1 -1
- package/cjs/CascadeTree/TreeView.js +1 -1
- package/cjs/CascadeTree/hooks/useSearch.js +4 -4
- package/cjs/CascadeTree/hooks/useSelect.js +2 -2
- package/cjs/Cascader/Cascader.js +13 -13
- package/cjs/Cascader/useActive.js +4 -4
- package/cjs/CheckPicker/CheckPicker.js +5 -5
- package/cjs/CheckTree/CheckTree.js +1 -1
- package/cjs/CheckTree/CheckTreeNode.js +3 -3
- package/cjs/CheckTree/CheckTreeView.js +7 -7
- package/cjs/CheckTree/utils.js +3 -3
- package/cjs/CheckTreePicker/CheckTreePicker.js +2 -2
- package/cjs/CheckTreePicker/hooks/useFocusState.js +3 -3
- package/cjs/Checkbox/Checkbox.js +2 -2
- package/cjs/CheckboxGroup/CheckboxGroup.js +1 -1
- package/cjs/CustomProvider/FormattedNumber.d.ts +7 -0
- package/cjs/CustomProvider/FormattedNumber.js +19 -0
- package/cjs/CustomProvider/index.d.ts +1 -0
- package/cjs/CustomProvider/index.js +3 -1
- package/cjs/CustomProvider/types.d.ts +10 -0
- package/cjs/CustomProvider/useCustom.d.ts +1 -0
- package/cjs/CustomProvider/useCustom.js +3 -1
- package/cjs/DateInput/DateField.js +2 -2
- package/cjs/DateInput/DateInput.js +2 -2
- package/cjs/DateInput/hooks/useDateInputState.js +2 -2
- package/cjs/DateInput/hooks/useIsFocused.js +2 -2
- package/cjs/DateInput/hooks/useKeyboardInputEvent.js +5 -5
- package/cjs/DatePicker/DatePicker.js +14 -14
- package/cjs/DatePicker/PredefinedRanges.js +1 -1
- package/cjs/DatePicker/hooks/useFocus.js +1 -1
- package/cjs/DatePicker/hooks/useMonthView.js +1 -1
- package/cjs/DateRangeInput/DateRangeInput.js +4 -4
- package/cjs/DateRangePicker/DateRangePicker.js +8 -8
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/cjs/Dropdown/Dropdown.js +3 -3
- package/cjs/Dropdown/DropdownItem.js +2 -2
- package/cjs/Dropdown/DropdownMenu.js +1 -1
- package/cjs/Form/Form.js +8 -8
- package/cjs/Form/hooks/useFormValidate.js +19 -19
- package/cjs/FormControl/FormControl.js +5 -5
- package/cjs/FormControl/hooks/useField.js +1 -1
- package/cjs/FormControl/hooks/useRegisterModel.js +2 -2
- package/cjs/Image/Image.d.ts +42 -0
- package/cjs/Image/Image.js +102 -0
- package/cjs/Image/ImageWrapper.d.ts +1 -0
- package/cjs/Image/ImageWrapper.js +10 -0
- package/cjs/Image/hooks/useImage.d.ts +14 -0
- package/cjs/Image/hooks/useImage.js +68 -0
- package/cjs/Image/index.d.ts +3 -0
- package/cjs/Image/index.js +8 -0
- package/cjs/InlineEdit/renderChildren.js +1 -1
- package/cjs/InlineEdit/useEditState.js +7 -7
- package/cjs/InlineEdit/useFocusEvent.js +5 -5
- package/cjs/Input/Input.js +3 -3
- package/cjs/InputGroup/InputGroup.js +2 -2
- package/cjs/InputNumber/InputNumber.js +3 -3
- package/cjs/InputPicker/InputAutosize.js +1 -1
- package/cjs/InputPicker/InputPicker.js +13 -13
- package/cjs/InputPicker/InputSearch.js +1 -1
- package/cjs/InputPicker/hooks/useData.js +1 -1
- package/cjs/InputPicker/hooks/useInput.js +2 -2
- package/cjs/List/List.d.ts +19 -1
- package/cjs/List/List.js +11 -7
- package/cjs/List/ListItem.d.ts +1 -1
- package/cjs/List/helper/useSortHelper.js +10 -10
- package/cjs/MaskedInput/TextMask.js +3 -3
- package/cjs/Message/Message.js +1 -1
- package/cjs/Modal/Modal.js +6 -6
- package/cjs/Modal/utils.js +2 -2
- package/cjs/MultiCascadeTree/SearchView.js +1 -1
- package/cjs/MultiCascadeTree/TreeView.js +1 -1
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.js +5 -5
- package/cjs/MultiCascadeTree/hooks/useSearch.js +1 -1
- package/cjs/MultiCascadeTree/hooks/useSelect.js +1 -1
- package/cjs/MultiCascadeTree/utils.js +9 -9
- package/cjs/MultiCascader/MultiCascader.js +5 -5
- package/cjs/Nav/Nav.js +2 -2
- package/cjs/Nav/NavDropdown.js +3 -3
- package/cjs/Nav/NavDropdownItem.js +2 -2
- package/cjs/Nav/NavDropdownMenu.js +1 -1
- package/cjs/Nav/NavItem.js +3 -3
- package/cjs/Navbar/NavbarDropdown.js +3 -3
- package/cjs/Navbar/NavbarDropdownItem.js +4 -4
- package/cjs/Navbar/NavbarItem.js +3 -3
- package/cjs/Notification/Notification.js +1 -1
- package/cjs/Pagination/PaginationButton.js +1 -1
- package/cjs/Pagination/PaginationGroup.js +3 -3
- package/cjs/Panel/Panel.js +2 -2
- package/cjs/PanelGroup/PanelGroup.js +1 -1
- package/cjs/Placeholder/PlaceholderGrid.js +2 -2
- package/cjs/Placeholder/PlaceholderParagraph.js +1 -1
- package/cjs/Radio/Radio.js +2 -2
- package/cjs/RadioGroup/RadioGroup.js +1 -1
- package/cjs/RadioTile/RadioTile.js +2 -2
- package/cjs/RadioTileGroup/RadioTileGroup.js +1 -1
- package/cjs/RangeSlider/RangeSlider.js +5 -5
- package/cjs/Rate/Character.js +2 -2
- package/cjs/Rate/Rate.js +3 -3
- package/cjs/SafeAnchor/SafeAnchor.js +1 -1
- package/cjs/SelectPicker/SelectPicker.js +7 -7
- package/cjs/Sidebar/Sidebar.js +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdown.js +4 -4
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +3 -3
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +2 -2
- package/cjs/Sidenav/Sidenav.js +1 -1
- package/cjs/Sidenav/SidenavDropdown.js +4 -4
- package/cjs/Sidenav/SidenavDropdownItem.js +2 -2
- package/cjs/Sidenav/SidenavDropdownMenu.js +1 -1
- package/cjs/Sidenav/SidenavItem.js +4 -4
- package/cjs/Sidenav/SidenavToggle.js +1 -1
- package/cjs/Slider/Graduated.js +1 -1
- package/cjs/Slider/Slider.js +3 -3
- package/cjs/Slider/useDrag.js +6 -6
- package/cjs/Stack/HStack.d.ts +6 -3
- package/cjs/Stack/HStack.js +1 -0
- package/cjs/Stack/Stack.d.ts +6 -2
- package/cjs/Stack/Stack.js +1 -1
- package/cjs/Stack/VStack.d.ts +6 -3
- package/cjs/Stack/VStack.js +1 -0
- package/cjs/Stat/Stat.d.ts +26 -0
- package/cjs/Stat/Stat.js +57 -0
- package/cjs/Stat/StatHelpText.d.ts +4 -0
- package/cjs/Stat/StatHelpText.js +11 -0
- package/cjs/Stat/StatLabel.d.ts +14 -0
- package/cjs/Stat/StatLabel.js +53 -0
- package/cjs/Stat/StatTrend.d.ts +7 -0
- package/cjs/Stat/StatTrend.js +68 -0
- package/cjs/Stat/StatValue.d.ts +7 -0
- package/cjs/Stat/StatValue.js +41 -0
- package/cjs/Stat/StatValueUnit.d.ts +4 -0
- package/cjs/Stat/StatValueUnit.js +11 -0
- package/cjs/Stat/index.d.ts +3 -0
- package/cjs/Stat/index.js +8 -0
- package/cjs/StatGroup/StatGroup.d.ts +13 -0
- package/cjs/StatGroup/StatGroup.js +47 -0
- package/cjs/StatGroup/index.d.ts +3 -0
- package/cjs/StatGroup/index.js +8 -0
- package/cjs/Tabs/Tabs.js +1 -1
- package/cjs/Timeline/Timeline.js +1 -1
- package/cjs/Toggle/Toggle.js +1 -1
- package/cjs/Tree/Tree.js +1 -1
- package/cjs/Tree/TreeNode.js +9 -9
- package/cjs/Tree/TreeView.js +7 -7
- package/cjs/Tree/hooks/useExpandTree.js +1 -1
- package/cjs/Tree/hooks/useFlattenTree.js +1 -1
- package/cjs/Tree/hooks/useFocusTree.js +6 -6
- package/cjs/Tree/hooks/useTreeDrag.js +17 -17
- package/cjs/Tree/hooks/useTreeSearch.js +1 -1
- package/cjs/Tree/utils/flattenTree.js +6 -6
- package/cjs/Tree/utils/focusableTree.js +6 -6
- package/cjs/Tree/utils/getNodeParentKeys.js +4 -4
- package/cjs/Tree/utils/treeKeyboardInteractions.js +2 -2
- package/cjs/TreePicker/TreePicker.js +5 -5
- package/cjs/TreePicker/hooks/useFocusState.js +4 -4
- package/cjs/Uploader/UploadFileItem.js +5 -5
- package/cjs/Uploader/UploadTrigger.js +11 -11
- package/cjs/Uploader/Uploader.js +16 -16
- package/cjs/Uploader/utils/ajaxUpload.js +5 -5
- package/cjs/index.d.ts +10 -0
- package/cjs/index.js +12 -2
- package/cjs/internals/Disclosure/Disclosure.js +3 -3
- package/cjs/internals/Disclosure/DisclosureButton.js +2 -2
- package/cjs/internals/Menu/Menu.js +3 -3
- package/cjs/internals/Menu/MenuItem.js +1 -1
- package/cjs/internals/Menu/Menubar.js +2 -2
- package/cjs/internals/Overlay/Modal.js +7 -7
- package/cjs/internals/Overlay/Overlay.js +1 -1
- package/cjs/internals/Overlay/OverlayTrigger.js +3 -3
- package/cjs/internals/Overlay/Position.js +5 -5
- package/cjs/internals/Picker/ListCheckItem.js +3 -3
- package/cjs/internals/Picker/ListItem.js +1 -1
- package/cjs/internals/Picker/Listbox.js +4 -4
- package/cjs/internals/Picker/PickerToggle.js +2 -2
- package/cjs/internals/Picker/SelectedElement.js +1 -1
- package/cjs/internals/Picker/hooks/useFocusItemValue.js +2 -2
- package/cjs/internals/Picker/hooks/usePickerRef.js +4 -4
- package/cjs/internals/Picker/hooks/useSearch.js +1 -1
- package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.js +9 -9
- package/cjs/internals/Picker/utils.js +8 -8
- package/cjs/internals/Ripple/Ripple.js +2 -2
- package/cjs/internals/ScrollView/hooks/useScrollState.js +1 -1
- package/cjs/internals/Tree/utils/filterNodesOfTree.js +3 -3
- package/cjs/internals/Tree/utils/findNodeOfTree.js +3 -3
- package/cjs/internals/Tree/utils/getParentMap.js +3 -3
- package/cjs/internals/Windowing/AutoSizer.js +1 -1
- package/cjs/internals/Windowing/List.js +4 -4
- package/cjs/internals/hooks/useClickOutside.js +1 -1
- package/cjs/internals/hooks/useElementResize.js +1 -1
- package/cjs/internals/hooks/useEventListener.js +1 -1
- package/cjs/internals/hooks/useFocus.js +2 -2
- package/cjs/internals/hooks/useMount.js +1 -1
- package/cjs/internals/hooks/useRootClose.js +4 -4
- package/cjs/internals/hooks/useTimeout.js +1 -1
- package/cjs/internals/utils/getDOMNode.js +2 -1
- package/cjs/internals/utils/stringifyReactNode.js +5 -5
- package/cjs/toaster/ToastContainer.d.ts +1 -0
- package/cjs/toaster/ToastContainer.js +19 -14
- package/cjs/toaster/hooks/useDelayedClosure.js +2 -2
- package/cjs/toaster/toaster.js +7 -7
- package/cjs/useToaster/useToaster.js +1 -1
- package/dist/rsuite-no-reset-rtl.css +274 -36
- 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 +274 -36
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +274 -36
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +274 -36
- package/dist/rsuite.js +427 -174
- 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/Affix/Affix.js +2 -2
- package/esm/Animation/Transition.js +7 -7
- package/esm/AutoComplete/AutoComplete.js +7 -7
- package/esm/Avatar/useImage.js +1 -1
- package/esm/Breadcrumb/Breadcrumb.js +1 -1
- package/esm/Calendar/Calendar.js +3 -3
- package/esm/Calendar/CalendarContainer.js +1 -1
- package/esm/Calendar/Grid/GridRow.js +3 -3
- package/esm/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/esm/Calendar/TimeDropdown/TimeDropdown.js +3 -3
- package/esm/Calendar/hooks/useCalendarState.js +6 -6
- package/esm/Card/Card.d.ts +33 -0
- package/esm/Card/Card.js +58 -0
- package/esm/Card/CardBody.d.ts +4 -0
- package/esm/Card/CardBody.js +7 -0
- package/esm/Card/CardFooter.d.ts +4 -0
- package/esm/Card/CardFooter.js +7 -0
- package/esm/Card/CardHeader.d.ts +4 -0
- package/esm/Card/CardHeader.js +7 -0
- package/esm/Card/index.d.ts +6 -0
- package/esm/Card/index.js +3 -0
- package/esm/CardGroup/CardGroup.d.ts +13 -0
- package/esm/CardGroup/CardGroup.js +42 -0
- package/esm/CardGroup/index.d.ts +3 -0
- package/esm/CardGroup/index.js +3 -0
- package/esm/Carousel/Carousel.js +5 -4
- package/esm/CascadeTree/CascadeTree.js +1 -1
- package/esm/CascadeTree/TreeView.js +1 -1
- package/esm/CascadeTree/hooks/useSearch.js +4 -4
- package/esm/CascadeTree/hooks/useSelect.js +2 -2
- package/esm/Cascader/Cascader.js +13 -13
- package/esm/Cascader/useActive.js +4 -4
- package/esm/CheckPicker/CheckPicker.js +5 -5
- package/esm/CheckTree/CheckTree.js +1 -1
- package/esm/CheckTree/CheckTreeNode.js +3 -3
- package/esm/CheckTree/CheckTreeView.js +7 -7
- package/esm/CheckTree/utils.js +3 -3
- package/esm/CheckTreePicker/CheckTreePicker.js +2 -2
- package/esm/CheckTreePicker/hooks/useFocusState.js +3 -3
- package/esm/Checkbox/Checkbox.js +2 -2
- package/esm/CheckboxGroup/CheckboxGroup.js +1 -1
- package/esm/CustomProvider/FormattedNumber.d.ts +7 -0
- package/esm/CustomProvider/FormattedNumber.js +13 -0
- package/esm/CustomProvider/index.d.ts +1 -0
- package/esm/CustomProvider/index.js +1 -0
- package/esm/CustomProvider/types.d.ts +10 -0
- package/esm/CustomProvider/useCustom.d.ts +1 -0
- package/esm/CustomProvider/useCustom.js +3 -1
- package/esm/DateInput/DateField.js +2 -2
- package/esm/DateInput/DateInput.js +2 -2
- package/esm/DateInput/hooks/useDateInputState.js +2 -2
- package/esm/DateInput/hooks/useIsFocused.js +2 -2
- package/esm/DateInput/hooks/useKeyboardInputEvent.js +5 -5
- package/esm/DatePicker/DatePicker.js +14 -14
- package/esm/DatePicker/PredefinedRanges.js +1 -1
- package/esm/DatePicker/hooks/useFocus.js +1 -1
- package/esm/DatePicker/hooks/useMonthView.js +1 -1
- package/esm/DateRangeInput/DateRangeInput.js +4 -4
- package/esm/DateRangePicker/DateRangePicker.js +8 -8
- package/esm/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/esm/Dropdown/Dropdown.js +3 -3
- package/esm/Dropdown/DropdownItem.js +2 -2
- package/esm/Dropdown/DropdownMenu.js +1 -1
- package/esm/Form/Form.js +8 -8
- package/esm/Form/hooks/useFormValidate.js +19 -19
- package/esm/FormControl/FormControl.js +5 -5
- package/esm/FormControl/hooks/useField.js +1 -1
- package/esm/FormControl/hooks/useRegisterModel.js +2 -2
- package/esm/Image/Image.d.ts +42 -0
- package/esm/Image/Image.js +97 -0
- package/esm/Image/ImageWrapper.d.ts +1 -0
- package/esm/Image/ImageWrapper.js +6 -0
- package/esm/Image/hooks/useImage.d.ts +14 -0
- package/esm/Image/hooks/useImage.js +63 -0
- package/esm/Image/index.d.ts +3 -0
- package/esm/Image/index.js +3 -0
- package/esm/InlineEdit/renderChildren.js +1 -1
- package/esm/InlineEdit/useEditState.js +7 -7
- package/esm/InlineEdit/useFocusEvent.js +5 -5
- package/esm/Input/Input.js +3 -3
- package/esm/InputGroup/InputGroup.js +2 -2
- package/esm/InputNumber/InputNumber.js +3 -3
- package/esm/InputPicker/InputAutosize.js +1 -1
- package/esm/InputPicker/InputPicker.js +13 -13
- package/esm/InputPicker/InputSearch.js +1 -1
- package/esm/InputPicker/hooks/useData.js +1 -1
- package/esm/InputPicker/hooks/useInput.js +2 -2
- package/esm/List/List.d.ts +19 -1
- package/esm/List/List.js +11 -7
- package/esm/List/ListItem.d.ts +1 -1
- package/esm/List/helper/useSortHelper.js +10 -10
- package/esm/MaskedInput/TextMask.js +3 -3
- package/esm/Message/Message.js +1 -1
- package/esm/Modal/Modal.js +6 -6
- package/esm/Modal/utils.js +2 -2
- package/esm/MultiCascadeTree/SearchView.js +1 -1
- package/esm/MultiCascadeTree/TreeView.js +1 -1
- package/esm/MultiCascadeTree/hooks/useCascadeValue.js +5 -5
- package/esm/MultiCascadeTree/hooks/useSearch.js +1 -1
- package/esm/MultiCascadeTree/hooks/useSelect.js +1 -1
- package/esm/MultiCascadeTree/utils.js +13 -10
- package/esm/MultiCascader/MultiCascader.js +5 -5
- package/esm/Nav/Nav.js +2 -2
- package/esm/Nav/NavDropdown.js +3 -3
- package/esm/Nav/NavDropdownItem.js +2 -2
- package/esm/Nav/NavDropdownMenu.js +1 -1
- package/esm/Nav/NavItem.js +3 -3
- package/esm/Navbar/NavbarDropdown.js +3 -3
- package/esm/Navbar/NavbarDropdownItem.js +4 -4
- package/esm/Navbar/NavbarItem.js +3 -3
- package/esm/Notification/Notification.js +1 -1
- package/esm/Pagination/PaginationButton.js +1 -1
- package/esm/Pagination/PaginationGroup.js +3 -3
- package/esm/Panel/Panel.js +2 -2
- package/esm/PanelGroup/PanelGroup.js +1 -1
- package/esm/Placeholder/PlaceholderGrid.js +2 -2
- package/esm/Placeholder/PlaceholderParagraph.js +1 -1
- package/esm/Radio/Radio.js +2 -2
- package/esm/RadioGroup/RadioGroup.js +1 -1
- package/esm/RadioTile/RadioTile.js +2 -2
- package/esm/RadioTileGroup/RadioTileGroup.js +1 -1
- package/esm/RangeSlider/RangeSlider.js +5 -5
- package/esm/Rate/Character.js +2 -2
- package/esm/Rate/Rate.js +3 -3
- package/esm/SafeAnchor/SafeAnchor.js +1 -1
- package/esm/SelectPicker/SelectPicker.js +7 -7
- package/esm/Sidebar/Sidebar.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdown.js +4 -4
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +3 -3
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +2 -2
- package/esm/Sidenav/Sidenav.js +1 -1
- package/esm/Sidenav/SidenavDropdown.js +4 -4
- package/esm/Sidenav/SidenavDropdownItem.js +2 -2
- package/esm/Sidenav/SidenavDropdownMenu.js +1 -1
- package/esm/Sidenav/SidenavItem.js +4 -4
- package/esm/Sidenav/SidenavToggle.js +1 -1
- package/esm/Slider/Graduated.js +1 -1
- package/esm/Slider/Slider.js +3 -3
- package/esm/Slider/useDrag.js +6 -6
- package/esm/Stack/HStack.d.ts +6 -3
- package/esm/Stack/HStack.js +1 -0
- package/esm/Stack/Stack.d.ts +6 -2
- package/esm/Stack/Stack.js +1 -1
- package/esm/Stack/VStack.d.ts +6 -3
- package/esm/Stack/VStack.js +1 -0
- package/esm/Stat/Stat.d.ts +26 -0
- package/esm/Stat/Stat.js +52 -0
- package/esm/Stat/StatHelpText.d.ts +4 -0
- package/esm/Stat/StatHelpText.js +7 -0
- package/esm/Stat/StatLabel.d.ts +14 -0
- package/esm/Stat/StatLabel.js +48 -0
- package/esm/Stat/StatTrend.d.ts +7 -0
- package/esm/Stat/StatTrend.js +63 -0
- package/esm/Stat/StatValue.d.ts +7 -0
- package/esm/Stat/StatValue.js +36 -0
- package/esm/Stat/StatValueUnit.d.ts +4 -0
- package/esm/Stat/StatValueUnit.js +7 -0
- package/esm/Stat/index.d.ts +3 -0
- package/esm/Stat/index.js +3 -0
- package/esm/StatGroup/StatGroup.d.ts +13 -0
- package/esm/StatGroup/StatGroup.js +42 -0
- package/esm/StatGroup/index.d.ts +3 -0
- package/esm/StatGroup/index.js +3 -0
- package/esm/Tabs/Tabs.js +1 -1
- package/esm/Timeline/Timeline.js +1 -1
- package/esm/Toggle/Toggle.js +1 -1
- package/esm/Tree/Tree.js +1 -1
- package/esm/Tree/TreeNode.js +9 -9
- package/esm/Tree/TreeView.js +7 -7
- package/esm/Tree/hooks/useExpandTree.js +1 -1
- package/esm/Tree/hooks/useFlattenTree.js +1 -1
- package/esm/Tree/hooks/useFocusTree.js +6 -6
- package/esm/Tree/hooks/useTreeDrag.js +17 -17
- package/esm/Tree/hooks/useTreeSearch.js +1 -1
- package/esm/Tree/utils/flattenTree.js +6 -6
- package/esm/Tree/utils/focusableTree.js +6 -6
- package/esm/Tree/utils/getNodeParentKeys.js +4 -4
- package/esm/Tree/utils/treeKeyboardInteractions.js +2 -2
- package/esm/TreePicker/TreePicker.js +5 -5
- package/esm/TreePicker/hooks/useFocusState.js +4 -4
- package/esm/Uploader/UploadFileItem.js +5 -5
- package/esm/Uploader/UploadTrigger.js +11 -11
- package/esm/Uploader/Uploader.js +16 -16
- package/esm/Uploader/utils/ajaxUpload.js +5 -5
- package/esm/index.d.ts +10 -0
- package/esm/index.js +5 -0
- package/esm/internals/Disclosure/Disclosure.js +3 -3
- package/esm/internals/Disclosure/DisclosureButton.js +2 -2
- package/esm/internals/Menu/Menu.js +3 -3
- package/esm/internals/Menu/MenuItem.js +1 -1
- package/esm/internals/Menu/Menubar.js +2 -2
- package/esm/internals/Overlay/Modal.js +7 -7
- package/esm/internals/Overlay/Overlay.js +1 -1
- package/esm/internals/Overlay/OverlayTrigger.js +3 -3
- package/esm/internals/Overlay/Position.js +5 -5
- package/esm/internals/Picker/ListCheckItem.js +3 -3
- package/esm/internals/Picker/ListItem.js +1 -1
- package/esm/internals/Picker/Listbox.js +4 -4
- package/esm/internals/Picker/PickerToggle.js +2 -2
- package/esm/internals/Picker/SelectedElement.js +1 -1
- package/esm/internals/Picker/hooks/useFocusItemValue.js +2 -2
- package/esm/internals/Picker/hooks/usePickerRef.js +4 -4
- package/esm/internals/Picker/hooks/useSearch.js +1 -1
- package/esm/internals/Picker/hooks/useToggleKeyDownEvent.js +9 -9
- package/esm/internals/Picker/utils.js +8 -8
- package/esm/internals/Ripple/Ripple.js +2 -2
- package/esm/internals/ScrollView/hooks/useScrollState.js +1 -1
- package/esm/internals/Tree/utils/filterNodesOfTree.js +3 -3
- package/esm/internals/Tree/utils/findNodeOfTree.js +3 -3
- package/esm/internals/Tree/utils/getParentMap.js +3 -3
- package/esm/internals/Windowing/AutoSizer.js +1 -1
- package/esm/internals/Windowing/List.js +4 -4
- package/esm/internals/hooks/useClickOutside.js +1 -1
- package/esm/internals/hooks/useElementResize.js +1 -1
- package/esm/internals/hooks/useEventListener.js +1 -1
- package/esm/internals/hooks/useFocus.js +2 -2
- package/esm/internals/hooks/useMount.js +1 -1
- package/esm/internals/hooks/useRootClose.js +4 -4
- package/esm/internals/hooks/useTimeout.js +1 -1
- package/esm/internals/utils/getDOMNode.js +2 -1
- package/esm/internals/utils/stringifyReactNode.js +5 -5
- package/esm/toaster/ToastContainer.d.ts +1 -0
- package/esm/toaster/ToastContainer.js +19 -14
- package/esm/toaster/hooks/useDelayedClosure.js +2 -2
- package/esm/toaster/toaster.js +7 -7
- package/esm/useToaster/useToaster.js +1 -1
- package/package.json +1 -1
- package/styles/color-modes/dark.less +6 -0
- package/styles/color-modes/high-contrast.less +6 -0
- package/styles/color-modes/light.less +6 -0
- package/styles/index.less +5 -0
- package/toaster/styles/index.css +24 -24
- package/toaster/styles/index.less +29 -29
- package/useToaster/styles/index.css +24 -24
|
@@ -197,8 +197,8 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
197
197
|
*/
|
|
198
198
|
var handleMoveForward = useEventCallback(function (nextPageDate) {
|
|
199
199
|
setCalendarDate(nextPageDate);
|
|
200
|
-
onNextMonth === null || onNextMonth === void 0
|
|
201
|
-
onChangeCalendarDate === null || onChangeCalendarDate === void 0
|
|
200
|
+
onNextMonth === null || onNextMonth === void 0 || onNextMonth(nextPageDate);
|
|
201
|
+
onChangeCalendarDate === null || onChangeCalendarDate === void 0 || onChangeCalendarDate(nextPageDate);
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
/**
|
|
@@ -206,16 +206,16 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
206
206
|
*/
|
|
207
207
|
var handleMoveBackward = useEventCallback(function (nextPageDate) {
|
|
208
208
|
setCalendarDate(nextPageDate);
|
|
209
|
-
onPrevMonth === null || onPrevMonth === void 0
|
|
210
|
-
onChangeCalendarDate === null || onChangeCalendarDate === void 0
|
|
209
|
+
onPrevMonth === null || onPrevMonth === void 0 || onPrevMonth(nextPageDate);
|
|
210
|
+
onChangeCalendarDate === null || onChangeCalendarDate === void 0 || onChangeCalendarDate(nextPageDate);
|
|
211
211
|
});
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
214
|
* The callback triggered when the date changes.
|
|
215
215
|
*/
|
|
216
216
|
var handleDateChange = useEventCallback(function (nextValue, event) {
|
|
217
|
-
onSelect === null || onSelect === void 0
|
|
218
|
-
onChangeCalendarDate === null || onChangeCalendarDate === void 0
|
|
217
|
+
onSelect === null || onSelect === void 0 || onSelect(nextValue, event);
|
|
218
|
+
onChangeCalendarDate === null || onChangeCalendarDate === void 0 || onChangeCalendarDate(nextValue, event);
|
|
219
219
|
});
|
|
220
220
|
|
|
221
221
|
/**
|
|
@@ -231,7 +231,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
231
231
|
*/
|
|
232
232
|
var handleClose = useEventCallback(function () {
|
|
233
233
|
var _trigger$current, _trigger$current$clos;
|
|
234
|
-
(_trigger$current = trigger.current) === null || _trigger$current === void 0
|
|
234
|
+
(_trigger$current = trigger.current) === null || _trigger$current === void 0 || (_trigger$current$clos = _trigger$current.close) === null || _trigger$current$clos === void 0 || _trigger$current$clos.call(_trigger$current);
|
|
235
235
|
});
|
|
236
236
|
var updateValue = function updateValue(event, date, closeOverlay) {
|
|
237
237
|
if (closeOverlay === void 0) {
|
|
@@ -241,7 +241,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
241
241
|
setCalendarDate(nextValue || startOfToday());
|
|
242
242
|
setValue(nextValue);
|
|
243
243
|
if (nextValue !== value) {
|
|
244
|
-
onChange === null || onChange === void 0
|
|
244
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
// `closeOverlay` default value is `true`
|
|
@@ -257,7 +257,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
257
257
|
var value = range.value;
|
|
258
258
|
updateValue(event, value, closeOverlay);
|
|
259
259
|
handleDateChange(value, event);
|
|
260
|
-
onShortcutClick === null || onShortcutClick === void 0
|
|
260
|
+
onShortcutClick === null || onShortcutClick === void 0 || onShortcutClick(range, event);
|
|
261
261
|
});
|
|
262
262
|
|
|
263
263
|
/**
|
|
@@ -265,7 +265,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
265
265
|
*/
|
|
266
266
|
var handleOK = useEventCallback(function (event) {
|
|
267
267
|
updateValue(event);
|
|
268
|
-
onOk === null || onOk === void 0
|
|
268
|
+
onOk === null || onOk === void 0 || onOk(calendarDate, event);
|
|
269
269
|
focusInput();
|
|
270
270
|
});
|
|
271
271
|
|
|
@@ -274,10 +274,10 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
274
274
|
*/
|
|
275
275
|
|
|
276
276
|
var handleClean = useEventCallback(function (event) {
|
|
277
|
-
event === null || event === void 0
|
|
277
|
+
event === null || event === void 0 || event.stopPropagation();
|
|
278
278
|
updateValue(event, null);
|
|
279
279
|
resetCalendarDate(null);
|
|
280
|
-
onClean === null || onClean === void 0
|
|
280
|
+
onClean === null || onClean === void 0 || onClean(event);
|
|
281
281
|
});
|
|
282
282
|
var handlePickerPopupKeyDown = useEventCallback(function (event) {
|
|
283
283
|
onKeyFocusEvent(event, {
|
|
@@ -350,7 +350,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
350
350
|
}
|
|
351
351
|
} else {
|
|
352
352
|
var _trigger$current3;
|
|
353
|
-
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0
|
|
353
|
+
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0 || _trigger$current3.open();
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
});
|
|
@@ -452,7 +452,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
452
452
|
resetCalendarDate();
|
|
453
453
|
}
|
|
454
454
|
setMonthView(false);
|
|
455
|
-
(_props$onClose = props.onClose) === null || _props$onClose === void 0
|
|
455
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
456
456
|
});
|
|
457
457
|
var showCleanButton = cleanable && hasValue && !readOnly;
|
|
458
458
|
var _partitionHTMLProps = partitionHTMLProps(restProps, {
|
|
@@ -48,7 +48,7 @@ var PredefinedRanges = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
48
48
|
if (disabled) {
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
onShortcutClick === null || onShortcutClick === void 0
|
|
51
|
+
onShortcutClick === null || onShortcutClick === void 0 || onShortcutClick(range, closeOverlay !== false ? true : false, event);
|
|
52
52
|
};
|
|
53
53
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
54
54
|
appearance: "link",
|
|
@@ -46,7 +46,7 @@ function useFocus(props) {
|
|
|
46
46
|
delay(function () {
|
|
47
47
|
var container = getOverlayContainer();
|
|
48
48
|
var selectedElement = container === null || container === void 0 ? void 0 : container.querySelector('[aria-selected="true"]');
|
|
49
|
-
selectedElement === null || selectedElement === void 0
|
|
49
|
+
selectedElement === null || selectedElement === void 0 || selectedElement.focus();
|
|
50
50
|
}, 1);
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -11,7 +11,7 @@ function useMonthView(props) {
|
|
|
11
11
|
* The callback triggered after the month selection box is opened or closed.
|
|
12
12
|
*/
|
|
13
13
|
var toggleMonthView = useEventCallback(function (show) {
|
|
14
|
-
onToggleMonthDropdown === null || onToggleMonthDropdown === void 0
|
|
14
|
+
onToggleMonthDropdown === null || onToggleMonthDropdown === void 0 || onToggleMonthDropdown(show);
|
|
15
15
|
setMonthView(show);
|
|
16
16
|
});
|
|
17
17
|
return {
|
|
@@ -104,7 +104,7 @@ var DateRangeInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
104
104
|
var setSelectionRange = useInputSelection(inputRef);
|
|
105
105
|
var handleChange = useEventCallback(function (date, event) {
|
|
106
106
|
var nextValue = dateType === DateType.Start ? [date, value === null || value === void 0 ? void 0 : value[1]] : [value === null || value === void 0 ? void 0 : value[0], date];
|
|
107
|
-
onChange === null || onChange === void 0
|
|
107
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
108
108
|
setValue(nextValue);
|
|
109
109
|
});
|
|
110
110
|
var handleClear = useEventCallback(function (event) {
|
|
@@ -113,7 +113,7 @@ var DateRangeInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
113
113
|
setSelectionRange(0, 0);
|
|
114
114
|
reset();
|
|
115
115
|
setValue(null);
|
|
116
|
-
onChange === null || onChange === void 0
|
|
116
|
+
onChange === null || onChange === void 0 || onChange(null, event);
|
|
117
117
|
});
|
|
118
118
|
var onSegmentChange = useEventCallback(function (event, nextDirection) {
|
|
119
119
|
var input = event.target;
|
|
@@ -240,12 +240,12 @@ var DateRangeInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
240
240
|
end = _ref[1];
|
|
241
241
|
if (isValid(start) && isValid(end)) {
|
|
242
242
|
var nextValue = [start, end];
|
|
243
|
-
onChange === null || onChange === void 0
|
|
243
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
244
244
|
setValue(nextValue);
|
|
245
245
|
startDateState.setNewDate(start);
|
|
246
246
|
endDateState.setNewDate(end);
|
|
247
247
|
}
|
|
248
|
-
onPaste === null || onPaste === void 0
|
|
248
|
+
onPaste === null || onPaste === void 0 || onPaste(event);
|
|
249
249
|
});
|
|
250
250
|
var onKeyboardInput = useKeyboardInputEvent({
|
|
251
251
|
onSegmentChange: onSegmentChange,
|
|
@@ -290,7 +290,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
290
290
|
setSelectedDates(nextValue !== null && nextValue !== void 0 ? nextValue : []);
|
|
291
291
|
setValue(nextValue);
|
|
292
292
|
if (!isSameRange(nextValue, value, formatStr)) {
|
|
293
|
-
onChange === null || onChange === void 0
|
|
293
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
// `closeOverlay` default value is `true`
|
|
@@ -341,7 +341,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
341
341
|
// in `oneTap` mode
|
|
342
342
|
if (oneTap) {
|
|
343
343
|
setDateRange(event, noHoverRangeValid ? [startOfDay(date), endOfDay(date)] : hoverRangeValue);
|
|
344
|
-
onSelect === null || onSelect === void 0
|
|
344
|
+
onSelect === null || onSelect === void 0 || onSelect(date, event);
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
347
|
|
|
@@ -394,7 +394,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
394
394
|
eventName: 'changeDate'
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
onSelect === null || onSelect === void 0
|
|
397
|
+
onSelect === null || onSelect === void 0 || onSelect(date, event);
|
|
398
398
|
setSelectedIdle(!isSelectedIdle);
|
|
399
399
|
});
|
|
400
400
|
|
|
@@ -477,7 +477,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
477
477
|
} else {
|
|
478
478
|
setSelectedDates(value !== null && value !== void 0 ? value : []);
|
|
479
479
|
}
|
|
480
|
-
onShortcutClick === null || onShortcutClick === void 0
|
|
480
|
+
onShortcutClick === null || onShortcutClick === void 0 || onShortcutClick(range, event);
|
|
481
481
|
|
|
482
482
|
// End unfinished selections.
|
|
483
483
|
setSelectedIdle(true);
|
|
@@ -495,14 +495,14 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
495
495
|
var handleClickOK = useEventCallback(function (event) {
|
|
496
496
|
var nextValue = calculateDateRange();
|
|
497
497
|
setDateRange(event, nextValue);
|
|
498
|
-
onOk === null || onOk === void 0
|
|
498
|
+
onOk === null || onOk === void 0 || onOk(nextValue, event);
|
|
499
499
|
});
|
|
500
500
|
var handleClean = useEventCallback(function (event) {
|
|
501
501
|
setCalendarDateRange({
|
|
502
502
|
dateRange: null
|
|
503
503
|
});
|
|
504
504
|
setDateRange(event, null);
|
|
505
|
-
onClean === null || onClean === void 0
|
|
505
|
+
onClean === null || onClean === void 0 || onClean(event);
|
|
506
506
|
event.stopPropagation();
|
|
507
507
|
});
|
|
508
508
|
|
|
@@ -598,7 +598,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
598
598
|
};
|
|
599
599
|
var handleClose = useEventCallback(function () {
|
|
600
600
|
var _trigger$current, _trigger$current$clos;
|
|
601
|
-
(_trigger$current = trigger.current) === null || _trigger$current === void 0
|
|
601
|
+
(_trigger$current = trigger.current) === null || _trigger$current === void 0 || (_trigger$current$clos = _trigger$current.close) === null || _trigger$current$clos === void 0 || _trigger$current$clos.call(_trigger$current);
|
|
602
602
|
});
|
|
603
603
|
var handleInputKeyDown = useEventCallback(function (event) {
|
|
604
604
|
onMenuKeyDown(event, {
|
|
@@ -609,7 +609,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
609
609
|
open = _ref4.open;
|
|
610
610
|
if (!open) {
|
|
611
611
|
var _trigger$current3;
|
|
612
|
-
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0
|
|
612
|
+
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0 || _trigger$current3.open();
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
});
|
|
@@ -12,19 +12,19 @@ export function useCalendarHandlers(_ref) {
|
|
|
12
12
|
return calendarDateRange[index];
|
|
13
13
|
}, [calendarDateRange, index]);
|
|
14
14
|
var handleSelect = useEventCallback(function (date, event) {
|
|
15
|
-
onSelect === null || onSelect === void 0
|
|
15
|
+
onSelect === null || onSelect === void 0 || onSelect(index, date, event);
|
|
16
16
|
});
|
|
17
17
|
var handleChangeMonth = useEventCallback(function (nextPageDate) {
|
|
18
|
-
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0
|
|
18
|
+
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0 || onChangeCalendarMonth(index, nextPageDate);
|
|
19
19
|
});
|
|
20
20
|
var handleChangeTime = useEventCallback(function (nextPageDate) {
|
|
21
|
-
onChangeCalendarTime === null || onChangeCalendarTime === void 0
|
|
21
|
+
onChangeCalendarTime === null || onChangeCalendarTime === void 0 || onChangeCalendarTime(index, nextPageDate);
|
|
22
22
|
});
|
|
23
23
|
var handleMoveForward = useEventCallback(function () {
|
|
24
|
-
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0
|
|
24
|
+
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0 || onChangeCalendarMonth(index, addMonths(calendarDate, 1));
|
|
25
25
|
});
|
|
26
26
|
var handleMoveBackward = useEventCallback(function () {
|
|
27
|
-
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0
|
|
27
|
+
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0 || onChangeCalendarMonth(index, addMonths(calendarDate, -1));
|
|
28
28
|
});
|
|
29
29
|
return {
|
|
30
30
|
calendarDate: calendarDate,
|
package/esm/Dropdown/Dropdown.js
CHANGED
|
@@ -136,11 +136,11 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
136
136
|
}, popupProps), children);
|
|
137
137
|
},
|
|
138
138
|
onToggleMenu: function onToggleMenu(open) {
|
|
139
|
-
onToggle === null || onToggle === void 0
|
|
139
|
+
onToggle === null || onToggle === void 0 || onToggle(open);
|
|
140
140
|
if (open) {
|
|
141
|
-
onOpen === null || onOpen === void 0
|
|
141
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
142
142
|
} else {
|
|
143
|
-
onClose === null || onClose === void 0
|
|
143
|
+
onClose === null || onClose === void 0 || onClose();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}, function (_ref2, menuContainerRef) {
|
|
@@ -49,8 +49,8 @@ var DropdownItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
49
49
|
prefix = _useClassNames.prefix;
|
|
50
50
|
var handleSelectItem = useCallback(function (event) {
|
|
51
51
|
var _dropdown$onSelect;
|
|
52
|
-
onSelect === null || onSelect === void 0
|
|
53
|
-
dropdown === null || dropdown === void 0
|
|
52
|
+
onSelect === null || onSelect === void 0 || onSelect(eventKey, event);
|
|
53
|
+
dropdown === null || dropdown === void 0 || (_dropdown$onSelect = dropdown.onSelect) === null || _dropdown$onSelect === void 0 || _dropdown$onSelect.call(dropdown, eventKey, event);
|
|
54
54
|
}, [onSelect, eventKey, dropdown]);
|
|
55
55
|
var selected = activeProp || !isNil(eventKey) && shallowEqual(dropdown === null || dropdown === void 0 ? void 0 : dropdown.activeKey, eventKey);
|
|
56
56
|
var dispatch = dropdown === null || dropdown === void 0 ? void 0 : dropdown.dispatch;
|
|
@@ -58,7 +58,7 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
58
58
|
var _useCustom = useCustom(),
|
|
59
59
|
rtl = _useCustom.rtl;
|
|
60
60
|
var handleToggleSubmenu = useCallback(function (_, event) {
|
|
61
|
-
onToggle === null || onToggle === void 0
|
|
61
|
+
onToggle === null || onToggle === void 0 || onToggle(eventKey, event);
|
|
62
62
|
}, [eventKey, onToggle]);
|
|
63
63
|
var _useClassNames = useClassNames(classPrefix),
|
|
64
64
|
merge = _useClassNames.merge,
|
package/esm/Form/Form.js
CHANGED
|
@@ -99,17 +99,17 @@ var Form = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
99
99
|
var submit = useEventCallback(function (event) {
|
|
100
100
|
// Check the form before submitting
|
|
101
101
|
if (check()) {
|
|
102
|
-
onSubmit === null || onSubmit === void 0
|
|
102
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(formValue, event);
|
|
103
103
|
}
|
|
104
104
|
});
|
|
105
105
|
var reset = useEventCallback(function (event) {
|
|
106
106
|
resetErrors();
|
|
107
|
-
onReset === null || onReset === void 0
|
|
107
|
+
onReset === null || onReset === void 0 || onReset(resetFormValue(), event);
|
|
108
108
|
});
|
|
109
109
|
var handleSubmit = useEventCallback(function (event) {
|
|
110
110
|
var _event$preventDefault, _event$stopPropagatio;
|
|
111
|
-
event === null || event === void 0
|
|
112
|
-
event === null || event === void 0
|
|
111
|
+
event === null || event === void 0 || (_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0 || _event$preventDefault.call(event);
|
|
112
|
+
event === null || event === void 0 || (_event$stopPropagatio = event.stopPropagation) === null || _event$stopPropagatio === void 0 || _event$stopPropagatio.call(event);
|
|
113
113
|
|
|
114
114
|
// Prevent submission when the form is disabled, readOnly, or plaintext
|
|
115
115
|
if (disabled || readOnly || plaintext) {
|
|
@@ -119,8 +119,8 @@ var Form = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
119
119
|
});
|
|
120
120
|
var handleReset = useEventCallback(function (event) {
|
|
121
121
|
var _event$preventDefault2, _event$stopPropagatio2;
|
|
122
|
-
event === null || event === void 0
|
|
123
|
-
event === null || event === void 0
|
|
122
|
+
event === null || event === void 0 || (_event$preventDefault2 = event.preventDefault) === null || _event$preventDefault2 === void 0 || _event$preventDefault2.call(event);
|
|
123
|
+
event === null || event === void 0 || (_event$stopPropagatio2 = event.stopPropagation) === null || _event$stopPropagatio2 === void 0 || _event$stopPropagatio2.call(event);
|
|
124
124
|
|
|
125
125
|
// Prevent reset when the form is disabled, readOnly, or plaintext
|
|
126
126
|
if (disabled || readOnly || plaintext) {
|
|
@@ -144,14 +144,14 @@ var Form = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
144
144
|
});
|
|
145
145
|
var removeFieldValue = useEventCallback(function (name) {
|
|
146
146
|
var formValue = onRemoveValue(name);
|
|
147
|
-
onChange === null || onChange === void 0
|
|
147
|
+
onChange === null || onChange === void 0 || onChange(formValue);
|
|
148
148
|
});
|
|
149
149
|
var removeFieldError = useEventCallback(function (name) {
|
|
150
150
|
onRemoveError(name);
|
|
151
151
|
});
|
|
152
152
|
var onFieldChange = useEventCallback(function (name, value, event) {
|
|
153
153
|
var nextFormValue = setFieldValue(name, value);
|
|
154
|
-
onChange === null || onChange === void 0
|
|
154
|
+
onChange === null || onChange === void 0 || onChange(nextFormValue, event);
|
|
155
155
|
});
|
|
156
156
|
var formContextValue = {
|
|
157
157
|
errorFromContext: errorFromContext,
|
|
@@ -32,7 +32,7 @@ export default function useFormValidate(_formError, props) {
|
|
|
32
32
|
var formError = {};
|
|
33
33
|
var errorCount = 0;
|
|
34
34
|
var model = getCombinedModel();
|
|
35
|
-
var
|
|
35
|
+
var _checkField = function checkField(key, type, value, formErrorObj) {
|
|
36
36
|
model.setSchemaOptionsForAllType(formValue || {});
|
|
37
37
|
var checkResult = type.check(value, formValue, key);
|
|
38
38
|
if (checkResult.hasError === true) {
|
|
@@ -48,20 +48,20 @@ export default function useFormValidate(_formError, props) {
|
|
|
48
48
|
formErrorObj[key] = formErrorObj[key] || {
|
|
49
49
|
object: {}
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
_checkField(nestedKey, nestedType, value === null || value === void 0 ? void 0 : value[nestedKey], formErrorObj[key].object);
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
55
|
Object.entries(model.getSchemaSpec()).forEach(function (_ref2) {
|
|
56
56
|
var key = _ref2[0],
|
|
57
57
|
type = _ref2[1];
|
|
58
|
-
|
|
58
|
+
_checkField(key, type, formValue[key], formError);
|
|
59
59
|
});
|
|
60
60
|
setFormError(formError);
|
|
61
|
-
onCheck === null || onCheck === void 0
|
|
62
|
-
callback === null || callback === void 0
|
|
61
|
+
onCheck === null || onCheck === void 0 || onCheck(formError);
|
|
62
|
+
callback === null || callback === void 0 || callback(formError);
|
|
63
63
|
if (errorCount > 0) {
|
|
64
|
-
onError === null || onError === void 0
|
|
64
|
+
onError === null || onError === void 0 || onError(formError);
|
|
65
65
|
return false;
|
|
66
66
|
}
|
|
67
67
|
return true;
|
|
@@ -78,10 +78,10 @@ export default function useFormValidate(_formError, props) {
|
|
|
78
78
|
if (nestedField) {
|
|
79
79
|
nextFormError = set(nextFormError, nameToPath(fieldName), resultOfCurrentField);
|
|
80
80
|
setFormError(nextFormError);
|
|
81
|
-
onCheck === null || onCheck === void 0
|
|
82
|
-
callback === null || callback === void 0
|
|
81
|
+
onCheck === null || onCheck === void 0 || onCheck(nextFormError);
|
|
82
|
+
callback === null || callback === void 0 || callback(resultOfCurrentField);
|
|
83
83
|
if (resultOfCurrentField.hasError) {
|
|
84
|
-
onError === null || onError === void 0
|
|
84
|
+
onError === null || onError === void 0 || onError(nextFormError);
|
|
85
85
|
}
|
|
86
86
|
return !resultOfCurrentField.hasError;
|
|
87
87
|
} else {
|
|
@@ -101,10 +101,10 @@ export default function useFormValidate(_formError, props) {
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
setFormError(nextFormError);
|
|
104
|
-
onCheck === null || onCheck === void 0
|
|
105
|
-
callback === null || callback === void 0
|
|
104
|
+
onCheck === null || onCheck === void 0 || onCheck(nextFormError);
|
|
105
|
+
callback === null || callback === void 0 || callback(resultOfCurrentField);
|
|
106
106
|
if (hasError) {
|
|
107
|
-
onError === null || onError === void 0
|
|
107
|
+
onError === null || onError === void 0 || onError(nextFormError);
|
|
108
108
|
}
|
|
109
109
|
return !hasError;
|
|
110
110
|
}
|
|
@@ -138,10 +138,10 @@ export default function useFormValidate(_formError, props) {
|
|
|
138
138
|
formError[keys[i]] = values[i].errorMessage;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
onCheck === null || onCheck === void 0
|
|
141
|
+
onCheck === null || onCheck === void 0 || onCheck(formError);
|
|
142
142
|
setFormError(formError);
|
|
143
143
|
if (errorCount > 0) {
|
|
144
|
-
onError === null || onError === void 0
|
|
144
|
+
onError === null || onError === void 0 || onError(formError);
|
|
145
145
|
}
|
|
146
146
|
return {
|
|
147
147
|
hasError: errorCount > 0,
|
|
@@ -161,10 +161,10 @@ export default function useFormValidate(_formError, props) {
|
|
|
161
161
|
|
|
162
162
|
if (nestedField) {
|
|
163
163
|
nextFormError = set(nextFormError, nameToPath(fieldName), resultOfCurrentField);
|
|
164
|
-
onCheck === null || onCheck === void 0
|
|
164
|
+
onCheck === null || onCheck === void 0 || onCheck(nextFormError);
|
|
165
165
|
setFormError(nextFormError);
|
|
166
166
|
if (resultOfCurrentField.hasError) {
|
|
167
|
-
onError === null || onError === void 0
|
|
167
|
+
onError === null || onError === void 0 || onError(nextFormError);
|
|
168
168
|
}
|
|
169
169
|
return resultOfCurrentField;
|
|
170
170
|
} else {
|
|
@@ -184,9 +184,9 @@ export default function useFormValidate(_formError, props) {
|
|
|
184
184
|
}
|
|
185
185
|
});
|
|
186
186
|
setFormError(nextFormError);
|
|
187
|
-
onCheck === null || onCheck === void 0
|
|
187
|
+
onCheck === null || onCheck === void 0 || onCheck(nextFormError);
|
|
188
188
|
if (hasError) {
|
|
189
|
-
onError === null || onError === void 0
|
|
189
|
+
onError === null || onError === void 0 || onError(nextFormError);
|
|
190
190
|
}
|
|
191
191
|
return resultOfCurrentField;
|
|
192
192
|
}
|
|
@@ -208,7 +208,7 @@ export default function useFormValidate(_formError, props) {
|
|
|
208
208
|
var formError = omit(realFormErrorRef.current, [nestedField ? nameToPath(name) : name]);
|
|
209
209
|
realFormErrorRef.current = formError;
|
|
210
210
|
setFormError(formError);
|
|
211
|
-
onCheck === null || onCheck === void 0
|
|
211
|
+
onCheck === null || onCheck === void 0 || onCheck(formError);
|
|
212
212
|
return formError;
|
|
213
213
|
}, [nestedField, onCheck, setFormError]);
|
|
214
214
|
var cleanErrors = useEventCallback(function () {
|
|
@@ -81,8 +81,8 @@ var FormControl = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
81
81
|
useRegisterModel(name, rule);
|
|
82
82
|
useWillUnmount(function () {
|
|
83
83
|
if (shouldResetWithUnmount) {
|
|
84
|
-
removeFieldValue === null || removeFieldValue === void 0
|
|
85
|
-
removeFieldError === null || removeFieldError === void 0
|
|
84
|
+
removeFieldValue === null || removeFieldValue === void 0 || removeFieldValue(name);
|
|
85
|
+
removeFieldError === null || removeFieldError === void 0 || removeFieldError(name);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
var trigger = checkTrigger || contextCheckTrigger;
|
|
@@ -107,14 +107,14 @@ var FormControl = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
107
107
|
if (trigger === 'change') {
|
|
108
108
|
handleFieldCheck(value);
|
|
109
109
|
}
|
|
110
|
-
onFieldChange === null || onFieldChange === void 0
|
|
111
|
-
onChange === null || onChange === void 0
|
|
110
|
+
onFieldChange === null || onFieldChange === void 0 || onFieldChange(name, value, event);
|
|
111
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
112
112
|
});
|
|
113
113
|
var handleFieldBlur = useEventCallback(function (event) {
|
|
114
114
|
if (trigger === 'blur') {
|
|
115
115
|
handleFieldCheck(fieldValue);
|
|
116
116
|
}
|
|
117
|
-
onBlur === null || onBlur === void 0
|
|
117
|
+
onBlur === null || onBlur === void 0 || onBlur(event);
|
|
118
118
|
});
|
|
119
119
|
var handleFieldCheck = useEventCallback(function (value) {
|
|
120
120
|
var nextFormValue = setFieldValue(name, value);
|
|
@@ -17,7 +17,7 @@ function getErrorMessage(error) {
|
|
|
17
17
|
if (error !== null && error !== void 0 && error.array && ((_error$array = error.array) === null || _error$array === void 0 ? void 0 : _error$array.length) > 0) {
|
|
18
18
|
return error.array[0].errorMessage;
|
|
19
19
|
}
|
|
20
|
-
if (
|
|
20
|
+
if (/*#__PURE__*/isValidElement(error)) {
|
|
21
21
|
return error;
|
|
22
22
|
}
|
|
23
23
|
return error === null || error === void 0 ? void 0 : error.errorMessage;
|
|
@@ -8,9 +8,9 @@ function useRegisterModel(name, rule) {
|
|
|
8
8
|
var refRule = useRef(rule);
|
|
9
9
|
refRule.current = rule;
|
|
10
10
|
useEffect(function () {
|
|
11
|
-
pushFieldRule === null || pushFieldRule === void 0
|
|
11
|
+
pushFieldRule === null || pushFieldRule === void 0 || pushFieldRule(name, refRule);
|
|
12
12
|
return function () {
|
|
13
|
-
removeFieldRule === null || removeFieldRule === void 0
|
|
13
|
+
removeFieldRule === null || removeFieldRule === void 0 || removeFieldRule(name);
|
|
14
14
|
};
|
|
15
15
|
}, [name, pushFieldRule, removeFieldRule]);
|
|
16
16
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import type { WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
3
|
+
export interface ImageProps extends WithAsProps, Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'placeholder'> {
|
|
4
|
+
/**
|
|
5
|
+
* An image may appear with border.
|
|
6
|
+
*/
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* An image may appear circular.
|
|
10
|
+
*/
|
|
11
|
+
circle?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The fallback image when the src fails to load.
|
|
14
|
+
*/
|
|
15
|
+
fallbackSrc?: string;
|
|
16
|
+
/**
|
|
17
|
+
* An image may appear rounded.
|
|
18
|
+
*/
|
|
19
|
+
rounded?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether there is a shadow.
|
|
22
|
+
*/
|
|
23
|
+
shaded?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* It maps to css `object-fit` property.
|
|
26
|
+
*/
|
|
27
|
+
fit?: CSSProperties['objectFit'];
|
|
28
|
+
/**
|
|
29
|
+
* It maps to css `object-position` property.
|
|
30
|
+
*/
|
|
31
|
+
position?: CSSProperties['objectPosition'];
|
|
32
|
+
/**
|
|
33
|
+
* The placeholder to display when the image is loading.
|
|
34
|
+
*/
|
|
35
|
+
placeholder?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the image should be zoomed when hovered.
|
|
38
|
+
*/
|
|
39
|
+
zoomed?: boolean;
|
|
40
|
+
}
|
|
41
|
+
declare const Image: RsRefForwardingComponent<'img', ImageProps>;
|
|
42
|
+
export default Image;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
var _excluded = ["as", "bordered", "classPrefix", "className", "circle", "crossOrigin", "fit", "fallbackSrc", "loading", "rounded", "srcSet", "sizes", "shaded", "src", "style", "position", "placeholder", "width", "height", "zoomed"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { useClassNames } from "../internals/hooks/index.js";
|
|
8
|
+
import { ImageWrapper } from "./ImageWrapper.js";
|
|
9
|
+
import { useImage } from "./hooks/useImage.js";
|
|
10
|
+
import { useCustom } from "../CustomProvider/index.js";
|
|
11
|
+
var Image = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
|
+
var _extends2;
|
|
13
|
+
var _useCustom = useCustom('Image', props),
|
|
14
|
+
propsWithDefaults = _useCustom.propsWithDefaults;
|
|
15
|
+
var _propsWithDefaults$as = propsWithDefaults.as,
|
|
16
|
+
Component = _propsWithDefaults$as === void 0 ? 'img' : _propsWithDefaults$as,
|
|
17
|
+
bordered = propsWithDefaults.bordered,
|
|
18
|
+
_propsWithDefaults$cl = propsWithDefaults.classPrefix,
|
|
19
|
+
classPrefix = _propsWithDefaults$cl === void 0 ? 'image' : _propsWithDefaults$cl,
|
|
20
|
+
className = propsWithDefaults.className,
|
|
21
|
+
circle = propsWithDefaults.circle,
|
|
22
|
+
crossOrigin = propsWithDefaults.crossOrigin,
|
|
23
|
+
fit = propsWithDefaults.fit,
|
|
24
|
+
fallbackSrc = propsWithDefaults.fallbackSrc,
|
|
25
|
+
loading = propsWithDefaults.loading,
|
|
26
|
+
rounded = propsWithDefaults.rounded,
|
|
27
|
+
srcSet = propsWithDefaults.srcSet,
|
|
28
|
+
sizes = propsWithDefaults.sizes,
|
|
29
|
+
shaded = propsWithDefaults.shaded,
|
|
30
|
+
src = propsWithDefaults.src,
|
|
31
|
+
style = propsWithDefaults.style,
|
|
32
|
+
position = propsWithDefaults.position,
|
|
33
|
+
placeholder = propsWithDefaults.placeholder,
|
|
34
|
+
width = propsWithDefaults.width,
|
|
35
|
+
height = propsWithDefaults.height,
|
|
36
|
+
zoomed = propsWithDefaults.zoomed,
|
|
37
|
+
rest = _objectWithoutPropertiesLoose(propsWithDefaults, _excluded);
|
|
38
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
39
|
+
merge = _useClassNames.merge,
|
|
40
|
+
withClassPrefix = _useClassNames.withClassPrefix;
|
|
41
|
+
var classes = merge(className, withClassPrefix({
|
|
42
|
+
circle: circle,
|
|
43
|
+
bordered: bordered,
|
|
44
|
+
rounded: rounded,
|
|
45
|
+
shaded: shaded,
|
|
46
|
+
zoomed: zoomed
|
|
47
|
+
}));
|
|
48
|
+
var imgProps = {
|
|
49
|
+
crossOrigin: crossOrigin,
|
|
50
|
+
srcSet: srcSet,
|
|
51
|
+
sizes: sizes,
|
|
52
|
+
loading: loading
|
|
53
|
+
};
|
|
54
|
+
var _useImage = useImage(_extends({
|
|
55
|
+
src: src,
|
|
56
|
+
fallbackSrc: fallbackSrc
|
|
57
|
+
}, imgProps)),
|
|
58
|
+
imgSrc = _useImage.imgSrc,
|
|
59
|
+
isLoading = _useImage.isLoading;
|
|
60
|
+
var styles = _extends({}, style, (_extends2 = {}, _extends2['--rs-object-fit'] = fit, _extends2['--rs-object-position'] = position, _extends2));
|
|
61
|
+
var wrapStyles = {
|
|
62
|
+
width: width,
|
|
63
|
+
height: height
|
|
64
|
+
};
|
|
65
|
+
var image = /*#__PURE__*/React.createElement(Component, _extends({
|
|
66
|
+
ref: ref,
|
|
67
|
+
src: imgSrc,
|
|
68
|
+
className: classes,
|
|
69
|
+
style: styles,
|
|
70
|
+
width: width,
|
|
71
|
+
height: height
|
|
72
|
+
}, imgProps, rest));
|
|
73
|
+
if (zoomed) {
|
|
74
|
+
return /*#__PURE__*/React.createElement(ImageWrapper, {
|
|
75
|
+
style: wrapStyles
|
|
76
|
+
}, image);
|
|
77
|
+
}
|
|
78
|
+
if (placeholder) {
|
|
79
|
+
return /*#__PURE__*/React.createElement(ImageWrapper, {
|
|
80
|
+
style: wrapStyles
|
|
81
|
+
}, isLoading && placeholder, image);
|
|
82
|
+
}
|
|
83
|
+
return image;
|
|
84
|
+
});
|
|
85
|
+
Image.displayName = 'Image';
|
|
86
|
+
Image.propTypes = {
|
|
87
|
+
bordered: PropTypes.bool,
|
|
88
|
+
circle: PropTypes.bool,
|
|
89
|
+
fallbackSrc: PropTypes.string,
|
|
90
|
+
fit: PropTypes.string,
|
|
91
|
+
position: PropTypes.string,
|
|
92
|
+
rounded: PropTypes.bool,
|
|
93
|
+
shaded: PropTypes.bool,
|
|
94
|
+
placeholder: PropTypes.node,
|
|
95
|
+
zoomed: PropTypes.bool
|
|
96
|
+
};
|
|
97
|
+
export default Image;
|