rsuite 5.74.1 → 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/Accordion/styles/index.css +0 -2
- package/Animation/styles/index.css +0 -2
- package/AutoComplete/styles/index.css +0 -2
- package/Avatar/styles/index.css +0 -2
- package/AvatarGroup/styles/index.css +0 -2
- package/Badge/styles/index.css +0 -2
- package/Breadcrumb/styles/index.css +0 -2
- package/Button/styles/index.css +0 -2
- package/ButtonGroup/styles/index.css +0 -2
- package/ButtonToolbar/styles/index.css +0 -2
- package/CHANGELOG.md +28 -0
- package/Calendar/styles/index.css +0 -2
- 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/Carousel/styles/index.css +0 -2
- package/CascadeTree/styles/index.css +0 -2
- package/Cascader/styles/index.css +0 -2
- package/CheckPicker/styles/index.css +0 -2
- package/CheckTree/styles/index.css +0 -2
- package/CheckTreePicker/styles/index.css +0 -2
- package/Checkbox/styles/index.css +0 -2
- package/CheckboxGroup/styles/index.css +0 -2
- package/Col/styles/index.css +0 -2
- package/Container/styles/index.css +0 -2
- package/Content/styles/index.css +0 -2
- package/DateInput/styles/index.css +0 -2
- package/DatePicker/styles/index.css +0 -2
- package/DateRangeInput/styles/index.css +0 -2
- package/DateRangePicker/styles/index.css +0 -2
- package/Divider/styles/index.css +0 -2
- package/Drawer/styles/index.css +0 -2
- package/Dropdown/styles/index.css +0 -2
- package/FlexboxGrid/styles/index.css +0 -2
- package/Footer/styles/index.css +0 -2
- package/Form/styles/index.css +0 -2
- package/FormControl/styles/index.css +0 -2
- package/FormControlLabel/styles/index.css +0 -2
- package/FormErrorMessage/styles/index.css +0 -2
- package/FormGroup/styles/index.css +0 -2
- package/FormHelpText/styles/index.css +0 -2
- package/Grid/styles/index.css +0 -2
- package/Header/styles/index.css +0 -2
- package/Heading/styles/index.css +0 -2
- package/HeadingGroup/styles/index.css +0 -2
- package/Highlight/styles/index.css +0 -2
- package/IconButton/styles/index.css +0 -2
- package/InlineEdit/styles/index.css +0 -2
- package/Input/styles/index.css +0 -2
- package/InputGroup/styles/index.css +0 -2
- package/InputNumber/styles/index.css +0 -2
- package/InputPicker/styles/index.css +0 -2
- package/List/styles/index.css +10 -14
- package/List/styles/index.less +12 -4
- package/Loader/styles/index.css +0 -2
- package/Message/styles/index.css +0 -2
- package/Modal/styles/index.css +0 -2
- package/MultiCascadeTree/styles/index.css +0 -2
- package/MultiCascader/styles/index.css +0 -2
- package/Nav/styles/index.css +0 -2
- package/Navbar/styles/index.css +0 -2
- package/Notification/styles/index.css +0 -2
- package/Pagination/styles/index.css +0 -2
- package/Panel/styles/index.css +0 -2
- package/PanelGroup/styles/index.css +0 -2
- package/Placeholder/styles/index.css +0 -2
- package/Popover/styles/index.css +0 -2
- package/Progress/styles/index.css +0 -2
- package/Radio/styles/index.css +0 -2
- package/RadioGroup/styles/index.css +0 -2
- package/RadioTile/styles/index.css +0 -2
- package/RadioTileGroup/styles/index.css +0 -2
- package/RangeSlider/styles/index.css +0 -2
- package/Rate/styles/index.css +0 -2
- package/Row/styles/index.css +0 -2
- package/SelectPicker/styles/index.css +0 -2
- package/Sidebar/styles/index.css +0 -2
- package/Sidenav/styles/index.css +0 -2
- package/Slider/styles/index.css +0 -2
- package/Stack/styles/index.css +0 -2
- 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/Steps/styles/index.css +0 -2
- package/Table/styles/index.css +0 -2
- package/Tabs/styles/index.css +0 -2
- package/Tag/styles/index.css +0 -2
- package/TagGroup/styles/index.css +0 -2
- package/TagInput/styles/index.css +0 -2
- package/TagPicker/styles/index.css +0 -2
- package/Text/styles/index.css +0 -2
- package/TimePicker/styles/index.css +0 -2
- package/TimeRangePicker/styles/index.css +0 -2
- package/Timeline/styles/index.css +0 -2
- package/Toggle/styles/index.css +0 -2
- package/Tooltip/styles/index.css +0 -2
- package/Tree/styles/index.css +0 -2
- package/TreePicker/styles/index.css +0 -2
- package/Uploader/styles/index.css +0 -2
- package/VisuallyHidden/styles/index.css +0 -2
- 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 +12 -9
- 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/AccordionButton.js +1 -0
- 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/Table/Table.js +4 -2
- 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 -38
- 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 -38
- package/dist/rsuite.js +386 -177
- 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 +12 -9
- 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/AccordionButton.js +1 -0
- 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/Table/Table.js +4 -2
- 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 -26
- package/toaster/styles/index.less +29 -29
- package/useToaster/styles/index.css +24 -26
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.FormattedNumber = FormattedNumber;
|
|
6
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
var _useCustom2 = require("./useCustom");
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
function FormattedNumber(_ref) {
|
|
11
|
+
var value = _ref.value,
|
|
12
|
+
formatOptions = _ref.formatOptions;
|
|
13
|
+
var _useCustom = (0, _useCustom2.useCustom)(),
|
|
14
|
+
code = _useCustom.code;
|
|
15
|
+
var formatter = (0, _react.useMemo)(function () {
|
|
16
|
+
return new Intl.NumberFormat(code, formatOptions);
|
|
17
|
+
}, [code, formatOptions]);
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formatter.format(value));
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CustomProvider from './CustomProvider';
|
|
2
2
|
export { FormattedDate } from './FormattedDate';
|
|
3
|
+
export { FormattedNumber } from './FormattedNumber';
|
|
3
4
|
export { useCustom } from './useCustom';
|
|
4
5
|
export { CustomContext } from './CustomProvider';
|
|
5
6
|
export type { CustomProviderProps } from './CustomProvider';
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.useCustom = exports.default = exports.FormattedDate = exports.CustomContext = void 0;
|
|
5
|
+
exports.useCustom = exports.default = exports.FormattedNumber = exports.FormattedDate = exports.CustomContext = void 0;
|
|
6
6
|
var _CustomProvider = _interopRequireWildcard(require("./CustomProvider"));
|
|
7
7
|
exports.CustomContext = _CustomProvider.CustomContext;
|
|
8
8
|
var _FormattedDate = require("./FormattedDate");
|
|
9
9
|
exports.FormattedDate = _FormattedDate.FormattedDate;
|
|
10
|
+
var _FormattedNumber = require("./FormattedNumber");
|
|
11
|
+
exports.FormattedNumber = _FormattedNumber.FormattedNumber;
|
|
10
12
|
var _useCustom = require("./useCustom");
|
|
11
13
|
exports.useCustom = _useCustom.useCustom;
|
|
12
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -17,6 +17,8 @@ import type { CalendarProps } from '../Calendar';
|
|
|
17
17
|
import type { CarouselProps } from '../Carousel';
|
|
18
18
|
import type { CascadeTreeProps } from '../CascadeTree';
|
|
19
19
|
import type { CascaderProps } from '../Cascader';
|
|
20
|
+
import type { CardProps } from '../Card';
|
|
21
|
+
import type { CardGroupProps } from '../CardGroup';
|
|
20
22
|
import type { CheckPickerProps } from '../CheckPicker';
|
|
21
23
|
import type { CheckTreeProps } from '../CheckTree';
|
|
22
24
|
import type { CheckTreePickerProps } from '../CheckTreePicker';
|
|
@@ -84,6 +86,8 @@ import type { SidenavProps } from '../Sidenav';
|
|
|
84
86
|
import type { SliderProps } from '../Slider';
|
|
85
87
|
import type { StackProps } from '../Stack';
|
|
86
88
|
import type { StepsProps } from '../Steps';
|
|
89
|
+
import type { StatProps } from '../Stat';
|
|
90
|
+
import type { StatGroupProps } from '../StatGroup';
|
|
87
91
|
import type { TableProps } from '../Table';
|
|
88
92
|
import type { TabsProps } from '../Tabs';
|
|
89
93
|
import type { TagProps } from '../Tag';
|
|
@@ -124,6 +128,8 @@ export interface ReactSuiteComponents {
|
|
|
124
128
|
Carousel: ComponentProps<CarouselProps>;
|
|
125
129
|
CascadeTree: ComponentProps<CascadeTreeProps>;
|
|
126
130
|
Cascader: ComponentProps<CascaderProps>;
|
|
131
|
+
Card: ComponentProps<CardProps>;
|
|
132
|
+
CardGroup: ComponentProps<CardGroupProps>;
|
|
127
133
|
CheckPicker: ComponentProps<CheckPickerProps>;
|
|
128
134
|
CheckTree: ComponentProps<CheckTreeProps>;
|
|
129
135
|
CheckTreePicker: ComponentProps<CheckTreePickerProps>;
|
|
@@ -191,6 +197,8 @@ export interface ReactSuiteComponents {
|
|
|
191
197
|
Slider: ComponentProps<SliderProps>;
|
|
192
198
|
Stack: ComponentProps<StackProps>;
|
|
193
199
|
Steps: ComponentProps<StepsProps>;
|
|
200
|
+
Stat: ComponentProps<StatProps>;
|
|
201
|
+
StatGroup: ComponentProps<StatGroupProps>;
|
|
194
202
|
Table: ComponentProps<TableProps>;
|
|
195
203
|
Tabs: ComponentProps<TabsProps>;
|
|
196
204
|
Tag: ComponentProps<TagProps>;
|
|
@@ -9,6 +9,7 @@ type LocaleKey = keyof typeof enGB;
|
|
|
9
9
|
* @param componentProps - The props of the component
|
|
10
10
|
*/
|
|
11
11
|
export declare function useCustom<P = any>(componentName?: keyof ReactSuiteComponents, componentProps?: P): {
|
|
12
|
+
code: string | undefined;
|
|
12
13
|
rtl: boolean;
|
|
13
14
|
toasters: import("react").MutableRefObject<Map<string, import("../toaster/ToastContainer").ToastContainerInstance>> | undefined;
|
|
14
15
|
disableRipple: boolean | undefined;
|
|
@@ -46,7 +46,8 @@ function useCustom(componentName, componentProps) {
|
|
|
46
46
|
var _ref = componentProps || {},
|
|
47
47
|
componentLocale = _ref.locale,
|
|
48
48
|
restProps = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
49
|
-
var dateLocale = globalLocale === null || globalLocale === void 0
|
|
49
|
+
var dateLocale = globalLocale === null || globalLocale === void 0 || (_globalLocale$DateTim = globalLocale.DateTimeFormats) === null || _globalLocale$DateTim === void 0 ? void 0 : _globalLocale$DateTim.dateLocale;
|
|
50
|
+
var code = globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale.code;
|
|
50
51
|
var getLocale = (0, _react.useCallback)(function (key, overrideLocale) {
|
|
51
52
|
// Initialize with common locale
|
|
52
53
|
var publicLocale = (globalLocale === null || globalLocale === void 0 ? void 0 : globalLocale.common) || {};
|
|
@@ -102,6 +103,7 @@ function useCustom(componentName, componentProps) {
|
|
|
102
103
|
}, options));
|
|
103
104
|
}, [parseDate, dateLocale]);
|
|
104
105
|
return {
|
|
106
|
+
code: code,
|
|
105
107
|
rtl: rtl,
|
|
106
108
|
toasters: toasters,
|
|
107
109
|
disableRipple: disableRipple,
|
|
@@ -52,7 +52,7 @@ var DateField = exports.DateField = /*#__PURE__*/function (_Object) {
|
|
|
52
52
|
}
|
|
53
53
|
(0, _inheritsLoose2.default)(DateField, _Object);
|
|
54
54
|
return DateField;
|
|
55
|
-
}(
|
|
55
|
+
}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Object));
|
|
56
56
|
/**
|
|
57
57
|
* Pad a number with zeros to the left.
|
|
58
58
|
*/
|
|
@@ -142,7 +142,7 @@ var useDateField = exports.useDateField = function useDateField(format, localize
|
|
|
142
142
|
var validFieldValue = function validFieldValue(type, value) {
|
|
143
143
|
var _format$match;
|
|
144
144
|
var isValid = true;
|
|
145
|
-
(_format$match = format.match(new RegExp('([y|d|M|H|h|m|s])+', 'ig'))) === null || _format$match === void 0
|
|
145
|
+
(_format$match = format.match(new RegExp('([y|d|M|H|h|m|s])+', 'ig'))) === null || _format$match === void 0 || _format$match.forEach(function (pattern) {
|
|
146
146
|
var key = patternMap[pattern[0]];
|
|
147
147
|
var fieldValue = type === key ? value : dateField[key];
|
|
148
148
|
if (fieldValue === null) {
|
|
@@ -83,7 +83,7 @@ var DateInput = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
83
83
|
}, [dateField, dateString, formatStr, dateLocale]);
|
|
84
84
|
var setSelectionRange = (0, _utils2.useInputSelection)(inputRef);
|
|
85
85
|
var handleChange = (0, _hooks.useEventCallback)(function (value, event) {
|
|
86
|
-
onChange === null || onChange === void 0
|
|
86
|
+
onChange === null || onChange === void 0 || onChange(value, event);
|
|
87
87
|
setValue(value);
|
|
88
88
|
});
|
|
89
89
|
var handleClear = (0, _hooks.useEventCallback)(function (event) {
|
|
@@ -197,7 +197,7 @@ var DateInput = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
197
197
|
handleChange(nextDate, event);
|
|
198
198
|
setNewDate(nextDate);
|
|
199
199
|
}
|
|
200
|
-
onPaste === null || onPaste === void 0
|
|
200
|
+
onPaste === null || onPaste === void 0 || onPaste(event);
|
|
201
201
|
});
|
|
202
202
|
var onKeyboardInput = (0, _useKeyboardInputEvent.default)({
|
|
203
203
|
onSegmentChange: onSegmentChange,
|
|
@@ -76,7 +76,7 @@ function useDateInputState(_ref) {
|
|
|
76
76
|
value: value
|
|
77
77
|
});
|
|
78
78
|
var field = _DateField.patternMap[pattern];
|
|
79
|
-
callback === null || callback === void 0
|
|
79
|
+
callback === null || callback === void 0 || callback(toDate(field, value));
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
var setDateField = function setDateField(pattern, value, callback) {
|
|
@@ -86,7 +86,7 @@ function useDateInputState(_ref) {
|
|
|
86
86
|
type: actionName,
|
|
87
87
|
value: value
|
|
88
88
|
});
|
|
89
|
-
callback === null || callback === void 0
|
|
89
|
+
callback === null || callback === void 0 || callback(toDate(field, value));
|
|
90
90
|
};
|
|
91
91
|
var getDateField = function getDateField(pattern) {
|
|
92
92
|
var fieldName = _DateField.patternMap[pattern];
|
|
@@ -13,11 +13,11 @@ function useIsFocused(_ref) {
|
|
|
13
13
|
setIsFocused = _useState[1];
|
|
14
14
|
var onFocus = (0, _react.useCallback)(function (event) {
|
|
15
15
|
setIsFocused(true);
|
|
16
|
-
onFocusProp === null || onFocusProp === void 0
|
|
16
|
+
onFocusProp === null || onFocusProp === void 0 || onFocusProp(event);
|
|
17
17
|
}, [onFocusProp]);
|
|
18
18
|
var onBlur = (0, _react.useCallback)(function (event) {
|
|
19
19
|
setIsFocused(false);
|
|
20
|
-
onBlurProp === null || onBlurProp === void 0
|
|
20
|
+
onBlurProp === null || onBlurProp === void 0 || onBlurProp(event);
|
|
21
21
|
}, [onBlurProp]);
|
|
22
22
|
return [isFocused, {
|
|
23
23
|
onFocus: onFocus,
|
|
@@ -16,21 +16,21 @@ function useKeyboardInputEvent(_ref) {
|
|
|
16
16
|
switch (key) {
|
|
17
17
|
case 'ArrowRight':
|
|
18
18
|
case 'ArrowLeft':
|
|
19
|
-
onSegmentChange === null || onSegmentChange === void 0
|
|
19
|
+
onSegmentChange === null || onSegmentChange === void 0 || onSegmentChange(event);
|
|
20
20
|
event.preventDefault();
|
|
21
21
|
break;
|
|
22
22
|
case 'ArrowUp':
|
|
23
23
|
case 'ArrowDown':
|
|
24
|
-
onSegmentValueChange === null || onSegmentValueChange === void 0
|
|
24
|
+
onSegmentValueChange === null || onSegmentValueChange === void 0 || onSegmentValueChange(event);
|
|
25
25
|
event.preventDefault();
|
|
26
26
|
break;
|
|
27
27
|
case 'Backspace':
|
|
28
|
-
onSegmentValueRemove === null || onSegmentValueRemove === void 0
|
|
28
|
+
onSegmentValueRemove === null || onSegmentValueRemove === void 0 || onSegmentValueRemove(event);
|
|
29
29
|
event.preventDefault();
|
|
30
30
|
break;
|
|
31
31
|
case (_key$match = key.match(/\d/)) === null || _key$match === void 0 ? void 0 : _key$match.input:
|
|
32
32
|
// Allow numeric keys to be entered
|
|
33
|
-
onSegmentValueChangeWithNumericKeys === null || onSegmentValueChangeWithNumericKeys === void 0
|
|
33
|
+
onSegmentValueChangeWithNumericKeys === null || onSegmentValueChangeWithNumericKeys === void 0 || onSegmentValueChangeWithNumericKeys(event);
|
|
34
34
|
event.preventDefault();
|
|
35
35
|
case (_key$match2 = key.match(/[a-z]/)) === null || _key$match2 === void 0 ? void 0 : _key$match2[0]:
|
|
36
36
|
// Determine whether the Ctrl or Command key is pressed, does not affect user copy and paste
|
|
@@ -42,7 +42,7 @@ function useKeyboardInputEvent(_ref) {
|
|
|
42
42
|
event.preventDefault();
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
onKeyDown === null || onKeyDown === void 0
|
|
45
|
+
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event);
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
var _default = exports.default = useKeyboardInputEvent;
|
|
@@ -203,8 +203,8 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
203
203
|
*/
|
|
204
204
|
var handleMoveForward = (0, _hooks2.useEventCallback)(function (nextPageDate) {
|
|
205
205
|
setCalendarDate(nextPageDate);
|
|
206
|
-
onNextMonth === null || onNextMonth === void 0
|
|
207
|
-
onChangeCalendarDate === null || onChangeCalendarDate === void 0
|
|
206
|
+
onNextMonth === null || onNextMonth === void 0 || onNextMonth(nextPageDate);
|
|
207
|
+
onChangeCalendarDate === null || onChangeCalendarDate === void 0 || onChangeCalendarDate(nextPageDate);
|
|
208
208
|
});
|
|
209
209
|
|
|
210
210
|
/**
|
|
@@ -212,16 +212,16 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
212
212
|
*/
|
|
213
213
|
var handleMoveBackward = (0, _hooks2.useEventCallback)(function (nextPageDate) {
|
|
214
214
|
setCalendarDate(nextPageDate);
|
|
215
|
-
onPrevMonth === null || onPrevMonth === void 0
|
|
216
|
-
onChangeCalendarDate === null || onChangeCalendarDate === void 0
|
|
215
|
+
onPrevMonth === null || onPrevMonth === void 0 || onPrevMonth(nextPageDate);
|
|
216
|
+
onChangeCalendarDate === null || onChangeCalendarDate === void 0 || onChangeCalendarDate(nextPageDate);
|
|
217
217
|
});
|
|
218
218
|
|
|
219
219
|
/**
|
|
220
220
|
* The callback triggered when the date changes.
|
|
221
221
|
*/
|
|
222
222
|
var handleDateChange = (0, _hooks2.useEventCallback)(function (nextValue, event) {
|
|
223
|
-
onSelect === null || onSelect === void 0
|
|
224
|
-
onChangeCalendarDate === null || onChangeCalendarDate === void 0
|
|
223
|
+
onSelect === null || onSelect === void 0 || onSelect(nextValue, event);
|
|
224
|
+
onChangeCalendarDate === null || onChangeCalendarDate === void 0 || onChangeCalendarDate(nextValue, event);
|
|
225
225
|
});
|
|
226
226
|
|
|
227
227
|
/**
|
|
@@ -237,7 +237,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
237
237
|
*/
|
|
238
238
|
var handleClose = (0, _hooks2.useEventCallback)(function () {
|
|
239
239
|
var _trigger$current, _trigger$current$clos;
|
|
240
|
-
(_trigger$current = trigger.current) === null || _trigger$current === void 0
|
|
240
|
+
(_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);
|
|
241
241
|
});
|
|
242
242
|
var updateValue = function updateValue(event, date, closeOverlay) {
|
|
243
243
|
if (closeOverlay === void 0) {
|
|
@@ -247,7 +247,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
247
247
|
setCalendarDate(nextValue || (0, _date.startOfToday)());
|
|
248
248
|
setValue(nextValue);
|
|
249
249
|
if (nextValue !== value) {
|
|
250
|
-
onChange === null || onChange === void 0
|
|
250
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
// `closeOverlay` default value is `true`
|
|
@@ -263,7 +263,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
263
263
|
var value = range.value;
|
|
264
264
|
updateValue(event, value, closeOverlay);
|
|
265
265
|
handleDateChange(value, event);
|
|
266
|
-
onShortcutClick === null || onShortcutClick === void 0
|
|
266
|
+
onShortcutClick === null || onShortcutClick === void 0 || onShortcutClick(range, event);
|
|
267
267
|
});
|
|
268
268
|
|
|
269
269
|
/**
|
|
@@ -271,7 +271,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
271
271
|
*/
|
|
272
272
|
var handleOK = (0, _hooks2.useEventCallback)(function (event) {
|
|
273
273
|
updateValue(event);
|
|
274
|
-
onOk === null || onOk === void 0
|
|
274
|
+
onOk === null || onOk === void 0 || onOk(calendarDate, event);
|
|
275
275
|
focusInput();
|
|
276
276
|
});
|
|
277
277
|
|
|
@@ -280,10 +280,10 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
280
280
|
*/
|
|
281
281
|
|
|
282
282
|
var handleClean = (0, _hooks2.useEventCallback)(function (event) {
|
|
283
|
-
event === null || event === void 0
|
|
283
|
+
event === null || event === void 0 || event.stopPropagation();
|
|
284
284
|
updateValue(event, null);
|
|
285
285
|
resetCalendarDate(null);
|
|
286
|
-
onClean === null || onClean === void 0
|
|
286
|
+
onClean === null || onClean === void 0 || onClean(event);
|
|
287
287
|
});
|
|
288
288
|
var handlePickerPopupKeyDown = (0, _hooks2.useEventCallback)(function (event) {
|
|
289
289
|
onKeyFocusEvent(event, {
|
|
@@ -356,7 +356,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
356
356
|
}
|
|
357
357
|
} else {
|
|
358
358
|
var _trigger$current3;
|
|
359
|
-
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0
|
|
359
|
+
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0 || _trigger$current3.open();
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
362
|
});
|
|
@@ -458,7 +458,7 @@ var DatePicker = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
458
458
|
resetCalendarDate();
|
|
459
459
|
}
|
|
460
460
|
setMonthView(false);
|
|
461
|
-
(_props$onClose = props.onClose) === null || _props$onClose === void 0
|
|
461
|
+
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
462
462
|
});
|
|
463
463
|
var showCleanButton = cleanable && hasValue && !readOnly;
|
|
464
464
|
var _partitionHTMLProps = (0, _utils2.partitionHTMLProps)(restProps, {
|
|
@@ -55,7 +55,7 @@ var PredefinedRanges = /*#__PURE__*/_react.default.forwardRef(function (props, r
|
|
|
55
55
|
if (disabled) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
onShortcutClick === null || onShortcutClick === void 0
|
|
58
|
+
onShortcutClick === null || onShortcutClick === void 0 || onShortcutClick(range, closeOverlay !== false ? true : false, event);
|
|
59
59
|
};
|
|
60
60
|
return /*#__PURE__*/_react.default.createElement(_Button.default, (0, _extends2.default)({
|
|
61
61
|
appearance: "link",
|
|
@@ -51,7 +51,7 @@ function useFocus(props) {
|
|
|
51
51
|
(0, _delay.default)(function () {
|
|
52
52
|
var container = getOverlayContainer();
|
|
53
53
|
var selectedElement = container === null || container === void 0 ? void 0 : container.querySelector('[aria-selected="true"]');
|
|
54
|
-
selectedElement === null || selectedElement === void 0
|
|
54
|
+
selectedElement === null || selectedElement === void 0 || selectedElement.focus();
|
|
55
55
|
}, 1);
|
|
56
56
|
};
|
|
57
57
|
|
|
@@ -15,7 +15,7 @@ function useMonthView(props) {
|
|
|
15
15
|
* The callback triggered after the month selection box is opened or closed.
|
|
16
16
|
*/
|
|
17
17
|
var toggleMonthView = (0, _hooks.useEventCallback)(function (show) {
|
|
18
|
-
onToggleMonthDropdown === null || onToggleMonthDropdown === void 0
|
|
18
|
+
onToggleMonthDropdown === null || onToggleMonthDropdown === void 0 || onToggleMonthDropdown(show);
|
|
19
19
|
setMonthView(show);
|
|
20
20
|
});
|
|
21
21
|
return {
|
|
@@ -111,7 +111,7 @@ var DateRangeInput = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
111
111
|
var setSelectionRange = (0, _DateInput.useInputSelection)(inputRef);
|
|
112
112
|
var handleChange = (0, _hooks.useEventCallback)(function (date, event) {
|
|
113
113
|
var nextValue = dateType === _utils2.DateType.Start ? [date, value === null || value === void 0 ? void 0 : value[1]] : [value === null || value === void 0 ? void 0 : value[0], date];
|
|
114
|
-
onChange === null || onChange === void 0
|
|
114
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
115
115
|
setValue(nextValue);
|
|
116
116
|
});
|
|
117
117
|
var handleClear = (0, _hooks.useEventCallback)(function (event) {
|
|
@@ -120,7 +120,7 @@ var DateRangeInput = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
120
120
|
setSelectionRange(0, 0);
|
|
121
121
|
reset();
|
|
122
122
|
setValue(null);
|
|
123
|
-
onChange === null || onChange === void 0
|
|
123
|
+
onChange === null || onChange === void 0 || onChange(null, event);
|
|
124
124
|
});
|
|
125
125
|
var onSegmentChange = (0, _hooks.useEventCallback)(function (event, nextDirection) {
|
|
126
126
|
var input = event.target;
|
|
@@ -247,12 +247,12 @@ var DateRangeInput = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
247
247
|
end = _ref[1];
|
|
248
248
|
if ((0, _date.isValid)(start) && (0, _date.isValid)(end)) {
|
|
249
249
|
var nextValue = [start, end];
|
|
250
|
-
onChange === null || onChange === void 0
|
|
250
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
251
251
|
setValue(nextValue);
|
|
252
252
|
startDateState.setNewDate(start);
|
|
253
253
|
endDateState.setNewDate(end);
|
|
254
254
|
}
|
|
255
|
-
onPaste === null || onPaste === void 0
|
|
255
|
+
onPaste === null || onPaste === void 0 || onPaste(event);
|
|
256
256
|
});
|
|
257
257
|
var onKeyboardInput = (0, _DateInput.useKeyboardInputEvent)({
|
|
258
258
|
onSegmentChange: onSegmentChange,
|
|
@@ -297,7 +297,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
297
297
|
setSelectedDates(nextValue !== null && nextValue !== void 0 ? nextValue : []);
|
|
298
298
|
setValue(nextValue);
|
|
299
299
|
if (!(0, _utils.isSameRange)(nextValue, value, formatStr)) {
|
|
300
|
-
onChange === null || onChange === void 0
|
|
300
|
+
onChange === null || onChange === void 0 || onChange(nextValue, event);
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
// `closeOverlay` default value is `true`
|
|
@@ -348,7 +348,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
348
348
|
// in `oneTap` mode
|
|
349
349
|
if (oneTap) {
|
|
350
350
|
setDateRange(event, noHoverRangeValid ? [(0, _date.startOfDay)(date), (0, _date.endOfDay)(date)] : hoverRangeValue);
|
|
351
|
-
onSelect === null || onSelect === void 0
|
|
351
|
+
onSelect === null || onSelect === void 0 || onSelect(date, event);
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
354
|
|
|
@@ -401,7 +401,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
401
401
|
eventName: 'changeDate'
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
onSelect === null || onSelect === void 0
|
|
404
|
+
onSelect === null || onSelect === void 0 || onSelect(date, event);
|
|
405
405
|
setSelectedIdle(!isSelectedIdle);
|
|
406
406
|
});
|
|
407
407
|
|
|
@@ -463,6 +463,9 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
463
463
|
dateRange: nextCalendarDate
|
|
464
464
|
});
|
|
465
465
|
});
|
|
466
|
+
var handleExit = (0, _hooks.useEventCallback)(function () {
|
|
467
|
+
setSelectedIdle(true);
|
|
468
|
+
});
|
|
466
469
|
|
|
467
470
|
/**
|
|
468
471
|
* Toolbar operation callback function
|
|
@@ -481,7 +484,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
481
484
|
} else {
|
|
482
485
|
setSelectedDates(value !== null && value !== void 0 ? value : []);
|
|
483
486
|
}
|
|
484
|
-
onShortcutClick === null || onShortcutClick === void 0
|
|
487
|
+
onShortcutClick === null || onShortcutClick === void 0 || onShortcutClick(range, event);
|
|
485
488
|
|
|
486
489
|
// End unfinished selections.
|
|
487
490
|
setSelectedIdle(true);
|
|
@@ -499,14 +502,14 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
499
502
|
var handleClickOK = (0, _hooks.useEventCallback)(function (event) {
|
|
500
503
|
var nextValue = calculateDateRange();
|
|
501
504
|
setDateRange(event, nextValue);
|
|
502
|
-
onOk === null || onOk === void 0
|
|
505
|
+
onOk === null || onOk === void 0 || onOk(nextValue, event);
|
|
503
506
|
});
|
|
504
507
|
var handleClean = (0, _hooks.useEventCallback)(function (event) {
|
|
505
508
|
setCalendarDateRange({
|
|
506
509
|
dateRange: null
|
|
507
510
|
});
|
|
508
511
|
setDateRange(event, null);
|
|
509
|
-
onClean === null || onClean === void 0
|
|
512
|
+
onClean === null || onClean === void 0 || onClean(event);
|
|
510
513
|
event.stopPropagation();
|
|
511
514
|
});
|
|
512
515
|
|
|
@@ -602,7 +605,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
602
605
|
};
|
|
603
606
|
var handleClose = (0, _hooks.useEventCallback)(function () {
|
|
604
607
|
var _trigger$current, _trigger$current$clos;
|
|
605
|
-
(_trigger$current = trigger.current) === null || _trigger$current === void 0
|
|
608
|
+
(_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);
|
|
606
609
|
});
|
|
607
610
|
var handleInputKeyDown = (0, _hooks.useEventCallback)(function (event) {
|
|
608
611
|
(0, _Picker.onMenuKeyDown)(event, {
|
|
@@ -613,7 +616,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
613
616
|
open = _ref4.open;
|
|
614
617
|
if (!open) {
|
|
615
618
|
var _trigger$current3;
|
|
616
|
-
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0
|
|
619
|
+
(_trigger$current3 = trigger.current) === null || _trigger$current3 === void 0 || _trigger$current3.open();
|
|
617
620
|
}
|
|
618
621
|
}
|
|
619
622
|
});
|
|
@@ -809,7 +812,7 @@ var DateRangePicker = /*#__PURE__*/_react.default.forwardRef(function (props, re
|
|
|
809
812
|
pickerProps: (0, _pick.default)(props, _Picker.pickTriggerPropKeys),
|
|
810
813
|
placement: placement,
|
|
811
814
|
onEnter: (0, _utils2.createChainedFunction)(events.onActive, handleEnter, onEnter),
|
|
812
|
-
onExit: (0, _utils2.createChainedFunction)(events.onInactive, onExit),
|
|
815
|
+
onExit: (0, _utils2.createChainedFunction)(events.onInactive, handleExit, onExit),
|
|
813
816
|
speaker: renderCalendarOverlay
|
|
814
817
|
}, /*#__PURE__*/_react.default.createElement(Component, {
|
|
815
818
|
ref: root,
|
|
@@ -17,19 +17,19 @@ function useCalendarHandlers(_ref) {
|
|
|
17
17
|
return calendarDateRange[index];
|
|
18
18
|
}, [calendarDateRange, index]);
|
|
19
19
|
var handleSelect = (0, _hooks.useEventCallback)(function (date, event) {
|
|
20
|
-
onSelect === null || onSelect === void 0
|
|
20
|
+
onSelect === null || onSelect === void 0 || onSelect(index, date, event);
|
|
21
21
|
});
|
|
22
22
|
var handleChangeMonth = (0, _hooks.useEventCallback)(function (nextPageDate) {
|
|
23
|
-
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0
|
|
23
|
+
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0 || onChangeCalendarMonth(index, nextPageDate);
|
|
24
24
|
});
|
|
25
25
|
var handleChangeTime = (0, _hooks.useEventCallback)(function (nextPageDate) {
|
|
26
|
-
onChangeCalendarTime === null || onChangeCalendarTime === void 0
|
|
26
|
+
onChangeCalendarTime === null || onChangeCalendarTime === void 0 || onChangeCalendarTime(index, nextPageDate);
|
|
27
27
|
});
|
|
28
28
|
var handleMoveForward = (0, _hooks.useEventCallback)(function () {
|
|
29
|
-
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0
|
|
29
|
+
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0 || onChangeCalendarMonth(index, (0, _date.addMonths)(calendarDate, 1));
|
|
30
30
|
});
|
|
31
31
|
var handleMoveBackward = (0, _hooks.useEventCallback)(function () {
|
|
32
|
-
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0
|
|
32
|
+
onChangeCalendarMonth === null || onChangeCalendarMonth === void 0 || onChangeCalendarMonth(index, (0, _date.addMonths)(calendarDate, -1));
|
|
33
33
|
});
|
|
34
34
|
return {
|
|
35
35
|
calendarDate: calendarDate,
|
package/cjs/Dropdown/Dropdown.js
CHANGED
|
@@ -143,11 +143,11 @@ var Dropdown = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
143
143
|
}, popupProps), children);
|
|
144
144
|
},
|
|
145
145
|
onToggleMenu: function onToggleMenu(open) {
|
|
146
|
-
onToggle === null || onToggle === void 0
|
|
146
|
+
onToggle === null || onToggle === void 0 || onToggle(open);
|
|
147
147
|
if (open) {
|
|
148
|
-
onOpen === null || onOpen === void 0
|
|
148
|
+
onOpen === null || onOpen === void 0 || onOpen();
|
|
149
149
|
} else {
|
|
150
|
-
onClose === null || onClose === void 0
|
|
150
|
+
onClose === null || onClose === void 0 || onClose();
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}, function (_ref2, menuContainerRef) {
|
|
@@ -56,8 +56,8 @@ var DropdownItem = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
56
56
|
prefix = _useClassNames.prefix;
|
|
57
57
|
var handleSelectItem = (0, _react.useCallback)(function (event) {
|
|
58
58
|
var _dropdown$onSelect;
|
|
59
|
-
onSelect === null || onSelect === void 0
|
|
60
|
-
dropdown === null || dropdown === void 0
|
|
59
|
+
onSelect === null || onSelect === void 0 || onSelect(eventKey, event);
|
|
60
|
+
dropdown === null || dropdown === void 0 || (_dropdown$onSelect = dropdown.onSelect) === null || _dropdown$onSelect === void 0 || _dropdown$onSelect.call(dropdown, eventKey, event);
|
|
61
61
|
}, [onSelect, eventKey, dropdown]);
|
|
62
62
|
var selected = activeProp || !(0, _isNil.default)(eventKey) && (0, _utils.shallowEqual)(dropdown === null || dropdown === void 0 ? void 0 : dropdown.activeKey, eventKey);
|
|
63
63
|
var dispatch = dropdown === null || dropdown === void 0 ? void 0 : dropdown.dispatch;
|
|
@@ -65,7 +65,7 @@ var DropdownMenu = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
65
65
|
var _useCustom = (0, _CustomProvider.useCustom)(),
|
|
66
66
|
rtl = _useCustom.rtl;
|
|
67
67
|
var handleToggleSubmenu = (0, _react.useCallback)(function (_, event) {
|
|
68
|
-
onToggle === null || onToggle === void 0
|
|
68
|
+
onToggle === null || onToggle === void 0 || onToggle(eventKey, event);
|
|
69
69
|
}, [eventKey, onToggle]);
|
|
70
70
|
var _useClassNames = (0, _hooks.useClassNames)(classPrefix),
|
|
71
71
|
merge = _useClassNames.merge,
|
package/cjs/Form/Form.js
CHANGED
|
@@ -104,17 +104,17 @@ var Form = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
104
104
|
var submit = (0, _hooks.useEventCallback)(function (event) {
|
|
105
105
|
// Check the form before submitting
|
|
106
106
|
if (check()) {
|
|
107
|
-
onSubmit === null || onSubmit === void 0
|
|
107
|
+
onSubmit === null || onSubmit === void 0 || onSubmit(formValue, event);
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
var reset = (0, _hooks.useEventCallback)(function (event) {
|
|
111
111
|
resetErrors();
|
|
112
|
-
onReset === null || onReset === void 0
|
|
112
|
+
onReset === null || onReset === void 0 || onReset(resetFormValue(), event);
|
|
113
113
|
});
|
|
114
114
|
var handleSubmit = (0, _hooks.useEventCallback)(function (event) {
|
|
115
115
|
var _event$preventDefault, _event$stopPropagatio;
|
|
116
|
-
event === null || event === void 0
|
|
117
|
-
event === null || event === void 0
|
|
116
|
+
event === null || event === void 0 || (_event$preventDefault = event.preventDefault) === null || _event$preventDefault === void 0 || _event$preventDefault.call(event);
|
|
117
|
+
event === null || event === void 0 || (_event$stopPropagatio = event.stopPropagation) === null || _event$stopPropagatio === void 0 || _event$stopPropagatio.call(event);
|
|
118
118
|
|
|
119
119
|
// Prevent submission when the form is disabled, readOnly, or plaintext
|
|
120
120
|
if (disabled || readOnly || plaintext) {
|
|
@@ -124,8 +124,8 @@ var Form = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
124
124
|
});
|
|
125
125
|
var handleReset = (0, _hooks.useEventCallback)(function (event) {
|
|
126
126
|
var _event$preventDefault2, _event$stopPropagatio2;
|
|
127
|
-
event === null || event === void 0
|
|
128
|
-
event === null || event === void 0
|
|
127
|
+
event === null || event === void 0 || (_event$preventDefault2 = event.preventDefault) === null || _event$preventDefault2 === void 0 || _event$preventDefault2.call(event);
|
|
128
|
+
event === null || event === void 0 || (_event$stopPropagatio2 = event.stopPropagation) === null || _event$stopPropagatio2 === void 0 || _event$stopPropagatio2.call(event);
|
|
129
129
|
|
|
130
130
|
// Prevent reset when the form is disabled, readOnly, or plaintext
|
|
131
131
|
if (disabled || readOnly || plaintext) {
|
|
@@ -149,14 +149,14 @@ var Form = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
149
149
|
});
|
|
150
150
|
var removeFieldValue = (0, _hooks.useEventCallback)(function (name) {
|
|
151
151
|
var formValue = onRemoveValue(name);
|
|
152
|
-
onChange === null || onChange === void 0
|
|
152
|
+
onChange === null || onChange === void 0 || onChange(formValue);
|
|
153
153
|
});
|
|
154
154
|
var removeFieldError = (0, _hooks.useEventCallback)(function (name) {
|
|
155
155
|
onRemoveError(name);
|
|
156
156
|
});
|
|
157
157
|
var onFieldChange = (0, _hooks.useEventCallback)(function (name, value, event) {
|
|
158
158
|
var nextFormValue = setFieldValue(name, value);
|
|
159
|
-
onChange === null || onChange === void 0
|
|
159
|
+
onChange === null || onChange === void 0 || onChange(nextFormValue, event);
|
|
160
160
|
});
|
|
161
161
|
var formContextValue = {
|
|
162
162
|
errorFromContext: errorFromContext,
|