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
|
@@ -4,18 +4,16 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { useClassNames } from '../utils';
|
|
6
6
|
import FlexboxGridItem from './FlexboxGridItem';
|
|
7
|
-
var defaultProps = {
|
|
8
|
-
as: 'div',
|
|
9
|
-
classPrefix: 'flex-box-grid',
|
|
10
|
-
align: 'top',
|
|
11
|
-
justify: 'start'
|
|
12
|
-
};
|
|
13
7
|
var FlexboxGrid = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
|
-
var
|
|
8
|
+
var _props$as = props.as,
|
|
9
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
15
10
|
className = props.className,
|
|
16
|
-
classPrefix = props.classPrefix,
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
_props$classPrefix = props.classPrefix,
|
|
12
|
+
classPrefix = _props$classPrefix === void 0 ? 'flex-box-grid' : _props$classPrefix,
|
|
13
|
+
_props$align = props.align,
|
|
14
|
+
align = _props$align === void 0 ? 'top' : _props$align,
|
|
15
|
+
_props$justify = props.justify,
|
|
16
|
+
justify = _props$justify === void 0 ? 'start' : _props$justify,
|
|
19
17
|
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "align", "justify"]);
|
|
20
18
|
|
|
21
19
|
var _useClassNames = useClassNames(classPrefix),
|
|
@@ -30,7 +28,6 @@ var FlexboxGrid = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
30
28
|
});
|
|
31
29
|
FlexboxGrid.Item = FlexboxGridItem;
|
|
32
30
|
FlexboxGrid.displayName = 'FlexboxGrid';
|
|
33
|
-
FlexboxGrid.defaultProps = defaultProps;
|
|
34
31
|
FlexboxGrid.propTypes = {
|
|
35
32
|
className: PropTypes.string,
|
|
36
33
|
classPrefix: PropTypes.string,
|
|
@@ -3,20 +3,18 @@ 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: 'flex-box-grid-item',
|
|
9
|
-
colspan: 0,
|
|
10
|
-
order: 0
|
|
11
|
-
};
|
|
12
6
|
var FlexboxGridItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
7
|
var _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
|
-
classPrefix = props.classPrefix,
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
_props$classPrefix = props.classPrefix,
|
|
13
|
+
classPrefix = _props$classPrefix === void 0 ? 'flex-box-grid-item' : _props$classPrefix,
|
|
14
|
+
_props$colspan = props.colspan,
|
|
15
|
+
colspan = _props$colspan === void 0 ? 0 : _props$colspan,
|
|
16
|
+
_props$order = props.order,
|
|
17
|
+
order = _props$order === void 0 ? 0 : _props$order,
|
|
20
18
|
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "colspan", "order"]);
|
|
21
19
|
|
|
22
20
|
var _useClassNames = useClassNames(classPrefix),
|
|
@@ -31,7 +29,6 @@ var FlexboxGridItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
31
29
|
}));
|
|
32
30
|
});
|
|
33
31
|
FlexboxGridItem.displayName = 'FlexboxGridItem';
|
|
34
|
-
FlexboxGridItem.defaultProps = defaultProps;
|
|
35
32
|
FlexboxGridItem.propTypes = {
|
|
36
33
|
as: PropTypes.elementType,
|
|
37
34
|
className: PropTypes.string,
|
package/esm/Form/Form.js
CHANGED
|
@@ -12,24 +12,22 @@ import FormControlLabel from '../FormControlLabel';
|
|
|
12
12
|
import FormErrorMessage from '../FormErrorMessage';
|
|
13
13
|
import FormGroup from '../FormGroup';
|
|
14
14
|
import FormHelpText from '../FormHelpText';
|
|
15
|
-
var defaultProps = {
|
|
16
|
-
checkTrigger: 'change',
|
|
17
|
-
classPrefix: 'form',
|
|
18
|
-
errorFromContext: true,
|
|
19
|
-
formDefaultValue: {},
|
|
20
|
-
layout: 'vertical',
|
|
21
|
-
model: SchemaModel({})
|
|
22
|
-
};
|
|
23
15
|
var Form = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
24
|
-
var checkTrigger = props.checkTrigger,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
var _props$checkTrigger = props.checkTrigger,
|
|
17
|
+
checkTrigger = _props$checkTrigger === void 0 ? 'change' : _props$checkTrigger,
|
|
18
|
+
_props$classPrefix = props.classPrefix,
|
|
19
|
+
classPrefix = _props$classPrefix === void 0 ? 'form' : _props$classPrefix,
|
|
20
|
+
_props$errorFromConte = props.errorFromContext,
|
|
21
|
+
errorFromContext = _props$errorFromConte === void 0 ? true : _props$errorFromConte,
|
|
22
|
+
_props$formDefaultVal = props.formDefaultValue,
|
|
23
|
+
formDefaultValue = _props$formDefaultVal === void 0 ? {} : _props$formDefaultVal,
|
|
28
24
|
formValue = props.formValue,
|
|
29
25
|
formError = props.formError,
|
|
30
26
|
fluid = props.fluid,
|
|
31
|
-
layout = props.layout,
|
|
32
|
-
|
|
27
|
+
_props$layout = props.layout,
|
|
28
|
+
layout = _props$layout === void 0 ? 'vertical' : _props$layout,
|
|
29
|
+
_props$model = props.model,
|
|
30
|
+
model = _props$model === void 0 ? SchemaModel({}) : _props$model,
|
|
33
31
|
readOnly = props.readOnly,
|
|
34
32
|
plaintext = props.plaintext,
|
|
35
33
|
className = props.className,
|
|
@@ -268,7 +266,6 @@ Form.Group = FormGroup;
|
|
|
268
266
|
Form.HelpText = FormHelpText;
|
|
269
267
|
Form.Control = FormControl;
|
|
270
268
|
Form.displayName = 'Form';
|
|
271
|
-
Form.defaultProps = defaultProps;
|
|
272
269
|
Form.propTypes = {
|
|
273
270
|
className: PropTypes.string,
|
|
274
271
|
classPrefix: PropTypes.string,
|
|
@@ -123,14 +123,18 @@ var FormControl = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
var ariaDescribedby = controlId ? controlId + "-
|
|
126
|
+
var ariaDescribedby = controlId ? controlId + "-help-text" : null;
|
|
127
|
+
var fieldHasError = Boolean(messageNode);
|
|
128
|
+
var ariaErrormessage = fieldHasError && controlId ? controlId + "-error-message" : undefined;
|
|
127
129
|
return /*#__PURE__*/React.createElement(Component, {
|
|
128
130
|
className: classes,
|
|
129
131
|
ref: ref
|
|
130
132
|
}, /*#__PURE__*/React.createElement(AccepterComponent, _extends({
|
|
131
133
|
id: controlId,
|
|
132
134
|
"aria-labelledby": controlId ? controlId + "-control-label" : null,
|
|
133
|
-
"aria-describedby": ariaDescribedby
|
|
135
|
+
"aria-describedby": ariaDescribedby,
|
|
136
|
+
"aria-invalid": fieldHasError || undefined,
|
|
137
|
+
"aria-errormessage": ariaErrormessage
|
|
134
138
|
}, rest, {
|
|
135
139
|
readOnly: readOnly,
|
|
136
140
|
plaintext: plaintext,
|
|
@@ -4,16 +4,14 @@ import React from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import Button from '../Button';
|
|
6
6
|
import { useClassNames } from '../utils';
|
|
7
|
-
var defaultProps = {
|
|
8
|
-
classPrefix: 'btn-icon',
|
|
9
|
-
placement: 'left'
|
|
10
|
-
};
|
|
11
7
|
var IconButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
8
|
var icon = props.icon,
|
|
13
|
-
placement = props.placement,
|
|
9
|
+
_props$placement = props.placement,
|
|
10
|
+
placement = _props$placement === void 0 ? 'left' : _props$placement,
|
|
14
11
|
children = props.children,
|
|
15
12
|
circle = props.circle,
|
|
16
|
-
classPrefix = props.classPrefix,
|
|
13
|
+
_props$classPrefix = props.classPrefix,
|
|
14
|
+
classPrefix = _props$classPrefix === void 0 ? 'btn-icon' : _props$classPrefix,
|
|
17
15
|
className = props.className,
|
|
18
16
|
rest = _objectWithoutPropertiesLoose(props, ["icon", "placement", "children", "circle", "classPrefix", "className"]);
|
|
19
17
|
|
|
@@ -31,7 +29,6 @@ var IconButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
31
29
|
}), icon, children);
|
|
32
30
|
});
|
|
33
31
|
IconButton.displayName = 'IconButton';
|
|
34
|
-
IconButton.defaultProps = defaultProps;
|
|
35
32
|
IconButton.propTypes = {
|
|
36
33
|
className: PropTypes.string,
|
|
37
34
|
icon: PropTypes.any,
|
package/esm/Input/Input.js
CHANGED
|
@@ -6,16 +6,14 @@ import { FormGroupContext } from '../FormGroup/FormGroup';
|
|
|
6
6
|
import { InputGroupContext } from '../InputGroup/InputGroup';
|
|
7
7
|
import Plaintext from '../Plaintext';
|
|
8
8
|
import { createChainedFunction, TypeChecker, mergeRefs, useClassNames, KEY_VALUES } from '../utils';
|
|
9
|
-
var defaultProps = {
|
|
10
|
-
as: 'input',
|
|
11
|
-
classPrefix: 'input',
|
|
12
|
-
type: 'text'
|
|
13
|
-
};
|
|
14
9
|
var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
10
|
var className = props.className,
|
|
16
|
-
classPrefix = props.classPrefix,
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
_props$classPrefix = props.classPrefix,
|
|
12
|
+
classPrefix = _props$classPrefix === void 0 ? 'input' : _props$classPrefix,
|
|
13
|
+
_props$as = props.as,
|
|
14
|
+
Component = _props$as === void 0 ? 'input' : _props$as,
|
|
15
|
+
_props$type = props.type,
|
|
16
|
+
type = _props$type === void 0 ? 'text' : _props$type,
|
|
19
17
|
disabled = props.disabled,
|
|
20
18
|
value = props.value,
|
|
21
19
|
defaultValue = props.defaultValue,
|
|
@@ -84,7 +82,6 @@ var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
84
82
|
}));
|
|
85
83
|
});
|
|
86
84
|
Input.displayName = 'Input';
|
|
87
|
-
Input.defaultProps = defaultProps;
|
|
88
85
|
Input.propTypes = {
|
|
89
86
|
type: PropTypes.string,
|
|
90
87
|
as: PropTypes.elementType,
|
|
@@ -75,19 +75,12 @@ function disableMinValue(value, min) {
|
|
|
75
75
|
return false;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
var defaultProps = {
|
|
79
|
-
as: InputGroup,
|
|
80
|
-
classPrefix: 'input-number',
|
|
81
|
-
min: -Infinity,
|
|
82
|
-
max: Infinity,
|
|
83
|
-
step: 1,
|
|
84
|
-
buttonAppearance: 'subtle',
|
|
85
|
-
scrollable: true
|
|
86
|
-
};
|
|
87
78
|
var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
88
|
-
var
|
|
79
|
+
var _props$as = props.as,
|
|
80
|
+
Component = _props$as === void 0 ? InputGroup : _props$as,
|
|
89
81
|
className = props.className,
|
|
90
|
-
classPrefix = props.classPrefix,
|
|
82
|
+
_props$classPrefix = props.classPrefix,
|
|
83
|
+
classPrefix = _props$classPrefix === void 0 ? 'input-number' : _props$classPrefix,
|
|
91
84
|
disabled = props.disabled,
|
|
92
85
|
readOnly = props.readOnly,
|
|
93
86
|
plaintext = props.plaintext,
|
|
@@ -96,11 +89,16 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
96
89
|
size = props.size,
|
|
97
90
|
prefixElement = props.prefix,
|
|
98
91
|
postfix = props.postfix,
|
|
99
|
-
step = props.step,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
_props$step = props.step,
|
|
93
|
+
step = _props$step === void 0 ? 1 : _props$step,
|
|
94
|
+
_props$buttonAppearan = props.buttonAppearance,
|
|
95
|
+
buttonAppearance = _props$buttonAppearan === void 0 ? 'subtle' : _props$buttonAppearan,
|
|
96
|
+
_props$min = props.min,
|
|
97
|
+
min = _props$min === void 0 ? -Infinity : _props$min,
|
|
98
|
+
_props$max = props.max,
|
|
99
|
+
max = _props$max === void 0 ? Infinity : _props$max,
|
|
100
|
+
_props$scrollable = props.scrollable,
|
|
101
|
+
scrollable = _props$scrollable === void 0 ? true : _props$scrollable,
|
|
104
102
|
onChange = props.onChange,
|
|
105
103
|
onWheel = props.onWheel,
|
|
106
104
|
restProps = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "disabled", "readOnly", "plaintext", "value", "defaultValue", "size", "prefix", "postfix", "step", "buttonAppearance", "min", "max", "scrollable", "onChange", "onWheel"]);
|
|
@@ -246,7 +244,6 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
246
244
|
}, /*#__PURE__*/React.createElement(AngleDownIcon, null))), postfix && /*#__PURE__*/React.createElement(InputGroupAddon, null, postfix));
|
|
247
245
|
});
|
|
248
246
|
InputNumber.displayName = 'InputNumber';
|
|
249
|
-
InputNumber.defaultProps = defaultProps;
|
|
250
247
|
InputNumber.propTypes = {
|
|
251
248
|
className: PropTypes.string,
|
|
252
249
|
classPrefix: PropTypes.string,
|
|
@@ -29,7 +29,8 @@ var copyStyles = function copyStyles(styles, node) {
|
|
|
29
29
|
* @param placeholderRef
|
|
30
30
|
*/
|
|
31
31
|
var useInputWidth = function useInputWidth(props, sizerRef, placeholderRef) {
|
|
32
|
-
var minWidth = props.minWidth,
|
|
32
|
+
var _props$minWidth = props.minWidth,
|
|
33
|
+
minWidth = _props$minWidth === void 0 ? 1 : _props$minWidth,
|
|
33
34
|
placeholder = props.placeholder,
|
|
34
35
|
value = props.value,
|
|
35
36
|
onAutosize = props.onAutosize;
|
|
@@ -170,7 +171,4 @@ InputAutosize.propTypes = {
|
|
|
170
171
|
value: PropTypes.any,
|
|
171
172
|
onAutosize: PropTypes.func
|
|
172
173
|
};
|
|
173
|
-
InputAutosize.defaultProps = {
|
|
174
|
-
minWidth: 1
|
|
175
|
-
};
|
|
176
174
|
export default InputAutosize;
|
|
@@ -24,51 +24,49 @@ import Tag from '../Tag';
|
|
|
24
24
|
import InputAutosize from './InputAutosize';
|
|
25
25
|
import InputSearch from './InputSearch';
|
|
26
26
|
export var InputPickerContext = /*#__PURE__*/React.createContext({});
|
|
27
|
-
var defaultProps = {
|
|
28
|
-
as: 'div',
|
|
29
|
-
appearance: 'default',
|
|
30
|
-
cleanable: true,
|
|
31
|
-
cacheData: [],
|
|
32
|
-
classPrefix: 'picker',
|
|
33
|
-
data: [],
|
|
34
|
-
disabledItemValues: [],
|
|
35
|
-
valueKey: 'value',
|
|
36
|
-
labelKey: 'label',
|
|
37
|
-
placement: 'bottomStart',
|
|
38
|
-
searchable: true,
|
|
39
|
-
menuAutoWidth: true,
|
|
40
|
-
menuMaxHeight: 320
|
|
41
|
-
};
|
|
42
27
|
var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
43
28
|
var _merge;
|
|
44
29
|
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
30
|
+
var _props$as = props.as,
|
|
31
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
32
|
+
_props$appearance = props.appearance,
|
|
33
|
+
appearance = _props$appearance === void 0 ? 'default' : _props$appearance,
|
|
34
|
+
_props$cleanable = props.cleanable,
|
|
35
|
+
cleanable = _props$cleanable === void 0 ? true : _props$cleanable,
|
|
36
|
+
_props$cacheData = props.cacheData,
|
|
37
|
+
cacheData = _props$cacheData === void 0 ? [] : _props$cacheData,
|
|
38
|
+
_props$classPrefix = props.classPrefix,
|
|
39
|
+
classPrefix = _props$classPrefix === void 0 ? 'picker' : _props$classPrefix,
|
|
40
|
+
_props$data = props.data,
|
|
41
|
+
controlledData = _props$data === void 0 ? [] : _props$data,
|
|
50
42
|
disabled = props.disabled,
|
|
51
43
|
readOnly = props.readOnly,
|
|
52
44
|
plaintext = props.plaintext,
|
|
53
45
|
defaultValue = props.defaultValue,
|
|
54
46
|
defaultOpen = props.defaultOpen,
|
|
55
|
-
|
|
47
|
+
_props$disabledItemVa = props.disabledItemValues,
|
|
48
|
+
disabledItemValues = _props$disabledItemVa === void 0 ? [] : _props$disabledItemVa,
|
|
56
49
|
overrideLocale = props.locale,
|
|
57
50
|
toggleAs = props.toggleAs,
|
|
58
51
|
style = props.style,
|
|
59
|
-
searchable = props.searchable,
|
|
52
|
+
_props$searchable = props.searchable,
|
|
53
|
+
searchable = _props$searchable === void 0 ? true : _props$searchable,
|
|
60
54
|
controlledOpen = props.open,
|
|
61
55
|
placeholder = props.placeholder,
|
|
62
56
|
groupBy = props.groupBy,
|
|
63
57
|
menuClassName = props.menuClassName,
|
|
64
58
|
menuStyle = props.menuStyle,
|
|
65
|
-
menuAutoWidth = props.menuAutoWidth,
|
|
66
|
-
|
|
59
|
+
_props$menuAutoWidth = props.menuAutoWidth,
|
|
60
|
+
menuAutoWidth = _props$menuAutoWidth === void 0 ? true : _props$menuAutoWidth,
|
|
61
|
+
_props$menuMaxHeight = props.menuMaxHeight,
|
|
62
|
+
menuMaxHeight = _props$menuMaxHeight === void 0 ? 320 : _props$menuMaxHeight,
|
|
67
63
|
creatable = props.creatable,
|
|
68
64
|
valueProp = props.value,
|
|
69
|
-
valueKey = props.valueKey,
|
|
65
|
+
_props$valueKey = props.valueKey,
|
|
66
|
+
valueKey = _props$valueKey === void 0 ? 'value' : _props$valueKey,
|
|
70
67
|
virtualized = props.virtualized,
|
|
71
|
-
labelKey = props.labelKey,
|
|
68
|
+
_props$labelKey = props.labelKey,
|
|
69
|
+
labelKey = _props$labelKey === void 0 ? 'label' : _props$labelKey,
|
|
72
70
|
listProps = props.listProps,
|
|
73
71
|
id = props.id,
|
|
74
72
|
tabIndex = props.tabIndex,
|
|
@@ -92,8 +90,9 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
92
90
|
onBlur = props.onBlur,
|
|
93
91
|
onFocus = props.onFocus,
|
|
94
92
|
searchBy = props.searchBy,
|
|
95
|
-
placement = props.placement,
|
|
96
|
-
|
|
93
|
+
_props$placement = props.placement,
|
|
94
|
+
placement = _props$placement === void 0 ? 'bottomStart' : _props$placement,
|
|
95
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "appearance", "cleanable", "cacheData", "classPrefix", "data", "disabled", "readOnly", "plaintext", "defaultValue", "defaultOpen", "disabledItemValues", "locale", "toggleAs", "style", "searchable", "open", "placeholder", "groupBy", "menuClassName", "menuStyle", "menuAutoWidth", "menuMaxHeight", "creatable", "value", "valueKey", "virtualized", "labelKey", "listProps", "id", "tabIndex", "sort", "renderMenu", "renderExtraFooter", "renderValue", "renderMenuItem", "renderMenuGroup", "onEnter", "onEntered", "onExit", "onExited", "onChange", "onClean", "onCreate", "onSearch", "onSelect", "onOpen", "onClose", "onBlur", "onFocus", "searchBy", "placement"]);
|
|
97
96
|
|
|
98
97
|
var _useContext = useContext(InputPickerContext),
|
|
99
98
|
multi = _useContext.multi,
|
|
@@ -642,8 +641,11 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
642
641
|
var hasValue = multi ? !!(tagElements !== null && tagElements !== void 0 && tagElements.length) || hasMultiValue : isValid || hasSingleValue;
|
|
643
642
|
|
|
644
643
|
var _usePickerClassName = usePickerClassName(_extends({}, props, {
|
|
644
|
+
classPrefix: classPrefix,
|
|
645
|
+
appearance: appearance,
|
|
645
646
|
hasValue: hasValue,
|
|
646
|
-
name: 'input'
|
|
647
|
+
name: 'input',
|
|
648
|
+
cleanable: cleanable
|
|
647
649
|
})),
|
|
648
650
|
pickerClasses = _usePickerClassName[0],
|
|
649
651
|
usedClassNamePropKeys = _usePickerClassName[1];
|
|
@@ -694,6 +696,7 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
694
696
|
onKeyDown: onPickerKeyDown
|
|
695
697
|
}, /*#__PURE__*/React.createElement(PickerToggle, _extends({}, omit(rest, [].concat(omitTriggerPropKeys, usedClassNamePropKeys)), {
|
|
696
698
|
id: id,
|
|
699
|
+
appearance: appearance,
|
|
697
700
|
readOnly: readOnly,
|
|
698
701
|
plaintext: plaintext,
|
|
699
702
|
ref: targetRef,
|
|
@@ -720,7 +723,6 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
720
723
|
})))));
|
|
721
724
|
});
|
|
722
725
|
InputPicker.displayName = 'InputPicker';
|
|
723
|
-
InputPicker.defaultProps = defaultProps;
|
|
724
726
|
InputPicker.propTypes = _extends({}, listPickerPropTypes, {
|
|
725
727
|
locale: PropTypes.any,
|
|
726
728
|
appearance: PropTypes.oneOf(['default', 'subtle']),
|
package/esm/List/List.js
CHANGED
|
@@ -6,25 +6,23 @@ import useSortHelper from './helper/useSortHelper';
|
|
|
6
6
|
import { mergeRefs, useClassNames } from '../utils';
|
|
7
7
|
import ListContext from './ListContext';
|
|
8
8
|
import ListItem from './ListItem';
|
|
9
|
-
var defaultProps = {
|
|
10
|
-
as: 'div',
|
|
11
|
-
classPrefix: 'list',
|
|
12
|
-
size: 'md',
|
|
13
|
-
autoScroll: true,
|
|
14
|
-
pressDelay: 0,
|
|
15
|
-
transitionDuration: 300
|
|
16
|
-
};
|
|
17
9
|
var List = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
|
-
var
|
|
19
|
-
|
|
10
|
+
var _props$as = props.as,
|
|
11
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
12
|
+
_props$classPrefix = props.classPrefix,
|
|
13
|
+
classPrefix = _props$classPrefix === void 0 ? 'list' : _props$classPrefix,
|
|
20
14
|
className = props.className,
|
|
21
15
|
bordered = props.bordered,
|
|
22
16
|
hover = props.hover,
|
|
23
|
-
size = props.size,
|
|
17
|
+
_props$size = props.size,
|
|
18
|
+
size = _props$size === void 0 ? 'md' : _props$size,
|
|
24
19
|
sortable = props.sortable,
|
|
25
|
-
autoScroll = props.autoScroll,
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
_props$autoScroll = props.autoScroll,
|
|
21
|
+
autoScroll = _props$autoScroll === void 0 ? true : _props$autoScroll,
|
|
22
|
+
_props$pressDelay = props.pressDelay,
|
|
23
|
+
pressDelay = _props$pressDelay === void 0 ? 0 : _props$pressDelay,
|
|
24
|
+
_props$transitionDura = props.transitionDuration,
|
|
25
|
+
transitionDuration = _props$transitionDura === void 0 ? 300 : _props$transitionDura,
|
|
28
26
|
children = props.children,
|
|
29
27
|
onSort = props.onSort,
|
|
30
28
|
onSortEnd = props.onSortEnd,
|
|
@@ -77,7 +75,6 @@ var List = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
77
75
|
});
|
|
78
76
|
List.Item = ListItem;
|
|
79
77
|
List.displayName = 'List';
|
|
80
|
-
List.defaultProps = defaultProps;
|
|
81
78
|
List.propTypes = {
|
|
82
79
|
className: PropTypes.string,
|
|
83
80
|
classPrefix: PropTypes.string,
|
package/esm/List/ListItem.js
CHANGED
|
@@ -5,17 +5,15 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { useContext, useEffect, useRef } from 'react';
|
|
6
6
|
import { mergeRefs, useClassNames } from '../utils';
|
|
7
7
|
import ListContext from './ListContext';
|
|
8
|
-
var defaultProps = {
|
|
9
|
-
as: 'div',
|
|
10
|
-
classPrefix: 'list-item',
|
|
11
|
-
collection: 0
|
|
12
|
-
};
|
|
13
8
|
var ListItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
14
|
-
var
|
|
9
|
+
var _props$as = props.as,
|
|
10
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
15
11
|
children = props.children,
|
|
16
12
|
className = props.className,
|
|
17
|
-
classPrefix = props.classPrefix,
|
|
18
|
-
|
|
13
|
+
_props$classPrefix = props.classPrefix,
|
|
14
|
+
classPrefix = _props$classPrefix === void 0 ? 'list-item' : _props$classPrefix,
|
|
15
|
+
_props$collection = props.collection,
|
|
16
|
+
collection = _props$collection === void 0 ? 0 : _props$collection,
|
|
19
17
|
disabled = props.disabled,
|
|
20
18
|
index = props.index,
|
|
21
19
|
rest = _objectWithoutPropertiesLoose(props, ["as", "children", "className", "classPrefix", "collection", "disabled", "index"]);
|
|
@@ -57,7 +55,6 @@ var ListItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
57
55
|
}), children);
|
|
58
56
|
});
|
|
59
57
|
ListItem.displayName = 'ListItem';
|
|
60
|
-
ListItem.defaultProps = defaultProps;
|
|
61
58
|
ListItem.propTypes = {
|
|
62
59
|
index: PropTypes.number,
|
|
63
60
|
collection: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
package/esm/Loader/Loader.js
CHANGED
|
@@ -3,18 +3,16 @@ 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: 'loader',
|
|
9
|
-
speed: 'normal'
|
|
10
|
-
};
|
|
11
6
|
var Loader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
|
-
var
|
|
13
|
-
|
|
7
|
+
var _props$as = props.as,
|
|
8
|
+
Component = _props$as === void 0 ? 'div' : _props$as,
|
|
9
|
+
_props$classPrefix = props.classPrefix,
|
|
10
|
+
classPrefix = _props$classPrefix === void 0 ? 'loader' : _props$classPrefix,
|
|
14
11
|
className = props.className,
|
|
15
12
|
inverse = props.inverse,
|
|
16
13
|
backdrop = props.backdrop,
|
|
17
|
-
speed = props.speed,
|
|
14
|
+
_props$speed = props.speed,
|
|
15
|
+
speed = _props$speed === void 0 ? 'normal' : _props$speed,
|
|
18
16
|
center = props.center,
|
|
19
17
|
vertical = props.vertical,
|
|
20
18
|
content = props.content,
|
|
@@ -51,7 +49,6 @@ var Loader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
51
49
|
}, content)));
|
|
52
50
|
});
|
|
53
51
|
Loader.displayName = 'Loader';
|
|
54
|
-
Loader.defaultProps = defaultProps;
|
|
55
52
|
Loader.propTypes = {
|
|
56
53
|
as: PropTypes.elementType,
|
|
57
54
|
className: PropTypes.string,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MaskType, MaskFunctionType, ConfigType } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#guide
|
|
5
|
+
*/
|
|
6
|
+
interface TextMaskProps {
|
|
7
|
+
/**
|
|
8
|
+
* `guide` is a boolean that tells the component whether to be in guide or no guide mode.
|
|
9
|
+
*/
|
|
10
|
+
guide?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* `mask` is an array or a function that defines how the user input is going to be masked.
|
|
13
|
+
*/
|
|
14
|
+
mask?: MaskType | MaskFunctionType | boolean;
|
|
15
|
+
/**
|
|
16
|
+
* `showMask` is a boolean that tells the Text Mask component to display the mask as a placeholder
|
|
17
|
+
* in place of the regular placeholder when the input element value is empty.
|
|
18
|
+
*/
|
|
19
|
+
showMask?: boolean;
|
|
20
|
+
/** The placeholder character represents the fillable spot in the mask. The default placeholder character is underscore, _. */
|
|
21
|
+
placeholderChar?: string;
|
|
22
|
+
/** `keepCharPositions` changes the general behavior of the Text Mask component. */
|
|
23
|
+
keepCharPositions?: boolean;
|
|
24
|
+
/** You can provide a `pipe` function that will give you the opportunity to modify the conformed value before it is displayed on the screen. */
|
|
25
|
+
pipe?: (conformedValue: string, config: ConfigType) => string;
|
|
26
|
+
}
|
|
27
|
+
export declare type MaskedInputProps = TextMaskProps & React.HTMLAttributes<HTMLInputElement> & {
|
|
28
|
+
/** Custom rendering DOM */
|
|
29
|
+
render?: (ref: React.Ref<HTMLInputElement>, props: React.HTMLAttributes<HTMLInputElement>) => any;
|
|
30
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
31
|
+
value?: string | number;
|
|
32
|
+
readOnly?: boolean;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
};
|
|
35
|
+
declare const MaskedInput: React.ForwardRefExoticComponent<TextMaskProps & React.HTMLAttributes<HTMLInputElement> & {
|
|
36
|
+
/** Custom rendering DOM */
|
|
37
|
+
render?: (ref: React.Ref<HTMLInputElement>, props: React.HTMLAttributes<HTMLInputElement>) => any;
|
|
38
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
39
|
+
value?: string | number;
|
|
40
|
+
readOnly?: boolean;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
43
|
+
export default MaskedInput;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import React, { useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
import omit from 'lodash/omit';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import createTextMaskInputElement from './createTextMaskInputElement';
|
|
7
|
+
import { mergeRefs } from '../utils';
|
|
8
|
+
/**
|
|
9
|
+
* https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#guide
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
var defaultRender = function defaultRender(ref, props) {
|
|
13
|
+
return /*#__PURE__*/React.createElement("input", _extends({
|
|
14
|
+
ref: ref
|
|
15
|
+
}, props));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var MaskedInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
19
|
+
var mask = props.mask,
|
|
20
|
+
_props$guide = props.guide,
|
|
21
|
+
guide = _props$guide === void 0 ? true : _props$guide,
|
|
22
|
+
placeholderChar = props.placeholderChar,
|
|
23
|
+
value = props.value,
|
|
24
|
+
showMask = props.showMask,
|
|
25
|
+
pipe = props.pipe,
|
|
26
|
+
_props$render = props.render,
|
|
27
|
+
render = _props$render === void 0 ? defaultRender : _props$render,
|
|
28
|
+
onChange = props.onChange,
|
|
29
|
+
rest = _objectWithoutPropertiesLoose(props, ["mask", "guide", "placeholderChar", "value", "showMask", "pipe", "render", "onChange"]);
|
|
30
|
+
|
|
31
|
+
var inputRef = useRef(null);
|
|
32
|
+
var textMaskInputElement = useRef();
|
|
33
|
+
var initTextMask = useCallback(function () {
|
|
34
|
+
var _textMaskInputElement;
|
|
35
|
+
|
|
36
|
+
textMaskInputElement.current = createTextMaskInputElement(_extends({
|
|
37
|
+
inputElement: inputRef.current
|
|
38
|
+
}, props));
|
|
39
|
+
(_textMaskInputElement = textMaskInputElement.current) === null || _textMaskInputElement === void 0 ? void 0 : _textMaskInputElement.update(value);
|
|
40
|
+
}, [props, value]);
|
|
41
|
+
var handleChange = useCallback(function (event) {
|
|
42
|
+
var _textMaskInputElement2;
|
|
43
|
+
|
|
44
|
+
(_textMaskInputElement2 = textMaskInputElement.current) === null || _textMaskInputElement2 === void 0 ? void 0 : _textMaskInputElement2.update();
|
|
45
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
46
|
+
}, [onChange]);
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
initTextMask();
|
|
49
|
+
}, [guide, placeholderChar, showMask, pipe, mask, value, initTextMask]);
|
|
50
|
+
return render(mergeRefs(inputRef, ref), _extends({
|
|
51
|
+
onChange: handleChange,
|
|
52
|
+
defaultValue: value
|
|
53
|
+
}, omit(rest, ['keepCharPositions'])));
|
|
54
|
+
});
|
|
55
|
+
MaskedInput.displayName = 'MaskedInput';
|
|
56
|
+
MaskedInput.propTypes = {
|
|
57
|
+
render: PropTypes.func,
|
|
58
|
+
onChange: PropTypes.func,
|
|
59
|
+
mask: PropTypes.oneOfType([PropTypes.array, PropTypes.func, PropTypes.bool]).isRequired,
|
|
60
|
+
guide: PropTypes.bool,
|
|
61
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
62
|
+
pipe: PropTypes.func,
|
|
63
|
+
placeholderChar: PropTypes.string,
|
|
64
|
+
keepCharPositions: PropTypes.bool,
|
|
65
|
+
showMask: PropTypes.bool
|
|
66
|
+
};
|
|
67
|
+
export default MaskedInput;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default function adjustCaretPosition({ previousConformedValue, previousPlaceholder, currentCaretPosition, conformedValue, rawValue, placeholderChar, placeholder, indexesOfPipedChars, caretTrapIndexes }: {
|
|
2
|
+
previousConformedValue?: string;
|
|
3
|
+
previousPlaceholder?: string;
|
|
4
|
+
currentCaretPosition?: number;
|
|
5
|
+
conformedValue: any;
|
|
6
|
+
rawValue: any;
|
|
7
|
+
placeholderChar: any;
|
|
8
|
+
placeholder: any;
|
|
9
|
+
indexesOfPipedChars?: any[];
|
|
10
|
+
caretTrapIndexes?: any[];
|
|
11
|
+
}): number;
|