rsuite 5.74.2 → 5.75.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 +16 -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/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 +4 -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 +8 -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/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 +8 -0
- package/cjs/index.js +10 -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/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 +240 -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 +240 -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 +240 -36
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +240 -36
- package/dist/rsuite.js +384 -175
- 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 +4 -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 +8 -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/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 +8 -0
- package/esm/index.js +4 -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/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 +4 -0
- package/toaster/styles/index.css +24 -24
- package/toaster/styles/index.less +29 -29
- package/useToaster/styles/index.css +24 -24
|
@@ -39,7 +39,7 @@ function shouldDisplay(label, searchKeyword) {
|
|
|
39
39
|
var keyword = searchKeyword.toLocaleLowerCase();
|
|
40
40
|
if (typeof label === 'string' || typeof label === 'number') {
|
|
41
41
|
return ("" + label).toLocaleLowerCase().indexOf(keyword) >= 0;
|
|
42
|
-
} else if (
|
|
42
|
+
} else if (/*#__PURE__*/_react.default.isValidElement(label)) {
|
|
43
43
|
var nodes = (0, _utils2.reactToString)(label);
|
|
44
44
|
return nodes.join('').toLocaleLowerCase().indexOf(keyword) >= 0;
|
|
45
45
|
}
|
|
@@ -61,35 +61,35 @@ function onMenuKeyDown(event, events) {
|
|
|
61
61
|
switch (event.key) {
|
|
62
62
|
// down
|
|
63
63
|
case _constants.KEY_VALUES.DOWN:
|
|
64
|
-
down === null || down === void 0
|
|
64
|
+
down === null || down === void 0 || down(event);
|
|
65
65
|
event.preventDefault();
|
|
66
66
|
break;
|
|
67
67
|
// up
|
|
68
68
|
case _constants.KEY_VALUES.UP:
|
|
69
|
-
up === null || up === void 0
|
|
69
|
+
up === null || up === void 0 || up(event);
|
|
70
70
|
event.preventDefault();
|
|
71
71
|
break;
|
|
72
72
|
// enter
|
|
73
73
|
case _constants.KEY_VALUES.ENTER:
|
|
74
|
-
enter === null || enter === void 0
|
|
74
|
+
enter === null || enter === void 0 || enter(event);
|
|
75
75
|
event.preventDefault();
|
|
76
76
|
break;
|
|
77
77
|
// delete
|
|
78
78
|
case _constants.KEY_VALUES.BACKSPACE:
|
|
79
|
-
del === null || del === void 0
|
|
79
|
+
del === null || del === void 0 || del(event);
|
|
80
80
|
break;
|
|
81
81
|
// esc | tab
|
|
82
82
|
case _constants.KEY_VALUES.ESC:
|
|
83
83
|
case _constants.KEY_VALUES.TAB:
|
|
84
|
-
esc === null || esc === void 0
|
|
84
|
+
esc === null || esc === void 0 || esc(event);
|
|
85
85
|
break;
|
|
86
86
|
// left arrow
|
|
87
87
|
case _constants.KEY_VALUES.LEFT:
|
|
88
|
-
left === null || left === void 0
|
|
88
|
+
left === null || left === void 0 || left(event);
|
|
89
89
|
break;
|
|
90
90
|
// right arrow
|
|
91
91
|
case _constants.KEY_VALUES.RIGHT:
|
|
92
|
-
right === null || right === void 0
|
|
92
|
+
right === null || right === void 0 || right(event);
|
|
93
93
|
break;
|
|
94
94
|
default:
|
|
95
95
|
}
|
|
@@ -67,7 +67,7 @@ var Ripple = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
67
67
|
var _position = getPosition(triggerRef.current, event);
|
|
68
68
|
setRippling(true);
|
|
69
69
|
setPosition(_position);
|
|
70
|
-
onMouseDown === null || onMouseDown === void 0
|
|
70
|
+
onMouseDown === null || onMouseDown === void 0 || onMouseDown(_position, event);
|
|
71
71
|
}
|
|
72
72
|
}, [onMouseDown]);
|
|
73
73
|
(0, _react.useEffect)(function () {
|
|
@@ -76,7 +76,7 @@ var Ripple = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
76
76
|
if (parentNode) {
|
|
77
77
|
var mousedownListener = (0, _on.default)(parentNode, 'mousedown', handleMouseDown);
|
|
78
78
|
return function () {
|
|
79
|
-
mousedownListener === null || mousedownListener === void 0
|
|
79
|
+
mousedownListener === null || mousedownListener === void 0 || mousedownListener.off();
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
}, [handleMouseDown]);
|
|
@@ -47,7 +47,7 @@ function useScrollState(scrollShadow) {
|
|
|
47
47
|
}
|
|
48
48
|
return function () {
|
|
49
49
|
var _observer;
|
|
50
|
-
(_observer = observer) === null || _observer === void 0
|
|
50
|
+
(_observer = observer) === null || _observer === void 0 || _observer.disconnect();
|
|
51
51
|
};
|
|
52
52
|
});
|
|
53
53
|
var handleScroll = (0, _hooks.useEventCallback)(function (event) {
|
|
@@ -6,14 +6,14 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.filterNodesOfTree = filterNodesOfTree;
|
|
7
7
|
var _clone = _interopRequireDefault(require("lodash/clone"));
|
|
8
8
|
function filterNodesOfTree(data, check) {
|
|
9
|
-
var
|
|
9
|
+
var _findNodes = function findNodes(nodes) {
|
|
10
10
|
if (nodes === void 0) {
|
|
11
11
|
nodes = [];
|
|
12
12
|
}
|
|
13
13
|
var nextNodes = [];
|
|
14
14
|
for (var i = 0; i < nodes.length; i += 1) {
|
|
15
15
|
if (Array.isArray(nodes[i].children)) {
|
|
16
|
-
var nextChildren =
|
|
16
|
+
var nextChildren = _findNodes(nodes[i].children);
|
|
17
17
|
if (nextChildren.length) {
|
|
18
18
|
var item = (0, _clone.default)(nodes[i]);
|
|
19
19
|
item.children = nextChildren;
|
|
@@ -27,5 +27,5 @@ function filterNodesOfTree(data, check) {
|
|
|
27
27
|
}
|
|
28
28
|
return nextNodes;
|
|
29
29
|
};
|
|
30
|
-
return
|
|
30
|
+
return _findNodes(data);
|
|
31
31
|
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.findNodeOfTree = findNodeOfTree;
|
|
6
6
|
function findNodeOfTree(data, check) {
|
|
7
|
-
var
|
|
7
|
+
var _findNode = function findNode(nodes) {
|
|
8
8
|
if (nodes === void 0) {
|
|
9
9
|
nodes = [];
|
|
10
10
|
}
|
|
11
11
|
for (var i = 0; i < nodes.length; i += 1) {
|
|
12
12
|
var item = nodes[i];
|
|
13
13
|
if (Array.isArray(item.children)) {
|
|
14
|
-
var node =
|
|
14
|
+
var node = _findNode(item.children);
|
|
15
15
|
if (node) {
|
|
16
16
|
return node;
|
|
17
17
|
}
|
|
@@ -22,5 +22,5 @@ function findNodeOfTree(data, check) {
|
|
|
22
22
|
}
|
|
23
23
|
return undefined;
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return _findNode(data);
|
|
26
26
|
}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports.getKeyParentMap = getKeyParentMap;
|
|
6
6
|
exports.getParentMap = getParentMap;
|
|
7
|
-
function _createForOfIteratorHelperLoose(
|
|
8
|
-
function _unsupportedIterableToArray(
|
|
9
|
-
function _arrayLikeToArray(
|
|
7
|
+
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
10
|
/**
|
|
11
11
|
* Returns a WeakMap that maps each item in `items` to its parent
|
|
12
12
|
* indicated by `getChildren` function
|
|
@@ -57,7 +57,7 @@ var AutoSizer = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
57
57
|
if (!disableHeight && height !== newHeight || !disableWidth && width !== newWidth) {
|
|
58
58
|
setHeight(offsetHeight - paddingTop - paddingBottom);
|
|
59
59
|
setWidth(offsetWidth - paddingLeft - paddingRight);
|
|
60
|
-
onResize === null || onResize === void 0
|
|
60
|
+
onResize === null || onResize === void 0 || onResize({
|
|
61
61
|
height: offsetHeight,
|
|
62
62
|
width: offsetWidth
|
|
63
63
|
});
|
|
@@ -42,19 +42,19 @@ var List = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
42
42
|
return {
|
|
43
43
|
resetAfterIndex: function resetAfterIndex(index, shouldForceUpdate) {
|
|
44
44
|
var _listRef$current, _listRef$current$rese;
|
|
45
|
-
(_listRef$current = listRef.current) === null || _listRef$current === void 0
|
|
45
|
+
(_listRef$current = listRef.current) === null || _listRef$current === void 0 || (_listRef$current$rese = _listRef$current.resetAfterIndex) === null || _listRef$current$rese === void 0 || _listRef$current$rese.call(_listRef$current, index, shouldForceUpdate);
|
|
46
46
|
},
|
|
47
47
|
scrollTo: function scrollTo(scrollOffset) {
|
|
48
48
|
var _listRef$current2, _listRef$current2$scr;
|
|
49
|
-
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0
|
|
49
|
+
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || (_listRef$current2$scr = _listRef$current2.scrollTo) === null || _listRef$current2$scr === void 0 || _listRef$current2$scr.call(_listRef$current2, scrollOffset);
|
|
50
50
|
},
|
|
51
51
|
scrollToItem: function scrollToItem(index, align) {
|
|
52
52
|
var _listRef$current3, _listRef$current3$scr;
|
|
53
|
-
(_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0
|
|
53
|
+
(_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || (_listRef$current3$scr = _listRef$current3.scrollToItem) === null || _listRef$current3$scr === void 0 || _listRef$current3$scr.call(_listRef$current3, index, align);
|
|
54
54
|
},
|
|
55
55
|
scrollToRow: function scrollToRow(index) {
|
|
56
56
|
var _listRef$current4, _listRef$current4$scr;
|
|
57
|
-
(_listRef$current4 = listRef.current) === null || _listRef$current4 === void 0
|
|
57
|
+
(_listRef$current4 = listRef.current) === null || _listRef$current4 === void 0 || (_listRef$current4$scr = _listRef$current4.scrollToItem) === null || _listRef$current4$scr === void 0 || _listRef$current4$scr.call(_listRef$current4, index);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
});
|
|
@@ -22,7 +22,7 @@ function useClickOutside(_ref) {
|
|
|
22
22
|
var _isOutsideRef$current;
|
|
23
23
|
if ((_isOutsideRef$current = isOutsideRef.current) !== null && _isOutsideRef$current !== void 0 && _isOutsideRef$current.call(isOutsideRef, event)) {
|
|
24
24
|
var _handleRef$current;
|
|
25
|
-
(_handleRef$current = handleRef.current) === null || _handleRef$current === void 0
|
|
25
|
+
(_handleRef$current = handleRef.current) === null || _handleRef$current === void 0 || _handleRef$current.call(handleRef, event);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
window.addEventListener('mousedown', eventHandler);
|
|
@@ -25,7 +25,7 @@ function useElementResize(eventTarget, listener) {
|
|
|
25
25
|
}
|
|
26
26
|
return function () {
|
|
27
27
|
var _resizeObserver$curre;
|
|
28
|
-
(_resizeObserver$curre = resizeObserver.current) === null || _resizeObserver$curre === void 0
|
|
28
|
+
(_resizeObserver$curre = resizeObserver.current) === null || _resizeObserver$curre === void 0 || _resizeObserver$curre.disconnect();
|
|
29
29
|
};
|
|
30
30
|
}, [eventTarget, listener]);
|
|
31
31
|
}
|
|
@@ -23,7 +23,7 @@ function useEventListener(eventTarget, event, listener, capture) {
|
|
|
23
23
|
var target = typeof eventTarget === 'function' ? eventTarget() : eventTarget;
|
|
24
24
|
var controller = target ? (0, _on.default)(target, event, listener, capture) : null;
|
|
25
25
|
return function () {
|
|
26
|
-
controller === null || controller === void 0
|
|
26
|
+
controller === null || controller === void 0 || controller.off();
|
|
27
27
|
};
|
|
28
28
|
}, [eventTarget, event, listener, capture]);
|
|
29
29
|
}
|
|
@@ -16,7 +16,7 @@ function useFocus(elementRef) {
|
|
|
16
16
|
if (document.activeElement !== elementRef.current) {
|
|
17
17
|
var _elementRef$current;
|
|
18
18
|
previousActiveElementRef.current = document.activeElement;
|
|
19
|
-
(_elementRef$current = elementRef.current) === null || _elementRef$current === void 0
|
|
19
|
+
(_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 || _elementRef$current.focus();
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}, [elementRef]);
|
|
@@ -25,7 +25,7 @@ function useFocus(elementRef) {
|
|
|
25
25
|
var release = (0, _react.useCallback)(function (options) {
|
|
26
26
|
requestAnimationFrame(function () {
|
|
27
27
|
var _previousActiveElemen;
|
|
28
|
-
(_previousActiveElemen = previousActiveElementRef.current) === null || _previousActiveElemen === void 0
|
|
28
|
+
(_previousActiveElemen = previousActiveElementRef.current) === null || _previousActiveElemen === void 0 || _previousActiveElemen.focus(options);
|
|
29
29
|
});
|
|
30
30
|
}, []);
|
|
31
31
|
return {
|
|
@@ -9,7 +9,7 @@ var useMount = exports.useMount = function useMount(callback) {
|
|
|
9
9
|
mountRef.current = callback;
|
|
10
10
|
(0, _react.useEffect)(function () {
|
|
11
11
|
var _mountRef$current;
|
|
12
|
-
(_mountRef$current = mountRef.current) === null || _mountRef$current === void 0
|
|
12
|
+
(_mountRef$current = mountRef.current) === null || _mountRef$current === void 0 || _mountRef$current.call(mountRef);
|
|
13
13
|
}, []);
|
|
14
14
|
};
|
|
15
15
|
var _default = exports.default = useMount;
|
|
@@ -31,7 +31,7 @@ function useRootClose(onRootClose, _ref) {
|
|
|
31
31
|
listenEscape = _ref$listenEscape === void 0 ? true : _ref$listenEscape;
|
|
32
32
|
var handleDocumentKeyUp = (0, _react.useCallback)(function (event) {
|
|
33
33
|
if (listenEscape && event.key === _constants.KEY_VALUES.ESC) {
|
|
34
|
-
onRootClose === null || onRootClose === void 0
|
|
34
|
+
onRootClose === null || onRootClose === void 0 || onRootClose(event);
|
|
35
35
|
}
|
|
36
36
|
}, [listenEscape, onRootClose]);
|
|
37
37
|
var handleDocumentMouseDown = (0, _react.useCallback)(function (event) {
|
|
@@ -50,7 +50,7 @@ function useRootClose(onRootClose, _ref) {
|
|
|
50
50
|
if (isModifiedEvent(event) || !isLeftClickEvent(event)) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
onRootClose === null || onRootClose === void 0
|
|
53
|
+
onRootClose === null || onRootClose === void 0 || onRootClose(event);
|
|
54
54
|
}, [onRootClose, triggerTarget, overlayTarget]);
|
|
55
55
|
(0, _react.useEffect)(function () {
|
|
56
56
|
var currentTarget = (0, _getDOMNode.default)(triggerTarget);
|
|
@@ -59,8 +59,8 @@ function useRootClose(onRootClose, _ref) {
|
|
|
59
59
|
var onDocumentMouseDownListener = (0, _on.default)(doc, 'mousedown', handleDocumentMouseDown, true);
|
|
60
60
|
var onDocumentKeyupListener = (0, _on.default)(doc, 'keyup', handleDocumentKeyUp);
|
|
61
61
|
return function () {
|
|
62
|
-
onDocumentMouseDownListener === null || onDocumentMouseDownListener === void 0
|
|
63
|
-
onDocumentKeyupListener === null || onDocumentKeyupListener === void 0
|
|
62
|
+
onDocumentMouseDownListener === null || onDocumentMouseDownListener === void 0 || onDocumentMouseDownListener.off();
|
|
63
|
+
onDocumentKeyupListener === null || onDocumentKeyupListener === void 0 || onDocumentKeyupListener.off();
|
|
64
64
|
};
|
|
65
65
|
}, [triggerTarget, disabled, onRootClose, handleDocumentMouseDown, handleDocumentKeyUp]);
|
|
66
66
|
}
|
|
@@ -28,7 +28,7 @@ function useTimeout(fn, ms, enabled) {
|
|
|
28
28
|
if (enabled) {
|
|
29
29
|
timeout.current = setTimeout(function () {
|
|
30
30
|
var _callback$current;
|
|
31
|
-
(_callback$current = callback.current) === null || _callback$current === void 0
|
|
31
|
+
(_callback$current = callback.current) === null || _callback$current === void 0 || _callback$current.call(callback);
|
|
32
32
|
}, ms);
|
|
33
33
|
}
|
|
34
34
|
}, [ms, enabled]);
|
|
@@ -14,16 +14,16 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
14
14
|
*/
|
|
15
15
|
function reactToString(element) {
|
|
16
16
|
var nodes = [];
|
|
17
|
-
var
|
|
17
|
+
var _recursion = function recursion(elmt) {
|
|
18
18
|
_react.default.Children.forEach(elmt.props.children, function (child) {
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (/*#__PURE__*/_react.default.isValidElement(child)) {
|
|
20
|
+
_recursion(child);
|
|
21
21
|
} else if (typeof child === 'string') {
|
|
22
22
|
nodes.push(child);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
_recursion(element);
|
|
27
27
|
return nodes;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -35,7 +35,7 @@ function reactToString(element) {
|
|
|
35
35
|
function stringifyReactNode(node) {
|
|
36
36
|
if (typeof node === 'string') {
|
|
37
37
|
return node;
|
|
38
|
-
} else if (
|
|
38
|
+
} else if (/*#__PURE__*/_react.default.isValidElement(node)) {
|
|
39
39
|
var nodes = reactToString(node);
|
|
40
40
|
return nodes.join('');
|
|
41
41
|
}
|
|
@@ -7,6 +7,7 @@ exports.toastPlacements = exports.default = void 0;
|
|
|
7
7
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactDom = require("react-dom");
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
|
12
13
|
var _Transition = _interopRequireDefault(require("../Animation/Transition"));
|
|
@@ -33,7 +34,8 @@ var useMessages = function useMessages() {
|
|
|
33
34
|
var _ref = options || {},
|
|
34
35
|
duration = _ref.duration,
|
|
35
36
|
_ref$mouseReset = _ref.mouseReset,
|
|
36
|
-
mouseReset = _ref$mouseReset === void 0 ? true : _ref$mouseReset
|
|
37
|
+
mouseReset = _ref$mouseReset === void 0 ? true : _ref$mouseReset,
|
|
38
|
+
container = _ref.container;
|
|
37
39
|
var key = (0, _utils.guid)();
|
|
38
40
|
setMessages(function (prevMessages) {
|
|
39
41
|
return [].concat(prevMessages, [{
|
|
@@ -41,7 +43,8 @@ var useMessages = function useMessages() {
|
|
|
41
43
|
visible: true,
|
|
42
44
|
node: message,
|
|
43
45
|
duration: duration,
|
|
44
|
-
mouseReset: mouseReset
|
|
46
|
+
mouseReset: mouseReset,
|
|
47
|
+
container: container
|
|
45
48
|
}]);
|
|
46
49
|
});
|
|
47
50
|
return key;
|
|
@@ -115,15 +118,9 @@ var ToastContainer = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
115
118
|
var elements = messages.map(function (item) {
|
|
116
119
|
var mouseReset = item.mouseReset,
|
|
117
120
|
duration = item.duration,
|
|
118
|
-
node = item.node
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
usedToaster: true,
|
|
122
|
-
mouseReset: mouseReset,
|
|
123
|
-
duration: duration
|
|
124
|
-
},
|
|
125
|
-
key: item.key
|
|
126
|
-
}, /*#__PURE__*/_react.default.createElement(_Transition.default, {
|
|
121
|
+
node = item.node,
|
|
122
|
+
container = item.container;
|
|
123
|
+
var toastWithTransition = /*#__PURE__*/_react.default.createElement(_Transition.default, {
|
|
127
124
|
in: item.visible,
|
|
128
125
|
exitedClassName: rootPrefix('toast-fade-exited'),
|
|
129
126
|
exitingClassName: rootPrefix('toast-fade-exiting'),
|
|
@@ -142,12 +139,20 @@ var ToastContainer = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
142
139
|
}),
|
|
143
140
|
className: merge(rootPrefix('toast'), (_node$props2 = node.props) === null || _node$props2 === void 0 ? void 0 : _node$props2.className, transitionClassName)
|
|
144
141
|
}));
|
|
145
|
-
})
|
|
142
|
+
});
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_ToastContext.default.Provider, {
|
|
144
|
+
value: {
|
|
145
|
+
usedToaster: true,
|
|
146
|
+
mouseReset: mouseReset,
|
|
147
|
+
duration: duration
|
|
148
|
+
},
|
|
149
|
+
key: item.key
|
|
150
|
+
}, container ? /*#__PURE__*/(0, _reactDom.createPortal)(toastWithTransition, typeof container === 'function' ? container() : container) : toastWithTransition);
|
|
146
151
|
});
|
|
147
152
|
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({}, rest, {
|
|
148
153
|
ref: function ref(selfRef) {
|
|
149
154
|
rootRef.current = selfRef;
|
|
150
|
-
callback === null || callback === void 0
|
|
155
|
+
callback === null || callback === void 0 || callback(selfRef);
|
|
151
156
|
},
|
|
152
157
|
className: classes
|
|
153
158
|
}), elements);
|
|
@@ -161,7 +166,7 @@ ToastContainer.getInstance = function (props) {
|
|
|
161
166
|
var renderCallback = function renderCallback() {
|
|
162
167
|
resolve([containerRef, unmount]);
|
|
163
168
|
};
|
|
164
|
-
var _render = (0, _utils.render)(
|
|
169
|
+
var _render = (0, _utils.render)(/*#__PURE__*/_react.default.createElement(ToastContainer, (0, _extends2.default)({}, rest, {
|
|
165
170
|
ref: containerRef,
|
|
166
171
|
callback: renderCallback
|
|
167
172
|
})), containerElement),
|
|
@@ -34,8 +34,8 @@ function useDelayedClosure(props) {
|
|
|
34
34
|
mouseLeaveRef.current = (0, _on.default)(targetRef.current, 'mouseleave', reset);
|
|
35
35
|
return function () {
|
|
36
36
|
var _mouseEnterRef$curren, _mouseLeaveRef$curren;
|
|
37
|
-
(_mouseEnterRef$curren = mouseEnterRef.current) === null || _mouseEnterRef$curren === void 0
|
|
38
|
-
(_mouseLeaveRef$curren = mouseLeaveRef.current) === null || _mouseLeaveRef$curren === void 0
|
|
37
|
+
(_mouseEnterRef$curren = mouseEnterRef.current) === null || _mouseEnterRef$curren === void 0 || _mouseEnterRef$curren.off();
|
|
38
|
+
(_mouseLeaveRef$curren = mouseLeaveRef.current) === null || _mouseLeaveRef$curren === void 0 || _mouseLeaveRef$curren.off();
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
});
|
package/cjs/toaster/toaster.js
CHANGED
|
@@ -25,7 +25,7 @@ function createContainer(_x, _x2) {
|
|
|
25
25
|
* @param containerId
|
|
26
26
|
*/
|
|
27
27
|
function _createContainer() {
|
|
28
|
-
_createContainer = (0, _asyncToGenerator2.default)(
|
|
28
|
+
_createContainer = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(containerId, props) {
|
|
29
29
|
var _yield$ToastContainer, container;
|
|
30
30
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
31
31
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -51,10 +51,10 @@ function getContainer(containerId) {
|
|
|
51
51
|
}
|
|
52
52
|
return containers.get(containerId || defaultContainerId);
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
return
|
|
54
|
+
var _toaster = function toaster(message) {
|
|
55
|
+
return _toaster.push(message);
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
_toaster.push = function (message, options) {
|
|
58
58
|
if (options === void 0) {
|
|
59
59
|
options = {};
|
|
60
60
|
}
|
|
@@ -70,16 +70,16 @@ toaster.push = function (message, options) {
|
|
|
70
70
|
return (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.push(message, restOptions);
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
_toaster.remove = function (key) {
|
|
74
74
|
containers.forEach(function (c) {
|
|
75
75
|
var _c$current;
|
|
76
76
|
return (_c$current = c.current) === null || _c$current === void 0 ? void 0 : _c$current.remove(key);
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
_toaster.clear = function () {
|
|
80
80
|
containers.forEach(function (c) {
|
|
81
81
|
var _c$current2;
|
|
82
82
|
return (_c$current2 = c.current) === null || _c$current2 === void 0 ? void 0 : _c$current2.clear();
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
|
-
var _default = exports.default =
|
|
85
|
+
var _default = exports.default = _toaster;
|
|
@@ -32,7 +32,7 @@ var useToaster = function useToaster() {
|
|
|
32
32
|
*/
|
|
33
33
|
push: function push(message, options) {
|
|
34
34
|
var _toasters$current;
|
|
35
|
-
var customToaster = toasters === null || toasters === void 0
|
|
35
|
+
var customToaster = toasters === null || toasters === void 0 || (_toasters$current = toasters.current) === null || _toasters$current === void 0 ? void 0 : _toasters$current.get((options === null || options === void 0 ? void 0 : options.placement) || 'topCenter');
|
|
36
36
|
return customToaster ? customToaster.push(message, options) : _toaster.default.push(message, options);
|
|
37
37
|
},
|
|
38
38
|
/**
|