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/FormText.js
CHANGED
|
@@ -2,7 +2,8 @@ import classNames from 'classnames';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const FormText = /*#__PURE__*/React.forwardRef(
|
|
5
|
+
const FormText = /*#__PURE__*/React.forwardRef(
|
|
6
|
+
// Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
6
7
|
({
|
|
7
8
|
bsPrefix,
|
|
8
9
|
className,
|
|
@@ -11,7 +12,8 @@ const FormText = /*#__PURE__*/React.forwardRef( // Need to define the default "a
|
|
|
11
12
|
...props
|
|
12
13
|
}, ref) => {
|
|
13
14
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'form-text');
|
|
14
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
15
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
16
|
+
...props,
|
|
15
17
|
ref: ref,
|
|
16
18
|
className: classNames(className, bsPrefix, muted && 'text-muted')
|
|
17
19
|
});
|
package/esm/Image.js
CHANGED
|
@@ -8,22 +8,18 @@ export const propTypes = {
|
|
|
8
8
|
* @default 'img'
|
|
9
9
|
*/
|
|
10
10
|
bsPrefix: PropTypes.string,
|
|
11
|
-
|
|
12
11
|
/**
|
|
13
12
|
* Sets image as fluid image.
|
|
14
13
|
*/
|
|
15
14
|
fluid: PropTypes.bool,
|
|
16
|
-
|
|
17
15
|
/**
|
|
18
16
|
* Sets image shape as rounded.
|
|
19
17
|
*/
|
|
20
18
|
rounded: PropTypes.bool,
|
|
21
|
-
|
|
22
19
|
/**
|
|
23
20
|
* Sets image shape as circle.
|
|
24
21
|
*/
|
|
25
22
|
roundedCircle: PropTypes.bool,
|
|
26
|
-
|
|
27
23
|
/**
|
|
28
24
|
* Sets image shape as thumbnail.
|
|
29
25
|
*/
|
package/esm/InputGroup.js
CHANGED
|
@@ -9,21 +9,18 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
9
9
|
const InputGroupText = createWithBsPrefix('input-group-text', {
|
|
10
10
|
Component: 'span'
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
const InputGroupCheckbox = props => /*#__PURE__*/_jsx(InputGroupText, {
|
|
14
13
|
children: /*#__PURE__*/_jsx(FormCheckInput, {
|
|
15
14
|
type: "checkbox",
|
|
16
15
|
...props
|
|
17
16
|
})
|
|
18
17
|
});
|
|
19
|
-
|
|
20
18
|
const InputGroupRadio = props => /*#__PURE__*/_jsx(InputGroupText, {
|
|
21
19
|
children: /*#__PURE__*/_jsx(FormCheckInput, {
|
|
22
20
|
type: "radio",
|
|
23
21
|
...props
|
|
24
22
|
})
|
|
25
23
|
});
|
|
26
|
-
|
|
27
24
|
/**
|
|
28
25
|
*
|
|
29
26
|
* @property {InputGroupText} Text
|
|
@@ -39,9 +36,10 @@ const InputGroup = /*#__PURE__*/React.forwardRef(({
|
|
|
39
36
|
as: Component = 'div',
|
|
40
37
|
...props
|
|
41
38
|
}, ref) => {
|
|
42
|
-
bsPrefix = useBootstrapPrefix(bsPrefix, 'input-group');
|
|
43
|
-
// exists under an input group.
|
|
39
|
+
bsPrefix = useBootstrapPrefix(bsPrefix, 'input-group');
|
|
44
40
|
|
|
41
|
+
// Intentionally an empty object. Used in detecting if a dropdown
|
|
42
|
+
// exists under an input group.
|
|
45
43
|
const contextValue = useMemo(() => ({}), []);
|
|
46
44
|
return /*#__PURE__*/_jsx(InputGroupContext.Provider, {
|
|
47
45
|
value: contextValue,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
export interface JumbotronProps extends BsPrefixProps {
|
|
3
|
+
fluid?: boolean;
|
|
4
|
+
}
|
|
5
|
+
declare type Jumbotron = BsPrefixRefForwardingComponent<'div', JumbotronProps>;
|
|
6
|
+
declare const Jumbotron: Jumbotron;
|
|
7
|
+
export default Jumbotron;
|
package/esm/ListGroup.js
CHANGED
|
@@ -21,11 +21,9 @@ const ListGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
21
21
|
});
|
|
22
22
|
const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'list-group');
|
|
23
23
|
let horizontalVariant;
|
|
24
|
-
|
|
25
24
|
if (horizontal) {
|
|
26
25
|
horizontalVariant = horizontal === true ? 'horizontal' : `horizontal-${horizontal}`;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
process.env.NODE_ENV !== "production" ? warning(!(horizontal && variant === 'flush'), '`variant="flush"` and `horizontal` should not be used together.') : void 0;
|
|
30
28
|
return /*#__PURE__*/_jsx(BaseNav, {
|
|
31
29
|
ref: ref,
|
package/esm/ListGroupItem.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import classNames from 'classnames';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import warning from 'warning';
|
|
3
4
|
import useEventCallback from '@restart/hooks/useEventCallback';
|
|
4
5
|
import { useNavItem } from '@restart/ui/NavItem';
|
|
5
6
|
import { makeEventKey } from '@restart/ui/SelectableContext';
|
|
@@ -28,17 +29,16 @@ const ListGroupItem = /*#__PURE__*/React.forwardRef(({
|
|
|
28
29
|
event.stopPropagation();
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
32
|
navItemProps.onClick(event);
|
|
33
33
|
});
|
|
34
|
-
|
|
35
34
|
if (disabled && props.tabIndex === undefined) {
|
|
36
35
|
props.tabIndex = -1;
|
|
37
36
|
props['aria-disabled'] = true;
|
|
38
|
-
}
|
|
39
|
-
|
|
37
|
+
}
|
|
40
38
|
|
|
39
|
+
// eslint-disable-next-line no-nested-ternary
|
|
41
40
|
const Component = as || (action ? props.href ? 'a' : 'button' : 'div');
|
|
41
|
+
process.env.NODE_ENV !== "production" ? warning(as || !(!action && props.href), '`action=false` and `href` should not be used together.') : void 0;
|
|
42
42
|
return /*#__PURE__*/_jsx(Component, {
|
|
43
43
|
ref: ref,
|
|
44
44
|
...props,
|
package/esm/Media.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
|
|
2
|
+
declare const MediaBody: BsPrefixRefForwardingComponent<"div", unknown>;
|
|
3
|
+
declare type MediaProps = BsPrefixProps;
|
|
4
|
+
declare type Media = BsPrefixRefForwardingComponent<'div', MediaProps> & {
|
|
5
|
+
Body: typeof MediaBody;
|
|
6
|
+
};
|
|
7
|
+
declare const Media: Media;
|
|
8
|
+
export default Media;
|
package/esm/Modal.js
CHANGED
|
@@ -32,22 +32,22 @@ const defaultProps = {
|
|
|
32
32
|
animation: true,
|
|
33
33
|
dialogAs: ModalDialog
|
|
34
34
|
};
|
|
35
|
-
/* eslint-disable no-use-before-define, react/no-multi-comp */
|
|
36
35
|
|
|
36
|
+
/* eslint-disable no-use-before-define, react/no-multi-comp */
|
|
37
37
|
function DialogTransition(props) {
|
|
38
|
-
return /*#__PURE__*/_jsx(Fade, {
|
|
38
|
+
return /*#__PURE__*/_jsx(Fade, {
|
|
39
|
+
...props,
|
|
39
40
|
timeout: null
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
|
|
43
43
|
function BackdropTransition(props) {
|
|
44
|
-
return /*#__PURE__*/_jsx(Fade, {
|
|
44
|
+
return /*#__PURE__*/_jsx(Fade, {
|
|
45
|
+
...props,
|
|
45
46
|
timeout: null
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
/* eslint-enable no-use-before-define */
|
|
49
|
-
|
|
50
49
|
|
|
50
|
+
/* eslint-enable no-use-before-define */
|
|
51
51
|
const Modal = /*#__PURE__*/React.forwardRef(({
|
|
52
52
|
bsPrefix,
|
|
53
53
|
className,
|
|
@@ -59,8 +59,8 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
59
59
|
'aria-labelledby': ariaLabelledby,
|
|
60
60
|
'aria-describedby': ariaDescribedby,
|
|
61
61
|
'aria-label': ariaLabel,
|
|
62
|
-
|
|
63
62
|
/* BaseModal props */
|
|
63
|
+
|
|
64
64
|
show,
|
|
65
65
|
animation,
|
|
66
66
|
backdrop,
|
|
@@ -96,14 +96,12 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
96
96
|
const modalContext = useMemo(() => ({
|
|
97
97
|
onHide: handleHide
|
|
98
98
|
}), [handleHide]);
|
|
99
|
-
|
|
100
99
|
function getModalManager() {
|
|
101
100
|
if (propsManager) return propsManager;
|
|
102
101
|
return getSharedManager({
|
|
103
102
|
isRTL
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
|
-
|
|
107
105
|
function updateDialogStyle(node) {
|
|
108
106
|
if (!canUseDOM) return;
|
|
109
107
|
const containerIsOverflowing = getModalManager().getScrollbarWidth() > 0;
|
|
@@ -113,7 +111,6 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
113
111
|
paddingLeft: !containerIsOverflowing && modalIsOverflowing ? getScrollbarSize() : undefined
|
|
114
112
|
});
|
|
115
113
|
}
|
|
116
|
-
|
|
117
114
|
const handleWindowResize = useEventCallback(() => {
|
|
118
115
|
if (modal) {
|
|
119
116
|
updateDialogStyle(modal.dialog);
|
|
@@ -122,117 +119,108 @@ const Modal = /*#__PURE__*/React.forwardRef(({
|
|
|
122
119
|
useWillUnmount(() => {
|
|
123
120
|
removeEventListener(window, 'resize', handleWindowResize);
|
|
124
121
|
removeStaticModalAnimationRef.current == null ? void 0 : removeStaticModalAnimationRef.current();
|
|
125
|
-
});
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// We prevent the modal from closing during a drag by detecting where the
|
|
126
125
|
// the click originates from. If it starts in the modal and then ends outside
|
|
127
126
|
// don't close.
|
|
128
|
-
|
|
129
127
|
const handleDialogMouseDown = () => {
|
|
130
128
|
waitingForMouseUpRef.current = true;
|
|
131
129
|
};
|
|
132
|
-
|
|
133
130
|
const handleMouseUp = e => {
|
|
134
131
|
if (waitingForMouseUpRef.current && modal && e.target === modal.dialog) {
|
|
135
132
|
ignoreBackdropClickRef.current = true;
|
|
136
133
|
}
|
|
137
|
-
|
|
138
134
|
waitingForMouseUpRef.current = false;
|
|
139
135
|
};
|
|
140
|
-
|
|
141
136
|
const handleStaticModalAnimation = () => {
|
|
142
137
|
setAnimateStaticModal(true);
|
|
143
138
|
removeStaticModalAnimationRef.current = transitionEnd(modal.dialog, () => {
|
|
144
139
|
setAnimateStaticModal(false);
|
|
145
140
|
});
|
|
146
141
|
};
|
|
147
|
-
|
|
148
142
|
const handleStaticBackdropClick = e => {
|
|
149
143
|
if (e.target !== e.currentTarget) {
|
|
150
144
|
return;
|
|
151
145
|
}
|
|
152
|
-
|
|
153
146
|
handleStaticModalAnimation();
|
|
154
147
|
};
|
|
155
|
-
|
|
156
148
|
const handleClick = e => {
|
|
157
149
|
if (backdrop === 'static') {
|
|
158
150
|
handleStaticBackdropClick(e);
|
|
159
151
|
return;
|
|
160
152
|
}
|
|
161
|
-
|
|
162
153
|
if (ignoreBackdropClickRef.current || e.target !== e.currentTarget) {
|
|
163
154
|
ignoreBackdropClickRef.current = false;
|
|
164
155
|
return;
|
|
165
156
|
}
|
|
166
|
-
|
|
167
157
|
onHide == null ? void 0 : onHide();
|
|
168
158
|
};
|
|
169
|
-
|
|
170
159
|
const handleEscapeKeyDown = e => {
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
160
|
+
if (keyboard) {
|
|
161
|
+
onEscapeKeyDown == null ? void 0 : onEscapeKeyDown(e);
|
|
162
|
+
} else {
|
|
163
|
+
// Call preventDefault to stop modal from closing in @restart/ui.
|
|
174
164
|
e.preventDefault();
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
165
|
+
if (backdrop === 'static') {
|
|
166
|
+
// Play static modal animation.
|
|
167
|
+
handleStaticModalAnimation();
|
|
168
|
+
}
|
|
178
169
|
}
|
|
179
170
|
};
|
|
180
|
-
|
|
181
171
|
const handleEnter = (node, isAppearing) => {
|
|
182
172
|
if (node) {
|
|
183
173
|
updateDialogStyle(node);
|
|
184
174
|
}
|
|
185
|
-
|
|
186
175
|
onEnter == null ? void 0 : onEnter(node, isAppearing);
|
|
187
176
|
};
|
|
188
|
-
|
|
189
177
|
const handleExit = node => {
|
|
190
178
|
removeStaticModalAnimationRef.current == null ? void 0 : removeStaticModalAnimationRef.current();
|
|
191
179
|
onExit == null ? void 0 : onExit(node);
|
|
192
180
|
};
|
|
193
|
-
|
|
194
181
|
const handleEntering = (node, isAppearing) => {
|
|
195
|
-
onEntering == null ? void 0 : onEntering(node, isAppearing);
|
|
182
|
+
onEntering == null ? void 0 : onEntering(node, isAppearing);
|
|
196
183
|
|
|
184
|
+
// FIXME: This should work even when animation is disabled.
|
|
197
185
|
addEventListener(window, 'resize', handleWindowResize);
|
|
198
186
|
};
|
|
199
|
-
|
|
200
187
|
const handleExited = node => {
|
|
201
188
|
if (node) node.style.display = ''; // RHL removes it sometimes
|
|
189
|
+
onExited == null ? void 0 : onExited(node);
|
|
202
190
|
|
|
203
|
-
|
|
204
|
-
|
|
191
|
+
// FIXME: This should work even when animation is disabled.
|
|
205
192
|
removeEventListener(window, 'resize', handleWindowResize);
|
|
206
193
|
};
|
|
207
|
-
|
|
208
|
-
|
|
194
|
+
const renderBackdrop = useCallback(backdropProps => /*#__PURE__*/_jsx("div", {
|
|
195
|
+
...backdropProps,
|
|
209
196
|
className: classNames(`${bsPrefix}-backdrop`, backdropClassName, !animation && 'show')
|
|
210
197
|
}), [animation, backdropClassName, bsPrefix]);
|
|
211
|
-
const baseModalStyle = {
|
|
198
|
+
const baseModalStyle = {
|
|
199
|
+
...style,
|
|
212
200
|
...modalStyle
|
|
213
|
-
};
|
|
214
|
-
// https://github.com/react-bootstrap/react-bootstrap/issues/5102
|
|
201
|
+
};
|
|
215
202
|
|
|
203
|
+
// If `display` is not set to block, autoFocus inside the modal fails
|
|
204
|
+
// https://github.com/react-bootstrap/react-bootstrap/issues/5102
|
|
216
205
|
baseModalStyle.display = 'block';
|
|
217
|
-
|
|
218
206
|
const renderDialog = dialogProps => /*#__PURE__*/_jsx("div", {
|
|
219
207
|
role: "dialog",
|
|
220
208
|
...dialogProps,
|
|
221
209
|
style: baseModalStyle,
|
|
222
|
-
className: classNames(className, bsPrefix, animateStaticModal && `${bsPrefix}-static
|
|
210
|
+
className: classNames(className, bsPrefix, animateStaticModal && `${bsPrefix}-static`, !animation && 'show'),
|
|
223
211
|
onClick: backdrop ? handleClick : undefined,
|
|
224
212
|
onMouseUp: handleMouseUp,
|
|
225
213
|
"aria-label": ariaLabel,
|
|
226
214
|
"aria-labelledby": ariaLabelledby,
|
|
227
215
|
"aria-describedby": ariaDescribedby,
|
|
228
|
-
children: /*#__PURE__*/_jsx(Dialog, {
|
|
216
|
+
children: /*#__PURE__*/_jsx(Dialog, {
|
|
217
|
+
...props,
|
|
229
218
|
onMouseDown: handleDialogMouseDown,
|
|
230
219
|
className: dialogClassName,
|
|
231
220
|
contentClassName: contentClassName,
|
|
232
221
|
children: children
|
|
233
222
|
})
|
|
234
223
|
});
|
|
235
|
-
|
|
236
224
|
return /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
237
225
|
value: modalContext,
|
|
238
226
|
children: /*#__PURE__*/_jsx(BaseModal, {
|
package/esm/ModalContext.js
CHANGED
package/esm/ModalDialog.js
CHANGED
|
@@ -16,7 +16,8 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(({
|
|
|
16
16
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'modal');
|
|
17
17
|
const dialogClass = `${bsPrefix}-dialog`;
|
|
18
18
|
const fullScreenClass = typeof fullscreen === 'string' ? `${bsPrefix}-fullscreen-${fullscreen}` : `${bsPrefix}-fullscreen`;
|
|
19
|
-
return /*#__PURE__*/_jsx("div", {
|
|
19
|
+
return /*#__PURE__*/_jsx("div", {
|
|
20
|
+
...props,
|
|
20
21
|
ref: ref,
|
|
21
22
|
className: classNames(dialogClass, className, size && `${bsPrefix}-${size}`, centered && `${dialogClass}-centered`, scrollable && `${dialogClass}-scrollable`, fullscreen && fullScreenClass),
|
|
22
23
|
children: /*#__PURE__*/_jsx("div", {
|
package/esm/Nav.js
CHANGED
|
@@ -35,7 +35,6 @@ const Nav = /*#__PURE__*/React.forwardRef((uncontrolledProps, ref) => {
|
|
|
35
35
|
let isNavbar = false;
|
|
36
36
|
const navbarContext = useContext(NavbarContext);
|
|
37
37
|
const cardHeaderContext = useContext(CardHeaderContext);
|
|
38
|
-
|
|
39
38
|
if (navbarContext) {
|
|
40
39
|
navbarBsPrefix = navbarContext.bsPrefix;
|
|
41
40
|
isNavbar = navbar == null ? true : navbar;
|
|
@@ -44,7 +43,6 @@ const Nav = /*#__PURE__*/React.forwardRef((uncontrolledProps, ref) => {
|
|
|
44
43
|
cardHeaderBsPrefix
|
|
45
44
|
} = cardHeaderContext);
|
|
46
45
|
}
|
|
47
|
-
|
|
48
46
|
return /*#__PURE__*/_jsx(BaseNav, {
|
|
49
47
|
as: as,
|
|
50
48
|
ref: ref,
|
package/esm/NavLink.js
CHANGED
|
@@ -22,7 +22,8 @@ const NavLink = /*#__PURE__*/React.forwardRef(({
|
|
|
22
22
|
active,
|
|
23
23
|
...props
|
|
24
24
|
});
|
|
25
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
25
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
26
|
+
...props,
|
|
26
27
|
...navItemProps,
|
|
27
28
|
ref: ref,
|
|
28
29
|
className: classNames(className, bsPrefix, props.disabled && 'disabled', meta.isActive && 'active')
|
package/esm/Navbar.js
CHANGED
|
@@ -41,18 +41,17 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
41
41
|
const bsPrefix = useBootstrapPrefix(initialBsPrefix, 'navbar');
|
|
42
42
|
const handleCollapse = useCallback((...args) => {
|
|
43
43
|
onSelect == null ? void 0 : onSelect(...args);
|
|
44
|
-
|
|
45
44
|
if (collapseOnSelect && expanded) {
|
|
46
45
|
onToggle == null ? void 0 : onToggle(false);
|
|
47
46
|
}
|
|
48
|
-
}, [onSelect, collapseOnSelect, expanded, onToggle]);
|
|
47
|
+
}, [onSelect, collapseOnSelect, expanded, onToggle]);
|
|
48
|
+
|
|
49
|
+
// will result in some false positives but that seems better
|
|
49
50
|
// than false negatives. strict `undefined` check allows explicit
|
|
50
51
|
// "nulling" of the role if the user really doesn't want one
|
|
51
|
-
|
|
52
52
|
if (controlledProps.role === undefined && Component !== 'nav') {
|
|
53
53
|
controlledProps.role = 'navigation';
|
|
54
54
|
}
|
|
55
|
-
|
|
56
55
|
let expandClass = `${bsPrefix}-expand`;
|
|
57
56
|
if (typeof expand === 'string') expandClass = `${expandClass}-${expand}`;
|
|
58
57
|
const navbarContext = useMemo(() => ({
|
package/esm/NavbarBrand.js
CHANGED
|
@@ -10,7 +10,8 @@ const NavbarBrand = /*#__PURE__*/React.forwardRef(({
|
|
|
10
10
|
}, ref) => {
|
|
11
11
|
bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-brand');
|
|
12
12
|
const Component = as || (props.href ? 'a' : 'span');
|
|
13
|
-
return /*#__PURE__*/_jsx(Component, {
|
|
13
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
14
|
+
...props,
|
|
14
15
|
ref: ref,
|
|
15
16
|
className: classNames(className, bsPrefix)
|
|
16
17
|
});
|
package/esm/NavbarContext.js
CHANGED
package/esm/NavbarOffcanvas.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { OffcanvasProps } from './Offcanvas';
|
|
3
|
-
export
|
|
3
|
+
export type NavbarOffcanvasProps = Omit<OffcanvasProps, 'show'>;
|
|
4
4
|
declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Pick<NavbarOffcanvasProps, keyof OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default NavbarOffcanvas;
|
package/esm/NavbarToggle.js
CHANGED
|
@@ -27,12 +27,11 @@ const NavbarToggle = /*#__PURE__*/React.forwardRef(({
|
|
|
27
27
|
if (onClick) onClick(e);
|
|
28
28
|
if (onToggle) onToggle();
|
|
29
29
|
});
|
|
30
|
-
|
|
31
30
|
if (Component === 'button') {
|
|
32
31
|
props.type = 'button';
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
34
|
+
...props,
|
|
36
35
|
ref: ref,
|
|
37
36
|
onClick: handleClick,
|
|
38
37
|
"aria-label": label,
|
package/esm/Offcanvas.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ModalProps as BaseModalProps } from '@restart/ui/Modal';
|
|
3
3
|
import { BsPrefixRefForwardingComponent } from './helpers';
|
|
4
|
-
export
|
|
4
|
+
export type OffcanvasPlacement = 'start' | 'end' | 'top' | 'bottom';
|
|
5
5
|
export interface OffcanvasProps extends Omit<BaseModalProps, 'role' | 'renderBackdrop' | 'renderDialog' | 'transition' | 'backdrop' | 'backdropTransition'> {
|
|
6
6
|
bsPrefix?: string;
|
|
7
7
|
backdropClassName?: string;
|
package/esm/Offcanvas.js
CHANGED
|
@@ -27,17 +27,16 @@ const defaultProps = {
|
|
|
27
27
|
placement: 'start',
|
|
28
28
|
renderStaticNode: false
|
|
29
29
|
};
|
|
30
|
-
|
|
31
30
|
function DialogTransition(props) {
|
|
32
|
-
return /*#__PURE__*/_jsx(OffcanvasToggling, {
|
|
31
|
+
return /*#__PURE__*/_jsx(OffcanvasToggling, {
|
|
32
|
+
...props
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
|
|
36
35
|
function BackdropTransition(props) {
|
|
37
|
-
return /*#__PURE__*/_jsx(Fade, {
|
|
36
|
+
return /*#__PURE__*/_jsx(Fade, {
|
|
37
|
+
...props
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
|
|
41
40
|
const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
42
41
|
bsPrefix,
|
|
43
42
|
className,
|
|
@@ -45,8 +44,8 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
45
44
|
'aria-labelledby': ariaLabelledby,
|
|
46
45
|
placement,
|
|
47
46
|
responsive,
|
|
48
|
-
|
|
49
47
|
/* BaseModal props */
|
|
48
|
+
|
|
50
49
|
show,
|
|
51
50
|
backdrop,
|
|
52
51
|
keyboard,
|
|
@@ -89,10 +88,8 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
89
88
|
const modalContext = useMemo(() => ({
|
|
90
89
|
onHide: handleHide
|
|
91
90
|
}), [handleHide]);
|
|
92
|
-
|
|
93
91
|
function getModalManager() {
|
|
94
92
|
if (propsManager) return propsManager;
|
|
95
|
-
|
|
96
93
|
if (scroll) {
|
|
97
94
|
// Have to use a different modal manager since the shared
|
|
98
95
|
// one handles overflow.
|
|
@@ -101,31 +98,27 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
|
|
|
101
98
|
});
|
|
102
99
|
return modalManager.current;
|
|
103
100
|
}
|
|
104
|
-
|
|
105
101
|
return getSharedManager();
|
|
106
102
|
}
|
|
107
|
-
|
|
108
103
|
const handleEnter = (node, ...args) => {
|
|
109
104
|
if (node) node.style.visibility = 'visible';
|
|
110
105
|
onEnter == null ? void 0 : onEnter(node, ...args);
|
|
111
106
|
};
|
|
112
|
-
|
|
113
107
|
const handleExited = (node, ...args) => {
|
|
114
108
|
if (node) node.style.visibility = '';
|
|
115
109
|
onExited == null ? void 0 : onExited(...args);
|
|
116
110
|
};
|
|
117
|
-
|
|
118
|
-
|
|
111
|
+
const renderBackdrop = useCallback(backdropProps => /*#__PURE__*/_jsx("div", {
|
|
112
|
+
...backdropProps,
|
|
119
113
|
className: classNames(`${bsPrefix}-backdrop`, backdropClassName)
|
|
120
114
|
}), [backdropClassName, bsPrefix]);
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
const renderDialog = dialogProps => /*#__PURE__*/_jsx("div", {
|
|
116
|
+
...dialogProps,
|
|
123
117
|
...props,
|
|
124
118
|
className: classNames(className, responsive ? `${bsPrefix}-${responsive}` : bsPrefix, `${bsPrefix}-${placement}`),
|
|
125
119
|
"aria-labelledby": ariaLabelledby,
|
|
126
120
|
children: children
|
|
127
121
|
});
|
|
128
|
-
|
|
129
122
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
130
123
|
children: [!showOffcanvas && (responsive || renderStaticNode) && renderDialog({}), /*#__PURE__*/_jsx(ModalContext.Provider, {
|
|
131
124
|
value: modalContext,
|
package/esm/OffcanvasToggling.js
CHANGED
|
@@ -27,7 +27,8 @@ const OffcanvasToggling = /*#__PURE__*/React.forwardRef(({
|
|
|
27
27
|
addEndListener: transitionEndListener,
|
|
28
28
|
...props,
|
|
29
29
|
childRef: children.ref,
|
|
30
|
-
children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
|
|
30
|
+
children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
|
|
31
|
+
...innerProps,
|
|
31
32
|
className: classNames(className, children.props.className, (status === ENTERING || status === EXITING) && `${bsPrefix}-toggling`, transitionStyles[status])
|
|
32
33
|
})
|
|
33
34
|
});
|
package/esm/Overlay.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface OverlayInjectedProps {
|
|
|
12
12
|
popper: PopperRef;
|
|
13
13
|
[prop: string]: any;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type OverlayChildren = React.ReactElement<OverlayInjectedProps> | ((injected: OverlayInjectedProps) => React.ReactNode);
|
|
16
16
|
export interface OverlayProps extends Omit<BaseOverlayProps, 'children' | 'transition' | 'rootCloseEvent'> {
|
|
17
17
|
children: OverlayChildren;
|
|
18
18
|
transition?: TransitionType;
|
package/esm/Overlay.js
CHANGED
|
@@ -16,7 +16,6 @@ const defaultProps = {
|
|
|
16
16
|
show: false,
|
|
17
17
|
placement: 'top'
|
|
18
18
|
};
|
|
19
|
-
|
|
20
19
|
function wrapRefs(props, arrowProps) {
|
|
21
20
|
const {
|
|
22
21
|
ref
|
|
@@ -24,12 +23,9 @@ function wrapRefs(props, arrowProps) {
|
|
|
24
23
|
const {
|
|
25
24
|
ref: aRef
|
|
26
25
|
} = arrowProps;
|
|
27
|
-
|
|
28
26
|
props.ref = ref.__wrapped || (ref.__wrapped = r => ref(safeFindDOMNode(r)));
|
|
29
|
-
|
|
30
27
|
arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = r => aRef(safeFindDOMNode(r)));
|
|
31
28
|
}
|
|
32
|
-
|
|
33
29
|
const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
34
30
|
children: overlay,
|
|
35
31
|
transition,
|
|
@@ -50,9 +46,11 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
50
46
|
popperRef.current.scheduleUpdate == null ? void 0 : popperRef.current.scheduleUpdate();
|
|
51
47
|
}
|
|
52
48
|
}, [firstRenderedState]);
|
|
53
|
-
return /*#__PURE__*/_jsx(BaseOverlay, {
|
|
49
|
+
return /*#__PURE__*/_jsx(BaseOverlay, {
|
|
50
|
+
...outerProps,
|
|
54
51
|
ref: mergedRef,
|
|
55
|
-
popperConfig: {
|
|
52
|
+
popperConfig: {
|
|
53
|
+
...popperConfig,
|
|
56
54
|
modifiers: modifiers.concat(popperConfig.modifiers || []),
|
|
57
55
|
onFirstUpdate: handleFirstUpdate
|
|
58
56
|
},
|
|
@@ -63,9 +61,8 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
63
61
|
show
|
|
64
62
|
}) => {
|
|
65
63
|
var _popperObj$state, _popperObj$state$modi;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
wrapRefs(overlayProps, arrowProps);
|
|
65
|
+
// Need to get placement from popper object, handling case when overlay is flipped using 'flip' prop
|
|
69
66
|
const updatedPlacement = popperObj == null ? void 0 : popperObj.placement;
|
|
70
67
|
const popper = Object.assign(popperRef.current, {
|
|
71
68
|
state: popperObj == null ? void 0 : popperObj.state,
|
|
@@ -73,7 +70,8 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
73
70
|
placement: updatedPlacement,
|
|
74
71
|
outOfBoundaries: (popperObj == null ? void 0 : (_popperObj$state = popperObj.state) == null ? void 0 : (_popperObj$state$modi = _popperObj$state.modifiersData.hide) == null ? void 0 : _popperObj$state$modi.isReferenceHidden) || false
|
|
75
72
|
});
|
|
76
|
-
if (typeof overlay === 'function') return overlay({
|
|
73
|
+
if (typeof overlay === 'function') return overlay({
|
|
74
|
+
...overlayProps,
|
|
77
75
|
placement: updatedPlacement,
|
|
78
76
|
show,
|
|
79
77
|
...(!transition && show && {
|
|
@@ -82,12 +80,14 @@ const Overlay = /*#__PURE__*/React.forwardRef(({
|
|
|
82
80
|
popper,
|
|
83
81
|
arrowProps
|
|
84
82
|
});
|
|
85
|
-
return /*#__PURE__*/React.cloneElement(overlay, {
|
|
83
|
+
return /*#__PURE__*/React.cloneElement(overlay, {
|
|
84
|
+
...overlayProps,
|
|
86
85
|
placement: updatedPlacement,
|
|
87
86
|
arrowProps,
|
|
88
87
|
popper,
|
|
89
88
|
className: classNames(overlay.props.className, !transition && show && 'show'),
|
|
90
|
-
style: {
|
|
89
|
+
style: {
|
|
90
|
+
...overlay.props.style,
|
|
91
91
|
...overlayProps.style
|
|
92
92
|
}
|
|
93
93
|
});
|