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
package/esm/Cascader/Cascader.js
CHANGED
|
@@ -124,7 +124,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
124
124
|
var isLeafNode = node.isLeafNode,
|
|
125
125
|
cascadePaths = node.cascadePaths,
|
|
126
126
|
itemData = node.itemData;
|
|
127
|
-
onSelect === null || onSelect === void 0
|
|
127
|
+
onSelect === null || onSelect === void 0 || onSelect(itemData, cascadePaths, event);
|
|
128
128
|
var nextValue = itemData[valueKey];
|
|
129
129
|
if (isLeafNode) {
|
|
130
130
|
// Determines whether the option is a leaf node, and if so, closes the picker.
|
|
@@ -136,11 +136,11 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
136
136
|
// When the parent is optional, the value and the displayed path are updated.
|
|
137
137
|
if (parentSelectable && !shallowEqual(value, nextValue)) {
|
|
138
138
|
setValue(nextValue);
|
|
139
|
-
onChange === null || onChange === void 0
|
|
139
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// Update menu position
|
|
143
|
-
(_trigger$current = trigger.current) === null || _trigger$current === void 0
|
|
143
|
+
(_trigger$current = trigger.current) === null || _trigger$current === void 0 || _trigger$current.updatePosition();
|
|
144
144
|
};
|
|
145
145
|
var _useSelect = useSelect({
|
|
146
146
|
value: value,
|
|
@@ -206,7 +206,7 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
206
206
|
setKeys = _useFocusItemValue.setKeys,
|
|
207
207
|
onFocusItem = _useFocusItemValue.onKeyDown;
|
|
208
208
|
var onSearchCallback = function onSearchCallback(value, items, event) {
|
|
209
|
-
onSearch === null || onSearch === void 0
|
|
209
|
+
onSearch === null || onSearch === void 0 || onSearch(value, event);
|
|
210
210
|
if (!value || items.length === 0) {
|
|
211
211
|
setFocusItemValue(undefined);
|
|
212
212
|
return;
|
|
@@ -240,17 +240,17 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
240
240
|
handleExited = _useActive.handleExited;
|
|
241
241
|
var handleClose = useEventCallback(function () {
|
|
242
242
|
var _trigger$current2, _target$current, _target$current$focus;
|
|
243
|
-
(_trigger$current2 = trigger.current) === null || _trigger$current2 === void 0
|
|
243
|
+
(_trigger$current2 = trigger.current) === null || _trigger$current2 === void 0 || _trigger$current2.close();
|
|
244
244
|
|
|
245
245
|
// The focus is on the trigger button after closing
|
|
246
|
-
(_target$current = target.current) === null || _target$current === void 0
|
|
246
|
+
(_target$current = target.current) === null || _target$current === void 0 || (_target$current$focus = _target$current.focus) === null || _target$current$focus === void 0 || _target$current$focus.call(_target$current);
|
|
247
247
|
});
|
|
248
248
|
var handleClean = useEventCallback(function (event) {
|
|
249
249
|
if (disabled || !target.current) {
|
|
250
250
|
return;
|
|
251
251
|
}
|
|
252
252
|
setValue(null);
|
|
253
|
-
onChange === null || onChange === void 0
|
|
253
|
+
onChange === null || onChange === void 0 || onChange(null, event);
|
|
254
254
|
});
|
|
255
255
|
var handleMenuPressEnter = useEventCallback(function (event) {
|
|
256
256
|
var focusItem = findNodeOfTree(data, function (item) {
|
|
@@ -263,8 +263,8 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
263
263
|
setLayer(pathTowardsActiveItem.length - 1);
|
|
264
264
|
}
|
|
265
265
|
if (!shallowEqual(value, focusItemValue)) {
|
|
266
|
-
onSelect === null || onSelect === void 0
|
|
267
|
-
onChange === null || onChange === void 0
|
|
266
|
+
onSelect === null || onSelect === void 0 || onSelect(focusItem, pathTowardsActiveItem, event);
|
|
267
|
+
onChange === null || onChange === void 0 || onChange(focusItemValue !== null && focusItemValue !== void 0 ? focusItemValue : null, event);
|
|
268
268
|
}
|
|
269
269
|
handleClose();
|
|
270
270
|
}
|
|
@@ -289,8 +289,8 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
289
289
|
handleClose();
|
|
290
290
|
setSearchKeyword('');
|
|
291
291
|
setValue(nextValue);
|
|
292
|
-
onSelect === null || onSelect === void 0
|
|
293
|
-
onChange === null || onChange === void 0
|
|
292
|
+
onSelect === null || onSelect === void 0 || onSelect(itemData, nodes, event);
|
|
293
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
294
294
|
});
|
|
295
295
|
var renderCascadeColumn = function renderCascadeColumn(childNodes, column) {
|
|
296
296
|
var items = column.items,
|
|
@@ -361,11 +361,11 @@ var Cascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
361
361
|
selectedElement = [];
|
|
362
362
|
pathTowardsSelectedItem.forEach(function (item, index) {
|
|
363
363
|
var key = item[valueKey] || item[labelKey];
|
|
364
|
-
selectedElement.push(
|
|
364
|
+
selectedElement.push(/*#__PURE__*/React.createElement("span", {
|
|
365
365
|
key: key
|
|
366
366
|
}, item[labelKey]));
|
|
367
367
|
if (index < pathTowardsSelectedItem.length - 1) {
|
|
368
|
-
selectedElement.push(
|
|
368
|
+
selectedElement.push(/*#__PURE__*/React.createElement("span", {
|
|
369
369
|
className: "separator",
|
|
370
370
|
key: key + "-separator"
|
|
371
371
|
}, ' / '));
|
|
@@ -13,19 +13,19 @@ var useActive = function useActive(props) {
|
|
|
13
13
|
active = _useState[0],
|
|
14
14
|
setActive = _useState[1];
|
|
15
15
|
var handleEntered = useEventCallback(function (node) {
|
|
16
|
-
onEntered === null || onEntered === void 0
|
|
16
|
+
onEntered === null || onEntered === void 0 || onEntered(node);
|
|
17
17
|
if (!target.current) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
onOpen === null || onOpen === void 0
|
|
20
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
21
21
|
setActive(true);
|
|
22
22
|
});
|
|
23
23
|
var handleExited = useEventCallback(function (node) {
|
|
24
|
-
onExited === null || onExited === void 0
|
|
24
|
+
onExited === null || onExited === void 0 || onExited(node);
|
|
25
25
|
if (!target.current) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
-
onClose === null || onClose === void 0
|
|
28
|
+
onClose === null || onClose === void 0 || onClose();
|
|
29
29
|
setActive(false);
|
|
30
30
|
setSearchKeyword('');
|
|
31
31
|
});
|
|
@@ -108,8 +108,8 @@ var CheckPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
108
108
|
var handleSearchCallback = useEventCallback(function (searchKeyword, filteredData, event) {
|
|
109
109
|
var _filteredData$;
|
|
110
110
|
// The first option after filtering is the focus.
|
|
111
|
-
setFocusItemValue(filteredData === null || filteredData === void 0
|
|
112
|
-
onSearch === null || onSearch === void 0
|
|
111
|
+
setFocusItemValue(filteredData === null || filteredData === void 0 || (_filteredData$ = filteredData[0]) === null || _filteredData$ === void 0 ? void 0 : _filteredData$[valueKey]);
|
|
112
|
+
onSearch === null || onSearch === void 0 || onSearch(searchKeyword, event);
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
// Use search keywords to filter options.
|
|
@@ -149,14 +149,14 @@ var CheckPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
149
149
|
setStickyItems(nextStickyItems);
|
|
150
150
|
};
|
|
151
151
|
var handleChangeValue = useEventCallback(function (value, event) {
|
|
152
|
-
onChange === null || onChange === void 0
|
|
152
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
153
153
|
});
|
|
154
154
|
var handleClean = useEventCallback(function (event) {
|
|
155
155
|
if (disabled || !cleanable) {
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
158
|
setValue([]);
|
|
159
|
-
onClean === null || onClean === void 0
|
|
159
|
+
onClean === null || onClean === void 0 || onClean(event);
|
|
160
160
|
handleChangeValue([], event);
|
|
161
161
|
});
|
|
162
162
|
var handleMenuPressEnter = function handleMenuPressEnter(event) {
|
|
@@ -193,7 +193,7 @@ var CheckPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
193
193
|
onMenuPressBackspace: handleClean
|
|
194
194
|
}, rest));
|
|
195
195
|
var handleSelect = useEventCallback(function (nextItemValue, item, event) {
|
|
196
|
-
onSelect === null || onSelect === void 0
|
|
196
|
+
onSelect === null || onSelect === void 0 || onSelect(nextItemValue, item, event);
|
|
197
197
|
});
|
|
198
198
|
var handleItemSelect = useEventCallback(function (nextItemValue, item, event, checked) {
|
|
199
199
|
var nextValue = clone(value);
|
|
@@ -76,7 +76,7 @@ var CheckTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
76
76
|
}));
|
|
77
77
|
var handleChange = useEventCallback(function (nextValue, event) {
|
|
78
78
|
setValue(nextValue);
|
|
79
|
-
onChange === null || onChange === void 0
|
|
79
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
80
80
|
});
|
|
81
81
|
var treeContext = useMemo(function () {
|
|
82
82
|
return {
|
|
@@ -51,8 +51,8 @@ var CheckTreeNode = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
51
|
var handleExpand = useEventCallback(function (event) {
|
|
52
52
|
var _event$nativeEvent, _event$nativeEvent$st;
|
|
53
53
|
// stop propagation when using custom loading icon
|
|
54
|
-
event === null || event === void 0
|
|
55
|
-
onExpand === null || onExpand === void 0
|
|
54
|
+
event === null || event === void 0 || (_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 || (_event$nativeEvent$st = _event$nativeEvent.stopImmediatePropagation) === null || _event$nativeEvent$st === void 0 || _event$nativeEvent$st.call(_event$nativeEvent);
|
|
55
|
+
onExpand === null || onExpand === void 0 || onExpand(nodeData, expanded);
|
|
56
56
|
});
|
|
57
57
|
var handleSelect = useEventCallback(function (_value, event) {
|
|
58
58
|
var isChecked = false;
|
|
@@ -65,7 +65,7 @@ var CheckTreeNode = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
65
65
|
var nextNodeData = _extends({}, nodeData, {
|
|
66
66
|
check: isChecked
|
|
67
67
|
});
|
|
68
|
-
onSelect === null || onSelect === void 0
|
|
68
|
+
onSelect === null || onSelect === void 0 || onSelect(nextNodeData, event);
|
|
69
69
|
});
|
|
70
70
|
var classes = merge(className, withClassPrefix({
|
|
71
71
|
disabled: disabled,
|
|
@@ -87,7 +87,7 @@ var CheckTreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
87
87
|
}),
|
|
88
88
|
getCheckedValues = _useTreeCheckState.getCheckedValues;
|
|
89
89
|
var handleSearchCallback = function handleSearchCallback(value, _data, event) {
|
|
90
|
-
onSearch === null || onSearch === void 0
|
|
90
|
+
onSearch === null || onSearch === void 0 || onSearch(value, event);
|
|
91
91
|
};
|
|
92
92
|
var _useTreeSearch = useTreeSearch({
|
|
93
93
|
callback: handleSearchCallback,
|
|
@@ -168,9 +168,9 @@ var CheckTreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
168
168
|
return itemParentMap.get(item[valueKey]);
|
|
169
169
|
});
|
|
170
170
|
setFocusItemValue(node[valueKey]);
|
|
171
|
-
onChange === null || onChange === void 0
|
|
172
|
-
onSelect === null || onSelect === void 0
|
|
173
|
-
onSelectItem === null || onSelectItem === void 0
|
|
171
|
+
onChange === null || onChange === void 0 || onChange(checkedValues, event);
|
|
172
|
+
onSelect === null || onSelect === void 0 || onSelect(node, checkedValues, event);
|
|
173
|
+
onSelectItem === null || onSelectItem === void 0 || onSelectItem(node, path);
|
|
174
174
|
});
|
|
175
175
|
var selectActiveItem = function selectActiveItem(event) {
|
|
176
176
|
if (isNil(focusItemValue)) return;
|
|
@@ -188,7 +188,7 @@ var CheckTreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
188
188
|
enter: selectActiveItem
|
|
189
189
|
});
|
|
190
190
|
});
|
|
191
|
-
var
|
|
191
|
+
var _renderNode = function renderNode(node, layer) {
|
|
192
192
|
var visible = node.visible,
|
|
193
193
|
refKey = node.refKey,
|
|
194
194
|
parent = node.parent;
|
|
@@ -225,7 +225,7 @@ var CheckTreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
225
225
|
className: prefix('group'),
|
|
226
226
|
role: "group"
|
|
227
227
|
}, nodes.map(function (child) {
|
|
228
|
-
return
|
|
228
|
+
return _renderNode(child, layer);
|
|
229
229
|
}), showIndentLine && /*#__PURE__*/React.createElement(IndentLine, null)));
|
|
230
230
|
}
|
|
231
231
|
return /*#__PURE__*/React.createElement(CheckTreeNode, _extends({
|
|
@@ -266,7 +266,7 @@ var CheckTreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
266
266
|
'without-children': !hasGrandchild(data, childrenKey),
|
|
267
267
|
virtualized: virtualized
|
|
268
268
|
}));
|
|
269
|
-
var formattedNodes = getFormattedNodes(
|
|
269
|
+
var formattedNodes = getFormattedNodes(_renderNode);
|
|
270
270
|
var treeNodesClass = merge(prefix('root'), (_merge2 = {}, _merge2[prefix('all-uncheckable')] = isEveryFirstLevelNodeUncheckable(flattenedNodes, uncheckableItemValues, valueKey), _merge2));
|
|
271
271
|
return /*#__PURE__*/React.createElement(Component, {
|
|
272
272
|
ref: ref,
|
package/esm/CheckTree/utils.js
CHANGED
|
@@ -15,7 +15,7 @@ function getChildrenByFlattenNodes(nodes, parent) {
|
|
|
15
15
|
}
|
|
16
16
|
return Object.values(nodes).filter(function (item) {
|
|
17
17
|
var _item$parent;
|
|
18
|
-
return (item === null || item === void 0
|
|
18
|
+
return (item === null || item === void 0 || (_item$parent = item.parent) === null || _item$parent === void 0 ? void 0 : _item$parent.refKey) === parent.refKey && item.refKey && !nodes[item.refKey].uncheckable;
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -35,7 +35,7 @@ export function isEveryChildChecked(parent, options) {
|
|
|
35
35
|
}
|
|
36
36
|
return children.every(function (child) {
|
|
37
37
|
var _child$childrenKey;
|
|
38
|
-
if ((child === null || child === void 0
|
|
38
|
+
if ((child === null || child === void 0 || (_child$childrenKey = child[childrenKey]) === null || _child$childrenKey === void 0 ? void 0 : _child$childrenKey.length) > 0) {
|
|
39
39
|
// fix: #3559
|
|
40
40
|
return isEveryChildChecked(child, {
|
|
41
41
|
nodes: nodes,
|
|
@@ -56,7 +56,7 @@ export function isSomeChildChecked(nodes, parent, childrenKey) {
|
|
|
56
56
|
var children = getChildrenByFlattenNodes(nodes, parent);
|
|
57
57
|
return children.some(function (child) {
|
|
58
58
|
var _child$childrenKey2;
|
|
59
|
-
if ((child === null || child === void 0
|
|
59
|
+
if ((child === null || child === void 0 || (_child$childrenKey2 = child[childrenKey]) === null || _child$childrenKey2 === void 0 ? void 0 : _child$childrenKey2.length) > 0) {
|
|
60
60
|
return isSomeChildChecked(nodes, child, childrenKey);
|
|
61
61
|
}
|
|
62
62
|
return !_isNil(child.refKey) && nodes[child.refKey].check;
|
|
@@ -166,7 +166,7 @@ var CheckTreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
166
166
|
}
|
|
167
167
|
setFocusItemValue(null);
|
|
168
168
|
setValue([]);
|
|
169
|
-
onChange === null || onChange === void 0
|
|
169
|
+
onChange === null || onChange === void 0 || onChange([], event);
|
|
170
170
|
});
|
|
171
171
|
var handleTreeKeyDown = useEventCallback(function (event) {
|
|
172
172
|
onMenuKeyDown(event, {
|
|
@@ -188,7 +188,7 @@ var CheckTreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
188
188
|
}, rest));
|
|
189
189
|
var handleChange = useEventCallback(function (nextValue, event) {
|
|
190
190
|
setValue(nextValue);
|
|
191
|
-
onChange === null || onChange === void 0
|
|
191
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
192
192
|
});
|
|
193
193
|
var treeContext = useMemo(function () {
|
|
194
194
|
return {
|
|
@@ -11,18 +11,18 @@ function useFocusState(props) {
|
|
|
11
11
|
setFocusItemValue = _useState2[1];
|
|
12
12
|
var focusTarget = useEventCallback(function () {
|
|
13
13
|
var _target$current;
|
|
14
|
-
(_target$current = target.current) === null || _target$current === void 0
|
|
14
|
+
(_target$current = target.current) === null || _target$current === void 0 || _target$current.focus();
|
|
15
15
|
});
|
|
16
16
|
var onEnter = useEventCallback(function (node) {
|
|
17
17
|
var _props$onEnter;
|
|
18
18
|
setActive(true);
|
|
19
|
-
(_props$onEnter = props.onEnter) === null || _props$onEnter === void 0
|
|
19
|
+
(_props$onEnter = props.onEnter) === null || _props$onEnter === void 0 || _props$onEnter.call(props, node);
|
|
20
20
|
});
|
|
21
21
|
var onExit = useEventCallback(function (node) {
|
|
22
22
|
var _props$onExit;
|
|
23
23
|
setActive(false);
|
|
24
24
|
focusTarget();
|
|
25
|
-
(_props$onExit = props.onExit) === null || _props$onExit === void 0
|
|
25
|
+
(_props$onExit = props.onExit) === null || _props$onExit === void 0 || _props$onExit.call(props, node);
|
|
26
26
|
});
|
|
27
27
|
return {
|
|
28
28
|
active: active,
|
package/esm/Checkbox/Checkbox.js
CHANGED
|
@@ -106,8 +106,8 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
setSelfChecked(nextChecked);
|
|
109
|
-
onChange === null || onChange === void 0
|
|
110
|
-
onGroupChange === null || onGroupChange === void 0
|
|
109
|
+
onChange === null || onChange === void 0 || onChange(value, nextChecked, event);
|
|
110
|
+
onGroupChange === null || onGroupChange === void 0 || onGroupChange(value, nextChecked, event);
|
|
111
111
|
});
|
|
112
112
|
var handleLabelClick = useEventCallback(function (event) {
|
|
113
113
|
// Prevent check when label is not clickable
|
|
@@ -53,7 +53,7 @@ var CheckboxGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
setValue(nextValue);
|
|
56
|
-
onChange === null || onChange === void 0
|
|
56
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
57
57
|
}, [onChange, setValue, value]);
|
|
58
58
|
var contextValue = useMemo(function () {
|
|
59
59
|
return {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { useCustom } from "./useCustom.js";
|
|
4
|
+
export function FormattedNumber(_ref) {
|
|
5
|
+
var value = _ref.value,
|
|
6
|
+
formatOptions = _ref.formatOptions;
|
|
7
|
+
var _useCustom = useCustom(),
|
|
8
|
+
code = _useCustom.code;
|
|
9
|
+
var formatter = useMemo(function () {
|
|
10
|
+
return new Intl.NumberFormat(code, formatOptions);
|
|
11
|
+
}, [code, formatOptions]);
|
|
12
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, formatter.format(value));
|
|
13
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CustomProvider from './CustomProvider';
|
|
2
2
|
export { FormattedDate } from './FormattedDate';
|
|
3
|
+
export { FormattedNumber } from './FormattedNumber';
|
|
3
4
|
export { useCustom } from './useCustom';
|
|
4
5
|
export { CustomContext } from './CustomProvider';
|
|
5
6
|
export type { CustomProviderProps } from './CustomProvider';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import CustomProvider from "./CustomProvider.js";
|
|
3
3
|
export { FormattedDate } from "./FormattedDate.js";
|
|
4
|
+
export { FormattedNumber } from "./FormattedNumber.js";
|
|
4
5
|
export { useCustom } from "./useCustom.js";
|
|
5
6
|
export { CustomContext } from "./CustomProvider.js";
|
|
6
7
|
export default CustomProvider;
|
|
@@ -17,6 +17,8 @@ import type { CalendarProps } from '../Calendar';
|
|
|
17
17
|
import type { CarouselProps } from '../Carousel';
|
|
18
18
|
import type { CascadeTreeProps } from '../CascadeTree';
|
|
19
19
|
import type { CascaderProps } from '../Cascader';
|
|
20
|
+
import type { CardProps } from '../Card';
|
|
21
|
+
import type { CardGroupProps } from '../CardGroup';
|
|
20
22
|
import type { CheckPickerProps } from '../CheckPicker';
|
|
21
23
|
import type { CheckTreeProps } from '../CheckTree';
|
|
22
24
|
import type { CheckTreePickerProps } from '../CheckTreePicker';
|
|
@@ -51,6 +53,7 @@ import type { InputProps } from '../Input';
|
|
|
51
53
|
import type { InputGroupProps } from '../InputGroup';
|
|
52
54
|
import type { InputNumberProps } from '../InputNumber';
|
|
53
55
|
import type { InputPickerProps } from '../InputPicker';
|
|
56
|
+
import type { ImageProps } from '../Image';
|
|
54
57
|
import type { ListProps } from '../List';
|
|
55
58
|
import type { LoaderProps } from '../Loader';
|
|
56
59
|
import type { MaskedInputProps } from '../MaskedInput';
|
|
@@ -84,6 +87,8 @@ import type { SidenavProps } from '../Sidenav';
|
|
|
84
87
|
import type { SliderProps } from '../Slider';
|
|
85
88
|
import type { StackProps } from '../Stack';
|
|
86
89
|
import type { StepsProps } from '../Steps';
|
|
90
|
+
import type { StatProps } from '../Stat';
|
|
91
|
+
import type { StatGroupProps } from '../StatGroup';
|
|
87
92
|
import type { TableProps } from '../Table';
|
|
88
93
|
import type { TabsProps } from '../Tabs';
|
|
89
94
|
import type { TagProps } from '../Tag';
|
|
@@ -124,6 +129,8 @@ export interface ReactSuiteComponents {
|
|
|
124
129
|
Carousel: ComponentProps<CarouselProps>;
|
|
125
130
|
CascadeTree: ComponentProps<CascadeTreeProps>;
|
|
126
131
|
Cascader: ComponentProps<CascaderProps>;
|
|
132
|
+
Card: ComponentProps<CardProps>;
|
|
133
|
+
CardGroup: ComponentProps<CardGroupProps>;
|
|
127
134
|
CheckPicker: ComponentProps<CheckPickerProps>;
|
|
128
135
|
CheckTree: ComponentProps<CheckTreeProps>;
|
|
129
136
|
CheckTreePicker: ComponentProps<CheckTreePickerProps>;
|
|
@@ -158,6 +165,7 @@ export interface ReactSuiteComponents {
|
|
|
158
165
|
InputGroup: ComponentProps<InputGroupProps>;
|
|
159
166
|
InputNumber: ComponentProps<InputNumberProps>;
|
|
160
167
|
InputPicker: ComponentProps<InputPickerProps>;
|
|
168
|
+
Image: ComponentProps<ImageProps>;
|
|
161
169
|
List: ComponentProps<ListProps>;
|
|
162
170
|
Loader: ComponentProps<LoaderProps>;
|
|
163
171
|
MaskedInput: ComponentProps<MaskedInputProps>;
|
|
@@ -191,6 +199,8 @@ export interface ReactSuiteComponents {
|
|
|
191
199
|
Slider: ComponentProps<SliderProps>;
|
|
192
200
|
Stack: ComponentProps<StackProps>;
|
|
193
201
|
Steps: ComponentProps<StepsProps>;
|
|
202
|
+
Stat: ComponentProps<StatProps>;
|
|
203
|
+
StatGroup: ComponentProps<StatGroupProps>;
|
|
194
204
|
Table: ComponentProps<TableProps>;
|
|
195
205
|
Tabs: ComponentProps<TabsProps>;
|
|
196
206
|
Tag: ComponentProps<TagProps>;
|
|
@@ -9,6 +9,7 @@ type LocaleKey = keyof typeof enGB;
|
|
|
9
9
|
* @param componentProps - The props of the component
|
|
10
10
|
*/
|
|
11
11
|
export declare function useCustom<P = any>(componentName?: keyof ReactSuiteComponents, componentProps?: P): {
|
|
12
|
+
code: string | undefined;
|
|
12
13
|
rtl: boolean;
|
|
13
14
|
toasters: import("react").MutableRefObject<Map<string, import("../toaster/ToastContainer").ToastContainerInstance>> | undefined;
|
|
14
15
|
disableRipple: boolean | undefined;
|
|
@@ -40,7 +40,8 @@ export function useCustom(componentName, componentProps) {
|
|
|
40
40
|
var _ref = componentProps || {},
|
|
41
41
|
componentLocale = _ref.locale,
|
|
42
42
|
restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
|
-
var dateLocale = globalLocale === null || globalLocale === void 0
|
|
43
|
+
var dateLocale = globalLocale === null || globalLocale === void 0 || (_globalLocale$DateTim = globalLocale.DateTimeFormats) === null || _globalLocale$DateTim === void 0 ? void 0 : _globalLocale$DateTim.dateLocale;
|
|
44
|
+
var code = globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale.code;
|
|
44
45
|
var getLocale = useCallback(function (key, overrideLocale) {
|
|
45
46
|
// Initialize with common locale
|
|
46
47
|
var publicLocale = (globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale.common) || {};
|
|
@@ -96,6 +97,7 @@ export function useCustom(componentName, componentProps) {
|
|
|
96
97
|
}, options));
|
|
97
98
|
}, [parseDate, dateLocale]);
|
|
98
99
|
return {
|
|
100
|
+
code: code,
|
|
99
101
|
rtl: rtl,
|
|
100
102
|
toasters: toasters,
|
|
101
103
|
disableRipple: disableRipple,
|
|
@@ -47,7 +47,7 @@ export var DateField = /*#__PURE__*/function (_Object) {
|
|
|
47
47
|
}
|
|
48
48
|
_inheritsLoose(DateField, _Object);
|
|
49
49
|
return DateField;
|
|
50
|
-
}(
|
|
50
|
+
}(/*#__PURE__*/_wrapNativeSuper(Object));
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Pad a number with zeros to the left.
|
|
@@ -138,7 +138,7 @@ export var useDateField = function useDateField(format, localize, date) {
|
|
|
138
138
|
var validFieldValue = function validFieldValue(type, value) {
|
|
139
139
|
var _format$match;
|
|
140
140
|
var isValid = true;
|
|
141
|
-
(_format$match = format.match(new RegExp('([y|d|M|H|h|m|s])+', 'ig'))) === null || _format$match === void 0
|
|
141
|
+
(_format$match = format.match(new RegExp('([y|d|M|H|h|m|s])+', 'ig'))) === null || _format$match === void 0 || _format$match.forEach(function (pattern) {
|
|
142
142
|
var key = patternMap[pattern[0]];
|
|
143
143
|
var fieldValue = type === key ? value : dateField[key];
|
|
144
144
|
if (fieldValue === null) {
|
|
@@ -76,7 +76,7 @@ var DateInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
76
76
|
}, [dateField, dateString, formatStr, dateLocale]);
|
|
77
77
|
var setSelectionRange = useInputSelection(inputRef);
|
|
78
78
|
var handleChange = useEventCallback(function (value, event) {
|
|
79
|
-
onChange === null || onChange === void 0
|
|
79
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
80
80
|
setValue(value);
|
|
81
81
|
});
|
|
82
82
|
var handleClear = useEventCallback(function (event) {
|
|
@@ -190,7 +190,7 @@ var DateInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
190
190
|
handleChange(nextDate, event);
|
|
191
191
|
setNewDate(nextDate);
|
|
192
192
|
}
|
|
193
|
-
onPaste === null || onPaste === void 0
|
|
193
|
+
onPaste === null || onPaste === void 0 || onPaste(event);
|
|
194
194
|
});
|
|
195
195
|
var onKeyboardInput = useKeyboardInputEvent({
|
|
196
196
|
onSegmentChange: onSegmentChange,
|
|
@@ -70,7 +70,7 @@ export function useDateInputState(_ref) {
|
|
|
70
70
|
value: value
|
|
71
71
|
});
|
|
72
72
|
var field = patternMap[pattern];
|
|
73
|
-
callback === null || callback === void 0
|
|
73
|
+
callback === null || callback === void 0 || callback(toDate(field, value));
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
var setDateField = function setDateField(pattern, value, callback) {
|
|
@@ -80,7 +80,7 @@ export function useDateInputState(_ref) {
|
|
|
80
80
|
type: actionName,
|
|
81
81
|
value: value
|
|
82
82
|
});
|
|
83
|
-
callback === null || callback === void 0
|
|
83
|
+
callback === null || callback === void 0 || callback(toDate(field, value));
|
|
84
84
|
};
|
|
85
85
|
var getDateField = function getDateField(pattern) {
|
|
86
86
|
var fieldName = patternMap[pattern];
|
|
@@ -8,11 +8,11 @@ export function useIsFocused(_ref) {
|
|
|
8
8
|
setIsFocused = _useState[1];
|
|
9
9
|
var onFocus = useCallback(function (event) {
|
|
10
10
|
setIsFocused(true);
|
|
11
|
-
onFocusProp === null || onFocusProp === void 0
|
|
11
|
+
onFocusProp === null || onFocusProp === void 0 || onFocusProp(event);
|
|
12
12
|
}, [onFocusProp]);
|
|
13
13
|
var onBlur = useCallback(function (event) {
|
|
14
14
|
setIsFocused(false);
|
|
15
|
-
onBlurProp === null || onBlurProp === void 0
|
|
15
|
+
onBlurProp === null || onBlurProp === void 0 || onBlurProp(event);
|
|
16
16
|
}, [onBlurProp]);
|
|
17
17
|
return [isFocused, {
|
|
18
18
|
onFocus: onFocus,
|
|
@@ -11,21 +11,21 @@ export function useKeyboardInputEvent(_ref) {
|
|
|
11
11
|
switch (key) {
|
|
12
12
|
case 'ArrowRight':
|
|
13
13
|
case 'ArrowLeft':
|
|
14
|
-
onSegmentChange === null || onSegmentChange === void 0
|
|
14
|
+
onSegmentChange === null || onSegmentChange === void 0 || onSegmentChange(event);
|
|
15
15
|
event.preventDefault();
|
|
16
16
|
break;
|
|
17
17
|
case 'ArrowUp':
|
|
18
18
|
case 'ArrowDown':
|
|
19
|
-
onSegmentValueChange === null || onSegmentValueChange === void 0
|
|
19
|
+
onSegmentValueChange === null || onSegmentValueChange === void 0 || onSegmentValueChange(event);
|
|
20
20
|
event.preventDefault();
|
|
21
21
|
break;
|
|
22
22
|
case 'Backspace':
|
|
23
|
-
onSegmentValueRemove === null || onSegmentValueRemove === void 0
|
|
23
|
+
onSegmentValueRemove === null || onSegmentValueRemove === void 0 || onSegmentValueRemove(event);
|
|
24
24
|
event.preventDefault();
|
|
25
25
|
break;
|
|
26
26
|
case (_key$match = key.match(/\d/)) === null || _key$match === void 0 ? void 0 : _key$match.input:
|
|
27
27
|
// Allow numeric keys to be entered
|
|
28
|
-
onSegmentValueChangeWithNumericKeys === null || onSegmentValueChangeWithNumericKeys === void 0
|
|
28
|
+
onSegmentValueChangeWithNumericKeys === null || onSegmentValueChangeWithNumericKeys === void 0 || onSegmentValueChangeWithNumericKeys(event);
|
|
29
29
|
event.preventDefault();
|
|
30
30
|
case (_key$match2 = key.match(/[a-z]/)) === null || _key$match2 === void 0 ? void 0 : _key$match2[0]:
|
|
31
31
|
// Determine whether the Ctrl or Command key is pressed, does not affect user copy and paste
|
|
@@ -37,7 +37,7 @@ export function useKeyboardInputEvent(_ref) {
|
|
|
37
37
|
event.preventDefault();
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
|
-
onKeyDown === null || onKeyDown === void 0
|
|
40
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
export default useKeyboardInputEvent;
|