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
package/esm/Affix/Affix.js
CHANGED
|
@@ -24,7 +24,7 @@ function useOffset(mountRef, onOffsetChange) {
|
|
|
24
24
|
if ((newOffset === null || newOffset === void 0 ? void 0 : newOffset.height) !== (offset === null || offset === void 0 ? void 0 : offset.height) || (newOffset === null || newOffset === void 0 ? void 0 : newOffset.width) !== (offset === null || offset === void 0 ? void 0 : offset.width) || (newOffset === null || newOffset === void 0 ? void 0 : newOffset.top) !== (offset === null || offset === void 0 ? void 0 : offset.top) || (newOffset === null || newOffset === void 0 ? void 0 : newOffset.left) !== (offset === null || offset === void 0 ? void 0 : offset.left)) {
|
|
25
25
|
setOffset(newOffset);
|
|
26
26
|
if (offset !== null && newOffset !== null) {
|
|
27
|
-
onOffsetChange === null || onOffsetChange === void 0
|
|
27
|
+
onOffsetChange === null || onOffsetChange === void 0 || onOffsetChange(newOffset);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}, [mountRef, offset, onOffsetChange]);
|
|
@@ -88,7 +88,7 @@ function useFixed(offset, containerOffset, props) {
|
|
|
88
88
|
}
|
|
89
89
|
if (nextFixed !== fixed) {
|
|
90
90
|
setFixed(nextFixed);
|
|
91
|
-
onChange === null || onChange === void 0
|
|
91
|
+
onChange === null || onChange === void 0 || onChange(nextFixed);
|
|
92
92
|
}
|
|
93
93
|
}, [offset, top, containerOffset, fixed, onChange]);
|
|
94
94
|
|
|
@@ -116,7 +116,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
116
116
|
_proto.onTransitionEnd = function onTransitionEnd(node, handler) {
|
|
117
117
|
var _this$animationEventL;
|
|
118
118
|
this.setNextCallback(handler);
|
|
119
|
-
(_this$animationEventL = this.animationEventListener) === null || _this$animationEventL === void 0
|
|
119
|
+
(_this$animationEventL = this.animationEventListener) === null || _this$animationEventL === void 0 || _this$animationEventL.off();
|
|
120
120
|
if (!this.nextCallback) {
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
@@ -173,16 +173,16 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
173
173
|
this.cancelNextCallback();
|
|
174
174
|
var node = this.getChildElement();
|
|
175
175
|
this.instanceElement = node;
|
|
176
|
-
onEnter === null || onEnter === void 0
|
|
176
|
+
onEnter === null || onEnter === void 0 || onEnter(node);
|
|
177
177
|
this.safeSetState({
|
|
178
178
|
status: STATUS.ENTERING
|
|
179
179
|
}, function () {
|
|
180
|
-
onEntering === null || onEntering === void 0
|
|
180
|
+
onEntering === null || onEntering === void 0 || onEntering(node);
|
|
181
181
|
_this3.onTransitionEnd(node, function () {
|
|
182
182
|
_this3.safeSetState({
|
|
183
183
|
status: STATUS.ENTERED
|
|
184
184
|
}, function () {
|
|
185
|
-
onEntered === null || onEntered === void 0
|
|
185
|
+
onEntered === null || onEntered === void 0 || onEntered(node);
|
|
186
186
|
});
|
|
187
187
|
});
|
|
188
188
|
});
|
|
@@ -196,16 +196,16 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
|
196
196
|
this.cancelNextCallback();
|
|
197
197
|
var node = this.getChildElement();
|
|
198
198
|
this.instanceElement = node;
|
|
199
|
-
onExit === null || onExit === void 0
|
|
199
|
+
onExit === null || onExit === void 0 || onExit(node);
|
|
200
200
|
this.safeSetState({
|
|
201
201
|
status: STATUS.EXITING
|
|
202
202
|
}, function () {
|
|
203
|
-
onExiting === null || onExiting === void 0
|
|
203
|
+
onExiting === null || onExiting === void 0 || onExiting(node);
|
|
204
204
|
_this4.onTransitionEnd(node, function () {
|
|
205
205
|
_this4.safeSetState({
|
|
206
206
|
status: STATUS.EXITED
|
|
207
207
|
}, function () {
|
|
208
|
-
onExited === null || onExited === void 0
|
|
208
|
+
onExited === null || onExited === void 0 || onExited(node);
|
|
209
209
|
});
|
|
210
210
|
});
|
|
211
211
|
});
|
|
@@ -97,7 +97,7 @@ var AutoComplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
97
97
|
esc: handleClose
|
|
98
98
|
});
|
|
99
99
|
handleKeyDown(event);
|
|
100
|
-
onKeyDown === null || onKeyDown === void 0
|
|
100
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
101
101
|
};
|
|
102
102
|
var selectFocusMenuItem = function selectFocusMenuItem(event) {
|
|
103
103
|
if (!focusItemValue) {
|
|
@@ -115,10 +115,10 @@ var AutoComplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
115
115
|
handleClose();
|
|
116
116
|
};
|
|
117
117
|
var handleSelect = useEventCallback(function (item, event) {
|
|
118
|
-
onSelect === null || onSelect === void 0
|
|
118
|
+
onSelect === null || onSelect === void 0 || onSelect(item.value, item, event);
|
|
119
119
|
});
|
|
120
120
|
var handleChangeValue = useEventCallback(function (value, event) {
|
|
121
|
-
onChange === null || onChange === void 0
|
|
121
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
122
122
|
});
|
|
123
123
|
var handleChange = function handleChange(value, event) {
|
|
124
124
|
setFocusItemValue('');
|
|
@@ -129,12 +129,12 @@ var AutoComplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
129
129
|
var handleClose = useEventCallback(function () {
|
|
130
130
|
if (isMounted()) {
|
|
131
131
|
setFocus(false);
|
|
132
|
-
onClose === null || onClose === void 0
|
|
132
|
+
onClose === null || onClose === void 0 || onClose();
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
var handleOpen = useEventCallback(function () {
|
|
136
136
|
setFocus(true);
|
|
137
|
-
onOpen === null || onOpen === void 0
|
|
137
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
138
138
|
});
|
|
139
139
|
var handleItemSelect = useEventCallback(function (nextItemValue, item, event) {
|
|
140
140
|
setValue(nextItemValue);
|
|
@@ -146,12 +146,12 @@ var AutoComplete = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
146
146
|
handleClose();
|
|
147
147
|
});
|
|
148
148
|
var handleInputFocus = useEventCallback(function (event) {
|
|
149
|
-
onFocus === null || onFocus === void 0
|
|
149
|
+
onFocus === null || onFocus === void 0 || onFocus(event);
|
|
150
150
|
handleOpen();
|
|
151
151
|
});
|
|
152
152
|
var handleInputBlur = useEventCallback(function (event) {
|
|
153
153
|
setTimeout(handleClose, 300);
|
|
154
|
-
onBlur === null || onBlur === void 0
|
|
154
|
+
onBlur === null || onBlur === void 0 || onBlur(event);
|
|
155
155
|
});
|
|
156
156
|
var _useClassNames = useClassNames(classPrefix),
|
|
157
157
|
withClassPrefix = _useClassNames.withClassPrefix,
|
package/esm/Avatar/useImage.js
CHANGED
|
@@ -35,7 +35,7 @@ var useImage = function useImage(props) {
|
|
|
35
35
|
var handleError = useCallback(function (event) {
|
|
36
36
|
setStatus('error');
|
|
37
37
|
flush();
|
|
38
|
-
onError === null || onError === void 0
|
|
38
|
+
onError === null || onError === void 0 || onError(event);
|
|
39
39
|
}, [onError]);
|
|
40
40
|
useEffect(function () {
|
|
41
41
|
setStatus(src ? 'loading' : 'pending');
|
|
@@ -44,7 +44,7 @@ var Breadcrumb = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
44
44
|
setShowEllipsis = _useState[1];
|
|
45
45
|
var handleClickEllipsis = useEventCallback(function (event) {
|
|
46
46
|
setShowEllipsis(false);
|
|
47
|
-
onExpand === null || onExpand === void 0
|
|
47
|
+
onExpand === null || onExpand === void 0 || onExpand(event);
|
|
48
48
|
});
|
|
49
49
|
var content = useMemo(function () {
|
|
50
50
|
var count = ReactChildren.count(children);
|
package/esm/Calendar/Calendar.js
CHANGED
|
@@ -43,16 +43,16 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
43
43
|
setCalendarDate = _useCalendarDate.setCalendarDate;
|
|
44
44
|
var handleChange = useEventCallback(function (nextValue) {
|
|
45
45
|
setCalendarDate(nextValue);
|
|
46
|
-
onChange === null || onChange === void 0
|
|
46
|
+
onChange === null || onChange === void 0 || onChange(nextValue);
|
|
47
47
|
if (!isSameMonth(nextValue, calendarDate)) {
|
|
48
|
-
onMonthChange === null || onMonthChange === void 0
|
|
48
|
+
onMonthChange === null || onMonthChange === void 0 || onMonthChange(nextValue);
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
var handleClickToday = useEventCallback(function () {
|
|
52
52
|
handleChange(new Date());
|
|
53
53
|
});
|
|
54
54
|
var handleSelect = useEventCallback(function (nextValue) {
|
|
55
|
-
onSelect === null || onSelect === void 0
|
|
55
|
+
onSelect === null || onSelect === void 0 || onSelect(nextValue);
|
|
56
56
|
handleChange(nextValue);
|
|
57
57
|
});
|
|
58
58
|
var _useClassNames = useClassNames(classPrefix),
|
|
@@ -98,7 +98,7 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
98
98
|
var timeDropdownProps = pick(rest, calendarOnlyProps);
|
|
99
99
|
var handleChangeMonth = useEventCallback(function (date, event) {
|
|
100
100
|
reset();
|
|
101
|
-
onChangeMonth === null || onChangeMonth === void 0
|
|
101
|
+
onChangeMonth === null || onChangeMonth === void 0 || onChangeMonth(date, event);
|
|
102
102
|
});
|
|
103
103
|
var contextValue = {
|
|
104
104
|
date: calendarDate,
|
|
@@ -38,7 +38,7 @@ var GridRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
38
38
|
if (disabled) {
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
onSelect === null || onSelect === void 0
|
|
41
|
+
onSelect === null || onSelect === void 0 || onSelect(date, event);
|
|
42
42
|
}, [onSelect]);
|
|
43
43
|
var renderDays = function renderDays() {
|
|
44
44
|
var days = [];
|
|
@@ -79,7 +79,7 @@ var GridRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
79
79
|
inRange = true;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
days.push(
|
|
82
|
+
days.push(/*#__PURE__*/React.createElement(GridCell, {
|
|
83
83
|
key: format(thisDate, 'yyyy-MM-dd'),
|
|
84
84
|
date: thisDate,
|
|
85
85
|
disabled: disabled,
|
|
@@ -94,7 +94,7 @@ var GridRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
94
94
|
return days;
|
|
95
95
|
};
|
|
96
96
|
var classes = merge(className, prefix('row'));
|
|
97
|
-
var _ref3 = (_locale$dateLocale$op = locale === null || locale === void 0
|
|
97
|
+
var _ref3 = (_locale$dateLocale$op = locale === null || locale === void 0 || (_locale$dateLocale = locale.dateLocale) === null || _locale$dateLocale === void 0 ? void 0 : _locale$dateLocale.options) !== null && _locale$dateLocale$op !== void 0 ? _locale$dateLocale$op : {},
|
|
98
98
|
firstWeekContainsDate = _ref3.firstWeekContainsDate,
|
|
99
99
|
weekStartsOn = _ref3.weekStartsOn;
|
|
100
100
|
var week = format(weekendDate, isoWeek ? 'I' : 'w', {
|
|
@@ -44,7 +44,7 @@ var MonthDropdownItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
44
44
|
if (disabled) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
onSelect === null || onSelect === void 0
|
|
47
|
+
onSelect === null || onSelect === void 0 || onSelect(currentMonth, event);
|
|
48
48
|
});
|
|
49
49
|
var _useClassNames = useClassNames(classPrefix),
|
|
50
50
|
prefix = _useClassNames.prefix,
|
|
@@ -52,7 +52,7 @@ var TimeDropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
52
52
|
nextDate = setSeconds(nextDate, d);
|
|
53
53
|
break;
|
|
54
54
|
}
|
|
55
|
-
onSelect === null || onSelect === void 0
|
|
55
|
+
onSelect === null || onSelect === void 0 || onSelect(nextDate, event);
|
|
56
56
|
});
|
|
57
57
|
var handleClickMeridiem = useEventCallback(function (meridiem, event) {
|
|
58
58
|
var tempDate = date || startOfToday();
|
|
@@ -66,7 +66,7 @@ var TimeDropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
66
66
|
};
|
|
67
67
|
var nextHours = adjustHours(meridiem, hours);
|
|
68
68
|
var nextDate = setHours(tempDate, nextHours);
|
|
69
|
-
onSelect === null || onSelect === void 0
|
|
69
|
+
onSelect === null || onSelect === void 0 || onSelect(nextDate, event);
|
|
70
70
|
});
|
|
71
71
|
var _useClassNames = useClassNames(classPrefix),
|
|
72
72
|
prefix = _useClassNames.prefix,
|
|
@@ -89,7 +89,7 @@ var TimeDropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
89
|
'cell-active': value === i,
|
|
90
90
|
'cell-disabled': disabled
|
|
91
91
|
});
|
|
92
|
-
items.push(
|
|
92
|
+
items.push(/*#__PURE__*/React.createElement("li", {
|
|
93
93
|
key: i,
|
|
94
94
|
role: "option",
|
|
95
95
|
tabIndex: -1,
|
|
@@ -15,19 +15,19 @@ export var useCalendarState = function useCalendarState(props) {
|
|
|
15
15
|
setCalendarState(undefined);
|
|
16
16
|
if (calendarState === CalendarState.TIME) {
|
|
17
17
|
var _props$onToggleTimeDr;
|
|
18
|
-
(_props$onToggleTimeDr = props.onToggleTimeDropdown) === null || _props$onToggleTimeDr === void 0
|
|
18
|
+
(_props$onToggleTimeDr = props.onToggleTimeDropdown) === null || _props$onToggleTimeDr === void 0 || _props$onToggleTimeDr.call(props, false);
|
|
19
19
|
} else if (calendarState === CalendarState.MONTH) {
|
|
20
20
|
var _props$onToggleMonthD;
|
|
21
|
-
(_props$onToggleMonthD = props.onToggleMonthDropdown) === null || _props$onToggleMonthD === void 0
|
|
21
|
+
(_props$onToggleMonthD = props.onToggleMonthDropdown) === null || _props$onToggleMonthD === void 0 || _props$onToggleMonthD.call(props, false);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
var onMoveForward = useEventCallback(function () {
|
|
25
25
|
var _props$onMoveForward;
|
|
26
|
-
(_props$onMoveForward = props.onMoveForward) === null || _props$onMoveForward === void 0
|
|
26
|
+
(_props$onMoveForward = props.onMoveForward) === null || _props$onMoveForward === void 0 || _props$onMoveForward.call(props, addMonths(props.calendarDate, 1));
|
|
27
27
|
});
|
|
28
28
|
var onMoveBackward = useEventCallback(function () {
|
|
29
29
|
var _props$onMoveBackward;
|
|
30
|
-
(_props$onMoveBackward = props.onMoveBackward) === null || _props$onMoveBackward === void 0
|
|
30
|
+
(_props$onMoveBackward = props.onMoveBackward) === null || _props$onMoveBackward === void 0 || _props$onMoveBackward.call(props, addMonths(props.calendarDate, -1));
|
|
31
31
|
});
|
|
32
32
|
var onToggleTimeDropdown = useEventCallback(function () {
|
|
33
33
|
var _props$onToggleTimeDr2;
|
|
@@ -36,7 +36,7 @@ export var useCalendarState = function useCalendarState(props) {
|
|
|
36
36
|
} else {
|
|
37
37
|
setCalendarState(CalendarState.TIME);
|
|
38
38
|
}
|
|
39
|
-
(_props$onToggleTimeDr2 = props.onToggleTimeDropdown) === null || _props$onToggleTimeDr2 === void 0
|
|
39
|
+
(_props$onToggleTimeDr2 = props.onToggleTimeDropdown) === null || _props$onToggleTimeDr2 === void 0 || _props$onToggleTimeDr2.call(props, calendarState !== CalendarState.TIME);
|
|
40
40
|
});
|
|
41
41
|
var onToggleMonthDropdown = useEventCallback(function () {
|
|
42
42
|
var _props$onToggleMonthD2;
|
|
@@ -45,7 +45,7 @@ export var useCalendarState = function useCalendarState(props) {
|
|
|
45
45
|
} else {
|
|
46
46
|
setCalendarState(CalendarState.MONTH);
|
|
47
47
|
}
|
|
48
|
-
(_props$onToggleMonthD2 = props.onToggleMonthDropdown) === null || _props$onToggleMonthD2 === void 0
|
|
48
|
+
(_props$onToggleMonthD2 = props.onToggleMonthDropdown) === null || _props$onToggleMonthD2 === void 0 || _props$onToggleMonthD2.call(props, calendarState !== CalendarState.MONTH);
|
|
49
49
|
});
|
|
50
50
|
var handlers = useMemo(function () {
|
|
51
51
|
return {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import CardHeader from './CardHeader';
|
|
2
|
+
import CardBody from './CardBody';
|
|
3
|
+
import CardFooter from './CardFooter';
|
|
4
|
+
import type { WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
5
|
+
export interface CardProps extends WithAsProps {
|
|
6
|
+
/**
|
|
7
|
+
* Show border
|
|
8
|
+
*/
|
|
9
|
+
bordered?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Whether there is a shadow
|
|
12
|
+
*/
|
|
13
|
+
shaded?: boolean | 'hover';
|
|
14
|
+
/**
|
|
15
|
+
* The width of the card
|
|
16
|
+
*/
|
|
17
|
+
width?: number | string;
|
|
18
|
+
/**
|
|
19
|
+
* The direction of the card
|
|
20
|
+
*/
|
|
21
|
+
direction?: 'row' | 'column';
|
|
22
|
+
/**
|
|
23
|
+
* Different sizes
|
|
24
|
+
*/
|
|
25
|
+
size?: 'lg' | 'md' | 'sm';
|
|
26
|
+
}
|
|
27
|
+
interface CardComponent extends RsRefForwardingComponent<'div', CardProps> {
|
|
28
|
+
Header: typeof CardHeader;
|
|
29
|
+
Body: typeof CardBody;
|
|
30
|
+
Footer: typeof CardFooter;
|
|
31
|
+
}
|
|
32
|
+
declare const Card: CardComponent;
|
|
33
|
+
export default Card;
|
package/esm/Card/Card.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
var _excluded = ["as", "bordered", "classPrefix", "className", "children", "direction", "shaded", "style", "size", "width"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import CardHeader from "./CardHeader.js";
|
|
8
|
+
import CardBody from "./CardBody.js";
|
|
9
|
+
import CardFooter from "./CardFooter.js";
|
|
10
|
+
import { useCustom } from "../CustomProvider/index.js";
|
|
11
|
+
import { useClassNames } from "../internals/hooks/index.js";
|
|
12
|
+
import { oneOf } from "../internals/propTypes/index.js";
|
|
13
|
+
var Card = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
|
+
var _withClassPrefix;
|
|
15
|
+
var _useCustom = useCustom('Card', props),
|
|
16
|
+
propsWithDefaults = _useCustom.propsWithDefaults;
|
|
17
|
+
var _propsWithDefaults$as = propsWithDefaults.as,
|
|
18
|
+
Component = _propsWithDefaults$as === void 0 ? 'div' : _propsWithDefaults$as,
|
|
19
|
+
_propsWithDefaults$bo = propsWithDefaults.bordered,
|
|
20
|
+
bordered = _propsWithDefaults$bo === void 0 ? true : _propsWithDefaults$bo,
|
|
21
|
+
_propsWithDefaults$cl = propsWithDefaults.classPrefix,
|
|
22
|
+
classPrefix = _propsWithDefaults$cl === void 0 ? 'card' : _propsWithDefaults$cl,
|
|
23
|
+
className = propsWithDefaults.className,
|
|
24
|
+
children = propsWithDefaults.children,
|
|
25
|
+
direction = propsWithDefaults.direction,
|
|
26
|
+
shaded = propsWithDefaults.shaded,
|
|
27
|
+
style = propsWithDefaults.style,
|
|
28
|
+
size = propsWithDefaults.size,
|
|
29
|
+
width = propsWithDefaults.width,
|
|
30
|
+
rest = _objectWithoutPropertiesLoose(propsWithDefaults, _excluded);
|
|
31
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
32
|
+
merge = _useClassNames.merge,
|
|
33
|
+
withClassPrefix = _useClassNames.withClassPrefix;
|
|
34
|
+
var classes = merge(className, withClassPrefix(direction, size, (_withClassPrefix = {
|
|
35
|
+
bordered: bordered,
|
|
36
|
+
shaded: shaded === true
|
|
37
|
+
}, _withClassPrefix['shaded-hover'] = shaded === 'hover', _withClassPrefix)));
|
|
38
|
+
var styles = _extends({}, style, {
|
|
39
|
+
'--rs-card-width': typeof width === 'number' ? width + "px" : width
|
|
40
|
+
});
|
|
41
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
42
|
+
ref: ref,
|
|
43
|
+
className: classes,
|
|
44
|
+
style: styles
|
|
45
|
+
}, rest), children);
|
|
46
|
+
});
|
|
47
|
+
Card.displayName = 'Card';
|
|
48
|
+
Card.Header = CardHeader;
|
|
49
|
+
Card.Body = CardBody;
|
|
50
|
+
Card.Footer = CardFooter;
|
|
51
|
+
Card.propTypes = {
|
|
52
|
+
bordered: PropTypes.bool,
|
|
53
|
+
shaded: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['hover'])]),
|
|
54
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
55
|
+
direction: oneOf(['row', 'column']),
|
|
56
|
+
size: oneOf(['lg', 'md', 'sm'])
|
|
57
|
+
};
|
|
58
|
+
export default Card;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WithAsProps, RsRefForwardingComponent } from '../internals/types';
|
|
2
|
+
export interface CardGroupProps extends WithAsProps {
|
|
3
|
+
/**
|
|
4
|
+
* The number of columns in the group
|
|
5
|
+
*/
|
|
6
|
+
columns?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Spacing between columns
|
|
9
|
+
*/
|
|
10
|
+
spacing?: number | string;
|
|
11
|
+
}
|
|
12
|
+
declare const CardGroup: RsRefForwardingComponent<'div', CardGroupProps>;
|
|
13
|
+
export default CardGroup;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
var _excluded = ["as", "classPrefix", "className", "children", "columns", "spacing", "style"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import { useClassNames } from "../internals/hooks/index.js";
|
|
8
|
+
import { useCustom } from "../CustomProvider/index.js";
|
|
9
|
+
var CardGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
|
+
var _useCustom = useCustom('CardGroup', props),
|
|
11
|
+
propsWithDefaults = _useCustom.propsWithDefaults;
|
|
12
|
+
var _propsWithDefaults$as = propsWithDefaults.as,
|
|
13
|
+
Component = _propsWithDefaults$as === void 0 ? 'div' : _propsWithDefaults$as,
|
|
14
|
+
_propsWithDefaults$cl = propsWithDefaults.classPrefix,
|
|
15
|
+
classPrefix = _propsWithDefaults$cl === void 0 ? 'card-group' : _propsWithDefaults$cl,
|
|
16
|
+
className = propsWithDefaults.className,
|
|
17
|
+
children = propsWithDefaults.children,
|
|
18
|
+
columns = propsWithDefaults.columns,
|
|
19
|
+
_propsWithDefaults$sp = propsWithDefaults.spacing,
|
|
20
|
+
spacing = _propsWithDefaults$sp === void 0 ? 16 : _propsWithDefaults$sp,
|
|
21
|
+
style = propsWithDefaults.style,
|
|
22
|
+
rest = _objectWithoutPropertiesLoose(propsWithDefaults, _excluded);
|
|
23
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
24
|
+
merge = _useClassNames.merge,
|
|
25
|
+
withClassPrefix = _useClassNames.withClassPrefix;
|
|
26
|
+
var classes = merge(className, withClassPrefix());
|
|
27
|
+
var styles = _extends({}, style, {
|
|
28
|
+
'--rs-columns': columns,
|
|
29
|
+
'--rs-spacing': typeof spacing === 'number' ? spacing + "px" : spacing
|
|
30
|
+
});
|
|
31
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
32
|
+
ref: ref,
|
|
33
|
+
className: classes,
|
|
34
|
+
style: styles
|
|
35
|
+
}, rest), children);
|
|
36
|
+
});
|
|
37
|
+
CardGroup.displayName = 'CardGroup';
|
|
38
|
+
CardGroup.propTypes = {
|
|
39
|
+
columns: PropTypes.number,
|
|
40
|
+
spacing: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
41
|
+
};
|
|
42
|
+
export default CardGroup;
|
package/esm/Carousel/Carousel.js
CHANGED
|
@@ -80,17 +80,17 @@ var Carousel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
80
80
|
// When index is greater than count, start from 1 again.
|
|
81
81
|
var nextIndex = index % count;
|
|
82
82
|
setActiveIndex(nextIndex);
|
|
83
|
-
onSlideStart === null || onSlideStart === void 0
|
|
83
|
+
onSlideStart === null || onSlideStart === void 0 || onSlideStart(nextIndex, event);
|
|
84
84
|
setLastIndex(nextActiveIndex == null ? activeIndex : nextIndex);
|
|
85
85
|
reset();
|
|
86
86
|
}, [activeIndex, count, setActiveIndex, clear, onSlideStart, reset]);
|
|
87
87
|
var handleChange = function handleChange(event) {
|
|
88
88
|
var activeIndex = +event.target.value;
|
|
89
89
|
handleSlide(activeIndex, event);
|
|
90
|
-
onSelect === null || onSelect === void 0
|
|
90
|
+
onSelect === null || onSelect === void 0 || onSelect(activeIndex, event);
|
|
91
91
|
};
|
|
92
92
|
var handleTransitionEnd = useCallback(function (event) {
|
|
93
|
-
onSlideEnd === null || onSlideEnd === void 0
|
|
93
|
+
onSlideEnd === null || onSlideEnd === void 0 || onSlideEnd(activeIndex, event);
|
|
94
94
|
}, [activeIndex, onSlideEnd]);
|
|
95
95
|
var uniqueId = useMemo(function () {
|
|
96
96
|
return guid();
|
|
@@ -101,7 +101,7 @@ var Carousel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
var inputKey = "indicator_" + uniqueId + "_" + index;
|
|
104
|
-
labels.push(
|
|
104
|
+
labels.push(/*#__PURE__*/React.createElement("li", {
|
|
105
105
|
key: "label" + index,
|
|
106
106
|
className: prefix('label-wrapper')
|
|
107
107
|
}, /*#__PURE__*/React.createElement("input", {
|
|
@@ -79,7 +79,7 @@ var CascadeTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
79
79
|
var isLeafNode = node.isLeafNode,
|
|
80
80
|
cascadePaths = node.cascadePaths,
|
|
81
81
|
itemData = node.itemData;
|
|
82
|
-
onSelect === null || onSelect === void 0
|
|
82
|
+
onSelect === null || onSelect === void 0 || onSelect(itemData, cascadePaths, event);
|
|
83
83
|
if (isLeafNode) {
|
|
84
84
|
var nextValue = itemData[valueKey];
|
|
85
85
|
setValue(nextValue);
|
|
@@ -88,7 +88,7 @@ var TreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
88
88
|
var handleSelect = useEventCallback(function (layer, itemData, event) {
|
|
89
89
|
var isLeafNode = isNil(itemData[childrenKey]);
|
|
90
90
|
var cascadePaths = getCascadePaths(layer + 1, itemData);
|
|
91
|
-
onSelect === null || onSelect === void 0
|
|
91
|
+
onSelect === null || onSelect === void 0 || onSelect({
|
|
92
92
|
itemData: itemData,
|
|
93
93
|
cascadePaths: cascadePaths,
|
|
94
94
|
isLeafNode: isLeafNode
|
|
@@ -12,12 +12,12 @@ function useSearch(props) {
|
|
|
12
12
|
flattenedData = props.flattenedData,
|
|
13
13
|
parentSelectable = props.parentSelectable,
|
|
14
14
|
onSearch = props.onSearch;
|
|
15
|
-
var
|
|
15
|
+
var _someKeyword = function someKeyword(item, keyword) {
|
|
16
16
|
if (item[labelKey].match(new RegExp(getSafeRegExpString(keyword || searchKeyword), 'i'))) {
|
|
17
17
|
return true;
|
|
18
18
|
}
|
|
19
19
|
var parent = parentMap.get(item);
|
|
20
|
-
if (parent &&
|
|
20
|
+
if (parent && _someKeyword(parent)) {
|
|
21
21
|
return true;
|
|
22
22
|
}
|
|
23
23
|
return false;
|
|
@@ -28,7 +28,7 @@ function useSearch(props) {
|
|
|
28
28
|
if (!parentSelectable && item[childrenKey]) {
|
|
29
29
|
return false;
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return _someKeyword(item, keyword);
|
|
32
32
|
});
|
|
33
33
|
for (var i = 0; i < result.length; i++) {
|
|
34
34
|
items.push(result[i]);
|
|
@@ -43,7 +43,7 @@ function useSearch(props) {
|
|
|
43
43
|
var handleSearch = useEventCallback(function (value, event) {
|
|
44
44
|
var items = getSearchResult(value);
|
|
45
45
|
setSearchKeyword(value);
|
|
46
|
-
onSearch === null || onSearch === void 0
|
|
46
|
+
onSearch === null || onSearch === void 0 || onSearch(value, items, event);
|
|
47
47
|
});
|
|
48
48
|
return {
|
|
49
49
|
searchKeyword: searchKeyword,
|
|
@@ -47,10 +47,10 @@ var useSelect = function useSelect(props) {
|
|
|
47
47
|
if (isLeafNode) {
|
|
48
48
|
var nextValue = itemData[valueKey];
|
|
49
49
|
if (!shallowEqual(value, nextValue)) {
|
|
50
|
-
onChange === null || onChange === void 0
|
|
50
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
onSelect === null || onSelect === void 0
|
|
53
|
+
onSelect === null || onSelect === void 0 || onSelect(node, event);
|
|
54
54
|
});
|
|
55
55
|
return {
|
|
56
56
|
loadingItemsSet: loadingItemsSet,
|