rsuite 6.1.2 → 6.2.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 +27 -0
- package/Timeline/styles/index.css +11 -0
- package/Timeline/styles/index.scss +13 -0
- package/Uploader/styles/index.css +3 -0
- package/Uploader/styles/index.scss +3 -0
- package/cjs/Affix/Affix.js +4 -4
- package/cjs/Animation/Collapse.js +4 -5
- package/cjs/Animation/Transition.d.ts +2 -2
- package/cjs/Animation/Transition.js +17 -20
- package/cjs/AutoComplete/AutoComplete.d.ts +2 -0
- package/cjs/AutoComplete/AutoComplete.js +12 -10
- package/cjs/Avatar/useImage.js +1 -1
- package/cjs/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/cjs/Badge/Badge.js +1 -4
- package/cjs/Breadcrumb/Breadcrumb.js +4 -4
- package/cjs/Button/Button.js +6 -6
- package/cjs/Calendar/Calendar.js +5 -5
- package/cjs/Calendar/CalendarBody.js +1 -1
- package/cjs/Calendar/CalendarContainer.js +14 -33
- package/cjs/Calendar/CalendarHeader.js +7 -8
- package/cjs/Calendar/Grid/GridCell.js +2 -2
- package/cjs/Calendar/Grid/GridHeaderRow.js +1 -1
- package/cjs/Calendar/Grid/GridRow.js +5 -6
- package/cjs/Calendar/MonthDropdown/MonthDropdown.js +1 -1
- package/cjs/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/cjs/Calendar/TimeDropdown/TimeDropdown.js +12 -14
- package/cjs/Calendar/hooks/useCalendar.d.ts +16 -17
- package/cjs/Calendar/hooks/useCalendar.js +2 -4
- package/cjs/Calendar/hooks/useCalendarDate.js +5 -9
- package/cjs/Calendar/hooks/useCalendarState.js +6 -12
- package/cjs/Calendar/types.d.ts +0 -1
- package/cjs/Carousel/Carousel.js +5 -6
- package/cjs/CascadeTree/CascadeTree.js +6 -16
- package/cjs/CascadeTree/TreeView.js +5 -7
- package/cjs/CascadeTree/hooks/useSearch.d.ts +0 -1
- package/cjs/CascadeTree/hooks/useSearch.js +1 -1
- package/cjs/CascadeTree/hooks/useSelect.d.ts +0 -1
- package/cjs/CascadeTree/hooks/useSelect.js +3 -4
- package/cjs/CascadeTree/types.d.ts +0 -1
- package/cjs/CascadeTree/utils.js +1 -2
- package/cjs/Cascader/Cascader.js +18 -29
- package/cjs/Cascader/useActive.d.ts +0 -1
- package/cjs/Cascader/useActive.js +4 -6
- package/cjs/CheckPicker/CheckPicker.js +14 -15
- package/cjs/CheckTree/CheckTree.js +1 -1
- package/cjs/CheckTree/CheckTreeNode.js +3 -4
- package/cjs/CheckTree/CheckTreeView.js +5 -5
- package/cjs/CheckTree/hooks/useTreeCheckState.js +2 -2
- package/cjs/CheckTree/utils.js +9 -17
- package/cjs/CheckTreePicker/CheckTreePicker.js +7 -7
- package/cjs/CheckTreePicker/hooks/useFocusState.d.ts +0 -1
- package/cjs/CheckTreePicker/hooks/useFocusState.js +3 -6
- package/cjs/Checkbox/Checkbox.js +4 -5
- package/cjs/Checkbox/hooks/useIndeterminateCheckbox.d.ts +0 -1
- package/cjs/Checkbox/hooks/useIndeterminateCheckbox.js +1 -1
- package/cjs/CheckboxGroup/CheckboxGroup.js +2 -2
- package/cjs/DOMHelper/index.d.ts +1 -2
- package/cjs/DOMHelper/isElement.js +1 -1
- package/cjs/DateInput/DateField.d.ts +122 -3
- package/cjs/DateInput/DateField.js +12 -15
- package/cjs/DateInput/DateInput.js +3 -4
- package/cjs/DateInput/hooks/useDateInputState.d.ts +124 -4
- package/cjs/DateInput/hooks/useDateInputState.js +2 -2
- package/cjs/DateInput/hooks/useIsFocused.js +2 -2
- package/cjs/DateInput/hooks/useKeyboardInputEvent.d.ts +0 -1
- package/cjs/DateInput/hooks/useKeyboardInputEvent.js +8 -9
- package/cjs/DateInput/hooks/useSelectedState.d.ts +0 -1
- package/cjs/DateInput/utils.d.ts +0 -1
- package/cjs/DateInput/utils.js +2 -3
- package/cjs/DatePicker/DatePicker.js +18 -25
- package/cjs/DatePicker/PredefinedRanges.js +3 -3
- package/cjs/DatePicker/Toolbar.js +4 -4
- package/cjs/DatePicker/hooks/useCustomizedInput.d.ts +0 -1
- package/cjs/DatePicker/hooks/useFocus.js +5 -8
- package/cjs/DatePicker/hooks/useMonthView.d.ts +0 -1
- package/cjs/DatePicker/hooks/useMonthView.js +1 -1
- package/cjs/DatePicker/utils.d.ts +1 -2
- package/cjs/DatePicker/utils.js +2 -2
- package/cjs/DateRangeInput/DateRangeInput.js +8 -9
- package/cjs/DateRangePicker/Calendar.js +2 -2
- package/cjs/DateRangePicker/DateRangePicker.js +25 -29
- package/cjs/DateRangePicker/Header.js +3 -3
- package/cjs/DateRangePicker/disabledDateUtils.js +2 -2
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.d.ts +0 -1
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/cjs/DateRangePicker/utils.js +1 -2
- package/cjs/Dropdown/Dropdown.js +3 -3
- package/cjs/Dropdown/DropdownItem.js +4 -5
- package/cjs/Dropdown/DropdownMenu.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.js +1 -1
- package/cjs/Form/Form.d.ts +38 -3
- package/cjs/Form/Form.js +25 -12
- package/cjs/Form/hooks/useFormRef.d.ts +0 -1
- package/cjs/Form/hooks/useFormValidate.d.ts +2 -1
- package/cjs/Form/hooks/useFormValidate.js +136 -20
- package/cjs/Form/hooks/useFormValue.d.ts +0 -1
- package/cjs/Form/index.d.ts +1 -0
- package/cjs/Form/resolvers.d.ts +59 -0
- package/cjs/Form/resolvers.js +4 -0
- package/cjs/FormControl/FormControl.js +5 -5
- package/cjs/FormGroup/FormGroupContext.d.ts +1 -1
- package/cjs/Highlight/utils/highlightText.js +1 -1
- package/cjs/InlineEdit/renderChildren.js +5 -6
- package/cjs/InlineEdit/useEditState.js +9 -12
- package/cjs/InlineEdit/useFocusEvent.d.ts +0 -1
- package/cjs/InlineEdit/useFocusEvent.js +7 -11
- package/cjs/Input/Input.js +1 -1
- package/cjs/InputGroup/InputGroupContext.d.ts +2 -1
- package/cjs/InputNumber/index.d.ts +0 -1
- package/cjs/InputPicker/InputAutosize.js +1 -1
- package/cjs/InputPicker/InputPicker.js +30 -35
- package/cjs/InputPicker/InputSearch.js +1 -2
- package/cjs/InputPicker/hooks/useData.d.ts +0 -1
- package/cjs/InputPicker/hooks/useData.js +1 -1
- package/cjs/InputPicker/hooks/useInput.js +3 -6
- package/cjs/InputPicker/hooks/useMaxWidth.js +2 -4
- package/cjs/List/helper/AutoScroller.js +2 -4
- package/cjs/List/helper/useSortHelper.d.ts +4 -4
- package/cjs/List/helper/useSortHelper.js +13 -19
- package/cjs/MaskedInput/TextMask.d.ts +5 -5
- package/cjs/MaskedInput/TextMask.js +3 -5
- package/cjs/MaskedInput/conformToMask.d.ts +1 -1
- package/cjs/MaskedInput/createTextMaskInputElement.js +2 -3
- package/cjs/Menu/MenuItem.js +3 -4
- package/cjs/Message/Message.js +1 -1
- package/cjs/Modal/Modal.js +8 -10
- package/cjs/Modal/ModalBody.js +1 -1
- package/cjs/Modal/utils.d.ts +2 -3
- package/cjs/Modal/utils.js +2 -3
- package/cjs/MultiCascadeTree/SearchView.js +1 -1
- package/cjs/MultiCascadeTree/TreeView.js +2 -2
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.d.ts +0 -1
- package/cjs/MultiCascadeTree/hooks/useCascadeValue.js +5 -8
- package/cjs/MultiCascadeTree/hooks/useColumnData.d.ts +0 -1
- package/cjs/MultiCascadeTree/hooks/useSearch.d.ts +0 -1
- package/cjs/MultiCascadeTree/hooks/useSearch.js +2 -2
- package/cjs/MultiCascadeTree/hooks/useSelect.js +3 -4
- package/cjs/MultiCascadeTree/types.d.ts +0 -1
- package/cjs/MultiCascadeTree/utils.d.ts +4 -4
- package/cjs/MultiCascadeTree/utils.js +2 -3
- package/cjs/MultiCascader/MultiCascader.js +13 -16
- package/cjs/Nav/AdaptiveNavItem.js +2 -3
- package/cjs/Nav/Nav.d.ts +1 -1
- package/cjs/Nav/Nav.js +4 -4
- package/cjs/Nav/NavDropdown.d.ts +1 -1
- package/cjs/Nav/NavDropdown.js +3 -3
- package/cjs/Nav/NavDropdownItem.js +2 -2
- package/cjs/Nav/NavDropdownMenu.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.js +1 -1
- package/cjs/Nav/NavItem.js +4 -4
- package/cjs/Navbar/Navbar.js +1 -1
- package/cjs/Navbar/NavbarContent.js +1 -1
- package/cjs/Navbar/NavbarDrawer.js +1 -1
- package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.js +3 -3
- package/cjs/Navbar/NavbarDropdownItem.js +5 -6
- package/cjs/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownMenu.js +1 -1
- package/cjs/Navbar/NavbarItem.js +4 -4
- package/cjs/Navbar/NavbarToggle.js +2 -2
- package/cjs/Notification/Notification.js +1 -1
- package/cjs/NumberInput/NumberInput.js +3 -3
- package/cjs/NumberInput/hooks/useEvents.d.ts +0 -1
- package/cjs/NumberInput/hooks/useEvents.js +2 -3
- package/cjs/NumberInput/hooks/useWheelHandler.js +1 -2
- package/cjs/Pagination/Pagination.js +1 -1
- package/cjs/Pagination/PaginationButton.js +1 -1
- package/cjs/Pagination/PaginationGroup.js +3 -4
- package/cjs/Panel/Panel.js +2 -2
- package/cjs/PanelGroup/PanelGroup.js +1 -1
- package/cjs/PasswordInput/PasswordInput.js +2 -2
- package/cjs/PinInput/PinInput.js +1 -1
- package/cjs/PinInput/hooks/usePinInputRefs.d.ts +0 -1
- package/cjs/PinInput/hooks/usePinInputRefs.js +2 -4
- package/cjs/PinInput/hooks/usePinValue.d.ts +1 -1
- package/cjs/PinInput/hooks/usePinValue.js +2 -2
- package/cjs/Progress/ProgressLine.js +1 -1
- package/cjs/Progress/types.d.ts +0 -1
- package/cjs/ProgressCircle/hooks/useProgressCirclePath.d.ts +0 -1
- package/cjs/Radio/Radio.js +3 -3
- 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 +6 -6
- package/cjs/Rate/Character.js +2 -2
- package/cjs/Rate/Rate.js +3 -3
- package/cjs/Rate/useRatingStates.d.ts +0 -1
- package/cjs/SegmentedControl/SegmentedControl.js +3 -3
- package/cjs/SegmentedControl/hooks/useIndicatorPosition.js +1 -1
- package/cjs/SelectPicker/SelectPicker.js +13 -16
- package/cjs/Sidebar/Sidebar.js +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdown.js +6 -6
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +4 -5
- package/cjs/Sidenav/Node.js +9 -16
- package/cjs/Sidenav/Sidenav.js +2 -2
- package/cjs/Sidenav/SidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdown.js +4 -4
- package/cjs/Sidenav/SidenavDropdownItem.js +3 -4
- package/cjs/Sidenav/SidenavItem.js +5 -6
- package/cjs/Sidenav/SidenavToggle.js +2 -2
- package/cjs/Slider/Slider.js +3 -3
- package/cjs/Slider/useDrag.d.ts +0 -1
- package/cjs/Slider/useDrag.js +7 -12
- package/cjs/Slider/utils.d.ts +1 -2
- package/cjs/Slider/utils.js +2 -3
- package/cjs/Steps/StepItem.js +1 -2
- package/cjs/Table/Table.d.ts +3 -3
- package/cjs/Tabs/Tabs.js +3 -4
- package/cjs/TimePicker/TimePicker.js +2 -2
- package/cjs/Timeline/Timeline.d.ts +6 -1
- package/cjs/Timeline/Timeline.js +14 -10
- package/cjs/Toggle/Toggle.js +2 -2
- package/cjs/Tree/Tree.js +2 -2
- package/cjs/Tree/TreeNode.js +10 -11
- package/cjs/Tree/TreeView.js +5 -5
- package/cjs/Tree/hooks/useExpandTree.js +1 -1
- package/cjs/Tree/hooks/useFlattenTree.js +6 -9
- package/cjs/Tree/hooks/useFocusTree.d.ts +1 -2
- package/cjs/Tree/hooks/useFocusTree.js +12 -14
- package/cjs/Tree/hooks/useTreeDrag.d.ts +0 -1
- package/cjs/Tree/hooks/useTreeDrag.js +10 -12
- package/cjs/Tree/hooks/useTreeNodeProps.js +1 -1
- package/cjs/Tree/hooks/useTreeSearch.js +4 -4
- package/cjs/Tree/hooks/useVirtualizedTreeData.js +2 -2
- package/cjs/Tree/types.d.ts +2 -3
- package/cjs/Tree/utils/flattenTree.d.ts +1 -1
- package/cjs/Tree/utils/focusableTree.js +5 -8
- package/cjs/Tree/utils/getNodeParentKeys.js +2 -4
- package/cjs/Tree/utils/hasVisibleChildren.d.ts +1 -1
- package/cjs/Tree/utils/treeKeyboardInteractions.js +3 -3
- package/cjs/TreePicker/TreePicker.js +8 -9
- package/cjs/TreePicker/hooks/useFocusState.d.ts +0 -1
- package/cjs/TreePicker/hooks/useFocusState.js +4 -8
- package/cjs/Uploader/UploadFileItem.js +8 -10
- package/cjs/Uploader/UploadTrigger.js +8 -10
- package/cjs/Uploader/Uploader.d.ts +2 -0
- package/cjs/Uploader/Uploader.js +66 -26
- package/cjs/Uploader/utils/ajaxUpload.js +5 -5
- package/cjs/Uploader/utils/previewFile.js +1 -1
- package/cjs/internals/Disclosure/Disclosure.js +5 -8
- package/cjs/internals/Disclosure/DisclosureButton.js +2 -2
- package/cjs/internals/InputBase/InputBase.js +5 -6
- package/cjs/internals/Menu/Menu.js +16 -20
- package/cjs/internals/Menu/MenuItem.js +4 -5
- package/cjs/internals/Menu/Menubar.js +5 -7
- package/cjs/internals/Menu/useMenu.js +5 -10
- package/cjs/internals/Overlay/Modal.js +8 -11
- package/cjs/internals/Overlay/ModalManager.js +3 -5
- package/cjs/internals/Overlay/Overlay.js +1 -1
- package/cjs/internals/Overlay/OverlayTrigger.d.ts +0 -1
- package/cjs/internals/Overlay/OverlayTrigger.js +5 -7
- package/cjs/internals/Overlay/Position.js +6 -8
- package/cjs/internals/Picker/ListCheckItem.js +3 -3
- package/cjs/internals/Picker/ListItem.js +1 -1
- package/cjs/internals/Picker/Listbox.js +9 -10
- package/cjs/internals/Picker/PickerIndicator.js +13 -11
- package/cjs/internals/Picker/PickerPopup.js +4 -5
- package/cjs/internals/Picker/PickerToggle.js +3 -4
- package/cjs/internals/Picker/SelectedElement.js +1 -1
- package/cjs/internals/Picker/hooks/useFocusItemValue.d.ts +0 -1
- package/cjs/internals/Picker/hooks/useFocusItemValue.js +14 -28
- package/cjs/internals/Picker/hooks/usePickerRef.d.ts +0 -1
- package/cjs/internals/Picker/hooks/usePickerRef.js +9 -15
- package/cjs/internals/Picker/hooks/useSearch.d.ts +0 -1
- package/cjs/internals/Picker/hooks/useSearch.js +2 -2
- package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.d.ts +0 -1
- package/cjs/internals/Picker/hooks/useToggleKeyDownEvent.js +13 -17
- package/cjs/internals/Picker/utils.js +9 -9
- package/cjs/internals/Ripple/Ripple.js +3 -4
- package/cjs/internals/SafeAnchor/SafeAnchor.js +1 -1
- package/cjs/internals/ScrollView/hooks/useScrollState.d.ts +0 -1
- package/cjs/internals/ScrollView/hooks/useScrollState.js +2 -3
- package/cjs/internals/Tree/TreeProvider.d.ts +4 -4
- package/cjs/internals/Tree/TreeProvider.js +2 -8
- package/cjs/internals/Tree/types.d.ts +0 -1
- package/cjs/internals/Tree/utils/getParentMap.d.ts +0 -1
- package/cjs/internals/Windowing/AutoSizer.js +2 -3
- package/cjs/internals/Windowing/List.js +4 -8
- package/cjs/internals/constants/index.d.ts +2 -2
- package/cjs/internals/hooks/useClickOutside.js +2 -4
- package/cjs/internals/hooks/useCustom.d.ts +0 -1
- package/cjs/internals/hooks/useCustom.js +5 -7
- package/cjs/internals/hooks/useElementResize.d.ts +0 -1
- package/cjs/internals/hooks/useEventCallback.js +1 -2
- package/cjs/internals/hooks/useEventListener.js +1 -1
- package/cjs/internals/hooks/useFocus.js +2 -4
- package/cjs/internals/hooks/useFocusVirtualListItem.d.ts +0 -1
- package/cjs/internals/hooks/useMount.js +1 -2
- package/cjs/internals/hooks/useRootClose.js +6 -6
- package/cjs/internals/hooks/useTimeout.js +1 -2
- package/cjs/internals/hooks/useToggleCaret.d.ts +0 -1
- package/cjs/internals/hooks/useUniqueId.js +1 -1
- package/cjs/internals/hooks/useUpdatedRef.d.ts +0 -1
- package/cjs/internals/styled-system/style-manager.js +1 -1
- package/cjs/internals/styled-system/useStyled.js +2 -2
- package/cjs/internals/types/utils.d.ts +0 -1
- package/cjs/internals/utils/colours.d.ts +4 -4
- package/cjs/internals/utils/colours.js +1 -1
- package/cjs/internals/utils/date/disableTime.js +6 -12
- package/cjs/internals/utils/date/omitHideDisabledProps.d.ts +1 -1
- package/cjs/internals/utils/date/useDateMode.d.ts +1 -1
- package/cjs/internals/utils/react/ReactChildren.js +1 -2
- package/cjs/internals/utils/react/deprecateComponent.js +1 -2
- package/cjs/internals/utils/react/getDOMNode.js +4 -5
- package/cjs/internals/utils/sizes.d.ts +2 -2
- package/cjs/internals/utils/style-sheet/css.d.ts +0 -1
- package/cjs/internals/utils/style-sheet/css.js +1 -1
- package/cjs/internals/utils/style-sheet/prefix.d.ts +0 -1
- package/cjs/internals/utils/style-sheet/responsive.d.ts +1 -1
- package/cjs/internals/utils/style-sheet/styles.d.ts +3 -3
- package/cjs/internals/utils/style-sheet/styles.js +1 -1
- package/cjs/toaster/ToastContainer.js +3 -5
- package/cjs/toaster/hooks/useDelayedClosure.d.ts +0 -1
- package/cjs/toaster/hooks/useDelayedClosure.js +3 -4
- package/cjs/toaster/toaster.js +42 -15
- package/cjs/useDialog/Dialog.d.ts +1 -1
- package/cjs/useDialog/Dialog.js +1 -1
- package/cjs/useDialog/useDialog.d.ts +1 -1
- package/cjs/useDialog/useDialog.js +3 -3
- package/cjs/useFormControl/hooks/useField.d.ts +0 -1
- package/cjs/useFormControl/hooks/useField.js +5 -7
- package/cjs/useFormControl/hooks/useRegisterModel.js +2 -2
- package/cjs/useFormControl/useFormControl.js +8 -8
- package/cjs/useToaster/useToaster.js +4 -5
- package/dist/rsuite-no-reset.css +14 -0
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite.css +14 -0
- package/dist/rsuite.js +224 -224
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Affix/Affix.js +4 -4
- package/esm/Animation/Collapse.js +1 -2
- package/esm/Animation/Transition.d.ts +2 -2
- package/esm/Animation/Transition.js +17 -20
- package/esm/AutoComplete/AutoComplete.d.ts +2 -0
- package/esm/AutoComplete/AutoComplete.js +12 -10
- package/esm/Avatar/useImage.js +1 -1
- package/esm/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/esm/Badge/Badge.js +1 -4
- package/esm/Breadcrumb/Breadcrumb.js +4 -4
- package/esm/Button/Button.js +6 -6
- package/esm/Calendar/Calendar.js +5 -5
- package/esm/Calendar/CalendarBody.js +1 -1
- package/esm/Calendar/CalendarContainer.js +14 -33
- package/esm/Calendar/CalendarHeader.js +7 -8
- package/esm/Calendar/Grid/GridCell.js +2 -2
- package/esm/Calendar/Grid/GridHeaderRow.js +1 -1
- package/esm/Calendar/Grid/GridRow.js +5 -6
- package/esm/Calendar/MonthDropdown/MonthDropdown.js +1 -1
- package/esm/Calendar/MonthDropdown/MonthDropdownItem.js +1 -1
- package/esm/Calendar/TimeDropdown/TimeDropdown.js +12 -14
- package/esm/Calendar/hooks/useCalendar.d.ts +16 -17
- package/esm/Calendar/hooks/useCalendar.js +2 -4
- package/esm/Calendar/hooks/useCalendarDate.js +5 -9
- package/esm/Calendar/hooks/useCalendarState.js +6 -12
- package/esm/Calendar/types.d.ts +0 -1
- package/esm/Carousel/Carousel.js +5 -6
- package/esm/CascadeTree/CascadeTree.js +6 -16
- package/esm/CascadeTree/TreeView.js +5 -7
- package/esm/CascadeTree/hooks/useSearch.d.ts +0 -1
- package/esm/CascadeTree/hooks/useSearch.js +1 -1
- package/esm/CascadeTree/hooks/useSelect.d.ts +0 -1
- package/esm/CascadeTree/hooks/useSelect.js +3 -4
- package/esm/CascadeTree/types.d.ts +0 -1
- package/esm/CascadeTree/utils.js +1 -2
- package/esm/Cascader/Cascader.js +18 -29
- package/esm/Cascader/useActive.d.ts +0 -1
- package/esm/Cascader/useActive.js +4 -6
- package/esm/CheckPicker/CheckPicker.js +14 -15
- package/esm/CheckTree/CheckTree.js +1 -1
- package/esm/CheckTree/CheckTreeNode.js +3 -4
- package/esm/CheckTree/CheckTreeView.js +5 -5
- package/esm/CheckTree/hooks/useTreeCheckState.js +2 -2
- package/esm/CheckTree/utils.js +9 -17
- package/esm/CheckTreePicker/CheckTreePicker.js +7 -7
- package/esm/CheckTreePicker/hooks/useFocusState.d.ts +0 -1
- package/esm/CheckTreePicker/hooks/useFocusState.js +3 -6
- package/esm/Checkbox/Checkbox.js +4 -5
- package/esm/Checkbox/hooks/useIndeterminateCheckbox.d.ts +0 -1
- package/esm/Checkbox/hooks/useIndeterminateCheckbox.js +1 -1
- package/esm/CheckboxGroup/CheckboxGroup.js +2 -2
- package/esm/DOMHelper/index.d.ts +1 -2
- package/esm/DOMHelper/isElement.js +1 -1
- package/esm/DateInput/DateField.d.ts +122 -3
- package/esm/DateInput/DateField.js +12 -15
- package/esm/DateInput/DateInput.js +3 -4
- package/esm/DateInput/hooks/useDateInputState.d.ts +124 -4
- package/esm/DateInput/hooks/useDateInputState.js +2 -2
- package/esm/DateInput/hooks/useIsFocused.js +2 -2
- package/esm/DateInput/hooks/useKeyboardInputEvent.d.ts +0 -1
- package/esm/DateInput/hooks/useKeyboardInputEvent.js +8 -9
- package/esm/DateInput/hooks/useSelectedState.d.ts +0 -1
- package/esm/DateInput/utils.d.ts +0 -1
- package/esm/DateInput/utils.js +2 -3
- package/esm/DatePicker/DatePicker.js +18 -25
- package/esm/DatePicker/PredefinedRanges.js +3 -3
- package/esm/DatePicker/Toolbar.js +4 -4
- package/esm/DatePicker/hooks/useCustomizedInput.d.ts +0 -1
- package/esm/DatePicker/hooks/useFocus.js +5 -8
- package/esm/DatePicker/hooks/useMonthView.d.ts +0 -1
- package/esm/DatePicker/hooks/useMonthView.js +1 -1
- package/esm/DatePicker/utils.d.ts +1 -2
- package/esm/DatePicker/utils.js +2 -2
- package/esm/DateRangeInput/DateRangeInput.js +8 -9
- package/esm/DateRangePicker/Calendar.js +2 -2
- package/esm/DateRangePicker/DateRangePicker.js +25 -29
- package/esm/DateRangePicker/Header.js +3 -3
- package/esm/DateRangePicker/disabledDateUtils.js +2 -2
- package/esm/DateRangePicker/hooks/useCalendarHandlers.d.ts +0 -1
- package/esm/DateRangePicker/hooks/useCalendarHandlers.js +5 -5
- package/esm/DateRangePicker/utils.js +1 -2
- package/esm/Dropdown/Dropdown.js +3 -3
- package/esm/Dropdown/DropdownItem.js +4 -5
- package/esm/Dropdown/DropdownMenu.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.js +1 -1
- package/esm/Form/Form.d.ts +38 -3
- package/esm/Form/Form.js +25 -12
- package/esm/Form/hooks/useFormRef.d.ts +0 -1
- package/esm/Form/hooks/useFormValidate.d.ts +2 -1
- package/esm/Form/hooks/useFormValidate.js +136 -20
- package/esm/Form/hooks/useFormValue.d.ts +0 -1
- package/esm/Form/index.d.ts +1 -0
- package/esm/Form/resolvers.d.ts +59 -0
- package/esm/Form/resolvers.js +2 -0
- package/esm/FormControl/FormControl.js +5 -5
- package/esm/FormGroup/FormGroupContext.d.ts +1 -1
- package/esm/Highlight/utils/highlightText.js +1 -1
- package/esm/InlineEdit/renderChildren.js +5 -6
- package/esm/InlineEdit/useEditState.js +9 -12
- package/esm/InlineEdit/useFocusEvent.d.ts +0 -1
- package/esm/InlineEdit/useFocusEvent.js +7 -11
- package/esm/Input/Input.js +1 -1
- package/esm/InputGroup/InputGroupContext.d.ts +2 -1
- package/esm/InputNumber/index.d.ts +0 -1
- package/esm/InputPicker/InputAutosize.js +1 -1
- package/esm/InputPicker/InputPicker.js +30 -35
- package/esm/InputPicker/InputSearch.js +1 -2
- package/esm/InputPicker/hooks/useData.d.ts +0 -1
- package/esm/InputPicker/hooks/useData.js +1 -1
- package/esm/InputPicker/hooks/useInput.js +3 -6
- package/esm/InputPicker/hooks/useMaxWidth.js +2 -4
- package/esm/List/helper/AutoScroller.js +2 -4
- package/esm/List/helper/useSortHelper.d.ts +4 -4
- package/esm/List/helper/useSortHelper.js +13 -19
- package/esm/MaskedInput/TextMask.d.ts +5 -5
- package/esm/MaskedInput/TextMask.js +3 -5
- package/esm/MaskedInput/conformToMask.d.ts +1 -1
- package/esm/MaskedInput/createTextMaskInputElement.js +2 -3
- package/esm/Menu/MenuItem.js +3 -4
- package/esm/Message/Message.js +1 -1
- package/esm/Modal/Modal.js +8 -10
- package/esm/Modal/ModalBody.js +1 -1
- package/esm/Modal/utils.d.ts +2 -3
- package/esm/Modal/utils.js +2 -3
- package/esm/MultiCascadeTree/SearchView.js +1 -1
- package/esm/MultiCascadeTree/TreeView.js +2 -2
- package/esm/MultiCascadeTree/hooks/useCascadeValue.d.ts +0 -1
- package/esm/MultiCascadeTree/hooks/useCascadeValue.js +5 -8
- package/esm/MultiCascadeTree/hooks/useColumnData.d.ts +0 -1
- package/esm/MultiCascadeTree/hooks/useSearch.d.ts +0 -1
- package/esm/MultiCascadeTree/hooks/useSearch.js +2 -2
- package/esm/MultiCascadeTree/hooks/useSelect.js +3 -4
- package/esm/MultiCascadeTree/types.d.ts +0 -1
- package/esm/MultiCascadeTree/utils.d.ts +4 -4
- package/esm/MultiCascadeTree/utils.js +2 -3
- package/esm/MultiCascader/MultiCascader.js +13 -16
- package/esm/Nav/AdaptiveNavItem.js +2 -3
- package/esm/Nav/Nav.d.ts +1 -1
- package/esm/Nav/Nav.js +4 -4
- package/esm/Nav/NavDropdown.d.ts +1 -1
- package/esm/Nav/NavDropdown.js +3 -3
- package/esm/Nav/NavDropdownItem.js +2 -2
- package/esm/Nav/NavDropdownMenu.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.js +1 -1
- package/esm/Nav/NavItem.js +4 -4
- package/esm/Navbar/Navbar.js +1 -1
- package/esm/Navbar/NavbarContent.js +1 -1
- package/esm/Navbar/NavbarDrawer.js +1 -1
- package/esm/Navbar/NavbarDropdown.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.js +3 -3
- package/esm/Navbar/NavbarDropdownItem.js +5 -6
- package/esm/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownMenu.js +1 -1
- package/esm/Navbar/NavbarItem.js +4 -4
- package/esm/Navbar/NavbarToggle.js +2 -2
- package/esm/Notification/Notification.js +1 -1
- package/esm/NumberInput/NumberInput.js +3 -3
- package/esm/NumberInput/hooks/useEvents.d.ts +0 -1
- package/esm/NumberInput/hooks/useEvents.js +2 -3
- package/esm/NumberInput/hooks/useWheelHandler.js +1 -2
- package/esm/Pagination/Pagination.js +1 -1
- package/esm/Pagination/PaginationButton.js +1 -1
- package/esm/Pagination/PaginationGroup.js +3 -4
- package/esm/Panel/Panel.js +2 -2
- package/esm/PanelGroup/PanelGroup.js +1 -1
- package/esm/PasswordInput/PasswordInput.js +2 -2
- package/esm/PinInput/PinInput.js +1 -1
- package/esm/PinInput/hooks/usePinInputRefs.d.ts +0 -1
- package/esm/PinInput/hooks/usePinInputRefs.js +2 -4
- package/esm/PinInput/hooks/usePinValue.d.ts +1 -1
- package/esm/PinInput/hooks/usePinValue.js +2 -2
- package/esm/Progress/ProgressLine.js +1 -1
- package/esm/Progress/types.d.ts +0 -1
- package/esm/ProgressCircle/hooks/useProgressCirclePath.d.ts +0 -1
- package/esm/Radio/Radio.js +3 -3
- 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 +6 -6
- package/esm/Rate/Character.js +2 -2
- package/esm/Rate/Rate.js +3 -3
- package/esm/Rate/useRatingStates.d.ts +0 -1
- package/esm/SegmentedControl/SegmentedControl.js +3 -3
- package/esm/SegmentedControl/hooks/useIndicatorPosition.js +1 -1
- package/esm/SelectPicker/SelectPicker.js +13 -16
- package/esm/Sidebar/Sidebar.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdown.js +6 -6
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +4 -5
- package/esm/Sidenav/Node.js +9 -16
- package/esm/Sidenav/Sidenav.js +2 -2
- package/esm/Sidenav/SidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdown.js +4 -4
- package/esm/Sidenav/SidenavDropdownItem.js +3 -4
- package/esm/Sidenav/SidenavItem.js +5 -6
- package/esm/Sidenav/SidenavToggle.js +2 -2
- package/esm/Slider/Slider.js +3 -3
- package/esm/Slider/useDrag.d.ts +0 -1
- package/esm/Slider/useDrag.js +7 -12
- package/esm/Slider/utils.d.ts +1 -2
- package/esm/Slider/utils.js +2 -3
- package/esm/Steps/StepItem.js +1 -2
- package/esm/Table/Table.d.ts +3 -3
- package/esm/Tabs/Tabs.js +3 -4
- package/esm/TimePicker/TimePicker.js +2 -2
- package/esm/Timeline/Timeline.d.ts +6 -1
- package/esm/Timeline/Timeline.js +14 -10
- package/esm/Toggle/Toggle.js +2 -2
- package/esm/Tree/Tree.js +2 -2
- package/esm/Tree/TreeNode.js +10 -11
- package/esm/Tree/TreeView.js +5 -5
- package/esm/Tree/hooks/useExpandTree.js +1 -1
- package/esm/Tree/hooks/useFlattenTree.js +6 -9
- package/esm/Tree/hooks/useFocusTree.d.ts +1 -2
- package/esm/Tree/hooks/useFocusTree.js +12 -14
- package/esm/Tree/hooks/useTreeDrag.d.ts +0 -1
- package/esm/Tree/hooks/useTreeDrag.js +10 -12
- package/esm/Tree/hooks/useTreeNodeProps.js +1 -1
- package/esm/Tree/hooks/useTreeSearch.js +4 -4
- package/esm/Tree/hooks/useVirtualizedTreeData.js +2 -2
- package/esm/Tree/types.d.ts +2 -3
- package/esm/Tree/utils/flattenTree.d.ts +1 -1
- package/esm/Tree/utils/focusableTree.js +5 -8
- package/esm/Tree/utils/getNodeParentKeys.js +2 -4
- package/esm/Tree/utils/hasVisibleChildren.d.ts +1 -1
- package/esm/Tree/utils/treeKeyboardInteractions.js +3 -3
- package/esm/TreePicker/TreePicker.js +8 -9
- package/esm/TreePicker/hooks/useFocusState.d.ts +0 -1
- package/esm/TreePicker/hooks/useFocusState.js +4 -8
- package/esm/Uploader/UploadFileItem.js +8 -10
- package/esm/Uploader/UploadTrigger.js +8 -10
- package/esm/Uploader/Uploader.d.ts +2 -0
- package/esm/Uploader/Uploader.js +66 -26
- package/esm/Uploader/utils/ajaxUpload.js +5 -5
- package/esm/Uploader/utils/previewFile.js +1 -1
- package/esm/internals/Disclosure/Disclosure.js +5 -8
- package/esm/internals/Disclosure/DisclosureButton.js +2 -2
- package/esm/internals/InputBase/InputBase.js +5 -6
- package/esm/internals/Menu/Menu.js +16 -20
- package/esm/internals/Menu/MenuItem.js +4 -5
- package/esm/internals/Menu/Menubar.js +5 -7
- package/esm/internals/Menu/useMenu.js +5 -10
- package/esm/internals/Overlay/Modal.js +8 -11
- package/esm/internals/Overlay/ModalManager.js +3 -5
- package/esm/internals/Overlay/Overlay.js +1 -1
- package/esm/internals/Overlay/OverlayTrigger.d.ts +0 -1
- package/esm/internals/Overlay/OverlayTrigger.js +5 -7
- package/esm/internals/Overlay/Position.js +6 -8
- package/esm/internals/Picker/ListCheckItem.js +3 -3
- package/esm/internals/Picker/ListItem.js +1 -1
- package/esm/internals/Picker/Listbox.js +9 -10
- package/esm/internals/Picker/PickerIndicator.js +13 -11
- package/esm/internals/Picker/PickerPopup.js +4 -5
- package/esm/internals/Picker/PickerToggle.js +3 -4
- package/esm/internals/Picker/SelectedElement.js +1 -1
- package/esm/internals/Picker/hooks/useFocusItemValue.d.ts +0 -1
- package/esm/internals/Picker/hooks/useFocusItemValue.js +14 -28
- package/esm/internals/Picker/hooks/usePickerRef.d.ts +0 -1
- package/esm/internals/Picker/hooks/usePickerRef.js +9 -15
- package/esm/internals/Picker/hooks/useSearch.d.ts +0 -1
- package/esm/internals/Picker/hooks/useSearch.js +2 -2
- package/esm/internals/Picker/hooks/useToggleKeyDownEvent.d.ts +0 -1
- package/esm/internals/Picker/hooks/useToggleKeyDownEvent.js +13 -17
- package/esm/internals/Picker/utils.js +9 -9
- package/esm/internals/Ripple/Ripple.js +3 -4
- package/esm/internals/SafeAnchor/SafeAnchor.js +1 -1
- package/esm/internals/ScrollView/hooks/useScrollState.d.ts +0 -1
- package/esm/internals/ScrollView/hooks/useScrollState.js +2 -3
- package/esm/internals/Tree/TreeProvider.d.ts +4 -4
- package/esm/internals/Tree/TreeProvider.js +2 -8
- package/esm/internals/Tree/types.d.ts +0 -1
- package/esm/internals/Tree/utils/getParentMap.d.ts +0 -1
- package/esm/internals/Windowing/AutoSizer.js +2 -3
- package/esm/internals/Windowing/List.js +4 -8
- package/esm/internals/constants/index.d.ts +2 -2
- package/esm/internals/hooks/useClickOutside.js +2 -4
- package/esm/internals/hooks/useCustom.d.ts +0 -1
- package/esm/internals/hooks/useCustom.js +5 -7
- package/esm/internals/hooks/useElementResize.d.ts +0 -1
- package/esm/internals/hooks/useEventCallback.js +1 -2
- package/esm/internals/hooks/useEventListener.js +1 -1
- package/esm/internals/hooks/useFocus.js +2 -4
- package/esm/internals/hooks/useFocusVirtualListItem.d.ts +0 -1
- package/esm/internals/hooks/useMount.js +1 -2
- package/esm/internals/hooks/useRootClose.js +6 -6
- package/esm/internals/hooks/useTimeout.js +1 -2
- package/esm/internals/hooks/useToggleCaret.d.ts +0 -1
- package/esm/internals/hooks/useUniqueId.js +1 -1
- package/esm/internals/hooks/useUpdatedRef.d.ts +0 -1
- package/esm/internals/styled-system/style-manager.js +1 -1
- package/esm/internals/styled-system/useStyled.js +2 -2
- package/esm/internals/types/utils.d.ts +0 -1
- package/esm/internals/utils/colours.d.ts +4 -4
- package/esm/internals/utils/colours.js +1 -1
- package/esm/internals/utils/date/disableTime.js +6 -12
- package/esm/internals/utils/date/omitHideDisabledProps.d.ts +1 -1
- package/esm/internals/utils/date/useDateMode.d.ts +1 -1
- package/esm/internals/utils/react/ReactChildren.js +1 -2
- package/esm/internals/utils/react/deprecateComponent.js +1 -2
- package/esm/internals/utils/react/getDOMNode.js +4 -5
- package/esm/internals/utils/sizes.d.ts +2 -2
- package/esm/internals/utils/style-sheet/css.d.ts +0 -1
- package/esm/internals/utils/style-sheet/css.js +1 -1
- package/esm/internals/utils/style-sheet/prefix.d.ts +0 -1
- package/esm/internals/utils/style-sheet/responsive.d.ts +1 -1
- package/esm/internals/utils/style-sheet/styles.d.ts +3 -3
- package/esm/internals/utils/style-sheet/styles.js +1 -1
- package/esm/toaster/ToastContainer.js +3 -5
- package/esm/toaster/hooks/useDelayedClosure.d.ts +0 -1
- package/esm/toaster/hooks/useDelayedClosure.js +3 -4
- package/esm/toaster/toaster.js +42 -15
- package/esm/useDialog/Dialog.d.ts +1 -1
- package/esm/useDialog/Dialog.js +1 -1
- package/esm/useDialog/useDialog.d.ts +1 -1
- package/esm/useDialog/useDialog.js +3 -3
- package/esm/useFormControl/hooks/useField.d.ts +0 -1
- package/esm/useFormControl/hooks/useField.js +5 -7
- package/esm/useFormControl/hooks/useRegisterModel.js +2 -2
- package/esm/useFormControl/useFormControl.js +8 -8
- package/esm/useToaster/useToaster.js +4 -5
- package/package.json +1 -1
package/cjs/Panel/Panel.js
CHANGED
|
@@ -68,8 +68,8 @@ const Panel = (0, _utils.forwardRef)((props, ref) => {
|
|
|
68
68
|
collapsible: collapsibleProp
|
|
69
69
|
});
|
|
70
70
|
const handleSelect = (0, _hooks.useEventCallback)(event => {
|
|
71
|
-
onSelect
|
|
72
|
-
onGroupSelect
|
|
71
|
+
onSelect?.(eventKey, event);
|
|
72
|
+
onGroupSelect?.(eventKey, event);
|
|
73
73
|
setExpanded(!expanded);
|
|
74
74
|
});
|
|
75
75
|
const classes = merge(className, withPrefix({
|
|
@@ -43,7 +43,7 @@ const PanelGroup = (0, _utils.forwardRef)((props, ref) => {
|
|
|
43
43
|
}));
|
|
44
44
|
const handleSelect = (0, _hooks.useEventCallback)((activeKey, event) => {
|
|
45
45
|
setActiveKey(activeKey);
|
|
46
|
-
onSelect
|
|
46
|
+
onSelect?.(activeKey, event);
|
|
47
47
|
});
|
|
48
48
|
const contextValue = (0, _react.useMemo)(() => ({
|
|
49
49
|
accordion,
|
|
@@ -44,7 +44,7 @@ const PasswordInput = (0, _utils.forwardRef)((props, ref) => {
|
|
|
44
44
|
const classes = merge(className, withPrefix());
|
|
45
45
|
const handleToggleVisibility = (0, _hooks.useEventCallback)(() => {
|
|
46
46
|
setVisible(!visible);
|
|
47
|
-
onVisibleChange
|
|
47
|
+
onVisibleChange?.(!visible);
|
|
48
48
|
});
|
|
49
49
|
return /*#__PURE__*/_react.default.createElement(_InputGroup.default, (0, _extends2.default)({
|
|
50
50
|
inside: true,
|
|
@@ -66,7 +66,7 @@ const PasswordInput = (0, _utils.forwardRef)((props, ref) => {
|
|
|
66
66
|
tabIndex: -1,
|
|
67
67
|
onClick: handleToggleVisibility,
|
|
68
68
|
"aria-label": "Toggle password visibility"
|
|
69
|
-
},
|
|
69
|
+
}, renderVisibilityIcon?.(visible ?? false) || (visible ? /*#__PURE__*/_react.default.createElement(_EyeClose.default, null) : /*#__PURE__*/_react.default.createElement(_Visible.default, null))));
|
|
70
70
|
});
|
|
71
71
|
PasswordInput.displayName = 'PasswordInput';
|
|
72
72
|
var _default = exports.default = PasswordInput;
|
package/cjs/PinInput/PinInput.js
CHANGED
|
@@ -121,7 +121,7 @@ const PinInput = (0, _utils.forwardRef)((props, ref) => {
|
|
|
121
121
|
// Safety check for event object
|
|
122
122
|
if (!e) return;
|
|
123
123
|
const target = e.target;
|
|
124
|
-
const inputValue =
|
|
124
|
+
const inputValue = target?.value || '';
|
|
125
125
|
|
|
126
126
|
// Handle backspace
|
|
127
127
|
if (e.key === 'Backspace') {
|
|
@@ -19,16 +19,14 @@ const usePinInputRefs = (length, autoFocus) => {
|
|
|
19
19
|
// Auto focus the first input on mount if autoFocus is true
|
|
20
20
|
(0, _react.useEffect)(() => {
|
|
21
21
|
if (autoFocus && inputRefs.current[0]) {
|
|
22
|
-
|
|
23
|
-
(_inputRefs$current$ = inputRefs.current[0]) === null || _inputRefs$current$ === void 0 || _inputRefs$current$.focus();
|
|
22
|
+
inputRefs.current[0]?.focus();
|
|
24
23
|
}
|
|
25
24
|
}, [autoFocus]);
|
|
26
25
|
|
|
27
26
|
// Focus a specific input by index
|
|
28
27
|
const focusInput = (0, _react.useCallback)(index => {
|
|
29
28
|
if (index >= 0 && index < length && inputRefs.current[index]) {
|
|
30
|
-
|
|
31
|
-
(_inputRefs$current$in = inputRefs.current[index]) === null || _inputRefs$current$in === void 0 || _inputRefs$current$in.focus();
|
|
29
|
+
inputRefs.current[index]?.focus();
|
|
32
30
|
return true;
|
|
33
31
|
}
|
|
34
32
|
return false;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* - Normalizes value to array format
|
|
5
5
|
* - Manages array updates and modifications
|
|
6
6
|
*/
|
|
7
|
-
export declare const usePinValue: (controlValue: string | undefined, defaultValue: string, length: number, onChange?: (
|
|
7
|
+
export declare const usePinValue: (controlValue: string | undefined, defaultValue: string, length: number, onChange?: (value: string) => void, onComplete?: (value: string) => void) => {
|
|
8
8
|
value: string;
|
|
9
9
|
valueArray: string[];
|
|
10
10
|
setDigit: (index: number, digit: string) => void;
|
|
@@ -54,11 +54,11 @@ const usePinValue = (controlValue, defaultValue, length, onChange, onComplete) =
|
|
|
54
54
|
// Filter out any extra characters beyond length
|
|
55
55
|
const filteredValue = newValue.slice(0, length);
|
|
56
56
|
setValue(filteredValue);
|
|
57
|
-
onChange
|
|
57
|
+
onChange?.(filteredValue);
|
|
58
58
|
|
|
59
59
|
// Call onComplete if the value is complete
|
|
60
60
|
if (filteredValue.length === length) {
|
|
61
|
-
onComplete
|
|
61
|
+
onComplete?.(filteredValue);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
return {
|
|
@@ -62,7 +62,7 @@ const ProgressLine = (0, _utils.forwardRef)((props, ref) => {
|
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
// Determine if the info should be placed inside the stroke
|
|
65
|
-
const isInsidePlacement = percentPlacement
|
|
65
|
+
const isInsidePlacement = percentPlacement?.startsWith('inside');
|
|
66
66
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
67
67
|
as: as,
|
|
68
68
|
ref: ref,
|
package/cjs/Progress/types.d.ts
CHANGED
package/cjs/Radio/Radio.js
CHANGED
|
@@ -28,7 +28,7 @@ const Radio = (0, _utils.forwardRef)((props, ref) => {
|
|
|
28
28
|
readOnly: readOnlyContext,
|
|
29
29
|
plaintext: plaintextContext,
|
|
30
30
|
onChange: onGroupChange
|
|
31
|
-
} = radioContext
|
|
31
|
+
} = radioContext ?? {};
|
|
32
32
|
const {
|
|
33
33
|
as,
|
|
34
34
|
title,
|
|
@@ -64,8 +64,8 @@ const Radio = (0, _utils.forwardRef)((props, ref) => {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
setChecked(true);
|
|
67
|
-
onGroupChange
|
|
68
|
-
onChange
|
|
67
|
+
onGroupChange?.(value, event);
|
|
68
|
+
onChange?.(value, true, event);
|
|
69
69
|
});
|
|
70
70
|
const controlled = radioContext ? true : selfControlled;
|
|
71
71
|
if (typeof controlled !== 'undefined') {
|
|
@@ -45,7 +45,7 @@ const RadioGroup = (0, _utils.forwardRef)((props, ref) => {
|
|
|
45
45
|
const [value, setValue, isControlled] = (0, _hooks.useControlled)(valueProp, defaultValue);
|
|
46
46
|
const handleChange = (0, _hooks.useEventCallback)((nextValue, event) => {
|
|
47
47
|
setValue(nextValue);
|
|
48
|
-
onChange
|
|
48
|
+
onChange?.(nextValue ?? '', event);
|
|
49
49
|
});
|
|
50
50
|
const contextValue = (0, _react.useMemo)(() => ({
|
|
51
51
|
inline,
|
|
@@ -52,8 +52,8 @@ const RadioTile = (0, _utils.forwardRef)((props, ref) => {
|
|
|
52
52
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
53
53
|
const handleChange = (0, _react.useCallback)(event => {
|
|
54
54
|
setChecked(true);
|
|
55
|
-
onGroupChange
|
|
56
|
-
onChange
|
|
55
|
+
onGroupChange?.(value, event);
|
|
56
|
+
onChange?.(value, event);
|
|
57
57
|
}, [onChange, onGroupChange, setChecked, value]);
|
|
58
58
|
const classes = merge(className, withPrefix());
|
|
59
59
|
const radioId = (0, _hooks.useUniqueId)('radio-');
|
|
@@ -43,7 +43,7 @@ const RadioTileGroup = (0, _utils.forwardRef)((props, ref) => {
|
|
|
43
43
|
const [value, setValue] = (0, _hooks.useControlled)(valueProp, defaultValue);
|
|
44
44
|
const handleChange = (0, _react.useCallback)((nextValue, event) => {
|
|
45
45
|
setValue(nextValue);
|
|
46
|
-
onChange
|
|
46
|
+
onChange?.(nextValue, event);
|
|
47
47
|
}, [onChange, setValue]);
|
|
48
48
|
const contextValue = (0, _react.useMemo)(() => ({
|
|
49
49
|
name,
|
|
@@ -174,7 +174,7 @@ const RangeSlider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
174
174
|
const nextValue = getNextValue(event, dataset);
|
|
175
175
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
176
176
|
setValue(nextValue);
|
|
177
|
-
onChange
|
|
177
|
+
onChange?.(nextValue, event);
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
|
|
@@ -188,14 +188,14 @@ const RangeSlider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
188
188
|
const nextValue = getNextValue(event, dataset);
|
|
189
189
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
190
190
|
setValue(nextValue);
|
|
191
|
-
onChangeCommitted
|
|
191
|
+
onChangeCommitted?.(nextValue, event);
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
const handleKeyDown = (0, _hooks.useEventCallback)(event => {
|
|
195
195
|
const target = event.target;
|
|
196
196
|
const {
|
|
197
197
|
key
|
|
198
|
-
} =
|
|
198
|
+
} = target?.dataset || {};
|
|
199
199
|
const nextValue = [...value];
|
|
200
200
|
const increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
201
201
|
const decreaseKey = rtl ? 'ArrowRight' : 'ArrowLeft';
|
|
@@ -229,7 +229,7 @@ const RangeSlider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
229
229
|
event.preventDefault();
|
|
230
230
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
231
231
|
setValue(nextValue);
|
|
232
|
-
onChange
|
|
232
|
+
onChange?.(nextValue, event);
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
const handleBarClick = (0, _hooks.useEventCallback)(event => {
|
|
@@ -248,8 +248,8 @@ const RangeSlider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
248
248
|
const nextValue = getValidValue([start, end].sort((a, b) => a - b));
|
|
249
249
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
250
250
|
setValue(nextValue);
|
|
251
|
-
onChange
|
|
252
|
-
onChangeCommitted
|
|
251
|
+
onChange?.(nextValue, event);
|
|
252
|
+
onChangeCommitted?.(nextValue, event);
|
|
253
253
|
}
|
|
254
254
|
});
|
|
255
255
|
const handleProps = (0, _react.useMemo)(() => [{
|
package/cjs/Rate/Character.js
CHANGED
|
@@ -36,10 +36,10 @@ const Character = (0, _utils.forwardRef)((props, ref) => {
|
|
|
36
36
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
37
37
|
const beforeRef = (0, _react.useRef)(null);
|
|
38
38
|
const handleMouseMove = (0, _hooks.useEventCallback)(event => {
|
|
39
|
-
onMouseMove
|
|
39
|
+
onMouseMove?.(getKey(beforeRef.current, event.target), event);
|
|
40
40
|
});
|
|
41
41
|
const handleClick = (0, _hooks.useEventCallback)(event => {
|
|
42
|
-
onClick
|
|
42
|
+
onClick?.(getKey(beforeRef.current, event.target), event);
|
|
43
43
|
});
|
|
44
44
|
const eventHandlers = (0, _react.useMemo)(() => {
|
|
45
45
|
if (disabled) {
|
package/cjs/Rate/Rate.js
CHANGED
|
@@ -69,7 +69,7 @@ const Rate = (0, _utils.forwardRef)((props, ref) => {
|
|
|
69
69
|
});
|
|
70
70
|
const handleMouseLeave = (0, _hooks.useEventCallback)(event => {
|
|
71
71
|
resetStarStates();
|
|
72
|
-
onChangeActive
|
|
72
|
+
onChangeActive?.(value, event);
|
|
73
73
|
});
|
|
74
74
|
const handleChangeValue = (0, _hooks.useEventCallback)((index, event) => {
|
|
75
75
|
let nextValue = (0, _utils2.transformStarStatusToValue)(starStates);
|
|
@@ -79,7 +79,7 @@ const Rate = (0, _utils.forwardRef)((props, ref) => {
|
|
|
79
79
|
if (nextValue !== value) {
|
|
80
80
|
setValue(nextValue);
|
|
81
81
|
setStarStates(getStarStates(nextValue));
|
|
82
|
-
onChange
|
|
82
|
+
onChange?.(nextValue, event);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
const handleKeyDown = (0, _hooks.useEventCallback)((index, event) => {
|
|
@@ -106,7 +106,7 @@ const Rate = (0, _utils.forwardRef)((props, ref) => {
|
|
|
106
106
|
});
|
|
107
107
|
if (!(0, _utils.shallowEqualArray)(starStates, nextStarStates)) {
|
|
108
108
|
setStarStates(nextStarStates);
|
|
109
|
-
onChangeActive
|
|
109
|
+
onChangeActive?.((0, _utils2.transformStarStatusToValue)(nextStarStates), event);
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
112
|
const handleClick = (0, _hooks.useEventCallback)((index, key, event) => {
|
|
@@ -48,7 +48,7 @@ const SegmentedControl = (0, _utils.forwardRef)((props, ref) => {
|
|
|
48
48
|
const containerRef = (0, _react.useRef)(null);
|
|
49
49
|
|
|
50
50
|
// Get the active item index
|
|
51
|
-
const activeIndex = data
|
|
51
|
+
const activeIndex = data?.findIndex(item => item.value === value);
|
|
52
52
|
const {
|
|
53
53
|
style: indicatorStyle
|
|
54
54
|
} = (0, _useIndicatorPosition.default)({
|
|
@@ -59,7 +59,7 @@ const SegmentedControl = (0, _utils.forwardRef)((props, ref) => {
|
|
|
59
59
|
});
|
|
60
60
|
const handleChange = (0, _hooks.useEventCallback)((nextValue, event) => {
|
|
61
61
|
setValue(nextValue);
|
|
62
|
-
onChange
|
|
62
|
+
onChange?.(nextValue ?? '', event);
|
|
63
63
|
});
|
|
64
64
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
65
65
|
as: as,
|
|
@@ -69,7 +69,7 @@ const SegmentedControl = (0, _utils.forwardRef)((props, ref) => {
|
|
|
69
69
|
"data-size": size,
|
|
70
70
|
"data-block": block || undefined,
|
|
71
71
|
"data-indicator": indicator
|
|
72
|
-
}, rest), data
|
|
72
|
+
}, rest), data?.map((item, index) => /*#__PURE__*/_react.default.createElement(_SegmentedItem.default, {
|
|
73
73
|
key: index,
|
|
74
74
|
item: item,
|
|
75
75
|
index: index,
|
|
@@ -34,7 +34,7 @@ const useIndicatorPosition = ({
|
|
|
34
34
|
}) => {
|
|
35
35
|
const [indicatorStyle, setIndicatorStyle] = (0, _react.useState)({});
|
|
36
36
|
const updatePosition = (0, _react.useCallback)(() => {
|
|
37
|
-
if (!
|
|
37
|
+
if (!containerRef?.current) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
const newStyle = updateIndicatorPosition(containerRef.current, activeIndex, indicator);
|
|
@@ -98,26 +98,23 @@ const SelectPicker = (0, _utils.forwardRef)((props, ref) => {
|
|
|
98
98
|
labelKey,
|
|
99
99
|
searchBy,
|
|
100
100
|
callback: (searchKeyword, filteredData, event) => {
|
|
101
|
-
var _filteredData$;
|
|
102
101
|
// The first option after filtering is the focus.
|
|
103
|
-
setFocusItemValue(filteredData
|
|
104
|
-
onSearch
|
|
102
|
+
setFocusItemValue(filteredData?.[0]?.[valueKey]);
|
|
103
|
+
onSearch?.(searchKeyword, event);
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
106
|
|
|
108
107
|
// Use component active state to support keyboard events.
|
|
109
108
|
const [active, setActive] = (0, _react.useState)(false);
|
|
110
109
|
const handleClose = (0, _hooks.useEventCallback)(() => {
|
|
111
|
-
|
|
112
|
-
(_trigger$current = trigger.current) === null || _trigger$current === void 0 || (_trigger$current$clos = _trigger$current.close) === null || _trigger$current$clos === void 0 || _trigger$current$clos.call(_trigger$current);
|
|
110
|
+
trigger.current?.close?.();
|
|
113
111
|
});
|
|
114
112
|
const handleSelect = (0, _hooks.useEventCallback)((value, item, event) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(_target$current = target.current) === null || _target$current === void 0 || _target$current.focus();
|
|
113
|
+
onSelect?.(value, item, event);
|
|
114
|
+
target.current?.focus();
|
|
118
115
|
});
|
|
119
116
|
const handleChangeValue = (0, _hooks.useEventCallback)((value, event) => {
|
|
120
|
-
onChange
|
|
117
|
+
onChange?.(value, event);
|
|
121
118
|
});
|
|
122
119
|
const handleMenuPressEnter = (0, _hooks.useEventCallback)(event => {
|
|
123
120
|
if (!focusItemValue) {
|
|
@@ -161,7 +158,7 @@ const SelectPicker = (0, _utils.forwardRef)((props, ref) => {
|
|
|
161
158
|
const handleExit = (0, _hooks.useEventCallback)(() => {
|
|
162
159
|
resetSearch();
|
|
163
160
|
setActive(false);
|
|
164
|
-
onSearch
|
|
161
|
+
onSearch?.('');
|
|
165
162
|
setFocusItemValue(null);
|
|
166
163
|
});
|
|
167
164
|
const handleEnter = (0, _hooks.useEventCallback)(() => {
|
|
@@ -182,7 +179,7 @@ const SelectPicker = (0, _utils.forwardRef)((props, ref) => {
|
|
|
182
179
|
merge
|
|
183
180
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
184
181
|
let selectedElement = placeholder;
|
|
185
|
-
if (activeItem
|
|
182
|
+
if (activeItem?.[labelKey]) {
|
|
186
183
|
selectedElement = activeItem[labelKey];
|
|
187
184
|
}
|
|
188
185
|
if (!(0, _isNil.default)(value) && (0, _isFunction.default)(renderValue)) {
|
|
@@ -227,7 +224,7 @@ const SelectPicker = (0, _utils.forwardRef)((props, ref) => {
|
|
|
227
224
|
virtualized: virtualized
|
|
228
225
|
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
229
226
|
className: prefix`none`
|
|
230
|
-
}, locale
|
|
227
|
+
}, locale?.noResultsText);
|
|
231
228
|
return /*#__PURE__*/_react.default.createElement(_Picker.PickerPopup, {
|
|
232
229
|
ref: (0, _utils.mergeRefs)(overlay, speakerRef),
|
|
233
230
|
autoWidth: popupAutoWidth,
|
|
@@ -236,11 +233,11 @@ const SelectPicker = (0, _utils.forwardRef)((props, ref) => {
|
|
|
236
233
|
onKeyDown: onPickerKeyDown,
|
|
237
234
|
target: trigger
|
|
238
235
|
}, searchable && /*#__PURE__*/_react.default.createElement(_SearchBox.default, {
|
|
239
|
-
placeholder: locale
|
|
236
|
+
placeholder: locale?.searchPlaceholder,
|
|
240
237
|
onChange: handleSearch,
|
|
241
238
|
value: searchKeyword,
|
|
242
239
|
inputRef: searchInput
|
|
243
|
-
}), renderListbox ? renderListbox(listbox) : listbox, renderExtraFooter
|
|
240
|
+
}), renderListbox ? renderListbox(listbox) : listbox, renderExtraFooter?.());
|
|
244
241
|
};
|
|
245
242
|
const triggerProps = {
|
|
246
243
|
...(0, _pick.default)(props, _Picker.triggerPropKeys),
|
|
@@ -271,11 +268,11 @@ const SelectPicker = (0, _utils.forwardRef)((props, ref) => {
|
|
|
271
268
|
disabled: disabled,
|
|
272
269
|
cleanable: cleanable && !disabled,
|
|
273
270
|
hasValue: hasValue,
|
|
274
|
-
inputValue: value
|
|
271
|
+
inputValue: value ?? '',
|
|
275
272
|
focusItemValue: focusItemValue,
|
|
276
273
|
active: active,
|
|
277
274
|
placement: placement
|
|
278
|
-
}, rest), selectedElement ||
|
|
275
|
+
}, rest), selectedElement || locale?.placeholder));
|
|
279
276
|
});
|
|
280
277
|
SelectPicker.displayName = 'SelectPicker';
|
|
281
278
|
var _default = exports.default = SelectPicker;
|
package/cjs/Sidebar/Sidebar.js
CHANGED
|
@@ -39,7 +39,7 @@ const Sidebar = (0, _utils.forwardRef)((props, ref) => {
|
|
|
39
39
|
} = (0, _react.useContext)(_Container.ContainerContext);
|
|
40
40
|
(0, _react.useEffect)(() => {
|
|
41
41
|
/** Notify the Container that the Sidebar is in the child node of the Container. */
|
|
42
|
-
setHasSidebar
|
|
42
|
+
setHasSidebar?.(true);
|
|
43
43
|
}, [setHasSidebar]);
|
|
44
44
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
45
45
|
as: as,
|
|
@@ -51,7 +51,7 @@ const ExpandedSidenavDropdown = (0, _utils.forwardRef)((props, ref) => {
|
|
|
51
51
|
withPrefix
|
|
52
52
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
53
53
|
const internalId = (0, _hooks.useInternalId)('SidenavDropdown');
|
|
54
|
-
const uniqueKey = eventKey
|
|
54
|
+
const uniqueKey = eventKey ?? internalId;
|
|
55
55
|
const {
|
|
56
56
|
openKeys = [],
|
|
57
57
|
onOpenChange
|
|
@@ -66,14 +66,14 @@ const ExpandedSidenavDropdown = (0, _utils.forwardRef)((props, ref) => {
|
|
|
66
66
|
items.some(item => item.active);
|
|
67
67
|
const handleToggleDisclosure = (0, _react.useCallback)((open, event) => {
|
|
68
68
|
if (open) {
|
|
69
|
-
onClose
|
|
69
|
+
onClose?.();
|
|
70
70
|
} else {
|
|
71
|
-
onOpen
|
|
71
|
+
onOpen?.();
|
|
72
72
|
}
|
|
73
|
-
onToggle
|
|
74
|
-
onOpenChange
|
|
73
|
+
onToggle?.(open);
|
|
74
|
+
onOpenChange?.(uniqueKey, event);
|
|
75
75
|
}, [onClose, onOpen, onToggle, uniqueKey, onOpenChange]);
|
|
76
|
-
const open = openProp
|
|
76
|
+
const open = openProp ?? openKeys.includes(uniqueKey);
|
|
77
77
|
return /*#__PURE__*/_react.default.createElement(_Disclosure.default, {
|
|
78
78
|
open: open,
|
|
79
79
|
onToggle: handleToggleDisclosure
|
|
@@ -45,7 +45,7 @@ const ExpandedSidenavDropdownItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
45
45
|
withPrefix,
|
|
46
46
|
prefix
|
|
47
47
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
48
|
-
const selected = activeProp
|
|
48
|
+
const selected = activeProp ?? (!(0, _isNil.default)(eventKey) && ((0, _utils.shallowEqual)(eventKey, sidenav.activeKey) || (0, _utils.shallowEqual)(nav.activeKey, eventKey)));
|
|
49
49
|
const classes = merge(className, withPrefix());
|
|
50
50
|
const dataAttributes = {
|
|
51
51
|
'data-active': selected,
|
|
@@ -53,11 +53,10 @@ const ExpandedSidenavDropdownItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
53
53
|
'data-with-icon': !!icon
|
|
54
54
|
};
|
|
55
55
|
const handleClick = (0, _react.useCallback)(event => {
|
|
56
|
-
var _nav$onSelect, _sidenav$onSelect;
|
|
57
56
|
if (disabled) return;
|
|
58
|
-
onSelect
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
onSelect?.(eventKey, event);
|
|
58
|
+
nav.onSelect?.(eventKey, event);
|
|
59
|
+
sidenav.onSelect?.(eventKey, event);
|
|
61
60
|
}, [disabled, onSelect, sidenav, eventKey, nav]);
|
|
62
61
|
const menuitemEventHandlers = {
|
|
63
62
|
onClick: (0, _utils.createChainedFunction)(handleClick, onClick)
|
package/cjs/Sidenav/Node.js
CHANGED
|
@@ -9,14 +9,11 @@ exports.Node = void 0;
|
|
|
9
9
|
* Ref: https://developer.mozilla.org/zh-CN/docs/Web/API/Node
|
|
10
10
|
*/
|
|
11
11
|
class Node {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.childNodes = [];
|
|
18
|
-
this.element = void 0;
|
|
19
|
-
}
|
|
12
|
+
id = null;
|
|
13
|
+
nodeValue = null;
|
|
14
|
+
parent = null;
|
|
15
|
+
parentNode = null;
|
|
16
|
+
childNodes = [];
|
|
20
17
|
appendChild(newChild) {
|
|
21
18
|
newChild.parentNode = this;
|
|
22
19
|
this.childNodes.push(newChild);
|
|
@@ -25,22 +22,18 @@ class Node {
|
|
|
25
22
|
return this.childNodes.length > 0;
|
|
26
23
|
}
|
|
27
24
|
get firstChild() {
|
|
28
|
-
|
|
29
|
-
return (_this$childNodes$ = this.childNodes[0]) !== null && _this$childNodes$ !== void 0 ? _this$childNodes$ : null;
|
|
25
|
+
return this.childNodes[0] ?? null;
|
|
30
26
|
}
|
|
31
27
|
get lastChild() {
|
|
32
|
-
|
|
33
|
-
return (_this$childNodes = this.childNodes[this.childNodes.length - 1]) !== null && _this$childNodes !== void 0 ? _this$childNodes : null;
|
|
28
|
+
return this.childNodes[this.childNodes.length - 1] ?? null;
|
|
34
29
|
}
|
|
35
30
|
get nextSibling() {
|
|
36
|
-
var _this$parentNode$chil;
|
|
37
31
|
if (!this.parentNode) return null;
|
|
38
|
-
return
|
|
32
|
+
return this.parentNode.childNodes[this.parentNode.childNodes.indexOf(this) + 1] ?? null;
|
|
39
33
|
}
|
|
40
34
|
get previousSibling() {
|
|
41
|
-
var _this$parentNode$chil2;
|
|
42
35
|
if (!this.parentNode) return null;
|
|
43
|
-
return
|
|
36
|
+
return this.parentNode.childNodes[this.parentNode.childNodes.indexOf(this) - 1] ?? null;
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
39
|
exports.Node = Node;
|
package/cjs/Sidenav/Sidenav.js
CHANGED
|
@@ -64,13 +64,13 @@ const Sidenav = (0, _utils.forwardRef)((props, ref) => {
|
|
|
64
64
|
nextOpenKeys.push(eventKey);
|
|
65
65
|
}
|
|
66
66
|
setOpenKeys(nextOpenKeys);
|
|
67
|
-
onOpenChange
|
|
67
|
+
onOpenChange?.(nextOpenKeys, event);
|
|
68
68
|
}, [onOpenChange, openKeys, setOpenKeys]);
|
|
69
69
|
const contextValue = (0, _react.useMemo)(() => ({
|
|
70
70
|
expanded,
|
|
71
71
|
activeKey,
|
|
72
72
|
sidenav: true,
|
|
73
|
-
openKeys: openKeys
|
|
73
|
+
openKeys: openKeys ?? [],
|
|
74
74
|
onOpenChange: handleOpenChange,
|
|
75
75
|
onSelect
|
|
76
76
|
}), [activeKey, expanded, handleOpenChange, onSelect, openKeys]);
|
|
@@ -51,6 +51,6 @@ export interface SidenavDropdownProps<T = any> extends BoxProps, SanitizedHTMLis
|
|
|
51
51
|
*/
|
|
52
52
|
declare const SidenavDropdown: import("../internals/types").InternalRefForwardingComponent<"div", SidenavDropdownProps<any>, never> & {
|
|
53
53
|
Item: import("../internals/types").InternalRefForwardingComponent<"li", import("../Nav/NavDropdownItem").NavDropdownItemProps<any>, never> & Record<string, never>;
|
|
54
|
-
Menu: React.ForwardRefExoticComponent<import("../Nav/NavDropdownMenu").NavDropdownMenuProps<any> & SanitizedHTMListProps
|
|
54
|
+
Menu: React.ForwardRefExoticComponent<import("../Nav/NavDropdownMenu").NavDropdownMenuProps<any> & SanitizedHTMListProps & React.RefAttributes<HTMLElement>>;
|
|
55
55
|
};
|
|
56
56
|
export default SidenavDropdown;
|
|
@@ -140,12 +140,12 @@ const SidenavDropdown = (0, _utils.forwardRef)((props, ref) => {
|
|
|
140
140
|
}, title), children);
|
|
141
141
|
},
|
|
142
142
|
onToggleMenu: (open, event) => {
|
|
143
|
-
onToggle
|
|
144
|
-
sidenav
|
|
143
|
+
onToggle?.(open, eventKey, event);
|
|
144
|
+
sidenav?.onOpenChange(eventKey, event);
|
|
145
145
|
if (open) {
|
|
146
|
-
onOpen
|
|
146
|
+
onOpen?.();
|
|
147
147
|
} else {
|
|
148
|
-
onClose
|
|
148
|
+
onClose?.();
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}, ({
|
|
@@ -54,11 +54,10 @@ const SidenavDropdownItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
54
54
|
prefix
|
|
55
55
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
56
56
|
const handleSelectItem = (0, _react.useCallback)(event => {
|
|
57
|
-
|
|
58
|
-
onSelect
|
|
59
|
-
(_nav$onSelect = nav.onSelect) === null || _nav$onSelect === void 0 || _nav$onSelect.call(nav, eventKey, event);
|
|
57
|
+
onSelect?.(eventKey, event);
|
|
58
|
+
nav.onSelect?.(eventKey, event);
|
|
60
59
|
}, [onSelect, eventKey, nav]);
|
|
61
|
-
const selected = activeProp || !(0, _isNil.default)(eventKey) && (0, _utils.shallowEqual)(nav
|
|
60
|
+
const selected = activeProp || !(0, _isNil.default)(eventKey) && (0, _utils.shallowEqual)(nav?.activeKey, eventKey);
|
|
62
61
|
const renderDropdownItem = (0, _useRenderMenuItem.useRenderMenuItem)(as);
|
|
63
62
|
if (sidenav.expanded) {
|
|
64
63
|
return /*#__PURE__*/_react.default.createElement(_ExpandedSidenavDropdownItem.default, (0, _extends2.default)({
|
|
@@ -57,15 +57,14 @@ const SidenavItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
57
57
|
withPrefix,
|
|
58
58
|
prefix
|
|
59
59
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
60
|
-
const selected = activeProp
|
|
60
|
+
const selected = activeProp ?? (!(0, _isNil.default)(eventKey) && (0, _utils.shallowEqual)(activeKey, eventKey));
|
|
61
61
|
const whisperRef = _react.default.useRef(null);
|
|
62
62
|
const handleClick = (0, _react.useCallback)(event => {
|
|
63
|
-
var _whisperRef$current;
|
|
64
63
|
if (disabled) return;
|
|
65
|
-
|
|
66
|
-
onSelect
|
|
67
|
-
onSelectFromNav
|
|
68
|
-
onClick
|
|
64
|
+
whisperRef.current?.close();
|
|
65
|
+
onSelect?.(eventKey, event);
|
|
66
|
+
onSelectFromNav?.(eventKey, event);
|
|
67
|
+
onClick?.(event);
|
|
69
68
|
}, [disabled, onSelect, onSelectFromNav, eventKey, onClick]);
|
|
70
69
|
const clonedIcon = icon ? /*#__PURE__*/_react.default.cloneElement(icon, {
|
|
71
70
|
className: (0, _classnames.default)(prefix('icon'), icon.props.className)
|
|
@@ -34,8 +34,8 @@ const SidenavToggle = (0, _utils.forwardRef)((props, ref) => {
|
|
|
34
34
|
collapsed: !expanded
|
|
35
35
|
}));
|
|
36
36
|
const handleToggle = (0, _hooks.useEventCallback)(event => {
|
|
37
|
-
onToggle
|
|
38
|
-
onClick
|
|
37
|
+
onToggle?.(!expanded, event);
|
|
38
|
+
onClick?.(event);
|
|
39
39
|
});
|
|
40
40
|
return /*#__PURE__*/_react.default.createElement(_IconButton.default, (0, _extends2.default)({
|
|
41
41
|
ref: ref,
|
package/cjs/Slider/Slider.js
CHANGED
|
@@ -134,7 +134,7 @@ const Slider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
134
134
|
}
|
|
135
135
|
const nextValue = getValidValue(getValueByPosition(event));
|
|
136
136
|
setValue(nextValue);
|
|
137
|
-
onChange
|
|
137
|
+
onChange?.(nextValue, event);
|
|
138
138
|
});
|
|
139
139
|
|
|
140
140
|
/**
|
|
@@ -145,7 +145,7 @@ const Slider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
const nextValue = getValidValue(getValueByPosition(event));
|
|
148
|
-
onChangeCommitted
|
|
148
|
+
onChangeCommitted?.(nextValue, event);
|
|
149
149
|
});
|
|
150
150
|
const handleClickBar = (0, _hooks.useEventCallback)(event => {
|
|
151
151
|
handleChangeValue(event);
|
|
@@ -177,7 +177,7 @@ const Slider = (0, _utils.forwardRef)((props, ref) => {
|
|
|
177
177
|
// Prevent scroll of the page
|
|
178
178
|
event.preventDefault();
|
|
179
179
|
setValue(nextValue);
|
|
180
|
-
onChange
|
|
180
|
+
onChange?.(nextValue, event);
|
|
181
181
|
});
|
|
182
182
|
if (plaintext) {
|
|
183
183
|
return /*#__PURE__*/_react.default.createElement(_Plaintext.default, {
|