react-bootstrap 2.5.0 → 2.7.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/cjs/AbstractModalHeader.js +0 -9
- package/cjs/AbstractNav.d.ts +15 -0
- package/cjs/AbstractNavItem.d.ts +19 -0
- package/cjs/Accordion.js +0 -17
- package/cjs/AccordionBody.d.ts +2 -1
- package/cjs/AccordionBody.js +12 -10
- package/cjs/AccordionButton.d.ts +1 -1
- package/cjs/AccordionButton.js +0 -15
- package/cjs/AccordionCollapse.js +0 -10
- package/cjs/AccordionContext.d.ts +1 -1
- package/cjs/AccordionContext.js +0 -5
- package/cjs/AccordionHeader.js +0 -9
- package/cjs/AccordionItem.js +0 -9
- package/cjs/AccordionItemContext.js +0 -4
- package/cjs/AccordionToggle.d.ts +11 -0
- package/cjs/Alert.js +0 -17
- package/cjs/Anchor.js +0 -3
- package/cjs/Badge.js +0 -8
- package/cjs/BootstrapModalManager.js +2 -18
- package/cjs/Breadcrumb.js +2 -12
- package/cjs/BreadcrumbItem.js +2 -10
- package/cjs/Button.d.ts +1 -1
- package/cjs/Button.js +2 -10
- package/cjs/ButtonGroup.js +2 -9
- package/cjs/ButtonToolbar.js +2 -9
- package/cjs/Card.js +0 -14
- package/cjs/CardColumns.d.ts +2 -0
- package/cjs/CardContext.d.ts +6 -0
- package/cjs/CardDeck.d.ts +2 -0
- package/cjs/CardGroup.js +0 -4
- package/cjs/CardHeader.js +0 -9
- package/cjs/CardHeaderContext.js +0 -4
- package/cjs/CardImg.js +2 -9
- package/cjs/Carousel.d.ts +1 -1
- package/cjs/Carousel.js +9 -58
- package/cjs/CarouselCaption.js +0 -4
- package/cjs/CarouselItem.js +0 -8
- package/cjs/CloseButton.d.ts +1 -1
- package/cjs/CloseButton.js +2 -9
- package/cjs/Col.d.ts +5 -5
- package/cjs/Col.js +6 -14
- package/cjs/Collapse.d.ts +1 -1
- package/cjs/Collapse.js +10 -22
- package/cjs/Container.js +0 -8
- package/cjs/Dropdown.js +17 -27
- package/cjs/DropdownButton.js +1 -25
- package/cjs/DropdownContext.d.ts +2 -2
- package/cjs/DropdownContext.js +0 -4
- package/cjs/DropdownItem.js +2 -11
- package/cjs/DropdownMenu.d.ts +2 -2
- package/cjs/DropdownMenu.js +12 -34
- package/cjs/DropdownToggle.d.ts +2 -2
- package/cjs/DropdownToggle.js +7 -24
- package/cjs/ElementChildren.js +2 -8
- package/cjs/Fade.js +2 -12
- package/cjs/Feedback.d.ts +1 -1
- package/cjs/Feedback.js +4 -11
- package/cjs/Figure.js +0 -7
- package/cjs/FigureCaption.js +0 -3
- package/cjs/FigureImage.js +0 -8
- package/cjs/FloatingLabel.js +0 -9
- package/cjs/Form.d.ts +5 -5
- package/cjs/Form.js +2 -22
- package/cjs/FormCheck.d.ts +1 -1
- package/cjs/FormCheck.js +2 -16
- package/cjs/FormCheckInput.d.ts +1 -1
- package/cjs/FormCheckInput.js +2 -10
- package/cjs/FormCheckLabel.js +2 -10
- package/cjs/FormContext.js +0 -4
- package/cjs/FormControl.d.ts +1 -1
- package/cjs/FormControl.js +2 -16
- package/cjs/FormFile.d.ts +23 -0
- package/cjs/FormFileInput.d.ts +10 -0
- package/cjs/FormFileLabel.d.ts +7 -0
- package/cjs/FormFloating.js +0 -4
- package/cjs/FormGroup.js +2 -8
- package/cjs/FormLabel.d.ts +1 -1
- package/cjs/FormLabel.js +0 -11
- package/cjs/FormRange.js +2 -10
- package/cjs/FormSelect.js +2 -10
- package/cjs/FormText.js +4 -10
- package/cjs/Image.js +0 -13
- package/cjs/InputGroup.js +3 -18
- package/cjs/InputGroupContext.js +0 -4
- package/cjs/Jumbotron.d.ts +7 -0
- package/cjs/ListGroup.js +0 -16
- package/cjs/ListGroupItem.js +4 -15
- package/cjs/Media.d.ts +8 -0
- package/cjs/Modal.js +32 -73
- package/cjs/ModalBody.js +0 -4
- package/cjs/ModalContext.js +0 -5
- package/cjs/ModalDialog.js +2 -9
- package/cjs/ModalFooter.js +0 -4
- package/cjs/ModalHeader.js +0 -9
- package/cjs/ModalTitle.js +0 -6
- package/cjs/Nav.js +0 -19
- package/cjs/NavContext.js +0 -4
- package/cjs/NavDropdown.js +0 -12
- package/cjs/NavItem.js +0 -4
- package/cjs/NavLink.js +2 -12
- package/cjs/Navbar.js +3 -22
- package/cjs/NavbarBrand.js +2 -9
- package/cjs/NavbarCollapse.js +0 -9
- package/cjs/NavbarContext.js +0 -4
- package/cjs/NavbarOffcanvas.d.ts +1 -1
- package/cjs/NavbarOffcanvas.js +0 -8
- package/cjs/NavbarToggle.js +2 -13
- package/cjs/Offcanvas.d.ts +1 -1
- package/cjs/Offcanvas.js +9 -37
- package/cjs/OffcanvasBody.js +0 -4
- package/cjs/OffcanvasHeader.js +0 -9
- package/cjs/OffcanvasTitle.js +0 -6
- package/cjs/OffcanvasToggling.js +2 -12
- package/cjs/Overlay.d.ts +1 -1
- package/cjs/Overlay.js +12 -27
- package/cjs/OverlayTrigger.d.ts +9 -9
- package/cjs/OverlayTrigger.js +7 -32
- package/cjs/PageItem.js +3 -12
- package/cjs/Pagination.js +0 -11
- package/cjs/Placeholder.js +2 -11
- package/cjs/PlaceholderButton.js +2 -9
- package/cjs/Popover.js +0 -13
- package/cjs/PopoverBody.js +0 -4
- package/cjs/PopoverContent.d.ts +5 -0
- package/cjs/PopoverHeader.js +0 -4
- package/cjs/PopoverTitle.d.ts +5 -0
- package/cjs/ProgressBar.js +2 -20
- package/cjs/Ratio.d.ts +1 -1
- package/cjs/Ratio.js +3 -12
- package/cjs/ResponsiveEmbed.d.ts +9 -0
- package/cjs/Row.d.ts +2 -2
- package/cjs/Row.js +0 -10
- package/cjs/SSRProvider.js +0 -2
- package/cjs/SafeAnchor.d.ts +17 -0
- package/cjs/SelectableContext.d.ts +5 -0
- package/cjs/Spinner.d.ts +1 -1
- package/cjs/Spinner.js +1 -9
- package/cjs/SplitButton.js +1 -27
- package/cjs/Stack.d.ts +1 -1
- package/cjs/Stack.js +2 -10
- package/cjs/Switch.d.ts +1 -1
- package/cjs/Switch.js +2 -10
- package/cjs/Tab.d.ts +2 -2
- package/cjs/Tab.js +2 -20
- package/cjs/TabContainer.d.ts +2 -2
- package/cjs/TabContainer.js +2 -10
- package/cjs/TabContent.js +0 -4
- package/cjs/TabContext.d.ts +12 -0
- package/cjs/TabPane.js +7 -17
- package/cjs/Table.js +2 -13
- package/cjs/Tabs.d.ts +3 -3
- package/cjs/Tabs.js +6 -24
- package/cjs/ThemeProvider.js +8 -17
- package/cjs/Toast.js +5 -18
- package/cjs/ToastBody.js +0 -4
- package/cjs/ToastContainer.d.ts +1 -1
- package/cjs/ToastContainer.js +0 -8
- package/cjs/ToastContext.js +0 -5
- package/cjs/ToastFade.js +2 -9
- package/cjs/ToastHeader.js +0 -11
- package/cjs/ToggleButton.d.ts +1 -1
- package/cjs/ToggleButton.js +2 -11
- package/cjs/ToggleButtonGroup.d.ts +2 -2
- package/cjs/ToggleButtonGroup.js +2 -23
- package/cjs/Tooltip.js +0 -9
- package/cjs/TransitionWrapper.d.ts +1 -1
- package/cjs/TransitionWrapper.js +3 -15
- package/cjs/createChainedFunction.js +2 -5
- package/cjs/createUtilityClasses.d.ts +1 -1
- package/cjs/createUtilityClasses.js +0 -6
- package/cjs/createWithBsPrefix.js +0 -11
- package/cjs/divWithClassName.js +2 -9
- package/cjs/getTabTransitionComponent.js +0 -6
- package/cjs/helpers.d.ts +4 -4
- package/cjs/helpers.js +2 -9
- package/cjs/index.js +0 -171
- package/cjs/safeFindDOMNode.d.ts +1 -1
- package/cjs/safeFindDOMNode.js +0 -5
- package/cjs/transitionEndListener.js +0 -6
- package/cjs/triggerBrowserReflow.js +0 -2
- package/cjs/types.d.ts +10 -10
- package/cjs/types.js +0 -5
- package/cjs/useOverlayOffset.js +0 -8
- package/cjs/usePlaceholder.d.ts +2 -2
- package/cjs/usePlaceholder.js +2 -7
- package/cjs/usePopperMarginModifiers.d.ts +4 -0
- package/cjs/useWrappedRefWithWarning.js +4 -9
- package/dist/react-bootstrap.js +750 -2195
- package/dist/react-bootstrap.min.js +1 -1
- package/esm/AbstractNav.d.ts +15 -0
- package/esm/AbstractNavItem.d.ts +19 -0
- package/esm/AccordionBody.d.ts +2 -1
- package/esm/AccordionBody.js +12 -0
- package/esm/AccordionButton.d.ts +1 -1
- package/esm/AccordionButton.js +0 -4
- package/esm/AccordionCollapse.js +0 -1
- package/esm/AccordionContext.d.ts +1 -1
- package/esm/AccordionToggle.d.ts +11 -0
- package/esm/Alert.js +0 -2
- package/esm/BootstrapModalManager.js +2 -9
- package/esm/Breadcrumb.js +2 -1
- package/esm/BreadcrumbItem.js +2 -1
- package/esm/Button.d.ts +1 -1
- package/esm/Button.js +2 -1
- package/esm/ButtonGroup.js +2 -1
- package/esm/ButtonToolbar.js +2 -1
- package/esm/CardColumns.d.ts +2 -0
- package/esm/CardContext.d.ts +6 -0
- package/esm/CardDeck.d.ts +2 -0
- package/esm/CardImg.js +2 -1
- package/esm/Carousel.d.ts +1 -1
- package/esm/Carousel.js +9 -36
- package/esm/CloseButton.d.ts +1 -1
- package/esm/CloseButton.js +2 -1
- package/esm/Col.d.ts +5 -5
- package/esm/Col.js +6 -5
- package/esm/Collapse.d.ts +1 -1
- package/esm/Collapse.js +11 -8
- package/esm/Dropdown.js +17 -7
- package/esm/DropdownButton.js +1 -14
- package/esm/DropdownContext.d.ts +2 -2
- package/esm/DropdownItem.js +2 -1
- package/esm/DropdownMenu.d.ts +2 -2
- package/esm/DropdownMenu.js +12 -15
- package/esm/DropdownToggle.d.ts +2 -2
- package/esm/DropdownToggle.js +7 -10
- package/esm/ElementChildren.js +3 -6
- package/esm/Fade.js +2 -1
- package/esm/Feedback.d.ts +1 -1
- package/esm/Feedback.js +4 -3
- package/esm/Form.d.ts +5 -5
- package/esm/Form.js +2 -2
- package/esm/FormCheck.d.ts +1 -1
- package/esm/FormCheck.js +2 -3
- package/esm/FormCheckInput.d.ts +1 -1
- package/esm/FormCheckInput.js +2 -1
- package/esm/FormCheckLabel.js +2 -1
- package/esm/FormContext.js +3 -1
- package/esm/FormControl.d.ts +1 -1
- package/esm/FormControl.js +2 -3
- package/esm/FormFile.d.ts +23 -0
- package/esm/FormFileInput.d.ts +10 -0
- package/esm/FormFileLabel.d.ts +7 -0
- package/esm/FormGroup.js +2 -1
- package/esm/FormLabel.d.ts +1 -1
- package/esm/FormRange.js +2 -1
- package/esm/FormSelect.js +2 -1
- package/esm/FormText.js +4 -2
- package/esm/Image.js +0 -4
- package/esm/InputGroup.js +3 -5
- package/esm/Jumbotron.d.ts +7 -0
- package/esm/ListGroup.js +0 -2
- package/esm/ListGroupItem.js +4 -4
- package/esm/Media.d.ts +8 -0
- package/esm/Modal.js +32 -44
- package/esm/ModalContext.js +0 -1
- package/esm/ModalDialog.js +2 -1
- package/esm/Nav.js +0 -2
- package/esm/NavLink.js +2 -1
- package/esm/Navbar.js +3 -4
- package/esm/NavbarBrand.js +2 -1
- package/esm/NavbarContext.js +3 -1
- package/esm/NavbarOffcanvas.d.ts +1 -1
- package/esm/NavbarToggle.js +2 -3
- package/esm/Offcanvas.d.ts +1 -1
- package/esm/Offcanvas.js +9 -16
- package/esm/OffcanvasToggling.js +2 -1
- package/esm/Overlay.d.ts +1 -1
- package/esm/Overlay.js +12 -12
- package/esm/OverlayTrigger.d.ts +9 -9
- package/esm/OverlayTrigger.js +7 -20
- package/esm/PageItem.js +2 -4
- package/esm/Pagination.js +0 -1
- package/esm/Placeholder.js +2 -1
- package/esm/PlaceholderButton.js +2 -1
- package/esm/PopoverContent.d.ts +5 -0
- package/esm/PopoverTitle.d.ts +5 -0
- package/esm/ProgressBar.js +2 -12
- package/esm/Ratio.d.ts +1 -1
- package/esm/Ratio.js +3 -4
- package/esm/ResponsiveEmbed.d.ts +9 -0
- package/esm/Row.d.ts +2 -2
- package/esm/Row.js +0 -2
- package/esm/SafeAnchor.d.ts +17 -0
- package/esm/SelectableContext.d.ts +5 -0
- package/esm/Spinner.d.ts +1 -1
- package/esm/Spinner.js +1 -1
- package/esm/SplitButton.js +1 -16
- package/esm/Stack.d.ts +1 -1
- package/esm/Stack.js +2 -1
- package/esm/Switch.d.ts +1 -1
- package/esm/Switch.js +2 -1
- package/esm/Tab.d.ts +2 -2
- package/esm/Tab.js +2 -9
- package/esm/TabContainer.d.ts +2 -2
- package/esm/TabContainer.js +2 -3
- package/esm/TabContext.d.ts +12 -0
- package/esm/TabPane.js +7 -4
- package/esm/Table.js +2 -6
- package/esm/Tabs.d.ts +3 -3
- package/esm/Tabs.js +6 -9
- package/esm/ThemeProvider.js +8 -9
- package/esm/Toast.js +5 -5
- package/esm/ToastContainer.d.ts +1 -1
- package/esm/ToastContext.js +0 -1
- package/esm/ToastFade.js +2 -1
- package/esm/ToggleButton.d.ts +1 -1
- package/esm/ToggleButton.js +2 -3
- package/esm/ToggleButtonGroup.d.ts +2 -2
- package/esm/ToggleButtonGroup.js +2 -9
- package/esm/TransitionWrapper.d.ts +1 -1
- package/esm/TransitionWrapper.js +3 -5
- package/esm/createChainedFunction.js +2 -4
- package/esm/createUtilityClasses.d.ts +1 -1
- package/esm/createUtilityClasses.js +0 -1
- package/esm/createWithBsPrefix.js +0 -2
- package/esm/divWithClassName.js +2 -1
- package/esm/getTabTransitionComponent.js +0 -1
- package/esm/helpers.d.ts +4 -4
- package/esm/helpers.js +3 -3
- package/esm/safeFindDOMNode.d.ts +1 -1
- package/esm/safeFindDOMNode.js +0 -1
- package/esm/transitionEndListener.js +0 -2
- package/esm/types.d.ts +10 -10
- package/esm/useOverlayOffset.js +3 -3
- package/esm/usePlaceholder.d.ts +2 -2
- package/esm/usePlaceholder.js +2 -1
- package/esm/usePopperMarginModifiers.d.ts +4 -0
- package/esm/useWrappedRefWithWarning.js +4 -3
- package/package.json +2 -2
package/esm/Dropdown.js
CHANGED
|
@@ -30,7 +30,8 @@ const DropdownItemText = createWithBsPrefix('dropdown-item-text', {
|
|
|
30
30
|
const defaultProps = {
|
|
31
31
|
navbar: false,
|
|
32
32
|
align: 'start',
|
|
33
|
-
autoClose: true
|
|
33
|
+
autoClose: true,
|
|
34
|
+
drop: 'down'
|
|
34
35
|
};
|
|
35
36
|
const Dropdown = /*#__PURE__*/React.forwardRef((pProps, ref) => {
|
|
36
37
|
const {
|
|
@@ -53,17 +54,17 @@ const Dropdown = /*#__PURE__*/React.forwardRef((pProps, ref) => {
|
|
|
53
54
|
const isInputGroup = useContext(InputGroupContext);
|
|
54
55
|
const prefix = useBootstrapPrefix(bsPrefix, 'dropdown');
|
|
55
56
|
const isRTL = useIsRTL();
|
|
56
|
-
|
|
57
57
|
const isClosingPermitted = source => {
|
|
58
58
|
// autoClose=false only permits close on button click
|
|
59
|
-
if (autoClose === false) return source === 'click';
|
|
59
|
+
if (autoClose === false) return source === 'click';
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
// autoClose=inside doesn't permit close on rootClose
|
|
62
|
+
if (autoClose === 'inside') return source !== 'rootClose';
|
|
62
63
|
|
|
64
|
+
// autoClose=outside doesn't permit close on select
|
|
63
65
|
if (autoClose === 'outside') return source !== 'select';
|
|
64
66
|
return true;
|
|
65
67
|
};
|
|
66
|
-
|
|
67
68
|
const handleToggle = useEventCallback((nextShow, meta) => {
|
|
68
69
|
if (meta.originalEvent.currentTarget === document && (meta.source !== 'keydown' || meta.originalEvent.key === 'Escape')) meta.source = 'rootClose';
|
|
69
70
|
if (isClosingPermitted(meta.source)) onToggle == null ? void 0 : onToggle(nextShow, meta);
|
|
@@ -75,6 +76,14 @@ const Dropdown = /*#__PURE__*/React.forwardRef((pProps, ref) => {
|
|
|
75
76
|
drop,
|
|
76
77
|
isRTL
|
|
77
78
|
}), [align, drop, isRTL]);
|
|
79
|
+
const directionClasses = {
|
|
80
|
+
down: prefix,
|
|
81
|
+
'down-centered': `${prefix}-center`,
|
|
82
|
+
up: 'dropup',
|
|
83
|
+
'up-centered': 'dropup-center dropup',
|
|
84
|
+
end: 'dropend',
|
|
85
|
+
start: 'dropstart'
|
|
86
|
+
};
|
|
78
87
|
return /*#__PURE__*/_jsx(DropdownContext.Provider, {
|
|
79
88
|
value: contextValue,
|
|
80
89
|
children: /*#__PURE__*/_jsx(BaseDropdown, {
|
|
@@ -84,9 +93,10 @@ const Dropdown = /*#__PURE__*/React.forwardRef((pProps, ref) => {
|
|
|
84
93
|
onToggle: handleToggle,
|
|
85
94
|
focusFirstItemOnShow: focusFirstItemOnShow,
|
|
86
95
|
itemSelector: `.${prefix}-item:not(.disabled):not(:disabled)`,
|
|
87
|
-
children: isInputGroup ? props.children : /*#__PURE__*/_jsx(Component, {
|
|
96
|
+
children: isInputGroup ? props.children : /*#__PURE__*/_jsx(Component, {
|
|
97
|
+
...props,
|
|
88
98
|
ref: ref,
|
|
89
|
-
className: classNames(className, show && 'show',
|
|
99
|
+
className: classNames(className, show && 'show', directionClasses[drop])
|
|
90
100
|
})
|
|
91
101
|
})
|
|
92
102
|
});
|
package/esm/DropdownButton.js
CHANGED
|
@@ -12,19 +12,14 @@ const propTypes = {
|
|
|
12
12
|
* @type {string}
|
|
13
13
|
*/
|
|
14
14
|
id: PropTypes.string,
|
|
15
|
-
|
|
16
15
|
/** An `href` passed to the Toggle component */
|
|
17
16
|
href: PropTypes.string,
|
|
18
|
-
|
|
19
17
|
/** An `onClick` handler passed to the Toggle component */
|
|
20
18
|
onClick: PropTypes.func,
|
|
21
|
-
|
|
22
19
|
/** The content of the non-toggle Button. */
|
|
23
20
|
title: PropTypes.node.isRequired,
|
|
24
|
-
|
|
25
21
|
/** Disables both Buttons */
|
|
26
22
|
disabled: PropTypes.bool,
|
|
27
|
-
|
|
28
23
|
/**
|
|
29
24
|
* Aligns the dropdown menu.
|
|
30
25
|
*
|
|
@@ -33,43 +28,36 @@ const propTypes = {
|
|
|
33
28
|
* @type {"start"|"end"|{ sm: "start"|"end" }|{ md: "start"|"end" }|{ lg: "start"|"end" }|{ xl: "start"|"end"}|{ xxl: "start"|"end"} }
|
|
34
29
|
*/
|
|
35
30
|
align: alignPropType,
|
|
36
|
-
|
|
37
31
|
/** An ARIA accessible role applied to the Menu component. When set to 'menu', The dropdown */
|
|
38
32
|
menuRole: PropTypes.string,
|
|
39
|
-
|
|
40
33
|
/** Whether to render the dropdown menu in the DOM before the first time it is shown */
|
|
41
34
|
renderMenuOnMount: PropTypes.bool,
|
|
42
|
-
|
|
43
35
|
/**
|
|
44
36
|
* Which event when fired outside the component will cause it to be closed.
|
|
45
37
|
*
|
|
46
38
|
* _see [DropdownMenu](#dropdown-menu-props) for more details_
|
|
47
39
|
*/
|
|
48
40
|
rootCloseEvent: PropTypes.string,
|
|
49
|
-
|
|
50
41
|
/**
|
|
51
42
|
* Menu color variant.
|
|
52
43
|
*
|
|
53
44
|
* Omitting this will use the default light color.
|
|
54
45
|
*/
|
|
55
46
|
menuVariant: PropTypes.oneOf(['dark']),
|
|
56
|
-
|
|
57
47
|
/**
|
|
58
48
|
* Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
|
|
59
49
|
* Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
|
|
60
50
|
*
|
|
61
51
|
*/
|
|
62
52
|
flip: PropTypes.bool,
|
|
63
|
-
|
|
64
53
|
/** @ignore */
|
|
65
54
|
bsPrefix: PropTypes.string,
|
|
66
|
-
|
|
67
55
|
/** @ignore */
|
|
68
56
|
variant: PropTypes.string,
|
|
69
|
-
|
|
70
57
|
/** @ignore */
|
|
71
58
|
size: PropTypes.string
|
|
72
59
|
};
|
|
60
|
+
|
|
73
61
|
/**
|
|
74
62
|
* A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
|
|
75
63
|
* are passed directly to the default `Dropdown.Menu`. This component accepts all of
|
|
@@ -79,7 +67,6 @@ const propTypes = {
|
|
|
79
67
|
* the Button `variant`, `size` and `bsPrefix` props are passed to the toggle,
|
|
80
68
|
* along with menu-related props are passed to the `Dropdown.Menu`
|
|
81
69
|
*/
|
|
82
|
-
|
|
83
70
|
const DropdownButton = /*#__PURE__*/React.forwardRef(({
|
|
84
71
|
title,
|
|
85
72
|
children,
|
package/esm/DropdownContext.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AlignType } from './types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type DropDirection = 'up' | 'up-centered' | 'start' | 'end' | 'down' | 'down-centered';
|
|
4
|
+
export type DropdownContextValue = {
|
|
5
5
|
align?: AlignType;
|
|
6
6
|
drop?: DropDirection;
|
|
7
7
|
isRTL?: boolean;
|
package/esm/DropdownItem.js
CHANGED
|
@@ -22,7 +22,8 @@ const DropdownItem = /*#__PURE__*/React.forwardRef(({
|
|
|
22
22
|
onClick,
|
|
23
23
|
active
|
|
24
24
|
});
|
|
25
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
25
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
26
|
+
...props,
|
|
26
27
|
...dropdownItemProps,
|
|
27
28
|
ref: ref,
|
|
28
29
|
className: classNames(className, prefix, meta.isActive && 'active', disabled && 'disabled')
|
package/esm/DropdownMenu.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { UseDropdownMenuOptions } from '@restart/ui/DropdownMenu';
|
|
|
3
3
|
import { DropDirection } from './DropdownContext';
|
|
4
4
|
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
5
5
|
import { AlignType } from './types';
|
|
6
|
-
export
|
|
6
|
+
export type DropdownMenuVariant = 'dark' | string;
|
|
7
7
|
export interface DropdownMenuProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
|
|
8
8
|
show?: boolean;
|
|
9
9
|
renderOnMount?: boolean;
|
|
@@ -13,6 +13,6 @@ export interface DropdownMenuProps extends BsPrefixProps, React.HTMLAttributes<H
|
|
|
13
13
|
popperConfig?: UseDropdownMenuOptions['popperConfig'];
|
|
14
14
|
variant?: DropdownMenuVariant;
|
|
15
15
|
}
|
|
16
|
-
export declare function getDropdownMenuPlacement(alignEnd: boolean, dropDirection?: DropDirection, isRTL?: boolean): "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end";
|
|
16
|
+
export declare function getDropdownMenuPlacement(alignEnd: boolean, dropDirection?: DropDirection, isRTL?: boolean): "bottom" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end";
|
|
17
17
|
declare const DropdownMenu: BsPrefixRefForwardingComponent<'div', DropdownMenuProps>;
|
|
18
18
|
export default DropdownMenu;
|
package/esm/DropdownMenu.js
CHANGED
|
@@ -25,7 +25,7 @@ export function getDropdownMenuPlacement(alignEnd, dropDirection, isRTL) {
|
|
|
25
25
|
const rightStart = isRTL ? 'left-start' : 'right-start';
|
|
26
26
|
const rightEnd = isRTL ? 'left-end' : 'right-end';
|
|
27
27
|
let placement = alignEnd ? bottomEnd : bottomStart;
|
|
28
|
-
if (dropDirection === 'up') placement = alignEnd ? topEnd : topStart;else if (dropDirection === 'end') placement = alignEnd ? rightEnd : rightStart;else if (dropDirection === 'start') placement = alignEnd ? leftEnd : leftStart;
|
|
28
|
+
if (dropDirection === 'up') placement = alignEnd ? topEnd : topStart;else if (dropDirection === 'end') placement = alignEnd ? rightEnd : rightStart;else if (dropDirection === 'start') placement = alignEnd ? leftEnd : leftStart;else if (dropDirection === 'down-centered') placement = 'bottom';else if (dropDirection === 'up-centered') placement = 'top';
|
|
29
29
|
return placement;
|
|
30
30
|
}
|
|
31
31
|
const DropdownMenu = /*#__PURE__*/React.forwardRef(({
|
|
@@ -53,17 +53,16 @@ const DropdownMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
53
53
|
align = align || contextAlign;
|
|
54
54
|
const isInputGroup = useContext(InputGroupContext);
|
|
55
55
|
const alignClasses = [];
|
|
56
|
-
|
|
57
56
|
if (align) {
|
|
58
57
|
if (typeof align === 'object') {
|
|
59
58
|
const keys = Object.keys(align);
|
|
60
59
|
process.env.NODE_ENV !== "production" ? warning(keys.length === 1, 'There should only be 1 breakpoint when passing an object to `align`') : void 0;
|
|
61
|
-
|
|
62
60
|
if (keys.length) {
|
|
63
61
|
const brkPoint = keys[0];
|
|
64
|
-
const direction = align[brkPoint];
|
|
65
|
-
// left in addition to align left classes.
|
|
62
|
+
const direction = align[brkPoint];
|
|
66
63
|
|
|
64
|
+
// .dropdown-menu-end is required for responsively aligning
|
|
65
|
+
// left in addition to align left classes.
|
|
67
66
|
alignEnd = direction === 'start';
|
|
68
67
|
alignClasses.push(`${prefix}-${brkPoint}-${direction}`);
|
|
69
68
|
}
|
|
@@ -71,7 +70,6 @@ const DropdownMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
71
70
|
alignEnd = true;
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
|
-
|
|
75
73
|
const placement = getDropdownMenuPlacement(alignEnd, drop, isRTL);
|
|
76
74
|
const [menuProps, {
|
|
77
75
|
hasShown,
|
|
@@ -93,30 +91,29 @@ const DropdownMenu = /*#__PURE__*/React.forwardRef(({
|
|
|
93
91
|
// renderOnMount=true. Need to call update() to correct it.
|
|
94
92
|
if (show) popper == null ? void 0 : popper.update();
|
|
95
93
|
}, [show]);
|
|
96
|
-
if (!hasShown && !renderOnMount && !isInputGroup) return null;
|
|
94
|
+
if (!hasShown && !renderOnMount && !isInputGroup) return null;
|
|
97
95
|
|
|
96
|
+
// For custom components provide additional, non-DOM, props;
|
|
98
97
|
if (typeof Component !== 'string') {
|
|
99
98
|
menuProps.show = show;
|
|
100
|
-
|
|
101
99
|
menuProps.close = () => toggle == null ? void 0 : toggle(false);
|
|
102
|
-
|
|
103
100
|
menuProps.align = align;
|
|
104
101
|
}
|
|
105
|
-
|
|
106
102
|
let style = props.style;
|
|
107
|
-
|
|
108
103
|
if (popper != null && popper.placement) {
|
|
109
104
|
// we don't need the default popper style,
|
|
110
105
|
// menus are display: none when not shown.
|
|
111
|
-
style = {
|
|
106
|
+
style = {
|
|
107
|
+
...props.style,
|
|
112
108
|
...menuProps.style
|
|
113
109
|
};
|
|
114
110
|
props['x-placement'] = popper.placement;
|
|
115
111
|
}
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
113
|
+
...props,
|
|
118
114
|
...menuProps,
|
|
119
|
-
style: style
|
|
115
|
+
style: style
|
|
116
|
+
// Bootstrap css requires this data attrib to style responsive menus.
|
|
120
117
|
,
|
|
121
118
|
...((alignClasses.length || isNavbar) && {
|
|
122
119
|
'data-bs-popper': 'static'
|
package/esm/DropdownToggle.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface DropdownToggleProps extends Omit<ButtonProps, 'as'> {
|
|
|
6
6
|
split?: boolean;
|
|
7
7
|
childBsPrefix?: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export
|
|
9
|
+
type DropdownToggleComponent = BsPrefixRefForwardingComponent<'button', DropdownToggleProps>;
|
|
10
|
+
export type PropsFromToggle = Partial<Pick<React.ComponentPropsWithRef<DropdownToggleComponent>, CommonButtonProps>>;
|
|
11
11
|
declare const DropdownToggle: DropdownToggleComponent;
|
|
12
12
|
export default DropdownToggle;
|
package/esm/DropdownToggle.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
2
|
+
import DropdownContext from '@restart/ui/DropdownContext';
|
|
3
|
+
import { useDropdownToggle } from '@restart/ui/DropdownToggle';
|
|
1
4
|
import classNames from 'classnames';
|
|
2
5
|
import * as React from 'react';
|
|
3
6
|
import { useContext } from 'react';
|
|
4
|
-
import { useDropdownToggle } from '@restart/ui/DropdownToggle';
|
|
5
|
-
import DropdownContext from '@restart/ui/DropdownContext';
|
|
6
|
-
import useMergedRefs from '@restart/hooks/useMergedRefs';
|
|
7
7
|
import Button from './Button';
|
|
8
|
-
import InputGroupContext from './InputGroupContext';
|
|
9
8
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
10
9
|
import useWrappedRefWithWarning from './useWrappedRefWithWarning';
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -20,18 +19,16 @@ const DropdownToggle = /*#__PURE__*/React.forwardRef(({
|
|
|
20
19
|
}, ref) => {
|
|
21
20
|
const prefix = useBootstrapPrefix(bsPrefix, 'dropdown-toggle');
|
|
22
21
|
const dropdownContext = useContext(DropdownContext);
|
|
23
|
-
const isInputGroup = useContext(InputGroupContext);
|
|
24
|
-
|
|
25
22
|
if (childBsPrefix !== undefined) {
|
|
26
23
|
props.bsPrefix = childBsPrefix;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
const [toggleProps] = useDropdownToggle();
|
|
30
|
-
toggleProps.ref = useMergedRefs(toggleProps.ref, useWrappedRefWithWarning(ref, 'DropdownToggle'));
|
|
31
|
-
// underlying component, to allow it to render size and style variants.
|
|
26
|
+
toggleProps.ref = useMergedRefs(toggleProps.ref, useWrappedRefWithWarning(ref, 'DropdownToggle'));
|
|
32
27
|
|
|
28
|
+
// This intentionally forwards size and variant (if set) to the
|
|
29
|
+
// underlying component, to allow it to render size and style variants.
|
|
33
30
|
return /*#__PURE__*/_jsx(Component, {
|
|
34
|
-
className: classNames(className, prefix, split && `${prefix}-split`,
|
|
31
|
+
className: classNames(className, prefix, split && `${prefix}-split`, (dropdownContext == null ? void 0 : dropdownContext.show) && 'show'),
|
|
35
32
|
...toggleProps,
|
|
36
33
|
...props
|
|
37
34
|
});
|
package/esm/ElementChildren.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Iterates through children that are typically specified as `props.children`,
|
|
4
5
|
* but only maps over children that are "valid elements".
|
|
@@ -7,33 +8,29 @@ import * as React from 'react';
|
|
|
7
8
|
* so an invalid component would not increase the index.
|
|
8
9
|
*
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
11
|
function map(children, func) {
|
|
12
12
|
let index = 0;
|
|
13
13
|
return React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) ? func(child, index++) : child);
|
|
14
14
|
}
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* Iterates through children that are "valid elements".
|
|
17
18
|
*
|
|
18
19
|
* The provided forEachFunc(child, index) will be called for each
|
|
19
20
|
* leaf child with the index reflecting the position relative to "valid components".
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
22
|
function forEach(children, func) {
|
|
24
23
|
let index = 0;
|
|
25
24
|
React.Children.forEach(children, child => {
|
|
26
25
|
if ( /*#__PURE__*/React.isValidElement(child)) func(child, index++);
|
|
27
26
|
});
|
|
28
27
|
}
|
|
28
|
+
|
|
29
29
|
/**
|
|
30
30
|
* Finds whether a component's `children` prop includes a React element of the
|
|
31
31
|
* specified type.
|
|
32
32
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
33
|
function hasChildOfType(children, type) {
|
|
36
34
|
return React.Children.toArray(children).some(child => /*#__PURE__*/React.isValidElement(child) && child.type === type);
|
|
37
35
|
}
|
|
38
|
-
|
|
39
36
|
export { map, forEach, hasChildOfType };
|
package/esm/Fade.js
CHANGED
|
@@ -33,7 +33,8 @@ const Fade = /*#__PURE__*/React.forwardRef(({
|
|
|
33
33
|
...props,
|
|
34
34
|
onEnter: handleEnter,
|
|
35
35
|
childRef: children.ref,
|
|
36
|
-
children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
|
|
36
|
+
children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
|
|
37
|
+
...innerProps,
|
|
37
38
|
className: classNames('fade', className, children.props.className, fadeStyles[status], transitionClasses[status])
|
|
38
39
|
})
|
|
39
40
|
});
|
package/esm/Feedback.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AsProp, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
-
export
|
|
3
|
+
export type FeedbackType = 'valid' | 'invalid';
|
|
4
4
|
export interface FeedbackProps extends AsProp, React.HTMLAttributes<HTMLElement> {
|
|
5
5
|
bsPrefix?: never;
|
|
6
6
|
type?: FeedbackType;
|
package/esm/Feedback.js
CHANGED
|
@@ -9,19 +9,20 @@ const propTypes = {
|
|
|
9
9
|
* @type {('valid'|'invalid')}
|
|
10
10
|
*/
|
|
11
11
|
type: PropTypes.string,
|
|
12
|
-
|
|
13
12
|
/** Display feedback as a tooltip. */
|
|
14
13
|
tooltip: PropTypes.bool,
|
|
15
14
|
as: PropTypes.elementType
|
|
16
15
|
};
|
|
17
|
-
const Feedback = /*#__PURE__*/React.forwardRef(
|
|
16
|
+
const Feedback = /*#__PURE__*/React.forwardRef(
|
|
17
|
+
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
18
18
|
({
|
|
19
19
|
as: Component = 'div',
|
|
20
20
|
className,
|
|
21
21
|
type = 'valid',
|
|
22
22
|
tooltip = false,
|
|
23
23
|
...props
|
|
24
|
-
}, ref) => /*#__PURE__*/_jsx(Component, {
|
|
24
|
+
}, ref) => /*#__PURE__*/_jsx(Component, {
|
|
25
|
+
...props,
|
|
25
26
|
ref: ref,
|
|
26
27
|
className: classNames(className, `${type}-${tooltip ? 'tooltip' : 'feedback'}`)
|
|
27
28
|
}));
|
package/esm/Form.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
73
73
|
is?: string | undefined;
|
|
74
74
|
'aria-activedescendant'?: string | undefined;
|
|
75
75
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
76
|
-
'aria-autocomplete'?: "list" | "none" | "
|
|
76
|
+
'aria-autocomplete'?: "list" | "none" | "both" | "inline" | undefined;
|
|
77
77
|
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
78
78
|
'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
79
79
|
'aria-colcount'?: number | undefined;
|
|
@@ -84,7 +84,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
84
84
|
'aria-describedby'?: string | undefined;
|
|
85
85
|
'aria-details'?: string | undefined;
|
|
86
86
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
87
|
-
'aria-dropeffect'?: "link" | "none" | "copy" | "
|
|
87
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
88
88
|
'aria-errormessage'?: string | undefined;
|
|
89
89
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
90
90
|
'aria-flowto'?: string | undefined;
|
|
@@ -106,7 +106,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
106
106
|
'aria-posinset'?: number | undefined;
|
|
107
107
|
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
108
108
|
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
109
|
-
'aria-relevant'?: "text" | "
|
|
109
|
+
'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
110
110
|
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
111
111
|
'aria-roledescription'?: string | undefined;
|
|
112
112
|
'aria-rowcount'?: number | undefined;
|
|
@@ -286,13 +286,12 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
286
286
|
label?: React.ReactNode;
|
|
287
287
|
pattern?: string | undefined;
|
|
288
288
|
list?: string | undefined;
|
|
289
|
-
inline?: boolean | undefined;
|
|
290
|
-
step?: string | number | undefined;
|
|
291
289
|
bsPrefix?: string | undefined;
|
|
292
290
|
height?: string | number | undefined;
|
|
293
291
|
width?: string | number | undefined;
|
|
294
292
|
reverse?: boolean | undefined;
|
|
295
293
|
size?: number | undefined;
|
|
294
|
+
inline?: boolean | undefined;
|
|
296
295
|
multiple?: boolean | undefined;
|
|
297
296
|
as?: React.ElementType<any> | undefined;
|
|
298
297
|
autoComplete?: string | undefined;
|
|
@@ -309,6 +308,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
|
|
|
309
308
|
enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send" | undefined;
|
|
310
309
|
readOnly?: boolean | undefined;
|
|
311
310
|
required?: boolean | undefined;
|
|
311
|
+
step?: string | number | undefined;
|
|
312
312
|
feedback?: React.ReactNode;
|
|
313
313
|
isValid?: boolean | undefined;
|
|
314
314
|
isInvalid?: boolean | undefined;
|
package/esm/Form.js
CHANGED
|
@@ -22,7 +22,6 @@ const propTypes = {
|
|
|
22
22
|
* @alias ref
|
|
23
23
|
*/
|
|
24
24
|
_ref: PropTypes.any,
|
|
25
|
-
|
|
26
25
|
/**
|
|
27
26
|
* Mark a form as having been validated. Setting it to `true` will
|
|
28
27
|
* toggle any validation styles on the forms elements.
|
|
@@ -36,7 +35,8 @@ const Form = /*#__PURE__*/React.forwardRef(({
|
|
|
36
35
|
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
37
36
|
as: Component = 'form',
|
|
38
37
|
...props
|
|
39
|
-
}, ref) => /*#__PURE__*/_jsx(Component, {
|
|
38
|
+
}, ref) => /*#__PURE__*/_jsx(Component, {
|
|
39
|
+
...props,
|
|
40
40
|
ref: ref,
|
|
41
41
|
className: classNames(className, validated && 'was-validated')
|
|
42
42
|
}));
|
package/esm/FormCheck.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FeedbackType } from './Feedback';
|
|
3
3
|
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
4
|
-
export
|
|
4
|
+
export type FormCheckType = 'checkbox' | 'radio' | 'switch';
|
|
5
5
|
export interface FormCheckProps extends BsPrefixProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
6
6
|
inline?: boolean;
|
|
7
7
|
reverse?: boolean;
|
package/esm/FormCheck.js
CHANGED
|
@@ -41,8 +41,8 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
41
41
|
controlId: id || controlId
|
|
42
42
|
}), [controlId, id]);
|
|
43
43
|
const hasLabel = !children && label != null && label !== false || hasChildOfType(children, FormCheckLabel);
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const input = /*#__PURE__*/_jsx(FormCheckInput, {
|
|
45
|
+
...props,
|
|
46
46
|
type: type === 'switch' ? 'checkbox' : type,
|
|
47
47
|
ref: ref,
|
|
48
48
|
isValid: isValid,
|
|
@@ -50,7 +50,6 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
|
|
|
50
50
|
disabled: disabled,
|
|
51
51
|
as: as
|
|
52
52
|
});
|
|
53
|
-
|
|
54
53
|
return /*#__PURE__*/_jsx(FormContext.Provider, {
|
|
55
54
|
value: innerFormContext,
|
|
56
55
|
children: /*#__PURE__*/_jsx("div", {
|
package/esm/FormCheckInput.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
-
|
|
3
|
+
type FormCheckInputType = 'checkbox' | 'radio';
|
|
4
4
|
export interface FormCheckInputProps extends BsPrefixProps, React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
5
|
type?: FormCheckInputType;
|
|
6
6
|
isValid?: boolean;
|
package/esm/FormCheckInput.js
CHANGED
|
@@ -19,7 +19,8 @@ const FormCheckInput = /*#__PURE__*/React.forwardRef(({
|
|
|
19
19
|
controlId
|
|
20
20
|
} = useContext(FormContext);
|
|
21
21
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check-input');
|
|
22
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
22
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
23
|
+
...props,
|
|
23
24
|
ref: ref,
|
|
24
25
|
type: type,
|
|
25
26
|
id: id || controlId,
|
package/esm/FormCheckLabel.js
CHANGED
|
@@ -14,7 +14,8 @@ const FormCheckLabel = /*#__PURE__*/React.forwardRef(({
|
|
|
14
14
|
controlId
|
|
15
15
|
} = useContext(FormContext);
|
|
16
16
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-check-label');
|
|
17
|
-
return /*#__PURE__*/_jsx("label", {
|
|
17
|
+
return /*#__PURE__*/_jsx("label", {
|
|
18
|
+
...props,
|
|
18
19
|
ref: ref,
|
|
19
20
|
htmlFor: htmlFor || controlId,
|
|
20
21
|
className: classNames(className, bsPrefix)
|
package/esm/FormContext.js
CHANGED
package/esm/FormControl.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
3
|
-
|
|
3
|
+
type FormControlElement = HTMLInputElement | HTMLTextAreaElement;
|
|
4
4
|
export interface FormControlProps extends BsPrefixProps, React.HTMLAttributes<FormControlElement> {
|
|
5
5
|
htmlSize?: number;
|
|
6
6
|
size?: 'sm' | 'lg';
|
package/esm/FormControl.js
CHANGED
|
@@ -26,7 +26,6 @@ const FormControl = /*#__PURE__*/React.forwardRef(({
|
|
|
26
26
|
} = useContext(FormContext);
|
|
27
27
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-control');
|
|
28
28
|
let classes;
|
|
29
|
-
|
|
30
29
|
if (plaintext) {
|
|
31
30
|
classes = {
|
|
32
31
|
[`${bsPrefix}-plaintext`]: true
|
|
@@ -37,9 +36,9 @@ const FormControl = /*#__PURE__*/React.forwardRef(({
|
|
|
37
36
|
[`${bsPrefix}-${size}`]: size
|
|
38
37
|
};
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
process.env.NODE_ENV !== "production" ? warning(controlId == null || !id, '`controlId` is ignored on `<FormControl>` when `id` is specified.') : void 0;
|
|
42
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
40
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
41
|
+
...props,
|
|
43
42
|
type: type,
|
|
44
43
|
size: htmlSize,
|
|
45
44
|
ref: ref,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormFileInput from './FormFileInput';
|
|
3
|
+
import FormFileLabel from './FormFileLabel';
|
|
4
|
+
import { BsCustomPrefixProps, BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
|
|
5
|
+
export interface FormFileProps extends BsPrefixPropsWithChildren, BsCustomPrefixProps, Pick<React.HTMLAttributes<HTMLElement>, 'style'> {
|
|
6
|
+
inputAs?: React.ElementType;
|
|
7
|
+
id?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
custom?: boolean;
|
|
11
|
+
isValid?: boolean;
|
|
12
|
+
isInvalid?: boolean;
|
|
13
|
+
feedback?: React.ReactNode;
|
|
14
|
+
feedbackTooltip?: boolean;
|
|
15
|
+
lang?: string;
|
|
16
|
+
'data-browse'?: any;
|
|
17
|
+
}
|
|
18
|
+
declare type FormFile = BsPrefixRefForwardingComponent<'input', FormFileProps> & {
|
|
19
|
+
Input: typeof FormFileInput;
|
|
20
|
+
Label: typeof FormFileLabel;
|
|
21
|
+
};
|
|
22
|
+
declare const FormFile: FormFile;
|
|
23
|
+
export default FormFile;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BsCustomPrefixProps, BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
export interface FormFileInputProps extends BsPrefixProps, BsCustomPrefixProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
isValid?: boolean;
|
|
5
|
+
isInvalid?: boolean;
|
|
6
|
+
lang?: string;
|
|
7
|
+
}
|
|
8
|
+
declare type FormFileInput = BsPrefixRefForwardingComponent<'input', FormFileInputProps>;
|
|
9
|
+
declare const FormFileInput: FormFileInput;
|
|
10
|
+
export default FormFileInput;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BsCustomPrefixProps, BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
export interface FormFileLabelProps extends BsPrefixProps, BsCustomPrefixProps {
|
|
3
|
+
htmlFor?: string;
|
|
4
|
+
}
|
|
5
|
+
declare type FormFileLabel = BsPrefixRefForwardingComponent<'label', FormFileLabelProps>;
|
|
6
|
+
declare const FormFileLabel: FormFileLabel;
|
|
7
|
+
export default FormFileLabel;
|
package/esm/FormGroup.js
CHANGED
|
@@ -13,7 +13,8 @@ const FormGroup = /*#__PURE__*/React.forwardRef(({
|
|
|
13
13
|
}), [controlId]);
|
|
14
14
|
return /*#__PURE__*/_jsx(FormContext.Provider, {
|
|
15
15
|
value: context,
|
|
16
|
-
children: /*#__PURE__*/_jsx(Component, {
|
|
16
|
+
children: /*#__PURE__*/_jsx(Component, {
|
|
17
|
+
...props,
|
|
17
18
|
ref: ref
|
|
18
19
|
})
|
|
19
20
|
});
|
package/esm/FormLabel.d.ts
CHANGED
|
@@ -11,6 +11,6 @@ export interface FormLabelOwnProps extends FormLabelBaseProps {
|
|
|
11
11
|
export interface FormLabelWithColProps extends FormLabelBaseProps, ColProps {
|
|
12
12
|
column: true | 'sm' | 'lg';
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type FormLabelProps = FormLabelWithColProps | FormLabelOwnProps;
|
|
15
15
|
declare const FormLabel: BsPrefixRefForwardingComponent<'label', FormLabelProps>;
|
|
16
16
|
export default FormLabel;
|
package/esm/FormRange.js
CHANGED
|
@@ -14,7 +14,8 @@ const FormRange = /*#__PURE__*/React.forwardRef(({
|
|
|
14
14
|
controlId
|
|
15
15
|
} = useContext(FormContext);
|
|
16
16
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-range');
|
|
17
|
-
return /*#__PURE__*/_jsx("input", {
|
|
17
|
+
return /*#__PURE__*/_jsx("input", {
|
|
18
|
+
...props,
|
|
18
19
|
type: "range",
|
|
19
20
|
ref: ref,
|
|
20
21
|
className: classNames(className, bsPrefix),
|
package/esm/FormSelect.js
CHANGED
|
@@ -18,7 +18,8 @@ const FormSelect = /*#__PURE__*/React.forwardRef(({
|
|
|
18
18
|
controlId
|
|
19
19
|
} = useContext(FormContext);
|
|
20
20
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-select');
|
|
21
|
-
return /*#__PURE__*/_jsx("select", {
|
|
21
|
+
return /*#__PURE__*/_jsx("select", {
|
|
22
|
+
...props,
|
|
22
23
|
size: htmlSize,
|
|
23
24
|
ref: ref,
|
|
24
25
|
className: classNames(className, bsPrefix, size && `${bsPrefix}-${size}`, isValid && `is-valid`, isInvalid && `is-invalid`),
|