rsuite 5.0.0 → 5.1.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 +67 -6
- package/Grid/styles/index.less +1 -2
- package/IconButton/styles/index.less +1 -1
- package/MaskedInput/package.json +7 -0
- package/MultiCascader/styles/index.less +3 -0
- package/Navbar/styles/index.less +8 -0
- package/Picker/styles/index.less +1 -1
- package/Picker/styles/mixin.less +1 -1
- package/README.md +16 -10
- package/Sidenav/styles/index.less +13 -16
- package/Toggle/styles/index.less +20 -0
- package/Toggle/styles/mixin.less +12 -0
- package/Uploader/styles/index.less +10 -1
- package/cjs/@types/common.d.ts +0 -1
- package/cjs/Animation/Collapse.js +8 -8
- package/cjs/AutoComplete/AutoComplete.js +10 -14
- package/cjs/Badge/Badge.js +6 -10
- package/cjs/Breadcrumb/Breadcrumb.js +8 -12
- package/cjs/Breadcrumb/BreadcrumbItem.js +4 -8
- package/cjs/Button/Button.js +6 -10
- package/cjs/ButtonGroup/ButtonGroup.js +6 -10
- package/cjs/Calendar/Calendar.js +4 -8
- package/cjs/Calendar/CalendarPanel.js +6 -10
- package/cjs/Calendar/Header.js +4 -8
- package/cjs/Calendar/MonthDropdown.js +10 -14
- package/cjs/Calendar/MonthDropdownItem.js +6 -10
- package/cjs/Calendar/Table.js +6 -10
- package/cjs/Calendar/TableHeaderRow.js +4 -7
- package/cjs/Calendar/TableRow.js +7 -11
- package/cjs/Calendar/TimeDropdown.js +4 -8
- package/cjs/Calendar/View.js +4 -8
- package/cjs/Carousel/Carousel.js +10 -14
- package/cjs/Cascader/Cascader.js +29 -26
- package/cjs/Cascader/DropdownMenu.js +19 -21
- package/cjs/CheckPicker/CheckPicker.js +33 -29
- package/cjs/CheckTreePicker/CheckTreeNode.js +4 -6
- package/cjs/CheckTreePicker/CheckTreePicker.js +47 -35
- package/cjs/Checkbox/Checkbox.js +8 -13
- package/cjs/CheckboxGroup/CheckboxGroup.d.ts +1 -12
- package/cjs/CheckboxGroup/CheckboxGroup.js +7 -13
- package/cjs/CheckboxGroup/CheckboxGroupContext.d.ts +13 -0
- package/cjs/CheckboxGroup/CheckboxGroupContext.js +12 -0
- package/cjs/CheckboxGroup/index.d.ts +4 -3
- package/cjs/CheckboxGroup/index.js +6 -4
- package/cjs/Col/Col.js +3 -2
- package/cjs/Container/Container.js +4 -7
- package/cjs/DOMHelper/index.d.ts +1 -1
- package/cjs/DatePicker/DatePicker.js +27 -22
- package/cjs/DatePicker/Toolbar.js +4 -8
- package/cjs/DateRangePicker/Calendar.js +12 -14
- package/cjs/DateRangePicker/DateRangePicker.js +40 -33
- package/cjs/Divider/Divider.js +4 -8
- package/cjs/Drawer/Drawer.js +8 -10
- package/cjs/Dropdown/Dropdown.js +8 -12
- package/cjs/Dropdown/DropdownItem.js +25 -22
- package/cjs/Dropdown/DropdownMenu.js +2 -6
- package/cjs/Dropdown/DropdownToggle.js +4 -8
- package/cjs/FlexboxGrid/FlexboxGrid.js +8 -12
- package/cjs/FlexboxGrid/FlexboxGridItem.js +8 -12
- package/cjs/Form/Form.js +12 -16
- package/cjs/FormControl/FormControl.js +6 -2
- package/cjs/IconButton/IconButton.js +4 -8
- package/cjs/Input/Input.js +6 -10
- package/cjs/InputNumber/InputNumber.js +14 -18
- package/cjs/InputPicker/InputAutosize.js +2 -4
- package/cjs/InputPicker/InputPicker.js +32 -30
- package/cjs/List/List.js +12 -16
- package/cjs/List/ListItem.js +6 -10
- package/cjs/Loader/Loader.js +6 -10
- package/cjs/MaskedInput/MaskedInput.d.ts +43 -0
- package/cjs/MaskedInput/MaskedInput.js +80 -0
- package/cjs/MaskedInput/adjustCaretPosition.d.ts +11 -0
- package/cjs/MaskedInput/adjustCaretPosition.js +218 -0
- package/cjs/MaskedInput/conformToMask.d.ts +8 -0
- package/cjs/MaskedInput/conformToMask.js +247 -0
- package/cjs/MaskedInput/createTextMaskInputElement.d.ts +7 -0
- package/cjs/MaskedInput/createTextMaskInputElement.js +226 -0
- package/cjs/MaskedInput/index.d.ts +3 -0
- package/cjs/MaskedInput/index.js +11 -0
- package/cjs/MaskedInput/types.d.ts +10 -0
- package/cjs/{@types/icons.js → MaskedInput/types.js} +0 -0
- package/cjs/MaskedInput/utilities.d.ts +7 -0
- package/cjs/MaskedInput/utilities.js +47 -0
- package/cjs/Menu/Menu.d.ts +0 -1
- package/cjs/Menu/Menu.js +3 -5
- package/cjs/Message/Message.js +8 -12
- package/cjs/Modal/Modal.d.ts +1 -10
- package/cjs/Modal/Modal.js +35 -27
- package/cjs/Modal/ModalBody.js +6 -10
- package/cjs/Modal/ModalContext.d.ts +12 -0
- package/cjs/Modal/ModalContext.js +12 -0
- package/cjs/Modal/ModalDialog.js +8 -8
- package/cjs/Modal/ModalHeader.js +8 -12
- package/cjs/Modal/ModalTitle.d.ts +3 -2
- package/cjs/Modal/ModalTitle.js +43 -4
- package/cjs/MultiCascader/DropdownMenu.js +21 -23
- package/cjs/MultiCascader/MultiCascader.js +35 -32
- package/cjs/Nav/Nav.js +6 -10
- package/cjs/Navbar/Navbar.js +6 -9
- package/cjs/Notification/Notification.js +6 -10
- package/cjs/Overlay/Modal.js +11 -18
- package/cjs/Overlay/Overlay.js +2 -5
- package/cjs/Overlay/OverlayTrigger.js +9 -9
- package/cjs/Overlay/Position.js +4 -8
- package/cjs/Overlay/positionUtils.js +1 -1
- package/cjs/Pagination/Pagination.js +10 -13
- package/cjs/Pagination/PaginationButton.js +4 -8
- package/cjs/Pagination/PaginationGroup.js +11 -12
- package/cjs/Panel/Panel.js +6 -10
- package/cjs/PanelGroup/PanelGroup.js +4 -8
- package/cjs/Picker/DropdownMenu.js +2 -3
- package/cjs/Picker/DropdownMenuGroup.js +4 -8
- package/cjs/Picker/DropdownMenuItem.js +4 -8
- package/cjs/Picker/PickerToggle.js +15 -14
- package/cjs/Picker/propTypes.d.ts +2 -16
- package/cjs/Picker/propTypes.js +4 -17
- package/cjs/Picker/utils.js +14 -9
- package/cjs/Placeholder/PlaceholderGraph.js +6 -10
- package/cjs/Placeholder/PlaceholderGrid.js +12 -16
- package/cjs/Placeholder/PlaceholderParagraph.js +10 -14
- package/cjs/Popover/Popover.js +4 -8
- package/cjs/Progress/ProgressCircle.js +18 -22
- package/cjs/Progress/ProgressLine.js +8 -12
- package/cjs/Radio/Radio.js +6 -11
- package/cjs/RadioGroup/RadioGroup.js +6 -9
- package/cjs/RangeSlider/RangeSlider.js +17 -20
- package/cjs/Rate/Character.js +4 -7
- package/cjs/Rate/Rate.js +14 -18
- package/cjs/Ripple/Ripple.js +4 -8
- package/cjs/SelectPicker/SelectPicker.js +31 -28
- package/cjs/Sidebar/Sidebar.js +6 -10
- package/cjs/Sidenav/Sidenav.js +8 -11
- package/cjs/Sidenav/SidenavDropdown.d.ts +6 -1
- package/cjs/Sidenav/SidenavDropdown.js +19 -19
- package/cjs/Sidenav/SidenavDropdownCollapse.js +2 -6
- package/cjs/Sidenav/SidenavDropdownItem.js +4 -8
- package/cjs/Sidenav/SidenavDropdownMenu.js +4 -8
- package/cjs/Sidenav/SidenavToggle.js +4 -8
- package/cjs/Slider/Graduated.js +4 -8
- package/cjs/Slider/Handle.d.ts +2 -0
- package/cjs/Slider/Handle.js +23 -12
- package/cjs/Slider/Input.d.ts +3 -0
- package/cjs/Slider/Input.js +35 -0
- package/cjs/Slider/Mark.js +4 -8
- package/cjs/Slider/ProgressBar.js +4 -8
- package/cjs/Slider/Slider.d.ts +0 -3
- package/cjs/Slider/Slider.js +14 -22
- package/cjs/Steps/StepItem.js +4 -7
- package/cjs/Steps/Steps.js +8 -12
- package/cjs/Table/Table.d.ts +7 -7
- package/cjs/Table/Table.js +5 -5
- package/cjs/TagInput/index.js +4 -6
- package/cjs/TagPicker/index.d.ts +1 -1
- package/cjs/TagPicker/index.js +4 -6
- package/cjs/Timeline/Timeline.js +6 -11
- package/cjs/Timeline/TimelineItem.js +4 -8
- package/cjs/Toggle/Toggle.d.ts +2 -0
- package/cjs/Toggle/Toggle.js +27 -13
- package/cjs/Tooltip/Tooltip.js +4 -8
- package/cjs/Tree/Tree.d.ts +6 -0
- package/cjs/TreePicker/TreeNode.js +4 -6
- package/cjs/TreePicker/TreePicker.js +38 -29
- package/cjs/Uploader/UploadFileItem.d.ts +1 -0
- package/cjs/Uploader/UploadFileItem.js +42 -33
- package/cjs/Uploader/UploadTrigger.js +4 -8
- package/cjs/Uploader/Uploader.d.ts +2 -0
- package/cjs/Uploader/Uploader.js +28 -29
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +5 -1
- package/cjs/locales/fa_IR.d.ts +105 -0
- package/cjs/locales/fa_IR.js +84 -0
- package/cjs/locales/index.d.ts +1 -0
- package/cjs/locales/index.js +6 -2
- package/cjs/toaster/ToastContainer.js +6 -10
- package/cjs/utils/createComponent.d.ts +1 -2
- package/cjs/utils/createComponent.js +10 -13
- package/cjs/utils/previewFile.d.ts +1 -0
- package/cjs/utils/previewFile.js +11 -0
- package/cjs/utils/useUniqueId.d.ts +3 -1
- package/cjs/utils/useUniqueId.js +4 -2
- package/dist/rsuite-rtl.css +115 -44
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +115 -44
- package/dist/rsuite.js +233 -144
- 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/@types/common.d.ts +0 -1
- package/esm/Animation/Collapse.js +8 -8
- package/esm/AutoComplete/AutoComplete.js +11 -14
- package/esm/Badge/Badge.js +6 -9
- package/esm/Breadcrumb/Breadcrumb.js +8 -11
- package/esm/Breadcrumb/BreadcrumbItem.js +4 -7
- package/esm/Button/Button.js +6 -9
- package/esm/ButtonGroup/ButtonGroup.js +6 -9
- package/esm/Calendar/Calendar.js +4 -7
- package/esm/Calendar/CalendarPanel.js +6 -9
- package/esm/Calendar/Header.js +4 -7
- package/esm/Calendar/MonthDropdown.js +10 -13
- package/esm/Calendar/MonthDropdownItem.js +6 -9
- package/esm/Calendar/Table.js +6 -9
- package/esm/Calendar/TableHeaderRow.js +4 -7
- package/esm/Calendar/TableRow.js +7 -10
- package/esm/Calendar/TimeDropdown.js +4 -7
- package/esm/Calendar/View.js +4 -7
- package/esm/Carousel/Carousel.js +10 -13
- package/esm/Cascader/Cascader.js +29 -26
- package/esm/Cascader/DropdownMenu.js +19 -21
- package/esm/CheckPicker/CheckPicker.js +33 -29
- package/esm/CheckTreePicker/CheckTreeNode.js +4 -6
- package/esm/CheckTreePicker/CheckTreePicker.js +47 -37
- package/esm/Checkbox/Checkbox.js +8 -12
- package/esm/CheckboxGroup/CheckboxGroup.d.ts +1 -12
- package/esm/CheckboxGroup/CheckboxGroup.js +5 -8
- package/esm/CheckboxGroup/CheckboxGroupContext.d.ts +13 -0
- package/esm/CheckboxGroup/CheckboxGroupContext.js +2 -0
- package/esm/CheckboxGroup/index.d.ts +4 -3
- package/esm/CheckboxGroup/index.js +2 -2
- package/esm/Col/Col.js +3 -2
- package/esm/Container/Container.js +4 -7
- package/esm/DOMHelper/index.d.ts +1 -1
- package/esm/DatePicker/DatePicker.js +27 -23
- package/esm/DatePicker/Toolbar.js +5 -8
- package/esm/DateRangePicker/Calendar.js +12 -13
- package/esm/DateRangePicker/DateRangePicker.js +40 -34
- package/esm/Divider/Divider.js +4 -7
- package/esm/Drawer/Drawer.js +8 -9
- package/esm/Dropdown/Dropdown.js +9 -12
- package/esm/Dropdown/DropdownItem.js +26 -22
- package/esm/Dropdown/DropdownMenu.js +3 -6
- package/esm/Dropdown/DropdownToggle.js +4 -7
- package/esm/FlexboxGrid/FlexboxGrid.js +8 -11
- package/esm/FlexboxGrid/FlexboxGridItem.js +8 -11
- package/esm/Form/Form.js +12 -15
- package/esm/FormControl/FormControl.js +6 -2
- package/esm/IconButton/IconButton.js +4 -7
- package/esm/Input/Input.js +6 -9
- package/esm/InputNumber/InputNumber.js +14 -17
- package/esm/InputPicker/InputAutosize.js +2 -4
- package/esm/InputPicker/InputPicker.js +32 -30
- package/esm/List/List.js +12 -15
- package/esm/List/ListItem.js +6 -9
- package/esm/Loader/Loader.js +6 -9
- package/esm/MaskedInput/MaskedInput.d.ts +43 -0
- package/esm/MaskedInput/MaskedInput.js +67 -0
- package/esm/MaskedInput/adjustCaretPosition.d.ts +11 -0
- package/esm/MaskedInput/adjustCaretPosition.js +213 -0
- package/esm/MaskedInput/conformToMask.d.ts +8 -0
- package/esm/MaskedInput/conformToMask.js +239 -0
- package/esm/MaskedInput/createTextMaskInputElement.d.ts +7 -0
- package/esm/MaskedInput/createTextMaskInputElement.js +212 -0
- package/esm/MaskedInput/index.d.ts +3 -0
- package/esm/MaskedInput/index.js +2 -0
- package/esm/MaskedInput/types.d.ts +10 -0
- package/esm/{@types/icons.js → MaskedInput/types.js} +0 -0
- package/esm/MaskedInput/utilities.d.ts +7 -0
- package/esm/MaskedInput/utilities.js +38 -0
- package/esm/Menu/Menu.d.ts +0 -1
- package/esm/Menu/Menu.js +3 -5
- package/esm/Message/Message.js +8 -11
- package/esm/Modal/Modal.d.ts +1 -10
- package/esm/Modal/Modal.js +31 -21
- package/esm/Modal/ModalBody.js +5 -8
- package/esm/Modal/ModalContext.d.ts +12 -0
- package/esm/Modal/ModalContext.js +2 -0
- package/esm/Modal/ModalDialog.js +8 -8
- package/esm/Modal/ModalHeader.js +7 -10
- package/esm/Modal/ModalTitle.d.ts +3 -2
- package/esm/Modal/ModalTitle.js +35 -4
- package/esm/MultiCascader/DropdownMenu.js +21 -23
- package/esm/MultiCascader/MultiCascader.js +35 -32
- package/esm/Nav/Nav.js +6 -9
- package/esm/Navbar/Navbar.js +6 -9
- package/esm/Notification/Notification.js +6 -9
- package/esm/Overlay/Modal.js +11 -18
- package/esm/Overlay/Overlay.js +2 -5
- package/esm/Overlay/OverlayTrigger.js +9 -9
- package/esm/Overlay/Position.js +4 -7
- package/esm/Overlay/positionUtils.js +1 -1
- package/esm/Pagination/Pagination.js +10 -13
- package/esm/Pagination/PaginationButton.js +4 -7
- package/esm/Pagination/PaginationGroup.js +10 -11
- package/esm/Panel/Panel.js +6 -9
- package/esm/PanelGroup/PanelGroup.js +4 -7
- package/esm/Picker/DropdownMenu.js +2 -3
- package/esm/Picker/DropdownMenuGroup.js +4 -7
- package/esm/Picker/DropdownMenuItem.js +4 -7
- package/esm/Picker/PickerToggle.js +13 -12
- package/esm/Picker/propTypes.d.ts +2 -16
- package/esm/Picker/propTypes.js +2 -13
- package/esm/Picker/utils.js +14 -9
- package/esm/Placeholder/PlaceholderGraph.js +6 -9
- package/esm/Placeholder/PlaceholderGrid.js +12 -15
- package/esm/Placeholder/PlaceholderParagraph.js +10 -13
- package/esm/Popover/Popover.js +4 -7
- package/esm/Progress/ProgressCircle.js +18 -21
- package/esm/Progress/ProgressLine.js +8 -11
- package/esm/Radio/Radio.js +6 -10
- package/esm/RadioGroup/RadioGroup.js +6 -9
- package/esm/RangeSlider/RangeSlider.js +17 -20
- package/esm/Rate/Character.js +4 -7
- package/esm/Rate/Rate.js +14 -17
- package/esm/Ripple/Ripple.js +4 -7
- package/esm/SelectPicker/SelectPicker.js +31 -28
- package/esm/Sidebar/Sidebar.js +6 -9
- package/esm/Sidenav/Sidenav.js +8 -11
- package/esm/Sidenav/SidenavDropdown.d.ts +6 -1
- package/esm/Sidenav/SidenavDropdown.js +19 -18
- package/esm/Sidenav/SidenavDropdownCollapse.js +2 -5
- package/esm/Sidenav/SidenavDropdownItem.js +5 -8
- package/esm/Sidenav/SidenavDropdownMenu.js +5 -8
- package/esm/Sidenav/SidenavToggle.js +4 -7
- package/esm/Slider/Graduated.js +4 -7
- package/esm/Slider/Handle.d.ts +2 -0
- package/esm/Slider/Handle.js +23 -12
- package/esm/Slider/Input.d.ts +3 -0
- package/esm/Slider/Input.js +23 -0
- package/esm/Slider/Mark.js +4 -7
- package/esm/Slider/ProgressBar.js +4 -7
- package/esm/Slider/Slider.d.ts +0 -3
- package/esm/Slider/Slider.js +14 -22
- package/esm/Steps/StepItem.js +4 -7
- package/esm/Steps/Steps.js +8 -11
- package/esm/Table/Table.d.ts +7 -7
- package/esm/Table/Table.js +5 -5
- package/esm/TagInput/index.js +4 -6
- package/esm/TagPicker/index.d.ts +1 -1
- package/esm/TagPicker/index.js +4 -6
- package/esm/Timeline/Timeline.js +6 -10
- package/esm/Timeline/TimelineItem.js +4 -7
- package/esm/Toggle/Toggle.d.ts +2 -0
- package/esm/Toggle/Toggle.js +27 -13
- package/esm/Tooltip/Tooltip.js +4 -7
- package/esm/Tree/Tree.d.ts +6 -0
- package/esm/TreePicker/TreeNode.js +4 -6
- package/esm/TreePicker/TreePicker.js +38 -31
- package/esm/Uploader/UploadFileItem.d.ts +1 -0
- package/esm/Uploader/UploadFileItem.js +42 -33
- package/esm/Uploader/UploadTrigger.js +4 -7
- package/esm/Uploader/Uploader.d.ts +2 -0
- package/esm/Uploader/Uploader.js +28 -28
- package/esm/index.d.ts +2 -0
- package/esm/index.js +1 -0
- package/esm/locales/fa_IR.d.ts +105 -0
- package/esm/locales/fa_IR.js +74 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +2 -1
- package/esm/toaster/ToastContainer.js +6 -9
- package/esm/utils/createComponent.d.ts +1 -2
- package/esm/utils/createComponent.js +10 -13
- package/esm/utils/previewFile.d.ts +1 -0
- package/esm/utils/previewFile.js +9 -0
- package/esm/utils/useUniqueId.d.ts +3 -1
- package/esm/utils/useUniqueId.js +4 -2
- package/locales/fa_IR/package.json +7 -0
- package/package.json +6 -8
- package/styles/color-modes/dark.less +1 -0
- package/styles/color-modes/high-contrast.less +1 -0
- package/styles/color-modes/light.less +3 -0
- package/styles/variables.less +3 -1
- package/cjs/@types/icons.d.ts +0 -1
- package/esm/@types/icons.d.ts +0 -1
package/esm/Panel/Panel.js
CHANGED
|
@@ -7,16 +7,13 @@ import AngleDownIcon from '@rsuite/icons/legacy/AngleDown';
|
|
|
7
7
|
import Collapse from '../Animation/Collapse';
|
|
8
8
|
import { useClassNames, useControlled } from '../utils';
|
|
9
9
|
import { PanelGroupContext } from '../PanelGroup';
|
|
10
|
-
var defaultProps = {
|
|
11
|
-
classPrefix: 'panel',
|
|
12
|
-
panelRole: 'region',
|
|
13
|
-
as: 'div'
|
|
14
|
-
};
|
|
15
10
|
var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
16
|
-
var
|
|
11
|
+
var _props$as = props.as,
|
|
12
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
17
13
|
children = props.children,
|
|
18
14
|
className = props.className,
|
|
19
|
-
classPrefix = props.classPrefix,
|
|
15
|
+
_props$classPrefix = props.classPrefix,
|
|
16
|
+
classPrefix = _props$classPrefix === void 0 ? 'panel' : _props$classPrefix,
|
|
20
17
|
bodyFill = props.bodyFill,
|
|
21
18
|
bordered = props.bordered,
|
|
22
19
|
collapsibleProp = props.collapsible,
|
|
@@ -25,7 +22,8 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
22
|
expandedProp = props.expanded,
|
|
26
23
|
header = props.header,
|
|
27
24
|
headerRoleProp = props.headerRole,
|
|
28
|
-
panelRole = props.panelRole,
|
|
25
|
+
_props$panelRole = props.panelRole,
|
|
26
|
+
panelRole = _props$panelRole === void 0 ? 'region' : _props$panelRole,
|
|
29
27
|
shaded = props.shaded,
|
|
30
28
|
id = props.id,
|
|
31
29
|
onEnter = props.onEnter,
|
|
@@ -145,7 +143,6 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
145
143
|
}), renderHeading(), collapsible ? renderCollapsibleBody() : renderBody());
|
|
146
144
|
});
|
|
147
145
|
Panel.displayName = 'Panel';
|
|
148
|
-
Panel.defaultProps = defaultProps;
|
|
149
146
|
Panel.propTypes = {
|
|
150
147
|
collapsible: PropTypes.bool,
|
|
151
148
|
bordered: PropTypes.bool,
|
|
@@ -3,18 +3,16 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames, useControlled } from '../utils';
|
|
6
|
-
var defaultProps = {
|
|
7
|
-
as: 'div',
|
|
8
|
-
classPrefix: 'panel-group'
|
|
9
|
-
};
|
|
10
6
|
export var PanelGroupContext = /*#__PURE__*/React.createContext({});
|
|
11
7
|
var PanelGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
|
-
var
|
|
8
|
+
var _props$as = props.as,
|
|
9
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
13
10
|
accordion = props.accordion,
|
|
14
11
|
defaultActiveKey = props.defaultActiveKey,
|
|
15
12
|
bordered = props.bordered,
|
|
16
13
|
className = props.className,
|
|
17
|
-
classPrefix = props.classPrefix,
|
|
14
|
+
_props$classPrefix = props.classPrefix,
|
|
15
|
+
classPrefix = _props$classPrefix === void 0 ? 'panel-group' : _props$classPrefix,
|
|
18
16
|
children = props.children,
|
|
19
17
|
activeProp = props.activeKey,
|
|
20
18
|
onSelect = props.onSelect,
|
|
@@ -49,7 +47,6 @@ var PanelGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
49
47
|
}, children));
|
|
50
48
|
});
|
|
51
49
|
PanelGroup.displayName = 'PanelGroup';
|
|
52
|
-
PanelGroup.defaultProps = defaultProps;
|
|
53
50
|
PanelGroup.propTypes = {
|
|
54
51
|
accordion: PropTypes.bool,
|
|
55
52
|
activeKey: PropTypes.any,
|
|
@@ -201,8 +201,7 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
201
201
|
return /*#__PURE__*/React.createElement(List, _extends({
|
|
202
202
|
role: "listbox",
|
|
203
203
|
containerRole: '',
|
|
204
|
-
"aria-readonly": null
|
|
205
|
-
}, listProps, {
|
|
204
|
+
"aria-readonly": null,
|
|
206
205
|
width: width,
|
|
207
206
|
height: height || maxHeight,
|
|
208
207
|
scrollToIndex: findIndex(data, function (item) {
|
|
@@ -211,7 +210,7 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
211
210
|
rowCount: rowCount,
|
|
212
211
|
rowHeight: getRowHeight.bind(_this, filteredItems),
|
|
213
212
|
rowRenderer: renderItem.bind(null, filteredItems)
|
|
214
|
-
}));
|
|
213
|
+
}, listProps));
|
|
215
214
|
}) : filteredItems.map(function (_item, index) {
|
|
216
215
|
return renderItem(filteredItems, {
|
|
217
216
|
index: index
|
|
@@ -8,13 +8,11 @@ import React from 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { useClassNames } from '../utils';
|
|
10
10
|
import ArrowDown from '@rsuite/icons/legacy/ArrowDown';
|
|
11
|
-
var defaultProps = {
|
|
12
|
-
as: 'div',
|
|
13
|
-
classPrefix: 'dropdown-menu-group'
|
|
14
|
-
};
|
|
15
11
|
var DropdownMenuGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
16
|
-
var
|
|
17
|
-
|
|
12
|
+
var _props$as = props.as,
|
|
13
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
14
|
+
_props$classPrefix = props.classPrefix,
|
|
15
|
+
classPrefix = _props$classPrefix === void 0 ? 'dropdown-menu-group' : _props$classPrefix,
|
|
18
16
|
children = props.children,
|
|
19
17
|
className = props.className,
|
|
20
18
|
rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "children", "className"]);
|
|
@@ -39,7 +37,6 @@ var DropdownMenuGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
39
37
|
})));
|
|
40
38
|
});
|
|
41
39
|
DropdownMenuGroup.displayName = 'DropdownMenuGroup';
|
|
42
|
-
DropdownMenuGroup.defaultProps = defaultProps;
|
|
43
40
|
DropdownMenuGroup.propTypes = {
|
|
44
41
|
classPrefix: PropTypes.string,
|
|
45
42
|
className: PropTypes.string,
|
|
@@ -3,14 +3,12 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames } from '../utils';
|
|
6
|
-
var defaultProps = {
|
|
7
|
-
as: 'div',
|
|
8
|
-
classPrefix: 'dropdown-menu-item'
|
|
9
|
-
};
|
|
10
6
|
var DropdownMenuItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11
|
-
var
|
|
7
|
+
var _props$as = props.as,
|
|
8
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
12
9
|
active = props.active,
|
|
13
|
-
classPrefix = props.classPrefix,
|
|
10
|
+
_props$classPrefix = props.classPrefix,
|
|
11
|
+
classPrefix = _props$classPrefix === void 0 ? 'dropdown-menu-item' : _props$classPrefix,
|
|
14
12
|
children = props.children,
|
|
15
13
|
className = props.className,
|
|
16
14
|
disabled = props.disabled,
|
|
@@ -53,7 +51,6 @@ var DropdownMenuItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
53
51
|
}, renderItem ? renderItem(value) : children));
|
|
54
52
|
});
|
|
55
53
|
DropdownMenuItem.displayName = 'DropdownMenuItem';
|
|
56
|
-
DropdownMenuItem.defaultProps = defaultProps;
|
|
57
54
|
DropdownMenuItem.propTypes = {
|
|
58
55
|
classPrefix: PropTypes.string,
|
|
59
56
|
active: PropTypes.bool,
|
|
@@ -7,21 +7,19 @@ var _templateObject, _templateObject2;
|
|
|
7
7
|
import React, { useState, useCallback, useEffect, useRef } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import debounce from 'lodash/debounce';
|
|
10
|
-
import MaskedInput from 'react-text-mask';
|
|
11
10
|
import ToggleButton from './ToggleButton';
|
|
12
11
|
import CloseButton from '../CloseButton';
|
|
13
12
|
import { useClassNames, KEY_VALUES, mergeRefs } from '../utils';
|
|
14
13
|
import Plaintext from '../Plaintext';
|
|
15
14
|
import useToggleCaret from '../utils/useToggleCaret';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
classPrefix: 'picker-toggle',
|
|
19
|
-
inputMask: []
|
|
20
|
-
};
|
|
15
|
+
import MaskedInput from '../MaskedInput';
|
|
16
|
+
var defaultInputMask = [];
|
|
21
17
|
var PickerToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
22
18
|
var activeProp = props.active,
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
_props$as = props.as,
|
|
20
|
+
Component = _props$as === void 0 ? ToggleButton : _props$as,
|
|
21
|
+
_props$classPrefix = props.classPrefix,
|
|
22
|
+
classPrefix = _props$classPrefix === void 0 ? 'picker-toggle' : _props$classPrefix,
|
|
25
23
|
children = props.children,
|
|
26
24
|
_props$caret = props.caret,
|
|
27
25
|
caret = _props$caret === void 0 ? true : _props$caret,
|
|
@@ -38,7 +36,8 @@ var PickerToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
38
36
|
input = props.input,
|
|
39
37
|
inputPlaceholder = props.inputPlaceholder,
|
|
40
38
|
inputValueProp = props.inputValue,
|
|
41
|
-
inputMask = props.inputMask,
|
|
39
|
+
_props$inputMask = props.inputMask,
|
|
40
|
+
inputMask = _props$inputMask === void 0 ? defaultInputMask : _props$inputMask,
|
|
42
41
|
onInputChange = props.onInputChange,
|
|
43
42
|
onInputPressEnter = props.onInputPressEnter,
|
|
44
43
|
onInputBlur = props.onInputBlur,
|
|
@@ -127,7 +126,7 @@ var PickerToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
127
126
|
}, hasValue ? children : null);
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
var
|
|
129
|
+
var showCleanButton = cleanableProp && hasValue && !readOnly; // When the component is read-only or disabled, the input is not interactive.
|
|
131
130
|
|
|
132
131
|
var inputFocused = readOnly || disabled ? false : input && activeState;
|
|
133
132
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
@@ -169,16 +168,18 @@ var PickerToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
169
168
|
}), children ? /*#__PURE__*/React.createElement("span", {
|
|
170
169
|
className: prefix(hasValue ? 'value' : 'placeholder'),
|
|
171
170
|
"aria-placeholder": typeof children === 'string' ? children : null
|
|
172
|
-
}, children) : null,
|
|
171
|
+
}, children) : null, showCleanButton && /*#__PURE__*/React.createElement(CloseButton, {
|
|
173
172
|
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["clean"]))),
|
|
174
173
|
tabIndex: -1,
|
|
174
|
+
locale: {
|
|
175
|
+
closeLabel: 'Clear'
|
|
176
|
+
},
|
|
175
177
|
onClick: handleClean
|
|
176
178
|
}), caret && /*#__PURE__*/React.createElement(Caret, {
|
|
177
179
|
className: prefix(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["caret"])))
|
|
178
180
|
}));
|
|
179
181
|
});
|
|
180
182
|
PickerToggle.displayName = 'PickerToggle';
|
|
181
|
-
PickerToggle.defaultProps = defaultProps;
|
|
182
183
|
PickerToggle.propTypes = {
|
|
183
184
|
classPrefix: PropTypes.string,
|
|
184
185
|
hasValue: PropTypes.bool,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { PickerAppearance, TypeAttributes } from '../@types/common';
|
|
3
2
|
export declare const pickerPropTypes: {
|
|
4
3
|
classPrefix: PropTypes.Requireable<string>;
|
|
5
4
|
className: PropTypes.Requireable<string>;
|
|
@@ -27,6 +26,7 @@ export declare const pickerPropTypes: {
|
|
|
27
26
|
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
27
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
28
|
onClean: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
+
listProps: PropTypes.Requireable<object>;
|
|
30
30
|
onEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
31
|
onEntering: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
32
|
onEntered: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -69,6 +69,7 @@ export declare const listPickerPropTypes: {
|
|
|
69
69
|
onOpen: PropTypes.Requireable<(...args: any[]) => any>;
|
|
70
70
|
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
71
71
|
onClean: PropTypes.Requireable<(...args: any[]) => any>;
|
|
72
|
+
listProps: PropTypes.Requireable<object>;
|
|
72
73
|
onEnter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
73
74
|
onEntering: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
75
|
onEntered: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -76,18 +77,3 @@ export declare const listPickerPropTypes: {
|
|
|
76
77
|
onExiting: PropTypes.Requireable<(...args: any[]) => any>;
|
|
77
78
|
onExited: PropTypes.Requireable<(...args: any[]) => any>;
|
|
78
79
|
};
|
|
79
|
-
export declare const pickerDefaultProps: {
|
|
80
|
-
cleanable: boolean;
|
|
81
|
-
placement: TypeAttributes.Placement;
|
|
82
|
-
appearance: PickerAppearance;
|
|
83
|
-
};
|
|
84
|
-
export declare const listPickerDefaultProps: {
|
|
85
|
-
data: any[];
|
|
86
|
-
disabledItemValues: any[];
|
|
87
|
-
childrenKey: string;
|
|
88
|
-
valueKey: string;
|
|
89
|
-
labelKey: string;
|
|
90
|
-
cleanable: boolean;
|
|
91
|
-
placement: TypeAttributes.Placement;
|
|
92
|
-
appearance: PickerAppearance;
|
|
93
|
-
};
|
package/esm/Picker/propTypes.js
CHANGED
|
@@ -29,7 +29,8 @@ export var pickerPropTypes = _extends({}, animationPropTypes, {
|
|
|
29
29
|
renderValue: PropTypes.func,
|
|
30
30
|
onOpen: PropTypes.func,
|
|
31
31
|
onClose: PropTypes.func,
|
|
32
|
-
onClean: PropTypes.func
|
|
32
|
+
onClean: PropTypes.func,
|
|
33
|
+
listProps: PropTypes.object
|
|
33
34
|
});
|
|
34
35
|
export var listPickerPropTypes = _extends({}, pickerPropTypes, {
|
|
35
36
|
data: PropTypes.array,
|
|
@@ -40,16 +41,4 @@ export var listPickerPropTypes = _extends({}, pickerPropTypes, {
|
|
|
40
41
|
value: PropTypes.any,
|
|
41
42
|
defaultValue: PropTypes.any,
|
|
42
43
|
onChange: PropTypes.func
|
|
43
|
-
});
|
|
44
|
-
export var pickerDefaultProps = {
|
|
45
|
-
cleanable: true,
|
|
46
|
-
placement: 'bottomStart',
|
|
47
|
-
appearance: 'default'
|
|
48
|
-
};
|
|
49
|
-
export var listPickerDefaultProps = _extends({}, pickerDefaultProps, {
|
|
50
|
-
data: [],
|
|
51
|
-
disabledItemValues: [],
|
|
52
|
-
childrenKey: 'children',
|
|
53
|
-
valueKey: 'value',
|
|
54
|
-
labelKey: 'label'
|
|
55
44
|
});
|
package/esm/Picker/utils.js
CHANGED
|
@@ -72,7 +72,7 @@ export function usePickerClassName(props) {
|
|
|
72
72
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
73
73
|
merge = _useClassNames.merge;
|
|
74
74
|
|
|
75
|
-
var classes = merge(className, withClassPrefix(name, appearance, 'toggle-wrapper', (_withClassPrefix = {}, _withClassPrefix["placement-" + kebabCase(placementPolyfill(placement))] = placement, _withClassPrefix['read-only'] = readOnly, _withClassPrefix['has-value'] = hasValue, _withClassPrefix.cleanable =
|
|
75
|
+
var classes = merge(className, withClassPrefix(name, appearance, 'toggle-wrapper', (_withClassPrefix = {}, _withClassPrefix["placement-" + kebabCase(placementPolyfill(placement))] = placement, _withClassPrefix['read-only'] = readOnly, _withClassPrefix['has-value'] = hasValue, _withClassPrefix.cleanable = cleanable, _withClassPrefix.block = block, _withClassPrefix.disabled = disabled, _withClassPrefix.countable = countable, _withClassPrefix.plaintext = plaintext, _withClassPrefix)));
|
|
76
76
|
var usedClassNamePropKeys = Object.keys(omit(props, [].concat(Object.keys(rest || {}), ['disabled', 'readOnly', 'plaintext'])));
|
|
77
77
|
return [classes, usedClassNamePropKeys];
|
|
78
78
|
}
|
|
@@ -357,13 +357,6 @@ export var useToggleKeyDownEvent = function useToggleKeyDownEvent(props) {
|
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
-
if (event.key === KEY_VALUES.ESC || event.key === KEY_VALUES.TAB) {
|
|
361
|
-
handleClose();
|
|
362
|
-
} // Native event callback
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
366
|
-
|
|
367
360
|
if (overlayRef !== null && overlayRef !== void 0 && overlayRef.current) {
|
|
368
361
|
// The keyboard operation callback on the menu.
|
|
369
362
|
onMenuKeyDown === null || onMenuKeyDown === void 0 ? void 0 : onMenuKeyDown(event);
|
|
@@ -371,8 +364,13 @@ export var useToggleKeyDownEvent = function useToggleKeyDownEvent(props) {
|
|
|
371
364
|
if (event.key === KEY_VALUES.ENTER) {
|
|
372
365
|
onMenuPressEnter === null || onMenuPressEnter === void 0 ? void 0 : onMenuPressEnter(event);
|
|
373
366
|
}
|
|
367
|
+
/**
|
|
368
|
+
* There is no callback when typing the Backspace key in the search box.
|
|
369
|
+
* The default is to remove search keywords
|
|
370
|
+
*/
|
|
374
371
|
|
|
375
|
-
|
|
372
|
+
|
|
373
|
+
if (event.key === KEY_VALUES.BACKSPACE && event.target !== (searchInputRef === null || searchInputRef === void 0 ? void 0 : searchInputRef.current)) {
|
|
376
374
|
onMenuPressBackspace === null || onMenuPressBackspace === void 0 ? void 0 : onMenuPressBackspace(event);
|
|
377
375
|
} // The search box gets focus when typing characters and numbers.
|
|
378
376
|
|
|
@@ -383,6 +381,13 @@ export var useToggleKeyDownEvent = function useToggleKeyDownEvent(props) {
|
|
|
383
381
|
searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
|
|
384
382
|
}
|
|
385
383
|
}
|
|
384
|
+
|
|
385
|
+
if (event.key === KEY_VALUES.ESC || event.key === KEY_VALUES.TAB) {
|
|
386
|
+
handleClose();
|
|
387
|
+
} // Native event callback
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
386
391
|
}, [handleClose, handleToggleDropdown, overlayRef, onExit, onKeyDown, onMenuKeyDown, onMenuPressBackspace, onMenuPressEnter, toggle, targetRef, searchInputRef]);
|
|
387
392
|
return onToggle;
|
|
388
393
|
};
|
|
@@ -3,19 +3,17 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames } from '../utils';
|
|
6
|
-
var defaultProps = {
|
|
7
|
-
as: 'div',
|
|
8
|
-
classPrefix: 'placeholder',
|
|
9
|
-
height: 200
|
|
10
|
-
};
|
|
11
6
|
var PlaceholderGraph = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
|
-
var
|
|
7
|
+
var _props$as = props.as,
|
|
8
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
13
9
|
className = props.className,
|
|
14
10
|
width = props.width,
|
|
15
|
-
height = props.height,
|
|
11
|
+
_props$height = props.height,
|
|
12
|
+
height = _props$height === void 0 ? 200 : _props$height,
|
|
16
13
|
style = props.style,
|
|
17
14
|
active = props.active,
|
|
18
|
-
classPrefix = props.classPrefix,
|
|
15
|
+
_props$classPrefix = props.classPrefix,
|
|
16
|
+
classPrefix = _props$classPrefix === void 0 ? 'placeholder' : _props$classPrefix,
|
|
19
17
|
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "width", "height", "style", "active", "classPrefix"]);
|
|
20
18
|
|
|
21
19
|
var _useClassNames = useClassNames(classPrefix),
|
|
@@ -46,5 +44,4 @@ PlaceholderGraph.propTypes = {
|
|
|
46
44
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
47
45
|
active: PropTypes.bool
|
|
48
46
|
};
|
|
49
|
-
PlaceholderGraph.defaultProps = defaultProps;
|
|
50
47
|
export default PlaceholderGraph;
|
|
@@ -4,22 +4,20 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { useClassNames } from '../utils';
|
|
7
|
-
var defaultProps = {
|
|
8
|
-
as: 'div',
|
|
9
|
-
classPrefix: 'placeholder',
|
|
10
|
-
rows: 5,
|
|
11
|
-
columns: 5,
|
|
12
|
-
rowHeight: 10,
|
|
13
|
-
rowMargin: 20
|
|
14
|
-
};
|
|
15
7
|
var PlaceholderGrid = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
16
|
-
var
|
|
8
|
+
var _props$as = props.as,
|
|
9
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
17
10
|
className = props.className,
|
|
18
|
-
classPrefix = props.classPrefix,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
_props$classPrefix = props.classPrefix,
|
|
12
|
+
classPrefix = _props$classPrefix === void 0 ? 'placeholder' : _props$classPrefix,
|
|
13
|
+
_props$rows = props.rows,
|
|
14
|
+
rows = _props$rows === void 0 ? 5 : _props$rows,
|
|
15
|
+
_props$columns = props.columns,
|
|
16
|
+
columns = _props$columns === void 0 ? 5 : _props$columns,
|
|
17
|
+
_props$rowHeight = props.rowHeight,
|
|
18
|
+
rowHeight = _props$rowHeight === void 0 ? 10 : _props$rowHeight,
|
|
19
|
+
_props$rowMargin = props.rowMargin,
|
|
20
|
+
rowMargin = _props$rowMargin === void 0 ? 20 : _props$rowMargin,
|
|
23
21
|
active = props.active,
|
|
24
22
|
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "rows", "columns", "rowHeight", "rowMargin", "active"]);
|
|
25
23
|
|
|
@@ -68,7 +66,6 @@ var PlaceholderGrid = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
68
66
|
}), colItems);
|
|
69
67
|
});
|
|
70
68
|
PlaceholderGrid.displayName = 'PlaceholderGrid';
|
|
71
|
-
PlaceholderGrid.defaultProps = defaultProps;
|
|
72
69
|
PlaceholderGrid.propTypes = {
|
|
73
70
|
className: PropTypes.string,
|
|
74
71
|
classPrefix: PropTypes.string,
|
|
@@ -3,22 +3,20 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames } from '../utils';
|
|
6
|
-
var defaultProps = {
|
|
7
|
-
as: 'div',
|
|
8
|
-
classPrefix: 'placeholder',
|
|
9
|
-
rows: 2,
|
|
10
|
-
rowHeight: 10,
|
|
11
|
-
rowMargin: 20
|
|
12
|
-
};
|
|
13
6
|
var PlaceholderParagraph = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
|
-
var
|
|
7
|
+
var _props$as = props.as,
|
|
8
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
15
9
|
className = props.className,
|
|
16
|
-
rows = props.rows,
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
_props$rows = props.rows,
|
|
11
|
+
rows = _props$rows === void 0 ? 2 : _props$rows,
|
|
12
|
+
_props$rowHeight = props.rowHeight,
|
|
13
|
+
rowHeight = _props$rowHeight === void 0 ? 10 : _props$rowHeight,
|
|
14
|
+
_props$rowMargin = props.rowMargin,
|
|
15
|
+
rowMargin = _props$rowMargin === void 0 ? 20 : _props$rowMargin,
|
|
19
16
|
graph = props.graph,
|
|
20
17
|
active = props.active,
|
|
21
|
-
classPrefix = props.classPrefix,
|
|
18
|
+
_props$classPrefix = props.classPrefix,
|
|
19
|
+
classPrefix = _props$classPrefix === void 0 ? 'placeholder' : _props$classPrefix,
|
|
22
20
|
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "rows", "rowHeight", "rowMargin", "graph", "active", "classPrefix"]);
|
|
23
21
|
|
|
24
22
|
var _useClassNames = useClassNames(classPrefix),
|
|
@@ -60,7 +58,6 @@ var PlaceholderParagraph = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
60
58
|
}, rowElements));
|
|
61
59
|
});
|
|
62
60
|
PlaceholderParagraph.displayName = 'PlaceholderParagraph';
|
|
63
|
-
PlaceholderParagraph.defaultProps = defaultProps;
|
|
64
61
|
PlaceholderParagraph.propTypes = {
|
|
65
62
|
className: PropTypes.string,
|
|
66
63
|
classPrefix: PropTypes.string,
|
package/esm/Popover/Popover.js
CHANGED
|
@@ -7,13 +7,11 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import { useClassNames } from '../utils';
|
|
10
|
-
var defaultProps = {
|
|
11
|
-
as: 'div',
|
|
12
|
-
classPrefix: 'popover'
|
|
13
|
-
};
|
|
14
10
|
var Popover = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
|
-
var
|
|
16
|
-
|
|
11
|
+
var _props$as = props.as,
|
|
12
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
13
|
+
_props$classPrefix = props.classPrefix,
|
|
14
|
+
classPrefix = _props$classPrefix === void 0 ? 'popover' : _props$classPrefix,
|
|
17
15
|
title = props.title,
|
|
18
16
|
children = props.children,
|
|
19
17
|
style = props.style,
|
|
@@ -52,7 +50,6 @@ var Popover = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
52
50
|
}, children));
|
|
53
51
|
});
|
|
54
52
|
Popover.displayName = 'Popover';
|
|
55
|
-
Popover.defaultProps = defaultProps;
|
|
56
53
|
Popover.propTypes = {
|
|
57
54
|
as: PropTypes.elementType,
|
|
58
55
|
classPrefix: PropTypes.string,
|
|
@@ -3,32 +3,30 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React, { useCallback } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames, PROGRESS_STATUS_ICON } from '../utils';
|
|
6
|
-
var defaultProps = {
|
|
7
|
-
as: 'div',
|
|
8
|
-
classPrefix: 'progress',
|
|
9
|
-
percent: 0,
|
|
10
|
-
strokeWidth: 6,
|
|
11
|
-
trailWidth: 6,
|
|
12
|
-
gapDegree: 0,
|
|
13
|
-
showInfo: true,
|
|
14
|
-
strokeLinecap: 'round',
|
|
15
|
-
gapPosition: 'top'
|
|
16
|
-
};
|
|
17
6
|
var ProgressCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
7
|
var _withClassPrefix;
|
|
19
8
|
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
var _props$as = props.as,
|
|
10
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
11
|
+
_props$strokeWidth = props.strokeWidth,
|
|
12
|
+
strokeWidth = _props$strokeWidth === void 0 ? 6 : _props$strokeWidth,
|
|
13
|
+
_props$trailWidth = props.trailWidth,
|
|
14
|
+
trailWidth = _props$trailWidth === void 0 ? 6 : _props$trailWidth,
|
|
15
|
+
_props$percent = props.percent,
|
|
16
|
+
percent = _props$percent === void 0 ? 0 : _props$percent,
|
|
17
|
+
_props$strokeLinecap = props.strokeLinecap,
|
|
18
|
+
strokeLinecap = _props$strokeLinecap === void 0 ? 'round' : _props$strokeLinecap,
|
|
25
19
|
className = props.className,
|
|
26
|
-
showInfo = props.showInfo,
|
|
20
|
+
_props$showInfo = props.showInfo,
|
|
21
|
+
showInfo = _props$showInfo === void 0 ? true : _props$showInfo,
|
|
27
22
|
status = props.status,
|
|
28
|
-
classPrefix = props.classPrefix,
|
|
23
|
+
_props$classPrefix = props.classPrefix,
|
|
24
|
+
classPrefix = _props$classPrefix === void 0 ? 'progress' : _props$classPrefix,
|
|
29
25
|
style = props.style,
|
|
30
|
-
gapDegree = props.gapDegree,
|
|
31
|
-
|
|
26
|
+
_props$gapDegree = props.gapDegree,
|
|
27
|
+
gapDegree = _props$gapDegree === void 0 ? 0 : _props$gapDegree,
|
|
28
|
+
_props$gapPosition = props.gapPosition,
|
|
29
|
+
gapPosition = _props$gapPosition === void 0 ? 'top' : _props$gapPosition,
|
|
32
30
|
trailColor = props.trailColor,
|
|
33
31
|
strokeColor = props.strokeColor,
|
|
34
32
|
rest = _objectWithoutPropertiesLoose(props, ["as", "strokeWidth", "trailWidth", "percent", "strokeLinecap", "className", "showInfo", "status", "classPrefix", "style", "gapDegree", "gapPosition", "trailColor", "strokeColor"]);
|
|
@@ -128,7 +126,6 @@ var ProgressCircle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
128
126
|
})));
|
|
129
127
|
});
|
|
130
128
|
ProgressCircle.displayName = 'ProgressCircle';
|
|
131
|
-
ProgressCircle.defaultProps = defaultProps;
|
|
132
129
|
ProgressCircle.propTypes = {
|
|
133
130
|
className: PropTypes.string,
|
|
134
131
|
strokeColor: PropTypes.string,
|
|
@@ -3,25 +3,23 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames, PROGRESS_STATUS_ICON } from '../utils';
|
|
6
|
-
var defaultProps = {
|
|
7
|
-
as: 'div',
|
|
8
|
-
classPrefix: 'progress',
|
|
9
|
-
showInfo: true,
|
|
10
|
-
percent: 0
|
|
11
|
-
};
|
|
12
6
|
var ProgressLine = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
7
|
var _lineInnerStyle, _percentStyle, _withClassPrefix;
|
|
14
8
|
|
|
15
|
-
var
|
|
9
|
+
var _props$as = props.as,
|
|
10
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
16
11
|
className = props.className,
|
|
17
|
-
percent = props.percent,
|
|
12
|
+
_props$percent = props.percent,
|
|
13
|
+
percent = _props$percent === void 0 ? 0 : _props$percent,
|
|
18
14
|
strokeColor = props.strokeColor,
|
|
19
15
|
strokeWidth = props.strokeWidth,
|
|
20
16
|
trailColor = props.trailColor,
|
|
21
17
|
trailWidth = props.trailWidth,
|
|
22
18
|
status = props.status,
|
|
23
|
-
showInfo = props.showInfo,
|
|
24
|
-
|
|
19
|
+
_props$showInfo = props.showInfo,
|
|
20
|
+
showInfo = _props$showInfo === void 0 ? true : _props$showInfo,
|
|
21
|
+
_props$classPrefix = props.classPrefix,
|
|
22
|
+
classPrefix = _props$classPrefix === void 0 ? 'progress' : _props$classPrefix,
|
|
25
23
|
vertical = props.vertical,
|
|
26
24
|
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "percent", "strokeColor", "strokeWidth", "trailColor", "trailWidth", "status", "showInfo", "classPrefix", "vertical"]);
|
|
27
25
|
|
|
@@ -64,7 +62,6 @@ var ProgressLine = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
64
62
|
}, info) : null);
|
|
65
63
|
});
|
|
66
64
|
ProgressLine.displayName = 'ProgressLine';
|
|
67
|
-
ProgressLine.defaultProps = defaultProps;
|
|
68
65
|
ProgressLine.propTypes = {
|
|
69
66
|
className: PropTypes.string,
|
|
70
67
|
classPrefix: PropTypes.string,
|
package/esm/Radio/Radio.js
CHANGED
|
@@ -4,12 +4,6 @@ import React, { useCallback, useContext } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { RadioContext } from '../RadioGroup/RadioGroup';
|
|
6
6
|
import { useClassNames, useControlled, partitionHTMLProps, TypeChecker } from '../utils';
|
|
7
|
-
var defaultProps = {
|
|
8
|
-
as: 'div',
|
|
9
|
-
classPrefix: 'radio',
|
|
10
|
-
tabIndex: 0,
|
|
11
|
-
inputProps: {}
|
|
12
|
-
};
|
|
13
7
|
var Radio = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
8
|
var _useContext = useContext(RadioContext),
|
|
15
9
|
groupValue = _useContext.value,
|
|
@@ -21,14 +15,17 @@ var Radio = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
21
15
|
plaintextContext = _useContext.plaintext,
|
|
22
16
|
onGroupChange = _useContext.onChange;
|
|
23
17
|
|
|
24
|
-
var
|
|
18
|
+
var _props$as = props.as,
|
|
19
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
25
20
|
title = props.title,
|
|
26
21
|
className = props.className,
|
|
27
22
|
children = props.children,
|
|
28
23
|
checkedProp = props.checked,
|
|
29
24
|
defaultChecked = props.defaultChecked,
|
|
30
|
-
classPrefix = props.classPrefix,
|
|
31
|
-
|
|
25
|
+
_props$classPrefix = props.classPrefix,
|
|
26
|
+
classPrefix = _props$classPrefix === void 0 ? 'radio' : _props$classPrefix,
|
|
27
|
+
_props$tabIndex = props.tabIndex,
|
|
28
|
+
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
|
|
32
29
|
inputRef = props.inputRef,
|
|
33
30
|
inputProps = props.inputProps,
|
|
34
31
|
_props$disabled = props.disabled,
|
|
@@ -118,7 +115,6 @@ var Radio = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
118
115
|
}, input, children) : input));
|
|
119
116
|
});
|
|
120
117
|
Radio.displayName = 'Radio';
|
|
121
|
-
Radio.defaultProps = defaultProps;
|
|
122
118
|
Radio.propTypes = {
|
|
123
119
|
id: PropTypes.string,
|
|
124
120
|
name: PropTypes.string,
|
|
@@ -6,14 +6,17 @@ import { useClassNames, useControlled } from '../utils';
|
|
|
6
6
|
import Plaintext from '../Plaintext';
|
|
7
7
|
export var RadioContext = /*#__PURE__*/React.createContext({});
|
|
8
8
|
var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
9
|
-
var
|
|
9
|
+
var _props$as = props.as,
|
|
10
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
10
11
|
className = props.className,
|
|
11
12
|
inline = props.inline,
|
|
12
13
|
children = props.children,
|
|
13
|
-
classPrefix = props.classPrefix,
|
|
14
|
+
_props$classPrefix = props.classPrefix,
|
|
15
|
+
classPrefix = _props$classPrefix === void 0 ? 'radio-group' : _props$classPrefix,
|
|
14
16
|
valueProp = props.value,
|
|
15
17
|
defaultValue = props.defaultValue,
|
|
16
|
-
appearance = props.appearance,
|
|
18
|
+
_props$appearance = props.appearance,
|
|
19
|
+
appearance = _props$appearance === void 0 ? 'default' : _props$appearance,
|
|
17
20
|
name = props.name,
|
|
18
21
|
plaintext = props.plaintext,
|
|
19
22
|
disabled = props.disabled,
|
|
@@ -62,13 +65,7 @@ var RadioGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
62
65
|
className: classes
|
|
63
66
|
}), children));
|
|
64
67
|
});
|
|
65
|
-
var defaultProps = {
|
|
66
|
-
as: 'div',
|
|
67
|
-
appearance: 'default',
|
|
68
|
-
classPrefix: 'radio-group'
|
|
69
|
-
};
|
|
70
68
|
RadioGroup.displayName = 'RadioGroup';
|
|
71
|
-
RadioGroup.defaultProps = defaultProps;
|
|
72
69
|
RadioGroup.propTypes = {
|
|
73
70
|
appearance: PropTypes.oneOf(['default', 'picker']),
|
|
74
71
|
name: PropTypes.string,
|